Repository navigation
fix(sdk): carry a check verb's CapturedValue on the out-of-process wire (R3) - #355
Conversation
…re (R3) opencharly/charly#780, producer half. ServeCheckVerb's Invoke returned the captureless builder, so a host-coupled probe's CapturedValue -- the parsed body of an HTTP probe, the matched fields of a log scan, the row a SQL check read -- was dropped on its way to the host, while the in-process path already carried it (charly's checkResultFromVerb, 0c62bc1c). The gap bit the OUT-OF-PROCESS probe family (cdp/kube/appium/adb/wl/...), exactly the family spec/ops's own prose names as the field's purpose. The reply is now built in ONE place, checkVerbReply: it encodes the verdict's JSON-encoded capture as the wire's raw `captured_value` (the operator-ruled shape for #780 -- JSON-encoded in both directions) and reports a NON-JSON stash as a FAIL naming the cause instead of emitting a corrupt wire or dropping it silently. A verdict that captured nothing stays byte-identical to the pre-extension wire (the field's omitempty), asserted directly. checkverb_test.go drives the reply through the protobuf carrier go-plugin's gRPC channel performs and decodes it with the contract module's OWN decoder (ops.ParseResultJSONFull), so the assertion is about the bytes that cross, never about a shape re-declared here (R3). The captureless builder's drop is pinned as a test of its own, so a future revert of checkVerbReply fails visibly. Refs opencharly/charly#780 Refs opencharly/spec#194 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Change class: code — sdk library change + new Go tests (not docs-only). Comment thread: empty (0 comments) — nothing to disposition. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Answering the org validator's two B18 findings on #825. Both premises are contradicted by the committed tree, and the diff now shows it: - `plugin_grpc_test.go` DID import `github.com/opencharly/spec/spec` — two import groups below the hunk's context (the file's own last group). No behaviour changes here: the import moves into the group the diff displays, so the evidence the finding asked for is visible in the hunk itself. - `plugin_appium_external_test.go` needed no change at all: it imports `spec` (line 13) and still uses `encoding/json` four times (lines 88, 122, 127). Closes #780 Refs opencharly/sdk#355 Refs opencharly/spec#194 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…ture included (#825) * fix(charly): decode a verb provider's reply through the contract, capture included #780, consumer half. The host kept its OWN declaration of the out-of-process verb reply — `pluginCheckResult{status,message}` — and decoded the provider's JSON with it, so the producer's CapturedValue never reached the CheckResult the check run carries and the ledger records. The producer half is merged in the SDK (opencharly/sdk#355, tag v0.2026280.2133): ServeCheckVerb now encodes the verdict's JSON-encoded capture as the wire's raw captured_value. charly now decodes through the contract module's OWN decoder, ops.ParseResultJSONFull, and threads the decoded value into CheckResult.CapturedValue — the out-of-process twin of checkResultFromVerb, which already maps the in-process verdict. `pluginCheckResult` is deleted, so no surface can re-declare the wire; a malformed reply is a FAIL naming the verb and an unrecognised status is a FAIL, exactly as the hand-rolled switch had it. The same cutover sweeps every reference to the deleted shape: four test files now assert through the production seam (plugin_grpc / plugin_external / plugin_appium_external / the checkcontext e2e dispatch), and checkspec_test.go loses an orphaned docstring describing the long-deleted capture_extract:/capture: matchers and the ScenarioContext.Captures stash they fed (spec#194's claim, same claim-keyed family). The sdk pin moves v0.2026280.1251 -> v0.2026280.2133 (the tag minted for that merge) — the producer's consumer-pin step, in this same landing. It is an INDIRECT require: charly's compiled-in plugin candies import the SDK, so this is the SDK the assembled binary's plugins build against. Closes #780 Refs opencharly/sdk#355 Refs opencharly/spec#194 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * style(charly): group the spec import beside ops in plugin_grpc_test Answering the org validator's two B18 findings on #825. Both premises are contradicted by the committed tree, and the diff now shows it: - `plugin_grpc_test.go` DID import `github.com/opencharly/spec/spec` — two import groups below the hunk's context (the file's own last group). No behaviour changes here: the import moves into the group the diff displays, so the evidence the finding asked for is visible in the hunk itself. - `plugin_appium_external_test.go` needed no change at all: it imports `spec` (line 13) and still uses `encoding/json` four times (lines 88, 122, 127). Closes #780 Refs opencharly/sdk#355 Refs opencharly/spec#194 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Summary
ServeCheckVerbis the OUT-OF-PROCESS placement of a host-coupled kit check verb. ItsInvokeended with:so a probe's
CapturedValue— the parsed body of an HTTP probe, the matched fields of a log scan, the row a SQL check read — was dropped on its way to the host, while the in-process path already carried it (charly/checkverb_result.go'scheckResultFromVerb,0c62bc1c). The gap bit exactly the familyspec/ops/ops.go:224's own prose names as the field's purpose: the out-of-process probes (cdp/kube/appium/adb/wl/…). opencharly/charly#780.The reply is now built in one place,
checkVerbReply: it encodes the verdict's JSON-encoded capture as the wire's rawcaptured_value(the operator-ruled shape for #780 — JSON-encoded in both directions) and reports a non-JSON stash as a FAIL naming the cause, rather than emitting a corruptcaptured_valueor dropping it silently (R1). A verdict that captured nothing stays byte-identical to the pre-extension wire (the field'somitempty), asserted directly.Files (2):
checkverb.go(the reply is built bycheckVerbReply+capturedWireValue),checkverb_test.go(new).Refs opencharly/charly#780 — Refs opencharly/spec#194 (the contract's own doc for the field, whose spec leg is #203).
Why the guard sits where every consumer's bytes cross
checkverb_test.gonever re-declares the wire shape: it carries the reply across the protobuf hop go-plugin's gRPC channel performs and decodes it with the contract module's own decoder,ops.ParseResultJSONFull— so the assertion is about the bytes that cross (R3: one declaration per wire surface; the decoder lives inspec/ops). Five tests: the capture survives and is a JSON document; the empty capture is byte-identical toResultJSON; a non-JSON stash is a loud FAIL; the status mapping survives with a capture; and the captureless builder's drop is pinned as its own test, so a future revert ofcheckVerbReplyfails visibly instead of quietly restoring the defect.How tested
Module gate (
sdk/AGENTS.md= exactly CI's steps), all on this head:The new tests on the PRE-FIX tree. In a detached
origin/mainworktree (f95b899), the committed guard is copied in and run:That is the honest form of the pre-fix result for this particular seam: the guard's subject (
checkVerbReply) is the change, so on pre-fix the guard cannot build. The behavioural pre-fix failure — the one that matters — is demonstrated live below, on the same tree pair, through charly's own transport.Live, OUT-OF-PROCESS, A/B on the real producer path (the cluster's R10 leg). A throwaway bed module (a real kit check verb whose
RunVerbreturns a PASS verdict carrying{"bytes":67,"path":"/tmp/screencap.png"},replace github.com/opencharly/sdk =>the sdk worktree under test) is host-built and spawned as a separate process and driven through charly's realLocalTransport(go-plugin gRPC + liveGRPCBroker) →grpcProvider.InvokeWithExecutor. Bed files are discarded; only this answer lands.Arm 2 is a real failure of the real code path on pre-fix
origin/main; arm 1 is the same path on the change. The only difference between the arms is which sdk the plugin binary links.RDD, before the fix was written (throwaway, in-package, at the real producer/consumer seam — verdict → the exact
ResultJSONcall the producer then made →proto.Marshal/Unmarshal(pb.InvokeReply)→ops.ParseResultJSONFull), with a positive control throughops.ResultJSONCapturedproving the instrument sensitive:What this PR does not claim: the live out-of-process arm was run against a BED plugin, because no shipping candy produces a capture yet — the corpus's first real producer is a separate feature, not this wire. The consumer half (charly decoding through
ops.ParseResultJSONFull, deleting its hand-rolledpluginCheckResult) is the next leg of this same cutover, producer-first.Rulebook compliance
/charly-internals:go(SDD: generated vs hand-written, the module gates),/charly-internals:plugin(the provider model, dual placement,ServeCheckVerb's out-of-process shape) and/charly-internals:git-workflow+ its pre-validator self-audit for this step.origin/mainwith an executable instrument before the edit (the spike above), and the new failure mode this change introduces — a non-JSON stash — fails LOUD rather than silently; no warning survives.0c62bc1c) and is re-verified by the reply tests; the consumer sibling is named and scheduled (the charly leg of this cutover), never "pre-existing"/"unrelated".checkVerbReply); the test decodes with the contract module's own decoder instead of re-declaring the shape;kit.Result/spec.CheckVerbResultremain the single declaration of the verdict.--format json/ ledger value) starts carrying the value once the consumer leg lands.capture:/capture_extract:/ScenarioContext.Captures) is owned by the charly leg, where the one surviving orphaned docstring lives (charly/checkspec_test.go).feat/c9-capturedvalue-produceroff freshorigin/main(f95b899), no force-push, no rebase; tree clean after the commit; no submodule's tracked checkout edited. The bed plugin module lives under the umbrella's gitignored.worktrees/wire-types/and is not part of any repo.buildPluginBinaryfrom the bed module pinned byreplaceto this sdk worktree.Change classification
github.com/opencharly/sdk) plus new Go tests. Not docs-only.gofmt/go build/go vet/go test ./.../golangci-lint/ the cross-compile matrix) on the final tree, plus the live out-of-process A/B above with the pre-fix arm red.fully tested and validated.Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)