Per-cut-class arming ladder: arm the surgical edge-cut before the quarantines (ADR-0035) - #305
Merged
thejefflarson merged 1 commit intoAug 1, 2026
Conversation
… before the quarantines (ADR-0035) Splits network-cut arming under `mode: enforce` into an ordered ladder instead of one flip that armed all three network cuts at once. A new arming_ladder module (engine/src/engine/respond/actuator/arming_ladder.rs) maps a single ordered ArmingRung to the EnabledActions it implies: `edge-cut` (the enforce default) arms only the surgical DenyNetworkPath cut; `quarantine` is an explicit second opt-in that also arms QuarantineEntry/QuarantineWorkload, implying edge-cut rather than replacing it. `EnabledActions` stays the pure armed-classes type; `enforceScope`/`mode` are unchanged. Wired via a new PROTECTOR_ENFORCE_RUNG env var / chart enforceRung value (default edge-cut), with helm-side validation mirroring the existing mode guard. Flips ADR-0035 Status: Proposed -> Accepted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VtjoJttCvBY4dzCoE4f9vP
thejefflarson
deleted the
thejefflarson/jef-671-per-cut-class-arming-ladder-arm-the-surgical-edge-cut-before
branch
August 1, 2026 07:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes JEF-671. Implements ADR-0035: splits
network-class arming undermode: enforceinto an ORDERED LADDER instead of a single flip that armed all three network cuts
(surgical
DenyNetworkPathedge-cut +QuarantineEntry+QuarantineWorkload) at once.edge-cut(theenforcedefault): arms only the surgical,most-reversible
DenyNetworkPathcut. The quarantines stay propose-only.quarantine: an explicit second opt-in that also armsQuarantineEntry/QuarantineWorkload— implying the edge-cut rung, never replacing it.One ordered position, not independent per-cut toggles (preserves ADR-0021's anti-drift
intent).
enforceScope(the where dial) andmode(the shadow-vs-act gate) are unchanged.auditstill arms nothing — byte-identical shadow default, empty-scope-refusedpreserved.
Design
engine/src/engine/respond/actuator/arming_ladder.rs— a small,single-purpose module (not bolted onto the already-large
respond/mod.rs). DefinesArmingRung { EdgeCut, Quarantine }andArmingRung::enabled_actions() -> EnabledActions.EnabledActionsitself is untouched — it stays the pure armed-classes type, exactly perthe ADR's implementation note.
engine/src/main.rs:Posturegains arung: ArmingRungfield, parsed from the newPROTECTOR_ENFORCE_RUNGenv var (defaultedge-cut, unrecognized values fall back tothe narrowest/safest rung).
engine_arming()now delegates toself.rung.enabled_actions()instead of hand-enabling all three classes.
engine/src/engine/respond/actuator/mod.rs: unchanged behaviorally — only apub mod arming_ladder;declaration and a doc-comment cross-reference clarifying thatactions_from_name/EnabledActions::from_names(the generic"network"name → allthree actions grouping) is a test convenience, distinct from the production
arming ladder.
Chart (hand-port needed — the deployed cluster chart is a fork)
charts/protector/values.yamlgainsenforceRung: edge-cut(documented alongsideenforceScope);templates/deployment.yamlwiresPROTECTOR_ENFORCE_RUNGand adds ahelm-side validation mirroring the existing
modeguard;templates/NOTES.txtandREADME.mdare updated to describe the ladder instead of "arms all three surfaces".The
../cluster/charts/protectorchart is a diverged fork (per prior team notes) —only the image tag auto-bumps there; everything else (including this new
enforceRungvalue + its env wiring + the helm validation) needs a manual hand-port before any
cluster actually escalates past the edge-cut rung. Until that port lands, the fork simply
has no
enforceRungkey, so anymode: enforceinstall through it stays on whatever theengine's built-in default resolves to (
edge-cut— safe, narrowest).Tests
engine/src/engine/respond/actuator/arming_ladder.rs(new, unit tests in-module):edge_cut_is_the_default_and_arms_only_the_surgical_cutquarantine_rung_implies_the_edge_cut_and_adds_both_quarantinesunknown_or_empty_names_fall_back_to_the_narrowest_rungneither_rung_arms_a_non_network_action_classengine/src/main.rs(Posture/engine_armingtests, extended):audit_arms_nothing_even_at_the_quarantine_rungenforce_narrowest_rung_arms_only_the_edge_cutenforce_quarantine_rung_adds_both_quarantines_and_still_implies_the_edge_cutenforce_rung_env_var_selects_the_ladder_position(env-var parsing, default + explicit)audit_posture_is_the_safe_default_everywhere/enforce_posture_arms_all_surfaces_in_exactly_the_scope/
labels_behave_like_namespaces/webhook_and_engine_share_one_scope/enforce_with_empty_scope_is_refusedall still pass unchanged (they exercise theedge-cut default, which the ladder preserves byte-for-byte).
How I tested
npm --prefix engine/web run build— green (needednpm installfirst; ran clean).cargo fmt— clean.cargo clippy --all-targets -- -D warnings— clean, zero warnings.cargo nextest run --workspace— 1105/1105 passed (2 skipped, pre-existing),including the file-size guard test.
helm lint charts/protector— clean.helm templatesmoke tests: renderedPROTECTOR_ENFORCE_RUNG=quarantinecorrectly;confirmed
helm template --set enforceRung=bogusfails fast with a clear error;helm install --dry-runNOTES.txt showsARMED at rung 'quarantine'./soundcheck:pr-review(single-pass) on the diff manually — no Critical/Highfindings; this is a config-gating/enum-mapping change with no new injection, secrets,
auth, or access-control surface.
/simplifypass (Agent tool unavailable in this context) — added oneclarifying doc cross-reference between the new production ladder and the pre-existing
generic
actions_from_nametest helper so future readers don't conflate the two"network arms 3 classes" representations; decided not to collapse them into one
source of truth, since that would either wire production arming through a
string-parsing test API or require exposing new crate-internal surface beyond this
ticket's scope.
Scope / risks
enforceScopesemantics, RBAC derivation, or theactuation/revert mechanics — only the arming-class granularity under
enforce, per theticket's explicit constraint.
PROTECTOR_*_ENABLEtoggle —PROTECTOR_ENFORCE_RUNGis a rung on the singleenforcement gate (
mode: enforce), not a detection toggle (CLAUDE.md's two-gate rule).enforcement code in parallel — this PR only edits
engine/src/main.rs'sPosture/engine_arming, the newarming_ladder.rsmodule,actuator/mod.rs's moduledeclaration + one doc comment, the ADR status flip, and chart/docs — no other files.
escalate to the
quarantinerung via the fork; until then it's inert (defaults safe).🤖 Generated with Claude Code
https://claude.ai/code/session_01VtjoJttCvBY4dzCoE4f9vP