← Documentation indexdocs/superpowers/plans/2026-10-14-v3-issue-236.md

V3 Issue #236 — Execution Receipts and Task Association

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox syntax for tracking.

Goal: Make each tool receipt identify the exact call and authorized operation, associate tasks only by explicit identity in native execution, and record evidence from typed outcomes.

Architecture: Extend the existing ExecutionReceipt and shared AgentRuntime.execute_call() boundary. Keep TaskManager as the owner of Working Plan lifecycle and evidence, ToolRegistry as the owner of tool metadata, and EventStore as the durable receipt log. Preserve compatibility fields as bounded projections of the immutable tool result.

Tech Stack: Python 3.12–3.13, dataclasses, existing JSON-safe ToolResult, SQLite-backed event/task stores, unittest.

Spec: OpenKyrozen V3 GitHub issue #236, covering R026–R030 and R066.

Global Constraints

Review Focus

Caller and Data Map


Task 1: Receipt contract and stable operation identity

Files: - Modify: openkyrozen/agent/types.py - Modify: openkyrozen/agent/executor.py - Test: tests/test_execution_receipts.py (create) and tests/test_tool_results.py

Interfaces: - Consumes: ToolCall, ToolResult, and ToolError from the existing provider/tools contracts. - Produces: immutable receipt fields for call_id, call_id_source (native, legacy, or synthetic), typed arguments, tool_result, user_id, workspace_id, session_id, plan_id, task_id, tool_version, tool_source, side_effects, and structured verification; as_dict() remains a bounded compatibility projection.

Task 2: Preserve call identity and enforce explicit task binding

Files: - Modify: openkyrozen/agent/runtime.py - Modify: openkyrozen/app/bootstrap.py - Modify: openkyrozen/agent/executor.py - Modify: task evidence owner under openkyrozen/tasks/ - Test: tests/test_execution_receipts.py, tests/test_working_plans.py, tests/test_approval_request.py

Interfaces: - Consumes: Task 1 receipt fields. - Produces: AgentRuntime.execute_call(..., *, task_id: str | None = None); explicit task identity flows to TaskManager.record_evidence(task_id=...); native calls with no task ID are unassociated. Legacy execute() supplies a marked synthetic call ID and retains heuristic task association through its compatibility adapter.

Task 3: Typed verification, acceptance, and effect classes

Files: - Modify: openkyrozen/agent/executor.py - Modify: openkyrozen/agent/subagent_runtime.py - Modify: openkyrozen/learning/evolution.py - Modify: openkyrozen/tools/catalog.py and openkyrozen/tools/manifest.py - Test: tests/test_execution_receipts.py, tests/test_tool_results.py, and affected task/registry tests

Interfaces: - Consumes: typed receipt and task binding from Tasks 1–2; existing explicit ToolResult and CommandResult status. - Produces: verification states verified, failed, unavailable, or not_applicable, including method/observed evidence; refined side-effect classes read_only, filesystem, process, remote, destructive, and internal (legacy registrations map conservatively).

Task 4: Compatibility, documentation, and issue validation

Files: - Modify: openkyrozen/agent/__init__.py and openkyrozen/__init__.py as needed for public exports. - Modify: docs/security.md, docs/tasks-and-automation.md, docs/architecture.md, and receipt fixtures/callers as needed. - Test: focused suites plus full repository targets.

Interfaces: - Consumes: completed receipt/evidence contract from Tasks 1–3. - Produces: documented, exported receipt API and compatible historical JSON event payloads, with native/MCP/subagent consumers using call identity and explicit task association.