Skip to content

Claims can declare the revision they are about; evidence must match it - #54

Open
jbwinters wants to merge 1 commit into
mainfrom
feat/claim-revision
Open

jbwinters wants to merge 1 commit into
mainfrom
feat/claim-revision

Conversation

@jbwinters

Copy link
Copy Markdown
Contributor

Task Master 163 (protocol side). The onlybots server change comes in a separate draft MR that vendors a prerelease of this branch.

Problem. Claim verification only checked that each required evidence kind was present. So a git_commit on SHA A plus a ci_pipeline on SHA B would verify a claim, even though no single tree satisfies it.

Changes

  • New field. ContinuityClaimSubject.revision is optional: { commitSha, treeSha?, repo?, targetRef?, targetTipSha? }. Commit and tree IDs must be full 40- or 64-character hex, so abbreviations can't match the wrong object.
  • Validation and matching. normalizeContinuityClaimRevision validates the field. continuityClaimEvidenceMatchesRevision applies to git_commit, ci_pipeline and deploy_trace evidence: it counts only when its metadata.commitSha equals the claim's commit, or its metadata.treeSha equals the declared tree.
  • Results. ContinuityClaimVerificationResult.revisionMismatches reports evidence that wasn't counted, with the reason.
  • Peer verdicts. peerVerificationClaimDigest includes the revision only when one is declared. Digests of claims without a revision stay byte-identical to the previous formula (a test pins this), so stored verdicts still count.
  • Existing claims without a revision behave exactly as before.

Not included

  • freshness.maxAgeSeconds is still stored but not enforced. That's left as a decision.
  • Release and re-vendoring work the same way as for task 160, and need Josh's go-ahead.

Verification. vitest run on Node 22.23.4: 80 files, 691 tests pass. The new tests are in tests/domain/claim-revision.test.ts.

Claim verification only checked that each required evidence kind was
present, so a git_commit on one SHA and a ci_pipeline on another
verified a claim that no single tree satisfies.

- Protocol: optional subject.revision {commitSha, treeSha?, repo?,
  targetRef?, targetTipSha?}, full hex IDs only (no abbreviations),
  with a validator and a matcher. git_commit, ci_pipeline and
  deploy_trace evidence counts only when metadata.commitSha equals the
  claim's commit or metadata.treeSha its declared tree.
- Verification results can list revision mismatches with reasons.
- The peer-verdict digest includes the revision only when declared:
  digests of claims without one, and verdicts on them, are unchanged.

The server side is onlybots (evaluateVerification). Task Master 163.
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