Skip to content

API Reference parrot.sdd.scripts.close_task

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

parrot.sdd.scripts.close_task

View source

Deterministically close a single SDD task (Python port of scripts/sdd/close_task.sh, FEAT-633).

Moves sdd/tasks/active/<TASK-ID>-*.md to sdd/tasks/completed/, marks it "done" in its per-spec index, stages the change, then HARD-VERIFIES that no active copy survives. Usage (identical to the shell script):

python -m parrot.sdd.scripts.close_task <TASK-ID> <feature-slug> [verified|partial|forced]

Exit codes: 0 closed (idempotent) · 1 usage · 2 nothing to close · 3 post-condition failed · 5 index not valid JSON / no task list (jq parity) · 128 not a git repository (git parity).

Attribute ACTIVE_DIR

Attribute COMPLETED_DIR

Attribute INDEX_DIR

Attribute USAGE

Function main

Port of close_task.sh C1–C14 (positional args only; extra args ignored, verification not validated).

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

Parameter Type Default Description
argv Sequence[str] | None None

Returns: int

Function sync_status_header

Rewrite the first **Status**: pending|in-progress line of task_file to **Status**: done.

sync_status_header(task_file: Path) -> bool

Parameter Type Default Description
task_file Path

Returns: bool — True when the header was rewritten, False when there was nothing to change.

Function update_index

C10: mark task_id done in the per-spec index; stamp top-level completed_at when every task is done.

completed_at and verification are write-once (dev f9e08bee3, issue:732f350600d1): a re-run on an already-closed task — the idempotent path — re-asserts status/file but never moves recorded history to now.

update_index(index: Path, task_id: str, verification: str, completed_file: str, now: str) -> None

Parameter Type Default Description
index Path
task_id str
verification str
completed_file str
now str

Raises:

  • ValueError — when the index is not valid JSON or tasks is not a list (caller returns 5, jq parity).

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