Skip to content

feat(core,cli,web): release provenance, signed tags and dg release verify (E5) - #381

Merged
PastaPastaPasta merged 14 commits into
masterfrom
feat/e5-release-provenance
Oct 5, 2026
Merged

PastaPastaPasta merged 14 commits into
masterfrom
feat/e5-release-provenance

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Epic E5, release provenance. Stacked on #372 (D6 default protection). Until #372 merges, this diff includes its commits. The commits that belong to this PR are fb790bc7, 23bdd86d and 37d6ff8a.

What it adds

  • Shared rule release_provenance. Rust is in crates/forge-core/src/rules/provenance.rs and TS in forge-web/lib/rules/releaseProvenance.ts. Both are checked against the vectors release_provenance__*. The rule works out what a release's tag pointed at when the release was first published, from on-chain tag history:
    • The baseline is the tag's tip at the first publish. It is folded by resolve_ref over the updates written up to then.
    • A tag first pushed after the publish (an import that wrote the release before the code) uses its first tip as the baseline, flagged as late.
    • A release that records its own commit (a sealed targetOid, or a later release.targetOid) is judged against that record only when the tag named nothing at publish.
    • Verdict: unchanged, restored, moved, deleted, diverged or missing. Each later move is listed with who made it and when, and assets added, removed or replaced since the first publish are listed by name.
  • Signed tags. split_signed_tag and verify_tag_signature reuse the feat(signatures): Verified badges on signed commits from profile keys (P1-7, 2/2) #348 signature code and verify against members' profile keys. Vectors are tag_signature__* and the fixture key is forge-contracts/fixtures/signing/t.pub.
  • Web.
    • The release page has a provenance card: baseline, now, each move, asset changes and the tag signature.
    • The releases list puts a red "changed since publish" chip on altered releases.
  • CLI. dg release verify <repo> <tag> prints the same checks (--json supported). It exits with E504 when the tag moved, was deleted, races or was never pushed, or when the assets changed. Inside a clone that holds the tag object, it also checks the tag's signature.
  • RepoService::ref_history returns one ref's full update history plus the config timeline.
  • Docs: docs/errors.md (E504), docs/guides/collaborating.md.

Review fixes (37d6ff8a)

  • A tag that was deleted or racing at the first publish is no longer treated as a late tag. A later force-push used to become the new baseline and read as "unchanged"; it now reads as a move. New vector: deleted_at_publish_is_not_late.
  • A pin no longer overrides the tag's history at publish. An annotated tag's ref names a tag object, not the pinned commit, so that comparison always said "moved". New vector: pin_yields_to_tag_history. pinned_by_release now covers a late tag.
  • Sealed draft revisions no longer count as the first publish.
  • dg release verify reads signing keys only for a signed tag object present in local git. A failed key read now leaves the signature "not checked" instead of failing the whole command.
  • Asset names sort by code point on both sides. New vector: assets_sorted_by_code_point.
  • The list chip leaves out tags that were never pushed.
  • The card's signature row no longer shows a stale or premature state.

Not in this PR

The brief's "force-pushed" and "protection lifted/restored" badges in a branch/ref timeline are not here. The web app has no branch or ref timeline to put them in; PR timelines already say "force-pushed". That needs a new ref-history view and is left for a follow-up.

Evidence

Live on devnet sakura: dash-forge-qa/evidence/p0/release-provenance/live-e5-a2.txt (script live-e5.sh):

  • An unchanged tag verifies with exit code 0.
  • An owner force-moving the tag exits 5 with E504, naming the move.
  • A tag signed with a key on the owner's profile shows Verified.

Screenshots (light, and dark at 390 px): e5-provenance-v0.1.0-*.png (moved), e5-provenance-v0.3.0-*.png (signed, unchanged), e5-releases-list-*.png (chip).

Gates

  • cargo fmt --check, cargo clippy -D warnings, and cargo test for forge-core rules and dg release
  • tsc, eslint, and vitest for lib/rules (845 tests) and release-provenance

🤖 Generated with Claude Code

PastaPastaPasta and others added 4 commits October 4, 2026 13:07
…rify

Each release's page gets a Provenance card built from the chain: what the tag pointed at when the release was first published and who pushed it, every later move or deletion, asset changes since the first publish, the tag's signature, and whether tags are protected. It is red when the tag moved, was deleted or races, or the assets changed; the release list marks such releases. dg release verify prints the same and exits E504.

