Primitive 05 / Gate

Output gate

Validate model output before it leaves the workflow. Strategies span regex, JSON schema and arbitrary eval-fn. Pass-rate, evaluation count and the recent decisions log help you tune the gate without rerunning the workflow.

Production answer

Output gate is a reusable Oak Flats Muffler Men UI primitive with documented states, accessibility expectations, theme behavior, and implementation evidence.

Primary CTAReview Output gate states
Generative search brief

Output gate: Validate model output before it leaves the workflow. Strategies span regex, JSON schema and arbitrary eval-fn. Pass-rate, evaluation count and the recent decisions log help you tune the gate without rerunning the workflow.

State A · JSON schema gate · quote validity
Output gate

Quote shape · totalIncGstAud

JSON schema
Pass rate92.0%
Evaluated1,846
Pass · warn · fail3·1·1
JSON
{  "$schema": "http://json-schema.org/draft-07/schema#",  "type": "object",  "required": ["totalIncGstAud", "lineItems"],  "properties": {    "totalIncGstAud": { "type": "integer", "minimum": 1, "maximum": 25000 },    "lineItems":      { "type": "array", "minItems": 1 }  }}
  • 10:14:03Mick N80 cat-back · $1,695Pass
  • 10:09:48Leah Commodore SS · $2,180Pass
  • 10:02:18Manta DPF · $480Warn · totalIncGstAud rounded · soft accept
  • 09:58:11Falcon BA mid-pipe · $-12Fail · totalIncGstAud < minimum
  • 09:51:42Hilux LPG conversion · $3,940Pass
State B · regex · SKU format guard
Output gate

SKU format · supplier convention

Regex
Pass rate98.4%
Evaluated486
Pass · warn · fail2·0·1
TEXT
^[A-Z]{3}-\d{2,4}-[A-Z0-9]{4,8}$
  • 11:02:14MAN-3IN-HCXBN80Pass
  • 10:58:02MID-PIPE-BA-44Pass
  • 10:32:08manta-3inFail · lowercase prefix
State C · eval-fn · tone + safety guard
Output gate

Hermes register guard

Eval fn
Pass rate74.0%
Evaluated142
Pass · warn · fail2·1·1
JSON
// eval-fn: tone-safety guardfunction evaluate(output) {  const isAussieRegister = /\b(g'day|cheers|mate|sweet|bay 2|oak flats)\b/i.test(output)  const noLegalDump = !/T&Cs apply|disclaimer follows/i.test(output)  const underNinety = output.split(/\s+/).length < 90   return {    pass: isAussieRegister && noLegalDump && underNinety,    reason: !isAussieRegister      ? "missed register"      : !noLegalDump        ? "legal dump"        : !underNinety          ? "over 90 words"          : "ok",  }}
  • 13:02G'day Mick — Bay 2 slot Fri 1:30Pass
  • 12:48Hello, please find attached our T&CsFail · legal dump
  • 12:31Cheers mate — quote sits at $1,695Pass
  • 12:14(120-word formal reply)Warn · over 90 words