Skip to content

spec(070): extraction rules 2: token extractors, exact-value conditions, declared date formats and rules first (amends 038 and 032) - #574

Merged
bartekus merged 1 commit into
mainfrom
spec/070-extract-rules-2
Nov 8, 2026
Merged

bartekus merged 1 commit into
mainfrom
spec/070-extract-rules-2

Conversation

@bartekus

@bartekus bartekus commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Spec 070 for #572: rustev.extract-rules/2, amending 038 (3.3.3, 3.3.5, 3.5, 3.7, 3.11, 3.12, 3.14) and 032 (3.2.1, 3.9.3). Ratified by the owner on 2026-11-08 for release 0.7.0 (A-90): status: approved, implementation: pending.

  • Value extractors: token_after{source, terms, charset, min_len, max_len} (max_len <= 64, charset of at most 8 ASCII classes or ranges), token_matching{source, shape, occurrence} (at most 16 elements, repeats <= 16, matched possessively at token boundaries, never a regular expression), date{source, format, months, occurrence} (formats ymd_dash, dmy_name, mdy_name, dmy_slash, mdy_slash, dmy_dot; month names only from a declared month_tables entry), and vocabulary_after{source, terms, vocabulary} (graded hint).
  • Conditions: equals and one_of (at most 256 values) over inputs whose accepted provenance excludes model-derived, compared exactly; an unreadable source leaves the field absent source_unavailable and is never false.
  • fill: rules_first with optional required: evaluates the program before listing; a fully filled request is recorded skipped{rules_filled} with no attempt or cost; otherwise one rustev.extract-request/1 asks only for the absent fields (subset schema and digest). Compile-time budgets unchanged.
  • WebAssembly: measured 4,822,101 bytes (merge-queue run 42514479928 over main 59cc7c3); headroom 420,779 bytes under 057's 5 MiB gate. The owner pre-approved 6 MiB in the increment that crosses it, should one.
  • Increments: (1) contract, (2) core extractors and conditions (may land as 2a/2b), (3) rules first, runtime, conformance, acceptance group.

