Skip to content

fix(exact-review): snapshot durable tuple before publication#846

Merged
brokemac79 merged 2 commits into
mainfrom
codex/csw-060-pr93584-completion-gap
Jul 25, 2026
Merged

fix(exact-review): snapshot durable tuple before publication#846
brokemac79 merged 2 commits into
mainfrom
codex/csw-060-pr93584-completion-gap

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the exact-review batch publisher so its tuple base snapshot comes from the durable isolated state checkout, not the empty worker directory. Also repair the CI fixture exposed by the current main admission behavior.

Problem

A re-review of openclaw/openclaw#93584 completed its exact worker successfully, produced a valid review artifact, and created the review-started placeholder, but never updated the durable review comment/status.

The first terminal loss was in batch run 30141831366 at 2026-07-25 03:16:37Z:

RecordTupleError: Invalid record tuple openclaw-openclaw/93584: missing comparable state-mutation timestamp

The batch workflow reported success even though it recorded that individual publication as permanent tuple_protocol_invalid; queue completion then removed the active item and placed it in the DLQ. This PR deliberately does not replay, requeue, or otherwise mutate that live item.

Timeline and cause

  • 03:06:21Z: @clawsweeper re-review on #93584.
  • 03:09:01Z–03:12:37Z: exact worker run 30141719145 succeeded; its artifact contains valid item_updated_at (03:10:15Z) and reviewed_at (03:12:20.195Z).
  • 03:10:14Z: review-started placeholder posted.
  • 03:16:37Z: the publisher failed above because publish-event-result captured the base tuple from the empty worker root. It later compared both the fresh artifact and the durable tuple against that empty base.

Causal classification: #840 introduced the isolated artifact/root flow that exposed this missing durable-base capture. #829/#830/#832 are predecessor tuple-protocol work, not sufficient causes. #842/#843 concern dispatch validation and are unrelated to the production publication failure. The separate stale-publication revision conflict observed for #111368 is also unrelated.

Implementation

  • Let captureEventBaseSnapshot read a specified source root.
  • In publish-event-result, snapshot from publishRoot() before applying artifacts to the isolated worker directory.
  • Preserve existing behavior when no durable state root is configured.
  • Restore fix(exact-review): retain actionable dispatch 422 detail #843's unclassified-422 fixture by mocking the verified /pulls/842 admission read and its head SHA. This is test-only; no production dispatch behavior changed.

Validation

  • pnpm run build:all
  • node --test --test-name-pattern='event base snapshot uses durable state' test/repair/event-record-store.test.ts
  • pnpm run lint:repair
  • pnpm run build:dashboard
  • node --test test/dashboard-worker.test.ts — 208 passed, 0 failed
  • pnpm run lint:scripts
  • pnpm exec oxfmt --check src/repair/event-record-store.ts src/repair/publish-event-result.ts test/repair/event-record-store.test.ts test/dashboard-worker.test.ts
  • git diff --check

The lifecycle regression constructs the #93584 topology: an empty worker, an existing durable tuple, and a fresh exact-review tuple. It proves the old base capture throws the production error and the durable-state capture resolves the fresh tuple as open.

The initial CI failure was deterministic but separate: #843 changed verified PR admission to read /pulls/<number>, while its test only mocked /issues/<number>. The dispatcher therefore never ran and the test observed an empty payload. The added fixture proves the real verified-head flow.

The full affected event-record test file has two pre-existing Windows fixture failures in unchanged cases: their remote tuple helpers write absolute decision_packet_path values, while tuple validation correctly requires records/... paths. They are outside this lifecycle patch.

Risk and rollback

The lifecycle change only selects the correct source for the existing baseline snapshot; tuple ordering, stale-event handling, retry/DLQ accounting, and routing semantics are unchanged. The CI follow-up is test-only. Roll back commits 0ea41f918ab280e44b909be56a7ad4fe049eeddc and 0b4839236a to restore prior behavior.

Review closeout

  • Lifecycle dirty patch: codex review --uncommitted — clean; no accepted/actionable findings.
  • Lifecycle branch against actual base: codex review --base origin/main — clean; no accepted/actionable findings.
  • CI follow-up dirty patch: codex review --uncommitted — clean; no accepted/actionable findings.
  • Final branch against actual base: codex review --base origin/main — clean; no accepted/actionable findings.

No live queue, state, review command, label, comment, or merge operation was performed by this PR preparation.

@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(exact-review): snapshot durable tuple before publication This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@brokemac79
brokemac79 merged commit 4707e59 into main Jul 25, 2026
10 checks passed
@brokemac79
brokemac79 deleted the codex/csw-060-pr93584-completion-gap branch July 25, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant