protocol: single Go home for the silkd wire layer#45
Merged
Conversation
The frame vocabulary moves out of sdk/go/silkd into a new protocol/wire module consumed by both the SDK and sandboxd, killing the fourth hand-rolled implementation in engine (map literals + string switches in installca/ silkd.go/port_forward) — engine now speaks typed wire requests/responses and inherits the fixture-corpus conformance the other implementations already had. sdk/go/silkd keeps the conn/stream layer.
The zero pseudo-version only worked through the local replace, which downstream consumers ignore — pin a real pseudo-version (cut a protocol/wire tag alongside every sdk/go release, per the go.mod note). docs/sdk.md and the README still pointed users at silkd.* for the moved frame vocabulary.
sdk/go's bumped protocol/wire requirement made mcp's zero-pseudo indirect inconsistent under MVS, failing go list (and CI lint) in that module.
frame_test read ../fixtures/v1 — outside the module root, so a downloaded module zip lost the corpus and wire's tests failed in a clean environment. The canonical corpus moves to protocol/wire/fixtures/v1; the Rust, Python, and engine tests keep sharing it at the new path. docs/sdk.md also still told users to import sdk/go/silkd for wire.* — point it at protocol/wire.
AppendBulkRequest renders the data-carrying request frame into a caller buffer — the zero-alloc twin of EncodeRequest — and both bulk senders (Conn.sendBulk, the port relay's Write) now call it instead of splicing their own copies of the byte layout; RequestHead goes private again. The info probe literal and engine's duplicate frame cap follow: EncodeRequest and wire.MaxFrame. An equivalence test pins the builder to EncodeRequest.
respFail had landed between parseRecord and its doc comment (misattaching the godoc); DialGuestPort mixed three error-name styles; installca's appendOut closure captured nothing; seven files carried a split internal import group from the move's mechanical import injection.
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.
Closes #44.
The silkd frame vocabulary (types, encode/decode, fastBulk, enums) moves from
sdk/go/silkdinto a new stdlib-onlyprotocol/wiremodule, sitting next to the fixture corpus it is pinned to. Both Go consumers now import it:silkd; all frame types arewire.*.installca.go's rawmap[string]anyframes,silkd.go's untypedsilkdFrame+ string switches, and theport_forward/info probes now go throughwire.EncodeRequest/wire.DecodeResponse— engine inherits corpus conformance instead of drifting silently.No wire-format change: encode output is byte-identical (the corpus round-trip tests moved with the code and pass unchanged).
RequestHeadis newly exported for the bulk senders' spliced frames.Verified:
make go-test(16 packages, all 5 modules incl. the newprotocol/wire) andmake go-lint(dual-platform) both clean.