mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-30 19:49:14 +00:00
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.
This commit is contained in:
+1
-1
@@ -2289,7 +2289,7 @@ IMPORT/EXPORT
|
||||
import <dir> [--no-embed] Import markdown directory
|
||||
sync [--repo <path>] [flags] Git-to-brain incremental sync
|
||||
sync --watch [--interval N] Continuous sync (loops until stopped)
|
||||
sync --install-cron Install persistent sync daemon
|
||||
See also: autopilot --install (continuous daemon).
|
||||
export [--dir ./out/] Export to markdown
|
||||
export --restore-only [--repo <p>] Restore missing supabase-only files
|
||||
[--type T] [--slug-prefix S] With optional filters
|
||||
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user