validate
Validate observation JSON files — core, slots, evidence refs, and semantic checks
disclosureos validate checks observation JSON files against the full standard. It runs the same parseEnrichedObservation pipeline the libraries use, plus file handling and provenance warnings.
Usage
disclosureos validate <path...> [options]Paths can be files, directories, or shell globs — mixed freely and deduped:
disclosureos validate ./data/nimitz.json
disclosureos validate ./data/ --recursive
disclosureos validate ./imports/*.json ./curated/key-cases.jsonA path that matches no JSON fails the run — a typo'd path can never masquerade as a clean validation.
Options
| Option | Effect |
|---|---|
--recursive, -r | Descend into directories |
--strict, -s | Also warn on missing recommended fields (summary, description, objectCharacteristics, sourceData, witnesses) |
--json, -j | Output results as structured JSON for CI and scripts |
What it checks
Errors (fail the run, exit code 1):
- Required fields and type correctness for the core record (via records' validator)
- Observable assessment levels and ids, when
observableAssessmentsis present - OCS node ids and confidence ranges, when
originis present - Unknown top-level keys — third-party data belongs under
extensions - Semantic sanity: non-negative durations, speeds, witness counts
Warnings (reported, never fail the run):
- Dangling evidence refs — a claim citing
sensor:radar-01when the record has no sensor with that id, or a malformed ref that doesn't match<kind>:<id> - Missing recommended fields, with
--strict
data/case-0042.json
✗ origin[0].confidence: Too big: expected number to be <=1
⚠ observableAssessments.technology.transmedium_travel[0].evidenceRefs[0]:
dangling evidence ref "sensor:spy1" — no sensor with id "spy1" in record
1 error(s) across 3 file(s)Why dangling refs are warnings, not errors
The schema deliberately keeps evidenceRefs as plain strings (for JSON Schema portability), so a dangling ref is structurally valid — but it's a broken provenance link the author should fix. The CLI surfaces it without --strict because an evidence-backed claim whose evidence can't be found undermines the whole point of the claim model.
Structured JSON output
Use --json (or -j) for machine-readable output. The JSON includes per-file results (errors, warnings, validity) and aggregate totals:
disclosureos validate ./data/ --recursive --json{
"files": [{ "file": "...", "valid": true, "errors": [], "warnings": [] }],
"emptyTargets": [],
"totals": { "files": 1, "errors": 0, "warnings": 0, "emptyTargets": 0 },
"valid": true
}CI usage
Exit code is 0 only when every file is valid and every path matched. Wire it straight into CI:
- name: Validate observation data
run: npx @disclosureos/cli validate ./data --recursive --strictSee also
completeness— measure which fields are missing after validation passes- Onboarding workspace — guided migration workflow with paste-and-validate playground