Skip to content

API Reference parrot.flows.dev_loop.sdd_coder.toolkit

github-actions[bot] edited this page Nov 5, 2026 · 4 revisions

parrot.flows.dev_loop.sdd_coder.toolkit

View source

parrot mcp-local sdd-coder — MCP surface of the sdd_coder kernel (FEAT-549, spec §3 M5).

Alias AbstractToolkit

Re-exported from parrot.tools.toolkit.AbstractToolkit.

Alias CoderBgStatusArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderBgStatusArgs.

Alias CoderBgWaitArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderBgWaitArgs.

Alias CoderCleanupArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderCleanupArgs.

Alias CoderDeliveryReportArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderDeliveryReportArgs.

Alias CoderEndExecutionArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderEndExecutionArgs.

Alias CoderError

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderError.

Alias CoderFailure

Re-exported from parrot.flows.dev_loop.sdd_coder.engine.CoderFailure.

Alias CoderFeedbackReportArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderFeedbackReportArgs.

Alias CoderJob

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderJob.

Alias CoderJobView

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderJobView.

Alias CoderMergeArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderMergeArgs.

Alias CoderPlanArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderPlanArgs.

Alias CoderPlanRequestArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderPlanRequestArgs.

Alias CoderPrepareNativeArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderPrepareNativeArgs.

Alias CoderReadArtifactArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderReadArtifactArgs.

Alias CoderRecordFeedbackArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderRecordFeedbackArgs.

Alias CoderRecordNativeObservationArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderRecordNativeObservationArgs.

Alias CoderRecordReviewArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderRecordReviewArgs.

Alias CoderResult

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderResult.

Alias CoderRunChunkArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderRunChunkArgs.

Alias CoderRunValidationArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderRunValidationArgs.

Alias CoderStatusArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderStatusArgs.

Alias CoderTaskContextArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderTaskContextArgs.

Alias CoderWaitArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.CoderWaitArgs.

Attribute EXCLUSIVE_WAIT_S

Type: float

Alias RosterConfig

Re-exported from parrot.flows.dev_loop.sdd_coder.models.RosterConfig.

Alias SddCoderEngine

Re-exported from parrot.flows.dev_loop.sdd_coder.engine.SddCoderEngine.

Class SddCoderToolkit

Orchestration and correction feedback for sdd-worker; every result is a CoderResult.

Parameter Type Default Description
roster Union[List[Dict[str, Any]], RosterConfig]
redis_url Optional[str] None
worktree_base_path Optional[str] None
telemetry_dir Optional[str] None
lint Optional[Dict[str, Any]] None
feedback Optional[Dict[str, Any]] None
complexity Optional[Dict[str, Any]] None
suspension_policy Optional[Dict[str, Any]] None
**kwargs Any {}

Attributes:

Attribute Type Description
llm_dependent_tools frozenset
auto_open bool
arg_models Dict[str, type[BaseModel]]

Method SddCoderToolkit.coder_plan

Next wave of feature sliced into distinct-seat chunks; roster availability; orphan branches.

Returns a CoderPlan containing:

  • assessments: ComplexityAssessment for each task in the wave
  • routing_blocks: ComplexityBlock entries for tasks that cannot be dispatched
  • Standard tasks use configured roster rotation; complex/unknown tasks are restricted to strong-model seats

response_mode='compact' (FEAT-584 M3/R2) projects the same plan into a <=16 KiB view instead, recoverable in full via coder_read_artifact.

coder_plan(feature: str, worktree: str, execution_id: str, response_mode: Literal['full', 'compact'] = 'full') -> CoderResult

Parameter Type Default Description
feature str
worktree str
execution_id str
response_mode Literal['full', 'compact'] 'full'

Returns: CoderResult

Method SddCoderToolkit.coder_run_chunk

Dispatch the MCP-seat tasks of the current chunk in parallel; returns a job id immediately.

