Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

WIP #6712 lane C: BEHAVIOR_CHANGES rows (0.60.249.0), kill list adds held_settled/retry_deferred

garrytan9cb4661c2025
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 6952c649ff..e65b338070 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -634,6 +634,9 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }
{ since: '0.60.245.0', text: 'A write refused because its page\'s canonical file holds a committed Git change that managed sync has not imported yet now says so (`source_changed`, reason `pending_import`, "The canonical file holds a committed Git change that sync has not imported yet.") instead of "an uncoordinated local edit". A `remember` refused that way, or refused because sync held the file, is kept: after each managed sync, gbrain replays those remembers whose page now matches its file, once, with the fact\'s original date and the caller\'s original authority (at most 50 per sync; the sync result\'s `replayedRemembers` counts them), so the agent should not save the fact again. `put_page` and other writes are not replayed: resubmit after the next sync. Remembers refused before this release are listed by `gbrain repair failed-writes --source <id>`.' },
// #6686 (D8): a facts fence below the timeline sentinel.
{ since: '0.60.245.0', text: 'A page whose only `## Facts` fence sits below the timeline sentinel keeps it there: `remember` and `extract_facts` now add their rows to that fence (and strike a replaced row where it lives) instead of adding a second fence above the sentinel, and `extract_facts` reconciles such a fence instead of warning `FACTS_FENCE_BELOW_SENTINEL` and freezing its facts. A page that already has a fence on each side of the sentinel still warns, now naming `gbrain repair split-facts --source <id>`, an explicit preview-then-apply repair that merges the two fences under their own row numbers and refuses a page whose fences share a row number.' },
+ // #6712 PR 1 lane C (L2 one page, one fate, #6565, #6600): pass once VERSION is stamped 0.60.249.0 (behavior-change-notice.test.ts fresh-install cases).
+ { since: '0.60.249.0', text: 'A managed sync now gives each page its own fate (#6712): a page that does not commit is held, retried or stops the run on its own, and the pages admitted after it still publish and are counted from their own receipts. Before, one failed page cancelled the rest of its bulk group and every group admitted ahead of it, and later syncs re-froze them. Two changes of one page in one sync (a delete and an import of one slug, say) are never published in the same group, and the later one is held behind the earlier one (`blocked_on`) when that one is held. `sync.knock_on_refreeze_limit` and `sync.knock_on_run_limit` are retired (`gbrain config set` refuses them) and `knock_on_exhausted` is no longer raised; an older receipt with it reads as superseded. The write owner must run this release.' },
+ { since: '0.60.249.0', text: 'A file that changed after its sync request was admitted (`source_changed`) is now retried after the manifest\'s last entry, up to three times, before it is held `worktree_dirty` (before: one retry in place). A dropped connection re-freezes the entry in place; an unrecognized database refusal (an unknown P0001 or a 55000, #6565) stops the run as systemic with the classifier\'s action, and the next plain sync re-freezes the stopped entry, at most three times in a row before `--retry-failed` is needed. A held deletion whose exact page an authorized delete already removed (#6600) settles and clears its hold. `preparation_stalled` holds are retried by every sync until their third attempt, a `concurrent_write` hold is re-screened when its page\'s revision moves, and `--retry-failed` now rediscovers a run whose checkpoint a receipt still blocks.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/test/sync-convergence.serial.test.ts b/test/sync-convergence.serial.test.ts
index 26b7067d91..ee9d5b0a0c 100644
--- a/test/sync-convergence.serial.test.ts
+++ b/test/sync-convergence.serial.test.ts
@@ -128,12 +128,14 @@ const ENTITY = 'people/alice-example';
* file-publication pair (`before_publication`/`after_publication`) never fires for it. Per-page seams are counted
* per submit_job request (nth inside the first 60% of a round); `lane:applied` and `sync:before_group_admission`
* fire once per bulk group, and a small round may form one group, so they kill at the first; `sync:mid_checkpoint`
- * fires on every cursor save (the first or second).
+ * fires on every cursor save (the first or second); #6712's `sync:held_settled` and `sync:retry_deferred` fire on the
+ * cursor step that holds a failed entry or defers a changed one (the first or second), and only in a round that has one.
*/
const KILL_POINTS = [
{ point: 'publication:before_commit', per: 'page' }, { point: 'publication:after_commit', per: 'page' },
{ point: 'consumer:preparing', per: 'page' }, { point: 'lane:applied', per: 'group' },
{ point: 'sync:before_group_admission', per: 'group' }, { point: 'sync:mid_checkpoint', per: 'save' },
+ { point: 'sync:held_settled', per: 'save' }, { point: 'sync:retry_deferred', per: 'save' },
] as const satisfies ReadonlyArray<{ point: FaultPoint; per: 'page' | 'group' | 'save' }>;
const MAX_RECOVERY_RUNS = 2;
/** Oracle tests are named by the persistence gate's violation class (scripts/persistence/model.ts) they would report. */
@@ -825,7 +827,7 @@ scenario(['a', 'b', 'c'], 'managed sync converges after a seeded kill loop of cl
// The fault plan, drawn from the seed before anything runs: one kill per round.
const kinds = [runs('a') && 'client', runs('b') && 'serve', runs('a') && runs('b') && 'serve+client'].filter(Boolean) as Array<'client' | 'serve' | 'serve+client'>;
const perRound = Math.min(100, Math.max(10, Math.round(NOTES * 0.1)));
- // Victims and fault points cycle from seeded offsets, so six kills reach every point and each victim kind twice.
+ // Victims and fault points cycle from seeded offsets, so six kills reach each victim kind twice and KILL_POINTS.length kills reach every point.
const offset = b.between(0, 2), pointOffset = b.between(0, KILL_POINTS.length - 1);
const plan = Array.from({ length: kinds.length ? KILLS : 0 }, (_, k) => {
const kind = kinds[(k + offset) % kinds.length];