Skip to content

docs(spec): correct CheckVerbResult.CapturedValue's contract (R1/R5) - #203

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/c9-captured-value-doc
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/c9-captured-value-doc

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

spec.CheckVerbResult.CapturedValue's comment read "value stashed under capture: (recorded only on PASS)" — a mechanism that exists nowhere. Re-derived on origin/main before touching it: no capture?: / capture_extract?: key survives anywhere in schema/, and the ScenarioContext.Captures stash it fed is gone as well (ScenarioContext now carries only CurrentStepID / Backgrounds / Results); the check-engine cutover removed both. Only CHANGELOG/ history and one orphaned docstring in charly/checkspec_test.go still name them — so the field's own contract comment was describing a gate nothing produces and nothing consumes.

The comment now states the contract the operator ruled for opencharly/charly#780 (JSON-encoded in both directions): the value is a JSON document the verb itself decided to capture while making its judgement, empty when it captured nothing, carried on the wire as ops.resultWire's captured_value raw JSON so a consumer addresses a field of it by dotted path without the contract naming any verb's shape.

Files (1): spec/checkcontext.go — a comment-only edit inside a hand-written (NOT generated) contract file; CheckVerbResult is an in-process value struct, SDD-audited REVIEWED-INTENTIONAL (spec/checkcontext.go header), so no CUE source and no charly task cue-gen run is implicated, and no generated artifact moves.

Closes #194
Refs opencharly/charly#780

The runtime legs of this same contract cutover follow producer-first in their own repos and their own PRs: sdk (ServeCheckVerb encodes the capture it currently drops) → charly (decode through ops.ParseResultJSONFull, delete the hand-rolled pluginCheckResult, thread the value through checkResultFromVerb, and sweep the orphaned capture_extract:/capture: docstring). This PR is the contract module's leg and carries only prose.

The claim-keyed sweep (R5), on this head

The deleted claim is "a capture: gate exists and stashes a value". The sweep is claim-keyed, not identifier-keyed:

$ git grep -n "capture:" HEAD -- '*.go' '*.cue' | grep -v "there is no"
$ echo "exit=$?"
exit=1
$ git -C spec grep -in "capture" origin/main -- 'schema/_common.cue' | head -4
origin/main:schema/_common.cue:369:// the existing from_snapshot: (boot from a backing chain) with capture-and-reset
origin/main:schema/_common.cue:370:// semantics for check runs: capture at install finalize (on_finalize), revert
$ git -C sdk show origin/main:kit/scenario.go | sed -n '16,36p'
type ScenarioContext struct {
	// CurrentStepID is rewritten for each step as the plan run executes, so ${STEP_ID}
	// references resolve to the currently-running step's identifier. Reporters surface this
	// on failures.
	CurrentStepID string

	// mu guards Backgrounds + Results when steps execute concurrently within a `parallel:`
	// group. The default (sequential) path doesn't contend, so the mutex overhead is
	// negligible.
	mu sync.Mutex

	// Backgrounds tracks PIDs of host-side processes spawned by `command:` verbs with
	// `background: true`. Reaped at plan teardown via SIGTERM (best-effort; non-fatal on
	// failure).
	Backgrounds []int

	// Results accumulates CheckResults from steps that have completed, indexed by step ID.
	// Used by the `summarize:` verb to walk prior steps' Elapsed durations and compute
	// distribution metrics.
	Results map[string]CheckResult
}

