Repository navigation
fix(report): a step renders on ONE line, so a reader can pair its status with its id - #283
Merged
Merged
Conversation
…tus with its id The text report is a LINE format: a reader pairs each step's status with its id by parsing one line per step, and the report states its own step count in the rollup it prints underneath. renderStep wrote step.Text and the step's message VERBATIM, so a step whose text carried a newline SPANNED several lines and its id bracket landed on a line of its own. The report's step lines then disagreed with the report's own rollup, and a reader that checks the two refuses the WHOLE report and credits NOTHING from it. It was found while running opencharly/layer-docs-site#13's R10 bed: all five of `charly check run check-docs`'s check phases SKIP with "the child's report could not be read: 21 step line(s) against the 22 step(s) its own rollup counted", and the run's exit code is 3. The base tree — WITHOUT that change — produces the identical skip with the identical numbers, so the defect is pre-existing and lives here, in the producer of the format. The PRODUCER owns the format, so the producer guarantees the shape it publishes: * OneLine is the ONE flattening rule for the report — every run of whitespace, a newline included, becomes one space. A step's keyword, text, id and message all go through it. * Flattening also collapses every run of TWO OR MORE spaces, so the two-space separator before a step's id bracket is the only one on the line: a reader can split the line on it without a bracket inside the text stealing the split. * The TAP reporter is a line format too — a test point is one line — so it flattens the same way. The JSON and JUnit reports are structured and are unaffected. A second finding on the same surface, fixed in the same change: truncate cut on BYTES, so a multi-byte rune could be cut in half and the report carried invalid UTF-8 — a line a reader cannot decode, in a report whose whole value is that a reader can read it. It now cuts on a CHARACTER boundary. Before/after, on the same fixture (a plan step whose `run:` block is a multi-line script, and a failure message that quotes a multi-line output): before — the report carries 8 step line(s) for 2 step(s), the id of the first step sits on a line that carries no status, and the TAP report spills a step over its own point; after — one line per step, the status and the id on the SAME line, and the rollup agreeing with the lines the report carries. Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
Review — PASSVerification of the change
Body honesty
Comments
No correctness, honesty, coverage, security, or scope defect is found in the current diff. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
This was referenced Oct 29, 2026
github-actions Bot
pushed a commit
to opencharly/charly
that referenced
this pull request
Oct 29, 2026
…o a reader can pair its status with its id) (#1086) `github.com/opencharly/spec` is compiled into the charly binary, so the pinned module version IS the behaviour of `charly check run` — of the bed record every R10 proof rests on. At the pinned version (v0.2026296.1036) a step whose text carries a newline spanned SEVERAL lines of the child's report: `spec/report`'s `renderStep` wrote `step.Text` verbatim, so the step's `[id]` bracket landed on a line of its own and no line carried both the status and the id. `plugin-check`'s reader matches ONE line per step, so it credited nothing for that step, the child's report carried 21 step lines against the 22 its own rollup counted, and — since plugin-check#134 — a report that disagrees with itself is refused WHOLE. Every check phase of the bed then SKIPs and the run exits 3. That is exactly what opencharly/layer-docs-site#13's `check-docs` bed hit: all five of its check phases SKIP with "the child's report could not be read: 21 step line(s) against the 22 step(s) its own rollup counted". The base tree of that repo, WITHOUT that repo's own change, produces the identical skip with the identical numbers and the identical exit code 3 — so the defect is pre-existing and lives in the PRODUCER of the report format. The producer is fixed, producer-first, in opencharly/spec#283 (squash 4266c8b, module tag v0.2026302.327): `spec/report` now renders every step on EXACTLY one line — the text and the message flattened through one rule — so the status and the id are on the SAME line, and `truncate` cuts on a character boundary so a report line is always decodable. The producer's own tests assert the invariant and FAIL against the old renderer. `charly/go.mod:142` moves `github.com/opencharly/spec` from v0.2026296.1036 to v0.2026302.327. The three lockstep modules move with it — tools/generate-packages, tools/golden-cloudinit and tools/golden-compile — by `charly task mods-tidy`, because tools/gomod-canonical's TestContractPinsMatchShared requires every in-repo module that requires a contract module to list the SAME shared sdk and spec pins. The sdk pin is unchanged (v0.2026297.1851, which requires spec v0.2026280.2244): v0.2026302.327 is the maximum the module graph selects, so no sdk move is behind it and no cascade follows. Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The text report is a LINE format: a reader pairs each step's status with its id by parsing
one line per step, and the report states its own step count in the rollup it prints
underneath.
renderStepwrote a step's text and its message VERBATIM, so a step whose textcarried a newline SPANNED several lines and its id bracket landed on a line of its own. The
report's step lines then disagreed with the report's own rollup, and a reader that checks
the two refuses the WHOLE report and credits nothing from it.
Head
f222b752eb80838777e2afbf6540c3c552677a38— 2 files changed, 259 insertions(+), 5 deletions(-)Where it was found. opencharly/layer-docs-site#13's R10 bed,
charly check run check-docs. All five of its check phases SKIP — "the child's report could not be read: 21step line(s) against the 22 step(s) its own rollup counted" — and the run exits 3. The base
tree of that repo, WITHOUT the change that found it, produces the identical skip with the
identical numbers and the identical exit code, so the defect is pre-existing and lives HERE,
in the producer of the format.
What lands.
OneLine— the one flattening rule for the report: every run of whitespace, a newlineincluded, becomes one space. A step's keyword, text, id and message all go through it.
renderStepwrites the flattened fields, so a step is exactly one line and its status andits id are on the SAME line.
block is
%q-quoted, so a multi-line message cannot break a point.text verbatim, and the JUnit attribute is XML-escaped by the encoder.
truncatecuts on a CHARACTER boundary. It used to cut on BYTES, so a multi-byte runecould be cut in half and the report carried invalid UTF-8 — a line a reader cannot
decode, in a report whose whole value is that a reader can read it. The 200 limit now
counts characters rather than bytes.
How tested
The work happened on
fix/report-one-line-per-stepin this repo's own session worktree, offfresh
origin/main(49c9a98), and the tree every gate ran in is the tree the commitcarries.
The linter runs against the go1.26 toolchain this module's
godirective names, exactly asthe repo's CI does it (
setup-goreadsgo.mod, thengo installbuilds the pinnedgolangci-lint). A linter built with a NEWER Go cannot read this module's dependency graph:
golang.org/x/netv0.52.0 ships a go1.27-only file, and the go1.26go/typesrefuses itand the linter's loader panics. That is a local toolchain pairing, not a finding in this
diff — the CI run on
main(49c9a98) is green.The regeneration gate is a no-op on the committed tree, and its own reproducibility check
passes:
The coverage fails without the change. The OLD renderer —
origin/main's — cannotsatisfy the shape the readers parse. The same fixture is driven against the old renderer
and against the committed one:
The same three tests on the committed tree:
The report the change produces — one line per step, the status and the id on the SAME
line, the rollup agreeing with the lines the report carries:
No verbatim write of a step's text survives — every write of a step's text, keyword, id
or message in the module goes through the one flattening rule:
The three lines that keep the text verbatim are deliberate and each is safe by construction:
line 81 is the infra discriminator (it reads the message, it does not print it), line 135 is
the TAP diagnostic block's
%q-quoted message (a quote escapes the newline), and lines188–200 are the JUnit report, which is structured — its attribute is XML-escaped by the
encoder and its element content is not a line format.
Rulebook compliance
AGENTS.mdwas read before acting in it (Part II feat(spec): CUE-source ResolvedBox/BuilderMap/AggregatedCandyCaps (#55 step3 unit 3a) #4), and/charly-internals:go,/charly-internals:git-workflow,/charly-internals:root-cause-analyzerand/charly-internals:strict-policywere loadedbefore the first edit and before the git actions. The change is Go source work in a
module whose gate its
AGENTS.mdnames.mechanism (the producer does not guarantee the shape the consumers parse), the missed
control (nothing asserted "a step is one line", and no test rendered a step whose text
carries a newline), the blast radius (every bed whose plan carries a multi-line step, and
the TAP report), and the root fix (the producer flattens, and this module's own tests
assert the shape). The defect was not introduced by the change that found it — the
base tree reproduces it identically — and it is fixed HERE, producer-first, in the repo
that owns the format. A second finding on the same surface,
truncatecutting on bytes,is fixed in the same change; it is in the same function family and the change's own
claim — a report line is well-formed text a reader can decode — is false without it. No
warning was tolerated anywhere: the test run, the build, the linter and the regeneration
gate all report zero.
OneLineis the single flattening rule, and the textreporter and the TAP reporter both go through it. There is no second copy of the rule and
no second copy of the truncation.
fail on the old renderer; there is no sleep, no retry, no suppression and no fallback
branch. The reader is not taught to cope — it is given the shape it already requires.
the prose, and the only prose this change touches is the code's own comment, which
describes a control that exists.
line formats, and the claim-keyed sweep is pasted above. No alias, shim, TODO or
deprecated path is introduced, and no legacy name survives anywhere in the module.
fix/report-one-line-per-step, off freshorigin/main; no other session's work, branchor worktree was touched, and no destructive git action was taken. The commit was made
before the first push, and nothing is amended or force-pushed after it.
tests, with the rendered report pasted above showing the eight lines it produced for two
steps. The changed path — the report renderer — executed live, and its real output is
pasted above in full.
[]spec.StepResultrenderedthrough the real reporter into a real buffer, and the proof is the program's own output.
No service is involved, and none is stubbed.
charlybinary is builtor installed here, so there is nothing to stamp. The one binary the gate ran
(
charly task cue-gen) is the worktree-local, CalVer-stamped build from opencharly/charly'sown worktree, never a shared install.
disposable: truebed, so the gate is the one itsAGENTS.mdnames —go build ./...,go test ./..., gofmt, golangci-lint andcharly task cue-gen— and all of it ran onthe committed tree with zero warnings. The end-to-end proof that this fix makes a REAL bed
GREEN is the consumer leg of the producer-first chain (charly's
specpin bump, then thecheck-docsbed), and it is that leg's job to carry it.Change classification
A bug fix in a library: the report format's producer now guarantees the shape the format's
consumers parse. It removes nothing that was usable and adds no new surface beyond one
exported helper, so no cutover machinery applies — the report's contract is unchanged in
NAME and in FIELD, and only the shape of a rendered step's text is corrected, to the shape
the readers already require. The gate is this module's own; the merge gate is the org-wide
charly/pr-validator.Filed issues
None filed by this change — every finding it raised is fixed in it. The consumer-side
consequence is tracked where it lives: opencharly/layer-docs-site#13 (whose
check-docsbedSKIPs until this fix reaches the binary) and opencharly/plugin-check#135 (the report format
is a contract, and the verdict reader parses it as TEXT).
Agent: charly
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)