Repository navigation
fix(charly): decode a verb provider's reply through the contract, capture included - #825
Conversation
…ture 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)
Review — BLOCKHead SHA: Change class: code — charly core Go (verb-reply decode + tests) plus a dependency pin bump. Blocks
Verdict: BLOCK 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)
|
STATUS — both B18 findings on the previous head are answered. One was a diff-context misreading, now impossible to repeat; the other needed no change at all. Fix landed in ONE follow-up commit ( Finding 1 — The follow-up commit moves Finding 2 — ( Gates re-run in full on this head The live out-of-process arm is unchanged from the body (it exercises Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3 |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch, no secrets/egress, no guardrail weakening; the sdk pin bump is a plain dependency bump, T4 not triggered.
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…-consumer # Conflicts: # charly/go.sum
|
STATUS — the branch has caught up with Why: the validator's PASS at head What changed: Gates re-run in full on that head, because the tree changed: The decode itself is untouched by the merge; the live out-of-process arm in the body (a real plugin process built against the released Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3 |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (the decode + its tests + a plain Comments:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
The consumer half of #780. charly kept its OWN declaration of the out-of-process verb reply —
pluginCheckResult{status,message}(charly/provider_checkenv.go) — and decoded the provider's JSON with it, so the producer'sCapturedValuenever reached theCheckResultthe check run carries and the ledger records. The producer half is merged and tagged: opencharly/sdk#355 (merged89a6fac17d98fb7b9c699d47ab84a8db7969c7a, tagv0.2026280.2133) now encodes the verdict's JSON-encoded capture as the wire's rawcaptured_value.charly now decodes through the contract module's own decoder,
ops.ParseResultJSONFull, and threads the decoded value intoCheckResult.CapturedValue— the out-of-process twin ofcheckResultFromVerb, which already maps the in-process verdict.pluginCheckResultis 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 producer's own contract comment for the field is spec#194 (PR opencharly/spec#203).Files (10):
charly/provider_checkenv.go(the type deleted;checkResultFromVerbReply+ the doc reference added; imports),charly/check_verb_reply_test.go(new), and the R5 sweep —plugin_grpc_test.go,plugin_external_test.go,plugin_appium_external_test.go,plugin_checkcontext_e2e_test.go(itsdispatchnow returns the productionspec.CheckResultthrough the production seam, so the e2e asserts what a check run would carry),external_verb_dispatch_test.go(comment),checkspec_test.go,go.mod+go.sum.Two sweeps ride along, both in the same cutover's theme:
pluginCheckResultnow go through the production conversion; nothing in the tree names the deleted type (grep below).charly/checkspec_test.gocarried an ORPHANED docstring for a deleted test, describing the long-removedcapture_extract:/capture:matchers and theScenarioContext.Capturesstash they fed — the same false claim as spec#194's, one level out. It dies here.The sdk pin moves
v0.2026280.1251 → v0.2026280.2133— the producer's consumer-pin step in this same landing. It is an INDIRECT require (no charly package imports the SDK directly; the compiled-in plugin candies do), so this is the SDK the assembled binary's plugins build against.Closes #780 — Refs opencharly/sdk#355 — Refs opencharly/spec#194
How tested
This head carries, on top of the decode change: one evidence-only follow-up commit (
30243419) answering the validator's B18 finding on the previous head —plugin_grpc_test.goalready importedgithub.com/opencharly/spec/spectwo import groups below the hunk's context, so the import moved into the group the diff displays, andplugin_appium_external_test.goneeded no change (it importsspecat line 13 and still usesencoding/jsonfour times) — and two catch-up merges oforigin/main(a merge, never a rebase or force-push —ac182d40and then713f57f5, the latter bringing in main'sCHANGELOG/2026.280.2154.md), because this branch's own predecessor #824 had meanwhile bumpedplugin-ociin the same two files. The merge keeps both pins (plugin-oci v0.2026280.2122,sdk v0.2026280.2133) andgo.sumwas regenerated withgo mod tidyafter the textual conflict, so it carries no hand-resolution. The gates below are re-run in full on this head.charly's authoritative gate (
.github/workflows/ci.yml, discovered):go test ./charly/...with a shortTMPDIR(the go-pluginsun_pathbound),gofmt -l charly tools, and golangci-lint incharly/. All on this head:The new tests, focused:
R5 — the deleted identifier is gone from the committed tree, docs included:
Live, OUT-OF-PROCESS, on the RELEASED SDK (the cluster's R10 leg for the consumer half). A throwaway bed module — a real kit check verb whose
RunVerbreturns a PASS verdict carrying{"bytes":67,"path":"/tmp/screencap.png"}— is pinned to the releasedgithub.com/opencharly/sdk v0.2026280.2133(noreplace), host-built by charly's ownbuildPluginBinary, spawned as a separate process, and driven through charly's realLocalTransport(go-plugin gRPC + liveGRPCBroker); the assertion goes through the production seamcheckResultFromVerbReply, i.e. the value a check run would carry. Bed files are discarded; only this answer lands.The pre-change behaviour, same bed, same host. With the bed plugin built against PRE-FIX sdk
origin/main(f95b899) and the host asserting the raw wire, the capture is simply absent — the run fails, exit 1 (pasted in full in opencharly/sdk#355's body, arm 2):On the host side the pre-change code could not even represent the value:
pluginCheckResulthadStatusandMessageand no third field. The committed guard is the honest form of that:checkResultFromVerbReplyis the change, so on pre-fix the new test file cannot build (undefined: checkResultFromVerbReply), and the behavioural demonstration is the live arm above plus the pinned old shape's absence of the field.What this PR does not claim: the live arm uses a bed plugin because no shipping candy produces a capture yet — a real producer is a separate feature, not this wire. charly's own
charly check --format jsonsurface starts carrying the value for such a producer automatically, since the mapping is the ONE the plan run and the ledger consume.Rulebook compliance
/charly-internals:go(core Go work, the module gates, R9) and/charly-internals:git-workflow+ its pre-validator self-audit for this step.origin/mainwith an executable instrument before the edit (the spike and the live pre-fix arm, both pasted); every failure this change introduces is loud (malformed reply, unknown status), never silent. No warning survives a gate:gofmt,go vet,go test ./charly/...and golangci-lint are clean on this head (below), and no doc in this repo still describes the deletedcapture_extract:/capture:mechanism.ops.ParseResultJSONFull), the host's copy is deleted, and the status/ capture mapping lives in one function; the tests assert through the production conversion instead of re-declaring the shape.go mod edit+tidypath.charlyreporting a probe's captured payload) becomes real rather than aspirational; nothing documented needed a change to keep working, and the changed path is exercised live above.git grep pluginCheckResultover the committed tree returns nothing (exit 1 pasted); the orphaned docstring naming the removedcapture_extract:/capture:matchers is deleted; the only surviving mention of that family in the org is CHANGELOG history (permitted) — and spec#194's own contract comment is corrected by spec#203.feat/c9-capturedvalue-consumeroff freshorigin/main(21469290), no force-push, no rebase; tree clean after the commit; no submodule's tracked checkout was edited. The bed modules live under the umbrella's gitignored.worktrees/wire-types/and belong to no repo.GRPCBroker), never a mock.buildPluginBinaryfrom a bed module pinned to the released SDK tag, and the host was the worktree's own test binary. Nothing was installed.CheckResult.Change classification
go test ./charly/...,gofmt -l charly, golangci-lint +fmt --diff) on the final tree, plus the live out-of-process bed run against the released SDK 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)