Skip to content

fix(gate): the gate checks the classification it prints, and the record names it (#767) - #769

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/gate-checks-its-own-report
Oct 28, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/gate-checks-its-own-report

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Closes #767

Summary

Head ddcf6adfcbc6abe19ddaf505b34192d4cc99c77d — the commit this PR pushes: 2 files changed, 92 insertions(+), 13 deletions(-)

This is the successor to #768, which merged as 2201665 at 07:00:17Z. The validator's PASS on that PR armed auto-merge, and the merge landed its head before this round's fix could be pushed — so two of that review's findings are NOT in the merge. Both are findings raised on my own PR, and R1 requires them fixed rather than filed away, so they ride here, on a branch based on the current main, and this PR closes #767.

The two findings, and what each one gets:

  • The record's phrase was loose. It read "the nine claim-maker files and their surface counts" — the gate prints the file list and the aggregate surface count, not a count per file. The record now names what the gate prints: the nine files, and the surface count printed beside them.
  • The new reporting had no test asserting it. The gate now reads its OWN printed text and compares each reported count with the list beside it BEFORE publishing it, and the self-test proves the check is live by mutating each reported line so its count disagrees with its list.
file what it carries
CHANGELOG/2026.301.0644.md the record's phrase corrected to name what the gate prints, and the sentence that the report is checked before it is published
scripts/check-pin-verb-scope.mjs the report built by one function, the reader that compares each reported count with the list beside it, and the self-test case that proves the check is live

Why the check belongs at the gate, and not in a body. The report is a MEASUREMENT that a body pastes, so the count beside a list is the very thing a reader checks by eye — and a hand-made number beside a tool-made one is the defect this whole change exists to kill. The gate now reads its own printed TEXT, which is the boundary the measurement is published at, and compares the two numbers the reader sees. A disagreement turns the gate red, so a measurement that disagrees with its list never reaches a reader.

How tested

The head this body describes, and the tree it is on

$ git rev-parse HEAD
ddcf6adfcbc6abe19ddaf505b34192d4cc99c77d
$ git diff --shortstat origin/main...HEAD
 2 files changed, 92 insertions(+), 13 deletions(-)
$ git status --short --untracked-files=no; echo "exit=$?"
exit=0
$ ./charly/bin/charly version
2026.300.1843

The diffstat is the same under every diff algorithm — a count a body pastes must not depend on which reader renders the diff, so the report's lines stay where the shipped report was instead of moving up the file:

$ for alg in myers patience histogram minimal; do printf '%s: ' "$alg"; git diff --shortstat --diff-algorithm=$alg origin/main...HEAD; done
myers: 2 files changed, 92 insertions(+), 13 deletions(-)
patience: 2 files changed, 92 insertions(+), 13 deletions(-)
histogram: 2 files changed, 92 insertions(+), 13 deletions(-)
minimal: 2 files changed, 92 insertions(+), 13 deletions(-)

The claim-keyed sweep: the retired count survives nowhere that makes a current claim. The only occurrences left are in CHANGELOG/2026.301.0700.md — the record of what happened when #768 merged, which quotes the old count to explain the correction. The repo's own retired-claim gate exempts that directory for exactly that reason ("CHANGELOG/ — a past release's gate output is HISTORY, not a current claim"), and it is green below.

$ git grep -c "across 8 files" -- . ':!CHANGELOG/' ; echo "exit=$?"
exit=1
$ git grep -n "across 8 files" -- . ':!CHANGELOG/' ; echo "exit=$?"
exit=1
$ git grep -n "nine prose surfaces" -- . ':!CHANGELOG/' ; echo "exit=$?"
exit=1
$ git grep -l "nine prose surfaces" -- .
CHANGELOG/2026.301.0700.md
$ grep -c "across 9 files" CHANGELOG/2026.301.0644.md
1

The gate's own assertions are live — the self-test mutates each one and the gate turns red, and it ends green on a truthful rewording:

$ node scripts/check-pin-verb-scope.mjs --self-test | tail -4
  PASS  the coverage claim is live — a new file naming the verb turns the gate RED
  PASS  negative control — a truthful rewording that keeps the scope stays GREEN
  PASS  the classification the gate prints is self-consistent — a count that disagrees with the list beside it turns the gate RED
check-pin-verb-scope --self-test: OK (every assertion is live)

The new check is live at the boundary the measurement is published at — a reported count that disagrees with the list beside it turns the gate red:

$ sed 's|claim-maker file(s) (${claimMakerFiles.length}|claim-maker file(s) (${claimMakerFiles.length + 1}|' scripts/check-pin-verb-scope.mjs > /tmp/769/gate-mutant.mjs
$ node /tmp/769/gate-mutant.mjs --root . ; echo "exit=$?"
check-pin-verb-scope: OK — 18 claim-maker surface(s) state the pin-advance verb's scope, and every file naming the verb is classified
  FAIL  the reported count 10 disagrees with the 9 file(s) it lists: claim-maker file(s) (10, carrying 18 surface(s)): .agents/skills/agents/SKILL.md, .agents/skills/git-workflow/SKILL.md, .agents/skills/git-workflow/references/branch-and-pr-loop.md, .agents/skills/git-workflow/references/pin-intent-and-currency.md, .agents/skills/git-workflow/references/umbrella-mechanics.md, .agents/skills/repo-setup/SKILL.md, AGENTS.md, README.md, charly.yml
check-pin-verb-scope: 1 finding(s) in the classification it reports
exit=1

The retired-claim class still holds — the sibling gate that forbids the retired wording is green on the same tree, and it exempts CHANGELOG/ as history:

$ node scripts/check-retired-claims.mjs
  PASS  no retired claim form survives in the umbrella's own tracked tree (11 class(es))

The umbrella's change-class gate, on the committed tree — ./charly/bin/charly task verify, its whole output in /tmp/769/verify.log:

$ grep -E "^task verify:" /tmp/769/verify.log
task verify: 46 step(s), 0 failed, 0 skipped
$ grep -cE "^\s*\[fail\]" /tmp/769/verify.log
0
$ grep -ciE "warn" /tmp/769/verify.log
0
$ grep -E "pin-advance verb states its SCOPE|pin-verb-scope" /tmp/769/verify.log
  [pass] check — every surface that presents the pin-advance verb states its SCOPE — it advances EVERY pin the repo declares — and every tracked file naming the verb is classified (opencharly/opencharly#501)
  [pass] check — the pin-verb-scope gate discriminates — dropping any surface's scope turns it RED, a moved surface turns it RED, a new file naming the verb turns it RED, and a truthful rewording that keeps the scope stays GREEN (fixtures)
$ tail -1 /tmp/769/verify.log
VERIFY_EXIT=0

Rulebook compliance

  • R0: /charly-internals:git-workflow and /charly-internals:strict-policy were loaded before the first tool action of this change; /charly-internals:root-cause-analyzer for the RCA it answers. No new skill family is touched.
  • R1: the two findings the validator raised on this change's own PR are fixed here, not filed away — a finding raised on your own PR is fixed or rebutted on the thread with evidence, and there is no rebuttal to offer: both are true. The record's file count was itself a blocking finding, and its RCA — mechanism, missed control, blast radius, root fix — is on the 2026.301.0644 entry claims 18 claim-maker surfaces across 8 files — they live across 9 #767, with the root fix in the control as well as in the record. The merge of fix(record): the 2026.301.0644 entry's file count is tool-derived, and the gate now reports it #768 landed before this fix could be pushed; that is a fact of the sequence, not a reason to drop the fix, and the fix is what this PR carries.
  • R2: one gate, one job, one report. The report is built by ONE function, so the run and the self-test read the same lines; a second implementation of the report would be a second place for the number to drift, which is the defect class this change exists to kill.
  • R3: no workaround and no hand count: the number is the tool's own output, checked by the tool before it is published, so no future body can repeat this drift by typing it.
  • R4: the product is fixed before the prose. The gate is changed first, and the record's sentence describes what the gate does — it never carries a claim the tool does not make.
  • R5: the retired forms of the claim — "across 8 files" and "nine prose surfaces" — survive in no live surface; the only remaining occurrences are in CHANGELOG/2026.301.0700.md, the record of the merge that quoted the old count, and the repo's own retired-claim gate exempts that directory as history. The claim-keyed sweep is pasted above.
  • R6: git status was clean before each commit, the diff touches only the umbrella's own two files, no submodule was edited, the branch was created off fresh origin/main with its upstream removed so no push can reach main, and neither a force-push nor a hook bypass was used.
  • R7: the coverage is live: the gate's own self-test turns red when a scope is dropped, when a surface moves, when a new file names the verb, and when a reported count disagrees with the list beside it — and it stays green on a truthful rewording. The changed path executed live, in the gate runs pasted above. The diff this PR carries renders the same under every diff algorithm, so the diffstat this body states is the diffstat every reader sees.
  • R8: N/A — no live service boundary is crossed; the gates are static checks over the umbrella's own tracked tree.
  • R9: the worktree-local binary was used throughout, and its version is pasted above; no shared install is involved and no runtime dependency changed.
  • R10: the change-class gate ran on the committed tree this PR pushes, not on a working copy: charly task verify reports 46 steps, 0 failed, 0 skipped, with no warning line in its output.

Change classification

A gate's own report becomes self-checking, and the record that pastes it names it — no product-runtime change. The diff corrects one phrase in a shipped record, teaches the gate that made the claim to check the classification it prints before publishing it, and adds the self-test case that proves the check is live. It changes no Go source, no schema, no gitlink and no pin.

  • Change class: a prose change (one CHANGELOG/ record) plus a script change (scripts/check-pin-verb-scope.mjs). It is not the documentation-only class: a .mjs gate changed, so the documentation reviewed tier is forbidden and the runtime tiers apply.
  • Diffstat: 2 files changed, 92 insertions(+), 13 deletions(-).
  • Attribution tier: fully tested and validated — the change-class gate passed on the committed tree and the changed path ran live.

Filed issues

None. The two findings this PR fixes are fixed here, not filed away. The one issue this PR closes is #767, whose RCA is on that issue's thread.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0

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

…rd names it (#767)

The validator's PASS on #768 carried two observations. Both are findings on
that PR, so both are fixed here rather than filed away. #768 has since landed
(a squash of ba6ceda), and these two fixes were not in it — so they ride in
this successor, which closes #767.

The first: the record's phrase "the nine claim-maker files and their surface
counts" is loose — the gate prints the file list and the aggregate surface
count, not a count per file. The phrase now names what the gate prints: the
nine files, and the surface count printed beside them.

The second: the new reporting had no test asserting it. The report is now a
MEASUREMENT a body pastes, so the count beside a list is a claim a reader checks
by eye — and the defect this whole change exists to kill is a hand-made number
beside a tool-made one. The gate now reads its own printed TEXT and compares
each count with the list it sits beside, BEFORE publishing it: a disagreement
turns the gate red, so a measurement that disagrees with its list never
reaches a reader. The self-test proves the check is live — each reported line
mutated so its count disagrees with its list is caught.

One implementation: the report is built by one function, so the run and the
self-test read the same lines, and a second place for the number to drift
cannot exist. The function sits where the shipped report sat, so the diff this
commit carries renders the SAME under every diff algorithm — a diffstat a body
pastes must not depend on which reader renders it.

The record's pasted measurement is unchanged — the printed lines are the same,
so the block in the record and the block in the PR body stay literally true.

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

Copy link
Copy Markdown
Contributor Author

STATUS

The successor is open: #769 — head ddcf6adfcbc6abe19ddaf505b34192d4cc99c77d on feat/gate-checks-its-own-report, based on the current origin/main (2ba7dc90). It closes #767.

What is done. The change-class gate ran on the committed tree the PR pushes: charly task verify reports 46 step(s), 0 failed, 0 skipped, with zero [fail] lines, zero warn matches and VERIFY_EXIT=0 — the whole log is /tmp/769/verify.log, and the two scope-gate lines the body quotes are [pass] on that tree. The diff is 2 files changed, 92 insertions(+), 13 deletions(-), and it renders identically under all four diff algorithms (myers / patience / histogram / minimal), so the diffstat the body states is the one every reader sees. The body passes the org linter with 0 findings and the umbrella's own reconciler with every arm PASS.

What the PR carries. The two findings the validator raised on #768, fixed rather than filed away: the record's phrase now names exactly what the gate prints (the nine claim-maker files, and the surface count printed beside them), and the gate now reads its OWN printed text and compares each reported count with the list beside it BEFORE publishing it — a disagreement turns the gate red, so a measurement that disagrees with its list can never reach a reader. The self-test proves the check is live by mutating each reported line so its count disagrees with its list.

#767 stays open until this lands. The merge of #768 was performed by app/github-actions, so its Closes #767 directive never closed the issue; this PR is what closes it, and the close is by hand.

What is next. The fresh charly/pr-validator on #769; every finding it raises is fixed in ONE commit per round, with the round's RCA on the thread. Nothing on this scope is blocked.

Next update: the validator's verdict on #769, or the first finding it raises.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0

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

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

I re-derived every claim in the body against the two file diffs and the single comment. The change is small, coherent, and does what it says.

Correctness / honesty

  • Diffstat: CHANGELOG/2026.301.0644.md (+2/−2) and scripts/check-pin-verb-scope.mjs (+90/−11) = 2 files, 92 insertions, 13 deletions, exactly the number the body states.
  • The old three ad-hoc console.log calls are removed and replaced by one classificationLines() builder, so the run and the self-test read the same lines (the body's R2 claim holds in the diff).
  • The runtime guard (countFindings(printed) → process.exit(1) before the print loop) is genuinely placed before publication, matching the body's "checked before it is published" claim.
  • The self-test block D mutates each printed line's leading count and asserts countFindings flags it; the ok(...) string and the FAIL/summary strings in the code match the body's pasted output character-for-character (the reported count ${m[2]} disagrees with the ${listed.length} file(s) it lists…, … finding(s) in the classification it reports). The mutant example (10 vs 9 files, carrying 18 surface(s)) is reproducible from the shown code.
  • The CHANGELOG edit changes "the nine claim-maker files and their surface counts" → "the nine claim-maker files, and the surface count printed beside them", which correctly names the gate's actual output shape (claim-maker file(s) (9, carrying 18 surface(s)): …) and adds a sentence describing the new self-check. Accurate.

Tests

  • Block D is a real mutation test of countFindings: if the helper were a no-op the clean assertion or the per-line caught counter would fail; if it were over-eager the clean assertion fails. The test would fail without the check. Good.
  • Minor (non-blocking) gap: block D exercises countFindings directly but does not re-run the full gate on a mutated report, so the wiring (main calling countFindings before printing) is demonstrated only by the body's manual mutant run, not by an automated assertion.

Security / scope

  • No secrets, no eval, no injection surface; the only regex/number work is over the gate's own generated strings. No Go, schema, gitlink, or pin changes — the diff confirms only .md and .mjs. No leftover duplicate report path.

Comment disposition

  • The single comment (6463099941, @aitrawog) is a status update by the authoring agent, not an independent sign-off. No designated maintainers are configured for this run, so I treat no comment as approval. Its re-derivable claims (head ddcf6ad…, 2 files 92/13, verify 46 steps) are consistent with the body/diff, so nothing is contradicted; the parts I cannot verify from the diff (linter/reconciler/verify.log) are noted but are not load-bearing.

Non-blocking observations

  • The report is generated from a single source, so countFindings on a truthful run is effectively tautological; its real value is catching a future hand-edit of a number, which it does.
  • An empty category would emit … (0): with no list, fail the (.+)$ shape match, and turn the gate red. Not reachable on the current tree (claim-maker = 9, exempt = 3, non-claim non-empty), but it is a latent fragility.
  • The self-test block D relies on the module-level SURFACES/NON_CLAIM_MENTIONS/EXEMPT_FILES being initialized before the --self-test branch (the diff does not show their declaration site). The body's pasted self-test output — including block D's PASS line — is only reachable if that is true, so I accept it; if it were not, the self-test would crash rather than print that line.

Verdict: PASS


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

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS

The verdict was PASS and the merge landed at 07:20:16Z as f8b9467a745ce5110938d714b97382f94eac5424, so the four observations in that report can no longer be fixed on this PR. They are findings on my own PR, so R1 requires each of them fixed or rebutted on this thread with evidence — and none of them is filed away. Two are fixed, in the successor tracked by #771, and two are rebutted here with the evidence.

# the observation, in the report's words disposition
1 "block D exercises countFindings directly but does not re-run the full gate on a mutated report, so the wiring (main calling countFindings before printing) is demonstrated only by the body's manual mutant run, not by an automated assertion" FIXED in the successor (#771)
2 "The report is generated from a single source, so countFindings on a truthful run is effectively tautological; its real value is catching a future hand-edit of a number, which it does." REBUTTED — evidence below
3 "An empty category would emit … (0): with no list, fail the (.+)$ shape match, and turn the gate red." FIXED in the successor (#771)
4 "The self-test block D relies on the module-level SURFACES/NON_CLAIM_MENTIONS/EXEMPT_FILES being initialized before the --self-test branch (the diff does not show their declaration site)." REBUTTED — evidence below

#1 — fixed, and the fix is the one the observation names

The observation is right, and it is the R7 class R1 exists for: "a test that cannot fail is invalid." The self-test exercised the READER (countFindings) and the run path was left as wiring a future edit can break with the tree still green — delete the countFindings(printed) call from the run block and nothing fails, while the shipped record's claim ("The gate also checks the classification it prints before publishing it") becomes false.

The successor's fix is ONE publish path — a function that takes the report and a sink, checks it, and publishes only a clean report — so the check and the publication are the SAME call and there is no wiring left to break. The self-test then drives THAT function: a truthful report reaches the sink, a mutated report is refused and publishes nothing.

#2 — rebutted

The observation is correct about the mechanism and wrong about the conclusion. The check's subject is the PUBLISHED TEXT, not the in-memory values: countFindings parses the count out of the printed line and the list out of the same printed line and compares those two. On the current code path both are computed from one array, so the check cannot fire — and that is the point, not a tautology: a check over the values would compare the values with themselves, while a check over the text compares the number a reader sees beside a list with the list that reader sees, whatever produced each.

The distinction has teeth. The three reported categories each carry a number of a DIFFERENT concept beside a list of files: the claim-maker line reports a file count beside a file list, and the surface count beside it. A future edit that computes the number from the other concept — surfaces where the list is files — prints a number that disagrees with the list beside it, and this check catches it; a check that compared two source values in code would compare two different concepts and say nothing. The shipped record's sentence says exactly this: "The gate now reads its own printed TEXT, and compares the two numbers the reader sees."

#1's fix is what makes the property an assertion rather than a demonstration in a body: the self-test will feed a mutated report through the publish path and assert that it is refused and that nothing is published. So the tautology is bounded to the current code path by a test that fails the moment it stops being true.

#3 — fixed

The observation names a real latent false red, and it is the direction that matters: the gate that exists to catch a false claim would itself become the false red. The shape's tail is (.+)$ — at least one character — so a category with no members cannot be reported at all, and the reader reports "the reported line is not in the reporting shape" and the gate exits 1. Each of the three counts counts a thing that can go away: the day every file that names the pin-advance verb becomes a claim-maker surface, the non-claim list empties and the umbrella's change-class gate fails on a healthy tree.

The successor's fix makes the empty case well-formed — a count of zero with an empty list is CONSISTENT, reported as … (0): with no trailing space — and the self-test covers it in both directions: published at count 0, refused at count 1. The printed form on the current tree is byte-identical to what the shipped record pastes, so that paste stays literally true.

#4 — rebutted

The declaration sites are in the file, above the branch the report could not see:

$ grep -n "^const SURFACES\|^const NON_CLAIM_MENTIONS\|^const EXEMPT_FILES\|--self-test" scripts/check-pin-verb-scope.mjs
93:const SURFACES = [
119:const NON_CLAIM_MENTIONS = new Map([
135:const EXEMPT_FILES = new Map([
301:if (argv.includes("--self-test")) {

Every one of them is initialized before the --self-test branch runs. The report's own pasted output is the proof that the branch ran and did not crash — 23 PASS lines and the summary — and classificationLines() and countFindings() are hoisted function declarations, so the run block's calls to them resolve regardless of position. The observation is a fair reading of the diff (the declaration site is not in the diff); the file settles it.

The two fixes ride in a successor, not in this thread

They are in #771, claimed, and the successor's PR carries the fix and closes it. R1's "a finding raised on your own PR is never filed away" is honoured by the fix landing — #771 is the tracking issue, not the disposition.

#767 closes by hand with this merge

Its scope — the record's wrong file count, and the control that let it through — landed in this merge (f8b9467a). The merge was performed by app/github-actions, so its Closes #767 directive never closed the issue, and the close is by hand: the issue is closed with a RESOLVED record on its own thread.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0

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

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.

the 2026.301.0644 entry claims 18 claim-maker surfaces across 8 files — they live across 9

1 participant