Three real bugs in luxfi/api/zap:
1. Debug fmt.Fprintf(os.Stderr, ...) prints on every wire read/write/
handler invocation. Visible in production logs as [ZAP-WIRE-READ],
[ZAP-CLIENT-READ], [ZAP-SERVER-WRITE], [ZAP-HANDLER]. Stripped.
2. Server's success path sent the handler's returned msgType directly
without OR'ing MsgResponseFlag. Echo-style handlers (return same
msgType) produced responses that looked like fresh inbound requests
to the client demultiplexer, which dropped them. Tests caught this
as 'Expected response type 137, got 9'.
3. Client treated every response as an error because the protocol used
a single MsgResponseFlag for both success and error paths. Added
MsgErrorFlag (0x40) — error responses now carry MsgResponseFlag
AND MsgErrorFlag; success responses carry only MsgResponseFlag.
All msg types must stay < 0x40 (the existing range 1-52 is fine).
agentic_capnp sub-package was never generated; build-tag dead code referencing it
broke 'go mod tidy' (could not resolve unused phantom import). No-fake policy.
deps: tls v1.0.3 (hkdf.New); go mod tidy
Add temporary stderr debug prints to ReadMessage, readLoop, handleConn,
and ServerConn.Write to capture exact msgType bytes on the wire. This
will reveal why the client sees MsgResponseFlag set on Initialize
responses that the server sends as MsgInitialize (0x01).
Add MsgResponseFlag for error responses over the wire, enable concurrent
request dispatch with per-goroutine panic recovery, and simplify State
type to use canonical vm.State. Update consensus dependency to v1.22.67.
- Add zap/ package with zero-copy binary wire protocol
- Support for VM client/server communication over ZAP
- Wire format: [4-byte length][1-byte message type][payload]
- Includes sender, transport, and VM implementations