test(azure): bind Claude runtime bundle to exact provider artifact bytes - #319
Merged
Conversation
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.
Intent
Validate the exact current head of branch codex/azure-final-claude-acceptance. Relative to current main, the authored change strengthens the executable Claude runtime-bundle contract: every fixture artifact has distinct bytes, bin/claude must equal the exact supplied provider binary, its manifest digest must match those bytes, and Codex-only artifacts must remain absent. Production behavior is unchanged. R1, R2, R3, R5, R6, R7, and R8 are DONE; R4 and R9 remain PARTIAL until this fresh protected validation cell reaches close with its worktree disk released. R10 remains DROPPED, and C1 through C3 must not be promoted.
Run the full no-mistakes pipeline on this exact pushed head, including behavior tests through the Azure shard bridge, adversarial review, documentation checks, lint, push verification, PR creation, PR hygiene, and CI. No pull request exists for this branch; create it only in the pipeline's PR step and do not merge it during the run. Owner decisions at any gate must use the sealed signed owner-decision protocol for this exact run and gate. If review proves the contract inaccurate or incomplete, fix only tests/fm-azure-runtime-bundle.test.sh, push the corrected head to the same branch, and wait for green CI. Otherwise leave the head unchanged.
What Changed
tests/fm-azure-runtime-bundle.test.shnow writes a distinct payload per fixture ELF binary (the artifact's filename is embedded after the header) so bundled binaries are no longer byte-identical to each other.bin/no-mistakes,bin/claude,bin/gh, andbin/nodefrom the tarball and assertsbin/claudeequals the exact supplied provider artifact bytes and that all four extracted binaries hash to distinct SHA-256 digests.runtime.jsonmanifest's declared digest forbin/claudematchessha256:of the provider artifact bytes, alongside the existing assertions thatbin/codexandbin/codex-code-mode-hoststay absent.Risk Assessment
✅ Low: The change is a 13-line, test-only strengthening of an existing Claude runtime-bundle contract whose assertions I verified against the real producer's manifest and archive output; it touches no production code, and the modified fixture helper is used nowhere else in the repository.
Testing
Ran the single relevant test file (
tests/fm-azure-runtime-bundle.test.sh, all six cases green) on top of the already-green baseline test command, then drove the real bundle producer manually to capture the operator-visible artifact: bin/claude's shipped bytes equal the supplied provider binary, its manifest digest matches those bytes, all four binary payloads are distinct, and both Codex-only artifacts are absent. To show the strengthened contract is not vacuous I built a self-consistent misbound bundle (bin/node's bytes shipped as bin/claude with the digest updated to match) and ran each commit's assertion block against it verbatim: the parent commit accepts it, this change rejects it, and under the parent's identical-byte fixtures the misbinding is invisible at the payload level entirely - confirming the fixture-byte and assertion changes are one indivisible strengthening. The diff touches no non-test file, so production behavior is unchanged as claimed. No screenshot applies: this is a CLI/archive-contract change with no rendered surface, so the reviewer-visible evidence is the producer transcript, the generated runtime.json manifest, and the digest/discrimination tables.Evidence: Shipped Claude bundle: payload bytes vs supplied artifacts vs manifest digests
== operator view: shipped Claude runtime bundle == provider : claude provider_path : bin/claude == bin/* payload bytes vs supplied provider artifacts == member sha256(bundle bytes)manifest digest == supplied file bin/claude c223671b507cafb9 match YES bin/gh b379d12ff5ec8c39 match YES bin/gh-axi 425ba2cbe2b8b6e9 match n/a bin/no-mistakes 19291eff935e56aa match YES bin/node 8625501564b3823c match YES distinct payload digests among ['bin/no-mistakes', 'bin/claude', 'bin/gh', 'bin/node'] -> 4 of 4 bin/claude bytes == artifacts/claude bytes -> True manifest digest for bin/claude == sha256(artifacts/claude) -> True Codex-only artifacts absent -> bin/codex: True bin/codex-code-mode-host: TrueEvidence: Misbinding discrimination: old contract accepts the wrong provider bytes, new contract rejects them
Misbound bundle = bin/node's bytes shipped at bin/claude, with the manifest digest updated to match, i.e. a self-consistent bundle whose own digest recheck still passes. --- fixture regime: PARENT COMMIT 7b6b15f (all six artifacts written with identical bytes) --- supplied artifact digests: no-mistakes/claude/gh/node all c8b9669bd01ccecf misbound bundle payload vs correct bundle payload: NO - member bytes identical, defect invisible parent-commit assertions vs misbound bundle: PASS (accepted) this-change assertions vs misbound bundle: FAIL (rejected) this-change assertions vs correct bundle: FAIL (rejected) --- fixture regime: THIS CHANGE bb96be9 (each artifact's bytes carry its own name) --- supplied artifact digests: 19291eff935e56aa / c223671b507cafb9 / b379d12ff5ec8c39 / 8625501564b3823c misbound bundle payload vs correct bundle payload: YES - member bytes differ parent-commit assertions vs misbound bundle: PASS (accepted) this-change assertions vs misbound bundle: FAIL (rejected) this-change assertions vs correct bundle: PASS (accepted)Evidence: Generated runtime.json manifest from the real producer
Evidence: Producer build transcript
AZURE VALIDATION RUNTIME BUILT output=.../claude-runtime.tar.gz digest=sha256:bb4f7112948bf204d6e072276bc8e8c2e47a4053089caca6c8bd33d5b527c3e1Evidence: Targeted test run transcript
== tests/fm-azure-runtime-bundle.test.sh == ok - explicit local inputs produce a no-download byte-deterministic manifest-first bundle with normalized guest-safe tar and gzip metadata ok - Claude runtime production is byte deterministic and binds only the exact Claude provider artifact ok - real submit stages no-follow one-link bytes before validation, survives a hostile source swap, rehashes the payload copy, and rejects links plus credential-bearing members ok - incomplete runtime closures, missing Codex tools, existing outputs, unsafe inputs, wrong-architecture ELF files, and bad versions refuse without partial artifacts ok - two concurrent producers publish exactly one deterministic runtime without clobbering output or each other's staging files ok - the exact shipped guest recheck binds duplicate-free sealed schema, fixed Node and gh-axi closure, credential policy, and one-link inventory exit=0Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-azure-runtime-bundle.test.sh:593- tests/fm-azure-runtime-bundle.test.sh:593 proves distinctness of the four archived binaries but only bin/claude is bound to its source (line 592). A builder that cross-wired two non-provider members (e.g. bin/gh receiving node's bytes and bin/node receiving gh's bytes) would keep all four digests distinct and still pass. Asserting each member equals its supplied source file would subsume the distinctness check. Noting only as residual coverage; the intent scopes the byte-equality contract to bin/claude, so this is not a defect in the authored contract.tests/fm-azure-runtime-bundle.test.sh:593- tests/fm-azure-runtime-bundle.test.sh:593 hashes each member to test pairwise distinctness; comparing the byte strings directly (len(set(contents.values())) == len(contents)) is equivalent and shorter, since sha256 is injective for this purpose. Purely cosmetic - not worth a new head given the intent to leave the commit unchanged absent a proven contract defect.✅ **Test** - passed
✅ No issues found.
if [ "${FM_AZURE_VALIDATION_CELL:-0}" = 1 ]; then exec "$FM_AZURE_VALIDATION_SHARD_BRIDGE" behavior --count "${FM_AZURE_VALIDATION_SHARD_COUNT:-8}"; else exec bin/fm-no-mistakes-test-command.sh; fitests/run.sh tests/fm-azure-runtime-bundle.test.sh- all 6 cases pass, includingclaude_provider_bundle_contractManual producer run:bin/fm-azure-validation.sh build-runtime-bundle --provider claude --provider-binary <claude> --no-mistakes <nm> --gh <gh> --node <node> --gh-axi-package <pkg> --output claude-runtime.tar.gzagainst distinct-byte ELF fixturesManual bundle inspection: extractedruntime.jsonplus everybin/*member and compared sha256 of each payload against the supplied artifact and against the manifest's declared digest; asserted 4-of-4 distinct digests and absence ofbin/codexandbin/codex-code-mode-hostMisbinding discrimination experiment: built a self-consistent misbound bundle (bin/node bytes shipped atbin/claude, manifest digest updated in place) under both the parent-commit identical-byte fixture regime and this change's distinct-byte regime, then ran each commit'sclaude_provider_bundle_contractpython assertion block verbatim against correct and misbound bundlesgit diff --name-only 7b6b15f..bb96be9 | grep -v '^tests/'- confirms no production source file changeddocs/azure-validation.md:185- Pre-existing, not caused by this change: bin/fm-azure-validation.py:106 accepts PROVIDERS = ("codex", "claude"), but the runtime-bundle section of docs/azure-validation.md shows only the--provider codexinvocation and a codex manifest example, and mentions Claude solely by implication in "Codex bundles must include a provider-extra named codex-code-mode-host" (line 171). Nothing in that section is contradicted by this change, and it is test-only, so I left the doc untouched under the scope rules. Follow-up worth considering: add one sentence to docs/azure-validation.md namingcodexandclaudeas the accepted--providervalues and noting that a Claude bundle carries no provider-extra, keeping that fact in its single owner document rather than duplicating the build example.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.