Skip to content

feat(sdk): each commit of a round has an author receipt in Git notes #479

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 each author session to the actual commit that it wrote. No code writes this binding today, so a round cannot prove who wrote each commit.

Goal

Each commit of a round has an author receipt. The receipt is a Git note under the ref refs/notes/nicely-sessions, attached to the full commit SHA. This follows D069 section 3 and the publication part of section 4.

Acceptance rules

  1. The owned commit path reads the context of its invocation, creates the commit, resolves its actual SHA, then writes the receipt. It never reads a global "current session" file.
  2. Each receipt holds the captured author sessions, the capture source and the harness version.
  3. A launcher can write the receipts after the session ends only when it owns the worktree exclusively and records the range before and after. It accounts for each commit in that range. It rejects an unexpected writer or a head that moved.
  4. For several authors, the author set of the round is the union of its receipts for each commit.
  5. A history rewrite makes new SHAs, so the old receipts and the review become invalid. An owned rewrite records its writer and keeps the recorded source authors in new receipts. A rewrite that is not supported fails until a new captured round records the bindings.
  6. A commit trailer can repeat the captured ID, but a copied trailer alone is not a receipt.
  7. The publication recipe pushes the notes ref with the source branches and verifies both writes, because an ordinary branch push does not send Git notes. It exports a portable receipt bundle that holds the source head and the object ID of the notes ref.

Examples

  • Success: two author sessions a1 and a2 each write one commit of a round. Each commit has its receipt, and the author set of the round is a1 and a2.
  • Failure: a commit of the round has no receipt. The export fails and names that SHA.
  • Failure: the publication pushes the branch but not the notes ref. The recipe fails and names the notes ref.

Check

Scenarios under testdata/script/ prove each example. 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