Scenario coherence
OpenAgentWorks 1.4.0 adds the required feature
scenario_coherence_v1 for producers adopting these
bindings. Core wire version remains 1.0.0. Consumers that do not support
this feature must refuse it.
Run python3 -B tooling/build_validate.py PATH_TO_BAG
from a trusted distribution. Checks run across every scenario, including
alternates and refusals. No packaged code is executed by validation.
Response contract
A scenario uses response_schema_pointer to select
#, #/anyOf/0, or another declared top-level
response variant. The validator checks all observed response fields
together, including types, values and closed properties. The default
capture source is http for HTTP operations and
artifact for verification operations; an HTTP-verifying
adapter explicitly declares response_source: "http".
For example, an inventory oracle asserting
movement_type: "receipt" and
unique_effect_count: 1 requires those fields in the
selected success variant. A generic variant requiring an unasserted
code cannot admit this success.
Top-level equality predicates are partial observations: missing,
unobserved required response fields are not errors. This is an admission
check, not a proof that every complex schema has a satisfying
completion. Nested pointers or non-equality predicates require a
complete response_example; that witness must validate
against the full response schema and selected variant and satisfy all
response predicates. For example, a gte count predicate can
use a full response example with count 3.
Setup and state changes
Every scenario declares setup_assertions, with an empty
array explicitly meaning no additional typed predicates. Each assertion
has source_ref, left JSON pointer,
operator, and exactly one of value or
right pointer. Operators are eq,
ne, gte, lte, gt,
lt. For example, activation asserts equality between
/business_facts/debits_minor and
/business_facts/credits_minor, referencing its accounting
requirement.
Operation outcome_constraints condition on a response
schema fragment and constrain initial_state_schema,
request_schema, and additional setup assertions. An
inventory projection returning cancelled requires an already cancelled
seed unless an explicit cancellation command is bound. An operation
transition_contract identifies the data model and the
initial, requested and observed state pointers; the result must match
the requested target and an allowed transition.
Copied negative-case prose is not a universal precondition. The
feature rejects retained
initial_state.original_precondition and the legacy copied
canonical-acceptance precondition pattern. Original acceptance criteria
remain conditional authority. Typed bindings must be authored and
reviewed: the tool does not extract arbitrary natural-language rules or
certify full business correctness.
Regression suite
python3 -B tooling/test_scenario_coherence.py checks
forbidden fields, wrong types, wrong variants, generic error escape
hatches, missing selectors, witness failures, setup conflicts, missing
or contradictory transition commands, and explicit HTTP capture
bindings. CI runs this suite alongside request admission and existing
conformance checks.
Strict coherence v2 (OpenAgentWorks 1.5.0)
scenario_coherence_v1 retains its historical
partial-observation behavior. Packages requiring
scenario_coherence_v2 additionally require complete
response_example witnesses for every response-bearing scenario,
even simple equality predicates. Each observed pointer must resolve to a
typed property (or exact const/enum), including inside nested arrays and
local references. additionalProperties does not declare a
typed oracle field. The witness must satisfy the original root schema,
selected branch and every observation together; required fields and
oneOf exclusivity are never relaxed. Identical declared executable
inputs need a common admitted witness. Inconclusive completion is a
failure requiring producer clarification, not a proof of
satisfiability.
Operations may declare fixture_state_schema to exclude
pseudo-command fixture flags. Use existing
outcome_constraints to bind refusal/success outcomes to
real requests and persisted conditions.
response_field_guards entries contain an id, when_state
schema, when_request schema and forbidden_pointers: if both conditions
match, a response witness cannot include those unobserved facts. For
example, an authorization refusal cannot invent an inaccessible opening
balance.
These checks validate authored bindings. They cannot infer arbitrary
domain rules from prose, certify persistence from field names, or prove
an implementation observes the witness. Producers must review bindings
against normative requirements. audit_scenarios.py BAG
inventories all strict failures; validate.py BAG and
build_validate.py BAG enforce required v2 checks as part of
normal admission.
One shared implementation
Product repositories invoke a trusted pinned OpenAgentWorks release. Offline distribution may carry an unchanged release archive with SHA-256 archive and distribution pins. Do not fork core validators, execute tools from the imported bag, or catch-and-ignore standard errors. Product-specific adapters remain separate and report their additional checks without claiming the standard understands product semantics. The release pin is a reproducibility boundary, not a signature or independent authorship certificate.
V2 packages register build/toolchain-lock.json
containing the trusted release version and
distribution_sha256. Normal build validation compares these
with its own release inventory and refuses a missing or mismatched pin.
The consumer obtains the trusted release independently or verifies the
unchanged offline archive before execution.
UI form field schemas must match their bound request properties, including direct nested children; schema drift is rejected even when field names still match.