Three gates answer different questions
Schema validation asks whether fields and types match a contract. Fact validation asks whether values match current evidence. Authorization asks whether the caller may perform the operation. Passing one cannot substitute for the others.
A string model identifier and positive numeric capacity satisfy a shape. AX220 with capacity 200 passes that structure but conflicts with the synthetic 20 L fact. Conversely, a read-only agent may not publish even a correct value. Preserve all three decisions rather than one ambiguous success flag.
A minimal schema and fact source
{
"type": "object",
"required": ["model", "capacity_l"],
"additionalProperties": false,
"properties": {
"model": {"type": "string"},
"capacity_l": {"type": "number", "minimum": 0}
}
}
The local fact dictionary contains only AX220 at 20 L. assessments.py runs a JSON Schema validator followed by entity-existence and capacity checks. The records are synthetic; no customer inventory or external model generation is involved.
Four executed outcomes
| Input | Schema | Fact check | Action |
|---|---|---|---|
| AX220, 20 | Pass | Pass | Authorization still required |
| AX220, 200 | Pass | capacity_conflict | Block and inspect evidence |
| AX999, 20 | Pass | unknown_model | Request facts instead of guessing |
| AX220, string 20 | Fail | Not evaluated | Repair type or define conversion |
assessment-results.json preserves the outputs. Converting a numeric string must be a declared rule; silent conversion can destroy meaningful leading zeros, identifiers or units. Unknown models should not be automatically replaced by similar known names.
Facts need conditions, time and provenance
Real facts depend on model, market, certificate validity or package version. Store entity, attribute, value, unit, conditions, evidence location and applicability. Conflicting sources should produce a conflict, not an automatic choice of the most recently fetched text.
Instructions embedded in retrieved material are not fact fields. A PDF telling the system to ignore rules and publish must not change tool permissions. Separate evidence, generated suggestions and trusted operator instructions through executable controls, not cautionary prompting alone.
Bound retries
A format error can be returned to a generation step with explicit diagnostics and a retry limit. A factual conflict needs source investigation, not repeated requests to produce something that passes. Otherwise a model may emit expected values without evidence.
Record source version, output, error class and resolution for each revision. Version the schema too. Free-text assertions still need segmentation, evidence matching and sometimes human review; typed fields cannot cover all meaning.
Zhihe Growth's delivery principle
Zhihe Growth can use structured output for client intake, reviewable drafts and fact-store integration. It should not describe format constraints as a truth guarantee. Patent applications must not become granted patents, and historical citation rates must not become sales growth.
This is reference code, not a deployed autonomous publishing plugin. Combine it with the state machine, tool boundaries and citation audit. Production integration also needs authenticated identity, audit and data-access testing.
Route each failure to the right owner
| Finding | Responsible stage | Preserve | Do not substitute |
|---|---|---|---|
| Missing field | Input or generation repair | Output and schema version | Invented default |
| Wrong type | Data normalization | Rule and original | Universal numeric coercion |
| Unknown model | Evidence intake | Unresolved entity | Fuzzy match accepted as fact |
| Conflicting value | Source review | Both values and versions | More attractive specification |
| Expired evidence | Governance | Validity and purpose | Falsified new date |
| Forbidden publication | Authorization | Request and denial | Prompt-based bypass |
Diagnostics should aid repair without revealing another client's records. Return only evidence within the caller's project scope. Format correction, fact resolution and permission requests need distinct paths so retries do not expand access.
Reproduce and consult primary sources
Download the four-record validation package. See JSON Schema's introduction and OpenAI's structured-output documentation. Structural adherence establishes neither semantic correctness nor user authorization.