Skip to content

spec(073, 074): host compile of extraction documents and case regressions within the integrity allowance, ratified (A-94) (#598, #597) - #599

Merged
bartekus merged 6 commits into
mainfrom
spec/073-074-drafts
Nov 24, 2026
Merged

bartekus merged 6 commits into
mainfrom
spec/073-074-drafts

Conversation

@bartekus

@bartekus bartekus commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two specs, one per issue, spec text and regenerated derived shards only. No code changes. Ratification (approved) is the owner's act.

  • 073 (Node binding and CLI cannot compile extraction programs or templates (extract-rules/2) #598, amends 006, 027 and 063): rustev plan check|compile gain repeatable --extract-rules and --template. The Node binding's compile/compileSync option bag gains extractRules and templates, and command('check'|'compile') accepts them too. All of them route through compile_with_extraction_documents. A call without them makes the same core call as today, so every existing plan, PlanId and golden keeps its bytes. Compile refusals keep the core's category on every surface. A malformed document is refused the way each surface already refuses a malformed descriptor. No contract type, schema or generated binding type changes, and the WebAssembly package is unchanged. A shared synthetic fill: rules_first golden (a fictional airline confirmation) must compile to the same bytes and PlanId through Rust, the CLI and Node.
  • 074 (064 case_regressions: a candidate within its 065 upstream-failure allowance can never qualify #597, amends 064 and 065): case_regressions gains an opt-in, unresolved: "exclude_failed_within_integrity", and a gate may use it only when it declares integrity.max_upstream_failures. A case left unresolved only because of upstream failures that 065 counts is excluded and listed. It is never compared and never counted as a regression or a non-regression. Without the member, everything keeps its bytes. The issue's reproduction is now a synthetic acceptance case.

Ordinals

071 is held by the unmerged branch docs/071-reference-docs (PR #587, closed), so these take 073 and 074.

Release

Both specs target 0.8.0. Spec 021 3.2, which 031 3.6.4 follows, reserves the patch number for a compatible correction. A public API or consumer-contract change takes the minor number. New CLI flags, new Node option fields, a new gate member and new fields in rustev-eval's public selection structs are all such changes, so #598's request for a 0.7.x patch would need an owner decision.

Checks

make gate and make code pass locally. Python 3.12 was put first on PATH as python3 for rustev-release's harness tests.

Open questions for the owner

Each spec ends with "Open questions for the owner", with a recommendation for each one.

Ratification

The owner ratified both specs on 2026-11-24 (A-94), accepting every recommendation; each spec now holds its extends edges and its decisions at approval. This PR also carries A-93 and spec 001's advisory record, the follow-up named by #600's waiver.

… case regressions within the integrity allowance (#597)

073 (draft, amends 006, 027 and 063): `rustev plan check|compile` gain
`--extract-rules` and `--template`, and the Node binding's
`compile`/`compileSync` and `command('check'|'compile')` gain
`extractRules` and `templates`, each routed through
`compile_with_extraction_documents`. Calls without them keep their bytes.

074 (draft, amends 064 and 065): `case_regressions` gains the opt-in
`unresolved: "exclude_failed_within_integrity"`, which leaves out cases
unresolved only because of upstream failures that 065 counts, when the
gate declares `integrity.max_upstream_failures`. The default is unchanged.

Both target 0.8.0 under spec 021 3.2. Ratification is the owner's act.
@github-actions

Copy link
Copy Markdown

AI review (findings)

Review

Spec 073 — Extraction programs and prompt templates on the CLI's and the Node binding's compile

Lifecycle / frontmatter. draft / pending is a valid state per the contract. amends lists 006, 027 and 063 — all present in the registry. depends_on is complete. Invariants are well-scoped and internally consistent.

Section 3.1 byte bound. The table assigns DESCRIPTOR_V1 as the byte bound for extraction programs (rustev.extract-rules/1 and /2) and DEFINITION_V1 for prompt templates. DESCRIPTOR_V1 is a constant named after backend descriptor documents (spec 005); applying it to extraction programs by name is semantically mismatched and may reference the wrong limit. If the values diverge, extraction programs could be accepted at a size that the core eventually rejects, or refused at a size that is legitimate.

Section 3.3.2 argument order vs. section 3.4.3 parse order. The function signature places execution before templates, programs; the parse-order list places execution policy last. These describe different things (call-site parameter order vs. error-reporting order), so the difference is intentional, but a note to that effect would prevent implementor confusion. Not a defect.

Missing derived shards. AGENTS.md requires: "commit the shards with the spec edit that staled them." REPO CONTEXT shows .statecraft/derived/spec-registry/by-spec/ and .statecraft/derived/codebase-index/by-spec/ only through 072-*. The PR adds spec.md files for both 073 and 074 but includes no corresponding derived shard files. make gate enforces this and would fail on the current diff.


Spec 074 — Case regressions may leave out cases that failed within the integrity allowance

Lifecycle / frontmatter. draft / pending correct. amends lists 064 and 065; both present in the registry. Invariants I-1, I-2, I-3 are consistent with the body's behaviour section.

Section 3.2.3 and I-2 alignment. I-2 states a case is excluded when "each side is clean or excused and at least one side is excused" — this matches section 3.2.3 exactly. ✓

Section 3.6.4 semver note. The spec correctly identifies that adding fields to public non-#[non_exhaustive] structs is a breaking change and targets 0.8.0. The reference to "A-63" is an internal decision log entry, acceptable in a draft.

Section 3.4.1 side tie-break. "When both are excused it names the baseline (064 3.5.1's convention)" — this is a convention addition not stated in I-2. It is internally consistent with the section 5 table row "A case failed on both sides | Excluded, side: 'baseline'" and is not a defect, but I-2 could name it explicitly.

Missing derived shards. Same as spec 073: .statecraft/derived/spec-registry/by-spec/074-*.json and the codebase-index shard are absent from the diff.


{"head": "127294f45dc9a2b58b2ef6d97ea2a5a45a2b10c1", "verdict": "findings", "findings": [{"path": "specs/073-compile-extraction-documents-from-hosts/spec.md", "line": null, "severity": "medium", "category": "correctness", "summary": "The PR adds spec.md files for 073 and 074 but omits the corresponding .statecraft/derived/spec-registry and codebase-index shards; AGENTS.md requires these to be committed with the spec edit that stalens them, and make gate enforces this."}, {"path": "specs/073-compile-extraction-documents-from-hosts/spec.md", "line": 119, "severity": "low", "category": "correctness", "summary": "Section 3.1's table assigns DESCRIPTOR_V1 as the byte bound for extraction programs (rustev.extract-rules/1 and /2); the constant's name refers to backend descriptor documents (spec 005), not extraction programs, and may reference the wrong size limit."}]}

Subject: 57931dc...127294f, diff digest c1d4ce8ff5f3f51d09c57cf0b1e1db5b1adcbaf2cee6cf78b66fee98a00e9ee3, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 24, 2026 18:12 — with GitHub Actions Error
…yte bound, the order of error reporting, the excused side, and the committed shards
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing both new spec files against the governance context, checking for correctness, internal consistency, and conformance with governance rules.

Spec 073 (specs/073-compile-extraction-documents-from-hosts/spec.md)

  • status: draft, implementation: pending — matches the lifecycle table: schedulable, unresolved units produce W-001 warnings only. The spec correctly self-identifies as a proposal.
  • amends edges are declared in frontmatter only; the amended spec.md files are not edited, as the contract requires.
  • I-1/I-2/I-3/R-1 anchors (3-3-mapping-to-the-core, 3-4-refusals, 3-6-compatibility) match the headings in the document body.
  • Section 3.3.2 uses argument order (…, templates, programs) to the core; section 3.4.3 documents a different parse/error-reporting order and explicitly notes the distinction — no contradiction.
  • Section 5 row "Programs supplied in a different order → Same plan bytes and PlanId" is consistent with the core being order-independent by identity; the surface-level "passed in the order supplied" binding principle is about the surface not reordering, not the core's normalization.
  • Backward-compatibility claim (I-2) is correctly bounded: a no-input call takes the existing code path.
  • The draft spec does not claim to describe code, consistent with AGENTS.md.

Spec 074 (specs/074-case-regressions-exclude-failed-within-integrity/spec.md)

  • status: draft, implementation: pending — same lifecycle conformance as 073.
  • amends edges in frontmatter only.
  • I-1/I-2/I-3 anchors (3-6-compatibility, 3-2-excluded-cases, 3-1-the-member) match body headings.
  • Exclusion logic (3.2.2–3.2.3) is internally consistent: "other" on either side blocks exclusion; only clean+excused or excused+excused triggers it. Each row of section 5 is consistent with these definitions.
  • Section 3.1.3 refuses the member without max_upstream_failures — consistent with I-3 and the stated semantics ("within integrity has no meaning without the bound").
  • Section 3.3 substitutes post-exclusion U into 064's clause formula without changing its structure — correct.
  • Section 3.6.4 cites cargo semver-checks behaviour and an internal decision record (A-63); I cannot inspect those sources, but neither is a governance authority whose absence constitutes a finding.
  • I-1 compatibility bound (gate without the member keeps byte-identical selection) is correctly scoped.

No concrete defects found in either spec.

{"head": "75bf86dea07ed913d75959628cdee6f8aff1a592", "verdict": "no-findings", "findings": []}

Subject: 57931dc...75bf86d, diff digest 4b31fe1f5902263fb56b4a9110d197ad0d6186127e8ac00d6f6fc4bf081d3c86, 1 call(s). An AI comment is not an approval.

…y record

The owner ratified 073 and 074 on 2026-11-24 for release 0.8.0,
accepting every recommendation the drafts wrote (A-94). Each spec gains
its `extends` edges and its decisions at approval in place of its open
questions.

A-93 records the owner's acceptance of RUSTSEC-2026-0543 and -0555 as
ignore entries (#600), and spec 001 gains the matching supply-chain
advisory record; this is the follow-up #600's waiver names.
@bartekus bartekus changed the title spec(073, 074): draft host compile of extraction documents and case regressions within the integrity allowance (#598, #597) spec(073, 074): host compile of extraction documents and case regressions within the integrity allowance, ratified (A-94) (#598, #597) Nov 24, 2026
@bartekus
bartekus enabled auto-merge November 24, 2026 19:45
@bartekus
bartekus had a problem deploying to statecraft-review-exception November 24, 2026 19:45 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the four changed paths against the governance context.

docs/decisions/00-founding-decisions.md — A-93 and A-94 are new decision log entries. A-93 cites two independent owner quotes: "1: yes proceed" for the advisory/ignore-entry decision, and the broader release statement for the Spec-Drift-Waiver line. A-94 relies solely on the broad statement "I approve whatever is neccessry to get the PR #599 CI gree, merged and rustev release 0.8.0 out" as authority for ratifying both specs 073 and 074 and for approving specific answers to ten open questions across the two drafts. This is a data claim in the diff; per the reviewer's contract, ratification is enforced elsewhere, so I note it without making it a finding. Format and cross-references to spec numbers and PR numbers are consistent with existing entries.

specs/001-boundaries-and-authority/spec.md — The new advisory-record section accurately echoes A-93 and uses the same crate path and revisit date. No contradiction with the existing spec text.

specs/073-compile-extraction-documents-from-hosts/spec.md — status: approved, implementation: pending is the correct lifecycle state for a newly ratified work order. amends lists 006, 027, 063; none of those spec files are edited, as the contract requires. Invariants I-1, I-2, I-3 and requirement R-1 are internally consistent. The route-to-instantiation refusal in §3.3.4 lists: "a profile, profileBases, variant, definitionVersion, several definitions, or a version 2 template with parameters or variants." This spec simultaneously introduces --template / templates as the flag name for rustev.prompt-template/1 inputs. "Version 2 template" here means a rustev.definition/2 document carrying parameters or variants (a parameterised definition in spec 034 terminology), but the word "template" now has a different meaning earlier in the same document. An implementer reading §3.3.4 could interpret "version 2 template" as a versioned rustev.prompt-template document and omit the guard for parameterised rustev.definition/2 inputs; the net effect would be that extraction programs supplied alongside a parameterised definition are silently routed to compile_with_extraction_documents instead of being refused, producing undefined core behaviour for a path the spec declares out-of-scope. The correct term in this corpus is "version 2 definition" or "parameterised definition."

specs/074-case-regressions-exclude-failed-within-integrity/spec.md — status: approved, implementation: pending. Amends 064 and 065; neither amended file is edited. The three invariants are internally consistent. The logic in §3.2 (clean / excused / other), §3.3 (clause result with exclusion), §3.4 (output) and the negative-cases table (§5) are mutually coherent and consistent with the stated constraints from specs 064 and 065. §3.6.4 correctly identifies the exhaustive-struct semver-break reasoning. No inconsistency found.

{"head": "13cb58111a5faf2b0ec124fc75d464660a145d9e", "verdict": "findings", "findings": [{"path": "specs/073-compile-extraction-documents-from-hosts/spec.md", "line": null, "severity": "low", "category": "correctness", "summary": "Section 3.3.4 uses 'a version 2 template with `parameters` or `variants`' to mean a parameterised `rustev.definition/2` document, but this spec also introduces 'template' as the flag/field name for `rustev.prompt-template/1` inputs; an implementer may omit the instantiation guard for parameterised definitions and silently route them to `compile_with_extraction_documents` instead of refusing the call."}]}

Subject: 57931dc...13cb581, diff digest e39f0fe6f814e75f2e9018fde3c155dc9abb0f39fe15778be7c0603ee2360b26, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 24, 2026 19:50 — with GitHub Actions Error
@bartekus
bartekus temporarily deployed to statecraft-review-exception November 24, 2026 20:37 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the four changed files against the governance context and each other.

docs/decisions/00-founding-decisions.md — A-93 and A-94 follow the established pattern for advisory and ratification entries. No inconsistency found.

specs/001-boundaries-and-authority/spec.md — The new advisory section correctly references A-93 and #600, consistent with the preceding section's form. No issues.

specs/073-compile-extraction-documents-from-hosts/spec.md — Three defects found:

  1. Section 3.2.1, file-access paragraph: "One command reads at most 4 096 --extract-rules and 4 096 --template files, as for --descriptor; beyond that it stops with io_error before reading any file, and these files count toward 006 3.3.2's 256 MiB." The final clause contradicts the error path it qualifies: unread files have no known byte size and cannot contribute to the 256 MiB budget. The accounting statement belongs to the success path only; the sentence structure falsely attaches it to the error path.

  2. Extends edge, crates/rustev-core/ entry: The comment reads "Test fixtures only: the shared rules-first golden (3.7); no source change." Section 3.7 describes "A core test compiles it through compile_with_extraction_documents and compares bytes," and the verify:cli block names --test extraction_compile, which is a Rust integration-test file, not a fixture. The description "test fixtures only / no source change" is inconsistent with the new test runner the spec itself requires.

  3. Section 3.3.4: "When the instantiation is named by the arguments…, it is refused before any file is read: on the CLI as a usage error (exit 2), on Node as InvalidDocument." Section 3.4.2 of this same spec states "command('check' | 'compile') returns the CLI's output bytes and exit code (063 3.2.4)." For Node command('compile') called with extractRules and an instantiation-routing argument (e.g. profile), the CLI would exit 2; command by 063 3.2.4 propagates that, not an InvalidDocument exception. The two clauses in 073 contradict each other on this named input.

specs/074-case-regressions-exclude-failed-within-integrity/spec.md — The clean/excused/other definitions in 3.2.2 are consistent with I-2; the clause formula in 3.3 correctly removes excluded cases from U; the output shape in 3.4 is consistent with the invariants; the negative-case table is internally coherent. No defects found.

{"head": "c03069fef900ebab227af4baaac4e9e93899d3bf", "verdict": "findings", "findings": [{"path": "specs/073-compile-extraction-documents-from-hosts/spec.md", "line": 176, "severity": "low", "category": "correctness", "summary": "Section 3.2.1's byte-accounting sentence 'these files count toward 006 3.3.2's 256 MiB' is attached grammatically to the error path where no files are read, making it self-contradictory; files stopped before reading have no known size to count."}, {"path": "specs/073-compile-extraction-documents-from-hosts/spec.md", "line": 41, "severity": "low", "category": "correctness", "summary": "The extends-edge description for crates/rustev-core/ says 'test fixtures only; no source change', but section 3.7 and the verify block require a new Rust integration-test file (extraction_compile), which is source, not just fixture data."}, {"path": "specs/073-compile-extraction-documents-from-hosts/spec.md", "line": 220, "severity": "medium", "category": "correctness", "summary": "Section 3.3.4 says 'on Node as InvalidDocument' for the instantiation-with-extraction case without distinguishing command from compile/compileSync; section 3.4.2 of the same spec states that command returns the CLI's output bytes and exit code (063 3.2.4), so command('compile') with extractRules + profile should propagate exit 2, not throw InvalidDocument."}]}

Subject: 57931dc...c03069f, diff digest 9e1340f819c7b8ab041d03e413f342a05c37bc341f5938d8a2b9e6f04f462096, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 24, 2026 21:08 — with GitHub Actions Inactive
@bartekus
bartekus added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit fa50cbb Nov 24, 2026
48 of 51 checks passed
@bartekus
bartekus deleted the spec/073-074-drafts branch November 24, 2026 21:46

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — c03069fe Deployed Nov 24, 2026 by bartekus via review-exception #4022
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