Repository navigation
feat(kit): the check result model lands in sdk/kit (P5-unit-2) - #17
Conversation
Second unit of P5 (check-engine SDK-ization). The result model - the pass/fail/skip
verdict, the per-step result record, and the output formatters - now lives ONCE in
sdk/kit, so a plugin candy that runs a plan represents and formats results with the
same types the engine uses.
Moved:
- kit.Status gains String() -> "pass"/"fail"/"skip"/"unknown". It was already the
three-valued verdict a verb returns in a kit.Result; it is now also the enum the
engine records.
- kit.CheckResult (checkresult.go): the engine's per-step record - a verb's verdict
(Status/Message/CapturedValue) plus the bookkeeping a Result does not carry (Op
*spec.Op, Verb, Elapsed, retry Attempts/TotalElapsed, DeadlineExceeded).
- kit.StepResult: one plan step's outcome (keyword/text/origin/id + its CheckResult).
- kit.FormatStepResults{Text,JSON,TAP,JUnit} + kit.Plural (report.go): the check
output reporters, moved verbatim.
The duplication this dissolves: kit.Status and charly's CheckStatus were the SAME
three-valued enum, bridged by a kitStatusToCheck converter in core - the exact
"mirror + convert" pattern P5 removes (kit.go's own comment read "Status ... mirrors
charly's CheckStatus ordering" and "charly converts it to its internal CheckResult").
The converter is deleted; a verb's kit.Result verdict now flows into a CheckResult
with no conversion. kit.Result (the verb-author verdict) and kit.CheckResult (the
engine's record) coexist as distinct documented concepts - a Request/Record split.
Check-coverage - the formatters had NONE. report_test.go adds the tests the reporters
never had: the exact text output (the format the check-live golden oracle compares -
PASS/FAIL/SKIP column, the "N steps:" summary, singular/plural), the retry-info suffix
(present at Attempts>1, absent at 1), TAP v13 (the failing point emits exactly one
diagnostic block; a skip is still "ok"), a JSON round-trip, and JUnit XML (origin
grouping into suites, per-suite counts). Plus Status.String() (all four cases) and
Plural.
Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: sdk Go (pure, additive library MOVE — behaviour-neutral) Independent re-derivation (trusted nothing in the PR body). Checklist:
Behaviour preservation — PROVEN byte-identical vs Integration (my own fresh-rebuild evidence): the full Decision: Genuine PASS. A pure, behaviour-preserving MOVE proven byte-equivalent at source, all Go gates green on the exact head, and the consumer integrates and tests clean against it. I did not re-run the full 18-bed roster (properly the consumer PR's gate); the behaviour claim is proven more strongly at source than a single noisy bed would show. Finalizing merge-time CalVer, squash-merging, tagging. Assisted-by: Claude (analysed on a live system) |
pr-validator merge-time version stamp: rename the CHANGELOG placeholder 2026.191.1530 -> 2026.191.1732 (generated at merge, not author-time). No code change; the validated result-model move is unchanged. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01W8GPhuyWWs5XwJyJYtCaxE
Summary
Second unit of P5 (check-engine SDK-ization). The check engine's result model — the
pass/fail/skip verdict, the per-step result record, and the output formatters — now lives ONCE
in
sdk/kit, so a plugin candy that runs a plan represents and formats results with the sametypes the engine uses.
What moved
kit.Statusgains aString()→"pass"/"fail"/"skip"/"unknown". It was already thethree-valued verdict (
StatusPass/StatusFail/StatusSkip) a verb returns in akit.Result; itis now also the ONE enum the engine records.
kit.CheckResult(checkresult.go) — the engine's per-step record: a verb's verdict(Status/Message/CapturedValue) plus the bookkeeping a
Resultdoes not carry (Op *spec.Op,Verb,Elapsed, retryAttempts/TotalElapsed,DeadlineExceeded).kit.StepResult— one plan step's outcome (keyword/text/origin/id + itsCheckResult).kit.FormatStepResults{Text,JSON,TAP,JUnit}+kit.Plural(report.go) — the checkoutput reporters, moved verbatim.
The duplication this dissolves
kit.Statusand charly'sCheckStatuswere the same three-valued enum, bridged by akitStatusToCheckconverter in core — the exact "mirror + convert" pattern P5 exists to remove.kit.go's own comment read "Status ... mirrors charly's CheckStatus ordering" and "charly
converts it to its internal CheckResult." The converter is deleted (in the consuming
superproject PR); a verb's
kit.Resultverdict now flows into aCheckResultwith no conversion.kit.Result(the verb-author verdict — what to return) andkit.CheckResult(the engine'srecord) coexist as distinct, documented concepts: a Request/Record split, not duplication.
Change class
sdkGo (pure library — this PR is purely additive; the core deletions land in the superprojectconsumer). Gate:
go test ./...+ the consuming superproject's full concurrent bed roster + a21-file
check-livegolden-output parity.Check-coverage — the formatters had NONE in core
report_test.goadds 10 tests the reporters never had:TestFormatStepResultsText— the exact text output (the format thecheck-livegoldenoracle compares): the
PASS/FAIL/SKIPcolumn, theN steps: … passed, … failed, … skippedsummary, and singular vs plural.TestRenderStep_RetryInfo— the(attempts=N, elapsed=…)suffix appears atAttempts>1andis absent at 1.
TestFormatStepResultsTAP— TAP v13; the failing point emits exactly one diagnostic block, askip is still
ok.TestFormatStepResultsJSON_RoundTrips— the JSON document unmarshals back to[]StepResult.TestFormatStepResultsJUnit— parses the XML back and checks origin→suite grouping (first-seenorder) and per-suite tests/failures/skipped counts.
TestStatus_String(all four cases),TestPlural,TestStepResultCarriesOp.R10 evidence — consumed by the superproject, full concurrent roster + golden parity
charlyrebuilt against this working tree (replace => ../sdk), all 18 disposable beds at once:Golden parity. The 21-file
check-liveoracle captured before P5 began, masked forby-design non-determinism (auto ssh ports, k8s name hashes, unordered pod listing):
21/21 identical. The result-model move is behaviour-neutral — the reporters produce the
same bytes.
Tier
fully tested and validated.Assisted-by: Claude (fully tested and validated)