v1.91.176.0 cso: ignore the compiled helpers' leading #! line in the release contract's preparationSha256 (both sides) (#3333)

* cso: ignore the compiled helpers' leading #! line in preparationSha256, on both sides of the release contract

S1 (#3312) rewrote only line 1 of lib/cso/verifier.ts and
lib/cso/preparation-container.ts. That shebang is an unused string in the
compiled helper binaries, but it moved preparationSha256, so qualify run
39535948607 refused the run-5 statements staged at 133cb36 with
STALE_RUNTIME_QUALIFICATION. Garry chose this narrow rule (option 2).

The release contract re-measures a recorded preparationSha256 that differs
from the checkout's at the staged commit (git history), accepts a record
that matches it under the current or the legacy rule, and compares and
records the current-rule value. Both release workflows fetch full history.

* test(cso): prove the release-contract fingerprint rule without git history

Free-suite checkouts are depth 1, so the tests no longer read 133cb36 or
6b2b5f3. They rebuild the staged commit in a scratch repository from this
tree with both helpers' S1 shebang reverted. Its legacy fingerprint equals
the real run-5 record (b069f7ef...), so it is 133cb36's image source byte
for byte, and the contract accepts that record under the current rule.

* v1.91.176.0 stamp
This commit is contained in:
Garry Tan authored and GitHub committed 2026-10-21 19:22:49 +00:00
1 parent 4065e340e9
commit 514fbfdc97
10 files changed
+164 -16

No files matched your search

+10 -3
View File
@@ -280,12 +280,19 @@ policy (`ISOLATION_POLICY_HASH`, which covers the `cso-isolation-v1` policy
version and every limit), `preparationSha256` (a digest of every source byte
compiled or copied into a runtime image: the import closure of the image's
verifier and preparation helpers plus the image build context), and the
`build-inputs.json` revision. The staging run's `reviewed-inputs` job records
`build-inputs.json` revision. Each helper entrypoint's leading `#!` line is
hashed as absent: it is compiled into the binary as an unused string and never
runs inside the image. Every other byte of the helpers counts, and so does
every byte of every other file, shebang lines included. The staging run's `reviewed-inputs` job records
these values for its source commit as the `cso-requalification-triggers`
artifact. The ingress downloads that artifact from the verified staging run
into the evidence, and the promotion generator writes it into
`promotion.requalification`. Generation refuses triggers that differ from the
promoting checkout, so a trigger that changed between staging and promotion
`promotion.requalification`. When a recorded `preparationSha256` differs from
the promoting checkout's, generation re-measures it at the staged commit from
the checkout's git history. The record must match that commit under either the
current rule or the earlier rule that also hashed the helpers' `#!` lines, and
the current-rule value is what gets compared and recorded. Generation refuses
triggers that differ from the promoting checkout, so a trigger that changed between staging and promotion
requires a new staging run. The free suite's
[`cso-requalification.test.ts`](../test/cso-requalification.test.ts) compares
the committed catalog's recorded triggers with the current source and fails