cli: wire egress-velocity thresholds through the drift gate (closes #457) - #459
Open
Maqbool61 wants to merge 2 commits into
Open
cli: wire egress-velocity thresholds through the drift gate (closes #457)#459Maqbool61 wants to merge 2 commits into
Maqbool61 wants to merge 2 commits into
Conversation
Contributor
Author
|
The secret-scan failure is unrelated to this PR. Gitleaks recently required a paid license key for organizations — the error is: [DobermanCore] is an organization. License key is required. This fails in 7 seconds before scanning any code, and would affect every PR opened against this repo. All 5 test jobs (Ubuntu 3.11/3.12/3.13, Windows 3.12, package-smoke-test) pass. The PR is ready to merge. |
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.
Problem
apply_egress_velocity_change(added in #446) had no caller. A user couldhand-edit
.doberman/policies.yamlto loosenburst,volume-bytes, orfanoutwithout ever crossing the possession-factor gate — silently bypassingthe raise-only invariant the gate exists to enforce.
Closes #457
Solution
Add
doberman egress-velocityto the CLI, mirroringdoberman prefsexactly:gate first, save only on
outcome.approved. Every loosening now has tocross the same TOTP-or-password weaken path as every other policy weakening.
Hand-editing the YAML still works mechanically, but the sanctioned path is
the CLI, and operators who care about the audit trail will use it.
What the command does
doberman egress-velocity # show current thresholds + built-in defaults
doberman egress-velocity burst 10 # tighten (frictionless, no prompt)
doberman egress-velocity burst 30 # loosen (TOTP if enrolled, else password)
doberman egress-velocity volume-bytes 10485760 # same gate for volume
doberman egress-velocity fanout 5 # same gate for fanout
Tightening (lower value than currently stored) →
method=auto, prompternever invoked, recorded in ledger, persisted immediately.
Loosening (higher value than currently stored) → confirmation prompt, then
TOTP if enrolled, else password. Denied on wrong factor, declined confirm, or
no factor enrolled. Denial recorded in ledger; nothing written to disk.
Shape mirrors
doberman prefsload_policy → gate → save_policyskeletonoutcome.approvedguard before any writeprefsin the Policy panelFiles changed
src/doberman/cli/main.pyegress-velocitycommand +apply_egress_velocity_change/VelocityThresholdsimportstests/unit/test_cli_egress_velocity.pytest_cli_lowering_gate.pytests/unit/test_cli_help.py("egress-velocity",)added toCLI_HELP_TARGETSTest coverage
_Boomguard)approved=0burst=25,moving to
burst=22is a strengthen relative to the current stored value —frictionless, no gate,
method=auto— even though22 > 20(built-in default)Checklist
ruff check— 0 errorsruff format --check— 383 files already formattedlint-imports— 3 contracts kept, 0 brokenpython scripts/check_markdown_links.py— no broken links