Repository navigation
fix(aws-control): add opencode's auth.json to the standalone credential fence - #10248
Conversation
…al fence Two PRs merged ten minutes apart today collided semantically: #10006 declared .local/share/opencode/auth.json as a credential leaf (spliced into the shared validator via host_auth.credential_leaves()), and #9213 added the packaging fence's _SENSITIVE_RELATIVE_DIRS, written before that leaf existed. Each was green against a main lacking the other; combined, test_the_local_subset_fences_every_foreign_credential_store fails on main. Add the exact leaf, not the .local/share/opencode directory: the shared validator classifies only auth.json, and the converse parity test (test_the_local_fence_is_never_stricter_than_the_shared_one) rejects the directory-level entry as over-fencing. Verified: the full test_sensitive_source_and_report_identity.py file passes (96/96) with this entry; both parity tests fail/over-fence respectively without it.
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Minimal forward-fix restoring the invariant the parity test pins; leaf-not-directory choice is verified against the converse never-stricter test and matches the list's documented pattern. [DESIGN-REVIEWED] bed838f |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of All claims verified by reading: the opencode leaf First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (1 item) — 1 justifiedIntent: unwedge red main by fencing opencode's credential file in the standalone build fence — a FIX.
Verified by reading the tree at HEAD: the leaf is declared in [FIRST-PRINCIPLES-REVIEWED] bed838f |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…al fence (kirodotdev#10248) Two PRs merged ten minutes apart today collided semantically: kirodotdev#10006 declared .local/share/opencode/auth.json as a credential leaf (spliced into the shared validator via host_auth.credential_leaves()), and kirodotdev#9213 added the packaging fence's _SENSITIVE_RELATIVE_DIRS, written before that leaf existed. Each was green against a main lacking the other; combined, test_the_local_subset_fences_every_foreign_credential_store fails on main. Add the exact leaf, not the .local/share/opencode directory: the shared validator classifies only auth.json, and the converse parity test (test_the_local_fence_is_never_stricter_than_the_shared_one) rejects the directory-level entry as over-fencing. Verified: the full test_sensitive_source_and_report_identity.py file passes (96/96) with this entry; both parity tests fail/over-fence respectively without it. Co-authored-by: Helena Stafford <helenars@amazon.com>
Summary
Main is currently red on Backend Tests:
test_the_local_subset_fences_every_foreign_credential_storefails because two PRs merged ten minutes apart today collided semantically —.local/share/opencode/auth.jsonas a credential leaf, whichsecurity/paths.pysplices into the shared validator viahost_auth.credential_leaves()._SENSITIVE_RELATIVE_DIRS, written before the opencode leaf existed.Each PR was green against a main that lacked the other. Combined, the fence-parity test fails: the shared validator classifies opencode's token as a foreign credential store and the standalone fence treats it as ordinary — which, in standalone mode (when
kiro_crew.securitycannot be imported), is exactly the gap the test exists to catch.Fix
One entry added to
_SENSITIVE_RELATIVE_DIRS: the exact leaf.local/share/opencode/auth.json, mirroring how the list already carries amazon-q and kiro-cli stores.The leaf, deliberately not the
.local/share/opencodedirectory: the shared validator classifies onlyauth.json, and the converse parity test (test_the_local_fence_is_never_stricter_than_the_shared_one) rejects the directory-level entry as over-fencing — verified both ways locally before settling on the leaf.Testing
test_sensitive_source_and_report_identity.py: 96/96 pass with this change; the parity test fails without it (reproduced on pristine main, Linux — it is not Windows-specific despite first surfacing on a Windows shard).First observed on PR #9969's CI (merge-commit run); reproduced on main directly.
Pattern harvest
Rule candidate: process, not lint — this is the "two individually-green PRs whose union breaks an invariant" class (#10006 added a validator entry; #9213 added a parity-pinned mirror of the validator, authored before that entry existed). A merge queue (or retesting each PR against post-merge main before landing) catches the whole class; no code-level rule can, since each tree was correct in isolation. The parity test itself is already the right mechanical guard — it did catch the collision, on main, immediately.
Not generalizable at the code level beyond what the parity test already pins: the fence's hardcoded list is BY DESIGN (standalone mode cannot import the validator), and the test mechanically harvests every validator leaf, so any future omission of this kind stays impossible to miss.