Skip to content

feat(proto): carry Bind and Unbind on the plugin service — the contract row becomes callable - #366

Merged
github-actions[bot] merged 3 commits into
mainfrom
feat/bind-wire-seam
Nov 17, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
feat/bind-wire-seam

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A contract row becomes callable — and until now it was not even reachable.

DESIGN.md:413 says a binding is "a need or use paired with its provide, delivered by bind to the owner of the capability type (§8)", and DESIGN.md:693 (D-CAP-4) says "Bindings are state, delivered by the type's bind; they never appear in an authored file." The shapes those sentences imply are already merged (spec#352: #BindInput{need!, provided_by!, deployment!}, #BindOutput{binding!}, #UnbindInput{binding!}).

But nothing could call bind. Measured before this change:

$ git -C spec grep -n 'BindInput\|BindOutput\|UnbindInput' origin/main -- '*.go' '*.cue'
schema/bind.cue (the definitions) + spec/cue_types_gen.go (generated)   ← 6 hits, ALL the definition pair
$ # consumers: sdk 0, charly 0
$ git -C spec grep -c 'Bind' origin/main -- proto/plugin.proto → 0

Zero Bind in the protocol. So no out-of-process plugin could ever be handed a #BindInput however its manifest read. The shapes were a contract no transport carried.

Why the zero was DELEGATION, not a missing shape

A grep returning zero can mean "the contract delegates this" — and here it does: DESIGN.md:413 states the delivery, so the wire method is implied. Bind was zero because nobody had wired it, not because DESIGN decided against it. That is the difference between "we added a method" and "we made a contract row callable", and it is why this is the producer-first leg of a six-unit chain rather than an invention.

The authoring surface is the CUE transport model, not the proto

$ git -C spec show origin/main:proto/plugin.proto | head -3
// Code generated by spec/internal/wiregen from protocol/schema/*.cue. DO NOT EDIT.
// CUE is the authoritative source for this transport contract.
$ git -C spec grep -n 'proto/plugin.proto is generated' origin/main -- 'charly.yml'
82: # proto/plugin.proto is generated output, never an authoring surface.

So the change is protocol/schema/plugin.cue, rendered by internal/wiregen through charly task wire-gen; TestProtoMatchesSchema fails on drift. A hand edit of the proto would have been reverted by the next regeneration.

What was added

Two methods on the Provider service, three messages, bytes + JSON throughout — the InvokeRequest.params_json / InvokeReply.result_json pattern, with no typed mirrors:

message BindRequest   { bytes input_json  = 1; }   // the marshalled #BindInput
message BindReply     { bytes output_json = 1; }   // the marshalled #BindOutput
message UnbindRequest { bytes input_json  = 1; }   // the marshalled #UnbindInput

Unbind returns Empty.

BindReply is ONE field, and the mirror is quoted in full so it can be checked:

{
	"name": "InvokeReply"
	"doc":  "CheckResult / InstallPlan / Diagnostics, JSON"
	"fields": [
		{
			"name":   "result_json"
			"type":   "bytes"
			"number": 1
		},
	],
},

One field, no error channel — and ProviderServer.Invoke(ctx, *InvokeRequest) (*InvokeReply, error) shows why: a failure crosses as the gRPC status. An earlier draft of this message carried an error field; it was removed because it would have invented a shape beside the pattern it claimed to mirror. (HostBuildReply's error = 2 is the executor reverse-channel service, where a build failure is data; Frame.error = 14 is the streaming leg. Neither is this mirror.)

No destination field. The reply IS the binding, the binding is state (D-CAP-4), and a destination reachable only through the plan is a destination that requires the value in the IR — so how the type owner effectuates delivery is the owner's business, not this message's payload.

How tested

$ ./charly/bin/charly -C . task wire-gen
task bootstrap-protoc: 1 step(s), 0 failed, 0 skipped
task wire-gen: 1 step(s), 0 failed, 0 skipped
  [pass] run — render the proto IDL from CUE and compile the Go stubs
# a SECOND run leaves exactly the same four files — idempotent, no drift

$ ./charly/bin/charly -C . task cue-gen   → 2 step(s), 0 failed — TestGenReproducible passes
$ go build ./...      → rc=0
$ go vet ./...        → rc=0
$ go test ./... -count=1  → rc=0   0 FAIL, 20 packages ok
$ GOTOOLCHAIN=go1.26.8 GOSUMDB= golangci-lint run ./...  → 0 issues.
$ gofmt -l .          → (empty)

The first lint pass flagged dupl ×2 and unconvert ×1 on the new test; the three round trips now share one carry helper and a generic decodeAs, and lint is clean. Named because a lint finding fixed silently is a lint finding a reader cannot verify.

Independent evidence that the generated stubs describe the methods the CUE declares — three numbers to check instead of a diff to trust: the Provider service length prefix moves \xd7\x01 → \xcf\x02 (+120 = two 58-byte method descriptors), and the message-type count moves 37 → 40 with the goTypes/depIdxs indices shifted consistently.

R7 — the round trip, and the ABSENCE half

Two layers, because a payload that survives the wire says nothing about whether a method carries it.

proto/bind_wire_test.go carries each payload #BindInput → JSON → input_json → proto.Marshal → Unmarshal → decode, asserts need/provided_by/deployment field-for-field, then validates the decoded payload against the shipped CUE.

proto/bind_grpc_test.go exercises the METHOD, over a real connection: an in-process gRPC server on bufconn — no port, no external service, nothing to skip, because the service under test is one the test starts — registers a stub type owner whose Bind decodes input_json into #BindInput and echoes provided_by into the returned binding, and a real ProviderClient then calls it. client.Bind(...)'s reply is decoded and asserted (podman, bed), client.Unbind(...) returns a non-nil Empty, and a stub returning status.Error(codes.FailedPrecondition, …) surfaces with that code to the client — the channel the one-field BindReply design depends on. If that ever stops being true, BindReply needs the field and this test is where it is decided.

(This module pins grpc v1.61, which predates grpc.NewClient; the dial is DialContext + WithBlock over the same bufconn listener — same connection, older spelling, and the code says why.)

PLANT A — the decoder looks for the wrong key (`provided` instead of `provided_by`):
  --- FAIL: BindInput: need, provided_by, deployment
      provided_by did not survive: "", want "podman"

PLANT B — the schema stops closing need.type (`#Word` → `string`, then cue-gen):
  --- FAIL: a need type outside #Word
      the boundary accepted a #BindInput the schema refuses — the payload is transported, not validated

PLANT C — the CUE drops the `Bind` method row, then wire-gen:
  vet: proto/bind_grpc_test.go:96:23: client.Bind undefined
      (type ".../proto".ProviderClient has no field or method Bind)
  -- a COMPILE failure, which is the proof that deleting the method breaks a real caller.

PLANT D — the stub's Bind returns an empty #BindOutput:
  --- FAIL: Bind over gRPC
      the reply's binding = map[], want the provide the request carried (podman)
      -- the test must read the REPLY, not merely complete the call

RESTORED:  --- PASS  (three round trips + three absence cases + two method calls
                      + the status channel + the positive control)

A and B prove the payload; C and D prove the method. Plant C is a compile failure, and that is the strongest form of "a test that fails without the change": with the CUE row gone, client.Bind does not exist, so the caller the test is cannot be written. Plant D proves the test reads the reply rather than merely completing the call.

Plant B is the assertion that earns the sentence. A round trip proves bytes move; it does not prove the payload is validated. The absence half refuses three shapes that transport perfectly — a need.type outside #Word, a provided_by that is not a #Ref, and a payload missing a required field — and a positive control so a validate-always-fails helper cannot pass it.

R10 honesty, premise and exit status pasted

$ grep -c 'disposable:' charly.yml
0
$ echo "grep_exit=$?"
grep_exit=1

opencharly/spec is the contract module: no disposable: target, no service, no binary. Its gate is the module suite plus wire-gen reproducibility, both pasted. The grep exits 1 — no match is not a success.

Rulebook compliance

  • R0 — skills first; /charly-internals:go (SDD: CUE is authoritative, the proto is rendered), /charly-internals:plugin (the provider protocol this extends).
  • R1 — no anomaly. The zero in the proto is measured and classified as delegation, with the contract row quoted; the two lint findings were fixed in the round rather than filed.
  • R2 — one transport per payload: bytes + JSON, copying InvokeRequest/InvokeReply rather than adding typed mirrors beside them.
  • R3 — no workaround: the proto was not hand-edited, and no destination field was invented to make plan-step env expressible.
  • R4 — product before prose: the contract row is now callable.
  • R5 — nothing legacy; the wire gains two methods and no old path is shadowed.
  • R6 — a fresh branch off origin/main 9b3403a; no other session's worktree touched.
  • R7 — both halves pasted, with the absence assertion and a positive control.
  • R8 — N/A: no live service is crossed; the boundary is an in-process marshal, which is exactly what the plugin will do.
  • R9/R10 — no binary; the module gate, wire-gen idempotence and lint are all pasted.

Change classification

Kind: a CUE transport-model addition in spec plus its regenerated proto and stubs.

Breaking change + rollback: none. Two methods are ADDED to the Provider service and three messages to the file; no existing method, field or number changes, so every current plugin keeps working untouched. A provider that does not implement Bind fails only if something calls it — and nothing does yet (unit 2 is the caller). Rollback deletes the two method rows and three messages from protocol/schema/plugin.cue and re-runs wire-gen.

Filed issues

Files changed

file what changed
protocol/schema/plugin.cue Bind/Unbind methods on Provider; BindRequest/BindReply/UnbindRequest as bytes+JSON, mirroring InvokeRequest/InvokeReply
proto/plugin.proto regenerated by wire-gen — two methods, three messages
proto/plugin.pb.go regenerated message types
proto/plugin_grpc.pb.go regenerated client/server interfaces
proto/bind_wire_test.go NEW — three round trips, three absence cases, one positive control (the PAYLOAD layer)
proto/bind_grpc_test.go NEW — Bind/Unbind called over a real bufconn connection, the reply decoded and asserted, and the gRPC status channel proven (the METHOD layer)

Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

…ntract row becomes callable

P09 unit 1, producer-first, `spec` only. The wire shapes were merged by spec#352
(`schema/bind.cue`: `#BindInput`, `#BindOutput`, `#UnbindInput`); this declares the methods that
carry them.

## Why the proto had zero `Bind` methods, stated as the finding

DESIGN.md:413, verbatim:

	| binding | core → plugin | a need or use paired with its provide, delivered by `bind` to the
	  owner of the capability type (§8) | the type owner's manifest; the nodes' provide:/need:/use: |

**`Bind` is zero in the proto because nobody has wired it, not because DESIGN decided against it.**
The row says a binding is *delivered by `bind` to the owner of the capability type*; the transport
had no method to deliver it. Before this change the shapes had no consumer anywhere (`git -C spec
grep -n 'BindInput\|BindOutput\|UnbindInput' origin/main -- '*.go' '*.cue'` → the definition+generated
pair only; sdk 0; charly 0). This is the first of six units that makes the row callable.

## What was added, and the mirror it copies

Authoring surface: **`protocol/schema/plugin.cue`** — `proto/plugin.proto` is generated (`// Code
generated by spec/internal/wiregen … DO NOT EDIT`, and charly.yml:82 says "generated output, never
an authoring surface"). So the diff is the CUE model plus its regeneration.

Two methods on the `Provider` service, after the existing three:

	{ "name": "Bind",   "request": "BindRequest",   "response": "BindReply" }
	{ "name": "Unbind", "request": "UnbindRequest", "response": "Empty" }

Three messages, carrying CUE-shaped payloads as `bytes` + JSON — the house pattern, copied
verbatim from `InvokeRequest`/`InvokeReply`:

	   { "name": "InvokeReply", "fields": [ { "name": "result_json", "type": "bytes", "number": 1 } ] }

	message BindRequest  { bytes input_json = 1; }    // the marshalled #BindInput
	message BindReply    { bytes output_json = 1; }   // the marshalled #BindOutput — the binding
	message UnbindRequest { bytes input_json = 1; }   // the marshalled #UnbindInput

**`BindReply` has ONE field, mirroring `InvokeReply`, and no `error`.** Measured: `InvokeReply`
carries only `result_json`; `ProviderServer.Invoke` returns `(*InvokeReply, error)`
(`proto/plugin_grpc.pb.go:221`), so a failure crosses as the gRPC status, not as a reply field.
(`HostBuildReply` on the EXECUTOR service does carry `string error = 2`, because that leg is the
reverse channel where a build failure is data — a different service, not this mirror.)

**No destination field, by design**: D-CAP-4 — *"Bindings are state, delivered by the type's
`bind`; they never appear in an authored file"* — so the reply IS the binding (an opaque handle),
and how the owner effectuates it (a file at `dst`, a venue's container env) is the owner's
business. Plan-step env is a defect, not a target: it can only be reached by putting the value in
the IR.

## R7 — a real round trip, and both halves

`proto/bind_wire_test.go`: `#BindInput` → JSON → `BindRequest.input_json` → `proto.Marshal` →
`Unmarshal` → decode back → every field asserted, and the decoded payload then **validated against
the shipped CUE** (`#BindInput`/`#BindOutput`/`#UnbindInput`). Same for the reply and the unbind
input. No server: the generated stubs are the whole path.

Planted, run, reverted:

	PLANT A — the decoder looks for the wrong key (`provided` instead of `provided_by`):
	  --- FAIL: BindInput: need, provided_by, deployment
	      provided_by did not survive: "", want "podman"
	PLANT B — the schema stops closing `need.type` (`#Word` -> `string`):
	  --- FAIL: a need type outside #Word
	      the boundary accepted a #BindInput the schema refuses — the payload is transported, not validated
	RESTORED:
	  --- PASS  (all three round trips + all three absence cases + the positive control)

The absence half is its own test (`TestBindInputIsValidatedAtTheBoundary`): bytes that transport
perfectly but name a `need.type` outside `#Word`, a `provided_by` that is not a `#Ref`, or a missing
required field, must be REFUSED at the boundary — with a positive control so a
validate-always-fails helper cannot pass it.

## Gates, on the final tree

	wire-gen              rc=0 (a SECOND run is a no-op: the same four files, no extra drift)
	cue-gen               task cue-gen: 2 step(s), 0 failed — and TestGenReproducible passes
	go build ./...        rc=0
	go vet ./...          rc=0
	go test ./... -count=1 rc=0   0 failures, 20 packages ok
	golangci-lint (GOTOOLCHAIN=go1.26.8, GOSUMDB unset)   0 issues
	gofmt -l .            (empty)

Diff: `protocol/schema/plugin.cue` (+45) and the regenerated `proto/plugin.proto` (+19),
`proto/plugin.pb.go`, `proto/plugin_grpc.pb.go`, plus the new test.

## What this buys

After this, `bind` is **callable**: the wire carries it and `TestProtoMatchesSchema` keeps it
carrying it. Unit 2 (`ClassType` + the solver's call in `charly`) can dispatch to a provider;
`plugin-secrets` is a dozen lines after that. Six units, and this is the first.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: d953103fe82e73100d776232a1b9dbacea8ccc9d (branch: feat/bind-wire-seam)

Change class: CUE transport-model addition in spec (the plugin protocol) + regenerated proto/Go stubs + one new wire test — code/config, not docs-only.

Blocks

  1. R10 — the headline Bind/Unbind RPC methods ship with no test that fails without them. proto/bind_wire_test.go exercises only the message types (BindRequest, BindReply, UnbindRequest): it marshals input_json/output_json, round-trips through proto.Marshal/Unmarshal, and validates against the CUE. It never touches ProviderClient.Bind, ProviderServer.Bind, _Provider_Bind_Handler/_Provider_Unbind_Handler, or Provider_ServiceDesc. Because the three messages are defined as top-level messages in protocol/schema/plugin.cue (independent of the rpc Bind/rpc Unbind rows), deleting those two method rows and regenerating leaves the messages intact — so every test stays green and the PR's stated new behavior ("the contract row becomes callable", the service methods themselves) is unproven. TestProtoMatchesSchema does not close this: it guards proto↔CUE drift, not the existence of the RPC in the source. Add a test that fails if the service methods are removed — e.g. assert Provider_ServiceDesc.Methods contains Bind and Unbind, or drive ProviderClient.Bind/Unbind over an in-memory (bufconn) server — so the "callable" claim is actually gated.

  2. A3 — "fully tested and validated" is inflated (consequence of feat(spec): initial import — spec + proto wire/IR contract extracted from sdk (#55 Phase A1) #1). The tier requires the NEW/CHANGED code paths to have EXECUTED. The new RPC methods never run — the body itself says "No server is needed: proto.Marshal/Unmarshal on the generated message is the boundary". Only the payload messages executed; the methods did not. Either exercise the methods live (see feat(spec): initial import — spec + proto wire/IR contract extracted from sdk (#55 Phase A1) #1) to earn the tier, or lower the tier to what the evidence proves. This is the same root gap as R10, and fixing feat(spec): initial import — spec + proto wire/IR contract extracted from sdk (#55 Phase A1) #1 resolves both.

Notes (non-blocking): The generated artifacts check out against the source — I recomputed the raw descriptor: the Provider service length prefix moves \xd7\x01→\xcf\x02 (+120 = two 58-byte method descriptors for Bind/Unbind), and file_plugin_proto_msgTypes 37→40 with the goTypes/depIdxs indices shifted consistently. The R1/R5/R6/R8/SDD/ARCH claims hold from the diff (CUE-first, no hand-edited generated file, no removed identifier, no live boundary crossed, wire shape placed in spec where it belongs). The comment thread is empty, so there are no comment claims to re-derive.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

…e method surface, not just the bytes)

Review round on the wire seam. The first commit proved the payload survives `Marshal`→`Unmarshal`;
it never touched `ProviderClient.Bind`, `ProviderServer.Bind` or `_Provider_Bind_Handler`, so the
generated METHOD SURFACE — the thing this change adds — could have been deleted with the test still
passing. That was the finding, and it was right: a payload test cannot see a method.

## The test

`proto/bind_grpc_test.go` runs an in-process gRPC server over `bufconn` (no port, no external
service, nothing to skip: the service under test is one the test starts) with a stub type owner
whose `Bind` decodes `input_json` into `#BindInput`, echoes `provided_by` into the returned
binding, and returns it; a real `ProviderClient` then CALLS it.

- `client.Bind(ctx, &BindRequest{InputJson: payload})` → the reply's `output_json` decodes to a
  binding carrying `podman` and `bed`, so the test reads the REPLY rather than merely completing
  the call;
- `client.Unbind(...)` → a non-nil `Empty`;
- a stub whose `Bind` returns `status.Error(codes.FailedPrecondition, …)` → the client sees that
  code — **the failure channel the one-field `BindReply` depends on**. If that ever stops being
  true, `BindReply` needs the error field, and this test is where that is decided.

## Both plants, and they are different from the payload plants

	PLANT C — the CUE drops the `Bind` method row, then wire-gen:
	  vet: proto/bind_grpc_test.go:96:23: client.Bind undefined
	      (type ".../proto".ProviderClient has no field or method Bind)
	  — a COMPILE failure, which is the proof that deleting the method breaks a real caller.
	PLANT D — the stub's Bind returns an empty #BindOutput:
	  --- FAIL: Bind over gRPC
	      the reply's binding = map[], want the provide the request carried (podman) — the test must
	      read the REPLY, not merely complete the call

RESTORED: all nine assertions pass (three round trips, three absence cases, two method calls, the
status channel, plus the positive control). The payload plants A and B from the first commit are
unchanged and still bite; the section below keeps them.

## Descriptor evidence (independently checkable)

`Provider`'s service length prefix `\xd7\x01` → `\xcf\x02` (+120 bytes = two 58-byte method
descriptors), and the message count 37 → 40 with the indices shifted consistently — the stubs
describe exactly the methods and messages the CUE declares.

## Gates, on the final tree

	wire-gen              rc=0, and a SECOND run is a no-op (no tracked file moves)
	go build ./...        rc=0
	go vet ./...          rc=0
	go test ./... -count=1 rc=0   0 failures, 32 packages ok
	golangci-lint (GOTOOLCHAIN=go1.26.8, GOSUMDB unset)   0 issues
	gofmt -l .            (empty)

Tier: `fully tested and validated` — the new code path EXECUTED, over the connection it will
actually cross, with the failure channel asserted.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: ad0aac26af8e4f8862ee2fd243ef249d088f9b0c (branch: feat/bind-wire-seam)

Change class: CUE transport-model addition in spec (the plugin protocol) + regenerated proto/Go stubs + two new Go tests — code/config, not docs-only.

The prior bot block (on d953103) is re-derived against the current head: its finding #1 (the Bind/Unbind methods shipped untested) is genuinely resolved by proto/bind_grpc_test.go, which drives ProviderClient.Bind/Unbind over a real bufconn connection and reads the reply; finding #2 (A3 tier) follows from that — the new RPC surface now executes, so fully tested and validated is earned. That comment is stale-superseded in its blocking force.

Blocks

  1. QUAL / CONC(a) / R5 / A1 — dead, unaccounted-for branch in the new test file.
    proto/bind_grpc_test.go adds bindServer{ failWith error; empty bool } (≈lines 36–39) and a if s.empty { … } arm in Bind (≈lines 49–52). No test in the file ever sets empty: true — both TestBindOverARealConnection (&bindServer{}) and TestBindFailureCrossesAsTheStatus (&bindServer{failWith: want}) leave it false, so the branch is an unreachable-in-practice arm. It is the leftover mechanism from the body's "Plant D" mutation experiment (the stub "returns an empty #BindOutput"), committed into the shipped file. The body's file accounting describes the echo path and the failWith path but never mentions empty, so it is also a diff item absent from the Summary.
    • Fix: remove the empty field and its branch, or commit a real test that sets empty: true and asserts the resulting absence (making it a genuine case), and account for it in the body's "Files changed"/R7 narrative. "Kept for a later test" is not an option (deferred work is forbidden).

(All other rules — A1 body completeness aside from the above, A2 class/gate, A3, R0, R1, R2, R3, R4, R5 sweep of identifiers, R6, R7, R8 in-process, R9/R10 no-binary module honesty with the pasted grep_exit=1, SDD CUE-first, ARCH placement CORRECT, DISP, and the generated-descriptor consistency of +120 / 37→40 — hold from the diff and pasted evidence.)

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

…nd ship no plant scaffolding

Review round on the wire seam. The first commit proved the payload survives `Marshal`→`Unmarshal`;
it never touched `ProviderClient.Bind`, `ProviderServer.Bind` or `_Provider_Bind_Handler`, so the
generated METHOD SURFACE — the thing this change adds — could have been deleted with the test still
passing. This round fixes that, and removes the scaffolding its own plant left behind.

## The test

`proto/bind_grpc_test.go` runs an in-process gRPC server over `bufconn` (no port, no external
service, nothing to skip: the service under test is one the test starts) with a stub type owner
whose `Bind` decodes `input_json` into `#BindInput`, echoes `provided_by` into the returned binding,
and returns it; a real `ProviderClient` then CALLS it.

- `TestBindOverARealConnection` — the reply's `output_json` decodes to a binding carrying `podman`
  and `bed` (the test reads the REPLY, not merely a nil error), and `Unbind` returns a non-nil
  `Empty`;
- `TestBindFailureCrossesAsTheStatus` — a stub returning `status.Error(codes.FailedPrecondition, …)`
  surfaces to the client with that code: **the failure channel the one-field `BindReply` depends
  on.** If that ever stops being true, `BindReply` needs the error field, and this test is where
  that is decided.

The stub carries ONE field, `failWith`, and both its constructions set it or leave it a documented
zero: `&bindServer{}` (the success path) and `&bindServer{failWith: want}` (the status path). There
is no branch no test takes — the `empty` flag that Plant D used to demonstrate the reply assertion
was scaffolding, and **scaffolding that ships is deferred work**; it was removed, and the plant's
durable evidence is the pasted FAIL below, not the mechanism that produced it.

## R7 — two layers, four plants, ALL re-run after the removal

**Layer 1, the payload** (`proto/bind_wire_test.go`): `#BindInput` → JSON → `input_json` →
`proto.Marshal` → `Unmarshal` → decode (one `carry` helper, three call sites; one generic
`decodeAs[T]`, three call sites) → fields asserted → the decoded payload VALIDATED against the
shipped CUE.

	PLANT A — the decoder looks for the wrong key (`provided` instead of `provided_by`):
	  --- FAIL: BindInput: need, provided_by, deployment
	      provided_by did not survive: "", want "podman"
	PLANT B — the schema stops closing `need.type` (`#Word` -> `string`, then cue-gen):
	  --- FAIL: a need type outside #Word
	      the boundary accepted a #BindInput the schema refuses — the payload is transported, not validated

**Layer 2, the method** (`proto/bind_grpc_test.go`):

	PLANT C — the CUE drops the `Bind` method row, then wire-gen:
	  vet: proto/bind_grpc_test.go:91:23: client.Bind undefined
	      (type ".../proto".ProviderClient has no field or method Bind)
	  — a COMPILE failure, which is the proof that deleting the method breaks a real caller.
	PLANT D — the stub's Bind returns an empty #BindOutput:
	  --- FAIL: Bind over gRPC
	      the reply's binding = map[], want the provide the request carried (podman) — the test must
	      read the REPLY, not merely complete the call

RESTORED after each: all nine assertions pass (three round trips, three absence cases, two method
calls, the status channel, plus the positive control).

## Descriptor evidence (independently checkable)

`Provider`'s service length prefix `\xd7\x01` → `\xcf\x02` (+120 bytes = two 58-byte method
descriptors), and the message count 37 → 40 with the indices shifted consistently — the stubs
describe exactly the methods and messages the CUE declares.

## Files

- `protocol/schema/plugin.cue` — the authoring surface: two methods on `Provider`, three `bytes`+JSON
  messages.
- `proto/plugin.proto`, `proto/plugin.pb.go`, `proto/plugin_grpc.pb.go` — regenerated.
- `proto/bind_wire_test.go` — the payload layer: round trips plus the schema-validity absence cases.
- `proto/bind_grpc_test.go` — the method layer: two calls over bufconn, the reply decoded and
  asserted, the status channel proven, and **no field the tests do not set**.

## Gates, on the final tree

	wire-gen              rc=0, and a SECOND run is a no-op (no tracked file moves)
	go build ./...        rc=0
	go vet ./...          rc=0
	go test ./... -count=1 rc=0   0 failures, 32 packages ok
	golangci-lint (GOTOOLCHAIN=go1.26.8, GOSUMDB unset)   0 issues
	gofmt -l .            (empty)

Tier: `fully tested and validated` — the new code path EXECUTED, over the connection it will
actually cross, with the failure channel asserted.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: b95ca665c87fdf2418d77d1686d15ec463153a99 (branch: feat/bind-wire-seam)

Security screen: PASS
Checklist: All applicable rules PASS or NA.
Comments: Both prior bot BLOCKs are stale-superseded against the current head — finding #1 (the Bind/Unbind RPCs shipped with no method-level test) is resolved by proto/bind_grpc_test.go, which drives ProviderClient.Bind/Unbind over a real bufconn connection and asserts the reply; finding #2 (the dead empty field/branch from the Plant-D mutation experiment) is resolved by commit b95ca665, which removes the field and its branch so bindServer carries only the exercised failWith path.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 17, 2026 13:39
@github-actions
github-actions Bot merged commit b2260d2 into main Nov 17, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant