Skip to content

docs(phase3-step8): TDD implementation plan — Plan + Permission Contract#16

Merged
AVADSA25 merged 1 commit into
mainfrom
docs/phase3-step8-plan
May 3, 2026
Merged

docs(phase3-step8): TDD implementation plan — Plan + Permission Contract#16
AVADSA25 merged 1 commit into
mainfrom
docs/phase3-step8-plan

Conversation

@AVADSA25
Copy link
Copy Markdown
Owner

@AVADSA25 AVADSA25 commented May 3, 2026

Summary

TDD implementation plan for Phase 3 Step 8 — Plan + Permission Contract. Generated via the superpowers:writing-plans skill from the approved blueprint (docs/PHASE3-BLUEPRINT.md §2). 19 tasks, 89 atomic TDD steps, 2364 lines.

This PR is the PLAN, not the implementation. Once approved, execution happens in a follow-up PR (feat/phase3-step8-implementation).

What Step 8 builds

Drop-a-project planning: user describes a project → Qwen-3.6 drafts structured plan with permission manifest → user approves in PWA → grants persisted with plan_hash for Step 9 tamper detection. No execution yet — Step 9 picks that up.

Plan structure

Task Purpose
1 Audit event constants (6 events)
2 Plan/Checkpoint/PermissionManifest dataclasses
3 Plan-hash (Q13 tamper detection)
4 Atomic R/W (tmp+rename pattern)
5 Skill-registry validation
6 Qwen-3.6 plan drafter (Q1: local-only)
7 Vague-description clarifying loop (Q3)
8 Global allowlist tier (Q4)
9 State machine (status transitions)
10 create_agent orchestrator
11 approve / reject / revise functions
12 9 PWA endpoints (routes/agents.py)
13 Approve/reject integration tests
14 Global grants endpoints test
15 Auto-approve via global allowlist
16 Pre-approval re-validation
17 End-to-end integration test
18 AGENTS.md documentation update
19 Final verification + push + PR

Estimated implementation outputs

  • 1 new module: codec_agent_plan.py (~500 LOC)
  • 1 new router: routes/agents.py (~200 LOC, 9 endpoints)
  • 25 new passing tests (tests/test_agent_plan.py, ~700 LOC)
  • 6 new audit event constants in codec_audit.py
  • 1 mount edit in codec_dashboard.py
  • AGENTS.md §X.X sub-section + §6 table + §10 don't-touch list

Quality discipline (from writing-plans skill)

  • Every step has exact file paths, exact code, exact pytest commands
  • Every test has a complete body (no "similar to Task N")
  • Every assertion is concrete
  • TDD pattern strictly followed: write failing test → run-fail → implement → run-pass → commit
  • No placeholders / TBDs / TODOs

Test plan

  • No code changes — docs-only PR
  • User reviews plan structure + task decomposition
  • After approval: execute the plan via superpowers:subagent-driven-development or superpowers:executing-plans

Sequencing

This PR (Step 8 plan) → user merges → execution PR ships → Step 8 sign-off → Step 9 plan → Step 9 execution → Step 9 sign-off → Step 10 plan → Step 10 execution → Phase 3 closeout.

Mirrors the Phase 1+2 cadence.

🤖 Generated with Claude Code

Implementation plan for Phase 3 Step 8 (Plan + Permission Contract).
Generated via superpowers:writing-plans skill.

19 tasks decomposing Step 8 into bite-sized TDD steps:

  1. Audit event constants (6 events + PHASE3_STEP8_EVENTS frozenset)
  2. Plan/Checkpoint/PermissionManifest dataclasses
  3. Plan-hash for Step 9 tamper detection (Q13)
  4. Atomic R/W for plan/state/manifest/grants (tmp+rename pattern)
  5. Skill-registry validation
  6. Qwen-3.6 plan drafter (local-only per Q1)
  7. Vague-description clarifying loop via codec_ask_user.ask (Q3)
  8. Global allowlist tier (Q4)
  9. State machine (status transitions)
  10. create_agent orchestrator + audit emits
  11. approve/reject/revise functions
  12. PWA endpoints — CRUD + global grants
  13. PWA approve/reject integration tests
  14. PWA global grants endpoints test
  15. Auto-approve via global allowlist (the integration moment)
  16. Pre-approval re-validation against registry
  17. End-to-end integration test
  18. AGENTS.md documentation update
  19. Final verification + push + open PR

Estimated outputs:
- 1 new module (codec_agent_plan.py, ~500 LOC)
- 1 new router (routes/agents.py, ~200 LOC, 9 endpoints)
- 25 new passing tests (tests/test_agent_plan.py, ~700 LOC)
- 6 new audit event constants in codec_audit.py
- 1 codec_dashboard.py mount edit
- AGENTS.md §X.X sub-section + §6 table extension + §10 don't-touch

Each task is fully self-contained with exact file paths, exact code,
exact pytest commands with expected outputs. No placeholders, no
"similar to Task N" shortcuts, no missing test bodies.

Reference: docs/PHASE3-BLUEPRINT.md (approved by user 2026-05-03).

After Step 8 lands and signs off, Steps 9 + 10 plans will follow the
same writing-plans cadence.
@AVADSA25 AVADSA25 merged commit c70ae16 into main May 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants