symfonic.capabilities.governance.stages.metacognition¶
metacognition ¶
Metacognition: the final, expensive stage of the governance pipeline.
The default policy carries the legacy selective gate's deterministic evidence
forward. Confidence remains one optional signal; it never replaces claims,
actions, findings, or recall-time sensitivity. None withholds confidence
without inventing a low score.
MetacognitionStage ¶
MetacognitionStage(reflector: Reflector | None, *, confidence_floor: float = 0.6, sensitive_terms: Sequence[str] = (), sensitive_tags: Sequence[str] = (), read_only_tools: Sequence[str] = (), trivial_ack_patterns: Sequence[str] = (), confidence: ConfidenceReporter | None = None, trigger_policy: MetacognitionTriggerPolicy | None = None)
Reflect on the draft when, and only when, the gate fires.
Source code in src/symfonic/capabilities/governance/stages/metacognition.py
check_reporter ¶
The reporter, or a refusal raised where nothing will contain it.
This stage is FAIL_OPEN: the pipeline catches whatever apply
raises and allows the turn. So a per-turn refusal cannot protect a
composed caller -- it produces the disabled gate :func:_validated
exists to prevent, recorded in degraded_stages and nowhere a caller
is obliged to look. A port that can never work is knowable before any
turn runs, and construction happens outside the containment boundary, so
that is where it is refused.
An async reporter is the mistake worth naming: :class:Reflector sits
beside this port and is async, and runtime_checkable cannot tell
them apart because it only checks that the method exists. Left to run, it
returns an un-awaited coroutine every turn -- a warning, a leak, and a
gate that quietly stopped guarding.