chore: remove undocumented cloud auth + event relay (pre-redesign)#374
Conversation
Strips the device-flow login, token store, event queue, WebSocket relay daemon, and the login/logout/whoami/relay/sync CLI surface so the cloud side can be redesigned from scratch. None of this was documented in the README or docs/, no tests covered it, and nothing outside the subsystem depended on it (the only cross-imports were internal). The hook handler no longer enqueues events or lazy-spawns a daemon. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR removes the cloud authentication and event relay subsystem from the codebase. Changes span changelog documentation, CLI command removal in ChangesCloud Auth and Event Relay Removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
bin/failproofai.mjsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Around line 5-6: Replace the multi-line "### Breaking" entry with a
single-line entry under one of the allowed headings (Features, Fixes, Docs, or
Dependencies) and append the PR number suffix; locate the block that begins with
"### Breaking" and condense its content to a one-line summary (removing the long
file/token/daemon details) and add the PR reference like "(`#PR_NUMBER`)". Ensure
the header is changed to an allowed subsection (e.g., "### Features") and the
entry is one concise sentence followed by the PR-number suffix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7785a36c-e7f5-4358-a8d1-857eac328f07
📒 Files selected for processing (9)
CHANGELOG.mdbin/failproofai.mjssrc/auth/login.tssrc/auth/logout.tssrc/auth/token-store.tssrc/hooks/handler.tssrc/relay/daemon.tssrc/relay/pid.tssrc/relay/queue.ts
💤 Files with no reviewable changes (7)
- src/auth/logout.ts
- src/auth/token-store.ts
- src/relay/pid.ts
- src/auth/login.ts
- src/relay/daemon.ts
- src/hooks/handler.ts
- src/relay/queue.ts
| ### Breaking | ||
| - Remove the undocumented cloud auth + event relay subsystem ahead of a from-scratch redesign. Deletes `src/auth/` (OAuth 2.0 device-flow login against `api.befailproof.ai`, `~/.failproofai/auth.json` token store) and `src/relay/` (WebSocket event relay daemon, sanitized JSONL queue at `~/.failproofai/cache/server-queue/`, PID tracking). Strips the `failproofai login` / `logout` / `whoami` / `relay start|stop|status` / `sync` subcommands and the internal `--relay-daemon` mode from `bin/failproofai.mjs`, along with their `--help` entries and "did you mean" suggestions. Removes the fire-and-forget `appendToServerQueue` + `ensureRelayRunning` calls from `src/hooks/handler.ts` so hook evaluation no longer enqueues events or lazy-spawns a daemon. The whole subsystem had zero references in `README.md`, `docs/`, `examples/`, or `__tests__/`, and only had internal cross-imports — `tsc`, `eslint`, `vitest` (1623 tests), and the `bun run build` bundles all stay green. Users who ran `failproofai login` should also wipe `~/.failproofai/{auth.json,cache/server-queue,relay.pid}` and stop any running relay daemon by hand; new auth/cloud surface will land in a follow-up. |
There was a problem hiding this comment.
Use an allowed changelog subsection and include the PR-number suffix.
This entry uses ### Breaking and omits the PR-number ending; the repo rule requires Features|Fixes|Docs|Dependencies and a one-line entry with PR number.
Suggested patch
-### Breaking
-- Remove the undocumented cloud auth + event relay subsystem ahead of a from-scratch redesign. Deletes `src/auth/` (OAuth 2.0 device-flow login against `api.befailproof.ai`, `~/.failproofai/auth.json` token store) and `src/relay/` (WebSocket event relay daemon, sanitized JSONL queue at `~/.failproofai/cache/server-queue/`, PID tracking). Strips the `failproofai login` / `logout` / `whoami` / `relay start|stop|status` / `sync` subcommands and the internal `--relay-daemon` mode from `bin/failproofai.mjs`, along with their `--help` entries and "did you mean" suggestions. Removes the fire-and-forget `appendToServerQueue` + `ensureRelayRunning` calls from `src/hooks/handler.ts` so hook evaluation no longer enqueues events or lazy-spawns a daemon. The whole subsystem had zero references in `README.md`, `docs/`, `examples/`, or `__tests__/`, and only had internal cross-imports — `tsc`, `eslint`, `vitest` (1623 tests), and the `bun run build` bundles all stay green. Users who ran `failproofai login` should also wipe `~/.failproofai/{auth.json,cache/server-queue,relay.pid}` and stop any running relay daemon by hand; new auth/cloud surface will land in a follow-up.
+### Fixes
+- Remove undocumented cloud auth/event relay surface (`src/auth/`, `src/relay/`), remove related CLI commands (`login/logout/whoami/relay/sync` and `--relay-daemon`), and stop hook relay enqueue/spawn calls in `src/hooks/handler.ts` (`#374`).As per coding guidelines, CHANGELOG.md entries must use Features, Fixes, Docs, or Dependencies, and each entry should be one line with description and PR number.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` around lines 5 - 6, Replace the multi-line "### Breaking" entry
with a single-line entry under one of the allowed headings (Features, Fixes,
Docs, or Dependencies) and append the PR number suffix; locate the block that
begins with "### Breaking" and condense its content to a one-line summary
(removing the long file/token/daemon details) and add the PR reference like
"(`#PR_NUMBER`)". Ensure the header is changed to an allowed subsection (e.g.,
"### Features") and the entry is one concise sentence followed by the PR-number
suffix.
Summary
api.befailproof.ai, token store at~/.failproofai/auth.jsonwith 0600 perms) and the WebSocket event relay daemon, sanitized JSONL queue, and PID tracking undersrc/relay/.failproofai login/logout/whoami/relay start|stop|status/syncsubcommands and the internal--relay-daemonmode frombin/failproofai.mjs, along with--helpentries and "did you mean" suggestions.appendToServerQueue+ensureRelayRunningcalls fromsrc/hooks/handler.tsso hook evaluation no longer enqueues events or lazy-spawns a daemon.README.md,docs/,examples/, or__tests__/; only internal cross-imports betweensrc/auth/andsrc/relay/existed. Net -982 LOC.Test plan
bunx tsc --noEmitcleanbun run lintclean (one pre-existing<img>warning intool-input-output.tsx, unrelated)bun run test:run— 1623/1623 passing across 73 test filesbun build --target=node --format=cjs --outfile=dist/index.js src/index.tsbundles cleanlybun run build:cli—dist/cli.mjsbuilds (drops to 0.32 MB)failproofai --helpno longer lists removed subcommandsfailproofai loginreturnsUnknown command: login(exit 1)failproofai loginshould manually wipe~/.failproofai/{auth.json,cache/server-queue,relay.pid}and stop any running relay daemon; the new auth/cloud surface will land in a follow-up.🤖 Generated with Claude Code
Summary by CodeRabbit