Audit remediation: security, correctness, billing, UX (Phases 0–5) - #4
Merged
Merged
Conversation
Captures the full fix plan from the security/code-quality/UX audit: Phase 0 security hardening, Phase 1 packages/llm-core extraction, Phase 2 streaming/routing correctness, Phase 3 billing accounting, Phase 4 cheap-high-value UX, Phase 5 large product items. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
12 bite-sized TDD tasks covering C1 loopback bind, C2a/b/c token hygiene, C3 timing-safe compare, H2 SSRF allowlist, H3 CORS, H4 entitlements, M4 AES-256-GCM at-rest encryption for provider keys (both gateways) + keychain-provisioned ROUTEBOX_DB_KEY. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… + regression tests (H2-sec)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sec) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rod (M4-sec) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cryption (M4-sec)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Share types + pricing algorithm + alias resolver; each app keeps its own registry list and pricing table (data is legitimately divergent, not drift). Zero behavior change. Adapter/SSE unification deferred to Phase 2 where they're fixed with tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…est accessor verifyToken reads ROUTEBOX_TOKEN at call time so sibling test files can't leak a stale token across the shared module singleton; db.ts gains a test-only __rawProviderKeyForTest so encryption assertions read the real DB singleton regardless of import order. Full gateway suite now passes 63/0 (was order-dependent).
…avior change) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
H1 fallback-route bug (catch-retry records wrong provider), M4 (4xx fallback returned as 200), H3 (provider never recovers after 3-strike down). TDD where cleanly testable; H3 via pure computeProviderUp helper to avoid mutating the shared metrics singleton. Streaming robustness (H2/H4/M8 + SSE extraction) deferred to Phase 2b. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(H3) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…or (M4) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…er is recorded (H1) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
H1 wrong-tab onboarding/settings copy + real navigation, H2 two-step delete confirm + visible errors, H5 tappable gateway-failed banner, M5 pause balance polling while panel hidden, M6 provider startup retry, L6 web-search save error surface, L4 activity search by provider/status. Frontend-only, low-risk. M7 (pricing) dropped pending a price decision. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ix pre-existing red suite)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… search by provider/status (M6/L6/L4-ux)
… after giving up (M6-ux)
…elf (H3-ux) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tate (tray-ux) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…hable (C1 docker regression)
…mages Phase 1 made both gateways import @routebox/llm-core via tsconfig paths, but the images were built with context=apps/<x>, so packages/llm-core was absent and the import crashed at runtime (gateway smoke test caught it; cloud's lenient '|| true' smoke masked the same break). Gateway now bundles to a self-contained file (like the desktop ships); cloud preserves the monorepo layout + copies packages/. Workflows build with context=root.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remediates findings from a three-dimension audit (security / code-quality / UX), executed in six phases. Each phase went plan → implementation → independent review; plans live in
docs/superpowers/plans/, specs indocs/superpowers/specs/.Phase 0 — Security hardening
127.0.0.1(was0.0.0.0, LAN-exposed) (C1)*for no-origin requests (H3-sec)Phase 1 —
packages/llm-coreShared mechanism (types, pricing algorithm, alias resolver) extracted; each app keeps its own registry/pricing data (legitimately divergent). Zero behavior change, verified line-by-line.
Phase 2 — Streaming & routing correctness
Phase 3 — Cloud accounting correctness
Phase 4 — UX
Onboarding/Settings point to the correct Account tab and navigate (H1); two-step delete confirm + visible errors (H2); tappable gateway-failed banner (H5); balance polling pauses when panel hidden (M5); bounded provider startup retry (M6); web-search save error surfaced (L6); Activity search by provider/status (L4).
Phase 5 — Product items
Landing Pro/Max CTAs point to
#download(were looping to self) (H3-ux); admin panel mobile-responsive + dead duplicate removed (M2-ux); tray status tooltip + Start/Stop/Copy-Endpoint menu driven by gateway state.Verification
bun test68/0. Desktop:tsc --noEmitclean,vitest30/30. llm-core: 12/12.cargo. Runcd apps/desktop/src-tauri && cargo checkandcd apps/desktop && pnpm tauri devto confirm the tray end-to-end.apps/cloud-gateway/node_moduleswas removed during development to free disk; runpnpm installto restore cloud-gateway tests.🤖 Generated with Claude Code