Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

wip(#6865): behavior row since, current-lane fixture

garrytan70d70caeeed6
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 2c051ffd87..e686960b44 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -729,7 +729,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }
{ since: '0.60.269.0', text: 'A managed sync no longer forks a second page for a file whose page an older gbrain imported under a slug the current slug fold spells differently (#6727: punctuation, spaces, accents, emoji, full-width characters): a file with no recorded origin and no page at its slug imports into the one live page without a recorded file that folds to it, keeping that page\'s id, links and history. When several such pages match, the file is held `legacy_slug_conflict` (needs a person: keep one, remove the others, then sync); with `sync.holds=fail` the run stops `page_identity_changed`. Pages already forked by older syncs are not merged.' },
{ since: '0.60.269.0', text: 'A managed sync\'s final checkpoint validation reads at most one committed receipt per unfinished receipt, so a catch-up of tens of thousands of entries no longer times out at its last step (#6735). A checkpoint that still hits `checkpoint_validation_timeout` is re-validated by the next sync of the source (once per run, after the stop is recorded) instead of rediscovering the whole manifest.' },
{ since: '0.60.269.0', text: 'Doctor no longer warns that a managed sync cursor has been idle "over an hour" right after the cursor was discovered (#6763): idle time counts from the cursor\'s last advance, or from its discovery when it has not advanced yet.' },
- { since: '0.60.270.0', text: 'A managed `gbrain sync` now removes a stray frontmatter `slug:` line by itself when the slug it names has no page and no file (#6865, the content-repair lane\'s deterministic `absent_page` rule): right after the sync releases its drain lease, each such held file is rewritten without that one line, imported under the slug its path gives, its `frontmatter_slug_conflict` hold cleared and the edit committed as `gbrain: repair frontmatter slug in <path>` with the `gbrain-repair:` trailer, through the same coordinated repair write the maintenance run already used; the declared slug becomes an alias of the page so links written against it keep resolving. At most 200 files and 60 s per sync; the result\'s `slug_lines_removed` counts them and the rest. A line naming an existing page (with a file or database-only), a file edited since sync held it, a source with an unfinished sync, and a sync submitted by a remote job or agent are left held. Preview what the lane would do with `gbrain repair content --source <id> --no-llm`; opt out with `gbrain config set sync.slug_conflicts.auto_remove false` (or pause the whole lane with `fences.repair.enabled false`); undo one edit with `git revert` of its commit and a sync, which holds the file again. Nothing runs at upgrade. Slug-conflict hold status now follows what the lane found: "decide which page keeps the slug" appears only when the line names a live page, a hold with no verdict yet never escalates to a person, and a verdict an older gbrain recorded is rechecked once by the next sync or maintenance run instead of being listed for a person.' },
+ { since: '0.60.269.0', text: 'A managed `gbrain sync` now removes a stray frontmatter `slug:` line by itself when the slug it names has no page and no file (#6865, the content-repair lane\'s deterministic `absent_page` rule): right after the sync releases its drain lease, each such held file is rewritten without that one line, imported under the slug its path gives, its `frontmatter_slug_conflict` hold cleared and the edit committed as `gbrain: repair frontmatter slug in <path>` with the `gbrain-repair:` trailer, through the same coordinated repair write the maintenance run already used; the declared slug becomes an alias of the page so links written against it keep resolving. At most 200 files and 60 s per sync; the result\'s `slug_lines_removed` counts them and the rest. A line naming an existing page (with a file or database-only), a file edited since sync held it, a source with an unfinished sync, and a sync submitted by a remote job or agent are left held. Preview what the lane would do with `gbrain repair content --source <id> --no-llm`; opt out with `gbrain config set sync.slug_conflicts.auto_remove false` (or pause the whole lane with `fences.repair.enabled false`); undo one edit with `git revert` of its commit and a sync, which holds the file again. Nothing runs at upgrade. Slug-conflict hold status now follows what the lane found: "decide which page keeps the slug" appears only when the line names a live page, a hold with no verdict yet never escalates to a person, and a verdict an older gbrain recorded is rechecked once by the next sync or maintenance run instead of being listed for a person.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/test/persistence-sync-holds.test.ts b/test/persistence-sync-holds.test.ts
index 9f2cb41756..f27116dd02 100644
--- a/test/persistence-sync-holds.test.ts
+++ b/test/persistence-sync-holds.test.ts
@@ -17,6 +17,7 @@ import { disposePersistenceConsumer } from '../src/core/persistence/service.ts';
import { performManagedSync } from '../src/core/persistence/sync-run.ts';
import { sha256 } from '../src/core/persistence/digest.ts';
import { GIT_HOLD_OP, SYNC_IMPORT_PROVENANCE_OP, gitHoldItem, readGitSourceHolds, recordContentHoldRepair, requestGitHoldRetry } from '../src/core/persistence/sync-holds.ts';
+import { CONTENT_REPAIR_LANE_VERSION } from '../src/core/persistence/sync-fault-class.ts';
import { printSyncResult, type SyncOpts, type SyncResult } from '../src/commands/sync.ts';
import { gitHoldStatusLines, readGitHoldStatuses } from '../src/core/persistence/connector-status.ts';
import { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';
@@ -419,7 +420,7 @@ test('#6377: a slug-conflict hold carries the content-repair verdict only for th
expect(hold).toMatchObject({ code: 'frontmatter_slug_conflict' });
expect(gitHoldItem(hold!).fix.argv).toEqual(['gbrain', 'repair', 'content', '--source', s.id, '--only', 'notes/slug.md']);
expect(gitHoldItem(hold!).fix.why).toContain('The content-repair lane clears this itself on the next maintenance run');
- const state = { action: 'merge_into' as const, reason: 'merge_recommended', canonical: 'notes/elsewhere', named: 'notes/elsewhere', model: 'anthropic:claude-opus-5-5', at: new Date().toISOString(), next_attempt_after: null };
+ const state = { action: 'merge_into' as const, reason: 'merge_recommended', canonical: 'notes/elsewhere', named: 'notes/elsewhere', model: 'anthropic:claude-opus-5-5', at: new Date().toISOString(), next_attempt_after: null, lane_version: CONTENT_REPAIR_LANE_VERSION };
// Conditional on the judged bytes and the code: other bytes or another path record nothing.
expect(await recordContentHoldRepair(engine, { sourceId: s.id, incarnation: hold!.incarnation, path: 'notes/slug.md', upstreamVersion: sha256('other bytes'), state })).toBe(false);
expect(await recordContentHoldRepair(engine, { sourceId: s.id, incarnation: hold!.incarnation, path: 'notes/ok.md', upstreamVersion: null, state })).toBe(false);