Skip to content

Commit f9dcd61

Browse files
committed
Make the fixture counting rule executable as fixtures-check
The ADR-0006 acceptance plan in fixtures/semantic-core/README.md required a fixtures-check command that fails when a named rule lacks a fixture or a fixture references an undefined code. The new CLI verb parses the plan's required-fixture tables (ranges, alternatives, shared-prefix shorthand), indexes every committed fixture and vector identity, and reports each required name as covered, named, unbounded, or absent per family. Reconciling the plan surfaced real divergences: T2202 is anticipated but undefined (the profile emits T2201), and several covered rules carried aspirational names that now cross-reference the committed identity that exercises them. Two new executable fixtures close the only absent names the current compiler can express: types.R3.unquantified-governed.fail and types.R3.unquantified-nominal.pass.
1 parent 8431f45 commit f9dcd61

11 files changed

Lines changed: 2022 additions & 1199 deletions

File tree

‎crates/avila-core-cli/src/fixtures_check.rs‎

Lines changed: 567 additions & 0 deletions
Large diffs are not rendered by default.

‎crates/avila-core-cli/src/main.rs‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![forbid(unsafe_code)]
22

3+
mod fixtures_check;
34
mod mcp;
45
mod queries;
56

@@ -72,6 +73,18 @@ enum Command {
7273
},
7374
/// Report the draft semantic profile and exact embedded vector identities.
7475
SemanticProfile,
76+
/// Report the semantic fixture corpus against the README's
77+
/// ADR-0006 required-fixture plan — which names exist, which are
78+
/// plan-referenced only, and which are absent.
79+
FixturesCheck {
80+
/// Exit nonzero when any required name is absent (unbounded names
81+
/// still report but do not fail).
82+
#[arg(long)]
83+
strict: bool,
84+
/// Emit the report as JSON instead of a table.
85+
#[arg(long)]
86+
json: bool,
87+
},
7588
/// Read authoritative JSON and emit its deterministic canonical bytes.
7689
Canonicalize { document: PathBuf },
7790
/// Compile a v0.2-draft contract against one immutable registry snapshot.
@@ -522,6 +535,11 @@ fn run() -> Result<ExitCode, Box<dyn Error>> {
522535
serde_json::to_string_pretty(&semantic_profile_report()?)?
523536
);
524537
}
538+
Command::FixturesCheck { strict, json } => {
539+
return Ok(ExitCode::from(
540+
fixtures_check::fixtures_check(strict, json)? as u8,
541+
));
542+
}
525543
Command::Canonicalize { document } => {
526544
let source = fs::read(document)?;
527545
let canonical = canonicalize_json(&source)?;
@@ -1306,7 +1324,7 @@ mod tests {
13061324
assert_eq!(report.status, "draft");
13071325
assert_eq!(report.total_vectors, 103);
13081326
assert_eq!(report.implemented_vector_sets.len(), 4);
1309-
assert_eq!(report.total_compiler_fixtures, 68);
1327+
assert_eq!(report.total_compiler_fixtures, 70);
13101328
assert_eq!(report.implemented_compiler_fixture_sets.len(), 5);
13111329
assert_eq!(report.total_campaign_fixtures, 16);
13121330
assert_eq!(report.implemented_campaign_fixture_sets.len(), 1);

‎crates/avila-core-compiler/tests/compiler_fixtures.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ fn compiler_type_fixtures_are_executable() {
123123
] {
124124
fixture_count += execute_suite(&fixture_root, suite_name);
125125
}
126-
assert_eq!(fixture_count, 68);
126+
assert_eq!(fixture_count, 70);
127127
}
128128

129129
// ---------------------------------------------------------------------------

‎docs/product/CORE_TOOLS.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ commands complement the query suite. `evaluate` accepts `--artifact FILE`
9393
(repeatable) to re-hash supplied bytes against each attested artifact
9494
identity — every admission then states `verified` or `not_checked`; without
9595
any, the report stays a digest-only evaluation and its identity is
96-
unchanged.
96+
unchanged. `fixtures-check` reports the committed fixture corpus against the
97+
ADR-0006 required-fixture plan in `fixtures/semantic-core/README.md` — every
98+
required name as `covered`, `named`, `unbounded`, or `absent`, and any
99+
fixture that references a code neither diagnostic catalog defines fails the
100+
check; `--strict` also fails on absent names.
97101

98102
## Native workbench
99103

‎docs/roadmap/AGENT_WORK_QUEUE.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,3 +826,22 @@ qualification bounds, package re-pinning, or evidence re-blessing.
826826
> infrastructure. Complete the required checks and visually exercise the app.
827827
> Continue through ready work without routine confirmation; stop at the stated
828828
> review point with a concise handoff.
829+
830+
### Executable fixture-counting rule — implemented 2026-09-17
831+
832+
The README's ADR-0006 counting rule is now `avila-core fixtures-check`: the
833+
committed corpus is embedded, the required-fixture tables are parsed (with
834+
`A1..A10` ranges, `a/b` alternatives, `pass/fail` suffixes, and
835+
prefix-inheriting shorthand), and every required name reports `covered`,
836+
`named`, `unbounded`, or `absent` per family. A fixture referencing a
837+
diagnostic code neither catalog defines fails outright; `--strict` fails on
838+
any absent name. Reconciling the plan surfaced real divergences: T2202 is a
839+
plan-anticipated code the profile does not define (the unquantified-governed
840+
case emits T2201), and several covered rules carried aspirational names that
841+
now cross-reference the committed vector or fixture identity. Two new
842+
executable fixtures — `types.R3.unquantified-governed.fail` and
843+
`types.R3.unquantified-nominal.pass` — closed the only absent names the
844+
current compiler can express. The remaining 128 absent names map to
845+
unimplemented semantics: lifecycle enforcement, the campaign-state machine,
846+
policy selection and organization rules, per-condition admission fixtures,
847+
scope/qualification evaluation, and the scenarios corpus.

‎docs/roadmap/STAGE_0_STATUS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ external product gate.
3636
| Surface | State | Evidence present | Material boundary still open |
3737
| --- | --- | --- | --- |
3838
| Canonical semantic kernel | Partial | 103 pure vectors: canonical values, exact unit scaling, three-valued predicates, and four-state verdict calculus including every categorical `equals`/`in_set` edge and the mixed admitted+non-admitted `not_evaluated` ordering | Total archive/package canonicalization, remaining predicate and aggregation boundaries, and independent implementation |
39-
| Static contract compiler | Partial | 68 fixtures across R1–R10, deterministic source diagnostics, exact lowering, and content-identified compiled snapshots | Package binding halves, qualification, organization policy, selection, lifecycle, and accepted profile |
39+
| Static contract compiler | Partial | 70 fixtures across R1–R10, deterministic source diagnostics, exact lowering, and content-identified compiled snapshots | Package binding halves, qualification, organization policy, selection, lifecycle, and accepted profile |
4040
| Diagnostic contract | Implemented for current compiler slice | 34 catalogued finding codes, anchored JSON Pointers, typed RFC 6902 repairs, mutation tests, and a 23-case real-contract defect corpus pinning status, findings, and snapshot identity for seeded defects in the committed CASE-001 pair, and a coverage check that fails when a catalogued code is exercised by no fixture and no named test | Measured false-block/clarification outcomes |
4141
| Campaign evaluation | Partial | 15 fixtures for snapshot binding, type-level admission, quarantine propagation, exact verdicts, qualification boundaries including `require_qualification` enforcement (S-035), and proof that optional presentation state cannot alter PASS or FAIL; CASE-000 adds one ACTINV → Aftermatter composition whose two computational steps are executed; `evaluate --artifact` re-hashes supplied bytes against attested identities and marks every admission `verified` or `not_checked` | Receipts are verified in the case runner, not the evaluator; capability identities beyond an executable digest, signed A2, A7/A8/A10, full qualification and policy evaluation, and invalidation remain open |
4242
| Internal composed case | Implemented as an unqualified specimen | CASE-000 revision 3 binds 14 source attestations and 6 output claims; with all three roots supplied the runner re-hashes all 18 artifacts, executes ACTINV 1.0.1 through Aftermatter's frozen R0 builder under a digest-pinned interpreter (`avila-labs.aftermatter/build-r0-case@1`) and then Aftermatter over the fresh inventory (`avila-labs.aftermatter/evaluate@1`), verifies both receipts against the committed ones, extracts all 6 claims from fresh results that reproduce the frozen artifacts byte for byte, and reproduces two numeric `PASS / bounded.lt.within` verdicts plus the expected Clive route-state `FAIL / categorical.equals.mismatch` with no review stage | Capability packages beyond an executable digest, a system interpreter pinned only by digest, categorical waste-class or multi-route aggregation, qualification evidence, and broader physical applicability |
@@ -54,7 +54,7 @@ external product gate.
5454
| --- | --- | --- |
5555
| Authoritative contract and verdict foundation | Partial | Current compiler and campaign slice plus package/bound-plan model driven by the selected pilot |
5656
| Proposed semantic profile and adversarial fixtures | Partial | All ADR-0006 acceptance conditions; draft status remains visible |
57-
| Question-first workbench | Partial | The case workbench renders every stage of a run and the specimen compiler now does JSON-level preflight editing — open a contract/registry pair, recompile on demand, apply exact repair candidates, save explicitly; form-based authoring and testing with pilot participants remain |
57+
| Question-first workbench | Partial | The case workbench renders every stage of a run and the specimen compiler does JSON-level preflight editing plus form-based authoring over the question layer — bounded question, policy, assumptions, inputs, workflow steps (capability type, input bindings, typed parameters, seed), and requirements; review declarations and material factors stay JSON-level. Testing with pilot participants remains |
5858
| Deterministic planning and blocked states | Implemented for the current slice | `run --plan` emits a content-identified `bound-plan/v0.1-draft` document inside the run report: per step, a closed decision vocabulary — `reuse_committed`, `execute`, `blocked`, `refused`, `not_executed` — where `execute` requires the declared capability's bytes to hash-verify at the supplied path and every required environment key to be valued (a step the report calls `planned` without those is `blocked` with named reasons); a plan-level `ready`/`blocked`/`refused`/`unavailable` status plus an `unresolved` list naming unmet roots and capabilities; state fixtures over synthetic and committed cases pin every decision, including determinism |
5959
| Capability threat model and conformance design | Design documented | `docs/architecture/CAPABILITY_THREAT_MODEL.md` reviews the implemented adapter/execution boundary — each defense named with the adversarial test pinning it — and names the residual risks (no sandbox, check-to-exec TOCTOU, env values outside invocation identity, no resource accounting) plus the conformance-vector definition the Stage-3 suite must satisfy; the suite itself and the capability SDK remain Stage 3 |
6060
| Evidence-package spike | Partial | CASE-000 performs an integrity/compile/execute/generate/bind/evaluate/replay round trip with every declared source byte verified and one execution receipt; package-root semantics are now documented in EVIDENCE_MODEL (confined documents, digest-bound artifacts, content identity under relocation — test-pinned) and the independent Python verifier is exercised with named-outs open; redaction/retention *rules* are a policy decision and are named owner-gated |
@@ -70,7 +70,7 @@ external product gate.
7070
| Known shortcut refusal | Exercised | An adversarial designer arm (CASE-002 campaign 3, amendment A6) confirmed refusals for out-of-envelope candidates, a wrong interpreter digest, a particle count below its domain, and coverage on a weaker basis, and obtained undeserved verdicts only by rewriting the package; the identity log and the manifest pin (S-030) now make a rewritten package a refusal or a visibly different identity; `execution_policy.require_signatures` is set on CASE-001, CASE-002 and CASE-003, and the campaign adversarial checker verifies each log row's ADR-0015 signature against a trust root (S-043), so a log row edited after Core wrote it classifies `refused` | A predeclared shortcut proposed and refused inside a scored search arm (EXP-005, paused) |
7171
| Autonomous search outcome | Reached twice | CASE-002 campaign 3: a language-model designer found an all-PASS design 277 kg lighter than the sweep's best at its second transport and stopped by judgment; the seeded surrogate found one at its eleventh. CASE-003 campaign 1, under the manifest pin: the same designer found an all-PASS spreader five times lighter than the sweep's bar at its sixth evaluation; see each case's `RESULTS.md` | EXP-002 ran on CASE-003 (2026-09-05, 15 trials, three arms): non-discriminating, every arm reached the optimum in one to three evaluations; Core's contribution must be isolated on a harder case (CASE-002). The predeclared shortcut was never proposed, so refusal during a successful search is still unexercised |
7272
| Optional practicality routing | Implemented for the slice | Exact instructed dossier exercises both `request_changes` and `present_to_user`; omission leaves Core fully usable |
73-
| Independent verification | Implemented for the first profile | `verifier/avila_core_verify.py` (S-041) reproduces package identity, receipt invocation identities, claims binding and every numeric and categorical verdict and margin for six cases with zero mismatches, and agrees with every semantic-core vector; ADR-0015 signatures are verified from scratch against a trust root (S-042); every qualified claim's persisted applicability context is re-evaluated against the bound record's scope and bound to the step's receipt (S-046), with CASE-002's pre-ADR-0018 claims named as mismatches until its actinv re-pin; requirement-set coverage is re-derived from the committed declaration (S-047) and `campaign_sha256` recomputed; staged-review records — the presentation gate's committed half — verified (both digest rules, presented-evidence re-binding, readiness, dispositions, eligibility-policy digest), with unresolvable campaign bindings named `not_checked`; the compiled snapshot itself is recomputed by the verifier's independent lowering port (`avila_core_lower.py`), proved against all 68 compiler fixtures' pinned snapshots and every committed case | Reviewer attestation is reported, never authenticated; the port reproduces whether a pair compiles and what it compiles to, not the finding vocabulary a rejected compile would report |
73+
| Independent verification | Implemented for the first profile | `verifier/avila_core_verify.py` (S-041) reproduces package identity, receipt invocation identities, claims binding and every numeric and categorical verdict and margin for six cases with zero mismatches, and agrees with every semantic-core vector; ADR-0015 signatures are verified from scratch against a trust root (S-042); every qualified claim's persisted applicability context is re-evaluated against the bound record's scope and bound to the step's receipt (S-046), with CASE-002's pre-ADR-0018 claims named as mismatches until its actinv re-pin; requirement-set coverage is re-derived from the committed declaration (S-047) and `campaign_sha256` recomputed; staged-review records — the presentation gate's committed half — verified (both digest rules, presented-evidence re-binding, readiness, dispositions, eligibility-policy digest), with unresolvable campaign bindings named `not_checked`; the compiled snapshot itself is recomputed by the verifier's independent lowering port (`avila_core_lower.py`), proved against all 70 compiler fixtures' pinned snapshots and every committed case | Reviewer attestation is reported, never authenticated; the port reproduces whether a pair compiles and what it compiles to, not the finding vocabulary a rejected compile would report |
7474
| Performance baseline | Measured once, debug build (2026-09-04) | Verify-only run of CASE-003: 10–40 ms. CASE-002 with every root supplied: 0.31 s per invocation, almost all of it re-hashing ~250 MB of static nuclear and ACTINV artifacts; a fresh screen adds ~30 ms; activation staging copy plus hash 1.1–1.5 s against a 12.4 s step; transport 4–6 min per candidate at 5e5 particles. Attempt lineage: 0.36 ms per log line plus 18 ms. See the [proposal review](reviews/2026-09-04-architecture-proposal-review.md) | A release-build baseline (EXP-003) with a frozen workload and machine, cold and warm separated, machine time separated from model time |
7575
| Tool license and deployment feasibility | Open | Every external tool in the chosen reference chain |
7676

0 commit comments

Comments
 (0)