Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix: pre-landing review fixes
garrytan1a342cff994c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c979c2f32c..0e6eeb7f1b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,12 +14,12 @@ identifiers and attribution are available in the pre-removal Git revision**`gbrain sources refresh --abandon` no longer lets the next sync delete pages a member source already synced.**-A refresh interrupted after a member source synced the upstream commit, then moved to `recovery_required` with the checkout back at the commit it started from, could be abandoned: `--resume` refused and named `--abandon`, `--abandon` lifted the fence, and the next sync diffed that member back to the start commit and soft-deleted every page it had synced. `--abandon` now refuses such a row (`refresh_recovery_required`, nothing changed) once any member's `last_commit` is past the start commit (set, and neither that commit nor an ancestor of it; a commit git cannot find counts as past), and `--resume` no longer names `--abandon` there. Both name the one way out that keeps the pages, as an ask-the-user fix: preview with `git -C <checkout> status --short`, fast-forward the checkout to the upstream commit with `git merge --ff-only` (it keeps uncommitted edits and refuses if one overlaps an incoming file), then `--resume`. Writer status uses the same member check. A row whose members never moved past the start commit is abandoned exactly as before, and sync's deletion behaviour is unchanged.+A refresh interrupted after a member source synced the upstream commit, then moved to `recovery_required` with the checkout back at the commit it started from, could be abandoned: `--resume` refused and named `--abandon`, `--abandon` lifted the fence, and the next sync diffed that member back to the start commit and soft-deleted every page it had synced. `--abandon` now refuses such a row (`refresh_recovery_required`, nothing changed) once any member's `last_commit` is past the start commit (set, and neither that commit nor an ancestor of it; a commit git cannot find counts as past), and `--resume` no longer names `--abandon` there. Both name the one way out that keeps the pages, as an ask-the-user fix: preview with `git -C <checkout> status --short`, fast-forward the checkout with `git merge --ff-only` to the commit the members synced (the upstream commit, or a later one a member already synced), then `--resume`; when git refuses, `git reset --hard` to that commit is named as the destructive fallback. `--resume` now also finishes a `recovery_required` refresh whose HEAD descends from the upstream commit instead of refusing it. Writer status uses the same member check. A row whose members never moved past the start commit is abandoned exactly as before, and sync's deletion behaviour is unchanged.### Itemized changes- `src/core/persistence/worktree-refresh.ts`: one member check (`membersPastStart`) feeds `--abandon`, the `--resume` refusal at the start commit, the stored `recovery_required` fix and writer status.-- Tests: `test/persistence-worktree-refresh.test.ts` 7r (the three-step chain: crash while syncing, member synced, HEAD reset; pages survive, then reset-to-target and `--resume` completes) 7s (no member moved: `--abandon` still works) and 7t (a member behind the start commit still abandons; an unknown commit refuses), on PGLite and on Postgres through `test/e2e/worktree-refresh-postgres.test.ts`.+- Tests: `test/persistence-worktree-refresh.test.ts` 7r (the three-step chain: crash while syncing, member synced, HEAD reset; pages survive, then reset-to-target and `--resume` completes) 7s (no member moved: `--abandon` still works) 7t (a member behind the start commit still abandons; an unknown commit refuses), 7u (a member synced past the target keeps its pages) and 7v (an unrelated HEAD names no `--abandon`; a HEAD past the target resumes), on PGLite and on Postgres through `test/e2e/worktree-refresh-postgres.test.ts`.## [0.60.583.0] - 2026-11-05diff --git a/docs/guides/write-refusals.md b/docs/guides/write-refusals.mdindex 1faa1e3790..ed667628c7 100644--- a/docs/guides/write-refusals.md+++ b/docs/guides/write-refusals.md@@ -572,7 +572,7 @@ this anchor (`--json` puts them in one object on stdout); the command exits 1.| <a id="refresh_lock_timeout"></a>`refresh_lock_timeout` | `refresh_lock_timeout` | The refresh fence locks the brain, worktree, source and refresh rows with a 5 s lock timeout, and another database transaction held one of them longer. `why` lists the five oldest open transactions in this database holding locks on those tables (pid, application, state, how long the transaction has been open). They are candidates: the blocker may not be among them, because Postgres does not show which row each one holds. It never repeats their SQL, and says so when that lookup failed or took longer than 3 s. HEAD did not move: no fence was set, or the draining refresh was aborted. When the same holder also blocked that abort, the refusal says the row stays `draining`, and the next `gbrain sources refresh <source>` resumes it. | Retry `gbrain sources refresh <source>`. If it repeats, a transaction holding one of those rows is stuck: `why` lists the oldest candidates, so confirm the blocker on the brain host before ending any transaction. || <a id="refresh_sync_timeout"></a>`refresh_sync_timeout` | `refresh_sync_timeout` | Reported per source in a refresh's `sync_blocked`, not as a refusal: the source's managed sync committed nothing within its share of the refresh sync budget (each member gets an equal share of what is left; `sources.refresh_sync_budget_ms`, `GBRAIN_REFRESH_SYNC_BUDGET_MS`, default 5 min), for example because no consumer claimed its write. The message names that write and its state. The checkout is at the upstream commit, the refresh completed and released its lock, and the source is behind until its next sync. A sync stopped by the drain's own rules is reported with that stop's code instead (`drain_stalled` and the others). | Run the `resume` command (`gbrain sync --source <source> --no-pull`). If it stalls the same way, check the write it names with `gbrain sources writer status <source> --json`. || <a id="refresh_source_changed"></a>`refresh_source_changed` | `refresh_source_changed` | HEAD moved (an outside commit or checkout), or the checkout's ownership or set of sources changed, between the precheck and the merge. Nothing was merged and the fence was lifted. | Retry `gbrain sources refresh <source>`. |-| <a id="refresh_recovery_required"></a>`refresh_recovery_required` | `refresh_recovery_required` | Publication or source recovery is pending on the checkout, or a refresh was interrupted and HEAD is neither the commit it started from nor the verified upstream commit. Writes to the checkout stay refused until it is resolved; gbrain never adopts a HEAD it cannot verify. | `gbrain sources writer status <source>`, then `gbrain sources refresh <source> --resume`. When HEAD is unverified the fix names both ways out: reset to the start commit and run `--abandon`, or reset to the upstream commit and run `--resume`. Resetting is destructive, so ask the user first. Writer status reads HEAD and names the one step left when HEAD already sits at one of those commits: `--resume` at the upstream commit, `--abandon` at the start commit when no member source has synced past it. When one has (its `last_commit` is set and is neither the start commit nor an ancestor of it; a commit git cannot find counts too), `--abandon` refuses with this code and changes nothing, because the next sync would roll that member's pages back; `--resume` refuses too, and both name the one way out that keeps those pages: the fix (`next: ask_user`) previews with `git -C <checkout> status --short`, fast-forwards the checkout to the upstream commit with `git merge --ff-only` (it keeps uncommitted edits and refuses if one overlaps an incoming file), then runs `--resume`. |+| <a id="refresh_recovery_required"></a>`refresh_recovery_required` | `refresh_recovery_required` | Publication or source recovery is pending on the checkout, or a refresh was interrupted and HEAD is neither the commit it started from nor the verified upstream commit. Writes to the checkout stay refused until it is resolved; gbrain never adopts a HEAD it cannot verify. | `gbrain sources writer status <source>`, then `gbrain sources refresh <source> --resume`. When HEAD is unverified the fix names both ways out: reset to the start commit and run `--abandon`, or reset to the upstream commit and run `--resume`. Resetting is destructive, so ask the user first. Writer status reads HEAD and names the one step left when HEAD already sits at one of those commits: `--resume` at the upstream commit, `--abandon` at the start commit when no member source has synced past it. When one has (its `last_commit` is set and is neither the start commit nor an ancestor of it; a commit git cannot find counts too), `--abandon` refuses with this code and changes nothing, because the next sync would roll that member's pages back; `--resume` refuses too, and both name the one way out that keeps those pages: the fix (`next: ask_user`) previews with `git -C <checkout> status --short`, fast-forwards the checkout with `git merge --ff-only` to the commit the members synced (the upstream commit, or a later one a member already synced; it keeps uncommitted edits and refuses if one overlaps an incoming file), then runs `--resume`. When git refuses, the fix names `git reset --hard` to that commit (destructive) instead. `--resume` finishes a `recovery_required` refresh whose HEAD is the upstream commit or descends from it. || <a id="worktree_refreshing"></a>`worktree_refreshing` | `worktree_refreshing` | A write, or a managed sync started by a cycle or another command, reached a checkout while a refresh is draining or merging it. It was not journaled. `detail` is `retry_after_ms=1000`. Writes to database-only memory are not affected. An interactive write (CLI, MCP) waits out the fence for up to 10 s, or its explicit `wait_ms` if lower, before this refusal; a background write is refused at once. The refusal is `retryable`, its `fix.next` is `wait`, and the CLI exits 1; the memory verbs keep their frozen `unavailable` code with `canonical: worktree_refreshing`. | Retry the same request ID after `retry_after_ms`; nothing was recorded, so the retry cannot write twice. `gbrain sources writer status --source <source> --json` shows the refresh. A cycle's sync is retried by the next cycle. |A refresh is recorded in `persistence_worktree_refreshes` and survives a crash.diff --git a/src/core/persistence/worktree-refresh.ts b/src/core/persistence/worktree-refresh.tsindex 19b249061f..ffcbb28e3e 100644--- a/src/core/persistence/worktree-refresh.ts+++ b/src/core/persistence/worktree-refresh.ts@@ -115,19 +115,35 @@ async function membersPastStart(engine: BrainEngine, row: Pick<WorktreeRefreshRoreturn past;}).catch(() => moved.map(member => member.id));}-const keepSyncedWayOut = (row: Pick<WorktreeRefreshRow, 'source_ids' | 'target_head'>, root: string) =>- `Ask the user first: git -C ${q(root)} merge --ff-only ${row.target_head} moves the checkout to the refresh target its members already synced (it keeps uncommitted edits git can carry, and refuses without changing anything when one overlaps an incoming file or HEAD is not behind the target; git -C ${q(root)} status --short lists them), then gbrain sources refresh ${row.source_ids[0]} --resume finishes the refresh and keeps the pages its members synced.`;-/** GST-1457: the refusal when a member synced past old_head; its fix is the fast-forward to the target (ask_user, preview first), then --resume. */-function membersSyncedRefusal(row: WorktreeRefreshRow, root: string, moved: string[], cause: string): OperationError {+/**+ * GST-1457: where the way out moves HEAD. The refresh target, or the newest member last_commit on the target's line when every other+ * member's commit is an ancestor of it (a cycle sync carried a member past the target while syncing, #6712), so --resume never completes+ * with a member ahead of HEAD, whose next sync would roll it back.+ */+async function keepPagesHead(engine: BrainEngine, row: Pick<WorktreeRefreshRow, 'source_ids' | 'target_head'>, root: string): Promise<string> {+ const commits = [...new Set((await engine.executeRaw<{ last_commit: string | null }>('SELECT last_commit FROM sources WHERE id = ANY($1::text[])', [row.source_ids]))+ .map(member => member.last_commit).filter((commit): commit is string => !!commit))];+ return withGit(async git => {+ let head = row.target_head;+ for (const commit of commits) if (commit !== head && await isAncestor(git, root, head, commit)) head = commit;+ for (const commit of commits) if (!await isAncestor(git, root, commit, head)) return row.target_head;+ return head;+ }).catch(() => row.target_head);+}+const keepSyncedWayOut = (row: Pick<WorktreeRefreshRow, 'source_ids'>, root: string, head: string) =>+ `Ask the user first: git -C ${q(root)} merge --ff-only ${head} moves the checkout to the commit its members already synced (it keeps uncommitted edits git can carry; git -C ${q(root)} status --short lists them), then gbrain sources refresh ${row.source_ids[0]} --resume finishes the refresh and keeps the pages its members synced. If git refuses (an uncommitted edit overlaps an incoming file, or HEAD is not an ancestor of ${head}), ask the user before git -C ${q(root)} reset --hard ${head}, which discards local commits and uncommitted edits not in it, then --resume.`;+/** GST-1457: the refusal when a member synced past old_head; its fix fast-forwards to the commit the members synced (ask_user, preview first), then --resume. */+async function membersSyncedRefusal(engine: BrainEngine, row: WorktreeRefreshRow, root: string, moved: string[], cause: string): Promise<OperationError> {const source = row.source_ids[0];- const error = refusal('refresh_recovery_required', cause, keepSyncedWayOut(row, root), row.id);- error.fix = { ask_user: true, argv: ['git', '-C', root, 'merge', '--ff-only', row.target_head], preview_argv: ['git', '-C', root, 'status', '--short'],+ const head = await keepPagesHead(engine, row, root);+ const error = refusal('refresh_recovery_required', cause, keepSyncedWayOut(row, root, head), row.id);+ error.fix = { ask_user: true, argv: ['git', '-C', root, 'merge', '--ff-only', head], preview_argv: ['git', '-C', root, 'status', '--short'],consent: [], actor: 'agent', requires_exclusive: false,- why: `Fast-forwards the checkout to the refresh target ${row.target_head}, which ${moved.join(', ')} already synced past the start commit toward; git keeps uncommitted edits it can carry and refuses, changing nothing, when one overlaps an incoming file. Then --resume finishes refresh ${row.id} without rolling a member back.`,- user_message: `Refresh ${row.id} of ${row.source_ids.join(', ')} stopped with the checkout ${root} back at ${row.old_head}, after ${moved.join(', ')} had already synced past it. Abandoning it would let the next sync delete the pages those sources synced. To keep them, fast-forward the checkout to the upstream commit ${row.target_head} (git merge --ff-only keeps uncommitted edits and refuses if one overlaps an incoming file; git status --short lists them) and then run gbrain sources refresh ${source} --resume. Go ahead?`,+ why: `Fast-forwards the checkout to ${head}, the commit ${moved.join(', ')} already synced toward; git keeps uncommitted edits it can carry and refuses, changing nothing, when one overlaps an incoming file. Then --resume finishes refresh ${row.id} without rolling a member back.`,+ user_message: `Refresh ${row.id} of ${row.source_ids.join(', ')} stopped with the checkout ${root} back at ${row.old_head}, after ${moved.join(', ')} had already synced past it. Abandoning it would let the next sync delete the pages those sources synced. To keep them, fast-forward the checkout to ${head} (git merge --ff-only keeps uncommitted edits and refuses if one overlaps an incoming file; git status --short lists them) and then run gbrain sources refresh ${source} --resume. Go ahead?`,verify: { argv: ['gbrain', 'sources', 'writer', 'status', '--source', source, '--json'] },then: { argv: ['gbrain', 'sources', 'refresh', source, '--resume'], consent: [], actor: 'agent', requires_exclusive: false,- why: `With HEAD at the target, records the merge and runs the member syncs, so refresh ${row.id} completes.` } };+ why: `With HEAD at ${head}, which contains the refresh target, records the merge and runs the member syncs, so refresh ${row.id} completes.` } };return error;}/**@@ -251,7 +267,7 @@ async function markRecoveryRequired(engine: BrainEngine, row: WorktreeRefreshRowconst moved = await membersPastStart(engine, row, root);const error = refusal('refresh_recovery_required',`The checkout HEAD (${head ?? 'unreadable'}) is not the verified upstream commit ${row.target_head}${moved.length ? `, and ${moved.join(', ')} already synced past the pre-refresh commit ${row.old_head}` : ` nor the pre-refresh commit ${row.old_head}`}; writes to this worktree stay fenced.`,- moved.length ? `Inspect with gbrain sources writer status ${source}. ${keepSyncedWayOut(row, root)}`+ moved.length ? `Inspect with gbrain sources writer status ${source}. ${keepSyncedWayOut(row, root, await keepPagesHead(engine, row, root))}`: `Inspect with gbrain sources writer status ${source}. Ask the user before resetting the checkout (destructive): git -C ${q(root)} reset --hard ${row.old_head} then gbrain sources refresh ${source} --abandon, or git -C ${q(root)} reset --hard ${row.target_head} then gbrain sources refresh ${source} --resume.`,row.id);await engine.transaction(tx => transition(tx, row, ['draining', 'fenced', 'merged', 'syncing', 'recovery_required'], 'recovery_required',@@ -882,7 +898,8 @@ async function recoverOne(engine: BrainEngine, git: Git, row: WorktreeRefreshRowawait engine.transaction(tx => transition(tx, row, ['draining'], 'aborted', { refusal: { code: 'refresh_interrupted', cause: 'The refreshing process stopped while draining; no merge was started.' } }));} else if (row.state === 'fenced' && head === row.old_head) {await engine.transaction(tx => transition(tx, row, ['fenced'], 'aborted', { refusal: { code: 'refresh_interrupted', cause: 'The refreshing process stopped before merging; HEAD is unchanged.' } }));- } else if (['fenced', 'merged', 'recovery_required'].includes(row.state) && head === row.target_head && await isAncestor(git, root, row.old_head, row.target_head)) {+ } else if (['fenced', 'merged', 'recovery_required'].includes(row.state) && (head === row.target_head || (row.state === 'recovery_required' && head !== null && await isAncestor(git, root, row.target_head, head)))+ && await isAncestor(git, root, row.old_head, row.target_head)) {await bookkeeping(engine, row);} else if (row.state === 'syncing' && head !== null && (head === row.target_head || await isAncestor(git, root, row.target_head, head))) {// stays syncing; the member syncs run from --resume or any later cycle sync.@@ -1015,7 +1032,7 @@ async function resumeOrAbandon(engine: BrainEngine, sourceId: string, opts: Refrthrow await markRecoveryRequired(engine, row, head, root);}const moved = row.state === 'recovery_required' ? await membersPastStart(engine, row, root) : [];- if (moved.length) throw membersSyncedRefusal(row, root, moved, `Refresh ${row.id} was not abandoned: the checkout is back at the pre-refresh commit ${row.old_head}, but ${moved.join(', ')} already synced past it, so lifting the fence would let the next sync soft-delete the pages that sync added. Nothing was changed.`);+ if (moved.length) throw await membersSyncedRefusal(engine, row, root, moved, `Refresh ${row.id} was not abandoned: the checkout is back at the pre-refresh commit ${row.old_head}, but ${moved.join(', ')} already synced past it, so lifting the fence would let the next sync soft-delete the pages that sync added. Nothing was changed.`);await engine.transaction(tx => transition(tx, row, ['draining', 'fenced', 'merged', 'recovery_required'], 'aborted',{ refusal: { code: 'refresh_abandoned', cause: `The operator abandoned the refresh with HEAD at ${head}.` } }));return { ...empty, status: 'abandoned', refresh_id: row.id, source_ids: row.source_ids, old_head: row.old_head, target_head: row.target_head,@@ -1036,7 +1053,7 @@ async function resumeHeld(engine: BrainEngine, git: Git, sourceId: string, refrelet row = await withTopologyLocks(engine, sourceId, async () => recoverOne(engine, git, await readRefresh(engine, refreshId), root, unattended), undefined, 30_000);if (row.state === 'recovery_required' && head === row.old_head) {const moved = await membersPastStart(engine, row, root);- if (moved.length) throw membersSyncedRefusal(row, root, moved, `The checkout is back at the pre-refresh commit ${row.old_head}, but ${moved.join(', ')} already synced past it, so --resume cannot finish refresh ${row.id} from here and --abandon would let the next sync soft-delete the pages that sync added.`);+ if (moved.length) throw await membersSyncedRefusal(engine, row, root, moved, `The checkout is back at the pre-refresh commit ${row.old_head}, but ${moved.join(', ')} already synced past it, so --resume cannot finish refresh ${row.id} from here and --abandon would let the next sync soft-delete the pages that sync added.`);throw refusal('refresh_recovery_required',`The checkout is back at the pre-refresh commit ${row.old_head}; nothing remains to resume.`, `gbrain sources refresh ${sourceId} --abandon`, row.id);}diff --git a/test/persistence-worktree-refresh.test.ts b/test/persistence-worktree-refresh.test.tsindex 73a8d19f28..ede190b4db 100644--- a/test/persistence-worktree-refresh.test.ts+++ b/test/persistence-worktree-refresh.test.ts@@ -786,6 +786,57 @@ test('7t. GST-1457: a member behind the start commit is not past it, and one whoexpect(await livePages(f, f.alpha)).toEqual(before);}), 180_000);+test('7u. GST-1457 review: a member a cycle sync carried past the target keeps its pages too: the way out fast-forwards to its commit', () => each(async f => {+ // Value: protects=the fix names the newest member commit on the target's line, so --resume completes at a HEAD no member is ahead of and+ // the next sync rolls nothing back; fails_when=the fix always names target_head, so completion leaves the member at a descendant of HEAD and+ // its next sync soft-deletes what that commit added; why_new=7r's member stops at the target; seam=a commit made in the managed checkout on+ // top of the target and synced by the real managed sync while the row was syncing (#6712's case); no_claim=members on diverged lines.+ const target = f.push('alpha/two.md', page('Alpha two', 'Synced to the target.'));+ const old = f.head();+ const orphan = await orphanAt(f, 'syncing', 'syncing');+ const past = commitFile(f.root, 'alpha/three.md', page('Alpha three', 'Landed on top of the target while syncing.'));+ await performManagedSync(f.engine, { sourceId: f.alpha, noPull: true, noEmbed: true });+ expect(await f.lastCommit(f.alpha)).toBe(past);+ const synced = await livePages(f, f.alpha);+ expect(synced.some(slug => slug.endsWith('three'))).toBe(true);+ git(f.root, 'reset', '-q', '--hard', old);+ const resume = await refusedWith(refreshWorktree(f.engine, f.alpha, { resume: true }), 'refresh_recovery_required') as { suggestion?: string; fix?: Record<string, any> };+ expect(resume.fix).toMatchObject({ argv: ['git', '-C', f.root, 'merge', '--ff-only', past] });+ expect(resume.suggestion).not.toContain(`merge --ff-only ${target}`);+ await refusedWith(refreshWorktree(f.engine, f.alpha, { abandon: true }), 'refresh_recovery_required');+ git(f.root, 'merge', '-q', '--ff-only', past);+ expect(await refreshWorktree(f.engine, f.alpha, { resume: true })).toMatchObject({ refresh_id: orphan.id, status: 'completed' });+ await performManagedSync(f.engine, { sourceId: f.alpha, noPull: true, noEmbed: true });+ expect(await livePages(f, f.alpha)).toEqual(synced);+}), 180_000);++test('7v. GST-1457 review: at an unrelated HEAD with a member synced, writer status and --resume name only the target, and --resume accepts a HEAD that descends from it', () => each(async f => {+ // Value: protects=the unverified-HEAD branch of writer status and the stored fix never name --abandon once a member moved, the stored fix names+ // a reset fallback when the fast-forward cannot apply, and --resume finishes a recovery_required row whose HEAD descends from the target+ // instead of refusing it forever; fails_when=recoverOne accepts only HEAD == target_head for recovery_required, or the moved branches are+ // dropped; why_new=7r and 7u start at old_head; seam=an empty commit makes HEAD unrelated, a local commit makes it a descendant; no_claim=none.+ const target = f.push('alpha/two.md', page('Alpha two', 'Synced to the target.'));+ const old = f.head();+ const orphan = await orphanAt(f, 'syncing', 'syncing');+ await performManagedSync(f.engine, { sourceId: f.alpha, noPull: true, noEmbed: true });+ const ahead = commitFile(f.root, 'alpha/four.md', page('Alpha four', 'Committed on top of the target, not synced yet.'));+ git(f.root, 'reset', '-q', '--hard', old);+ git(f.root, 'commit', '-q', '--allow-empty', '-m', 'unrelated');+ const resume = await refusedWith(refreshWorktree(f.engine, f.alpha, { resume: true }), 'refresh_recovery_required');+ expect(resume.message).toContain(f.alpha);+ expect(resume.suggestion).toContain(`merge --ff-only ${target}`);+ expect(resume.suggestion).toContain(`reset --hard ${target}`);+ expect(resume.suggestion).not.toContain('--abandon');+ const status = await writerStatusRow(f);+ expect(status).toMatchObject({ state: 'recovery_required', fix: { argv: ['gbrain', 'sources', 'refresh', f.alpha, '--resume'] } });+ expect(status.fix.why).toContain('--abandon refuses');+ git(f.root, 'reset', '-q', '--hard', ahead);+ expect(await refreshWorktree(f.engine, f.alpha, { resume: true })).toMatchObject({ refresh_id: orphan.id, status: 'completed' });+ await performManagedSync(f.engine, { sourceId: f.alpha, noPull: true, noEmbed: true });+ expect(await f.lastCommit(f.alpha)).toBe(ahead);+ expect((await livePages(f, f.alpha)).filter(slug => /two|four/.test(slug)).length).toBe(2);+}), 180_000);+test('8. a queued git effect drains before fenced, and nothing on the worktree is claimed while fenced', () => each(async f => {f.push('alpha/two.md', page('Alpha two', 'Upstream.'));await f.put(f.beta, 'notes/effect', page('Effect', 'Has a git effect.'));