← Documentation indexdocs/superpowers/plans/2026-10-16-v3-issue-245.md

V3 Issue #245 — Strategic Plans Implementation Plan

For agentic workers: execute this indexed plan task by task; keep the PR based on #242 and do not merge it.

Goal: Preserve Plan Mode as a non-executing, versioned user approval of stable objectives, acceptance criteria, workspace scope, permitted effects/capabilities, and risk limits, with a linked mutable Working Plan.

Architecture: Extend the existing InteractionController event-sourced proposal lifecycle and TaskManager transaction. Keep proposals and legacy message shapes as compatibility projections; persist the accepted Strategic Plan and linked Working Plan/tasks in the existing event and task stores, atomically. Strategic acceptance remains separate from capability grants, tool approvals, task evidence, and completion.

Tech Stack: Python 3.12–3.13, unittest, existing SQLite repositories and interaction event log; no new dependency.

Spec: GitHub issue #245, requirements R069–R073, R077, and R080; approved batch plan in the task history.

Global Constraints

Files in Scope

Review Focus


Task 1: Versioned Strategic Plan contract

Files: openkyrozen/agent/modes.py, openkyrozen/agent/prompts.py, tests/test_interaction.py.

Task 2: Atomic acceptance and task linkage

Files: openkyrozen/agent/modes.py, openkyrozen/tasks/engine.py, openkyrozen/tasks/ports.py, openkyrozen/persistence/store.py, openkyrozen/persistence/tasks.py, migration code, tests/test_interaction.py, tests/test_working_plans.py, tests/test_sqlite_migrations.py.

Task 3: Lifecycle, interfaces, and compatibility

Files: openkyrozen/agent/modes.py, openkyrozen/agent/loop.py, openkyrozen/agent/protocol.py, openkyrozen/agent/session.py, relevant interface projections, tests/test_interaction.py, tests/test_web_sessions.py, docs/tasks-and-automation.md.

Task 4: Verification and delivery

Validation Record

Implementation started from PR #284 head 0d49d4a488f6a9894b42900054cf06c665b9809f, based on refreshed main d71d2bd42b68485feb4571d3aad490d7d8327aa3.

Review follow-up

Final-head review follow-up: PR #285

Before changing code, reproduce the eight outstanding findings on head befb08c and add regressions. Keep the scope within #245 and its Working Plan boundary; do not start #246 here.

  1. Parse legacy JSON-object arguments before Strategic Plan path/effect checks, so serialized search_files and edit_file paths cannot bypass accepted roots.
  2. Canonicalize legacy arguments once for ExecutionReceipt and acceptance matching, without changing the string passed to legacy executors.
  3. Reject non-string risk_ceiling values with InteractionError rather than leaking TypeError from set membership.
  4. Require Strategic Plan objective/criterion bindings for Working Plan additions or semantic updates while a plan is executing; preserve valid bindings for allowed ordering and dependency edits.
  5. Permit the exact staged material revision to replace its previous executing revision through one transaction, retaining prior evidence and preventing simultaneous active plans.
  6. Reconcile completion from durable terminal Working Plan state after restart so a crash between task terminalization and completion-event append cannot strand Agent mode.
  7. Make concurrent duplicate acceptance idempotent inside the transaction by returning the already-linked plan for the same accepted version/fingerprint.
  8. Reconstruct active accepted bounds independently of the capped generic event listing so long sessions cannot lose capability, effect, risk, or workspace checks.

All eight findings were reproduced and fixed; regressions cover each boundary. Also fixed two issues exposed while reproducing the findings: receipt evidence now preserves the Strategic Plan checkpoint, and normalized proposals retain their verification contracts on revalidation.

The update remains limited to #245. Leave PR #285 and issue #245 open and unmerged.

Stacked CI follow-up

Delegated legacy-action CI regression

Read-verifier evidence review finding

Final-head Codex review findings

Follow-up review fixes: pathless reads now authorize their effective . path; explicit file objectives match only that exact file; cancelled current objectives remain completion blockers; contract actions are checked against normalized bounds; verifier receipts may match separately from execution actions; and every required acceptance ID is enforced. Focused interaction and execution-receipt suites pass. GitHub lists piggyevan123@gmail.com as the verified address for the signing key; this follow-up uses that identity.

Local full-suite status: 879 of 880 tests passed; the remaining existing 50 ms provider transport-timeout test also fails unchanged on main (146bb19) because no request reaches the fixture before the deadline. The final-head CI workflow dispatch is running; review fixes themselves pass their focused suites.