Repository navigation
fix(source-control): case-insensitive classification-token matching in babysit-readiness-gate - #1347
Conversation
…n babysit-readiness-gate babysit-readiness-gate.sh's bash degrade and babysit_classify.py's preferred Python classifier both matched classification tokens (VALID|INCORRECT| UNCERTAIN) exact-case only. A worker reply that wrote a natural-language disposition like "Valid (defer)" instead of the mandated all-caps VALID scored as unclassified, so the gate reported READINESS_BLOCKED reason=under-decomposed even though the finding genuinely was classified. Match both the token count and the self-row exclusion (which keeps a classification row's own severity word from re-counting as a phantom finding) case-insensitively, still whole-word so "invalid"/"INVALID" does not false-match "valid"/"VALID". Add bash regression cases, a lowercase convergence fixture pinning the bash degrade to the Python classifier, and Python unit tests. Bump source-control to 0.26.3 with a CHANGELOG entry. Closes #619 Co-Authored-By: Claude Sonnet 5 (claude-code-plugins work-loop) <[email protected]>
|
Claude finished @kyle-sexton's task in 2m 55s —— View job PR Review
SummaryThis is a minimal, well-targeted fix for a real false-BLOCKED scenario (#619). When a worker's classification table row used natural-language casing like Overall verdict: LGTM — no blocking issues. CorrectnessThe paired nature of the fix is the key invariant, and it's handled correctly. There are two places that must move together:
Both the bash and Python paths apply the change in both places:
Whole-word safety is preserved:
The asymmetry between Test CoverageCoverage is thorough and correctly structured. Each new behavior has a dedicated case:
One minor gap: Changelog / Version
Observations (non-blocking)
|
|
Claude finished @kyle-sexton's task in 1m 34s —— View job Security Review — PR #1347
No security issues found. Reviewed all 6 changed files for injection surfaces, logic flaws, authorization gaps, unsafe data handling, and dangerous patterns. Findings below by area: Command/Regex Injection — Clean
ReDoS — CleanThe changed patterns are fixed-string alternations inside word-boundary anchors. The Authorization / Gate-bypass Logic — CleanClassifications are counted exclusively from The whole-word guards ( Path Traversal / File Handling — CleanNo new file reads introduced. The GitHub Actions / Secrets / Supply Chain — N/ANo workflow files, dependency pins, or secret-handling changed in this PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7263e7bbb9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ness-gate-classify-case-insensitive # Conflicts: # plugins/source-control/.claude-plugin/plugin.json # plugins/source-control/CHANGELOG.md
…ition cell
Case-folding the classification token while scanning a whole `|`-prefixed line
made ordinary table prose score as a disposition: with two findings, one real
`VALID` row, and an unrelated self row such as `| CI check | result is valid |`,
both the bash degrade and the Python classifier reported classified=2 and let
the second, genuinely unclassified finding past the under-decomposition gate.
Both paths now require the token to OPEN a table cell -- a `|`, then only
non-letter decoration (`**`, a checkmark), then the token. Real dispositions
still count in any case ("Valid (defer)", "**VALID**"); prose does not. The
row-exclusion predicate is built by concatenating the row anchor onto the SAME
cell pattern, so the rows stripped from the finding corpus and the rows credited
as classified cannot drift apart.
Both tightenings fail closed: a disposition buried mid-cell now scores
unclassified (BLOCKED) rather than passing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 570ee76d2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ness-gate-classify-case-insensitive # Conflicts: # plugins/source-control/.claude-plugin/plugin.json # plugins/source-control/CHANGELOG.md # plugins/source-control/scripts/babysit-readiness-gate.sh
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Warning Automated review did not complete — this is an infrastructure failure, not a review verdict. Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."
Re-running the job, or pushing a new commit, will retry the review. |
|
Warning Automated security review did not complete — this is an infrastructure failure, not a review verdict. Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."
Re-running the job, or pushing a new commit, will retry the review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c39f450b92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…t its start Anchoring the classification token to the START of a table cell still credited prose: `| 2 | c2 | Valid cache entries are rejected | | |` opens a cell with a disposition word, so two findings and one real VALID row scored classified=2 and passed the under-decomposition gate. A letters-only boundary also accepted `valid2`, `2valid` and `VALID_TOKEN`, since digits and underscores are not letters -- and such a row is credited AND stripped from the finding corpus, turning one unclassified finding into READINESS_OK. A cell now counts only when the token IS the cell: decoration (`**`, a checkmark) may surround it, and a parenthesised or bracketed aside is removed first so "Valid (defer)" reads as the bare token. The decoration class excludes word characters on both sides. Chosen over parsing the table header for a Classification column: a header-driven rule still credits prose written INTO that column, and it needs a header row at all, which a single-row reply does not carry. The bash path moves its predicate into one `classify_rows` function so the count and the corpus-strip share it; the strip evaluates the predicate on a normalized copy and emits the ORIGINAL line, since aside removal would otherwise delete a `[P1]` severity marker from the corpus it only filters.
…ness-gate-classify-case-insensitive # Conflicts: # plugins/source-control/.claude-plugin/plugin.json # plugins/source-control/CHANGELOG.md
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
…ness-gate-classify-case-insensitive # Conflicts: # plugins/source-control/CHANGELOG.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a619f8f6dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 530ad06aae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Requiring the token to be the WHOLE cell rejected `VALID — fixing` and `VALID — fix now`, which reference/review-discipline.md specifies as canonical disposition values -- so a reply written exactly as documented scored unclassified and the gate reported a false READINESS_BLOCKED. A cell now counts when it OPENS with the token, optionally followed by an annotation introduced by PUNCTUATION. The punctuation requirement is the discriminator the whole-cell rule was standing in for: `VALID — fixing` and `VALID (defer)` count; `Valid cache entries are rejected` does not, because a bare space before more letters is prose, not an annotation. `valid2`, `2valid` and `VALID_TOKEN` still fail on the word-character boundary. Removes the aside-stripping normalization: the punctuation branch matches `(defer)` directly, so the third pattern that had to stay in sync between the bash and Python paths is gone.
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
Closes #619
Summary
babysit-readiness-gate.sh's bash safe-tier degrade andbabysit_classify.py's preferred Pythonclassifier both matched classification tokens (
VALID|INCORRECT|UNCERTAIN) exact-case only. Aworker reply that wrote a natural-language disposition like "Valid (defer)" instead of the mandated
all-caps
VALIDscored as unclassified, so the gate reportedREADINESS_BLOCKED reason=under-decomposedeven though the finding genuinely was classified.severity word from re-counting as a phantom finding) case-insensitive in both the bash degrade
(
grep -wiE) and the Python classifier (re.IGNORECASEonCLASSIFY_TOKEN_RE/CLASSIFY_ROW_RE) — kept whole-word, so "invalid"/"INVALID" still does not false-match"valid"/"VALID".
source-controlto 0.26.3 with a CHANGELOG entry.Test plan
bash plugins/source-control/scripts/babysit-readiness-gate.test.sh— 70/70 pass, including 3 newlowercase/natural-language-token regression cases and a new lowercase convergence fixture pinning
the bash degrade to the same count as the Python classifier.
bash plugins/source-control/skills/babysit-prs/scripts/engine.test.sh(Pythonunittestdiscovery + ruff + guarded-wrapper checks) — 351/351 tests pass, ruff clean.
shellcheckandeditorconfig-checkeron every changed file — clean.Related
Refs #534 — parent umbrella issue (shared authorship/finding/approval classifier this issue was folded under)
🤖 Generated with Claude Code