coder_run_chunk(feature: str, worktree: str, task_ids: List[str], execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
task_ids List[str]
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_prepare_native

Create the sub-worktree for a native (haiku) task; the orchestrator launches the agent itself.

coder_prepare_native(feature: str, worktree: str, task_id: str, execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
task_id str
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_merge

Clean-status check, fidelity check and merge of the task's latest attempt branch.

coder_merge(feature: str, worktree: str, task_id: str, execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
task_id str
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_record_feedback

Record a confirmed defect corrected by the worker in one coder delivery.

Supply source (review_fix_commit or code_review), lesson_scope=model, task_id, attempt_uid, backend, actual model, stable pattern slug, repository-relative files, defect, evidence, correction and verification. Use the attempt's resolved_model when present, otherwise model; native identity comes from coder_prepare_native. Call after each verified fix, before dispatching the next chunk. Never file infrastructure failures or speculative findings or engine lint fixes. Repo-wide lessons belong in conventions or the Codebase Contract. Records survive issue closure and cleanup.

coder_record_feedback(feature: str, worktree: str, feedback: Union[Dict[str, Any], BaseModel], execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
feedback Union[Dict[str, Any], BaseModel]
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_record_review

Record EVERY completed coder handoff review, including zero corrections.

Supply task_id, attempt_uid, backend, actual model, fix_commits (full SHAs of all fix(...) TASK-N review fixes commits, [] when none), and review_evidence. Exclude engine lint commits. The engine attaches actual feedback exposure so before/after rates include clean deliveries too.

coder_record_review(feature: str, worktree: str, review: Union[Dict[str, Any], BaseModel], execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
review Union[Dict[str, Any], BaseModel]
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_record_native_observation

Persist host observations for an issued native attempt without accepting it.

Reports agent linkage and observed dispatch/completion for a native attempt coder_prepare_native already issued in THIS execution. Supply event_id, task_id, attempt_uid, agent_id, observed_at, kind=dispatched|finished, evidence_ref; started_at/ended_at/terminal are optional -- leave the span null when only the arrival of the result is known, never infer it from an immediate dispatch tool_result. Never marks the task accepted, never releases the attempt's reservation and never substitutes for coder_merge; a repeated event_id reported with different content is rejected as a conflict, and an attempt/execution this engine did not itself issue is rejected as a foreign identity.

coder_record_native_observation(feature: str, worktree: str, execution_id: str, observation: Dict[str, Any]) -> CoderResult

Parameter Type Default Description
feature str
worktree str
execution_id str
observation Dict[str, Any]

Returns: CoderResult

Method SddCoderToolkit.coder_task_context

Inspect task context and blockers without modifying SDD state.

Snapshot of the task's index entry, dependency status (unmet dependencies are always listed in blockers, never treated as satisfied) and declared file contract, replacing a manual index -> task -> dependencies -> contract read chain. Never marks a task ready on trust and never converts an unaccepted dependency into ready.

coder_task_context(feature: str, worktree: str, task_id: str, execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
task_id str
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_delivery_report

Inspect delivery scope and known evidence; never validates, autofixes or merges.

Reports the execution-owned attempt branch, commit count, diff stat, changed/out-of-scope files (per the existing file-fidelity contract) and the sub-worktree's own status. Never runs tests or a merge: lint/test/review evidence not already durably recorded is reported as "unknown", never fabricated as a pass.

coder_delivery_report(feature: str, worktree: str, task_id: str, execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
task_id str
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_feedback_report

Read repository-wide review correction commits per task/model, grouped by feedback exposure.

Read-only and repository-wide: never starts, resumes or requires an execution.

coder_feedback_report(feature: str, worktree: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str

Returns: CoderResult

Method SddCoderToolkit.coder_begin_execution

Begin (or idempotently resume) this worker's execution pool.

Reads durable suspension history for the canonical feature worktree BEFORE probing any seat, then binds execution_id to that worktree for the rest of this call chain (coder_plan/coder_run_chunk/ coder_prepare_native/coder_merge/coder_cleanup/ coder_record_feedback/coder_record_review/coder_suspend_model all require the SAME id). Only one active execution may own a canonical worktree at a time -- a second id gets execution_in_progress.

coder_begin_execution(feature: str, worktree: str, execution_id: str) -> CoderResult

Parameter Type Default Description
feature str
worktree str
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_end_execution

End an execution, releasing worktree ownership once all admitted work has settled.

Refuses (execution_busy) while known attempts/native reservations/jobs are still in flight -- an error report alone never unlocks this; only explicit settlement (a real coder_merge) does. The error names each task still holding the execution and lists them in details.in_flight.

coder_end_execution(execution_id: str) -> CoderResult

Parameter Type Default Description
execution_id str

Returns: CoderResult

Method SddCoderToolkit.coder_suspend_model

Report a worker-observed failure for ONE OF ITS OWN admitted attempts.

Valid only for a native attempt (any reason) or a confirmed critical review defect on any attempt (reason='review_critical') -- every other MCP-seat failure is classified and suspended internally by the engine itself, never reported through this tool. The target model is resolved server-side from attempt_uid; the caller cannot name or invent a model directly.

coder_suspend_model(execution_id: str, attempt_uid: str, reason: str, evidence_ref: str) -> CoderResult

Parameter Type Default Description
execution_id str
attempt_uid str
reason str
evidence_ref str

Returns: CoderResult

Method SddCoderToolkit.coder_wait

Block up to timeout_seconds (≤ 300) and return the job snapshot plus its per-seat seats roll-up.

response_mode='compact' (FEAT-584 M3/R2) projects the same snapshot into a <=16 KiB view; the owning execution_id is resolved from the job itself, server-side -- never accepted as a separate argument.

coder_wait(job_id: str, timeout_seconds: int = 120, response_mode: Literal['full', 'compact'] = 'full') -> CoderResult

Parameter Type Default Description
job_id str
timeout_seconds int 120
response_mode Literal['full', 'compact'] 'full'

Returns: CoderResult

Method SddCoderToolkit.coder_status

Non-blocking job snapshot plus its per-seat seats roll-up (tasks, retries, duration, tokens).

FEAT-559: status() is now async (TASK-3282) -- it retries any pending suspension persistence idempotently before returning, so a degraded write becomes durable as soon as possible without a separate flush call.

response_mode='compact' (FEAT-584 M3/R2) projects the same snapshot into a <=16 KiB view; the owning execution_id is resolved from the job itself, server-side -- never accepted as a separate argument.

coder_status(job_id: str, response_mode: Literal['full', 'compact'] = 'full') -> CoderResult

Parameter Type Default Description
job_id str
response_mode Literal['full', 'compact'] 'full'

Returns: CoderResult

Method SddCoderToolkit.coder_read_artifact

Read a bounded page from evidence emitted for this execution only.

Recovers a full coder_plan/coder_wait/coder_status snapshot (or one of their paginated pending/blocked overflow pages) that a compact response_mode referenced by evidence_ref/ required_pages_remaining. Confinement to one execution's own artifacts/ directory happens inside ExecutionEvidenceStore (evidence.py) -- never here, and never from a caller-supplied path.

coder_read_artifact(execution_id: str, artifact_id: str, offset: int = 0, limit: int = 8192) -> CoderResult

Parameter Type Default Description
execution_id str
artifact_id str
offset int 0
limit int 8192

Returns: CoderResult

Method SddCoderToolkit.coder_cleanup

Remove merged sub-worktrees THIS execution created; keep conflicted ones unless told otherwise.

Never enumerates or deletes another execution's managers, native reservations or worktrees, even on the same engine instance.

coder_cleanup(feature: str, worktree: str, execution_id: str, keep_conflicted: bool = True) -> CoderResult

Parameter Type Default Description
feature str
worktree str
execution_id str
keep_conflicted bool True

Returns: CoderResult

Method SddCoderToolkit.coder_bg_status

Read authoritative known background state without waiting for termination.

handle is opaque and only ever comes from a prior coder_run_chunk (bg_handle), coder_prepare_native (bg_handle) or coder_run_validation (handle) response -- never a PID, a log path or anything invented by the model. Never spawns a shell, ps, tail or kill -0, and never waits for the underlying process/job to finish: state=finished reports a real receipt, not test success or task acceptance -- check outcome/exit_code separately. unknown after this engine loses the launch's ownership (e.g. a restart) is never resurrected into finished from an absent PID or an empty log.

coder_bg_status(execution_id: str, handle: str, since_revision: Optional[int] = None, tail_bytes: int = 2048) -> CoderResult

Parameter Type Default Description
execution_id str
handle str
since_revision Optional[int] None
tail_bytes int 2048

Returns: CoderResult

Method SddCoderToolkit.coder_bg_wait

Block up to timeout_seconds (<= 300) until a background handle settles, then return its status.

The blocking counterpart of coder_bg_status, and the ONLY sanctioned way to wait for a coder_run_validation handle: a background validation raises no host task notification, so ending the turn to "be woken" stalls the run. Loop this call instead -- never a ps/grep/tail/sleep shell loop, and never in the same message as another wait (the server runs tool calls concurrently, so a second call is not blocked, only wasted).

Ownership and existence are checked before any waiting, so a foreign or unknown handle fails immediately. An expired budget returns the last known non-terminal snapshot and leaves the run untouched; it is never a receipt. state="finished" still reports a receipt, not success -- check outcome/exit_code separately, exactly as with coder_bg_status.

coder_bg_wait(execution_id: str, handle: str, timeout_seconds: int = 120, since_revision: Optional[int] = None, tail_bytes: int = 2048) -> CoderResult

Parameter Type Default Description
execution_id str
handle str
timeout_seconds int 120
since_revision Optional[int] None
tail_bytes int 2048

Returns: CoderResult

Method SddCoderToolkit.coder_run_validation

Launch only a declared SDD validation and return a bg_handle without waiting for it.

Admits exactly the existing test selector's own tier-scoped plan (tier='merge' for changed scope, 'feature' for the full applicable set) inside the protected sandbox -- never an arbitrary argv/script, and never runs tests through this or any other read-only tool directly. task_ids must already be declared in the feature's per-spec index. timeout_seconds (1-7200) is mandatory and explicit -- no expected duration is claimed without history. request_id is stable idempotency: the SAME request/payload replays the SAME handle; a DIFFERENT payload under a reused request_id is rejected, never a second silent process. Every admitted validation must settle before coder_end_execution/coder_cleanup on this worktree.

tier='task' (FEAT-709) validates ONE task on its attempt worktree: it needs exactly one id in task_ids and the attempt_uid of an attempt this execution issued; the engine resolves that attempt's worktree and supplies the fork SHA as base_ref itself.

coder_run_validation(feature: str, worktree: str, execution_id: str, task_ids: List[str], tier: Literal['task', 'merge', 'feature'], timeout_seconds: int, request_id: str, attempt_uid: Optional[str] = None) -> CoderResult

Parameter Type Default Description
feature str
worktree str
execution_id str
task_ids List[str]
tier Literal['task', 'merge', 'feature']
timeout_seconds int
request_id str
attempt_uid Optional[str] None

Returns: CoderResult

Alias SuspendModelArgs

Re-exported from parrot.flows.dev_loop.sdd_coder.models.SuspendModelArgs.

Alias project_response

Re-exported from parrot.flows.dev_loop.sdd_coder.views.project_response.

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