Replace the streaming-json CLI + generated PreToolUse-hook Grok adapter with grok's native ACP mode (JSON-RPC 2.0 over stdio). Adds GrokACPBackend/GrokACPDecoder/GrokACPDecisionMapping (a near-twin of the Codex app-server adapter); generalizes CodexJSONRPC into a shared JSONRPCConnection (jsonrpc-header flag, default off so Codex is byte-identical, plus endNotifications); deletes GrokBuildBackend, GrokStreamDecoder, GrokHookConfig and strips the /grok-hook HTTP bridge from MCPApprovalServer. Claude and Codex are left native. Preserves conflict-lock parity, native resume (session/load), and the hermetic fake-grok contract test. Full suite: 525 tests green.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
M0 (the stream-json spike) was completed earlier but its code was left
uncommitted in a sibling worktree and never landed on any branch. This
commits it verbatim as the M1 baseline:
- NucleicCore: AgentEvent/JSONValue model, AgentBackend protocol,
ApprovalCoordinator, ProcessHost, Transcript writer/reader,
ClaudeStreamDecoder, in-process MCP approval server, ClaudeCodeBackend
- nucleic-spike CLI + fake-claude wire stub
- 41 hermetic tests (golden + contract + drift) and live captures under
fixtures/claude/2.1.167/
- PLAN.md / ADAPTERS.md updated with M0 findings; docs/M0_RESULTS.md
Built and tested with `swift build/test --build-system native` (iCloud
codesign workaround).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>