Repository navigation
community_16_modules_guardrails
grisun0 edited this page Oct 25, 2026
·
1 revision
Community 16 | 6 files | cohesion 0.67
This community groups 6 file(s) rooted at modules/guardrails with dominant language py (cohesion 0.67). Central symbols: AdvisoryLedger, CapacityEnvelope, CheckpointLedger, FeatureGate, GuardHarness, GuardrailContract, HarnessAdminPort, RunTicket. Core file: modules/guardrails/budget.py (16 symbols). Documented purpose: Operator-facing guardrail harness: tiers, capacity, checkpoints. Exposes the harness contracts used by the autonomous loop, the APT chain and the orchestrator .
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
modules/guardrails/__init__.py |
py | utility | 0 | yes |
modules/guardrails/advisories.py |
py | utility | 15 | yes |
modules/guardrails/budget.py |
py | utility | 16 | yes |
modules/guardrails/checkpoints.py |
py | utility | 7 | yes |
modules/guardrails/contracts.py |
py | utility | 10 | yes |
modules/guardrails/harness.py |
py | utility | 11 | yes |
-
AdvisoryLedger(class,modules/guardrails/advisories.py:17)class AdvisoryLedger- Bounded non-blocking notice stream (newest first). -
__init__(method,modules/guardrails/advisories.py:20)def __init__(self, limit)- Create an empty ledger. -
notice(method,modules/guardrails/advisories.py:31)def notice(self, code, message)- Record one advisory without blocking the caller. -
tail(method,modules/guardrails/advisories.py:49)def tail(self, limit)- Return the newest notices up to the limit. -
clear(method,modules/guardrails/advisories.py:54)def clear(self)- Drop every notice, returning the discarded count. -
describe(method,modules/guardrails/advisories.py:61)def describe(self)- Return the ledger summary for the admin console. -
tail_locked(method,modules/guardrails/advisories.py:66)def tail_locked(self, limit)- Tail helper used by describe; caller holds the lock. -
FeatureGate(class,modules/guardrails/advisories.py:71)class FeatureGate- Optional-feature suspension registry for graceful degradation. -
__init__(method,modules/guardrails/advisories.py:74)def __init__(self, features)- Create a gate limited to the known optional features. -
suspend(method,modules/guardrails/advisories.py:84)def suspend(self, feature, reason)- Suspend one optional feature. -
resume(method,modules/guardrails/advisories.py:102)def resume(self, feature)- Resume one suspended feature, returning True when it changed. -
resume_all(method,modules/guardrails/advisories.py:108)def resume_all(self)- Resume every suspended feature, returning the resumed count. -
is_suspended(method,modules/guardrails/advisories.py:115)def is_suspended(self, feature)- Return True when the feature is currently suspended. -
suspended(method,modules/guardrails/advisories.py:120)def suspended(self)- Return the suspended feature map (feature -> reason). -
describe(method,modules/guardrails/advisories.py:125)def describe(self)- Return the gate state for the admin console. -
CapacityEnvelope(class,modules/guardrails/budget.py:25)class CapacityEnvelope- Fixed-capacity ledger per task class with priority reservation. -
__init__(method,modules/guardrails/budget.py:28)def __init__(self, capacities, threshold)- Seed capacities and the saturation threshold. -
_default_capacities(method,modules/guardrails/budget.py:42)def _default_capacities()- Return the built-in per-class capacity table. -
configure(method,modules/guardrails/budget.py:50)def configure(self, capacities, threshold)- Apply capacity and threshold settings, clamping invalid values. -
admit(method,modules/guardrails/budget.py:78)def admit(self, task_class, units)- Reserve units for one tier honouring the priority contract. -
account(method,modules/guardrails/budget.py:109)def account(self, task_class, units)- Record consumed units for one tier (idempotent on refusal). -
release(method,modules/guardrails/budget.py:118)def release(self, task_class, units)- Return units to a tier ledger once an execution finishes. -
purge(method,modules/guardrails/budget.py:126)def purge(self, task_class)- Zero one tier ledger, returning the freed unit count. -
reclaim(method,modules/guardrails/budget.py:136)def reclaim(self)- Purge SUPPORT allocations, returning the freed unit count. -
usage(method,modules/guardrails/budget.py:140)def usage(self, task_class)- Return current consumed units for one tier. -
capacity(method,modules/guardrails/budget.py:147)def capacity(self, task_class)- Return configured capacity for one tier. -
saturated(method,modules/guardrails/budget.py:154)def saturated(self, task_class)- Return True when the tier usage ratio reaches the threshold. -
threshold(method,modules/guardrails/budget.py:161)def threshold(self)- Return the configured saturation threshold. -
describe(method,modules/guardrails/budget.py:166)def describe(self)- Return a per-tier usage snapshot for the admin console. -
_usage_ratio(method,modules/guardrails/budget.py:171)def _usage_ratio(self, tier)- Compute the usage ratio for one tier; caller holds the lock.
- Internal resolved imports (EXTRACTED): 10
- Cross-boundary resolved imports (EXTRACTED): 10
- [EXTRACTED] depends_on community 7 <-> 16 (strength 0.9): Extracted import edge crosses communities: cli/apt_chain_support.py imports modules/guardrails/init.py.
- No scoped security, taint, cycle, or layer risks.
- What would break if the most connected file in modules/guardrails changed?
- Should modules/guardrails be split, given cohesion 0.67?
Generated offline by readmenator from commit 804ebc910c1c. Edits here are overwritten by readmenator . --rebuild.
Start
Wiki
- community_0_modules_autonomous_daemon
- community_10_core
- community_11_modules_opsec_scorer
- community_12_modules_defense_eval
- community_13_modules_kerberos_core
- community_14_modules_saas_attacks
- community_15_modules_polymorphic_engine
- community_16_modules_guardrails
- community_17_contrib_legacy
- community_18_tests
- community_19_scripts_journal
- community_1_cli_commands
- community_20_modules_backdoor
- community_21_poc_tui
- community_22_scripts_check_contract_manifest
- community_23_scripts_migrate_lazyown
- community_24_tools
- community_25_orphans
- community_2_cli
- community_3_modules_lazy_loop
- community_4_modules_world_model
- community_5_lazygui_panels
- community_6_lazyc2_security
- community_7_modules_lazyown_facts
- community_8_static_js
- community_9_skills_claude_md_orchestrator
- concepts
- queries
- REPORT
Agent Docs
- API
- API_p10
- API_p11
- API_p12
- API_p13
- API_p14
- API_p15
- API_p16
- API_p17
- API_p18
- API_p19
- API_p2
- API_p20
- API_p21
- API_p22
- API_p23
- API_p24
- API_p3
- API_p4
- API_p5
- API_p6
- API_p7
- API_p8
- API_p9
- ARCHITECTURE
- ARCHITECTURE_p2
- ARCHITECTURE_p3
- ARCHITECTURE_p4
- ARCHITECTURE_p5
- ARCHITECTURE_p6
- ARCHITECTURE_p7
- ARCHITECTURE_p8
- ARCHITECTURE_p9
- CONCEPTS
- GOTCHAS
- INDEX
- INDEX_p2
- INDEX_p3
- KB_backdoor
- KB_blueprints
- KB_cgi-bin
- KB_claude_md_orchestrator
- KB_cli
- KB_cli_p2
- KB_cli_p3
- KB_cli_p4
- KB_cli_p5
- KB_commands
- KB_commands_p2
- KB_commands_p3
- KB_commands_p4
- KB_config
- KB_contract
- KB_core
- KB_core_p2
- KB_devtools
- KB_extensions
- KB_guardrails
- KB_hermes-lazyown
- KB_integrations
- KB_js
- KB_js_p2
- KB_js_p3
- KB_js_p4
- KB_lazyc2
- KB_lazygui
- KB_lazyown-docker
- KB_legacy
- KB_legacy_p2
- KB_mediation
- KB_misc
- KB_modules
- KB_modules_p10
- KB_modules_p11
- KB_modules_p12
- KB_modules_p13
- KB_modules_p14
- KB_modules_p15
- KB_modules_p16
- KB_modules_p2
- KB_modules_p3
- KB_modules_p4
- KB_modules_p5
- KB_modules_p6
- KB_modules_p7
- KB_modules_p8
- KB_modules_p9
- KB_modules_tools
- KB_palettes
- KB_panels
- KB_plugins
- KB_poc_tui
- KB_root
- KB_root_p2
- KB_rootkit
- KB_scripts
- KB_security
- KB_services
- KB_sinks
- KB_skills
- KB_skills_claude_md_orchestrator_tests
- KB_skills_p2
- KB_skills_p3
- KB_skills_p4
- KB_skills_p5
- KB_skills_tests
- KB_tests
- KB_tests_p10
- KB_tests_p11
- KB_tests_p12
- KB_tests_p13
- KB_tests_p14
- KB_tests_p15
- KB_tests_p16
- KB_tests_p17
- KB_tests_p18
- KB_tests_p19
- KB_tests_p2
- KB_tests_p20
- KB_tests_p3
- KB_tests_p4
- KB_tests_p5
- KB_tests_p6
- KB_tests_p7
- KB_tests_p8
- KB_tests_p9
- KB_theme
- KB_tools
- KB_widgets
- KB_win_rootkit
- KB_windows
- MEMORY
- SECURITY
- SYMBOLS
- SYMBOLS_p10
- SYMBOLS_p11
- SYMBOLS_p12
- SYMBOLS_p13
- SYMBOLS_p14
- SYMBOLS_p15
- SYMBOLS_p16
- SYMBOLS_p17
- SYMBOLS_p18
- SYMBOLS_p19
- SYMBOLS_p2
- SYMBOLS_p20
- SYMBOLS_p21
- SYMBOLS_p22
- SYMBOLS_p23
- SYMBOLS_p24
- SYMBOLS_p25
- SYMBOLS_p26
- SYMBOLS_p27
- SYMBOLS_p28
- SYMBOLS_p29
- SYMBOLS_p3
- SYMBOLS_p30
- SYMBOLS_p31
- SYMBOLS_p32
- SYMBOLS_p33
- SYMBOLS_p34
- SYMBOLS_p35
- SYMBOLS_p36
- SYMBOLS_p37
- SYMBOLS_p38
- SYMBOLS_p39
- SYMBOLS_p4
- SYMBOLS_p40
- SYMBOLS_p41
- SYMBOLS_p42
- SYMBOLS_p43
- SYMBOLS_p44
- SYMBOLS_p45
- SYMBOLS_p5
- SYMBOLS_p6
- SYMBOLS_p7
- SYMBOLS_p8
- SYMBOLS_p9
Recipes