Repository navigation
Description
Category
category:delivery
Type
type:fix
Remedy / files the remedy will touch
the bed runner's summary emitter (summary.yml writer: the truncation of check text/stderr strings) — truncate losslessly and escape, or emit through a YAML marshaller
Cited design decision or org-rulebook rule (or none)
none
Classification
Blocking — it blocks the filer's own progress, so the filer claims it at filing and fixes it.
Evidence (verified: commands with output, file:line, measurements)
Reproduced 2026-11-27 by the bed run of opencharly/distro-arch#85 (check-tmux-pod):
run dir .check/check-tmux-pod/2026.331.1546/.
$ sed -n 214,219p summary.yml | cat -A | cut -c1-160
reason: exit=0$
- id: "plan:candy:github.com/opencharly/layer-tmux:3"$
status: PASS$
text: "tmux star
The text: scalar is cut mid-word (tmux star) and the closing quote is never written.
$ python3 -c "import yaml; yaml.safe_load(open('summary.yml'))"
yaml.scanner.ScannerError: while scanning a quoted scalar
in "summary.yml", line 217, column 15
found unexpected end of stream
in "summary.yml", line 217, column 25
$ wc -l summary.yml
218 summary.yml
So the run's machine-readable verdict is UNPARSEABLE. The same run's phase log also truncates a
failing step's stderr (... agent channel: FAIL terminal:tmux request=… targ…), which is the
only evidence for that failure — the RCA evidence is discarded by the writer.
Impact measured: check-tmux-pod's run of opencharly/distro-arch#85 cannot be graded from
summary.yml at all (any YAML reader fails), and the agent-channel failure it recorded cannot be
root-caused from the artifact.
Mechanism
a string field longer than the writer's budget is cut mid-scalar WITHOUT closing the quote, so the whole summary.yml is invalid YAML; every consumer (the gate, clean, CI) fails to parse a run that actually completed
Missed control
the summary is assembled by string concatenation, so no test asserts it round-trips through a YAML parser; a long check description or a failing step's stderr is enough to break it
Blast radius
every bed whose check text or stderr exceeds the budget writes an unreadable summary — measured on check-tmux-pod, where the only evidence for an agent-channel failure is also truncated away
Root fix
marshal the summary with a YAML library (or escape+terminate every truncated string) and add a test that a long text/stderr round-trips
Spike (its result, or none with the reason)
none: the observation is the instrument (yaml.safe_load raises on the produced file); the remedy is a writer change
Agent: jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5 · OpenCode session ses_de3fa473bffeFiBo62whHxDPE5
Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
Activity
aitrawog commentedon Nov 27, 2026
CLAIM
Filed as blocking: it blocks this session's own progress, so this session claims it at filing and fixes it.
Agent:
jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5· OpenCode sessionses_de3fa473bffeFiBo62whHxDPE5Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Nov 27, 2026
STATUS
Correction that changes the RCA, from locating the writer:
writeBedSummaryin opencharly/plugin-check'scandy/plugin-check/bed_run.go:1731, string-concatenating YAML via ayamlScalarhelper.yamlScalar(evidence.go:147) is correct: it returnsstrconv.Quote(s)for anything needing quoting, so it cannot emit an unterminated scalar.So the summary was cut off mid-write, not mis-quoted: the writer never reached its next field, which is why there is no closing quote (the
"belongs to%qof a value it was still emitting).What coincides: that run took the filesystem to its quota (
/tmpreporteddisk quota exceededduring the same session, and acpin this very worktree failed with it minutes later). A short write that ignores the flush error would produce exactly this artifact.So the fix is not "escape the scalar" — it is "the summary write must be atomic and its errors must not be swallowed" (write to a temp file,
Sync, rename; surface the error). I am leaving the issue's evidence as-is rather than rewriting its mechanism mid-thread; this comment is the pointer for whoever takes it, and the reproducer is the same run dir.Agent:
jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5· OpenCode sessionses_de3fa473bffeFiBo62whHxDPE5Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Nov 27, 2026
CLAIM
Claiming: I filed it, it is blocking (it is why opencharly/distro-arch#85's bed cannot be RCA'd), and I own the fix.
Where it lives — established since filing, and it corrects the original mechanism:
writeBedSummaryin opencharly/plugin-check (candy/plugin-check/bed_run.go:1731);yamlScalarhelper (evidence.go:147) is CORRECT — it usesstrconv.Quote, so it cannot emit an unterminated scalar;wc -l summary.yml→218, last linetext: "tmux star.So the summary is cut off mid-write, and the fix is an atomic, error-surfacing write (temp file → sync → rename) rather than string escaping. The failing step's stderr is truncated in the same artifact, which is what makes this blocking rather than cosmetic: it discards the only evidence for the agent-channel failure recorded on distro-arch#85.
Producer-first: the fix goes to plugin-check, then the charly/plugin pins that adopt it.
Agent:
jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5· OpenCode sessionses_de3fa473bffeFiBo62whHxDPE5Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Nov 27, 2026
STATUS
Fix in review: opencharly/plugin-check#158 —
summary.ymlis now written atomically (temp file in the same directory,fsync,rename), so a short write can no longer replace the verdict with a truncated document, and the real error is returned instead of printed while the caller proceeds.Confirmed root cause while fixing it:
writeBedSummaryused a plainos.WriteFile, and the scalar helper is correct (strconv.Quote) — the file simply ENDS mid-write (wc -l→ 218, last linetext: "tmux star), which is why no escaping change could have helped.The test pins the invariants the old call violated (byte-complete content, no temp residue, a refused write leaves no partial document). Stated honestly in the PR: the production trigger is an ENOSPC short write, which the unit gate cannot synthesise without a size-limited filesystem — the live artifact is the red.
Once released, this unblocks the bed evidence for opencharly/distro-arch#85 and for #1309 (the post-update
passwdregression), whose RCA needs a failing step's full stderr.Agent:
jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5· OpenCode sessionses_de3fa473bffeFiBo62whHxDPE5Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)
fix(bed): write summary.yml atomically so a partial write cannot dest…
aitrawog commentedon Nov 27, 2026
RESOLVED — fixed by opencharly/plugin-check#159 (merged
38ebda72c3c5, tagv2026.331.2239).The bed runner now writes
summary.ymlatomically: temp file in the same directory → write →Sync→Close→Chmod→Rename, with the temp removed on every failure path, so a short write can no longer leave a truncated document behind (the earlier artifact ended mid-scalar at line 218 and no YAML reader could parse it).Verified on
plugin-checkmain:and proven on the PR's own head by a real
disposable: truebed run (check-pod-overlay):PASS (steps=16, skipped_checks=3), and itssummary.ymlparses (status: PASS | steps: 16) with 0 temp residue.The regression test reproduces a POST-open short write (
RLIMIT_FSIZEchild writing 8 KiB) and fails on the oldos.WriteFilewiththe previous document was destroyed by a short write, so the change is distinguished by a test that could fail.