docs(phase3-step9): TDD implementation plan — Background Execution + Permission Gate#18
Merged
Merged
Conversation
Implementation plan for Phase 3 Step 9 (Background Execution + Permission Gate). Generated via superpowers:writing-plans skill. 11 tasks decomposing Step 9 into bite-sized TDD steps: 1. Audit event constants (8 events + PHASE3_STEP9_EVENTS frozenset) 2. Extend _VALID_TRANSITIONS with Step 9 runtime statuses 3. PermissionViolation + permission_gate (4-test matrix) 4. Qwen-3.6 next-action driver (3 tests) 5. Strict-consent gate integration for destructive ops (2 tests) 6. _execute_checkpoint inner loop (4 tests: happy/perm/destructive/budget) 7. _run_agent main thread function (5 tests: happy/blocked/aborted/tampered/resume) 8. Daemon outer loop + multi-agent concurrency (6 tests inc. Q6/Q8/Q15) 9. PWA endpoints — abort/pause/resume/grant (4 tests) 10. PM2 ecosystem config + heartbeat monitoring 11. Final pytest + AGENTS.md docs + push + PR Estimated outputs: - 1 new module (codec_agent_runner.py, ~700 LOC) - 1 new PM2 service (codec-agent-runner) - 31 new passing tests (tests/test_agent_runner.py) - 8 new audit event constants in codec_audit.py - 4 new PWA endpoints in routes/agents.py - ecosystem.config.js + codec_heartbeat.py + AGENTS.md updates Each task is self-contained with exact file paths, exact code, exact pytest commands with expected outputs. No placeholders. Reference: docs/PHASE3-BLUEPRINT.md §3 (approved 2026-05-03). After Step 9 lands and signs off, Step 10 plan will follow the same writing-plans cadence (UI + proactive messaging + auto-escalation).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TDD implementation plan for Phase 3 Step 9 — Background Execution + Permission Gate. Generated via
superpowers:writing-plansfrom the approved blueprint (docs/PHASE3-BLUEPRINT.md§3). 11 tasks, 54 atomic TDD steps, 2113 lines.What Step 9 builds
The runtime layer. Approved plans (Step 8) actually run autonomously:
codec-agent-runner(5s tick daemon)Still no UI — Step 10 picks that up.
Plan structure
_execute_checkpointinner loop_run_agent(happy/blocked/aborted/tampered/resume)Estimated implementation outputs
codec_agent_runner.py(~700 LOC)codec-agent-runnerQuality discipline
Action,PermissionViolation,_qwen_next_action,_execute_checkpoint,_run_agent,permission_gateall defined once, reused with consistent signaturesTest plan
superpowers:subagent-driven-developmentSequencing
This PR (Step 9 plan) → user merges → execution PR ships → Step 9 sign-off → Step 10 plan → Step 10 execution → Phase 3 closeout.
🤖 Generated with Claude Code