Skip to content

ci: fix provenance tests (fetch-depth 0) and harden the workflow - #7

Merged
Nazim22 merged 1 commit into
mainfrom
pingu/ci-fetch-depth-and-hardening
Jul 25, 2026
Merged

ci: fix provenance tests (fetch-depth 0) and harden the workflow#7
Nazim22 merged 1 commit into
mainfrom
pingu/ci-fetch-depth-and-hardening

Conversation

@Nazim22

@Nazim22 Nazim22 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Follow-up to #5. The first CI run on main went red: 7 provenance/replay tests failed with

fatal: ambiguous argument '8488cb333157208e9781f8d3c32ea0dda587a368^{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 (see docs/EXAM.md), and that commit is only reachable through the full ref graph.

Reproduced locally rather than inferred:

$ git clone --depth 1 --single-branch --branch main <repo> shallow
$ cd shallow && git rev-list --count HEAD
1
$ git cat-file -e 8488cb3^{commit}; echo $?
1        # unreachable

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 privilege
  • Node matrix 18/20/22, so engines.node >= 18 in package.json is proven rather than asserted (Node 18 was already fine: all 7 failures shared the single Git cause, 223/230 passed)
  • runs npm run bench alongside npm test

Note 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

…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>
@Nazim22
Nazim22 merged commit 415f26f into main Jul 25, 2026
5 checks passed
@Nazim22
Nazim22 deleted the pingu/ci-fetch-depth-and-hardening branch July 25, 2026 17:54
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