JSON Schema & Types
UKS is defined by a normative JSON Schema (draft/2020-12). All three reference implementations bundle the same schema, so validation results agree.
- Canonical schema:
spec/schema/UKS.v3.schema.json($id:https://sabrecodex.dev/schemas/uks/v3/UKS.v3.schema.json) - TypeScript types:
spec/schema/UKS.v3.types.ts
Top-level shape
Required: packet_id, schema_version (const "3.0"), conformance_level (L1/L2/L3), created_at (ISO 8601 datetime), topic (a { title, … } object), sources (≥ 1).
Optional: project, data_contracts, scrape_targets, extraction_rules, directives, actions, agent_instructions, knowledge_nodes, domain_data, provenance, export, _extensions.
The schema is strict:
additionalProperties: falseat the top level. Unknown top-level keys are rejected — put implementation-specific data under_extensions, which never fails validation.
Conformance is schema-enforced
Level isn't just a label; the schema validates it:
If conformance_level is… | …then these are required (≥ 1 each) |
|---|---|
L2 | scrape_targets, extraction_rules |
L3 | scrape_targets, extraction_rules, directives, actions, agent_instructions |
So an L3 packet missing actions fails validation. See Conformance Levels.
Validate
uks validate my-packet.uks.json # CLIimport { validate } from '@uks/sdk'; // TypeScriptfrom uks_sdk import validate # Python→ Related: Schema Layers A–E · Source Fields · Standards Comparison