Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: pre-landing review fixes, cycle 2 (#7630)

garrytan92abed469816
diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.md
index 500a51df08..8095c94cb3 100644
--- a/docs/guides/troubleshooting.md
+++ b/docs/guides/troubleshooting.md
@@ -835,7 +835,8 @@ folder treated that folder as the brain repo: it ran `git init`, committed
everything in it and imported its markdown. Sync now refuses
`sync_anchor_relative` (exit 3) before any Git probe, cost estimate or import,
and nothing is changed. Doctor's `default_source_local_path` check warns on
-every source with a relative path.
+every source with a relative path, and on a relative `sync.repo_path` behind a
+default source with no path.
Ask the user which directory holds the source, then do one of:
@@ -853,12 +854,16 @@ the database (`repo_not_found`, `no_repo_configured`), a captured file keeps
no origin path, matching a folder to its source ignores the path, fence repair
edits stored pages, managed activation refuses it (`source_changed`, detail
`source_path_missing`), the dream, autopilot, per-phase and global
-maintenance cycles run only their database phases, `gbrain autopilot
+maintenance cycles and `gbrain maintain` run only their database phases,
+`sources set-path` and the write-through leak guard do not count it as
+another source's tree, `gbrain autopilot
--install` asks for `--repo`, a remote `submit_job` for the source is
refused, import does not count the folder as a configured root or stamp it
fresh, and a managed brain does not record it as a managed root. A few other
local commands may still read it from the folder they run in, so set the path
-first.
+first. A managed brain that ran before this fix may already have recorded the
+folders it ran from as managed roots; those records stay until an operator
+drains them (tracked in #7646).
For `sync.repo_path`: `gbrain config set sync.repo_path <absolute-directory>`.
`config set` refuses a relative value and writes nothing.
diff --git a/llms-full.txt b/llms-full.txt
index 632a34452b..32fcb447a1 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -10992,7 +10992,8 @@ folder treated that folder as the brain repo: it ran `git init`, committed
everything in it and imported its markdown. Sync now refuses
`sync_anchor_relative` (exit 3) before any Git probe, cost estimate or import,
and nothing is changed. Doctor's `default_source_local_path` check warns on
-every source with a relative path.
+every source with a relative path, and on a relative `sync.repo_path` behind a
+default source with no path.
Ask the user which directory holds the source, then do one of:
@@ -11010,12 +11011,16 @@ the database (`repo_not_found`, `no_repo_configured`), a captured file keeps
no origin path, matching a folder to its source ignores the path, fence repair
edits stored pages, managed activation refuses it (`source_changed`, detail
`source_path_missing`), the dream, autopilot, per-phase and global
-maintenance cycles run only their database phases, `gbrain autopilot
+maintenance cycles and `gbrain maintain` run only their database phases,
+`sources set-path` and the write-through leak guard do not count it as
+another source's tree, `gbrain autopilot
--install` asks for `--repo`, a remote `submit_job` for the source is
refused, import does not count the folder as a configured root or stamp it
fresh, and a managed brain does not record it as a managed root. A few other
local commands may still read it from the folder they run in, so set the path
-first.
+first. A managed brain that ran before this fix may already have recorded the
+folders it ran from as managed roots; those records stay until an operator
+drains them (tracked in #7646).
For `sync.repo_path`: `gbrain config set sync.repo_path <absolute-directory>`.
`config set` refuses a relative value and writes nothing.
diff --git a/src/commands/autopilot.ts b/src/commands/autopilot.ts
index d738610f3b..e18a01651d 100644
--- a/src/commands/autopilot.ts
+++ b/src/commands/autopilot.ts
@@ -861,9 +861,9 @@ export function writeWrapperScript(repoPath: string, target: InstallTarget, job:
# or which init file the OS loaded.
export PATH=${runtimePathPrefix}"$HOME/.bun/bin:$PATH"
${process.env.GBRAIN_HOME ? `# Baked at install: the supervisor does not pass the installer's env, and\n# without this the daemon would read/write a different home than the\n# install that configured it.\nexport GBRAIN_HOME='${(process.env.GBRAIN_HOME).replace(/'/g, "'\\''")}'\n` : ''}
-${generateSelfDisableGuard(repoPath, target, job)}# #3696: daemon cwd = the repo. A legacy RELATIVE sources.local_path /
-# sync.repo_path row is still never resolved against it (#7630: sync refuses
-# it and the other daemon readers skip it). Done HERE — after the guard has proven the repo exists —
+${generateSelfDisableGuard(repoPath, target, job)}# #3696: daemon cwd = the repo. Sync refuses a legacy RELATIVE local_path /
+# sync.repo_path row and guarded readers skip it (#7630); the few readers #7646
+# tracks still resolve one against this cwd, so the cd stays. Done HERE — after the guard has proven the repo exists —
# and NOT via launchd's plist WorkingDirectory: launchd chdir()s before exec,
# so a deleted repo would fail every respawn and the self-disable guard above
# could never run. Fail-open (|| true): a repo deleted between the guard and
@@ -1006,9 +1006,9 @@ export function pgliteDaemonGuardMessage(engineKind: string, force: boolean): st
// self-disable guard — would never run again, leaving a zombie KeepAlive
// job that can never take itself out of rotation. $HOME exists for the
// job's whole lifetime; the WRAPPER cd's into the repo AFTER the guard has
-// proven it exists (writeWrapperScript). Legacy RELATIVE
-// sources.local_path / sync.repo_path rows are refused or skipped, never
-// resolved against that cwd (#7630).
+// proven it exists (writeWrapperScript). Sync refuses a legacy RELATIVE
+// sources.local_path / sync.repo_path row and the guarded readers skip it
+// (#7630); the few readers #7646 tracks still resolve one against that cwd.
export function generateLaunchdPlist(wrapperPath: string, home: string, job?: AutopilotJob): string {
const logPath = job?.logPath ?? `${home}/.gbrain/autopilot.log`;
const errPath = job?.errPath ?? `${home}/.gbrain/autopilot.err`;
diff --git a/src/commands/brainstorm.ts b/src/commands/brainstorm.ts
index 052091ab85..3ec13e1990 100644
--- a/src/commands/brainstorm.ts
+++ b/src/commands/brainstorm.ts
@@ -491,7 +491,7 @@ export function formatSaveOutcome(
}
if (dbSaved && writeThrough.skipped === 'repo_not_found') {
return {
- stdout: `\n_Saved to DB page \`${ctx.slug}\` (\`sync.repo_path\` is not an absolute directory — skipped file write)._`,
+ stdout: `\n_Saved to DB page \`${ctx.slug}\` (the source directory, \`sources.local_path\` or \`sync.repo_path\`, is not an absolute directory — skipped file write)._`,
stderr,
exitCode: 0,
};
diff --git a/src/commands/doctor/checks/default-source-path.ts b/src/commands/doctor/checks/default-source-path.ts
index f1e3938253..c8f90b2949 100644
--- a/src/commands/doctor/checks/default-source-path.ts
+++ b/src/commands/doctor/checks/default-source-path.ts
@@ -7,7 +7,8 @@
* A null `default.local_path` is the DESIGNED fallback topology (pages nest
* under sync.repo_path), so the check only warns when the fallback
* demonstrably fails — see the helper's doc comment for the exact gates.
- * #7630: it also warns for every other source whose local_path is relative.
+ * #7630: it also warns on a relative default local_path or sync.repo_path and
+ * for every other source whose local_path is relative.
*
* Lives in the doctor module dir per the peeled-façade rule — new code goes
* here, not back into doctor.ts. Returns null for the 'skip' verdict so the
diff --git a/src/commands/doctor/checks/local-audits.ts b/src/commands/doctor/checks/local-audits.ts
index 4db3c1aa2b..3b61dcb856 100644
--- a/src/commands/doctor/checks/local-audits.ts
+++ b/src/commands/doctor/checks/local-audits.ts
@@ -527,7 +527,9 @@ async function runDefaultSourcePath(ctx: DoctorContext): Promise<Check[]> {
// default.local_path is the DESIGNED fallback topology (pages nest under
// sync.repo_path), so this only warns when that fallback demonstrably
// fails: file-backed default pages with no resolvable root, or a
- // sync.repo_path the #2018 leak guard silently skips. Logic lives in
+ // sync.repo_path the #2018 leak guard silently skips. #7630: it also warns
+ // on any relative stored path (default local_path, sync.repo_path, or another
+ // source's local_path). Logic lives in
// doctor/checks/default-source-path.ts (module-dir rule).
if (engine !== null) try {
const { defaultSourceLocalPathCheck } = await import('./default-source-path.ts');
diff --git a/src/commands/maintain.ts b/src/commands/maintain.ts
index e9b620b0ee..da783778f2 100644
--- a/src/commands/maintain.ts
+++ b/src/commands/maintain.ts
@@ -11,6 +11,7 @@
*/
import { existsSync } from 'fs';
+import { isAbsolute } from 'path';
import type { BrainEngine } from '../core/engine.ts';
import type { BrainHealth } from '../core/types.ts';
import { buildChecks, computeDoctorReport, type DoctorReport, type Check } from './doctor.ts';
@@ -144,7 +145,8 @@ async function runCycleFreshnessMaintenance(
for (const sourceId of sourceIds) {
const source = sources.find((s) => s.id === sourceId);
const localPath = source?.local_path ?? null;
- const brainDir = localPath && existsSync(localPath) ? localPath : null;
+ // #7630: a relative local_path names whatever directory maintain runs from, so it is no checkout.
+ const brainDir = localPath && isAbsolute(localPath) && existsSync(localPath) ? localPath : null;
let report: CycleReport;
try {
report = await runCycle(engine, {
diff --git a/src/commands/migrations/v0_11_0-install.ts b/src/commands/migrations/v0_11_0-install.ts
index eeaf08469f..d85de30b28 100644
--- a/src/commands/migrations/v0_11_0-install.ts
+++ b/src/commands/migrations/v0_11_0-install.ts
@@ -20,7 +20,7 @@
* `autopilot_already_installed`, `install_failed`) for later readers.
*/
import { appendFileSync, existsSync, mkdirSync, readFileSync } from 'fs';
-import { dirname } from 'path';
+import { dirname, isAbsolute } from 'path';
import { shellQuote } from '../../core/agent-output.ts';
import { resolveAutopilotJob } from '../../core/autopilot-paths.ts';
import { cliChildStdio } from '../../core/cli-force-exit.ts';
@@ -97,8 +97,10 @@ async function readRepoPaths(config: GBrainConfig | null): Promise<{ syncRepoPat
if (!config) throw new Error('no brain configured');
const { engine, close } = await connectMigrationEngine(config);
try {
- const syncRepoPath = (await engine.getConfig('sync.repo_path')) || null;
- return { syncRepoPath, defaultSourcePath: syncRepoPath ? null : await defaultSourceLocalPath(engine) };
+ // #7630: a relative stored path names the upgrade's cwd, which the install no longer accepts; it counts as unset.
+ const absolute = (path: string | null) => path && isAbsolute(path) ? path : null;
+ const syncRepoPath = absolute(await engine.getConfig('sync.repo_path'));
+ return { syncRepoPath, defaultSourcePath: syncRepoPath ? null : absolute(await defaultSourceLocalPath(engine)) };
} finally { await close(); }
}
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 6f78159b62..f3e8383fba 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -1304,7 +1304,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
{ since: '0.60.460.0', text: 'Dream consolidation on a managed brain now closes a fenced fact in its page: the closing `valid_until` is written into the fact\'s row in the entity page\'s `## Facts` fence, published with the take, and the database row takes its value from that cell, so a later sync or re-import keeps the fact closed. Before, only the database row was closed and the next re-import of the page reopened it. A fact with no fence row is still closed in the database. A fenced fact whose fence row is on another page is left open. Facts an earlier release closed in the database only are not changed (GBRA-190).' },
// GBRA-207 (#7630). `since` is stamped at the merge slot.
{ since: 'TBD', id: 'sync_refuses_relative_anchor', text: 'A sync whose source directory (`sources.local_path`) or legacy `sync.repo_path` is a relative path such as `.` now refuses `sync_anchor_relative` (exit 3) before any Git probe or import, instead of treating whatever folder it ran from as the brain repo (Git init, a baseline commit of the whole folder, an import of its markdown). `gbrain sources set-path <id> <absolute-directory>` sets the path, `gbrain sources set-path <id> --clear` now also clears a relative path on any source, and doctor\'s `default_source_local_path` warns on any source with a relative path, and `gbrain config set sync.repo_path` refuses one. Until the path is set, page and fact writes skip the file (database only), matching a folder to its source ignores it, the dream, autopilot and maintenance cycles run only database phases, fence repair edits stored pages instead of files, managed activation refuses it, `autopilot --install` needs `--repo`, a remote `submit_job` is refused and a managed brain records no managed root there. A few other local commands may still read it from the folder they run in, so set the path before relying on them.' },
- { since: 'TBD', text: 'A foreground write (`remember`, `put_page` and the other non-sync operations) that ends with a retryable fault such as `preparation_stalled` now carries a diagnosis that inspects the writer read-only (`gbrain sources writer status --source <id> --json`) and says to resubmit the same write with a new request_id, instead of telling the user to run `gbrain sync`. Recorded sync faults keep their sync retry.' },
+ { since: 'TBD', text: 'A foreground write (`remember`, `put_page`, `add_tag`, `takes_add` and the other caller-submitted page mutations) that ends with a retryable fault such as `preparation_stalled` now carries a diagnosis that inspects the writer read-only (`gbrain sources writer status --source <id> --json`) and says to resubmit the same write with a new request_id, instead of telling the user to run `gbrain sync`. A maintenance or administration operation gets the read-only inspect alone. Recorded sync faults keep their sync retry.' },
// GBRA-95 RLS backfill. `since` is stamped at the merge slot.
{ since: '0.60.463.0', id: 'rls_backfill_unguarded_tables', text: 'On Postgres, a schema migration now enables row-level security on every gbrain table still without it. A table could be left without RLS because its RLS came only from a full schema replay, which `gbrain apply-migrations --yes` does not run (the four incremental-derivation tables, `page_segment_derivations`, `page_derivation_spend` and the two purge tables), or only from the auto-RLS event trigger, which needs a superuser and is absent on many managed brains. Supabase gives public tables anon and authenticated grants, so with the Data API on such a table was reachable with the anon key. Only a table still without RLS changes; one with a `GBRAIN:RLS_EXEMPT` comment is left alone; no row is read or written. Under a role that does not bypass RLS or does not own a table, the migration names the table on stderr and leaves it, and `gbrain doctor` (rls) keeps naming it with the fix. `gbrain repair missing-tables` now recreates a cache table with RLS on. A role that neither owns a table nor bypasses RLS reads no rows from it and cannot insert or update it once RLS is on (a read-only reporting role or a scoped write role, for example): give that role policies before upgrading (docs/ENGINES.md has the source-scope recipe), or, to keep a table open to it on purpose, add the `GBRAIN:RLS_EXEMPT reason=...` comment to that table. A write role set up with an earlier copy of that recipe also needs its new policies on `page_derivation_spend` and the two purge tables: without them its segmented derivation writes are refused, and the derivation purge triggers its writes fire read no purge, so they do not hold back a purged claim.' },
{ since: '0.60.464.0', text: 'On Postgres, `gbrain serve --access read-only` (stdio) no longer acts as a resident owner: it holds no session-lane (direct pool) connection, starts no persistence consumer, takes no on-commit notifier lease, runs no startup or idle sweep or facts drain, and refuses delegated sync and sweep requests (the CLI then runs them itself). Resolve, turn_context and context_pack still answer. A read-write serve, `gbrain jobs work` or the autopilot owns those duties; `gbrain doctor` reports when no process on the host holds the notifier (`commit_notifier`) or a consumer (`two_consumers_on_host`). Read-write and HTTP serves, and any serve on PGLite (the process that owns the database file), are unchanged.' },
diff --git a/src/core/persistence/terminal-classify.ts b/src/core/persistence/terminal-classify.ts
index 2e3ede008c..9d707ca959 100644
--- a/src/core/persistence/terminal-classify.ts
+++ b/src/core/persistence/terminal-classify.ts
@@ -338,8 +338,9 @@ function schemaMissingVerdict(input: TerminalInput, code: string, origin: string
why: `The write needed ${what}. Read-only: when doctor's schema_version reports the schema behind, run gbrain apply-migrations --yes as the database role that owns the gbrain tables and resubmit; when it is at head, its schema_missing_tables check names what is missing (gbrain repair missing-tables previews it).` } };
}
-/** #7630: the foreground page and memory writes a caller resubmits; no sync replays them. */
-const RESUBMITTED_WRITES = new Set(['put_page', 'put_pages', 'capture', 'delete_page', 'restore_page', 'revert_version', 'edit_page', 'append_page', 'remember', 'forget']);
+/** #7630: the caller-submitted page and memory writes a caller resubmits; no sync replays them. */
+const RESUBMITTED_WRITES = new Set(['put_page', 'put_pages', 'capture', 'delete_page', 'restore_page', 'revert_version', 'edit_page', 'append_page', 'remember', 'forget',
+ 'add_tag', 'remove_tag', 'add_link', 'remove_link', 'add_timeline_entry', 'takes_add', 'takes_update', 'takes_supersede', 'takes_resolve', 'takes_remove']);
/**
* #7630: a sync write (and a recorded sync fault, read as one) is stored as `submit_job`; its retry is the sync. A
diff --git a/src/core/sources-ops.ts b/src/core/sources-ops.ts
index 573e113e33..2c27c4f644 100644
--- a/src/core/sources-ops.ts
+++ b/src/core/sources-ops.ts
@@ -39,7 +39,7 @@ import { managedPersistenceEnabled } from './persistence/ownership.ts';
*/
import { existsSync, mkdirSync, renameSync, rmSync, lstatSync, realpathSync } from 'fs';
-import { join, dirname, basename, resolve as resolvePath } from 'path';
+import { join, dirname, basename, isAbsolute, resolve as resolvePath } from 'path';
import { isPathContained, msysToNativePath } from './path-confine.ts';
import { mkdirPrivate } from './atomic-write.ts';
import { randomBytes } from 'crypto';
@@ -392,6 +392,8 @@ export async function assertNoOverlappingPath(
const realPath = real(path);
for (const other of others) {
const b = other.local_path;
+ // #7630: a relative local_path names whatever directory gbrain runs from, never a tree, so it overlaps nothing.
+ if (!isAbsolute(b)) continue;
if (overlaps(path, b) || overlaps(realPath, real(b))) {
throw new SourceOpError(
'overlapping_path',
diff --git a/src/core/write-through.ts b/src/core/write-through.ts
index cfbd271028..3f4fff3ad3 100644
--- a/src/core/write-through.ts
+++ b/src/core/write-through.ts
@@ -294,6 +294,8 @@ export async function otherSourceOwning(engine: BrainEngine, sourceId: string, p
const identity = (spelling: string) => { try { return canonicalFilesystemPath(msysToNativePath(spelling)); } catch { return null; } };
const target = identity(path);
return rows.find(row => {
+ // #7630: a relative local_path names whatever directory gbrain runs from, never a tree, so it owns nothing.
+ if (!isAbsolute(msysToNativePath(row.local_path))) return false;
const other = identity(row.local_path);
if (target === null || other === null) return true;
const rel = relative(other, target);
diff --git a/test/apply-migrations-safety.serial.test.ts b/test/apply-migrations-safety.serial.test.ts
index 8edc2b7d47..5515805093 100644
--- a/test/apply-migrations-safety.serial.test.ts
+++ b/test/apply-migrations-safety.serial.test.ts
@@ -365,6 +365,17 @@ console.log('CHECK=' + JSON.stringify(autopilotInstallPendingCheck()));
});
}, 60_000);
+ // #7630: the install refuses a relative stored path, so Phase F treats one as unset instead of failing and wedging.
+ test('a relative sync.repo_path and default-source path: Phase F skips no_repo_path and installs nothing', async () => {
+ await postgresBrain({ syncRepoPath: '.', defaultSourcePath: '.' }, async ({ home, ledger, calls, apply }) => {
+ const run = apply(['--yes', '--non-interactive', '--migration', '0.11.0']);
+ expect(run.exitCode, run.stderr).toBe(0);
+ expect(calls()).not.toContain('autopilot');
+ expect(entries(ledger).at(-1)!.phases!.find(phase => phase.name === 'install')).toMatchObject({ status: 'skipped', reason: 'no_repo_path' });
+ expect(pendingInstallItems(home)[0].install_argv).toEqual(['gbrain', 'autopilot', '--install', '--yes', '--repo', '<REPO_PATH>']);
+ });
+ }, 60_000);
+
test('sync.repo_path set: Phase F installs as before', async () => {
await postgresBrain({ syncRepoPath: '/srv/brain' }, async ({ home, ledger, calls, apply }) => {
const run = apply(['--yes', '--migration', '0.11.0']);
diff --git a/test/sync-relative-anchor-refusal-7630.test.ts b/test/sync-relative-anchor-refusal-7630.test.ts
index f54f894070..0814f510f9 100644
--- a/test/sync-relative-anchor-refusal-7630.test.ts
+++ b/test/sync-relative-anchor-refusal-7630.test.ts
@@ -475,6 +475,41 @@ for (const backend of testBackends()) {
expect(run?.files).toBe('none');
}, 120_000);
+ // Value: protects=gbrain maintain cycles a stale source with a relative local_path without a brain directory (database phases only);
+ // fails_when=maintain passes "." as brainDir, so the lint phase (fixes on by default) and other filesystem phases run in the cwd;
+ // why_new=the dream/autopilot/phase handlers above are separate readers; seam=runCycle spied to record its options and run orphans only;
+ // no_claim=what each filesystem phase would have written (none runs)
+ test('gbrain maintain cycles a stale relative-path source with no brain directory', async () => {
+ const cycle = await import('../src/core/cycle.ts');
+ const stale = new Date(Date.now() - 48 * 3_600_000).toISOString();
+ await engine.executeRaw("INSERT INTO sources (id, name, local_path, config) VALUES ('notes-a', 'notes-a', '.', $1::jsonb)", [JSON.stringify({ last_full_cycle_at: stale })]);
+ await engine.putPage('notes/a-note', { type: 'note', title: 'A note', compiled_truth: 'A note in notes-a.', timeline: '' }, { sourceId: 'notes-a' });
+ const real = cycle.runCycle;
+ const seen: Array<{ sourceId?: string; brainDir: string | null }> = [];
+ const spy = spyOn(cycle, 'runCycle').mockImplementation(async (e, opts) => {
+ seen.push({ sourceId: opts.sourceId, brainDir: opts.brainDir ?? null });
+ return real(e, { ...opts, phases: ['orphans'] });
+ });
+ try {
+ const { runMaintain } = await import('../src/commands/maintain.ts');
+ await cli(() => runMaintain(engine, ['--safe', '--json']));
+ } finally { spy.mockRestore(); }
+ expect(seen.find(s => s.sourceId === 'notes-a')).toEqual({ sourceId: 'notes-a', brainDir: null });
+ }, 120_000);
+
+ // Value: protects=the repair command (sources set-path) and the #2018 write-through leak guard never treat a sibling's relative
+ // local_path as the cwd's tree; fails_when=assertNoOverlappingPath or otherSourceOwning realpaths "." to the cwd, so set-path
+ // refuses overlapping_path and default writes under sync.repo_path skip as another source's tree; why_new=no other case has a
+ // relative sibling; seam=none; no_claim=company-brain admission (same helper)
+ test('a sibling with a relative local_path overlaps nothing: set-path to the cwd passes and the leak guard ignores it', async () => {
+ await engine.executeRaw("UPDATE sources SET local_path='.' WHERE id='default'");
+ await engine.executeRaw("INSERT INTO sources (id, name, local_path) VALUES ('notes-a', 'notes-a', '.')");
+ const { assertNoOverlappingPath } = await import('../src/core/sources-ops.ts');
+ expect(await assertNoOverlappingPath(engine, 'notes-a', folder).then(() => null, (error: { code?: string }) => error.code ?? String(error))).toBeNull();
+ const { otherSourceOwning } = await import('../src/core/write-through.ts');
+ expect(await otherSourceOwning(engine, 'default', join(folder, 'notes.md'))).toBeNull();
+ }, 120_000);
+
test('gbrain import of the cwd into a source whose local_path is "." does not stamp it fresh', async () => {
await engine.executeRaw("INSERT INTO sources (id, name, local_path) VALUES ('notes-a', 'notes-a', '.')");
const { runImport } = await import('../src/commands/import.ts');
@@ -491,7 +526,7 @@ describe('#7630: a stalled write\'s diagnosis matches its operation', () => {
operation, state: 'failed', error_code: 'preparation_stalled', error_detail: null, recovery: null, blocked_reason: null, compacted: false, intent_kind: null })!;
const mcp = { transport: 'stdio' as const, isCallable: () => false, preapproved: () => false };
- for (const operation of ['remember', 'put_page']) {
+ for (const operation of ['remember', 'put_page', 'add_tag', 'add_link', 'add_timeline_entry', 'takes_add']) {
test(`a foreground ${operation} that ended preparation_stalled inspects the writer and resubmits, never a sync`, () => {
const verdict = receipt(operation);
expect(verdict.action.argv).toEqual(['gbrain', 'sources', 'writer', 'status', '--source', 'default', '--json']);