stage1-classifier-hardening
Skill0 starsChanged 3 months agoMITView on GitHub
Diagnose and fix a reported false-positive or false-negative in Stage 1's genuine-response classifier (tools/review-watch/genuine-response.mjs) — isGenuineResponse, findExemption, and the primitives they compose.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- context-clearingSkill
- local-workerSkill
- model-checkSkill
- persona-makerSkill
- retroSkill
- script-makerSkill
- siftSkill
- skill-makerSkill
- spendSkill
- telemetry-batterySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Rule out a duplicate: Check the input against every existing guard function (isCodexCloudSetupPrompt, stripLeadingMarkdownWrapper, …
- Very specific: line 19
Rerun the full suite: All of tools/review-watch/*.test.mjs must still pass — every previously-fixed boundary documented in …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stage 1 classifier hardening
Trigger: a new misclassification is reported against tools/review-watch/genuine-response.mjs — a genuine Codex review wrongly gated as non-genuine (or vice versa), a BLOCKED/refusal/Codex-Cloud-setup reply wrongly accepted as a real review, or a PR-body Stage 1 exemption: declaration wrongly matched or missed by findExemption.
Out of scope: state-machine / correlation-logic defects — binding a response to the wrong frozen PR head, re-triggering across fix-commit heads, or anything about which comment/timestamp is being evaluated rather than how a given piece of text classifies. Those (e.g. issues #163, #165) are structurally different, single-occurrence defects. Route them through the normal bounded-review-cycle correction, not this skill.
Procedure
- Reproduce with the real input for the real function. The two entry points see different inputs, and reproducing with the wrong one risks an incorrect fix:
isGenuineResponseonly ever seesbody_excerpt = body.slice(0, 200), truncated byfindAllMatches(poll.mjs; consumed instage1-gate.mjs,trigger.mjs,lifecycle-gate.mjs) — reproduce from that exact 200-character excerpt, not the full reported body.findExemptionsees the full, untruncated PR body (stage1-gate.mjspassesgh pr view's output directly) — reproduce from the complete body, since an exemption declaration past character 200 or a fenced example spanning that boundary would classify differently if truncated. - Rule out a duplicate. Check the input against every existing guard function (
isCodexCloudSetupPrompt,stripLeadingMarkdownWrapper,isSelfReferentialRefusal,BLOCKED_STATUS_PATTERN,ELLIPTICAL_REFUSAL_PATTERN,EXEMPTION_PATTERN/blankFencedBlocks) and every case already intools/review-watch/*.test.mjs— this may already be fixed, or be a near-neighbor of a documented boundary. - Scope the fix. Fix only in this shared LDL module (
genuine-response.mjsorstage1-gate.mjs). Never patch around it in a consumer/target repository. - Extend the narrowest primitive. Locate the single pattern or function whose boundary is wrong and adjust that — don't bolt on a new isolated regex or a parallel classification path.
- Add bidirectional tests. Two assertions, in opposite classification directions: (a) the reported case now classifies correctly (a false negative's non-genuine input now returns
false; a false positive's genuine input now returnstrue), and (b) a near-neighbor case of the other class is unaffected — for a false-negative fix (tightening), a genuine review discussing or quoting the same syntax still returnstrue; for a false-positive fix (loosening), a real BLOCKED/refusal/setup-prompt variant still returnsfalse. Two tests that both assert the same boolean is not bidirectional and can pass while the fix silently over-loosens or over-tightens the guard. - Rerun the full suite. All of
tools/review-watch/*.test.mjsmust still pass — every previously-fixed boundary documented ingenuine-response.mjs's own comments must not regress.
Stop condition
Stop once the extended primitive passes its new bidirectional tests and the full suite passes unchanged elsewhere. Do not redesign the gate, add coverage for unobserved hypothetical phrasing, or authorize a second review round from inside this skill. If step 3 reveals the defect is actually a correlation/state-machine issue, stop and hand it to the normal bounded-review-cycle correction instead of forcing a text-classifier fix.
Why this exists
Issues #151, #161, and #162 (fix PRs and Stage 2 audits #155, #164/#167/#168, #173) each independently re-derived this same reproduce → dedupe → scope → narrow-extend → bidirectional-test → full-rerun sequence from scratch. Applying it directly is measurably faster than re-deriving it on the next occurrence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

