Skip to content

fix(charly): decode a verb provider's reply through the contract, capture included - #825

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/c9-capturedvalue-consumer
Oct 7, 2026
Merged

github-actions[bot] merged 4 commits into
mainfrom
feat/c9-capturedvalue-consumer

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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's CapturedValue never reached the CheckResult the check run carries and the ledger records. The producer half is merged and tagged: opencharly/sdk#355 (merge d89a6fac17d98fb7b9c699d47ab84a8db7969c7a, tag v0.2026280.2133) 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 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 (its dispatch now returns the production spec.CheckResult through 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:

  • Every reference to the deleted shape. The five test sites that hand-decoded pluginCheckResult now go through the production conversion; nothing in the tree names the deleted type (grep below).
  • The claim-keyed sibling. charly/checkspec_test.go carried an ORPHANED docstring for a deleted test, describing the long-removed capture_extract: / capture: matchers and the ScenarioContext.Captures stash 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.go already imported github.com/opencharly/spec/spec two import groups below the hunk's context, so the import moved into the group the diff displays, and plugin_appium_external_test.go needed no change (it imports spec at line 13 and still uses encoding/json four times) — and two catch-up merges of origin/main (a merge, never a rebase or force-push — ac182d40 and then 713f57f5, the latter bringing in main's CHANGELOG/2026.280.2154.md), because this branch's own predecessor #824 had meanwhile bumped plugin-oci in the same two files. The merge keeps both pins (plugin-oci v0.2026280.2122, sdk v0.2026280.2133) and go.sum was regenerated with go mod tidy after 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 short TMPDIR (the go-plugin sun_path bound), gofmt -l charly tools, and golangci-lint in charly/. All on this head:

$ git rev-parse HEAD
713f57f548dac188b89aa2ee9c4c40a427d2faa5

$ gofmt -l charly
$ echo "exit=$?"
exit=0
$ go test -count=1 ./charly/...
ok  	github.com/opencharly/charly/charly	121.815s
ok  	github.com/opencharly/charly/charly/internal/pluginsgen	133.466s
exit=0
$ (cd charly && golangci-lint run ./...)
0 issues.
exit=0
$ (cd charly && golangci-lint fmt --diff)
$ echo "exit=$?"
exit=0

The new tests, focused:

$ go test -count=1 -run 'TestCheckResultFromVerbReply' -v ./charly/
=== RUN   TestCheckResultFromVerbReplyCarriesTheCapturedValue
--- PASS: TestCheckResultFromVerbReplyCarriesTheCapturedValue (0.00s)
=== RUN   TestCheckResultFromVerbReplyWithoutCaptureIsUnchanged
--- PASS: TestCheckResultFromVerbReplyWithoutCaptureIsUnchanged (0.00s)
=== RUN   TestCheckResultFromVerbReplyMalformedIsAVerbNamingFail
--- PASS: TestCheckResultFromVerbReplyMalformedIsAVerbNamingFail (0.00s)
=== RUN   TestCheckResultFromVerbReplyUnknownStatusIsAFail
--- PASS: TestCheckResultFromVerbReplyUnknownStatusIsAFail (0.00s)
PASS
ok  	github.com/opencharly/charly/charly	1.044s
[exit: 0]

R5 — the deleted identifier is gone from the committed tree, docs included:

$ git grep -n "pluginCheckResult" HEAD -- '*.go'
$ echo "exit=$?"
exit=1

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 RunVerb returns a PASS verdict carrying {"bytes":67,"path":"/tmp/screencap.png"} — is pinned to the released github.com/opencharly/sdk v0.2026280.2133 (no replace), host-built by charly's own buildPluginBinary, spawned as a separate process, and driven through charly's real LocalTransport (go-plugin gRPC + live GRPCBroker); the assertion goes through the production seam checkResultFromVerbReply, i.e. the value a check run would carry. Bed files are discarded; only this answer lands.

$ go test -count=1 -run TestBedHostDecodeCarriesTheCaptureFromTheReleasedSDK -v ./charly/
=== RUN   TestBedHostDecodeCarriesTheCaptureFromTheReleasedSDK
    zz_bed_host_released_test.go:57: raw wire from the out-of-process plugin (released SDK): {"status":"pass","message":"bed wire probe: captured the probe's payload","captured_value":{"bytes":67,"path":"/tmp/screencap.png"}}
    zz_bed_host_released_test.go:76: the released SDK's capture reached charly's CheckResult: {"bytes":67,"path":"/tmp/screencap.png"}
--- PASS: TestBedHostDecodeCarriesTheCaptureFromTheReleasedSDK (0.71s)
ok  	github.com/opencharly/charly/charly	1.847s
[exit: 0]

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):

    raw wire from the out-of-process plugin: {"status":"pass","message":"bed wire probe: captured the probe's payload"}
    DROPPED: the out-of-process wire carried no captured_value: {"status":"pass","message":"bed wire probe: captured the probe's payload"}
--- FAIL: TestBedWireProbePreFixDropsTheCapture (0.97s)
[exit: 1]

On the host side the pre-change code could not even represent the value: pluginCheckResult had Status and Message and no third field. The committed guard is the honest form of that: checkResultFromVerbReply is 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 json surface starts carrying the value for such a producer automatically, since the mapping is the ONE the plan run and the ledger consume.

Rulebook compliance

  • R0 — loaded /charly-internals:go (core Go work, the module gates, R9) and /charly-internals:git-workflow + its pre-validator self-audit for this step.
  • R1 — the defect was re-derived from origin/main with 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 deleted capture_extract:/capture: mechanism.
  • R2 — one cutover: the host decode, the producer's pin, the deleted-shape sweep and the claim-keyed docstring sweep all land together; the remaining sibling outside this repo (the SDK CHANGELOG's historical mention) is history, which R5 permits.
  • R3 — the wire is decoded by its ONE declaration (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.
  • R4 — no sleeps, retries, or fallbacks; the pin bump is the ordinary go mod edit + tidy path.
  • R4a — the operator-facing behaviour (charly reporting 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.
  • R5 — git grep pluginCheckResult over the committed tree returns nothing (exit 1 pasted); the orphaned docstring naming the removed capture_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.
  • R6 — feat/c9-capturedvalue-consumer off fresh origin/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.
  • R7 — coverage that fails without the change: the live pre-fix arm (exit 1) plus the host-side impossibility (the deleted shape had no field to hold the value); the changed path was executed live out-of-process on the released SDK.
  • R7a — the live arm crosses a real process/transport boundary (a spawned plugin binary + GRPCBroker), never a mock.
  • R8 — the asserted artifact is the wire payload the host receives, read and mapped exactly as the check run maps it.
  • R9 — worktree-local builds only; the plugin binary under test was built by charly's own buildPluginBinary from a bed module pinned to the released SDK tag, and the host was the worktree's own test binary. Nothing was installed.
  • R10 — fresh rebuild + live run: the full core suite on the final tree, plus the out-of-process bed run against the released SDK with the capture landing in charly's CheckResult.

Change classification

  • Change class: code — charly core Go (a wire decode + tests) plus a dependency pin bump (compiled-in plugin candies' SDK). Not docs-only.
  • Verification gate: charly's own CI steps (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.
  • Attribution tier: 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)

…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)
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: 3959283e42d02511fcfe56f2e901089192d95072 (branch: feat/c9-capturedvalue-consumer)

Change class: code — charly core Go (verb-reply decode + tests) plus a dependency pin bump.

Blocks

  1. B18 / rule 4 — charly/plugin_grpc_test.go uses spec but the diff's import block never imports it. The changed import block (diff lines 2–13) resolves to stdlib / "github.com/opencharly/spec/ops" / grpc group only — no github.com/opencharly/spec/spec. Yet the added assertion references it:
    if verbRes.Status != spec.StatusPass || !strings.Contains(verbRes.Message, "testprobe-ok")
    checkResultFromVerbReply returns spec.CheckResult whose .Status is spec.Status, so spec.StatusPass requires the spec package to be in scope. Nothing in the file (the import hunk is the only import change, and it only re-adds ops) brings it in — while the sibling files show the author knew to add it (plugin_external_test.go adds "github.com/opencharly/spec/spec"; plugin_checkcontext_e2e_test.go has it as existing context). As committed this is undefined: spec, so the package cannot build and the body's pasted ok github.com/opencharly/charly/charly 127.018s / golangci-lint clean cannot be true (rule 4: output that contradicts the diff). Fix: add the spec import, or paste the full plugin_grpc_test.go import block proving spec is present below the diff's 3-line context, and re-paste the gate output on the resulting head.

  2. charly/plugin_appium_external_test.go — same proof required. The new code calls spec.StatusSkip while the file's imports are untouched by the diff, and the still-present encoding/json import has had its only shown use (json.Unmarshal) removed. Confirm (from the file, pasted) that spec is imported and that encoding/json is still used, otherwise this file is a second compile failure.

Verdict: BLOCK


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

View action run

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)
@aitrawog

