BattINFO Validation Contract#
This document defines the validation behavior that consumers can rely on for the supported BattINFO scope.
Supported Entry Points#
Core validation entry points:
battinfo validatebattinfo save ... --validatebattinfo publish ... --validatebattinfo index build --validatebattinfo.validate.validate_json(...)battinfo.validate.validate_record(...)battinfo.validate.validate_publication(...)
Policy Names#
BattINFO currently exposes these named validation policies:
defaultstrictpublisheringest
Policy semantics:
default: schema and references are errors; semantic issues default to warnings.strict: schema, references, and semantic issues are errors.publisher: publisher-oriented validation with semantic and publication checks as errors.ingest: schema remains strict while semantic and reference issues can remain warnings during staged cleanup.
Issue Model#
Structured validation issues expose these fields:
codeseveritypathmessagehintvalidatorresource_typeprofile
Severity values:
errorwarning
Representative issue codes:
schema.requiredschema.format.urischema.format.date_timeschema.profile_unknownreference.missingreference.type_mismatchsemantic.short_id_mismatchsemantic.temporal_order_invalidpublication.distribution_url_invalidpublication.jsonld_parse_error
CLI Contract#
battinfo validate supports:
--format text--format json
Text mode:
emits a human-readable pass/fail summary
includes warnings when validation succeeds with non-fatal issues
JSON mode emits a machine-readable payload with:
okmodepolicyprofilesource_rootissue_counterror_countwarning_counterrorsissues
Example issue object:
{
"code": "schema.format.uri",
"severity": "error",
"path": "dataset.url",
"message": "'not-a-uri' is not a 'uri'",
"hint": null,
"validator": "format",
"resource_type": "dataset",
"profile": null
}
Exit codes:
0when no error-severity issues are present1when one or more error-severity issues are present
Current Boundary#
Reference validation is supported against repository-style source trees through source_root.
This is sufficient for the core scope, but it is not yet the long-term scalability model for larger external registries or snapshots.