Yes/no answers
Three levels grade a skill that answers yes or no: the verdict, the shape, then the meaning of the reason lines.
text
oui ← verdict, principal: verdictEquals(id, "yes" | ["no", "yes"]) free
- Migration DDL sur outbox ┐ shape: answerShape(id, yesNoContract()): one reason per line, free
- Suppression de users.email ┘ no heading, confidence or recommendation, ≤ 500 characters each
meaning of the lines: judge().criterion(...), gated with one judge call
.when(verdictIs("yes")) when "non" is also validSee the migration and split-controller cases in Graders for a full example.
verdictEquals
- Passes when the first line of the answer (surrounding blanks, BOM and CRLF aside) is exactly the expected word:
oui/nonby default, case-sensitive. **Non.**,NONor a verdict on line 3 are not a verdict.- Its criterion is principal. It checks the verdict only, not the shape.
yesNoContract
yesNoContract() reads the answer as { verdict, reasons } (1st line, following lines), then validates it with zod:
| Answer | met | why |
|---|---|---|
non | ✓ | "non" alone |
oui\n- Migration DDL sur outbox | ✓ | "oui" then 1 reason line(s) |
non\nStyle only. | ✗ | reasons: "non" must stand alone |
oui | ✗ | reasons: "oui" must be followed by one line per reason |
**Oui**\n- …, review: oui | ✗ | verdict: the first line must be "non" or "oui" alone |
oui\n## Détails\n\nConfiance : haute | ✗ | reasons[0]: heading "## Détails"; reasons[1]: blank line ""; reasons[2]: confidence level … |
| a line longer than 500 characters | ✗ | reasons[0]: paragraph of 612 characters, at most 500 per reason line |
- Heading: a line that starts with
#followed by a blank (#1234 migrationis a reason) or ends with:. - Confidence: a line that starts with
confiance/niveau de confiance/confidence, bullets and**aside (confiance: haute,- Confiance « moyenne »…). - Recommendation: a line that starts with
Recommandation :orJe/Nous recommande…,I/We recommend…. - A word in the middle of a line does not count:
- abaisse le seuil de confiance…,Tiers de confiance : …,Règle de recommandation de paiement modifiéeare reasons.
Options
- The defaults are specific to
/sdlc:check-if-need-humain-review(French words and filters, 500 characters). Another yes/no skill overrideswordsandmaxReasonLength; another format writes its own contract. - 500 characters (
MAX_REASON_LENGTH): 9 reason lines out of 10 in recorded bash runs are below it. Beyond that, the line explains or chains several patterns. verdicts: ["no"]restricts the well-formed verdicts: it means "the output is strictlynon".- Another format = another contract
{ parse, schema, describe? }, without touchinganswerShape.
Gating the judge
- A judge whose
.when()gate is closed costs no call. It returns a passing grade without criteria: see Not applicable. The trial then has no score: the aggregates say over how many graded trials the score is averaged (0.75 ± 0.10 (2/4)). - Put a gate on what makes the criteria irrelevant, not on the expected verdict. On a case that expects
oui,.when(verdictIs("yes"))would leave a wrongnonwithout a score. Hencesplit-controllerin Graders, wherenonis valid. verdictIs("yes")follows the same strict rule asverdictEquals. Any(result) => booleanfunction also works.