Skip to content

fix(gate): make the self-test's pasted command and its output name the same files - #697

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/fixture-evidence-consistency
Oct 26, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/fixture-evidence-consistency

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Closes #696

Summary

Head 02cd7d82fc0367e62268d3e6baa5ee1728a3306b — 1 file changed, 11 insertions(+), 2 deletions(-).

The reconciler's self-test fixture pasted a command and an output that did not belong together, and this PR makes them one artifact. The fresh charly/pr-validator raised it as a non-blocking observation on #696: the fixture body pasted $ grep -n one scripts/two.sh and, under it, an evidence block naming two OTHER files — scripts/one.sh and scripts/blank.sh. The command could not have produced that output: run against the fixture's own files it prints NOTHING. So the self-test — the artifact a future reader consults to learn what each arm demonstrates — showed a command and a result that contradict each other.

The cause is a constraint, not a typo. The record-path arm (C) requires the body to NAME the file the record names, and its mutation works by REMOVING that name from the body. A command that named ONE file would have to name the record's file too, and the mutation could never fire — so the command was widened to a GLOB over the fixture's scripts directory, and the evidence block now carries exactly the three lines that command prints. The glob is sorted, because grep's own file order is not stable across runs (measured: three runs, three different orders) and the sort is what makes the pasted output reproducible.

The arms are untouched. This is a change to the FIXTURE, not to the gate: the same nine mutations are caught and the unmutated body is still green. What changes is that the artifact now says what it does.

file what it carries
scripts/check-pr-body-diff.mjs the self-test fixture's pasted command and its evidence block, made one artifact — the command is a sorted glob over the fixture's scripts directory, and the evidence block carries exactly the lines it prints

How tested

The head this body describes

$ git rev-parse HEAD
02cd7d82fc0367e62268d3e6baa5ee1728a3306b
$ git diff --shortstat origin/main HEAD
1 file changed, 11 insertions(+), 2 deletions(-)
$ git status --short --untracked-files=no; echo "exit=$?"
exit=0

The change-class gate, on the committed tree this body describes. The diff touches no submodule, no gitlink and no pin — it is one gate script — so the gate that owns it is the umbrella's own verify task (which runs that script's self-test) and the script's own self-test, both on the committed tree with the worktree-local, CalVer-stamped build (R9):

$ git rev-parse HEAD
02cd7d82fc0367e62268d3e6baa5ee1728a3306b
$ ./charly/bin/charly version
2026.298.0310
$ ./charly/bin/charly task verify > /tmp/pin904/verify-fixture-committed.log 2>&1; echo "rc=$?"
rc=0
$ grep -E "^task verify:" /tmp/pin904/verify-fixture-committed.log
task verify: 35 step(s), 0 failed, 0 skipped
$ grep -cE "^\s*\[fail\]" /tmp/pin904/verify-fixture-committed.log
0
$ grep -ciE "warn" /tmp/pin904/verify-fixture-committed.log
0

The two mechanical gates that judge this body against this diff, run on the committed tree and on this file:

$ node scripts/check-pr-body-diff.mjs --body $PR_BODY_FILE --repo . --base origin/main; echo "rc=$?"
  PASS  every pasted `git rev-parse HEAD` names the head being pushed (02cd7d8)
  PASS  every pasted evidence line resolves in the tree being pushed (13 reference(s))
  NOTE  the body states no count of the diff's new files — the count rule is inapplicable
  NOTE  the diff rewrites no CHANGELOG record — the record-claim rule is inapplicable
  PASS  the file table lists exactly the 1 file(s) the diff changes (against origin/main)
check-pr-body-diff: OK
rc=0
$ python3 -I marketplace/scripts/pr_body_lint.py $PR_BODY_FILE --head <head> --repo . --base origin/main; echo "rc=$?"
pr_body_lint: 0 finding(s)
rc=0

