Skip to content

fix: refresh run snapshots after concurrent publication - #145

Merged
zzxwill merged 1 commit into
masterfrom
fix/run-snapshot-publication
Oct 21, 2026
Merged

zzxwill merged 1 commit into
masterfrom
fix/run-snapshot-publication

Conversation

@zzxwill

@zzxwill zzxwill commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Concurrent jury reply or finding commands can read different event-log snapshots and finish their atomic renames in reverse order. The older command then leaves run.json missing newer completed replies or finding updates, even though events.ndjson is correct. Two synchronized real-CLI regressions fail on merged master and pass with this change.

Centralize event publication: fold the log, replace the snapshot atomically, then reread the log and retry if it changed. Review, console startup, reply and finding publishers all use the helper. Errors still propagate and temporary snapshots are cleaned up.

Validation on a51178c1e78256a795720807b8d8d7c2795bc88d:

  • node --test test/run-publication.test.js test/runs.test.js test/cli-commands.test.js: 22 passed.
  • node scripts/ci-check.mjs test: 309 passed, exit 0.
  • node scripts/ci-check.mjs test:package: 55 packaged files and installed CLI checks passed, exit 0, including the concurrent-publication regressions.
  • Actual Jury: exit 0, NO NEW FINDINGS, clean after one round in 71.5 seconds on this exact unchanged head. Codex selected as reviewer and judge; no judge triage was necessary. The read-only reviewer ran syntax checks but could not rerun file-writing tests; the independent checks above passed.

The fix converges to the current log after concurrent publishers complete successfully. It does not make the event append and snapshot write a crash-atomic transaction; a killed publisher can still require a subsequent publication. No provider sessions or credentials are involved in the deterministic regressions.

Actual executed command:

GIT_AUTHOR_NAME=zzxwill GIT_COMMITTER_NAME=zzxwill node bin/jury.js review --dir /Users/bytedance/Documents/Codex/2026-10-20/task/codejury-run-snapshot --trunk master --reviewer codex --judge codex --rounds 2 --summary 'Review the focused run.json publication fix. Two deterministic IPC-gated CLI regressions reproduce an older publisher erasing a newer reply or finding update while events.ndjson remains correct. All production publishers now fold a log snapshot, atomically replace run.json, then recheck and retry if the log changed. Independent validation passed 22 focused tests, 309 full tests and installed-package checks. Assess concurrency correctness and error handling. This guarantees convergence after successful publishers finish; it does not promise crash-atomic event and snapshot updates. Keep unrelated deferred bugs out of scope.' --web=false --push=false > ../run-snapshot-review-evidence/jury-first.log 2>&1

@zzxwill
zzxwill marked this pull request as ready for review October 21, 2026 18:44
@zzxwill
zzxwill merged commit faf2add into master Oct 21, 2026
8 checks passed
@zzxwill
zzxwill deleted the fix/run-snapshot-publication branch October 21, 2026 18:45
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