Schemas

Schema names and versions below are read from the current storage implementation.

storage.yaml — schema version 5

Owner: Documentledger durable data mount. Committed source of truth. Required keys include schema_version, project_uuid, positive state_version, latest scan version/counts, source-index filename, and source-index hash. Timestamp keys are stripped and not part of the contract. Unknown fields are normalized conservatively; incompatible versions fail.

Scan and source index

scan.yaml uses documentledger.scan.v5; source-index.json uses the current documentledger.source_index.v1 constant. Both are deterministic baselines stored in the data mount and validated against their integer version and hash metadata. Scan records include source/doc hashes, unit deltas, affected sections, stale-doc compatibility projections, and unmapped units.

Mapping and migration payloads

Mapping batches use documentledger.mapping_proposal.v1 and are validated as a complete batch before replacement or application. Migration plan and journal payloads carry plan identifiers and SHA-256 digests; apply rejects a stale plan. The migration boundary is copy-first and activates the shared manifest last.

CLI envelope

Successful JSON commands return an ok: true envelope with a command and result. Errors use:

{
  "ok": false,
  "command": "scan",
  "error": {
    "code": "workspace-not-found",
    "message": "...",
    "remediation": [],
    "details": { "domain_code": "workspace_not_found" }
  },
  "events": []
}

Schema commands provide discoverable names and known values: documentledger schema list, schema show NAME, and schema values [NAME].