Skip to content

spec: CheckVerbResult.CapturedValue's doc names a capture: op gate that does not exist #194

Closed

Description

@aitrawog

Problem

spec.CheckVerbResult.CapturedValue's doc comment states a contract that does not exist in the schema. spec/checkcontext.go:165:

type CheckVerbResult struct {
	Status        Status
	Message       string
	CapturedValue string // value stashed under `capture:` (recorded only on PASS)
}

There is no capture: op field. #Op (spec/schema/_common.cue) declares none, and the only Capture bool in the generated Go is on CliRequest (spec/cue_types_gen.go:9829, an argv/exec request struct — unrelated, and it means something different). A repo-wide search for capture: in authored YAML finds no consumer.

So the comment names a gate that was never built. It is the only place in the codebase that states how capture is supposed to be triggered, which makes it load-bearing prose describing a nonexistent mechanism.

Evidence

$ grep -n 'capture' .worktrees/workflow-ir/spec/schema/_common.cue    # the #Op def
(no `capture:` field)

$ awk 'NR<=9829 && /^type [A-Za-z]+ struct/' spec/spec/cue_types_gen.go | tail -1
type CliRequest struct {          # ← the only Capture bool, unrelated

$ grep -rn 'ResultJSONCaptured' --include='*.go' <worktrees> | grep -v '/spec/ops/'
(no consumers)

The comment arrived by relocation, not by design decision: git log -L traces it to 8c6b11c "refactor(spec)!: #55 step1-fabric — granular spec slices + value/wire types relocated from sdk kits", where spec/checkcontext.go is created as a new file (the type moved out of sdk/kit). The prose is inherited, not authored here.

Why it matters now

The workflow wave gives command: a real producer: candy/plugin-command's PASS arm now sets CapturedValue to the step's stdout (capped at 1 MiB, truncation named in Message). That is the producer charly task --output needs, and charly's check-task bed step task-output-captured asserts it.

Two things follow that this comment actively confuses:

  1. The gate question is open and undocumented. Capture is currently unconditional on PASS. If the comment is right, it should be opt-in via a capture: op field — which would mean #Op gains a field, charly threads it, and the bed's step declares capture: true. If the comment is wrong, it should be deleted. Either way the current state is undocumented intent, and the next reader will implement whichever they guess.
  2. The blast radius is real. command: is a heavily used verb. Unconditional capture means every passing command: step now rides up to 1 MiB of stdout in the check-run ledger. omitempty keeps a non-printing step byte-identical, so this is bounded and additive — but it is a behaviour change for existing producers, and the omitempty compatibility note in spec/ops/ops.go:224 reads as though capture were rare and opt-in.

Root fix (one of two, decided by the operator)

  • (a) The comment is stale → delete the under capture:`` clause in spec/checkcontext.go:165 and let `spec/ops/ops.go`'s `CapturedValue` paragraph (which correctly describes the field as optional and structured) be the single source. One-line prose fix, no wire change.
  • (b) The gate was real intent → add capture?: bool to #Op, have plugin-command capture only when it is set, thread it through charly's dispatch, and set it on the check-task bed's step. A contract change across spec + charly + the producer plugin; it would also keep the ledger narrow for verbs that never wanted a capture.

(a) is the cheap correction and matches the observed intent (the wave's consumer requires unconditional capture to work). (b) is a real feature with a real cost argument. This issue exists so the choice is made deliberately rather than by whoever reads the comment next.

Scope

spec only for (a). (a) + charly + candy/plugin-command + the check-task bed for (b). No consumer change either way.

Reported from the workflow-ir wave; see opencharly/plugin-task#9 and the candy/plugin-command PR for the measured chain. The wire half of the same field (dropped between the producer and charly) is the separate, measured defect opencharly/charly#780.

Agent: workflow-ir · session 7e17b5cf-c349-4032-8da5-2e4e03612780
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

Activity

  1. self-assigned this
    on Oct 4, 2026
  2. aitrawog commented on Oct 7, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the field's contract comment no longer names a capture: op gate; it states the contract the operator ruled for opencharly/charly#780 (a JSON document the verb itself captured, empty when it captured nothing, carried on the wire as ops.resultWire's captured_value raw JSON).

    Landed: #203 — merged 2026-10-07T21:26:45Z as 49d75610a3d92bb7f8e3a7fbf41b81e8270e72d4, with the org validator's ## Review — PASS on head 19bea59, validate / validate and go green.

    Evidence on the merged tree:

    $ git -C spec show 49d75610a3d92bb7f8e3a7fbf41b81e8270e72d4:spec/checkcontext.go | grep -n "CapturedValue" -A 8
    	// CapturedValue is the JSON-encoded value the verb captured while making its judgement —
    	// the parsed body of an HTTP probe, the matched fields of a log scan, the row a SQL check
    	// read — and empty when it captured nothing. It is a JSON document, never prose, so a
    	// consumer addresses a field of it by dotted path without this contract having to name any
    	// verb's shape; on the wire it is the `captured_value` raw JSON of ops.resultWire. Nothing
    	// gates it: there is no `capture:` op — the verb's own RunVerb decides what, if anything,
    	// to capture, exactly as it decides the status and the message.
    	CapturedValue string
    $ git grep -n "capture:" HEAD -- '*.go' '*.cue' | grep -v "there is no"
    $ echo "exit=$?"
    exit=1
    

    The claim-keyed sweep is pasted in the PR: zero live capture: gate references in the contract module, and the two out-of-repo survivors named rather than implied absent — sdk/CHANGELOG/2026.187.0747.md (history, permitted) and the orphaned docstring in charly/checkspec_test.go, which the charly leg of this same cutover deletes (opencharly/charly#825).

    The runtime legs of the cutover, in producer-first order: the SDK producer (opencharly/sdk#355, merged, tag v0.2026280.2133) and the charly consumer (opencharly/charly#825, open — it closes opencharly/charly#780).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions