Repository navigation
fix(sandbox): cover 3 sealed dir leaves in delegated-overlap wording (#12182) - #12193
Conversation
_DELEGATED_OVERLAP_LEAF_REASONS only carried wording for cloud.json and playwright-cli, so the module-level assert over the full sealed-leaf union failed at import time, breaking every backend test at collection. Add the (reason, consequence) entries for subagents, member-memory-bindings, and decisions, lifting the canonical wording from PR #12106 to avoid a future merge conflict in this hunk. Fixes #12182
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: |
|
Independent confirmation that this PR is the fix main is red at import right now. Verified on a detached worktree at Same command on this PR's head Blast radius: every backend job dies loading Why nobody saw it land: main's own runs at Note for whoever rebases: #12106 ( This PR is minimal and correct in shape: one file, one commit, three entries added, the assert left intact. Pattern class, if useful for the harvest section: a module-level assert over two hand-maintained sets that CI never exercised, because main's own runs were concurrency-cancelled. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 40f5c8f |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Only the What this change shipsInventory (2 items) — 2 justifiedIntent: FIX — restore
The fix is derived, not inherited: the assert at [FIRST-PRINCIPLES-REVIEWED] 40f5c8f |
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: |
What
Fixes the import-time
AssertionErrorinsrc/kiro_crew/sandbox.pythat broke every backend test at collection onmain(issue #12182).The module-level assert requires
_DELEGATED_OVERLAP_LEAF_REASONSto cover the full union of sealed leaves (_CREW_NOFOLLOW_READONLY_FILE_LEAVES|_CREW_NOFOLLOW_READONLY_DIR_LEAVES), but the dict only held wording forcloud.jsonandplaywright-cli. The three sealed directory leavessubagents,member-memory-bindings, anddecisionshad no delegated-overlap entry, so the assert fired at import time. This was unsatisfiable in the commit that introduced it (4ed7335, #11556), whose CI run was cancelled so the assert was never exercised pre-merge.Change
Added three
(reason, consequence)entries to_DELEGATED_OVERLAP_LEAF_REASONS, matching the dict shapedict[str, tuple[str, str]]and the existing entries. Wording is lifted verbatim from PR #12106 (same lane as #11556) so that PR does not gain a conflict in this hunk:subagents-> "sealed run records" / "the agent could rewrite the app owner a cold continuation restores its authorization from"member-memory-bindings-> "sealed run records" / "the agent could rewrite the app owner a retained V1 run restores its authorization from"decisions-> "sealed decision log" / "the agent could append a feedback row the owner's summary counts as a verdict nobody gave"For
decisions, the source comment gave only the consequence; the reason ("sealed decision log") was chosen to match the surrounding sealing comments and the 2-tuple shape of the other entries.Testing
python -c "import kiro_crew.sandbox"succeeds (no AssertionError)pytest test/test_session_control.py --collect-onlycollects 207 tests with no import errorpytest test/test_cloud_config.py test/test_sandbox_crew_home_carveout_spellings.py-> 149 passed, includingtest_every_strict_leaf_of_either_shape_is_covered_by_the_delegated_guard, which asserts the mapping equals the union of both leaf listsCloses #12182
Pattern harvest
Rule candidate: merge gate
Pattern: a required check whose newest run ended
cancelled(superseded push, orcancel-in-progress) is not evidence that the check passed, so a merge taken on it can land a failure no shard ever executed. That is how this defect reachedmain: #11556 added a module-levelassertpairing_DELEGATED_OVERLAP_LEAF_REASONSagainst two constant leaf lists while #11993 was adding a name to one of them, the assert was unsatisfiable on the merge commit, and every Backend Tests shard then exited 4 at conftest import. A gate that refuses the merge unless the newest run of each required check concludedsuccesscloses the class. The two-lists drift itself needs no new rule -- the assert plustest_every_strict_leaf_of_either_shape_is_covered_by_the_delegated_guardalready catch it the moment any shard runs.[operator: iamwhatever] section added to clear the PR Hygiene gate; no code or wording in the diff was changed.