Skip to content

docs: master roadmap + P2–P7 TDD migration plans to 100% parity#1

Open
sqlrush wants to merge 17 commits into
mainfrom
docs/migration-plans
Open

docs: master roadmap + P2–P7 TDD migration plans to 100% parity#1
sqlrush wants to merge 17 commits into
mainfrom
docs/migration-plans

Conversation

@sqlrush

@sqlrush sqlrush commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the parent roadmap and nine per-phase TDD implementation plans that take ccgo from the merged Phase 1 (interactive REPL) to 100% functional parity with Claude Code. No production code changes — planning docs only.

Every plan was authored by reading the real code on both sides (ccgo + the CC TypeScript reference), not self-reported roadmap docs, and follows the Phase 1 exemplar format (failing test → minimal impl → verify → commit) with exact file:line anchors and runnable verification commands.

What's included

Doc Tasks
00-master-roadmap — locked scope, dependency graph, phase table, milestone gates, shared Global Constraints, plan index, §10 code-verified corrections
phase2-interactive-completeness (UI 复刻主体, critical path) 13
phase3-agent-loop-wiring (cache / thinking / stop-reason) 9
phase4-auth-oauth 7
phase5-tools (prompts / web* / plan-ask / LSP) 10
phase6a-mcp-cli-remote-oauth 10
phase6b-commands 13
phase6c-memory-claudemd-rewind 8
phase6d-hooks-lifecycle 9
phase7-sandbox-team-sdk 9

88 TDD tasks total across P2–P7 (~18K lines of plans).

Code-verified corrections to the gap audit (master §10)

Writing the plans against real code surfaced stale/imprecise audit items. Net: several subsystems are cheaper than audited (library built, glue missing), Phase 7 slightly larger.

  • Cheaper: ~/.claude/history.jsonl store already fully built (0 callers); claude mcp serve + MCP elicitation protocol already complete (MCP net-new ≈1.8–2.5K, not ~6K); OAuth BuildAuthURL + PKCE + endpoints already present; config.WriteSettingsDocument + native.BuildColorDiff already exist for Phase 2.
  • Hooks audit stale: UserPromptSubmit/Stop/SubagentStop already fire; CC has 27 events (~16 in scope, 8 already work); real gap = 6 events + sequential→parallel deny>ask>allow.
  • pause_turn (audit item 11) is absent from the CC reference → implement minimal resume.
  • Phase 7 larger: the single "real" subagent is also record-only (no model loop); seatbelt/landlock profiles live in an external CC package, must be native in Go.

New dependencies the plans introduce (only where justified)

  • Phase 4: none (keychain via os/exec/usr/bin/security, like CC).
  • Phase 7: add github.com/landlock-lsm/go-landlock + promote golang.org/x/sys to direct; seccomp hand-rolled; macOS uses OS sandbox-exec.

Cross-phase coupling to manage at execution

  • Phase 4 OAuth callback/exchange is shared by Phase 6a remote-MCP OAuth (build canonical in P4).
  • One settings/permission writer is touched by P2 ("Allow Session") + P6b (/permissions) + P6d (hook settingsOverride) — keep one writer.
  • P2 competes with P5 (plan-mode UI) and P6b (command router) for internal/repl/internal/tui — sequence P2 first or isolate in a worktree.

Test plan

  • Docs-only change — go build ./... unaffected (verified clean locally).
  • Each plan is executable via superpowers:subagent-driven-development or executing-plans; per-task TDD steps carry their own go test verification.

SqlRush added 17 commits June 21, 2026 09:03
- Delete placeholder PermissionAskRequest; askRequest.req is now tool.PermissionAskRequest
- Add loopAsker (asker.go) implementing tool.PermissionAsker via channel hand-off
- Add showPermission + pendingAsk field; route askCh in Run select loop
- Update handleKey to resolve dialog events and dispatch PermissionDecision
- Add onPermissionShown test seam (nil in production) for deterministic gating
- Tests: TestLoopAskerAllow (gated Enter→Allow) + TestDecisionFromAction (pure)
- go test -race ./internal/repl/ passes all 19 tests; go build ./... clean
…loop exit

Replace single pendingAsk with activeAsk + askQueue FIFO so concurrent tool
asks are serialized rather than overwriting each other. Defer denyPendingAsks
in the tty Run path to unblock all waiting askers (active, queued, in-channel)
on any exit, preventing goroutine leaks when executors use context.Background().
- Add onTurnDone hook to Loop.finishTurn for test synchronization
- Create internal/repl/run.go with newTurnLoop + RunInteractive
- Replace scaffold stub in cmd/claude/main.go with interactiveRunner
- Add deterministic e2e test in internal/repl/run_test.go (no t.Skip)
Add the parent roadmap and nine per-phase implementation plans that take
ccgo from the merged Phase 1 (interactive REPL) to 100% functional parity.

- 00-master-roadmap: locked scope, dependency graph, phase table, milestone
  gates, shared Global Constraints, plan index, and §10 code-verified
  corrections to the gap audit.
- phase2 interactive-completeness (13 tasks), phase3 agent-loop-wiring (9),
  phase4 auth-oauth (7), phase5 tools (10), phase6a mcp-cli-remote-oauth (10),
  phase6b commands (13), phase6c memory-claudemd-rewind (8),
  phase6d hooks-lifecycle (9), phase7 sandbox-team-sdk (9).

88 TDD tasks total. Each plan was authored against the real code on both
sides (ccgo + CC TS reference), not self-reported roadmap docs, and follows
the Phase 1 exemplar format (failing test -> minimal impl -> verify -> commit).
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.

1 participant