Repository navigation
feat(deployments): require source commit provenance for first-party records - #257
Merged
truthixify merged 1 commit intoOct 18, 2026
Conversation
|
@Jerryvic911 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
truthixify
approved these changes
Oct 18, 2026
truthixify
left a comment
Contributor
There was a problem hiding this comment.
The provenance model is fail-closed and matches #232: deployment-script records require an existing full commit, source-verified claims are rebuilt before write, unverifiable history is explicit, and immutable EVM code is checked outside compiler-declared slots. Local verification passed: typecheck, 63 tests, and manifest check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #232
Closes #232
Problem
Every first-party manifest entry has
sourceCommit: null, so an operator cannot tie deployed bytecode back to reviewed source. Nothing separated "unknown history" from "proven source", and re-recording a contract silently wiped any commit that had been recorded.Changes
Schema and validation
provenancefield todeployments/schema/v1.json. Schema stays at v1, since adding an optional field does not need a bump.provenance, with one of two statuses:source-verified:sourceCommitis a full 40-hex commit that rebuilds toartifactHash.unverifiable: historical record,sourceCommitisnull, and areasonis required.source-verifiedrecord with a null commit;unverifiablerecord with a commit;deploy-scriptrecord that isunverifiable.Recording
recordfordeploy-scriptrecords now needs--source-commitasHEADor a full hash. Short hashes and branch names are rejected, and the commit must exist in the repo.unverifiableunless a commit is supplied. PreviouslysourceCommitandversionwere overwritten withnull.Verification
verify-sourcecommand: checks out each source-verified commit in a throwaway git worktree, rebuilds it, and compares the artifact hash.ERC6538Registry), the build is compared against the deployed code everywhere except the immutable slots.stellar/deploy.shdoes.Backfill
attestcommand marks a historical record source-verified only if a commit reproduces its recorded hash.--searchtries the commits that touched the chain's sources before the deployment.unverifiablewith a reason.manifest.jsonis regenerated.Docs are updated in
deployments/README.md.Testing
npm run typecheck,npm testandnpm run checkinscripts/deployment-manifest.test/provenance.test.tsuse a real temporary git repo and a fake builder. They cover commit resolution, dirty-tree detection, a matching and a differing build, null, malformed and unknown commits, worktree cleanup, immutable handling, and the validation rules.units.test.tsandcheck.e2e.test.tsgained the new field.Not tested / limitations
stellar contract optimize(Stellar) builders have not been run end to end. Only the logic around them is tested, with a fake builder.unverifiable. No commit was claimed without a reproduced hash.verify-sourceyet, because the CI job has no Rust or Stellar toolchain. This is a possible follow-up.check.e2e.test.tsdo not run on Windows because of the tsx spawn and line endings. That predates this change and is not touched here.