ci: fix provenance tests (fetch-depth 0) and harden the workflow - #7
Merged
Conversation
…den workflow The first CI run on main failed 7 provenance/replay tests with 'fatal: ambiguous argument 8488cb3^{tree}: unknown revision'. Root cause: actions/checkout defaults to a shallow single-branch clone. The replay and provenance suites verify the sealed exam runtime by reading its exact Git objects at commit 8488cb3, which is reachable only through the full ref graph. Reproduced locally: 'git clone --depth 1 --single-branch' yields 1 commit, main only, and the frozen commit is unreachable. Fixes it with fetch-depth: 0 and a comment explaining why it is load-bearing, so it does not get optimised away later. Also hardens the workflow while here: - permissions: contents: read (least privilege) - node matrix 18/20/22, proving the engines.node >= 18 claim in package.json rather than asserting it - runs npm run bench alongside npm test Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #5. The first CI run on
mainwent red: 7 provenance/replay tests failed withRoot cause.
actions/checkoutdefaults to a shallow, single-branch clone. The replay and provenance suites verify the sealed exam runtime by reading its exact Git objects at commit8488cb3(seedocs/EXAM.md), and that commit is only reachable through the full ref graph.Reproduced locally rather than inferred:
Fix:
fetch-depth: 0, with a comment explaining why it is load-bearing so it does not get "optimised" back to a shallow clone later.Hardening included while here:
permissions: contents: read— least privilegeengines.node >= 18in package.json is proven rather than asserted (Node 18 was already fine: all 7 failures shared the single Git cause, 223/230 passed)npm run benchalongsidenpm testNote this is not only a CI concern: it documents a real property of the repo. The sealed commit must stay reachable, so the
dae/*branches that anchor it must never be deleted.🤖 Generated with Claude Code