Skip to content

API Reference parrot.e2e.models

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

parrot.e2e.models

View source

Strict persisted schemas for the deterministic E2E gate (FEAT-581, M2).

Every model below is a normative field contract translated from spec §2 "Data Models" (sdd/specs/agentic-e2e-testing.spec.md). All persisted models use Pydantic v2 with extra="forbid", schema_version=1, UTC timestamps and finite/positive numeric constraints. IDs are validated as nonempty safe slugs; pytest node IDs are validated to reject wildcard or bare-directory selection (spec §2 "A node ID belongs to one scenario only; parameterized nodes must be enumerated, not selected by wildcard or directory.").

This module is intentionally dependency-light: only Pydantic and the standard library. No target/provider imports, no filesystem or network side effects — path existence and manifest hashing belong to parrot.e2e.plan / parrot.e2e.evidence (out of this task's scope).

Class E2EPlan

The complete, validated selection and budget for one E2E run (spec §2).

Fields:

Field Type Default Description
schema_version Literal[1] 1 Always 1 for this schema generation.
feature_id str Owning feature's stable ID (e.g. FEAT-581).
spec_path str Repository-relative path to the authoritative feature spec.
policy _PolicyLiteral required, optional or none. Required demands at least one required, codified (non-exploratory) scenario.
targets dict[str, TargetConfig] Named target configurations, keyed by target ID.
scenarios list[ScenarioSpec] Declared scenarios; scenario IDs and node IDs are unique.
budget LiveBudget Live-provider usage cap applied to any live scenario.
run_timeout_s int 600 Overall run deadline in seconds (1..3600).

Class E2EVerdict

The runner-computed, atomically-persisted final evidence for one run (spec §2).

Fields:

Field Type Default Description
schema_version Literal[1] 1 Always 1 for this schema generation.
feature_id str Owning feature's stable ID.
run_id str Stable ID for this run.
policy _PolicyLiteral The :class:E2EPlan.policy this run was evaluated against.
source_identity_before SourceIdentity Source identity captured before execution.
source_identity_after SourceIdentity Source identity captured after execution.
selected_node_ids list[str] Node IDs the plan selected for this run.
collected_node_ids list[str] Node IDs pytest actually collected.
results list[ScenarioResult] Per-scenario/node machine evidence.
counts dict[str, int] Outcome name to count mapping (e.g. {"passed": 3}).
argv list[str] Exact CLI argv used to invoke the run.
exit_code int Overall process exit code (spec §2 exit mapping).
cleanup_results dict[str, bool] Target run ID to "cleanup verified complete" mapping.
artifact_hashes dict[str, str] Relative artifact path to SHA-256 hex digest mapping.
status _VerdictStatusLiteral PASS, FAIL or BLOCKED.
gate_satisfied bool Whether required coverage was fully satisfied.
started_at datetime UTC timestamp execution began.
completed_at datetime UTC timestamp execution (including cleanup) completed.

Class LiveBudget

Aggregate cap on one run's optional live provider usage (spec §2 "Live Provider Budget").

Fields:

Field Type Default Description
model str 'google:gemini-2.5-flash-lite' Google model ID the budget is enforced against.
max_calls int 4 Maximum generation attempts across initial/continuation/repair/retry sends.
max_output_tokens int 512 Output token ceiling; growth on MAX_TOKENS is clamped to this value.
max_request_bytes int 16384 Serialized request byte ceiling (history + system + tools + prompt).
timeout_s float 60 Maximum wall-clock seconds for the whole live session.

Class ProcessIdentity

A verifiable OS process identity used to gate signaling (spec §2).

Never sufficient to signal on pid alone: pgid, create_time and boot_id must all match before any SIGTERM/SIGKILL is sent, guarding against PID reuse across reboots or foreign processes.

Fields:

Field Type Default Description
pid int OS process ID.
pgid int OS process group ID.
create_time datetime Process creation timestamp as reported by the OS (UTC).
boot_id str Host boot identifier, to detect a reboot invalidating pid.
owned bool Whether this process was spawned (and may be signaled) by the supervisor, as opposed to an adopted/foreign endpoint.

Class RunState

Persisted, worktree-local state for one supervised run (spec §2).

Fields:

Field Type Default Description
schema_version Literal[1] 1 Always 1 for this schema generation.
feature_id str Owning feature's stable ID.
run_id str Stable ID for this run.
worktree str Canonical (absolute, resolved) path of the owning worktree.
owner_id str Identity of the runner/session that owns this run.
controller_identity ProcessIdentity Identity of the foreground controller process.
supervisor_identity ProcessIdentity Identity of the supervisor process.
process_identity ProcessIdentity Identity of the supervised target process.
target_id str Target key (from :class:E2EPlan.targets) this state describes.
status _RunStatusLiteral Current lifecycle status.
endpoint Optional[str] None Reachable target endpoint (e.g. http://127.0.0.1:PORT), or None before readiness / for non-networked targets.
control_socket str Path to the private Unix control socket mediating supervisor request/response exchange.
started_at datetime UTC timestamp the run was started.
deadline datetime UTC timestamp after which the watchdog forces teardown.
log_path str Path to this run's log file.
shutdown_forced bool False Whether teardown required SIGKILL after SIGTERM.
cleanup_complete bool False Whether cleanup was verified complete.

Class ScenarioResult

Machine evidence for one executed scenario/node (spec §2).

Fields:

Field Type Default Description
scenario_id str The :class:ScenarioSpec.id this result belongs to.
node_id str The specific pytest node ID this result reports on.
outcome _OutcomeLiteral Final outcome; passed/failed/skipped/xfailed/ xpassed/blocked/missing. Only passed counts toward satisfied required coverage.
reason_code Optional[str] None Machine-readable reason for a non-passed outcome, if any.
setup_outcome Optional[str] None Pytest setup phase outcome, if collected.
call_outcome Optional[str] None Pytest call phase outcome, if collected.
teardown_outcome Optional[str] None Pytest teardown phase outcome, if collected.
exit_code Optional[int] None Pytest process exit code for the run that produced this result.
duration_s float Wall-clock seconds the node took to execute.
target_run_ids list[str] :class:RunState.run_id values this node depended on.
artifact_paths list[str] Relative paths of artifacts (logs, JUnit XML, screenshots) captured for this result; hashed centrally in :class:E2EVerdict.artifact_hashes.

Class ScenarioSpec

One declared E2E scenario: a tier, its targets and its coverage (spec §2).

Fields:

Field Type Default Description
id str Stable scenario ID, unique within a plan.
tier _TierLiteral deterministic, live or exploratory.
target_ids list[str] Target keys (from :class:E2EPlan.targets) this scenario uses.
required bool False Whether the scenario must execute successfully for the gate.
node_ids list[str] Enumerated pytest node IDs. Nonempty for codified tiers (deterministic/live); must be empty for exploratory.
timeout_s float 60 Seconds allowed for this scenario's execution.
prerequisites list[str] Other scenario IDs that must pass before this one runs.
assertions list[str] Human-readable assertion descriptions recorded as intent.

Class SourceIdentity

A verifiable snapshot of the exact source/config a run was validated against (spec §2).

Fields:

Field Type Default Description
commit str Git commit SHA the working tree was based on.
manifest_sha256 str Hash of the canonical sorted tracked+nonignored-untracked file manifest (paths, modes and content hashes; never source contents).
spec_sha256 str Hash of the authoritative feature spec content.
plan_sha256 str Hash of the frozen :class:E2EPlan content.
environment_sha256 str Hash of the nonsecret environment fingerprint (interpreter, installed versions, lockfile, model, opt-ins).
worktree str Canonical (absolute, resolved) path the manifest was captured from.

Class TargetConfig

One supervised target's launch/readiness configuration (spec §2).

Fields:

Field Type Default Description
kind _TargetKindLiteral Target adapter selector.
profile _ProfileLiteral 'minimal' minimal (default) or full launch profile.
startup_timeout_s float 60 Seconds allowed for the target to become ready.
shutdown_timeout_s float 10 Seconds allowed for graceful shutdown before SIGKILL.
options dict[str, JsonValue] Adapter-specific options; allowed keys are validated by the target adapter before spawn (out of scope for this schema).

Class VerificationResult

The read-only outcome of validating a run's evidence without executing tests (spec §2).

MISSING is synthesized by verification itself (e.g. no evidence file found, or policy none's explicit exemption) — never fabricated as a successful run.

Fields:

Field Type Default Description
status _VerificationStatusLiteral PASS, FAIL, BLOCKED or MISSING.
gate_satisfied bool Whether required coverage was fully satisfied.
reason_codes list[str] Machine-readable reason codes explaining status.

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