Skip to content

feat(sdk): the reviewer launcher writes a review receipt on the reviewed head #480

Open

Description

@pascalandy

Outside the plan: this card comes from the refinement of #451 after the decision of #450 (D069). Pascal approved this split on 2026-11-04.

Problem

D069 binds the reviewer session to the exact range that it reviewed. No code writes this binding today. A native child of an author can look like a different session, because it has a different thread ID.

Goal

The reviewer launcher starts a new root session on a frozen range. After a completed review, it writes a review receipt on the reviewed head. This follows D069 section 4 and section 7.

Acceptance rules

  1. Before it starts the reviewer, the launcher resolves the full base SHA and head SHA of the round and passes that exact range as the review target.
  2. The reviewer is a new root session with its own invocation context. The launcher does not resume the author, fork the conversation of the author or use a native child.
  3. After the review, the launcher checks again that the head did not move and that the source tree is clean.
  4. The review receipt is a Git note on the reviewed head, under refs/notes/nicely-sessions. It keeps the author receipt of that head. It names the base, the head, the captured reviewer session, the harness version, the root launch and the completed result.
  5. A failed review, an interrupted review or a missing capture writes no completed receipt. A completed review with findings still follows the existing finding and resolution gates.
  6. A Codex subagent hook reports the session_id of its parent. The skill therefore starts the reviewer as a separate root session through the launcher. The emitted IDs decide inequality, not a new process.

Examples

  • Success: a Codex root session reviews the range of a Claude Code author. The receipt holds two different IDs that nobody typed.
  • Failure: the head moves during the review. The launcher writes no receipt and asks for a new review.
  • Failure: a native child of the author session reviews. Its reported ID equals the author ID, so it does not count as a reviewer.

Check

Scenarios under testdata/script/ prove each example, with recorded hook inputs that include a Codex SubagentStart. scripts/template-test.sh passes.

by Opus-5.5 via Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-ready-for-agentValidated work, sufficiently specified for an autonomous agent2-type:featureNew or improved functionality; specification lives in the issue3-pty:p2Normal planned work; default when no priority is established

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions