Repository navigation
feat(relay): add a CAS publication receipt for closed reviewed revisions - #1337
Conversation
A reviewed result can be placed on a plain Git remote without reopening the run or synthesizing change-request or landing facts. Closes #1211 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e76d67e54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function pushWithObserve(sourceRepo, remoteUrl, destinationRef, expectedOldOid, publishedOid) { | ||
| try { | ||
| casPush(sourceRepo, remoteUrl, destinationRef, expectedOldOid, publishedOid); |
There was a problem hiding this comment.
Route publication through canonical recovery
Calling casPush here makes this standalone command a second remote-mutation path: unlike canonical recovery, it does not re-inspect under the run lock with the expected action key before pushing. The destination lease only guards the remote ref and cannot establish that the run still authorizes this lifecycle effect, so publication must be performed by the existing recovery writer rather than directly from this helper.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
| function receiptPathFor(runDir, remoteUrl, destinationRef, publishedOid) { | ||
| const digest = crypto.createHash("sha256") | ||
| .update([remoteUrl, destinationRef, publishedOid].join("\n")) | ||
| .digest("hex") | ||
| .slice(0, 16); | ||
| return path.join(runDir, `publication-receipt-${digest}.json`); |
There was a problem hiding this comment.
Keep publication evidence out of a receipt sidecar
Every successful publication creates a publication-receipt-*.json authority beside the journal even though inspection and recovery fold only events.jsonl; the receipt can therefore be missing, replaced, or disagree with the append-only lifecycle record. This reintroduces the explicitly prohibited evidence-sidecar model, so publication evidence should converge through the canonical fact/recovery mechanism rather than a separate run-local receipt.
AGENTS.md reference: AGENTS.md:L6-L10
Useful? React with 👍 / 👎.
| const review = lastMatching(facts, (fact) => ( | ||
| fact.type === "review_recorded" | ||
| && PASSING_VERDICTS.has(fact.payload.verdict) | ||
| && normalizeOid(fact.payload.reviewed_sha) === reviewedSha | ||
| && fact.payload.done_criteria_sha256 === record.contract.done_criteria_sha256 |
There was a problem hiding this comment.
Respect terminal fact ordering when loading the reviewed result
Because lastMatching scans the entire journal and skips non-passing reviews, a schema-valid journal such as pass -> changes_requested -> run_closed, or one with review evidence appended after the close, is accepted using the stale pass even though canonical inspection treats the immediately preceding review and its prior verification as the terminal binding. The command can consequently publish a revision that is not a valid derived reviewed_result_ready; derive the exact terminal evidence in journal order and enforce the bound reviewer instead of searching globally.
AGENTS.md reference: AGENTS.md:L6-L10
Useful? React with 👍 / 👎.
| kind: "plain-git-publication", | ||
| run_id: reviewedResult.run_id, | ||
| reviewed_sha: reviewedResult.reviewed_sha, | ||
| remote_url: remoteUrl, |
There was a problem hiding this comment.
Redact credentials from the recorded remote URL
When --remote is an authenticated URL such as an HTTPS URL containing userinfo, this field copies the password or token verbatim into the durable receipt and, with --json, back to stdout where automation commonly captures it. Keep the transport URL only for the Git invocation and record/return a credential-stripped remote identity.
Useful? React with 👍 / 👎.
|
r2 opus CR parked until sol r2: inspect-helpers uses FIRST terminal fact; r1 sol asked for LAST reviewed_result_ready. Will not flip-flop until both reviewers plus inspect-helpers.js agree. Receipt expected-old identity is a separate nit/follow-up. |
Closes #1211
Plain Git publication for a closed
reviewed_result_readyrevision. CAS via--force-with-lease=<ref>:<expected-old-oid>, thenls-remoteobservation. Receipt records remote, destination ref, expected old OID, published OID. Retry converges topublished/already_published. Concurrent movement fails closed without force-push. No change-request or landing facts.Focused tests:
node --test tests/relay/scripts/publish-reviewed-revision.test.js(7 passed).