Repository navigation
fix(pins): the wave body fails loud when the shared pin-contract definition is missing - #667
Conversation
…finition is missing The wave body sourced scripts/pin-contract-inputs.sh BEFORE `set -euo pipefail` was in force, so a missing shared file failed the source silently and the coverage decision then read an undefined `pin_contract_touches_input` as "no". The body reported "the pin check is NOT this diff's coverage" as a FACT and exited 0 — a body whose whole job is to state what covers the diff, deciding by accident. The commit gate (hooks/pre-commit-gate.sh) already carries the explicit existence guard for the same shared file; the body now carries the same guard, BEFORE the source, so a reader cannot mistake a failed source for a decision. The self-test arm that proves it runs a COPY of this script in a directory that has no shared file, in BODY mode with empty stdin (never --self-test: the copy's own self-test would re-enter the arm, and a self-referential arm is a hang, not a test), so the copy reaches the coverage decision where the fail-open lived. The discriminator is the fail-open SIGNATURE, not an exit code: the arm asserts that "command not found" and the "NOT offered as this diff" claim are both ABSENT, and that the loud failure says the body cannot decide. The positive control re-runs the same copy WITH the shared file and requires it to reach a coverage decision, so the arm cannot pass by failing everything. Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). The engine classified the run ITSELF, and its terminal line is quoted below. For a marker this workflow has no bespoke narrative for, the gate does not re-derive a cause from a signature: the engine's own line IS the diagnosis, and the instruction that line carries (every engine class names the knob to change) is the remedy. A signature heuristic must never overwrite what the engine stated. Measured in this run (the engine's own lines): Durable remedy.
Thread policy. A thread gets up to A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
… pushed The `charly/pr-validator` found, on this branch's own PR, a body whose pasted grep sweep was taken on ANOTHER tree: the body pasted `scripts/sync-pin-evidence.sh:290:` together with that line's text, and on the head being pushed line 290 read `guard_rc=0`. The gate's H, T and N arms all accept that, because a stale paste is well-formed — they judge the body's FORM and the diff's arithmetic, and never whether a pasted OUTPUT LINE is the tree's own text. A body could therefore state a fact about the tree that no run of any command had established. Arm E closes that class. Every fenced output line of the shape `path:NN:text` must resolve in the tree being pushed: the file must exist there, the line must exist in it, and the pasted text must be the text of that line. It is scoped to fenced blocks and never to prose — a prose quote may name a line that has since moved, and that is a judgement, not a mechanical fact — and a block that names another tree explicitly (`git show <blob>`, `git -C <dir>`) is the documented escape, so a historical quote has a way to say so. Two new self-test arms prove the arm can fail: a reference to a line the file does not have, and a reference whose text is not the tree's. Both are RED on the mutation and the fixture body stays GREEN, so the arm cannot pass by failing everything. The same round fixes a leak this change introduced. The missing-shared-file guard's scratch was removed only at the END of the arm, and `fail` EXITS, so every failing run left its scratch behind — and one of the ways that arm fails is a full filesystem, so the leak amplified the very condition it reported. Measured on 2026-10-24: the host's /tmp (a tmpfs with nr_inodes=1048576) ran out of inodes while the arm was running, the arm's positive control failed with "No space left on device", and the arm's own scratch was left behind. One `scratch` helper now creates and registers every temporary path this script makes — the guard's scratch, the fixture repository, the rows file — and ONE trap removes every registered path on every exit path, so registering a second scratch can never unregister the first. A new self-test arm registers a scratch in a subshell that exits non-zero and asserts the scratch is gone afterwards: remove the helper's trap and the arm goes RED, because the guard would then leak its scratch on every failure too. Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
Review — PASSI re-derived every claim in the body against the three diffs, the two commits, and the (empty) comment thread. No comments exist, so no maintainer sign-off is available or needed — the change stands on its own evidence. What the diff actually does (vs. what the body claims)1. Fail-loud guard in
2. Body gate
3. Scratch leak.
4. Arithmetic / honesty
Minor, non-blocking observations
VerdictThe change does what the body claims, ships tests that would fail without it (all three mutants are real discriminators per the diff), is coherent and free of leftover paths, introduces no security or dependency risk, and the body's evidence is internally consistent with the tree. No comments require disposition. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS Agent: charly This round is landed. Head The RCA the round's INCONCLUSIVE required. The first run's verdict was never
Every finding raised on this PR was fixed in it, none filed away.
Filed, and still open: #666 and #668 Next update due: the corpus half of the same finding lands in Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated) |
Summary
Three findings, one story: a check must not report what it has not verified, and it must
not leave behind what it created. The wave body published a coverage decision it never
made; this PR's own body published a sweep it had never run; and the guard that closes the
first defect leaked its own scratch every time it failed. All three are fixed here, and all
three are measured.
One — the wave body failed OPEN (the observation the validator raised on #664).
set -euo pipefailsat afterscripts/sync-pin-evidence.shsourcedscripts/pin-contract-inputs.sh, and — unlike the commit gate — the body carried noexistence guard, so a missing shared file would not fail loud. Measured on the merged
tree of #664 (squash
c717835), in a scratch copy with the shared file absent:stderr:
stdout — the coverage decision the body published, as a FACT:
exit status: 0. The source failed silently (no
set -ewas in force yet), theundefined function answered "no" inside an
ifcondition (a non-zero status there is afalse test, not an error), and the body published a decision it never made. A body whose
whole job is to state what covers a diff must not claim what it cannot decide.
The fix. The body takes the commit gate's own shape —
hooks/pre-commit-gate.sh:77already guards the same shared file — and nothing else:
set -euo pipefailfirst, thenan explicit existence guard that names the missing file, before the source. The two
readers of the one shared definition are now guarded the same way.
The coverage. A new self-test arm runs a COPY of the body in a directory with no
shared file, in body mode with empty stdin — never
--self-test, because the copy'sown self-test would re-enter the arm, and a self-referential arm is a hang, not a test.
The discriminator is the fail-open signature, not an exit code: the arm asserts that
command not foundand theNOT offered as this diffclaim are both absent, and thatthe loud failure says the body cannot decide. The positive control re-runs the same copy
with the shared file and requires it to reach a coverage decision, so the arm cannot
pass by failing everything.
Two — this PR's own body published a sweep it had never run.
The validator's run on this PR came back
INCONCLUSIVE— an engine class, filed asopencharly/plugin-review#47 (below). Its reasoning carried one real finding, and it
was against this body: the pasted
git grepsweep was taken on another tree. The bodypasted
scripts/sync-pin-evidence.sh:290:with that line's text, and on the head beingpushed line 290 read
guard_rc=0; and the body claimed the phrase survived "in exactlyone place" when the tree carries it on three lines. The finding is mine, it is fixed, and
it is not filed away.
The RCA. Mechanism: the sweep in the body was written by hand from an earlier draft
of the arm, not pasted from a run against the head being pushed, so it described a tree
that no longer existed. Missed control: the umbrella's own body gate
(
scripts/check-pr-body-diff.mjs) judges the body's form and the diff's arithmetic —the file table (T), the pasted head (H), the counts (N) — and never whether a pasted
output line is the tree's own text. A stale paste is well-formed, so H, T and N all
accept it; the body's evidence was never checked against the tree it claims to describe.
Blast radius: the body is the changelog (R7) — the artifact the reader trusts, and the
one the validator reads. A body could state a fact about the tree that no run of any
command had established, and both gates would pass it. Root fix: a new arm (E) in
that gate — every fenced output line of the shape
path:NN:textmust resolve in the treebeing pushed: the file must exist there, the line must exist in it, and the pasted text
must be the text of that line. It is scoped to fenced blocks and never to prose (a prose
quote may name a line that has since moved, and that is a judgement, not a mechanical
fact), and a block that names another tree explicitly (
git show <blob>,git -C <dir>)is the documented escape.
Three — the guard this PR adds leaked its own scratch every time it failed.
The missing-shared-file guard's scratch was removed at the END of the arm, and
failEXITS — so every failing run left the scratch behind. That is not cosmetic: one of the
ways that arm fails is a full filesystem, so a leaked scratch amplifies the very
condition it reports. Measured on 2026-10-24: the host's
/tmp(a tmpfs withnr_inodes=1048576) ran out of inodes while the arm was running; the arm's positivecontrol failed with
cp: cannot create regular file ...: No space left on device; the armreported it, and the arm's own scratch was left behind.
The fix. One
scratchhelper now creates and registers every temporary path thisscript makes — the guard's scratch, the fixture repository, the rows file — and ONE trap
removes every registered path on every exit path, so registering a second scratch can
never unregister the first. A new self-test arm registers a scratch in a subshell that
exits non-zero and asserts the scratch is gone afterwards: remove the helper's trap and
that arm goes RED, because the guard would then leak its scratch on every failure too.
The same class, in the same PR, in the same direction: the wave body reported a decision
it had not made, this body reported an observation it had not made, and the fix for the
first left a scratch behind every time it failed. One is fixed in the shipped builder, one
in the gate that guards the builder's evidence, and one in the builder's own temporary
state.
The third file closes the same gap in the umbrella's own description of that gate:
charly.ymlenumerates the arms the reconciliation gate's self-test proves, and theenumeration would otherwise leave the new arm — and the count arm that predates it —
unmentioned, so the step's own text would under-describe the product it runs.
scripts/sync-pin-evidence.shscratchhelper that removes every temporary path the script makes on every exit pathscripts/check-pr-body-diff.mjscharly.ymlCloses #665.
How tested
The head this body describes — the committed tree the evidence below was taken on:
The change-class gate, on the committed tree this body describes — the umbrella's own
verifytask, which is what owns this change class (the diff touches the manifestcharly.yml, a commit-carried input of the pin contract, and moves no gitlink):33 steps, 0 failed, 0 warnings — no step reported a warning, and the two steps that
cover the changed scripts both ran and passed:
The first is the body gate's own discriminating fixtures (
charly.yml:534); the second isthe umbrella's committed builders' self-tests (
charly.yml:537), which run the builderthis PR changes.
The changed paths, live, on their own.
The builder:
The body gate:
The R7 discriminators — three, one per finding. Each is the SAME tree mutated, run in a
scratch copy, so the mutation is the only difference between the two runs.
One — the fail-open is RED without the fix. Mutated back to the OLD shape: the existence
guard removed, and
set -euo pipefailmoved back to after the source. The scratch copyalso carries the shared definition, so the mutation — not a missing neighbour — is what the
run measures:
The mutated copy exits 0 and publishes the
NOT offered as this diffclaim — exactly whatthe new arm refuses to let a body do.
Two — the leak is RED without the fix. One line removed: the helper's trap, the ONE line
that makes every registered scratch disappear on every exit path.
Three — the body gate is RED on the very stale paste the validator found. The proof is
the last block of this section, because it is the arm this PR adds.
The R5 claim-keyed sweep — the shared definition's readers, named by their own token,
against the whole tree, so every surviving hit is classified rather than assumed away:
Every hit is classified: the
CHANGELOG/hits are history (this repo keeps history only inCHANGELOG/), thescripts/check-pre-commit-gate.mjshits are the FIXTURE that copies thedefinition into its scratch repo and mutates the source path to prove the gate fires, and
the two shell hits are the two readers —
hooks/pre-commit-gate.sh(which alreadyguarded the file) and
scripts/sync-pin-evidence.sh(which now guards it). There is nothird reader.
The fail-open's own code is gone from the tree. The phrase survives only where it must:
inside the arm that asserts the fail-open cannot come back, and in two
CHANGELOG/historyentries — this repo keeps history in
CHANGELOG/and nowhere else. Measured over thewhole tree on the head being pushed:
Every hit is classified: the two
CHANGELOG/hits are history, and the threescripts/sync-pin-evidence.shhits are all inside the self-test arm — the comment thatnames the signature, the assertion that it must be absent, and the failure message that
says so. The thing that produced the false "the pin check is NOT offered as this diff's
coverage" — the unguarded source — is gone.
The worktree-local binary (R9 — binary equals source), never a shared install:
The R7 discriminator for the new arm — the gate now catches the very paste the
validator found. The body this section lives in, with exactly ONE line changed: the R5
sweep's line number moved from the
310the tree carries to a331that carriesdifferent text. That is the defect, reproduced.
The mutated body is RED on the arm that names the defect, and the body as published is
GREEN. The same stale paste went through H, T and N unchallenged before this arm existed —
and the pre-push hook runs this very gate against the body being pushed, so the arm is
live on this push and not only in its fixtures.
Rulebook compliance
/charly-internals:git-workflowwas read in full before the first git orghaction; the umbrella's own
AGENTS.mddispatcher row for git/ghwork selected it, andno other row's trigger applies to a change inside one shell script and one gate script.
finding against this body (a pasted sweep taken on another tree) is fixed by the E
arm in the gate, with its discriminator pasted above. The INCONCLUSIVE verdict is an
engine class, not a code finding: it is escalated as pr-validator: a review whose answer omits the
Verdict:line is DISCARDED whole, so a real finding never reaches the PR plugin-review#47(below), with the engine's own reason for discarding the review. The leak this change
introduced is fixed here, with its own discriminator. The two findings that are
genuinely separable — a removed gitlink rendering a comparison row against the
remote, and the umbrella's
scripts/design-selftest.shleaking a full umbrella copy onevery failing run — are filed as the sync PR body emits a comparison row for a REMOVED gitlink — the removed pin is compared against the remote and can be flagged as a divergence #666 and
design-selftest.sh leaks a full umbrella copy on every failing run — one copy is 9.9 GB and 28% of the host's /tmp inode budget #668, each with its measurement. Every RCA here names the
mechanism, the missed control, the blast radius and the root fix.
rather than inventing a second shape, and the shared rule still lives in exactly one
file (
scripts/pin-contract-inputs.sh). The sweep above proves there is no third reader.The scratch helper is one helper with one trap, not one cleanup per call site.
and not a suppressed error; the leak is removed by a trap on the exit path, not by a
retry, a sleep or a periodic sweeper.
builder, so the builder is what changed. No documented command needed a workaround to
work around it, and the umbrella's own prose was not edited to describe the defect away.
command not foundsurvives only inside the arm that asserts it must stay absent — its comment, its
assertion and its failure message, three lines in the new self-test — plus two
CHANGELOG/history entries, as the sweep above shows. The shared definition has exactlytwo readers, and the sweep shows them.
git statuswas clean before the branch switch and is clean now; the difftouches exactly the three files its table names, and nothing else; no history is
rewritten, nothing is force-pushed, and no hook is bypassed. This round appends one
commit to the branch; the commit before it is untouched.
mutant is RED, the trap-removal mutant is RED, and the body gate's new E arm is RED
on the very stale paste the validator found (the proof is at the end of How tested).
Both changed paths executed live, standalone and inside the gate.
contract's readers are real files in the real tree, and the gate ran against the real
index of the real worktree.
(
2026.297.0121, printed above); no shared install was used, and the diff adds noruntime OS dependency, so
packaging:is untouched.passed with zero warnings: 33 steps, 0 failed, 0 warnings,
VERIFY_EXIT=0.Change classification
Two umbrella-native scripts and the manifest's own step description — the sync PR
body's builder (
scripts/sync-pin-evidence.sh), the umbrella's own body gate(
scripts/check-pr-body-diff.mjs), and thecharly.ymlstep that describes the gate'sself-test.
manifest's
pins:block not at all —charly.ymlis a commit-carried input of thepin contract, and this diff changes only a step's
check:description, so the pincheck's own change class fires (and passes) without any pin moving.
charly task verifyis the gate that owns this class.
no file is deleted.
./charly/bin/charly task verifyon the committed tree — 33 steps, 0 failed,VERIFY_EXIT=0, no warning — plus both changed scripts executed live(
bash scripts/sync-pin-evidence.sh --self-testandnode scripts/check-pr-body-diff.mjs --self-test, standalone and inside the gate).fully tested and validated— the class gate passed on the finaltree and the changed paths ran live.
leg does not apply, and nothing here can change a pin.
Filed issues
Verdict:line is DISCARDED whole, so a real finding never reaches the PR plugin-review#47 — theINCONCLUSIVEthis PR's validator run produced isan engine class, and it is escalated, not fixed in this diff. The engine's answer
(3876 bytes,
finish_reason="stop", 29067 of 393216 tokens spent) carried noVerdict:line, soplugin-review'sverdictExitreturned 1 — and becauseEmitrunsonly after the verdict validates, the whole review was discarded:
review.txtandreview.untrusted.txtare both absent from the evidence artifact and the PR commentsays "no code finding" while the finding is legible in the debug log's reasoning. The
prompt is not the defect (
opencharly/action-review'scharly.yml:517,528,548demandsthe closing
Verdict:line). The remedy belongs to that repo, and a change to theverdict contract falls under the T4 security-machinery check, so it needs a
maintainer-account sign-off I will not author.
gitlink: the removed pin's sha is compared against the remote's default-branch HEAD and
can be flagged
!, so a removal and a divergence are indistinguishable in the table.The classification is correct (measured:
is_gitlink_pathreads the index first andfalls back to
git ls-tree HEAD, so a removed gitlink resolves to mode160000and ISclassified as a gitlink) — the defect is the value, and it is a separate mechanism
from this change's fail-open, so it is filed rather than folded in.
scripts/design-selftest.shcopies the whole umbrellainto a temporary directory and removes it only on the success path: under
set -euo pipefailany failure before itsrm -rf "$copy"leaves the copy behind, andno trap holds the removal on the failure path. Measured on this host:
/tmpis a tmpfswith 1 048 576 inodes and 62 G of RAM, the umbrella carries 298 262 files, so one copy
is 28 % of the inode budget and ~9.9 GB of RAM; when the budget runs out, every command
on the host that needs to create a file fails with
ENOSPC— which is what stalled thissession earlier today. A leaked copy (75 174 files, 10 299 320 KiB, incomplete, nothing
holding it) was found, measured and reclaimed, freeing 108 562 inodes and 10.3 GB of
RAM. It is a different file and a different mechanism from this change, and it is in
active use by another session in this checkout, so it is filed with its measurement
rather than folded in; the claim on it names the fix it covers.
Agent: charly
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)