Skip to content

API Reference parrot.integrations.devloop.models

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

parrot.integrations.devloop.models

View source

Data contracts for the dev-loop integration (spec §2 Data Models, FEAT-555).

Kept import-cheap on purpose: only stdlib, pydantic and navconfig at module level. parrot.conf (and therefore the whole config bootstrap) is only imported lazily inside :meth:DevLoopIntegrationConfig.validate.

Class BridgeResult

Outcome of a command sent to the child (TASK-3202).

Fields:

Field Type Default Description
ok bool
status int
reason str ''

Class CommandSyntaxError

Bad /devloop text; usage carries the help text to show the user.

Parameter Type Default Description
message str
usage str ''

Class DevLoopCommand

Parsed /devloop … text (spec §2).

Fields:

Field Type Default Description
action Literal['dispatch', 'status', 'cancel', 'help']
type Optional[RequestType] None
prompt str ''
title Optional[str] None
jira_issue_key Optional[str] None
base_branch Optional[Literal['dev', 'staging']] None
component Optional[str] None
acceptance_command Optional[str] None
run_id Optional[str] None

Class DevLoopError

Base error for the dev-loop integration.

Class DevLoopIntegrationConfig

devloop: section of a Slack bot entry in integrations_bots.yaml.

Env fallbacks use the {NAME}_DEVLOOP_* prefix, mirroring SlackAgentConfig.__post_init__.

Parameter Type Default Description
name str ''
enabled bool False
repo_path str ''
command List[str] (lambda: ['parrot', 'devloop', 'run'])()
redis_url str ''
socket_dir str ''
use_tcp bool False
default_component str 'ai-parrot'
default_acceptance_criteria List[Dict[str, Any]] list()
status_card bool True
max_concurrent_runs Optional[int] None
run_retention_seconds int 86400
handshake_timeout_seconds float 120.0
cancel_grace_seconds float 45.0
tail_drain_seconds float 5.0

Fields:

Field Type Default Description
name str '' The owning bot's config name (used for env-fallback prefixes).
enabled bool False Whether this bot dispatches dev-loop runs at all.
repo_path str '' cwd of the headless child; falls back to {NAME}_DEVLOOP_REPO_PATH.
command List[str] field(default_factory=lambda: ['parrot', 'devloop', 'run']) Argv used to spawn the headless child.
redis_url str '' Redis URL for the tail/registry; falls back to {NAME}_DEVLOOP_REDIS_URL.
socket_dir str '' Directory for per-run Unix sockets/brief files; falls back to {NAME}_DEVLOOP_SOCKET_DIR. Empty + use_tcp=True means TCP-only.
use_tcp bool False Force --command-port instead of --command-socket.
default_component str 'ai-parrot' WorkBrief.affected_component default for bug runs.
default_acceptance_criteria List[Dict[str, Any]] field(default_factory=list) ShellCriterion-shaped dicts used when a bug run's --ac is not given. Mandatory (non-empty) when enabled.
status_card bool True Whether to render the live node-status card (M13).
max_concurrent_runs Optional[int] None Soft cap on live runs; None = unlimited (decision).
run_retention_seconds int 86400 TTL applied to a terminal run's Redis record.
handshake_timeout_seconds float 120.0 How long to await the child's handshake.
cancel_grace_seconds float 45.0 Parent-side escalation to terminate() after a cancel with no terminal action/exit (S7); must exceed the child's own --cancel-grace.
tail_drain_seconds float 5.0 How long the tail may run after the child exits (S8).

Method DevLoopIntegrationConfig.from_dict

Build from the parsed YAML mapping (unknown keys ignored).

from_dict(name: str, data: Dict[str, Any]) -> 'DevLoopIntegrationConfig'

Parameter Type Default Description
name str The owning bot's config name.
data Dict[str, Any] The devloop: mapping from integrations_bots.yaml.

Returns: 'DevLoopIntegrationConfig' — The constructed config.

Method DevLoopIntegrationConfig.validate

Return config errors; empty when valid.

Spec §7 Q2: default_acceptance_criteria is mandatory when enabled, and every criterion's command head must be in conf.ACCEPTANCE_CRITERION_ALLOWLIST.

validate() -> List[str]

Returns: List[str] — A list of human-readable error strings (empty ⇒ valid).

Class GateView

Transport-facing projection of ApprovalGate (session_state.py:257).

Fields:

Field Type Default Description
gate_id str
kind str
title str
instructions str ''
payload_ref str ''
questions List[str]
expires_at Optional[float] None
status str 'pending'
resolved_by str ''
answers Dict[str, str]

Class NotRunOwnerError

The actor is not the run's initiator.

owner_user_id lets a transport render something like "This run belongs to <@owner>".

Parameter Type Default Description
owner_user_id str

Class PendingConfirmation

A brief parked behind the confirm card (Q1, both kinds).

Memory-only, 15 min TTL — the dispatch service (TASK-3204) owns the in-memory dict this is stored in.

Fields:

Field Type Default Description
pending_id str
kind RequestType
brief Dict[str, Any]
fields Dict[str, str]
requester Requester
channel_id str
message_ts str ''
created_at float
expires_at float

Attribute RequestType

Class Requester

Channel-neutral identity of the human behind a command.

Fields:

Field Type Default Description
transport str
tenant_id str ''
user_id str
display_name str ''
email str ''

Attributes:

Attribute Type Description
actor str Stable audit identity used as resolved_by / requested_by.

Class RunEvent

Reduced session-state action (spec §2).

Fields:

Field Type Default Description
run_id str
kind Literal['snapshot', 'gate_opened', 'gate_resolved', 'gate_expired', 'node_changed', 'jira_linked', 'run_closed', 'run_cancelled', 'process_exited']
seq int 0
gate Optional[GateView] None
node_id str ''
node_status str ''
state Optional[Dict[str, Any]] None
exit_code Optional[int] None
stderr_tail str ''

Class RunNotFoundError

No run record for the given id.

Class RunRecord

One dispatched run; mirrored to Redis at devloop:runs:{run_id} (TASK-3203).

Fields:

Field Type Default Description
run_id str
kind RequestType
title str
requester Requester
channel_id str
thread_ts str ''
command_endpoint str ''
command_token str ''
pid Optional[int] None
phase str 'starting'
current_node str ''
pending_gate_id str ''
pr_url str ''
jira_issue_key str ''
error str ''
last_seen_seq int 0
status_message_ts str ''
brief_path str ''
started_at float
finished_at Optional[float] None
exit_code Optional[int] None

Class SpawnError

The headless child failed before its handshake.

Parameter Type Default Description
message str
exit_code Optional[int] None
stderr_tail str ''

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