Skip to main content

Module gate

Module gate 

Source
Expand description

Policy-aware unified enforcement (decided.services.gate, v0.21.14 / ADR-049) plus the STRICT .decided/config.yaml loaders it alone consumes (decided.services.init.load_enforcement_policy / load_overrides, the raising paths).

decided gate composes validation, relationship integrity, and review over one corpus, then classifies every finding as blocking or advisory under the corpus enforcement policy. The other commands keep the engine’s lenient config readers (validate::load_overrides skips malformed entries); the gate is the one surface where a malformed config is an operational error — decided: malformed repository config <path>: <reason> on stderr, exit 1 (MalformedRepositoryConfig in cmd_gate).

Structs§

CodeCoverage
CodeGateOptions
EnforcementPolicy
Finding codes mapped to an enforcement class (ADR-049). Precedence: off (suppress, None) -> blocking -> advisory -> the caller default.
GateFinding
GateReport
MalformedConfig
The gate’s operational config error. message() is the oracle’s str(MalformedRepositoryConfig) shape; cmd_gate prefixes decided: .

Constants§

ENFORCEMENT_ADVISORY
ENFORCEMENT_BLOCKING
SOURCE_RELATIONSHIPS
SOURCE_REVIEW
SOURCE_SENTRY
SOURCE_VALIDATE

Functions§

build_gate
build_gate(directory, recursive) — run validation, relationships, and review, then enforce the corpus policy. Findings the policy turns off are dropped; the rest sort by (path, line or 0, source, code, message).
build_gate_with_code
check_overrides
The STRICT face of load_overrides (ADR-053): build_gate validates the validation section shape and raises where the oracle raises. The override VALUES applied to the pipeline come from the engine’s lenient loader inside validate_directory — identical whenever this check passes (the lenient reader only ever drops entries this one rejects).
load_enforcement_policy
load_enforcement_policy(start_dir) — the STRICT reader build_gate consumes. YAML 1.1 resolves a bare off key to Bool(false); both key spellings are accepted, off winning (section["off"] if "off" in section else section.get(False)).