Repository navigation
fix(admission): name the remedy when the admission policy is missing - #23256
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this changes only message text on a path the unit tests already drive, and fail-closed behaviour is unchanged. Notes
[DESIGN-REVIEWED] fdb31c5 Description read[DESCRIPTION-READ] 013d2e397c29c8eb5da23036695749c20ab0fb7a4c255ac10c7f5275fe9fd7a1 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix only changes message text, and the goal is the message. The issue still open is why fresh 0.9.0.4 installs have no policy file; this PR defers that. Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: an operator whose gateway refuses to boot for lack of an admission policy is told the real cause and the one step that recovers it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] fdb31c5 Description read[DESCRIPTION-READ] cdb9e93996187dd9f379b8349dca1741a4031418ff1c706ded195c3423ee47d8 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 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: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
bolichen97
left a comment
There was a problem hiding this comment.
Looks good to ship. Head reviewed: a980a4c.
What I checked on this head:
- Linked issue #23255 is tier:T1, and the diff stays inside its scope: message and remedy text only. No admission decision changes, the SEL record keeps the plain reason, and the seed stays marker guarded.
- Main does not already carry this fix, and main has not moved the touched files since the merge base.
- I ran
test/test_platform_admission.pyandtest/test_governance_policy_signatures.pyon this head: 153 passed. Withadmission.pyanddiscovery.pyreverted to main, the four newTestDiscoveryGatetests fail and the other 93 pass, so the new tests pin the new behaviour. - Both remedy branches match the seed code: a failed seed write leaves no marker, and an env override run stamps the marker with no file.
- No touched path is on the security path list. The change adds no new input parsing, no auth or trust boundary change, and no secret handling.
- AI lanes on this head: Design PASS, First Principles PASS, Opus and GPT no blocking findings, UX skipped. I found no other open PR on the same files.
Remaining maintainer check: PR Readiness is still pending and several backend test shards are still running. I will approve once readiness passes on this same head.
a980a4c to
fdb31c5
Compare
|
Rebased once onto main for the #23264 Windows fix. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving at fdb31c5. This change is the fix for the linked incident, review found no issues on this head, and the maintainer accepted it. The remaining red Windows shard is a known flaky test on main that is tracked separately; auto merge will wait for required checks.
Problem / Motivation
Goal: When the admission policy file is missing, the gateway's refusal says the policy is missing and how to get it back, instead of only "not on the approved allowlist".
On a 0.9.0.4 macOS install the gateway stops at startup. The log says
no admission policy found ... failing closed, and then that the companion plugin "is not on the approved allowlist". Restarting does not help. The first-run seed is guarded by a one-shot marker, so the file is never written again. The only way out is to delete a hidden marker file that nothing names.Why it matters
Every start of an edition with a companion plugin is blocked, and the message sends the user after the wrong cause. Two users hit this from two different install routes.
Not a goal
KIROCREW_ADMISSION_POLICYset stamps the seed marker. That is a separate design question.apps/admission.py).What changed (motivation → approach → change)
The refusal blamed the allowlist, when the real problem was that no policy file existed and a restart could not make one.
A new helper,
missing_policy_remedy()inplatform/admission.py, gives an answer only when no policy is present (no env override, no default file). It tells two cases apart by the seed marker. If the marker is present, the seed already ran, so it names the marker to delete and says a managed fleet should restore its own file. If the marker is absent, the seed never managed to write the file, so it points at the data-home write.platform/discovery.pyadds that text to thePluginAdmissionErrorit raises.load_admission_policyadds it to its own error line, so other callers (the ops adapter path) log it too. A plugin rejected by a policy that does exist gets no extra text. The SEL audit record keeps the plain decision reason. The plugin-admission section ofplatform-context.mddescribes the recovery.Backwards compatibility
Compatible: the same plugins are admitted and rejected as before. Only the text of the rejection and of one error log line grows.
Removes nothing: no path, key, record or check is taken away.
Tests
test/test_platform_admission.py::TestDiscoveryGategains four tests:missing_policy_remedy()isNone.With
admission.pyanddiscovery.pyreverted to main, all four fail. With the change, all 97 tests in the file pass, plustest_governance_policy_signatures.py.Manual verification
N/A: the change is message text on a boot-failure path, and the unit tests drive that path through
discover_companion_contextwith real files in a temp home.Related Issues
Closes #23255
Sibling sweep
Swept: git grep -n "load_admission_policy()" -- src/
Sibling: src/kiro_crew/apps/builtins/ops_mission_control/backend/companion.py -- not affected -- its rejection skips one ops adapter without stopping the gateway, and the error line from load_admission_policy now carries the remedy
Sibling: src/kiro_crew/apps/admission.py -- not affected -- a separate app-admission store whose absent file means admit, so it has no missing-file dead end
Pattern harvest
Rule candidate: review-prompt
Pattern: a fail-closed default that a restart cannot undo must name the step that undoes it in the error it raises
Checklist