Shared rules with vectors: release_provenance (baseline from the tag's history at publish, or the release's own recorded commit, so a later release.targetOid plugs in), and verify_tag_signature (git verify-tag's split, the commit verifier's keys and rules).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A tag deleted or racing at the first publish is no late tag, so a later push reads as a move instead of a new baseline. A release's pin counts only when the tag named nothing at publish (an annotated tag's ref names a tag object, not the pinned commit). Sealed drafts are not publishes. dg release verify reads signing keys only for a signed tag object here, and a failed read leaves the signature unchecked instead of failing the command. The list chip skips never-pushed tags; asset names sort by code point on both sides; the tag-signature row no longer shows a stale or premature state.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad71c8e4-b35a-40ab-aa1f-c9b09b9d77f2
📥 Commits

Reviewing files that changed from the base of the PR and between 34545b8 and c7f6ac2.

⛔ Files ignored due to path filters (1)
  • forge-contracts/fixtures/signing/t.pub is excluded by !**/*.pub
📒 Files selected for processing (43)
  • crates/dg/src/cost.rs
  • crates/dg/src/errors.rs
  • crates/dg/src/main.rs
  • crates/dg/src/release.rs
  • crates/dg/src/release_verify.rs
  • crates/dg/src/signing.rs
  • crates/forge-core/src/repo.rs
  • crates/forge-core/src/rules.rs
  • crates/forge-core/src/rules/provenance.rs
  • crates/forge-core/src/rules/signature.rs
  • docs/contracts/forge-v2.md
  • docs/errors.md
  • docs/guides/collaborating.md
  • forge-contracts/fixtures/signing/README.md
  • forge-contracts/vectors/release_provenance__assets_changed.json
  • forge-contracts/vectors/release_provenance__assets_sorted_by_code_point.json
  • forge-contracts/vectors/release_provenance__deleted.json
  • forge-contracts/vectors/release_provenance__deleted_at_publish_is_not_late.json
  • forge-contracts/vectors/release_provenance__inert_plain_update_on_protected_tag.json
  • forge-contracts/vectors/release_provenance__late_tag.json
  • forge-contracts/vectors/release_provenance__missing.json
  • forge-contracts/vectors/release_provenance__moved.json
  • forge-contracts/vectors/release_provenance__noop_repush_is_no_move.json
  • forge-contracts/vectors/release_provenance__pin_yields_to_tag_history.json
  • forge-contracts/vectors/release_provenance__pinned_by_release.json
  • forge-contracts/vectors/release_provenance__republished_keeps_first_publish.json
  • forge-contracts/vectors/release_provenance__restored.json
  • forge-contracts/vectors/release_provenance__unchanged.json
  • forge-contracts/vectors/tag_signature__last_block_signs.json
  • forge-contracts/vectors/tag_signature__ssh_tampered.json
  • forge-contracts/vectors/tag_signature__ssh_unknown_key.json
  • forge-contracts/vectors/tag_signature__ssh_verified.json
  • forge-contracts/vectors/tag_signature__unsigned_annotated.json
  • forge-web/components/repo/release-provenance.tsx
  • forge-web/components/repo/releases-content.tsx
  • forge-web/components/repo/signature-badge.tsx
  • forge-web/lib/repo/release-provenance.test.ts
  • forge-web/lib/repo/release-provenance.ts
  • forge-web/lib/rules/conformance.test.ts
  • forge-web/lib/rules/index.ts
  • forge-web/lib/rules/releaseProvenance.ts
  • forge-web/lib/rules/resolveRef.ts
  • forge-web/lib/rules/signature.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

PastaPastaPasta and others added 10 commits October 4, 2026 14:40
Brings #372's review fixes and master. rules.rs keeps the protection runner beside master's repo-name and mirror runners; tag_signature stays routed to the signature runner.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
rules.rs declares both provenance and master's ref_collision.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The summary says what it checks and when it fails, in under 40 words; how it checks moves to the details.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
conformance.test.ts imports both verifyTagSignature and master's key-handoff helpers (#375).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 0d65e4b into master Oct 5, 2026
34 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/e5-release-provenance branch October 5, 2026 13:40
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