A-90 is added after A-88 because A-89 (spec 069, #569) is not on main yet.

Changes

  • specs/070-extract-rules-2/spec.md (new)
  • docs/decisions/00-founding-decisions.md: A-90
  • .statecraft/derived/: refreshed shards

Verification

  • make refresh, make gate (lint 0 warnings)
  • spec-spine couple --base origin/main --head HEAD

Closes nothing; #572 stays open until implementation.

Review notes

  • Fixed (first round): section 5's token_after example now follows 3.2.2's single-separator skip (Ref: abc12 stops at a; Ref: # ABC12 stops at #).
  • Not a defect (second round, finding 888cc... superseded): "the PR includes no .statecraft/derived shards". The PR does include .statecraft/derived/spec-registry/by-spec/070-extract-rules-2.json, .statecraft/derived/codebase-index/by-spec/070-extract-rules-2.json and inputs.json; the AI review excludes .statecraft/derived (review.exclude), so it does not see them. The governance job (make gate, including spec-spine check) passes on this head.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Review

docs/decisions/00-founding-decisions.md — A-90 row

The row is internally consistent. The A-89 gap is explicitly addressed ("This row follows A-88 because A-89 (spec 069, #569) was not on main when it was written"). The WebAssembly budget cross-reference to spec 057's 5 MiB gate and the pre-approval for 6 MiB are consistent with section 3.11 of the spec. No defects.

specs/070-extract-rules-2/spec.md

The spec is structurally sound: frontmatter lifecycle values, amends list, extends natures, invariants, and increment plan are consistent. The compatibility guarantees in 3.10 and their reflection in section 5 (committed goldens byte-identical) are coherent. The rules_first compile-time budget accounting (3.7.3) correctly prevents skipping from making an otherwise-refused definition admissible.

Concrete defect — section 5 negative case contradicts 3.2.2

Section 3.2.2 specifies the skip after a term as: any spaces/tabs, then at most one separator byte from :, #, and -, then any spaces/tabs.

For the input Ref: # abc12 with term Ref:

  1. 0 leading spaces
  2. : consumed (the one permitted separator)
  3. two trailing spaces consumed
  4. Skip ends — position is at #

The maximal run of upper/digit bytes starting at # is zero; the rule does not apply. The run is empty at #, not at a.

Section 5 states: "Run is empty at a; rule does not apply; nothing case-folded." Reaching a requires the skip to consume both : and # as separators — two separator bytes — which contradicts the "at most one" rule in 3.2.2. The note "nothing case-folded" (meaningful only if the cursor is at a letter) confirms the author expected a to be the starting position, implying the skip was intended to allow multiple separators for this input.

The example either requires 3.2.2 to be amended to "any number of separator bytes" (or "one or more"), or the example input needs to be changed to something that reaches a lowercase letter with a single separator (e.g., Ref: abc12). As written, the normative algorithm and the negative-case example are contradictory on this input, and an implementor following 3.2.2 literally would diverge from the stated expected behavior.

{"head": "6b8d52d81c394d3f99581632fc18103b244dbcad", "verdict": "findings", "findings": [{"path": "specs/070-extract-rules-2/spec.md", "line": null, "severity": "medium", "category": "correctness", "summary": "Section 5's negative case for `token_after` over `Ref:  # abc12` with charset `upper`/`digit` states the run is empty 'at `a`', but section 3.2.2's 'at most one separator byte' rule causes the skip to stop at `#` (after consuming only `:`), making the run empty at `#`, not `a`; reaching `a` requires consuming two separator bytes, contradicting the normative algorithm."}]}

Subject: 59cc7c3...6b8d52d, diff digest 398a1948a7fb3c22bcf27788800d5b4a168a357c57a9e20fd464cac795b375d7, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 8, 2026 19:50 — with GitHub Actions Error
@bartekus
bartekus force-pushed the spec/070-extract-rules-2 branch from 6b8d52d to 760c72a Compare November 8, 2026 19:51
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Review of head 760c72ab4830bb8bf7eb2061715d0313ae501029

Changed files: docs/decisions/00-founding-decisions.md and specs/070-extract-rules-2/spec.md

Decisions document (A-90 entry)

A-90 is internally consistent with the spec frontmatter (status: approved, implementation: pending, created: 2026-11-08, target release 0.7.0). The gap at A-89 is explicitly explained: spec 069 (#569) was not on main at the time of writing. The entry disclaims any authorization for release, push, or publication as required by convention.

Spec document

Frontmatter: amends names 038-structured-extraction and 032-evidence-quality, consistent with section 3.8's explicit "amends 032 3.2.1 and 3.9.3" and the extensive amendments to 038 3.3.3, 3.3.5, 3.5, 3.7, 3.11, 3.12, 3.14. The extends entries correctly distinguish amending (contract, core, conformance cases) from additive (runtime tests, binding type declarations, Makefile and acceptance scripts).

Governance principles: "Proposals, never grants" is applied throughout; equals/one_of are compile-time-refused over model-derived inputs (3.4.2, 3.5.2); vocabulary_after fields carry hint grade statically and dynamically, preventing hard gates without corroboration (3.8, I-5); skipped requests record their outcome and preserve compile-time budgets unchanged (3.7.3, I-4). "Unresolved is an answer" is preserved: not{equals} over a missing source remains source_unavailable, never true (3.4.5, I-3).

Bounds and determinism: The worst-case work analysis (3.6.2) is arithmetically consistent: 16 elements × 16 bytes + 1 end-boundary byte = 257 bytes per start position for token_matching; 10 bytes per start for numeric date formats; 48 names of 16 bytes for name formats. No floating point, no regex engine, no Unicode tables (I-1, R-1).

Compatibility: The I-1 invariant is stated, the negative case "every committed golden recompiled byte-identical" is in the acceptance criteria, and 3.10 explains how /1 programs keep their bytes.

WebAssembly measurement (3.11.1): Taken at base commit 59cc7c32 with #569 (described as a Node-only change). Node-only changes do not affect the WASM binary, so the stated headroom of 420,779 bytes against the 5 MiB gate is a valid representation of the current state.


Defect: missing derived shards

The REPO CONTEXT shows that every spec from 001 through 068 has corresponding entries in both .statecraft/derived/spec-registry/by-spec/ and .statecraft/derived/codebase-index/by-spec/. AGENTS.md requires: "make refresh regenerates .statecraft/derived/; commit the shards with the spec edit that staled them." Adding specs/070-extract-rules-2/spec.md stales the registry; the PR diff contains no corresponding derived shard files. This omission would cause make gate to fail.

{"head": "760c72ab4830bb8bf7eb2061715d0313ae501029", "verdict": "findings", "findings": [{"path": "specs/070-extract-rules-2/spec.md", "line": null, "severity": "medium", "category": "correctness", "summary": "Adding a new spec.md stales the derived registry, but the PR includes no corresponding .statecraft/derived/spec-registry/by-spec/070-extract-rules-2.json or .statecraft/derived/codebase-index/by-spec/070-extract-rules-2.json shards; AGENTS.md requires committing refreshed shards with the spec edit that staled them, and their absence will cause make gate to fail."}]}

Subject: 59cc7c3...760c72a, diff digest f1fbccc17ef7c983b1bc38896f623d0306b1f50a0dd97790970e4991f01901e3, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 8, 2026 19:58 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the spec/070-extract-rules-2 branch from 760c72a to d205176 Compare November 8, 2026 20:00
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files against governance context.

docs/decisions/00-founding-decisions.md — A-90 entry

A-90 records the owner's approval of spec 070 on 2026-11-08 and cross-references A-87/A-88/A-89, which precede it in the table. The entry is internally consistent with the spec's frontmatter (status: approved, created: 2026-11-08, claimed ratification A-90). Per the review contract, this is a data claim, not authority.

specs/070-extract-rules-2/spec.md

Frontmatter and lifecycle: status: approved + implementation: pending is a valid work order per the contract table. amends lists 038-structured-extraction and 032-evidence-quality; the amended specs' .md files are not edited, consistent with the contract rule. extends ownership claims use the correct nature values. No 062 gap is introduced by this PR.

Internal consistency checks:

  • Section 3.3.3 date format table — "Covers" column: For dmy_slash (Covers: DD/MM/YYYY), mdy_slash (Covers: MM/DD/YYYY), and dmy_dot (Covers: DD.MM.YYYY), the pattern uses D/M (a maximal run of 1 or 2 digits), not the fixed 2-digit DD/MM. The example for dmy_slash shows 2/3/2026 (single-digit day and month), which contradicts the Covers label DD/MM/YYYY. For mdy_name, Covers says Mon DD, YYYY, but the example November 2 2026 (single-digit day, no comma) is not described by that string. The Pattern column and prose are normative and correct; the Covers column is misleading shorthand that contradicts the examples in the same table.

  • Section 3.3.3 vs. section 5 on calendar-invalid dates: "later matches are not tried" (3.3.3) refers to later text occurrences; "next rule tried" (§5 negative case) refers to the next field rule. These are consistent.

  • I-3 and 3.4.5 (not{equals} over unresolved source → source_unavailable, never true): consistent.

  • Obligation I-2 and 3.3.3 (token_after never cut short, calendar-invalid makes rule not apply): consistent.

  • 3.6.2 bounds: token_matching examines ≤16 elements × ≤16 bytes = 256 bytes per start, plus 1 end-boundary byte = 257, with up to 8 class-entry comparisons per byte — bounded and correctly stated.

  • Rules-first compile-time accounting (3.7.3): skipped requests still count against max_semantic_requests, preventing admission of otherwise-refused definitions.

  • vocabulary_unavailable as a new absence reason is introduced in 3.3.5 and correctly referenced in 3.7.3 and §5.

  • WebAssembly budget section (3.11): references a specific past merge-queue run as a baseline; the pre-approved 6 MiB gate raise is tied to a measured crossing, which is correct governance.

No security defects found. The possessive, non-backtracking matching and explicit work bounds per source byte are correct mitigations.

{"head": "d2051768720f8bb9860427fa80c5ef67374415d9", "verdict": "findings", "findings": [{"path": "specs/070-extract-rules-2/spec.md", "line": 183, "severity": "low", "category": "correctness", "summary": "The date format table's 'Covers' column uses fixed-width DD/MM notation for dmy_slash, mdy_slash, and dmy_dot, contradicting the D/M patterns and examples (e.g., 2/3/2026), and describes mdy_name as 'Mon DD, YYYY' while the example 'November 2 2026' (single-digit day, no comma) is not covered by that string."}]}

Subject: c40b37e...d205176, diff digest 30cc7ce11152fe2e0665109088b21efaf2054e218760b207df720a67fd63aaaa, 1 call(s). An AI comment is not an approval.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files against the governance context.

docs/decisions/00-founding-decisions.md — A-90

The entry records the owner's act as "approved" (The owner approved spec 070). The two immediately preceding entries for the same kind of act (A-88 and A-89) both use "ratified" (The owner ratified spec 068, The owner ratified spec 069). The spec body itself consistently uses "ratified" (Approved: ratified by the owner on 2026-11-08 (A-90)). No rule is violated, but the word choice in the decisions table diverges from the adjacent pattern. Low severity, wording.

specs/070-extract-rules-2/spec.md

Frontmatter is well-formed: status: approved, implementation: pending (a valid work-order pair per the contract), amends names 038 and 032 (consistent with the title and body), depends_on lists all specs 070 extends or amends, obligations are keyed and anchored.

Behavioral invariants checked:

  • I-1 (compatibility): Section 3.1.3 and 3.10.1 together close the gap: a /1 document containing a /2 construct is refused at parse; a /1 program's plan bytes and PlanId are unchanged.
  • I-2 (no silent conversion): token_after and token_matching yield verbatim bytes or nothing; date renders only via the fixed YYYY-MM-DD mapping after calendar-validity; calendar-invalid dates make the rule not apply rather than pass through (confirmed in negative-case table vs. the deliberately different date_iso behavior).
  • I-3 (unresolved source never false): 3.4.5 is explicit: an unresolved equals/one_of source ends evaluation as source_unavailable; the negative case for not: {equals} over a missing input confirms.
  • I-4 (skipped request): 3.7.3 records skipped{rules_filled} with no attempt or cost; 3.7.3 also keeps compile-time budget counts unchanged (preventing budget circumvention).
  • I-5 (vocabulary hint): 3.8's static ceiling assignment in phase e2 and the dynamic grade ensure static and dynamic grades agree; the hard-gate refusal (category 14) is preserved.

Security-relevant constraint checked: equals/one_of sources must exclude model-derived (3.4.2, 3.5.2), enforced at compile time — consistent with Principle VI.

Work bounds (3.6.2): token_matching is bounded at 257n byte examinations per source byte; vocabulary_after at one token of ≤ 64 bytes against ≤ 4096 options. No backtracking. Determinism requirement (R-1) is consistent with wasm32 target.

One low-severity wording inconsistency noted below.

{"head": "667b2cf378296a77961c1f2ef22abecac9281b36", "verdict": "findings", "findings": [{"path": "docs/decisions/00-founding-decisions.md", "line": 283, "severity": "low", "category": "other", "summary": "A-90 records the owner act as 'approved' while the adjacent A-88 and A-89 entries and the spec body itself use 'ratified' for the same kind of act."}]}

Subject: c40b37e...667b2cf, diff digest 5606209f2418aa25c4e9c2c2915c5151d2f671bf1ef6ccb38ac3972c7993d52b, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 8, 2026 20:12 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the spec/070-extract-rules-2 branch from 667b2cf to 34542d3 Compare November 8, 2026 20:13
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Review of PR 34542d3

Summary

This PR introduces a decision record entry (A-90) and a new approved spec 070-extract-rules-2, covering token extractors, exact-value conditions, declared date formats, and a rules_first fill mode amending specs 038 and 032.

Governance compliance

  • Frontmatter status: approved with implementation: pending is correct for a ratified work order per contract.md.
  • amends edges are declared once in the new spec's frontmatter; the amended specs (038, 032) are not edited, consistent with the contract.
  • A-90 records the owner ratification claim; I cannot verify the owner act but the claim is internally consistent with the spec's approved status.

Technical review

Consistency and correctness:

The evaluation bounds in 3.6.2, possessive shape semantics in 3.3.2, calendar-validity logic in 3.3.3 (including the Gregorian leap-year rule), exact-value condition provenance restriction (3.4.2), hint grade propagation (3.8), and rules-first skip/partial request behavior (3.7) are internally consistent throughout.

The observable negative cases in section 5 are consistent with the spec text. For example:

  • "31 Feb 2026" is calendar-invalid → rule does not apply, next rule tried (not "later occurrence matches") — distinction is correctly maintained.
  • date_iso behavior (no boundary, defers calendar check to 038 3.4) vs ymd_dash (boundary-anchored, calendar-invalid makes rule not apply) is correctly differentiated.
  • XBA123 and BA12345 token_matching cases are consistent with the start-boundary and end-boundary definitions.

Security: No regular-expression engine, no backtracking, bounded per-byte work stated explicitly in 3.6.2, exact-value conditions restricted to non-model-derived sources only, vocabulary_after graded hint with uncorroborated_hint refusal blocking authority use. The "proposals, never grants" principle is maintained throughout.

Single documentation inconsistency found:

In the date format table (section 3.3.3), the "Layouts covered" column for mdy_name lists three of the four combinations produced by optional . and optional ,: "Mon D, YYYY; Mon D YYYY; Month D, YYYY" — but omits "Month D YYYY" (long name, no comma). The Pattern description ("optional . after Mon, optional , directly after D") and the examples column ("November 2 2026") both cover this fourth case. The Pattern is authoritative; this is a documentation gap in the table that could mislead an implementor checking only the Layouts column.

{"head": "34542d34e7767c6d74a3f7a1b43709acb91d2f39", "verdict": "findings", "findings": [{"path": "specs/070-extract-rules-2/spec.md", "line": 183, "severity": "low", "category": "correctness", "summary": "The 'Layouts covered' column for mdy_name in the date format table omits the 'Month D YYYY' combination (long name, no comma), though the Pattern description and the 'November 2 2026' example both cover it, creating a documentation inconsistency that could mislead implementors."}]}

Subject: f81dc04...34542d3, diff digest f1dc2af40a8d7fcf8669384873b647f6ed8d8697aa1e8bbbb9a475937b715cba, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 8, 2026 20:17 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the spec/070-extract-rules-2 branch from 34542d3 to 353d41f Compare November 8, 2026 20:21
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Review of docs/decisions/00-founding-decisions.md and specs/070-extract-rules-2/spec.md

decisions file — A-90

The entry is internally consistent with the spec: status approved, implementation: pending, amends 038 and 032, for release 0.7.0, quotes the owner's ratification words from 2026-11-08, notes the WASM pre-approval, and closes with the standard no-authorization disclaimer. No contradiction with earlier entries.

spec.md — structural pass

Frontmatter is well-formed: approved / pending is a valid work-order state per the contract. amends lists 038-structured-extraction and 032-evidence-quality. extends entries are consistent with the territory section. depends_on covers all specs explicitly built on; spec 004 is cited contextually in 3.12, not as a territory dependency, so its absence from depends_on is not a defect.

Computation bounds and security

Possessive matching (3.3.2) and the per-start bounds in 3.6.2 are consistent: 16 elements × 16 bytes + 1 end-boundary byte = 257 bytes per start, times 8 class entries = 2,056n comparisons — O(n), no backtracking. The 48-name bound for date name formats is correct (12 months × 4 names per table). No regular expression engine, no Unicode table, no floating point (R-1). No DoS vector in the stated design.

One concrete defect found

specs/070-extract-rules-2/spec.md, section 3.3.3, mdy_name row of the date format table.

The normative description reads "optional . after Mon, optional , directly after D" — two independent optional elements, yielding four valid combinations:

no comma comma
no dot Mon D YYYY ✓ listed Mon D, YYYY ✓ listed
dot Mon. D YYYY ✗ absent Mon. D, YYYY ✓ listed

The "Layouts covered" column lists five patterns (including the Month D / Month D, YYYY long-name variants) but omits Mon. D YYYY. The normative text is correct; the table, which purports to enumerate covered layouts and may be used as an implementor checklist or conformance-test seed, is incomplete. An implementor building test cases solely from the table would miss this combination.


{"head": "353d41f17bfefe4a7c166b6bb7c2b53b91c25089", "verdict": "findings", "findings": [{"path": "specs/070-extract-rules-2/spec.md", "line": 192, "severity": "low", "category": "correctness", "summary": "The mdy_name row's 'Layouts covered' column omits the Mon. D YYYY combination (dot after month, no comma after day), one of four valid combos implied by the normative text's two independent optionals; an implementor or conformance-test author using the table as a checklist would miss this case."}]}

Subject: f81dc04...353d41f, diff digest 3c3191f9c1437a299f3b99ad8f4f9d9714a8ee6c9a3f2fe99db7984408c169eb, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 8, 2026 20:31 — with GitHub Actions Inactive
@bartekus
bartekus force-pushed the spec/070-extract-rules-2 branch 2 times, most recently from db10414 to 34b8f6f Compare November 8, 2026 20:36
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files against the governance context.

docs/decisions/00-founding-decisions.md — A-90 entry

A-90 records owner ratification of spec 070 on 2026-11-08. Structurally it follows the pattern of A-88 and A-89 immediately above it. The ratification claim is review data, not authority; the entry correctly closes with the standard "authorizes no release, push or publication" disclaimer.

specs/070-extract-rules-2/spec.md — full spec review

Frontmatter: status: approved, implementation: pending is the correct "work order" lifecycle (contract §Lifecycle). The amends frontmatter lists 038-structured-extraction and 032-evidence-quality; the amended specs' .md files are not edited, consistent with contract §"An amends edge is declared once." Depends-on and extends entries reference specs confirmed present in the repo context. The spec id 070-extract-rules-2 is non-colliding (repo context lists through 069, with the existing 062 gap unrelated to this change).

Principles: The spec correctly threads the system principles—proposals never grants (§2.1, §3.12), derivation classes (§2.1, §3.8), unresolved is an answer (§3.4.5), pure core (§3.6.3, R-1). The boundary rule (only integrations/* may depend on Aicortex/HTTP; rustev-core performs no I/O) is maintained—no new dependency is introduced.

Technical correctness of key sections:

  • §3.2.4 boundaries + §3.3.1–3.3.3: Token boundaries (non-ASCII bytes bound tokens, consistent with the no-Unicode-table rule), possessive matching (correctly bounds worst-case work in §3.6.2), date calendar-validity check and leap-year rule (standard proleptic Gregorian) are internally consistent. The token_after skip rule (at most one separator byte) aligns with the observable cases.
  • §3.4.5 unresolved condition source: Correctly treats an unresolved equals/one_of source as source_unavailable and prohibits not from inverting it—matching /1's behaviour and Constitution VIII.
  • §3.7: Rules-first compile-time accounting is left unchanged (skipping never makes an otherwise-refused definition admissible). The partial-request RequestId covers the subset, and merge correctness (a rules-filled member returned by the model → record-level invalid_output) is specified. Replay re-evaluates the rules, listing the same subset, which is correct for determinism.
  • §3.8 hint grade: Applying hint to the whole field whenever any vocabulary_after rule can fill it (whatever the actual origin) is an intentional design choice (Decision 7) stated clearly and consistently across §3.8, the static phase-e2 ceiling, and observable cases.
  • §3.11 WebAssembly: 057's 5 MiB gate is kept; the pre-approved 6 MiB raise (A-90) is scoped to the increment that actually crosses the gate, never applied speculatively.

Finding — vocabulary_unavailable omitted from the evidence-amendment section

§3.3.5 introduces vocabulary_unavailable as a new field-absence reason (when the input vocabulary is unavailable, the field ends absent with that reason rather than fallback_no_match). It appears correctly in §3.7.3 and in the §5 observable cases table.

However, §3.9 (which explicitly amends 038 §3.12 on field evidence) says in item 2: "Field evidence is 038 3.12.1's" — without enumerating vocabulary_unavailable as a new element. The territory list in §2 for crates/rustev-contract/ lists "the evidence 2 request outcome skipped" but also omits vocabulary_unavailable. An implementer reading §3.9 as the authoritative list of rustev.evidence/2 schema changes would not add vocabulary_unavailable to the field-absence enum, producing a schema that cannot validate evidence records for fields whose vocabulary was unavailable at evaluation — a validation failure at runtime.

Location: specs/070-extract-rules-2/spec.md §3.9.2 (approximately line 484) in relation to §3.3.5 (approximately line 338).

{"head": "34b8f6f6fdebea5e4906362911dc8bde139fbcff", "verdict": "findings", "findings": [{"path": "specs/070-extract-rules-2/spec.md", "line": 484, "severity": "medium", "category": "correctness", "summary": "Section 3.9.2 says 'Field evidence is 038 3.12.1's' without enumerating vocabulary_unavailable (introduced as a new field-absence reason in §3.3.5) as an addition to the evidence/2 schema; the territory list in §2 also omits it, so an implementer following the evidence-amendment section would not add this reason to the schema, causing validation failures at runtime when a vocabulary input is unavailable."}]}

Subject: f81dc04...34b8f6f, diff digest 5968afc8b4f1bb4bb3015b16a127e897b55521fcfa53ac0468ba0ce5ccb9944d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 8, 2026 20:43 — with GitHub Actions Inactive
…ns, declared date formats and rules first (amends 038 and 032)
@bartekus
bartekus force-pushed the spec/070-extract-rules-2 branch from 34b8f6f to 1bd58b5 Compare November 8, 2026 20:59
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the two changed files: a decision log entry (A-90) and a new spec (specs/070-extract-rules-2/spec.md).

docs/decisions/00-founding-decisions.md (A-90)

The entry records ratification of spec 070 on 2026-11-08, referencing owner quote "we do need it in 0.7.0 ... proceed with specs/build". The ratification claim is consistent with the spec's status: approved, created: 2026-11-08 and matches the quote in the spec's "Decisions at approval" section. Per the review contract, the ratification claim is review data, not verified authority; enforcement is elsewhere. No contradiction found.

specs/070-extract-rules-2/spec.md

Frontmatter is well-formed: amends declares the two upstream specs, extends entries cover the right territory, depends_on lists all referenced specs, obligations and requirements are cross-referenced to spec sections.

Behavioral checks:

  • Document grammar (3.1): occurrence? for token_matching (optional, defaults to 1) versus bare occurrence for date (required by grammar). Consistent with 3.3.3's statement "defaults to 1 for token_matching only."
  • Term-skip-then-token logic (3.2.2, 3.3.1): The separator-consumed-by-skip rule ("when the charset contains the separator byte that the skip consumed, the skip still consumes it first") correctly removes ambiguity. Section 5 cases confirm this.
  • Calendar validation for date (3.3.3): "A calendar-invalid match makes the rule not apply; later matches are not tried." Explicitly stated. For occurrence=2 this means a calendar-invalid first syntactic match stops the search; a valid second occurrence is never reached. This is stated design (not an undocumented omission), but asymmetric with token_matching where a failed start causes the search to continue to the next start boundary.
  • date_iso vs ymd_dash distinction (3.3.3): date_iso passes the matched value to 038 3.4 (calendar-invalid → fallback_invalid, field settled, no further rules), while ymd_dash refuses the match at detection time (rule doesn't apply, next field rule tried). The two handle 2026-02-31 differently; explicitly documented in both body text and section 5. Correct.
  • Exact-value condition sources not requiring projection (3.4.2, 3.5.1): The asymmetry (text conditions/extractors require projection membership; equals/one_of do not because only the core reads them) is explicit and cross-validated in section 5 (equals source not in projection | Compiles; token_after source not in projection | Refused).
  • vocabulary_after grade propagation (3.8.2): "whatever its origin" means model values in a field that any vocabulary_after rule can fill also carry grade hint. This is confirmed by I-5 and the section 5 case ("The same field extracted by the model | Value metadata grade hint"). Consistent with the stated static-dynamic agreement requirement.
  • Merge fault on rules-filled fields (3.7.5): A model response naming a rules-filled field triggers invalid_output and retry/fallback policy. This correctly prevents the model from overriding rules-filled values.
  • Compile-time budgets unchanged under rules_first (3.7.3): "skipping never makes a definition admissible that would otherwise be refused." Section 5 confirms: rules_first definition whose worst case exceeds max_semantic_requests → refused. Correct and consistent.
  • Leap-year rule (3.3.3): "February has 29 days in a year divisible by 4 and not by 100, or divisible by 400." Standard proleptic Gregorian. Correct.
  • Work bounds (3.6.2): token_matching at most 257 bytes per start (16 elements × 16 bytes + end-boundary byte), 8 class entries per byte → 257n examinations. Bounded, deterministic, no backtracking. Consistent with R-1.
  • WebAssembly budget numbers (3.11): 5,242,880 bytes = 5 MiB (spec 057 gate), 6,291,456 bytes = 6 MiB (pre-approved raise). Both match A-90's "5 MiB" and "6 MiB" references exactly.
  • Compatibility guarantee (3.10.1): /1 documents, plans, and PlanIds keep their bytes. /2 constructs in a /1 document are refused as unknown. Consistent with I-1 and 3.1.3.

No bugs, security problems, or specification contradictions found in the supplied evidence.

{"head": "1bd58b52a884b9bfac7b965a94c798b9054fadde", "verdict": "no-findings", "findings": []}

Subject: f81dc04...1bd58b5, diff digest 7729183d41fb32da5f4b63ad1645745c48c28526332e70a9b9658b6196942c20, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 8, 2026 21:07 — with GitHub Actions Inactive
@bartekus
bartekus enabled auto-merge November 8, 2026 21:15
@bartekus
bartekus added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 706a5de Nov 8, 2026
26 checks passed
@bartekus
bartekus deleted the spec/070-extract-rules-2 branch November 8, 2026 21:53

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 1bd58b52 Deployed Nov 8, 2026 by bartekus via review-exception #3887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant