0xBUFF / docs

Contracts and errors

Record shapes, outcomes, diagnostics and resource limits.

All versioned public records use schema version 4. Record fields are closed: unknown fields, unsupported versions and invalid values are rejected. The TypeScript declarations in the released package define the exact unions.

AssessmentDefinition

FieldTypeRequired
schemaVersion4Yes
assessmentIdstringYes
revisionstringYes
revisionDigestSHA-256 digestSealed record only
policyVersioncomposed-required-v1Yes
criteriaCriterion arrayYes
compositionCriterionCompositionYes

A draft omits revisionDigest. Criterion IDs are unique. Revision must identify a stable revision, not latest.

Criterion

All criteria have id: string, kind, mode: "required" | "advisory", visibility: "public" | "restricted" and parameters. Only supported objective kinds accept a top-level executionFact.

KindParameter fields
exact_textexpected
normalized_textexpected, normalization
number_with_toleranceexpected, tolerance, optional unit
number_rangeexpected, optional unit
set_equivalenceexpected, itemType, order, duplicates
boolean_equalityexpected
json_equalityexpected
observed_executionassertions (array of id/referenceId pairs)
manual_evidencereview: required
qualitative_reviewreviewPolicyId, reviewPolicyVersion

An expected value is either a literal with type and value, or a reference with type, referenceId and referenceDigest. Restricted objective criteria require the reference form. See criteria for value types and rules.

Composition contains rootGroupId and groups. A group has id, operator (all or any), and children, each with kind (criterion or group) and id. See composition.

EvidenceBundle

FieldTypeRequired
schemaVersion4Yes
definitionDefinitionReferenceSealed record only
evidenceDigestSHA-256 digestSealed record only
artifactDigestSHA-256 digestNo
observationsObservation arrayYes

DefinitionReference contains assessmentId, revision and revisionDigest. The draft omits definition and evidenceDigest.

Observation

Common fields are criterionId, evidenceRef, kind and completeness (complete or truncated). Criterion IDs must refer to declared criteria and observation/evidence reference IDs cannot repeat.

KindAdditional fields
textvalue: string
numbervalue: finite number; optional unit
setitems: scalar array; itemType
booleanvalue: boolean
jsonvalue: JSON
executionrunRef; assertions with assertionId and state (confirmed, refuted, unknown)
manualartifactRefs: string array
qualitative_revieworigin, reviewPolicyId, reviewPolicyVersion, reviewer, uncertainty, feedback, citations

Objective selected facts also carry executionFact and an origin with runRef and termination. Other observations may have an origin as permitted by the scope rules. See evidence, execution facts and qualitative reviews.

ReferenceRecord and ReferenceBundle

A reference draft has schemaVersion, referenceId, kind and value. Numeric/range records accept an optional unit; set records require itemType. A sealed reference adds referenceDigest.

Reference kinds are text, number, range, set, boolean and json. The bundle has schemaVersion, definition and references, an array of sealed records. It does not have its own digest.

EvaluationResponse

A complete result has schemaVersion, definition, evidenceDigest, optional artifactDigest, outcome, policyVersion, findings, evaluator and warnings. The evaluator has id and version. Each finding has criterionId, outcome, reasonCode, evidenceRefs, evaluatorId and evaluatorVersion.

An invalid-input failure has outcome and diagnostics only. Do not assume that definition or findings exist on a failure.

Observation port

Request fields: schemaVersion, definition, optional artifactDigest, criteria and limits.maxCapturedBytes. Each requested criterion includes criterionId, kind and applicable unit, itemType, assertionIds or executionFact.

Report fields: schemaVersion, definition, optional artifactDigest, provenance, observations and termination where required. A receipt contains definition, evidenceDigest, evidenceRefs, optional termination/artifactDigest and provenance. See report requirements.

PublicTechnicalResult

FieldType
schemaVersion4
outcomepass, fail, inconclusive, evaluation_error or withheld
findingsArray of criterionId, outcome and reason

No evidence references or private warnings are included. See projection.

The contract source defines the complete field unions and types.

Outcomes and errors

Evaluation outcomes

OutcomeMeaning
passThe required composition is satisfied.
failThe required composition has a decisive mismatch.
inconclusiveThe required composition cannot be resolved.
evaluation_errorA comparison error determines the required composition.
invalid_definitionThe definition is malformed or fails integrity checks.
invalid_referenceSupplied reference material is invalid or does not match.
invalid_evidenceEvidence is malformed, incompatible or fails integrity checks.

The first four return complete findings; the last three return only diagnostics. The required aggregate uses the precedence in composition.

Criterion findings

Finding outcomeReason codeMeaning
passMATCHObserved value matches.
failVALUE_MISMATCHObserved value does not match.
inconclusiveREFERENCE_UNAVAILABLERequired reference value unavailable.
inconclusiveEVIDENCE_MISSINGObservation absent.
inconclusiveEVIDENCE_TRUNCATEDObservation incomplete.
inconclusiveASSERTION_INCOMPLETEExecution assertion incomplete.
inconclusiveEXECUTION_UNVERIFIEDAssertion claim cannot establish correctness.
inconclusiveEXECUTION_INCOMPLETESelected run did not complete.
inconclusiveARTIFACT_MISSINGRequired manual artifact absent.
inconclusiveREVIEW_REQUIREDManual or qualitative review needed.
errorCOMPARATOR_ERRORComparison could not complete.
errorNUMERIC_OVERFLOWRelative tolerance bound overflowed.

ADVISORY_UNRESOLVED is the sole warning code; unresolved advisory findings do not determine the binding outcome.

Public reasons

Public reasonTechnical codes
matchMATCH
mismatchVALUE_MISMATCH
missing_evidenceEVIDENCE_MISSING, ARTIFACT_MISSING
incomplete_evidenceEVIDENCE_TRUNCATED, ASSERTION_INCOMPLETE, EXECUTION_INCOMPLETE
review_neededREVIEW_REQUIRED
unavailableREFERENCE_UNAVAILABLE, EXECUTION_UNVERIFIED
evaluation_errorCOMPARATOR_ERROR, NUMERIC_OVERFLOW

Public aggregate withheld means the definition contains restricted criteria. It does not indicate their outcomes.

Validation diagnostics

Diagnostics contain a safe schema path and a closed code, without submitted values. ValidationResult domains are invalid_definition, invalid_evidence, invalid_reference and invalid_result.

CategoryCodes
Serialized inputINVALID_JSON, DUPLICATE_KEY
Resource boundsINPUT_TOO_DEEP, INPUT_TOO_LARGE, TOO_MANY_ITEMS, TOO_MANY_DIAGNOSTICS
Unsafe inputUNSUPPORTED_INPUT, UNSAFE_OBJECT, UNSAFE_KEY, UNSAFE_NUMBER
ShapeUNEXPECTED_FIELD, MISSING_FIELD, INVALID_TYPE, INVALID_VALUE, UNSUPPORTED_VERSION
DefinitionDUPLICATE_ID, EMPTY_REQUIRED_CRITERIA, RESTRICTED_LITERAL
IntegrityDEFINITION_DIGEST_MISMATCH, REFERENCE_DIGEST_MISMATCH, EVIDENCE_DIGEST_MISMATCH
CorrespondenceMISMATCHED_DEFINITION, MISMATCHED_ORIGIN, UNKNOWN_REFERENCE, MISMATCHED_REFERENCE, UNKNOWN_CRITERION, MISMATCHED_OBSERVATION

Collection errors use OBSERVATION_PORT_ERROR or OBSERVATION_CANCELLED. Projection failures return PUBLIC_PROJECTION_REJECTED without diagnostic details.

Resource limits

The exported CONTRACT_LIMITS object defines these bounds. Limits apply to the complete validated record, including nested values.

ConstantMaximum
maxDepth12
maxNodes4,096
maxInputBytes262,144
maxSerializedBytes262,144
maxCombinedSerializedBytes786,432
maxStringLength16,384
maxIdentifierLength96
maxObjectKeys32
maxArrayLength128
maxCriteria64
maxGroups64
maxGroupChildren64
maxGroupDepth8
maxCompositionEdges127
maxReviewFeedbackBytes4,096
maxReviewFeedbackLength4,096
maxReviewCitations8
maxObservations128
maxSetItems128
maxEvidenceRefs32
maxDiagnostics32
maxCapturedBytes65,536

Byte counts are UTF-8. Length limits on individual strings and review feedback are UTF-16 code units. The combined serialized budget applies to the complete multi-record input. A record that fits a particular field limit can still exceed a total budget.

Input restrictions

The bounded snapshot rejects unknown keys, functions, accessors, unsupported prototypes, cycles, unsafe numbers and unsupported values. Numeric values must be finite; counts and offsets that require integers must be safe integers. Serialized input must be a JSON object and cannot contain duplicate keys.

The decoder does not replace transport limits. Cap bytes before buffering and reject adversarial live Proxy objects. See security and trust.

The release constants are the source for this table.

Troubleshooting

SymptomCheck
invalid_definitionSchema, revision, criterion IDs, composition and definition digest
invalid_evidenceDefinition lineage, observation kinds, exact units, origin and evidence digest
invalid_referenceReference ID, digest, kind, unit or item type and bundle lineage
inconclusiveMissing or truncated facts, unavailable references, interrupted runs or pending review
evaluation_errorComparator errors or numeric overflow; inspect private finding reasons
Collection errorAdapter logs, request/report scope and cancellation signal
withheldExpected when any criterion is restricted
PUBLIC_PROJECTION_REJECTEDUse the exact authorized definition and an unmodified complete evaluation result

Keep diagnostics private. Report reproducible problems with synthetic data to the issue tracker.

On this page