aitrawog commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

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 (30243419, import-grouping only) and the whole body is re-keyed to the new head.

Finding 1 — plugin_grpc_test.go "never imports spec". It did. The import was two groups below the hunk's context, so the diff's 3-line context could not show it. Verbatim from the committed tree on this head:

$ git rev-parse HEAD
3024341906b8ebd62969aba76431d25ba35706f6
$ sed -n '3,16p' charly/plugin_grpc_test.go
import (
	"context"
	"net"
	"strings"
	"testing"

	"github.com/opencharly/spec/ops"
	"github.com/opencharly/spec/spec"

	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials/insecure"
	"google.golang.org/grpc/test/bufconn"

	pb "github.com/opencharly/spec/proto"

The follow-up commit moves "github.com/opencharly/spec/spec" into the group the diff displays (a formatting-only change; gofmt -l charly is empty and go vet ./charly/... is clean on it), so the hunk itself now carries the evidence.

Finding 2 — plugin_appium_external_test.go needs confirming. No change was needed; both claims hold on the committed tree:

$ sed -n '11,14p' charly/plugin_appium_external_test.go
	"github.com/opencharly/spec/matchers"
	"github.com/opencharly/spec/ops"
	"github.com/opencharly/spec/spec"
)
$ grep -c "json\." charly/plugin_appium_external_test.go
4

