← Files Computable Systems EngineeringARCHIVED FILE

docs/verifier-v2.md

6.92 KB · Dec 3, 2026 · 18:30 UTC

↓ Download file

# Finite verifier record, version 2 (alpha)

This is an opt-in model. Version-1 concept and operational records retain their existing helpers and meanings. There is no implicit conversion from version 1: its prose steps have no executable guards or effects. Run `python3 scripts/verify.py examples/verifier/valid.json --review`; use `--scenario S1` for a focused scenario review and `--json --detail` for evidence. Python 3.10+ and the standard library suffice.

IDs are unique across declarations, statements, scenarios, and steps. `actors` declares participants; an exchange names its `from` and `to` actors and typed data `fields`. A field must match its declared data type, unit, and scale. Properties have `type` `bool`, `enum` (nonempty unique string `values`), or `int` (inclusive finite `min` and `max`), and `owner` `input` or `controlled`. An integer declaration requires `unit` (use `""` for dimensionless) and positive decimal-string `scale` (for example `"0.1"`); integer values are ticks of that scale in the named unit. Initial values, effects, and comparison literals use integer ticks, with no conversion or binary floating-point equality. Integer comparisons require the property's exact `unit` string. Data uses the same types. A boolean predicate is a comparison `{ref, op, value, unit?}` or `{all:[...]}`, `{any:[...]}`, or `{not:...}`. `==` and `!=` work for every type; order comparisons work only for integers. Predicate nesting is capped at 32. No arithmetic, unbounded domain, implicit coercion, or embedded code is supported. Unsupported operators are reported, never silently ignored.

Statements have `category` `need`, `goal`, `fact`, `assumption`, `observation`, or `requirement`, plus a declared `subject`. Only a requirement with `modality: "shall"`, `when`, and `predicate` is an executable obligation. The detailed JSON report renders controlled SHALL text from those fields. Other categories carry `text` and remain qualitative; they cannot carry normative predicate fields. `justifies` traces go from requirement to need or goal. `addresses` traces go from scenario to requirement. A trace proves a typed link, not satisfaction. Required review demands every requirement have a justification and every scenario have an `addresses` link; a focused scenario review checks its links and globally checks all declarations, types, traces, and requirements.

Requirement consistency enumerates **every allowed input assignment**. For each assignment, it seeks a controlled assignment satisfying all applicable requirement predicates. This checks joint satisfiability at a single instant; it does not prove reactive realizability or that scenario executions always meet requirements. An overlapping or three-way conflict reports the full applicable requirement set and a conflicting subset. Mutually exclusive applicability is valid. A requirement with no applicable declared input context returns `unknown`, avoiding a vacuous required pass. All domains and assignments are finite. The default assignment cap is 100,000; exceeding it returns `unknown`, never `pass`.

Each scenario begins at `start` with all controlled properties assigned in `initial`; inputs range over all declared values. A step is enabled if its guard is true and its `consumes` data are available. Its `effects` atomically assign controlled properties; unspecified properties and data persist; `produces` adds data availability. A step naming an exchange may produce only that exchange's declared fields. Scenario analysis tracks data availability, not payload values. Data are initially unavailable unless listed in `initial_data`. At nodes in `external_at`, any allowed input assignment may be taken before the next step, including the unchanged assignment. This models an explicit wait and external change, without promising that an event will arrive. Terminal nodes have no outgoing steps or external changes. `completion` is a subset of terminal nodes. For `require_completion: true`, every reachable nonterminal state must have **some path** to completion, and every initial input context must have a completion path. This is existential reachability from each state, not inevitable completion under all schedules or fairness. A permitted loop may coexist with an exit; a terminal abort may be intentional when `require_completion` is false. Disabled steps, missing data, and nonterminal dead ends are distinct findings. State and transition exploration is exhaustive only within the declared finite domains and cap; hitting the cap returns `unknown`.

The report includes a semantic SHA-256 of the candidate, checker version, scope, expected/completed obligations, limits, status, and deterministic findings with IDs. `--evidence FILE` reads a separate JSON object with `model_sha256` and `items`; a mismatch is stale and blocks review. Its digest identifies the evidence file but cannot authenticate the observations. `--review` demands all core obligations (`declarations`, `types`, `traces`, `consistency`, `scenarios`) complete successfully. Without it, the result is a draft check, not acceptance. `--scenario S1 --view` returns a smaller context view with all global declarations, requirements, and traces plus S1; it is not a verification input or result. The complete model remains the input to every check. A local agent can edit the model, checker, or output; this is not a protected runner.

Fixture expectations: [valid.json](../examples/verifier/valid.json) passes a required review, including mutually exclusive requirements, an explicit external wait, and intentional completion. Tests derive variants for undefined entities, type and unit mismatch, broken traces, pairwise and three-way conflicts, missing data, disabled path, and nonterminal dead end. They also cover intentional terminal abort, permitted loop, malformed and unsupported records, stale evidence, and state/assignment limits. These are synthetic semantics, not accepted requirements for a real system.


An optional independent finite-review scope manifest is now supported with
`--manifest FILE`. It contains exactly `version: 1`, a nonblank `source_revision`,
`requirements: [ID, ...]`, and `scenarios: [ID, ...]`. Both inventories must exactly
match the whole candidate even under focus; duplicates/malformed IDs are errors,
and missing, wrong-kind or unclassified IDs fail scope. Without it, legacy review
retains its existing candidate-derived scope. Reports expose semantic manifest
identity (and exact file-byte identity in the CLI) plus `analyzed_scenarios`;
inventory coverage never implies unselected scenario execution. This does not
authenticate acceptance or detect same-ID meaning changes. See the
[completion matrix and negative controls](capability-completion.md).

Scenario exploration runs independently of unsupported requirement applicability.
If a cap truncates exploration after a reachable dead end was fully examined,
that failure is retained alongside the unknown result for the remaining search.
Library analysis caps must be positive integers, excluding Boolean values.

SHA-256: 696d63320bd37817941d81dd6ce746593656d4fa95433549310df61d01f03882