agentleFS
LouPineWaysLouPineWays/Loop-Dee-Loup/.claude/skills/stage1-classifier-hardening/SKILL.md

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.

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
  1. Very specific:

    Rule out a duplicate: Check the input against every existing guard function (isCodexCloudSetupPrompt, stripLeadingMarkdownWrapper, …

    line 15
  2. Very specific:

    Rerun the full suite: All of tools/review-watch/*.test.mjs must still pass — every previously-fixed boundary documented in …

    line 19

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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: isGenuineResponse only ever sees body_excerpt = body.slice(0, 200), truncated by findAllMatches (poll.mjs; consumed in stage1-gate.mjs, trigger.mjs, lifecycle-gate.mjs) — reproduce from that exact 200-character excerpt, not the full reported body. findExemption sees the full, untruncated PR body (stage1-gate.mjs passes gh 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.
  2. 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 in tools/review-watch/*.test.mjs — this may already be fixed, or be a near-neighbor of a documented boundary.
  3. Scope the fix. Fix only in this shared LDL module (genuine-response.mjs or stage1-gate.mjs). Never patch around it in a consumer/target repository.
  4. 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.
  5. 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 returns true), 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 returns true; for a false-positive fix (loosening), a real BLOCKED/refusal/setup-prompt variant still returns false. 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.
  6. Rerun the full suite. All of tools/review-watch/*.test.mjs must still pass — every previously-fixed boundary documented in genuine-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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.