(encoding/json is still used at lines 88, 122 and 127 — the host's json.Marshal of the Op and the round-trip json.Unmarshal.)

Gates re-run in full on this head 30243419 (the push fired a fresh charly/pr-validator run):

$ gofmt -l charly
$ echo "exit=$?"
exit=0
$ go test -count=1 ./charly/...
ok  	github.com/opencharly/charly/charly	120.573s
ok  	github.com/opencharly/charly/charly/internal/pluginsgen	134.104s
exit=0
$ (cd charly && golangci-lint run ./...)
0 issues.
exit=0
$ go test -count=1 -run 'TestCheckResultFromVerbReply' -v ./charly/
--- PASS: TestCheckResultFromVerbReplyCarriesTheCapturedValue (0.00s)
--- PASS: TestCheckResultFromVerbReplyWithoutResultIsUnchanged (0.00s)
--- PASS: TestCheckResultFromVerbReplyMalformedIsAVerbNamingFail (0.00s)
--- PASS: TestCheckResultFromVerbReplyUnknownStatusIsAFail (0.00s)
PASS
ok  	github.com/opencharly/charly/charly	1.009s
[exit: 0]
$ git grep -n "pluginCheckResult" HEAD -- '*.go'
$ echo "exit=$?"
exit=1

The live out-of-process arm is unchanged from the body (it exercises checkResultFromVerbReply, which this commit does not touch): a real plugin process built against the released sdk v0.2026280.2133 → capture reaches charly's CheckResult, PASS.

Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 3024341906b8ebd62969aba76431d25ba35706f6 (branch: feat/c9-capturedvalue-consumer)

Security screen: PASS — no scope mismatch, no secrets/egress, no guardrail weakening; the sdk pin bump is a plain dependency bump, T4 not triggered.
Checklist: All applicable rules PASS or NA (A1–A3, B4–B16, B18); R10/disposable: N/A (no charly-managed target destroyed/rebuilt — a throwaway Go test module + buildPluginBinary). The changed decode path (checkResultFromVerbReply) is exercised live out-of-process on the released SDK, and the diff's import blocks are consistent with the pasted green gofmt/go test/golangci-lint output (tool-limited: cannot re-run).
Comments:

  • 6047491675 (@github-actions[bot]) — finding 1 (plugin_grpc_test.go "never imports spec"): stale-superseded; the CURRENT diff shows + "github.com/opencharly/spec/spec" in the import block. finding 2 (confirm appium imports spec, keeps encoding/json): verified-non-blocking via the author's pasted sed/grep output, internally consistent.
  • 6047550323 (@aitrawog) — STATUS + evidence, consistent with the current head; not a T4 sign-off (none required).
  • B15 note (non-blocking): two non-changelog commits will collapse on squash; no partial/split work pattern.

Verdict: PASS


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

View action run

@aitrawog

aitrawog commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

STATUS — the branch has caught up with main (a merge, never a rebase or force-push), and the whole body is re-keyed to the resulting head.

Why: the validator's PASS at head 30243419 was correct, but this branch's own predecessor — #824, the plugin-oci consumer pin — merged minutes later and touched the same two files, leaving the PR CONFLICTING (GitHub will not auto-merge a conflicting head regardless of its check).

What changed: git merge origin/main into feat/c9-capturedvalue-consumer; charly/go.mod auto-merged carrying BOTH bumps (plugin-oci v0.2026280.2122 from #824, sdk v0.2026280.2133 from this branch); charly/go.sum conflicted textually and was regenerated with go mod tidy (GOWORK=off, -mod=mod), so nothing was hand-resolved. New head ac182d40ddca182f0351fea89e1127029d1bf111.

Gates re-run in full on that head, because the tree changed:

$ gofmt -l charly
$ echo "exit=$?"
exit=0
$ go test -count=1 ./charly/...
ok  	github.com/opencharly/charly/charly	124.133s
ok  	github.com/opencharly/charly/charly/internal/pluginsgen	130.500s
exit=0
$ (cd charly && golangci-lint run ./...)
0 issues.
$ (cd charly && golangci-lint fmt --diff)
$ echo "exit=$?"
exit=0
$ go test -count=1 -run 'TestCheckResultFromVerbReply' ./charly/
ok  	github.com/opencharly/charly/charly	0.914s
$ git grep -n "pluginCheckResult" HEAD -- '*.go'
$ echo "exit=$?"
exit=1

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 sdk v0.2026280.2133, capture reaching charly's CheckResult through checkResultFromVerbReply) still stands.

Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 713f57f548dac188b89aa2ee9c4c40a427d2faa5 (branch: feat/c9-capturedvalue-consumer)

Security screen: PASS — no scope mismatch (the decode + its tests + a plain sdk pin bump), no secrets/egress, no obfuscation, no guardrail/CI-script/validator-spec edit; spec/proto is a wire SHAPE, not an sdk mechanism kit; T4 not triggered.
Checklist: All applicable rules PASS or NA (A1–A3, B4–B18). The deleted pluginCheckResult has no surviving reference in the current diff (all five test sites route through checkResultFromVerbReply); the new test file proves the decode, and the production seam is exercised live out-of-process on the released SDK. R10/disposable: N/A (a throwaway Go test module + buildPluginBinary — no charly-managed target destroyed/rebuilt). Import hunks (ops/spec/pb) are gofmt-consistent and internally consistent with the pasted green gofmt/go test/golangci-lint output (tool-limited: cannot re-run).

Comments:

  • 6047491675 (@github-actions[bot], BLOCK on 3959283e) — finding 1 (plugin_grpc_test.go never imports spec): stale-superseded; the CURRENT diff shows + "github.com/opencharly/spec/spec" in the import block (fix commit 30243419). finding 2 (confirm appium imports spec, keeps encoding/json): verified-non-blocking via the author's pasted sed/grep (spec at line 13; json. ×4), internally consistent, file unchanged since.
  • 6047550323 (@aitrawog) — STATUS + evidence; consistent with the current head; not a maintainer sign-off (none required for a non-T4 change).
  • 6047662441 (@github-actions[bot], PASS on 30243419) — verified-non-blocking; superseded head, consistent with current state.
  • 6047707061 (@aitrawog) — STATUS (catch-up merge ac182d40); consistent.
  • B15 note (non-blocking): the two non-merge commits (3959283e, 30243419) collapse on squash; the two merges are catch-up merges — no partial/split work pattern.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 7, 2026 22:17
@github-actions
github-actions Bot merged commit b71b02f into main Oct 7, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 7, 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.

charly+sdk: a check verb's CapturedValue is dropped on the OUT-OF-PROCESS wire (producer never sends it, consumer cannot decode it)

1 participant