An official website of the Disclosure Foundation

Introduction

Overview

Commands

scaffoldvalidateregistryinfo

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

Terminal
disclosureos validate <path...> [options]

Paths can be files, directories, or shell globs — mixed freely and deduped:

Terminal
disclosureos validate ./data/nimitz.json
disclosureos validate ./data/ --recursive
disclosureos validate ./imports/*.json ./curated/key-cases.json

A path that matches no JSON fails the run — a typo'd path can never masquerade as a clean validation.

Options

OptionEffect
--recursive, -rDescend into directories
--strict, -sAlso warn on missing recommended fields (summary, description, objectCharacteristics, sourceData, witnesses)
--json, -jOutput 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 observableAssessments is present
  • OCS node ids and confidence ranges, when origin is 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-01 when 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:

Terminal
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:

.github/workflows/data.yml
- name: Validate observation data
  run: npx @disclosureos/cli validate ./data --recursive --strict

See also

  • completeness — measure which fields are missing after validation passes
  • Onboarding workspace — guided migration workflow with paste-and-validate playground

scaffold

Generate typed templates for observations, assessment maps, and classifications

registry

Introspect the field, observable, and origin registries from the terminal

On this page

Usage
Options
What it checks
Why dangling refs are warnings, not errors
Structured JSON output
CI usage
See also