evidence_gate
strands_teams.evidence_gate ¶
The evidence gate — a blocking finding must carry evidence.
ASTR §4.5 makes communication evidence-bearing; the NarrativeRubric specificity dimension already scores citation density over a narrative via :data:~strands_teams.rubric.FILE_LINE_PATTERN. This module binds that same citation-density concept to a typed :class:~strands_teams.models.Finding: a blocking=True finding must carry ≥1 evidence ref, or it is flagged rather than silently accepted.
To keep the "evidence density" definition in exactly one place (AC-5-4), the gate reuses FILE_LINE_PATTERN to recognize inline file.ext:line citations in a finding's statement and evidence uris, rather than introducing a second, divergent citation heuristic. An explicit :class:~strands_teams.models.Evidence ref and an inline file:line citation both count toward the same evidence-ref tally.
The gate is a pure function over already-parsed Finding objects; it does no I/O and never raises, so both the write path (write_findings) and the read path (read_team_findings) can call it and surface an evidence_gate summary in their JSON results.
EvidenceGateResult ¶
Bases: FrozenModel
Outcome of running the evidence gate over one or more findings.
Attributes:
| Name | Type | Description |
|---|---|---|
passed | bool | True when no |
flagged | list[str] | Statements of the |
checked | int | Total number of findings evaluated. |
finding_passes_gate ¶
Return whether a single finding satisfies the evidence gate (AC-5-1, AC-5-5).
A finding passes when it is non-blocking (evidence optional — AC-5-5) or when it carries ≥1 evidence ref. It fails only when blocking is True and it has zero evidence refs.
Source code in packages/strands-teams/src/strands_teams/evidence_gate.py
evaluate_evidence_gate ¶
Evaluate the evidence gate over a collection of findings (AC-5-1..5-3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
findings | Iterable[Finding] | The typed findings to check. | required |
Returns:
| Name | Type | Description |
|---|---|---|
An | EvidenceGateResult | class: |
EvidenceGateResult |
| |
EvidenceGateResult | finding's statement so the coordinator can act on the gap. |
Source code in packages/strands-teams/src/strands_teams/evidence_gate.py
gate_findings ¶
Return the evidence-gate summary as a plain dict for embedding in tool JSON.
Convenience wrapper around :func:evaluate_evidence_gate producing the evidence_gate block used by the write and read tool results (AC-5-2, AC-5-3).