Skip to content

feat(spec-002): ACP execution spine, real portable-pty runner, topological wave DAG & FTS5 memory - #25

Open
trac41799 wants to merge 20 commits into
mainfrom
docs/spec-002-acp-spine
Open

trac41799 wants to merge 20 commits into
mainfrom
docs/spec-002-acp-spine

Conversation

@trac41799

Copy link
Copy Markdown
Owner

Summary

Implements Spec 002 (002-acp-execution-spine) across Milestones 1–4 using SDD-BDD-TDD and independent adversarial review:

  • Closes [Bug/Blocker] /runner Agent Spawn & Terminal I/O Broken (IPC Mismatch, Dead Output Channel, Non-PTY Stdio, Hardcoded Paths) #19 (M1 — Interactive PTY Runner Spine & IPC Repair):
    • Fixes spawn_agent IPC payload in src/stores/agentStore.ts (IPC.spawnAgent with { agentId, projectPath, command, args, envVars }) and passes active currentProject.path in AgentPanel.tsx / Runner.tsx.
    • Upgrades src-tauri/src/pty.rs to allocate real portable-pty (0.8) 120×36 xterm-256color pseudo-terminals (Windows ConPTY / Unix openpty) with .cmd/.bat shim support, resize_pty_cmd, drain_output, child reaping on kill_process, and output_callback/status_callback wired to agent_events.rs in lib.rs.
    • Wires PtyTerminal.tsx to subscribe to agent-output, forward terminal.onData to writeToAgent, and sync dimensions via ResizeObserver → IPC.resizePty.
    • Exposes all 9 AGENT_CONFIGS in Runner.tsx and wires Load Profile, + New preset, Analyze, and Docs.
  • Closes [Feature/Architecture] Universal ACP (Agent Client Protocol) Adapter & Multi-Provider Harness Integration #20 (M2 — Universal ACP Adapter & Multi-Provider Harness Integration):
    • Implements AcpAgentAdapter (src-tauri/src/agent_adapters/acp.rs) over newline-delimited JSON-RPC 2.0 stdio (initialize → session/new → session/prompt, session/cancel on kill(), session/update text & cumulative session_cost(), -32601 for unknown methods).
    • Enforces strict canonical worktree path-containment (resolve_in_worktree + canonicalize_with_missing_tail) on fs/read_text_file, fs/write_text_file, and session/request_permission.
    • Registers pi (pi-acp), opencode-acp (opencode acp), gemini (gemini --acp), claude (@agentclientprotocol/claude-agent-acp), and codex (@agentclientprotocol/codex-acp) in AdapterRegistry::new_with_db with Vault environment injection, exposed in BuildApp.tsx and Orchestrate.tsx.
    • Auto-synthesizes a schema-valid 6-section HANDOFF_<ref>.md on clean ACP turn completion when missing.
  • Closes [Bug/Architecture] Wave Orchestrator (/orchestrate & wave_executor.rs) Ignores Wave DAG Dependencies & Has No UI Execute Action #21 & Closes [Feature/Pipeline] Freeform Spec/Prompt-to-Wave Planner & Real Database Provisioning in Build Pipeline #22 (M3 — Topological Wave DAG Execution, Worktree Junctions & Freeform Spec Parser):
    • Adds Kahn's algorithm DAG validation (validate_wave_plan) and get_wave_plans (get_wave_plans_cmd) in src-tauri/src/orchestrator.rs.
    • Updates wave_executor.rs (execute_topological_waves_with_adapters) to supervise, finalize, and merge tier k worktrees into base_branch before spawning tier k+1.
    • Adds link_shared_dependencies in src-tauri/src/worktree.rs creating a node_modules junction (Windows) / symlink (Unix).
    • Adds parse_spec_or_prompt in src-tauri/src/spec_parser.rs supporting both ## Phase N plans and freeform markdown PRDs/prompts.
    • Wires plan loading on mount, ACP harness selector, Execute Wave Plan, and Verify & Finalize in src/pages/Orchestrate.tsx.
  • Closes [UX/Architecture] Prune Speculative Facade & Consolidate 17 Routes into 4 Functional Core Surfaces #23 & Closes [Security/Bug] SQL Injection, Crash-on-Quote, and Unwired Context Injection in Memory Layer (memory.rs) #24 (M4 — Memory SQL Safety, FTS5 BM25, Context Injection & 4-Surface UI Consolidation):
    • Parameterizes all SQL queries in src-tauri/src/memory.rs (rusqlite::params! / params_from_iter), eliminating SQL injection and single-quote crashes.
    • Adds migration 023_memory_fts5.sql (memory_facts_fts + sync triggers) and updates memory::hybrid_search to rank via FTS5 bm25().
    • Wires guideline_spawn::append_project_context_to_guideline into wave_executor.rs to inject project memory facts and stack anti-pattern warnings into .acc/GUIDELINE.md.
    • Consolidates Sidebar.tsx into 4 core workflow groups (Workspace, Knowledge & Assets, Review & Outcomes, Settings) and gates experimental Bagua/Leiden controls behind settingsStore.experimentalFeatures (default false).

Gate Results

  • Rust (MSVC): cargo +stable-x86_64-pc-windows-msvc test → 258 passed; 0 failed; 3 ignored (lib) + 42 passed; 0 failed (integration_tests)
  • Frontend + IPC Contract: npm test -- --run → 36/36 files passed, 347/347 tests passed (ipc-contract.test.ts 5/5)
  • TypeScript: npx tsc --noEmit → 0 errors
  • ESLint: npm run lint → 0 errors, 13 warnings
  • Daemon: python -m pytest local-daemon/tests/test_router.py → 28 passed in 0.12s

Adversarial Review Verdict (origin/main...HEAD)

Verdict: clean-with-nits (46 files changed, +5413 / -397). Transparently documented non-blocking nits:

  1. acp.rs:282 passes "mcpServers": [] in session/new rather than loading active project MCP configs.
  2. acp.rs:803-816 validate_permission_params checks standard path/command keys (path, paths, file_path, target_path, cwd, dir, uri, command, cmd).
  3. Orchestrate.tsx exposes Execute Wave Plan + Verify & Finalize without a dedicated mid-wave Cancel button yet.
  4. assets.rs load_vault_env_vars reads the existing secrets_vault.encrypted_value column layout.

@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
source-forge Ready Ready Preview Nov 21, 2026 11:54am UTC

This branch was successfully deployed

1 active deployment
Preview — 5e36cf05 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment