Skip to content

feat(relay): add a CAS publication receipt for closed reviewed revisions - #1337

Merged
sungjunlee merged 2 commits into
mainfrom
frontier/1211
Sep 16, 2026
Merged

sungjunlee merged 2 commits into
mainfrom
frontier/1211

Conversation

@sungjunlee

Copy link
Copy Markdown
Owner

Closes #1211

Plain Git publication for a closed reviewed_result_ready revision. CAS via --force-with-lease=<ref>:<expected-old-oid>, then ls-remote observation. Receipt records remote, destination ref, expected old OID, published OID. Retry converges to published / 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).

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>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2e97fd22-bed3-4e00-98f4-54dbb7f1ec50


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T03:04:03.472858Z 5e76d67 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +314 to +316
function pushWithObserve(sourceRepo, remoteUrl, destinationRef, expectedOldOid, publishedOid) {
try {
casPush(sourceRepo, remoteUrl, destinationRef, expectedOldOid, publishedOid);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +268 to +273
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`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +130 to +134
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@sungjunlee

Copy link
Copy Markdown
Owner Author

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.

@sungjunlee
sungjunlee merged commit 5dcd072 into main Sep 16, 2026
10 checks passed
@sungjunlee
sungjunlee deleted the frontier/1211 branch September 16, 2026 00:46
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.

Plain Git publication receipt for reviewed revisions

1 participant