feat(kernel): fail closed on empty or misconfigured dark-window Allow allowlist (#135) - #270
Conversation
… allowlist (#135) The dark-window Allow eligibility predicate was bare allowlist membership. A misconfigured entry naming a communication or connector-write effect would have been permitted at activation, violating D-146. Harden it to a two-axis, fail-closed decision: an action is eligible only if it is on the (empty) allowlist AND the catalog certifies it approval-narrowing (reaches no connector, write, or counterparty). A misconfigured list -- any uncertified entry -- fails closed for every action, so a review error is noticed, not half-applied. Enforcement stays at the activation guard and startup sweep, which both consult this predicate; no mint-boundary re-check was added (it would break the settled legacy-install machinery tests and duplicate the activation+sweep design). Adds pure empty/filled/misconfigured decision tests and a safety-boundary completeness test.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughDark-window Allow eligibility now combines explicit allowlist membership with canonical catalog safety certification. Misconfigured allowlists fail closed for all actions. Tests cover eligibility outcomes and safety boundaries. ChangesDark-window Allow hardening
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Hardens the dark-window
Alloweligibility predicate so token minting failsclosed when the allowlist is empty or misconfigured (#135 AC).
Previously
dark_window_allow_eligiblewas bare allowlist membership(
allowlist.contains(action)). The allowlist is deliberately empty, so theempty case already failed closed — but a misconfigured entry naming a
communication or connector-write effect (e.g.
email.send) would have beenpermitted at activation, violating D-146. The "permitted" branch was also
untested.
Change
action_catalog_contracts.rs: two-axis, fail-closed decision. An action iseligible only if it is on the (empty) allowlist AND the catalog certifies
it
is_approval_narrowing— the existing, reviewed classification for actionsthat "reach no connector, write nothing, communicate with nobody".
secret.rotate,policy.modify_direct,coolify.deploy,filesystem.host_writeall declareno egress class / output channel, so an inference would miss them; requiring
approval-narrowing certification fails every un-cleared id closed.
closed for every action, not just the bad entry, via the new pure, total
dark_window_allow_eligibility(action, allowlist, certified_safe) -> Eligible | NotAllowlisted | Misconfigured.safety-boundary completeness test.
Why enforcement stays where it is
Enforcement remains at the activation guard (
dark_window_allow_rejection) andthe startup sweep (
sweep_ineligible_dark_window_allow_rules) — both alreadyconsult this predicate, so hardening it hardens both. No mint-boundary
(
claim/consume/recovery) re-check was added: it breaks the settledlegacy-install machinery tests, would need a
#[cfg(test)]seam that collideswith the cardinality-pinned catalog tests, touches dev-172's fired-token
erasure surface, and duplicates the activation+sweep design. Production
behavior is unchanged (allowlist empty); no existing test changes.
Verification
./scripts/check.shpasses (fmt, clippy -D warnings, workspace tests,OpenSpec strict-validate) on the rebased HEAD.
openspine-kernelstanding-rule + catalog suites green.origin/main.Implementation notes (five-line summary)
the narrow Allow-allowlist fail-closed AC.
.contains) and theuntested "permitted" path — both now closed.
fail-closed, enforced at the existing activation guard + startup sweep.
dev-172 overlap, redundant over activation+sweep).
allowedundispatchedrows for now-ineligible actions are an upgrade-path edge left out of scope.
Closes #135
Summary by cubic
Fail closed when the dark-window Allow allowlist is empty or misconfigured to prevent effectful actions from minting. Previously, eligibility was bare allowlist membership; now, actions must be on the allowlist and be catalog-certified approval-narrowing, and any uncertified allowlist entry misconfigures the list and blocks all minting.
dark_window_allow_eligibility(action, allowlist, certified_safe) -> Eligible | NotAllowlisted | Misconfigured, and updatesdark_window_allow_eligibleto use it.LazyLockto derive the certified-safe subset; the allowlist remains empty.email.send,secret.rotate,filesystem.host_writestay uncertified).Written for commit 148703e. Summary will update on new commits.