Skip to content

chore: remove undocumented cloud auth + event relay (pre-redesign)#374

Merged
NiveditJain merged 2 commits into
mainfrom
luv-376
May 22, 2026
Merged

chore: remove undocumented cloud auth + event relay (pre-redesign)#374
NiveditJain merged 2 commits into
mainfrom
luv-376

Conversation

@NiveditJain
Copy link
Copy Markdown
Member

@NiveditJain NiveditJain commented May 22, 2026

Summary

  • Removes the never-documented cloud auth subsystem (OAuth 2.0 device flow against api.befailproof.ai, token store at ~/.failproofai/auth.json with 0600 perms) and the WebSocket event relay daemon, sanitized JSONL queue, and PID tracking under src/relay/.
  • Strips the failproofai login / logout / whoami / relay start|stop|status / sync subcommands and the internal --relay-daemon mode from bin/failproofai.mjs, along with --help entries and "did you mean" suggestions.
  • Drops the fire-and-forget appendToServerQueue + ensureRelayRunning calls from src/hooks/handler.ts so hook evaluation no longer enqueues events or lazy-spawns a daemon.
  • Clears the runway for a from-scratch cloud-auth redesign. The removed code had zero references in README.md, docs/, examples/, or __tests__/; only internal cross-imports between src/auth/ and src/relay/ existed. Net -982 LOC.

Test plan

  • bunx tsc --noEmit clean
  • bun run lint clean (one pre-existing <img> warning in tool-input-output.tsx, unrelated)
  • bun run test:run — 1623/1623 passing across 73 test files
  • bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts bundles cleanly
  • bun run build:clidist/cli.mjs builds (drops to 0.32 MB)
  • failproofai --help no longer lists removed subcommands
  • failproofai login returns Unknown command: login (exit 1)
  • Users who ran failproofai login should 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

  • Breaking
    • Removed cloud authentication system including login, logout, and user identity features
    • Removed cloud event relay and synchronization subsystem
    • Removed associated CLI subcommands and daemon functionality
    • Users must clear locally stored authentication and relay configuration data

Review Change Stack

NiveditJain and others added 2 commits May 21, 2026 17:13
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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

This PR removes the cloud authentication and event relay subsystem from the codebase. Changes span changelog documentation, CLI command removal in bin/failproofai.mjs, and integration cleanup in hook event handling. No user-facing additions or modifications are present; this is purely a feature removal.

Changes

Cloud Auth and Event Relay Removal

Layer / File(s) Summary
Changelog documentation of removal
CHANGELOG.md
Version 0.0.11-beta.2 entry documents the breaking deletion of src/auth/ and src/relay/ directories, removal of login/logout/whoami/relay/sync subcommands, removal of --relay-daemon mode, and removal of relay queue/daemon spawning from hook event handling.
CLI subcommand removal and help text consolidation
bin/failproofai.mjs
The runCli() function's SUBCOMMANDS whitelist is narrowed to only policies; help text is updated to remove documentation of deleted commands; inline dispatch branches for login, logout, whoami, relay, and sync are removed; and the Levenshtein suggestion candidate list (primary) is reduced to match the narrowed command set.
Hook handler integration cleanup
src/hooks/handler.ts
handleHookEvent no longer calls appendToServerQueue() or ensureRelayRunning() after persisting hook activity; the function proceeds directly to PostHog telemetry, removing all relay integration from the hook event pipeline.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 The relay hops away, no more to roam,
Auth doors close gently, hooks find home,
Simpler paths now guide the way,
One subsystem less to manage each day. 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removal of undocumented cloud auth and event relay subsystems before a redesign.
Description check ✅ Passed The description includes a detailed Summary section and Test plan checklist with passing results, though the required Type of Change and Checklist sections from the template are not present.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

bin/failproofai.mjs

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b0f98bb and 4421e6d.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • bin/failproofai.mjs
  • src/auth/login.ts
  • src/auth/logout.ts
  • src/auth/token-store.ts
  • src/hooks/handler.ts
  • src/relay/daemon.ts
  • src/relay/pid.ts
  • src/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

Comment thread CHANGELOG.md
Comment on lines +5 to +6
### 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

@NiveditJain NiveditJain merged commit ef306f0 into main May 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant