Skip to content

fix(aws-control): add opencode's auth.json to the standalone credential fence - #10248

Merged
iamwhatever merged 1 commit into
mainfrom
fix/standalone-fence-opencode
Sep 12, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/standalone-fence-opencode

Conversation

@helenastafford

@helenastafford helenastafford commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Main is currently red on Backend Tests: test_the_local_subset_fences_every_foreign_credential_store fails because two PRs merged ten minutes apart today collided semantically —

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.security cannot 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/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 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).
  • Directory-level variant rejected by the never-stricter test (verified, see above).

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.

…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.
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of bed838f2cbe9ccfac5218548be1cbd5e65bc49a4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of bed838f2cbe9ccfac5218548be1cbd5e65bc49a4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] bed838f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt bed838f2cbe9ccfac5218548be1cbd5e65bc49a4: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of bed838f2cbe9ccfac5218548be1cbd5e65bc49a4 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All claims verified by reading: the opencode leaf .local/share/opencode/auth.json is declared in host_auth.py:446 (from #10006), spliced into the shared validator at security/paths.py:121, harvested by the parity test at test_sensitive_source_and_report_identity.py:1613, and absent from the standalone fence on base (the diff adds it at build.py:302). The leaf-not-directory choice is pinned by the never-stricter test at line 333. The test's mechanical harvest means no unfixed siblings can exist — any other missing leaf would keep the same test red. This is a one-item fix that unwedges a red main.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (1 item) — 1 justified

Intent: unwedge red main by fencing opencode's credential file in the standalone build fence — a FIX.

  1. Standalone crew bundles now refuse to read/bundle .local/share/opencode/auth.json — justified

Verified by reading the tree at HEAD: the leaf is declared in host_auth.py:446 and spliced into the shared validator (security/paths.py:121), both present on base; the parity test (test_sensitive_source_and_report_identity.py:1613) mechanically harvests every such leaf and asserts the standalone fence covers it, so base fails without this entry — the failing-test-on-base provenance holds without running anything. Sibling count is zero by construction: the same harvest would flag any other missing leaf. The leaf-not-directory shape is forced by test_the_local_fence_is_never_stricter_than_the_shared_one (line 333), a documented invariant, not a preference.

[FIRST-PRINCIPLES-REVIEWED] bed838f

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed bed838f2cbe9ccfac5218548be1cbd5e65bc49a4 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] bed838f

Verdict parsed from the review's SHA-scoped output markers for commit bed838f2cbe9ccfac5218548be1cbd5e65bc49a4.

False positive or not applicable? A repository writer can comment:
/ai-review override fable bed838f2cbe9ccfac5218548be1cbd5e65bc49a4: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@iamwhatever
iamwhatever merged commit dd0dce2 into main Sep 12, 2026
77 of 80 checks passed
@iamwhatever
iamwhatever deleted the fix/standalone-fence-opencode branch September 12, 2026 00:35
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Sep 12, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…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>
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.

2 participants