opencode: assert the config hook actually puts vault material on the wire - #54
Merged
ualtinok merged 1 commit intoSep 18, 2026
Conversation
Sentinel-forward mutation: 18 failures total — this arm plus 17 existing arms. Empty-material mutation: this arm alone failed: Expected Bearer VAULT-MAIN-TOKEN-xyz, Received Bearer. Hermetic from the worktree root: 222 pass / 0 fail. scripts/gate.sh was not green: opencode_files::manifest_lock_aba_regression::reclaim_leaves_nonmatching_siblings_live_lock_and_other_manifest_quarantine in crates/credentials-module/src/bin/cli_support/opencode_files.rs failed at load averages [10.59, 5.90, 6.28].
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 #53. One test arm, and the mutation evidence narrows my own issue — reporting both numbers because the second one is the argument and the first one is against me.
What #53 claimed, and what the mutations actually showed
I wrote that "a config hook which installed a material-dropping closure would pass the entire suite". Two mutations, run against production code:
So for sentinel leakage the suite was already well defended — 17 arms catch it and my claim was too broad. For the empty-material shape, nothing caught it.
That second line is
cortexkit/openai-auth#154's observed symptom reproduced character-for-character in this harness. There, a tombstoned main underclaustrummode emitted a bareBearer: the vaultcache.getsucceeded and the credential was then discarded by acatch { /* use stale token on refresh failure */ }falling back tocurrentAuth.access ?? ''. A tombstone is precisely the state with no stale token, so that branch is correct for every non-custody case and wrong for exactly the one custody creates.The one hook-level test that existed, and why it did not help
config-hook.test.tsalready had an end-to-end arm — it installs the hook and callscfg.provider.deepseek.options.fetch— and it caught the sentinel mutation. It asserts.status).toBe(200)and a detect count, and never reads the forwardedauthorizationheader.So the composition WAS exercised; what was missing is an assertion about the thing being composed. A stub upstream returns 200 regardless of what it was handed, which makes a status assertion structurally incapable of noticing an empty credential.
The arm
Installs the hook in the steady state (valid handle file + tombstoned auth entry), sends a sentinel-bearing header through
cfg.provider[id].options.fetch, captures the forwarded request, and asserts three things rather than one: the header equals the expected material, does not still contain the sentinel, and is neither empty nor the bare stringBearer.Verification
bash scripts/gate.shexit 0,workspace floor 630 >= origin/master 630 at 636fe62, hermetic 222 pass / 0 fail, one file, 33 insertions, no deletions,Cargo.lockandbun.lockuntouched, revert sweep clean.The implementer's gate run went red on
manifest_lock_aba_regression::reclaim_leaves_nonmatching_siblings_live_lock_and_other_manifest_quarantineat load[10.59, 5.90, 6.28]— the #51 class, in a file this diff does not touch. Mine passed at load ~5. Worth noting on #51 that this is a lower load than the[15.02]failure earlier today.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds an assertion that the config hook actually forwards vault material, closing #53. The sentinel-leak variant was already caught elsewhere, but no test caught a credential that had been emptied into a bare
Bearer; the new arm captures the forwarded request and verifies theAuthorizationheader carries the vault token, not the sentinel, and is neither empty nor justBearer. Test-only change, no production code touched.Written for commit cbc5af7. Summary will update on new commits.