Skip to content

API Reference parrot.sdd.scripts.check_e2e_closeout

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.sdd.scripts.check_e2e_closeout

View source

Code-enforced E2E evidence gate for the SDD closeout surfaces (FEAT-703).

Both /sdd-done twins (.claude/commands/sdd-done.md and .agents/skills/sdd-done/SKILL.md) invoke this before any stamp, push, PR, merge or cleanup step. The decision table implemented here is the one proven in tests/sdd_scripts/test_e2e_closeout_contract.py against the real parrot.e2e.evidence.verify_evidence validator (FEAT-581 TASK-3543); it was promoted out of that test file so closeout enforcement is a code invariant rather than prose an agent is merely asked to follow.

Class GateDecision

The full outcome of the closeout gate, including what to report.

Parameter Type Default Description
allowed bool
policy str
status str
gate_satisfied bool
reason_codes list[str]

Fields:

Field Type Default Description
allowed bool
policy str
status str
gate_satisfied bool
reason_codes list[str]

Function evaluate_closeout_gate

Return (allowed, reason_codes) for a feature's E2E closeout gate.

Thin wrapper over :func:evaluate_closeout_gate_detailed. Accepts no force argument by construction (FEAT-581 AC9).

evaluate_closeout_gate(*, policy: str, plan_path: Optional[Path], worktree: Path) -> tuple[bool, list[str]]

Parameter Type Default Description
policy str required, optional, none or invalid.
plan_path Optional[Path] The feature's e2e-plan.md, or None when none exists.
worktree Path The feature worktree to validate evidence against.

Returns: tuple[bool, list[str]] — (allowed, reason_codes).

Function evaluate_closeout_gate_detailed

Evaluate the closeout gate and return everything the caller reports.

Accepts no force argument by construction: FEAT-581 AC9's "generic force cannot bypass required E2E" is structural here, not merely documented.

evaluate_closeout_gate_detailed(*, policy: str, plan_path: Optional[Path], worktree: Path) -> GateDecision

Parameter Type Default Description
policy str required, optional, none or invalid.
plan_path Optional[Path] The feature's e2e-plan.md, or None when none exists.
worktree Path The feature worktree to validate evidence against.

Returns: GateDecision — class:GateDecision describing whether closeout may proceed.

Function main

Exit 0 when closeout may proceed, 1 when it must abort.

main(argv: Optional[Sequence[str]] = None) -> int

Parameter Type Default Description
argv Optional[Sequence[str]] None Optional argument list (defaults to sys.argv[1:]).

Returns: int — Process exit code.

Function resolve_policy

Return the spec's E2E policy, or invalid when it is malformed.

A spec with no e2e key returns optional (the documented default for every spec written before FEAT-581). A present-but-malformed policy is NEVER coerced to a safe default -- it returns invalid, which the gate treats exactly like required with missing evidence.

resolve_policy(spec_path: Path) -> str

Parameter Type Default Description
spec_path Path Path to the feature's spec file.

Returns: str — One of required, optional, none or invalid.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally