From 9f7244a77f1fa25bda2a4482b977ceed6d5b267e Mon Sep 17 00:00:00 2001 From: Masa <98894508+Masashi-Ono0611@users.noreply.github.com> Date: Tue, 21 Jul 2026 06:27:50 +0900 Subject: [PATCH] =?UTF-8?q?fix(cli):=20remove=20sync=20--install-cron=20he?= =?UTF-8?q?lp=20text=20=E2=80=94=20no=20handler=20ever=20existed=20(#2795)?= =?UTF-8?q?=20(#2972)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The top-level `gbrain --help` advertised `sync --install-cron` since the line was first added, but `src/commands/sync.ts` never parsed or handled the flag — `gbrain sync --install-cron` silently ran an ordinary one-off sync instead of installing anything, manufacturing false confidence in the exact durability layer operators reach for it to secure. git blame shows the line was introduced once (v0.42.29.0 help-text scaffold) and never touched again — no design intent to recover. Implementing it would also compete with autopilot, which already owns this job: `gbrain autopilot --install` runs a self-maintaining daemon (sync+extract+embed) on a schedule, including a per-source freshness check that submits `sync` jobs on its own interval. A second, separate sync-only cron would be a competing scheduler outside the D10 cycle-lock invariant that already keeps autopilot's own targeted-submit and full-cycle paths from double-processing. Removed the misleading line and pointed sync's --watch entry at `autopilot --install`, mirroring the existing `dream` command's "See also: autopilot --install (continuous daemon)." pattern one section below. Added regression coverage to test/cli-help-discoverability.test.ts asserting the help text no longer promises install-cron and does point at autopilot. --- src/cli.ts | 2 +- test/cli-help-discoverability.test.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index 154f449b1..a23881671 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -2289,7 +2289,7 @@ IMPORT/EXPORT import
] Restore missing supabase-only files [--type T] [--slug-prefix S] With optional filters diff --git a/test/cli-help-discoverability.test.ts b/test/cli-help-discoverability.test.ts index 451c5821b..3a00b39d6 100644 --- a/test/cli-help-discoverability.test.ts +++ b/test/cli-help-discoverability.test.ts @@ -98,6 +98,33 @@ describe('WARN-6 — main `gbrain --help` lists capture/brainstorm/lsd', () => { }); }); +describe('#2795 — `sync --install-cron` help line no longer promises an unbuilt feature', () => { + test('main `gbrain --help` does not advertise install-cron', () => { + // Pre-fix: `sync --install-cron Install persistent sync daemon` was + // listed in the top-level help with no flag parsing or handler behind + // it anywhere in src/commands/sync.ts — `gbrain sync --install-cron` + // silently ran an ordinary sync instead of installing anything. + const { stdout, status } = runCli(['--help']); + expect(status).toBe(0); + expect(stdout).not.toContain('install-cron'); + expect(stdout).not.toContain('Install persistent sync daemon'); + }); + + test('main `gbrain --help` points sync users at the real continuous-daemon command', () => { + const { stdout } = runCli(['--help']); + // autopilot --install already runs sync+extract+embed on a schedule + // (docs/architecture/KEY_FILES.md); point discoverability there instead + // of promising a separate sync-only cron installer that never existed. + expect(stdout).toMatch(/sync --watch \[--interval N\][^\n]*\n\s*See also: autopilot --install/); + }); + + test('`gbrain sync --help` never listed install-cron either', () => { + const { stdout, status } = runCli(['sync', '--help']); + expect(status).toBe(0); + expect(stdout).not.toContain('install-cron'); + }); +}); + describe('#1175 — main `gbrain --help` SOURCES block matches the real subcommand set', () => { test('archive and its lifecycle siblings are listed', () => { const { stdout, status } = runCli(['--help']);