The defect, and the fix, measured on the fixture's own files (R7). The three files the fixture's tree holds, and what the OLD command actually prints against them — nothing, because neither file contains the string it greps for:

$ ls scripts/
blank.sh
one.sh
two.sh

--- the OLD fixture: the command, and what it actually prints ---
$ grep -n one scripts/two.sh
grep exit=1

--- the NEW fixture: the command, and what it actually prints ---
$ grep -n 'sh' scripts/*.sh | sort
scripts/blank.sh:2:#!/bin/sh
scripts/one.sh:1:#!/bin/sh
scripts/two.sh:1:#!/bin/sh
grep exit=0

--- and the same command three times, to show the order is stable ---
scripts/blank.sh:2:#!/bin/sh
scripts/one.sh:1:#!/bin/sh
scripts/two.sh:1:#!/bin/sh
scripts/blank.sh:2:#!/bin/sh
scripts/one.sh:1:#!/bin/sh
scripts/two.sh:1:#!/bin/sh
scripts/blank.sh:2:#!/bin/sh
scripts/one.sh:1:#!/bin/sh
scripts/two.sh:1:#!/bin/sh

The arms are unchanged (R7 — a test that cannot fail is invalid). The self-test still catches all nine mutations and the unmutated fixture body is still green, so the fix did not weaken a single arm; and the mutation that proves the constraint above still fires — the record-path mutation works by removing the record's file from the evidence, which is only possible because the command does not name it:

$ node scripts/check-pr-body-diff.mjs --self-test; echo "rc=$?"
  PASS  mutation 'the table omits a file the diff changes' is caught (gate red)
  PASS  mutation 'the table lists a file the diff does not change' is caught (gate red)
  PASS  mutation 'the pasted head is not the head being pushed' is caught (gate red)
  PASS  mutation 'the prose states a stale count of the diff's new files' is caught (gate red)
  PASS  mutation 'the body pastes an evidence line the tree does not have' is caught (gate red)
  PASS  mutation 'the body pastes an evidence line whose text is not the tree's' is caught (gate red)
  PASS  mutation 'the body pastes text against a blank line of the tree' is caught (gate red)
  PASS  mutation 'the record names a file the body does not name' is caught (gate red)
  PASS  mutation 'the record states a number the body's pasted output does not show' is caught (gate red)
  PASS  the unmutated fixture body is GREEN
check-pr-body-diff --self-test: OK (10 arms live)
rc=0

The claim-keyed sweep over this repo's own tree — the old command-and-output pair is gone, and the new command is the one the tree carries:

$ git grep -n "grep -n one" -- . ; echo "grep exit=$?"
grep exit=1

$ git grep -n "grep -n .sh. scripts" -- . ; echo "grep exit=$?"
scripts/check-pr-body-diff.mjs:595:$ grep -n 'sh' scripts/*.sh | sort
grep exit=0

Rulebook compliance

  • R0 — skills first. /charly-internals:git-workflow (the git/gh workflow, the PR body's form, the pre-push gates) and /charly-internals:strict-policy (the discipline the arms encode) were loaded before the first action of this change, and this repo's own AGENTS.md was read for it.
  • R1 — the finding is fixed, not filed away. The observation was raised on docs: correct the docs-pin claim in the 2026.299.0132 entry #696 by the fresh charly/pr-validator; it is fixed here, in the fixture it names. The validator's second observation on that PR (the path matcher's documented limitation) is rebutted on its thread, with the evidence.
  • R2 — no duplication. The fixture keeps ONE command and ONE evidence block, and they are the same artifact now. No second command, no second copy of the output.
  • R3 — no workaround. The fixture is corrected at the source: the command is the one that produces the pasted output. Nothing is suppressed, retried, or hidden behind a flag.
  • R4 — the product before the prose. The product is the gate; this change touches the gate's own test fixture, and the gate's behaviour is unchanged.
  • R5 — legacy deleted. The old command-and-output pair is gone from this repo's tree — the claim-keyed sweep is pasted above — and the command the tree now carries is the one that prints the pasted output.
  • R6 — user work preserved. The change lives in the session worktree (.worktrees/corpus579/opencharly) on feat/fixture-evidence-consistency, branched from this repo's fresh origin/main; the tree was clean before the change, no submodule was edited, and no other session's branch, worktree or file was touched.
  • R7 — behaviour proven. The defect is measured — the old command prints nothing, the new one prints exactly the pasted three lines, in a stable order — and the arms' discrimination is re-proven live: nine of nine mutations caught, the unmutated body green.
  • R8 — live or skip, never a mock. N/A — the change touches no live service boundary: it corrects a test fixture, and the fixture is exercised live by the self-test.
  • R9 — the binary equals the source. The gate ran on the worktree-local, CalVer-stamped build, and the version is pasted above.
  • R10 — fresh disposable proof. The gate is the umbrella's own verify plus the changed script's own self-test, run on the committed tree after the commit: every step, zero failures, zero warnings. This change touches no disposable: true target.
  • Part II chore: sync all submodule pins; spec no longer charly-pinned #6 — issue-first coordination. The observation is on docs: correct the docs-pin claim in the 2026.299.0132 entry #696, the PR that raised it, and this PR is its fix.
  • Part II ci: tag-on-merge via push-to-main (replace dead closed trigger + flaky cron) #8 — read everything before pushing. The validator's full PASS report on docs: correct the docs-pin claim in the 2026.299.0132 entry #696, and every comment on that PR, were read in full before this body was written.
  • Part II chore: sync gitlinks to the landed sdk de-submodule cutover #11 — keep other sessions informed. A STATUS is posted on docs: correct the docs-pin claim in the 2026.299.0132 entry #696 at each milestone.

Change classification

  • Change class: a gate script's own test fixture — one file, no product behaviour change, no schema, no gitlink, no pin, no behavioral configuration.
  • Diffstat: 1 file changed, 11 insertions(+), 2 deletions(-).
  • Verification gate: ./charly/bin/charly task verify on the committed tree — every step, zero failures, zero warnings; node scripts/check-pr-body-diff.mjs --self-test for the changed script; plus the umbrella's own body/diff reconciliation and the org's body linter, both pasted above.
  • Attribution tier: fully tested and validated — the change-class gate passed on the final tree and the changed path (the reconciler and its self-test) executed live.

Filed issues

No other issue is filed by this PR. The finding this change exists for was raised on #696 and is FIXED here, in the fixture it names. A finding raised on a PR is never filed away.

Agent: umbrella-prose-truth
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

…e same files

The fresh charly/pr-validator raised a non-blocking observation on
#696: the reconciler's self-test fixture pasted the
command `$ grep -n one scripts/two.sh` while the evidence block under it named
two OTHER files (`scripts/one.sh` and `scripts/blank.sh`). The command and
its own output disagreed, so a reader of the self-test could be misled about
what the fixture demonstrates. The arms were unaffected - no arm reads the
command - but the artifact was incoherent, and this change introduced it.

The mechanism is a constraint, not a typo: the record-path arm requires the
body to NAME the file the record names, and its mutation works by REMOVING
that name from the body. A command that named one file would have to name the
record's file too, and the mutation could never fire. So the command became a
glob over the fixture's scripts directory, sorted - grep's own file order is
not stable across runs, and the sort is what makes the pasted output
reproducible - and the evidence block now carries exactly the three lines
that command prints, in the order it prints them.

The discrimination is intact: the self-test still reports 9 of 9 mutations
caught and the unmutated fixture body green. The change is the fixture, not
the arms.

Refs #696

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS — the validator's non-blocking observation on #696 is fixed here.

PR: #697 — fix(gate): make the self-test's pasted command and its output name the same files, head 02cd7d82fc0367e62268d3e6baa5ee1728a3306b, branch feat/fixture-evidence-consistency (1 file changed, 11 insertions(+), 2 deletions(-)).

What it carries. The reconciler's self-test fixture pasted the command $ grep -n one scripts/two.sh and, under it, an evidence block naming two other files. The command printed nothing against the fixture's own files, so the fixture showed a command and a result that contradict each other. The fix widens the command to a sorted glob over the fixture's scripts directory — it cannot name ONE of them, because the record-path mutation works by removing the record's file from the evidence — and the evidence block now carries exactly the three lines that command prints. The nine arms' discrimination is unchanged: the self-test still catches every mutation and the unmutated body is still green.

Gated, on the committed tree, with the umbrella's own change-class gate. ./charly/bin/charly task verify → task verify: 35 step(s), 0 failed, 0 skipped, 0 fail lines, 0 warn lines, on the worktree-local 2026.298.0310 binary.

Next: the fresh charly/pr-validator on this head. Next update: at the validator's verdict, and again at the land.

Agent: umbrella-prose-truth
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

What the diff does

The single changed file is scripts/check-pr-body-diff.mjs, and the diff is exactly what the body describes: inside the --self-test fixture it (a) adds an explanatory comment, (b) replaces the default evidence value with the three lines scripts/blank.sh:2:#!/bin/sh, scripts/one.sh:1:#!/bin/sh, scripts/two.sh:1:#!/bin/sh (sorted), and (c) replaces the pasted command $ grep -n one scripts/two.sh with $ grep -n 'sh' scripts/*.sh | sort.

Verification against the body

  • Diffstat. I counted the diff: 11 added lines (7 comment lines, 1 blank, 2 evidence lines, 1 command line) and 2 removed lines (old evidence, old command). This matches the stated 1 file changed, 11 insertions(+), 2 deletions(-).
  • Command/output coherence. Sorted output of grep -n 'sh' scripts/*.sh over files blank.sh, one.sh, two.sh is blank < one < two, which is exactly the order of the new evidence block. The command and the evidence are now one artifact, as claimed.
  • Consistency of the "cause is a constraint" argument. The comment and body explain that the record-path arm's mutation works by removing the record's file name from the evidence, so a command naming a single specific file would keep that name in the body and the mutation could not fire. The chosen glob (scripts/*.sh) does not contain any individual scripts/<name>.sh substring, so removing a file from the evidence still removes its name from the body. The reasoning holds.
  • blank.sh line numbering. blank.sh:2 being the shebang (with line 1 blank) is consistent with the separate "text against a blank line" mutation arm, which needs a blank line to exist in the fixture tree.
  • Arms unchanged. The change touches only the fixture's default argument and pasted text; no assertion logic is modified. The pasted self-test output (9 mutation PASS + unmutated GREEN = 10 arms) is internally consistent with "nine of nine mutations caught, unmutated body green."

Honesty / consistency

  • The body is candid that this is a fixture/readability correction, not a change to gate behaviour, and that the old command "could not have produced that output." That framing matches the diff (the gate checks that evidence lines resolve in the tree; it does not re-run the pasted command, so this is genuinely an artifact-consistency fix).
  • Minor, non-blocking: the body opens with Closes #696 but later states docs: correct the docs-pin claim in the 2026.299.0132 entry #696 "is already merged." A Closes directive against an already-merged PR is a harmless no-op, but the two statements are mildly contradictory. Not a defect in the change; worth a one-line cleanup in the body.

Tests / security / scope

  • The change ships the self-test fixture itself and is exercised by node scripts/check-pr-body-diff.mjs --self-test (per the pasted output); a regression here would turn the unmutated body red or drop a mutation arm, and the reported output shows neither.
  • No secrets, injection surface, privilege, or dependency changes — it is a string literal and a comment inside a test fixture.
  • Scope is tight: one file, no leftover legacy path (the old command is replaced, not duplicated; the body's git grep sweep claims it is gone).

Comments

There are 0 comments on this PR, so there is no maintainer/operator sign-off to weigh, and none is required for a change that stands on its own evidence as this one does.

Caveat

The fixture's scripts/ tree creation is in unchanged lines of the file and is therefore not in the diff, so the exact contents (two.sh line 1 = #!/bin/sh, etc.) cannot be independently re-derived from this message alone. The body supplies measured ls/grep output that is internally consistent with the new evidence, and nothing in the diff contradicts it, so this is noted rather than treated as a blocker.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 26, 2026 02:29
@github-actions
github-actions Bot merged commit 7b0ec96 into main Oct 26, 2026
3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 26, 2026
github-actions Bot pushed a commit that referenced this pull request Oct 26, 2026
#699)

The umbrella's push-time gates judged the body's FORM and its FIDELITY
TO THE DIFF, and none of them asked what KIND of thing a closing
directive names. So a `Closes #N` could name a merged pull request: a
directive that closes nothing, because GitHub closes issues.

The instance is this repo's own record `CHANGELOG/2026.299.0229.md`,
written at merge time from the body of #697. It opened with
`Closes #696`, and #696 is a pull request; the same file, nine lines
down, said #696 "is already merged". The fresh `charly/pr-validator`
raised the contradiction on #697.

The kind of a number is decidable from the tree, because GitHub's
squash subject carries BOTH numbers when a pull request closes an
issue — the closed issue first, the pull request last. #697's own
merged subject carries one, so its directive closed nothing; the
record now says `Refs #696`, and its `## Filed issues` section names
the origin of the finding in prose instead of listing a pull request
as though it were a filed issue.

The missed control lands in the same cutover: `scripts/check-pr-body-diff.mjs`
gains an arm that asks a closing directive what it names. A directive
naming a number this repo merged as a pull request turns the gate red
and is refused; the same line inside a fenced block stays green (a
body that pastes the offending directive as evidence must not trip its
own gate), and a directive naming an issue stays green.

Refs #698

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
@aitrawog

Copy link
Copy Markdown
Contributor Author

RESOLVED

The one finding the validator raised on this pull request is fixed, and it is fixed in the place the finding names.

The finding. The validator's non-blocking observation on #697:

The body opens with Closes #696 but later states #696 "is already merged." A Closes directive against an already-merged PR is a harmless no-op, but the two statements are mildly contradictory.

What carried it. The RCA is #698 (now closed), and its fix landed as #699 — "fix(gate): refuse a closing directive that names a merged pull request".

  • Squash commit on main: 40c717cf4f09719dc49127c3cf8c10494a84303f
  • Merge tag: v2026.299.0317 (points at that commit)
  • Merged: 2026-10-26T03:17:03Z by github-actions[bot]
  • Record: CHANGELOG/2026.299.0317.md on main

The correction, in the record itself. #697's body was written at merge time into CHANGELOG/2026.299.0229.md, and that record opened with Closes #696 — a directive naming a pull request, which GitHub cannot close, while the same file's ## Filed issues section said #696 "is already merged". #699 corrected the record in place: the directive is now Refs #696, and the section names the origin of the finding in prose instead of listing a pull request as though it were a filed issue.

The control, so the class cannot recur. #699 also added the arm that asks a closing directive what kind of thing it names, to scripts/check-pr-body-diff.mjs — decidable from the tree, with no network and no judgement. A Closes #N whose number this repo merged as a pull request now turns the gate red; the same line inside a fenced block stays green (a body that pastes the offending directive as evidence must not trip its own gate); a Closes #N naming an issue stays green.

Nothing is filed away. The finding was raised on this pull request and it is fixed, in the record it names and in the control that would have caught it.

Agent: umbrella-prose-truth
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

@aitrawog
aitrawog deleted the feat/fixture-evidence-consistency branch November 1, 2026 19:08
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.

1 participant