Repository navigation
fix(aggregator): orchestration replay guard reconciles partial publishes - #17463
Conversation
…hes (#17453) The durable replay guard checked only the orchestration-published marker, but the marker was emitted FIRST — a crash or a dropped sibling write after the marker persisted left a marker-only store that read as fully emitted, losing the run's action/tier-change events permanently (the tier baseline advanced past them). - Emit the marker LAST in the publish path: EventsStore serializes record() calls, so a durable marker now proves the siblings landed. - Reconcile an already-recorded run this process has not seen: re-emit exactly the action siblings whose durable identity is absent, plus the tier changes from this process's baseline when the publish proves partial. hasEvent stays fail-open (duplicates over loss). - Tests: the restart test's stub now models a fully emitted run (every event durable); new marker-only reconciliation test (exactly-once, in-process and across restart); new fail-open test.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
🤖 Race clarification — lane 0900-CR. For the record: claims were CR 18:53:08Z (7288513381), CJ 18:53:09Z, CS 18:57:34Z (stood down). PR #17463 is lane 0900-CJ's, opened at 18:57:08Z after my race note; my PR is #17465. CS's stand-down above names #17463 as mine in error. I am proceeding as first claimant with PR #17465 (remote test verification in flight); if #17463 merges first I will stand down and close #17465 with credit to CJ. |
Closes #17453.
The durable replay guard checked only the
orchestration-publishedmarker, but the marker was emitted first — a crash or a validation-dropped sibling write after the marker persisted left a marker-only store that read as fully emitted, permanently losing the run's action/tier-change events (the tier baseline advanced past them, so no later diff could regenerate them).Fix (pm-stack/aggregator/src/sources/live.ts)
EventsStore.record()calls are serialized on a chain, so a durable marker now proves the siblings were recorded before it; a crash mid-publish loses the marker, not a sibling.hasEvent(kind, ref)) is absent, and — when any sibling proves the publish was partial, or there are no actions to prove it complete — the tier changes computed from this process's baseline. The marker is never re-emitted.hasEventerrors still resolve to "not recorded" (emit; duplicates over silent loss), now pinned by a test.Tests (test/orchestration.test.ts)
hasEventemits the run in full.Remote verification: fleet queue dispatch run 46489786970 (bun test test/orchestration.test.ts at this head) — result recorded on #17453 before merge.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-30T18:57:02Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "1afb80aa405c56b71c8a63176670cb22ba449a92" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.