Skip to content

fix: preserve hook evidence and report durable replay progress - #59

Merged
hopeatina merged 1 commit into
mainfrom
codex/durable-hook-replay-20260904
Sep 4, 2026
Merged

hopeatina merged 1 commit into
mainfrom
codex/durable-hook-replay-20260904

Conversation

@hopeatina

Copy link
Copy Markdown
Contributor

Live OrgX health shows an active Codex 0.1.14 installation with a growing hook backlog and no observed replay. Before upgrading it to the newer automatic replay implementation, this fixes evidence-loss and reporting defects in that implementation.

  • Advance the upload cursor only across complete newline-terminated records, with byte-accurate UTF-8 and CRLF handling. Keep an incomplete tail for the next pass.
  • Preserve malformed records and block their batch for diagnosis. Keep the cursor unchanged on failed uploads and write cursor replacements atomically.
  • Retain an oversized spool because its independent hook writers do not share a rotation lock. The former truncate-after-upload path could erase events appended during upload. Disk reclamation requires writer coordination.
  • Prevent overlapping replay ticks in one peer. Read health from the same durable cursor, expose capped counts and partial tails, and stop presenting Work Graph upload time as an execution receipt.
  • Publish 0.1.20 through a PR validation job and a dependent push release job that publishes the exact tested tarball. Existing tagged releases remain supported.

Validation: npm run check passes; 29 focused replay/health tests pass locally, including partial writes, UTF-8 boundaries, upload-time appends, failure retention and cursor-based health. Full npm test runs in the added PR CI; local dependency installation was interrupted by the environment's network approval layer.

This release does not upgrade or sign in the user's running Darwin client. Live backlog drainage remains unverified until that client is updated and restarted. Delivery remains at least once across crashes; no exactly-once claim is made.

@hopeatina
hopeatina merged commit 1fdae43 into main Sep 4, 2026
2 checks passed
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