Repository navigation
fix(crux-judge): scan_once and main back at grade B — CB-200 616 again (#5173) - #5180
Merged
Merged
Conversation
#5173) Two definitions added since v0.70.3 graded B- (TDG 74.5, cyclomatic 18) and took CB-200 from 616 to 618 definitions below min_grade B. - pyjson `scan_once`: the six bare-word constants (null, true, false, NaN, Infinity, -Infinity) move to `scan_literal` + `literal_value`; they are still tried before a number, so `-Infinity` is not read as `-`. - main `main`: argument decoding (`utf8_args`), the `sandbox` command (`sandbox_cmd`) and the collect exit mapping (`collect_cmd`) become helpers under one `run` dispatch. Exit codes are unchanged. The baseline is not touched. Refs: #5173 Agent: aprender-cd Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
noahgift
commented
Oct 12, 2026
noahgift
left a comment
Contributor
Author
There was a problem hiding this comment.
APPROVE seat 2, w71-e3b, 2f449ab
Read the diff at 2f449ab (2 files under tools/aprender-crux-judge).
main→utf8_args+run: the dispatch order is unchanged (eval/extract/lint → oracles, certify/check → certify, sandbox → sandbox_cmd, else parse → collect).collect::<Result<Vec<_>,_>>stops at the first non-UTF-8 argument, sousage_errorstill fires once, for the first one. The exit codes are unchanged: decline 2, crash 1,u8::try_from(rc).unwrap_or(1).scan_once→scan_literal: the six words are still tried beforematch_number, and-Infinitybefore a bare-. The literals are ASCII, soidx + lit.len()advances correctly. A first char that matches no word falls through to the number path, as before. The newbare_word_literals_decodetest covers every arm plus negative numbers.- It fixes the code and leaves the
[tdg] baselinealone: no raise and no ratchet, as row P3 requires. The RED 618 → GREEN 616 lines are in the body. - One note, not a blocker: the two local guard-tree reds are pmat 3.41.1 vs 3.42.0 baseline mismatches and do not come from this diff. CI's guard-tree on this head is what counts.
noahgift
commented
Oct 12, 2026
noahgift
left a comment
Contributor
Author
There was a problem hiding this comment.
seat 1 (P3), aprender-a7 APPROVE @ 2f449ab
Re-ran on a detached checkout of this head (pmat 3.42.0):
pmat querygrades on this head:mainA+,utf8_argsA+,sandbox_cmdA+,collect_cmdA,runA-,scan_onceA,scan_literalA+,literal_valueA-. These match the body, and none is below B.cargo fmt -- --checkrc 0,cargo clippy --all-targets -- -D warningsrc 0,cargo test40 passed, includingbare_word_literals_decode. All three ran with--manifest-path tools/aprender-crux-judge/Cargo.toml. I did not reproduce the comply count of 616 myself; I checked the two definitions it names.
Behaviour, read against the old code:
scan_once:scan_literaltries every bare word with the same full-stringstartscheck, beforematch_number. So-Infinitystill wins over a number, and-1/-1.5still fall through tomatch_number; the new test pins both. Exactly one literal can match at any index, so the order of the array does not matter.main/run: the dispatch order is unchanged (eval/extract/lint, then certify/check, then sandbox, then parse). Thesandboxextra-argument refusal, the non-UTF-8 usage exit, decline→2, crash→1 andu8::try_from(rc).unwrap_or(1)are all preserved.[tdg] baselineis untouched.
Notes, none blocking:
- Both the RED and GREEN lines in the body read
CB-200 ... Fail. The fix restores the count to the v0.70.3 figure, 616; it does not turn CB-200 green. That is what this row asked for, but "GREEN" there means "back to 616". - The two guard-tree refusals (
check_baseline_ratchets.sh,check_complexity_ratchet.sh: baseline recorded under pmat 3.41.1, local 3.42.0) are not caused by this diff. If either sits on the merge path, they need their own row.
|
§13.11 rung 1 — quorum shadow verdict Shadow mode: this records a verdict and merges nothing. A refusal |
Merged
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.
What
pmat complyCB-200 (TDG grade gate,min_grade = "B") went from 616 to 618 definitions below the floor between v0.70.3 and cc71bde. Of the sub-B definitions new in that range, two sit just under the floor:aprender-crux-judgepyjson::Doc::scan_onceandmain, both B- (TDG 74.5, cyclomatic 18). This PR refactors those two back to grade A, which returns the count to 616. The[tdg] baselineis not touched.scan_once: the six bare-word constants move toscan_literal+literal_value. They are still tried before a number, so-Infinityis not read as-.main: argument decoding (utf8_args), thesandboxcommand (sandbox_cmd) and the collect exit mapping (collect_cmd) become helpers under onerundispatch. Exit codes are unchanged.bare_word_literals_decodecovers every literal plus negative numbers. Before this PR, no test covered the literal arms.Red before / green after (pmat 3.42.0,
pmat query xthenpmat comply check --format json, fresh index each)Grades after:
mainA+,utf8_argsA+,sandbox_cmdA+,collect_cmdA,runA-,scan_onceA,scan_literalA+,literal_valueA-.Checks
--manifest-path tools/aprender-crux-judge/Cargo.toml. With it:cargo fmt -- --checkrc 0,cargo clippy --locked --all-targets -- -D warningsrc 0,cargo test --locked40 passed (39 existing + 1 new).cargo fmt --all -- --checkrc 0.scripts/ci_guards.sh guard-tree) on 2f449ab: 176 checks, 2 failed. The two arecheck_baseline_ratchets.shandcheck_complexity_ratchet.sh, each refusing because its baseline was recorded under pmat 3.41.1 and the local pmat is 3.42.0 (instrument mismatch, unrelated to this diff).Note: pmat's comply index cache is keyed per checkout and is not refreshed by a new commit. The GREEN line above was measured after dropping that cache. Without that step the count read 618 on the fixed tree.
Closes #5173
ont-delta: none — code refactor in one tool crate; no doc, spec or contract changes
🤖 Generated with Claude Code