feat(neo): RPC bridge protocol + stdio transport (neo-go-tui task 3)#120
Merged
Conversation
Go mirror of the senpi JSONL RPC protocol in internal/bridge: structs for all RpcCommand variants, the RpcResponse union, session state, slash commands, the 9 extension-UI request methods, and every AgentSessionEvent variant plus extension_error. A four-way stdout demux classifies response / extension_ui_request / extension_error / event. StdioTransport spawns node <cli> --mode rpc with rpc-client.ts parity (100ms init wait, req_N id correlation, 30s request timeout, stderr capture, typed exit errors). Fixtures are generated by testdata/gen-fixtures.mjs against the mock-loop (never hand-edited); an exhaustiveness test extracts the TS unions from rpc-types.ts and agent-session.ts at test time via testdata/extract-ts-union.mjs (31 commands / 9 ext-UI methods / 22 events today) and fails on any missing Go mirror, so the counts are gated, not hand-maintained. Plan: .omo/plans/neo-go-tui.md
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
Plan task 3 of
.omo/plans/neo-go-tui.md: the Go mirror of senpi's JSONL RPC protocol — the wire layer every neo TUI feature drives the TS agent through. Additive only,packages/neointernal.Changes
internal/bridge/types.go: structs for all RpcCommand variants, RpcResponse union, session state, slash commands, 9 extension-UI methods, every AgentSessionEvent variant +extension_error.codec.go/demux.go: JSONL codec; four-way stdout demux (response / extension_ui_request / extension_error / event).transport.go/client.go: Transport interface + StdioTransport spawningnode <cli> --mode rpcwith rpc-client.ts parity (100ms init wait,req_Ncorrelation, 30s timeout, stderr capture, typed exit errors).testdata/: fixtures generated bygen-fixtures.mjsagainst the mock-loop (regeneration reproducible, never hand-edited);extract-ts-union.mjsextracts the TS unions at test time.QA / Evidence
Evidence:
.omo/evidence/task-3-neo-go-tui.txt(+ task-3-artifacts/) in the work worktree.rpc-types.ts+agent-session.ts— 31 commands / 9 ext-UI methods / 22 events today; the test, not a hand count, is the gate.senpi --mode rpc+ mock-loop — get_state, prompt→agent_end, get_commands; kill-child-mid-request yields a typed exit error carrying stderr (nil ExitError now fails the test explicitly); malformed JSONL line ignored. Real~/.senpihash unchanged (receipt).npm run checkexit 0. An adversarial audit round fixed evidence-wording/artifact gaps; re-audit verdict: real.Risks
Secret safety
No secrets; sandboxed QA; auth hash receipts before/after.
Summary by cubic
Implements the Go RPC bridge for the neo TUI: a JSONL codec/demux,
StdioTransportthat spawns the TS CLI, and aClientthat mirrorsrpc-client.tssemantics. This unlocks driving the TS agent from Go and gates drift with TS via exhaustive tests.Transportinterface andStdioTransportthat runsnode <cli> --mode rpc, captures stderr, and surfaces typed exit errors; graceful SIGTERM with SIGKILL fallback.Clientwithreq_Ncorrelation, per-request timeout (30s default, overridable), malformed-line tolerance, and event/message listeners.extension_error.~/.senpichanges).Written for commit 7b3a7f1. Summary will update on new commits.