The two remaining surfaces outside this repo are named, not hidden: sdk/CHANGELOG/2026.187.0747.md (historical record — permitted) and charly/checkspec_test.go:328-332 (an orphaned docstring for a deleted test, in another repo; it dies in that repo's own leg of this cutover, the charly PR, since a cross-repo cutover lands one PR per repo).

How tested

Contract/library module: its own committed CI is the change-class gate (spec/AGENTS.md: GOWORK=off go build ./... + go test ./..., with the repo's CI additionally running gofmt -l and golangci-lint). All of it, executed on this head (19bea59):

$ git rev-parse HEAD
19bea5923162659fc559f2cd419d2a8685859af6

$ gofmt -l .
$ echo "exit=$?"
exit=0
$ GOWORK=off go build ./...
$ echo "exit=$?"
exit=0
$ GOWORK=off go vet ./...
$ echo "exit=$?"
exit=0
$ GOWORK=off go test ./...
ok  	github.com/opencharly/spec/spec	(cached)
ok  	github.com/opencharly/spec/ops	(cached)
ok  	github.com/opencharly/spec/schema	(cached)
ok  	github.com/opencharly/spec/matchers	(cached)
ok  	github.com/opencharly/spec/checkstep	(cached)
ok  	github.com/opencharly/spec/container	(cached)
ok  	github.com/opencharly/spec/proc	0.249s
exit=0
$ golangci-lint fmt --diff
$ echo "exit=$?"
exit=0
$ golangci-lint run ./...
0 issues.
exit=0

git status --short is empty after the commit and the commit carries exactly the one intended file (git show --stat → spec/checkcontext.go | 13 ++++++++++---).

Stated honestly: this is a comment-only change, so no behavioural test can fail without it — the proof that the change is complete is the claim-keyed sweep above (zero live capture: gate references in the committed tree, and the two out-of-repo surfaces named rather than implied absent). The runtime proof for this contract belongs to the sdk/charly legs, each with its own gate.

Rulebook compliance

  • R0 — loaded /charly-internals:go (SDD: which files are generated vs hand-written) and /charly-build:validate//charly-internals:plugin (the CUE-schema contract) for this step, and /charly-internals:git-workflow + its pre-validator self-audit before the push.
  • R1 — the issue's premise was re-derived on origin/main before editing, not assumed: the capture:/capture_extract: keys and the ScenarioContext.Captures stash are provably gone, so the comment was the stale side and the code was right to be changed by comment only. No warning or failure is left standing.
  • R2 — the whole claim is corrected, and its sibling claims are named: charly/checkspec_test.go's orphaned docstring is routed to the charly leg of this same cutover (a cross-repo cutover lands one PR per repo); the sdk CHANGELOG mention is permitted history. No "pre-existing"/"unrelated" carve-out.
  • R3 — prose only; no declaration is added, moved or duplicated. The one declaration of this wire surface (ops.resultWire, spec.CheckResult) is untouched.
  • R4 — no sleeps, retries, shims or fallbacks; nothing runtime was touched.
  • R4a — no documented command is affected; the field is an internal contract type.
  • R5 — the stale claim dies here and the claim-keyed sweep is pasted above with its exit code; nothing in this diff introduces a new version/migration coupling, and #SchemaVersion/version: no longer exist to bump (CHANGELOG/0.2026270.938.md), so no migration is owed by a comment-only edit.
  • R6 — feat/c9-captured-value-doc off fresh origin/main (b8c348a), no force-push, no rebase; the tree is clean after the commit; no submodule's tracked checkout was touched.
  • R7 — no behaviour changes, so there is no behavioural coverage to add; the completeness claim (zero surviving capture: gate references) is backed by the pasted grep and its exit code, and the two out-of-repo survivors are named explicitly.
  • R7a — N/A — this change crosses no live service boundary.
  • R8 — no emitted artifact changes (comment-only); charly task cue-gen is not implicated because the edited type is hand-Go (SDD-audited REVIEWED-INTENTIONAL), which the paste of the file's own header establishes.
  • R9 — no binary is built or run by this change; no shared install is touched.
  • R10 — the change-class gate for a contract/library module with a comment-only diff is the repo's own committed CI (spec/AGENTS.md), not a bed: a fresh disposable venue would exercise nothing this diff touches. The non-runtime standards all passed on the final tree (pasted above).

Change classification

  • Change class: documentation-only, inside the contract module — a Go comment in a hand-written file. Classified from the diff (git diff --stat $(git merge-base origin/main HEAD)..HEAD → one file, comments only), never from intent.
  • Verification gate: gofmt -l + GOWORK=off go build ./... + go vet ./... + GOWORK=off go test ./... + golangci-lint fmt --diff + golangci-lint run ./... — all green on this head; plus the claim-keyed sweep.
  • Attribution tier: documentation reviewed (the tier for a comment-only change whose non-runtime standards all pass; runtime tiers are forbidden for prose-only work).

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

#194: the field's comment named a `capture:` op gate that exists
nowhere in the schema. Re-derived on origin/main before editing: no `capture?:`
or `capture_extract?:` key survives anywhere in schema/, and the
`ScenarioContext.Captures` stash it fed is gone too (ScenarioContext now carries
only CurrentStepID/Backgrounds/Results) -- the check-engine cutover removed both.
Only CHANGELOG history and one orphaned charly test docstring still mention them,
so the comment was describing a mechanism nothing produces.

The comment now states the contract the operator ruled for opencharly/charly#780
(JSON-encoded in both directions): the value is a JSON document the verb itself
decided to capture while making its judgement, empty when it captured nothing,
carried on the wire as ops.resultWire's `captured_value` raw JSON so a consumer
addresses a field of it by dotted path without the contract naming any verb's
shape.

Comment-only: no behaviour, no generated artifact, no schema edit, no version
coupling (#SchemaVersion and the charly.yml version: stamp were deleted).

Closes #194
Refs opencharly/charly#780

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (documentation reviewed)
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Review — PASS

Head SHA: 19bea5923162659fc559f2cd419d2a8685859af6 (branch: feat/c9-captured-value-doc)

Security screen: PASS — comment-only edit; no secrets/egress, no guardrail weakening, no supply-chain or self-modifying-security change; PR content treated as data (no embedded directives).
Change class: docs-only (a Go comment inside the hand-written contract file spec/checkcontext.go) → non-runtime standards gate, no bed required. Attribution tier documentation reviewed is legal for a comment-only diff; body ends with the required *Assisted-by: …* line after the Agent: footer.
Placement: CORRECT — the CheckVerbResult contract shape belongs in the contract module (spec); nothing capability-bearing moved into core/sdk.
Checklist: All applicable rules PASS or NA. Comment thread empty (0 comments) — no comment-intake dispositions owed. Tool-limited: the ops.resultWire.captured_value field, the file's SDD REVIEWED-INTENTIONAL header, and the model-name string cannot be re-derived from the supplied diff, but each is internally consistent with the pasted sweep/test output and the described cross-repo cutover (routing of the charly/checkspec_test.go docstring to the named charly leg is a legitimate one-PR-per-repo route, not a vague deferral).

Verdict: PASS


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

View action run

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.

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

1 participant