Skip to content

072 increment 1: a CLI-ready synthetic support-routing definition - #589

Merged
bartekus merged 1 commit into
mainfrom
impl/072-inc1-definition
Nov 11, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/072-inc1-definition

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Spec 072 increment 1 (3.1, I-1). Stacked on #588 (the spec).

The support-routing package's committed definition is bound to its reference topic calibration, which is bound to a placeholder backend, so rustev plan check refuses it with calibration_binding for any backend a CLI user has. This adds the definition a CLI user can compile:

  • data/synthetic-example.definition.json: the package definition with topic bound to synthetic-example.calibration.json, exposed as EXAMPLE_DEFINITION beside the other EXAMPLE_* constants.
  • tests/example.rs builds it with Params::with_topic and compares the committed bytes; RUSTEV_BLESS=1 rewrites it with the other example files.
  • tools/rustev-release/archive-policy.json lists the new file in the package's reviewed archive contents.

Check: the file equals support-routing.definition.json with only the topic calibration reference changed, and rustev plan check --definition synthetic-example.definition.json --rules synthetic-example.rules.json --calibration synthetic-example.calibration.json returns ok (plan sha256:7e0b9ae5…).

Local: package tests 11 passed; rustev-release archives and embedded_files tests pass; clippy and fmt clean; make gate passes; spec-spine couple against #588's branch reports no drift.

@bartekus bartekus added the statecraft:stacked-ci Run the full CI matrix on a stacked pull request label Nov 10, 2026
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the five changed paths against governance context and the diff.

specs/072-documentation-source-gaps/spec.md — lifecycle moves from approved/pending to approved/in-progress. Per the contract both states are schedulable; this is the expected transition once implementation begins, and the spec was already owner-ratified at the base commit. The new extends entry for 031-public-api-and-release-family over tools/rustev-release/ matches the archive-policy edit and the additive nature is correct.

tools/rustev-release/archive-policy.json — single entry added in sorted position, consistent with the surrounding file list pattern.

packages/rustev-pkg-support-routing/data/synthetic-example.definition.json — machine-generated single-line JSON committed as a golden file. The uncalibrated_threshold declarations are internally consistent: the topic step carries a calibration reference; explicit_deadline and ambiguous both declare their uncalibrated threshold status correctly (declared with reason vs not_declared).

packages/rustev-pkg-support-routing/src/lib.rs — include_bytes!("../data/synthetic-example.definition.json") resolves correctly relative to src/, matching the new file path.

packages/rustev-pkg-support-routing/tests/example.rs — the bless/compare block is inserted before the compile step. definition is not consumed by canonical(), so it remains valid for the subsequent compile call. The golden-file pattern matches the existing bless infrastructure described in the spec prose. No double-free or logic inversion.

No concrete defects found.

{"head": "0fc50b786b57b1e96e0d3465db6b99e0184e8821", "verdict": "no-findings", "findings": []}

Subject: 166a178...0fc50b7, diff digest 42b9429fb9ec7663d1a0be9af71e345dd6d2fba5716bed28f61a53ab92f27f1e, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/072-inc1-definition branch from 0fc50b7 to 24670f5 Compare November 10, 2026 22:30
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing each changed path against the governance context and the diff.

specs/072-documentation-source-gaps/spec.md

  • implementation: pending → in-progress is a valid lifecycle step for an approved spec per the contract table.
  • The new extends entry for spec 031-public-api-and-release-family over tools/rustev-release/ with nature: additive is consistent with the concurrent archive-policy.json change and uses the correct ownership vocabulary.
  • Prose updated to match the new status and to document increment 1. No normative contradiction.

packages/rustev-pkg-support-routing/src/lib.rs

  • EXAMPLE_DEFINITION is a plain include_bytes! constant, consistent with the existing EXAMPLE_RULES, EXAMPLE_CALIBRATION, and EXAMPLE_SNAPSHOT constants in the same block. No issue.

packages/rustev-pkg-support-routing/tests/example.rs

  • The bless/compare block follows the same pattern as the other example-file checks inferred from the surrounding context. It writes on bless, asserts byte equality otherwise. The bless path is a hardcoded data_dir().join(...) join — no path traversal concern.
  • The comparison definition.canonical().unwrap() == pkg::EXAMPLE_DEFINITION is deterministic (constitutionprinciple XIII covers canonical compilation), so the committed file and the constant will stay in sync after a bless run.

packages/rustev-pkg-support-routing/data/synthetic-example.definition.json

  • Single-line JSON with no trailing newline; this is what std::fs::write of a canonical serializer output produces, and the bless test would regenerate it identically.
  • "schema":"rustev.definition/1" matches the schema version referenced by the existing support-routing.definition.json family (spec says this file equals that one with only the topic calibration reference changed).
  • The two uncalibrated_threshold forms ("not_declared" for the calibrated topic step, {"declared":{...}} for the uncalibrated explicit_deadline step) are semantically coherent with the step definitions.

tools/rustev-release/archive-policy.json

  • "data/synthetic-example.definition.json" inserted in sorted order between .calibration.json and .judgment.json. Correct placement, no other lines changed.

No concrete defects found.

{"head": "24670f53b9c78b6a25847b6191387e0206638777", "verdict": "no-findings", "findings": []}

Subject: 0f0f940...24670f5, diff digest ddd09c6d23857d9cbe639f2e2dacc088ffbec18a3e64ee2a97ca4f9e9a153c89, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the spec/072-documentation-source-gaps branch from 0f0f940 to 4e575a1 Compare November 10, 2026 22:38
@bartekus
bartekus force-pushed the impl/072-inc1-definition branch from 24670f5 to 2c8c822 Compare November 10, 2026 22:38
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing each changed path against governance rules and internal consistency.

specs/072-documentation-source-gaps/spec.md

  • Lifecycle change pending → in-progress on an approved spec: both states are schedulable with W-001 warnings per the contract table. Valid.
  • New extends edge claims tools/rustev-release/ under spec 031 as additive. Spec 072 is approved; the edge is consistent with the archive-policy change in this same PR. Valid spec-first coupling.
  • The increment 1 prose accurately describes the code changes in this PR. No contradictions.

packages/rustev-pkg-support-routing/src/lib.rs

  • EXAMPLE_DEFINITION is a straightforward include_bytes! constant, consistent with the pattern used for EXAMPLE_RULES, EXAMPLE_CALIBRATION, and EXAMPLE_SNAPSHOT.

packages/rustev-pkg-support-routing/tests/example.rs

  • The bless/compare block is inserted after pkg::definition(&params).unwrap() and before the compile call. The bless path writes definition.canonical().unwrap() to disk; the non-bless path asserts equality with pkg::EXAMPLE_DEFINITION (the include_bytes! of that same file). The round-trip is consistent.
  • The JSON file ends without a trailing newline; canonical() presumably produces the same bytes since the bless path is what produced the committed file.

packages/rustev-pkg-support-routing/data/synthetic-example.definition.json

  • Single-line JSON. The calibration ID inside the topic step (sha256:13c548a7…) is verified at test time against calibration.id().unwrap(), so a stale ID would fail the non-bless assertion. No standalone correctness concern.
  • "uncalibrated_threshold":"not_declared" on the ambiguous rule and "uncalibrated_threshold":{"declared":{…}} on the explicit_deadline mass check are structurally distinct variants, consistent with the two-variant pattern used elsewhere in the corpus.

tools/rustev-release/archive-policy.json

  • data/synthetic-example.definition.json inserted in correct alphabetical position between synthetic-example.calibration.json and synthetic-example.judgment.json. Matches the spec 072 increment 1 description.

No concrete defects found.

{"head": "2c8c8229fbb265613afb6c298a624ec9ff0882fe", "verdict": "no-findings", "findings": []}

Subject: 4e575a1...2c8c822, diff digest 407d12958dc1ab3295f992f1e5d5bf96bc61372d6a3dac4dc185cd4bd49c37aa, 1 call(s). An AI comment is not an approval.

Base automatically changed from spec/072-documentation-source-gaps to main November 10, 2026 23:34
@bartekus
bartekus force-pushed the impl/072-inc1-definition branch from 2c8c822 to f49402e Compare November 10, 2026 23:35
@bartekus
bartekus enabled auto-merge November 10, 2026 23:35
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing each changed file against the governance context and the diff.

specs/072-documentation-source-gaps/spec.md

  • Lifecycle: approved + pending → approved + in-progress. Both are schedulable with W-001 warnings per the contract table; this is a legal and correct transition now that increment 1 work has landed.
  • The new extends edge to spec 031 for tools/rustev-release/ correctly documents that this increment touches territory owned by spec 031 (archive policy). The nature additive is appropriate since only a new entry is being added.
  • Prose update ("not started" → "in progress") is consistent with the frontmatter change.

tools/rustev-release/archive-policy.json

  • synthetic-example.definition.json is inserted alphabetically between synthetic-example.calibration.json and synthetic-example.judgment.json, preserving sort order. Correct.

packages/rustev-pkg-support-routing/src/lib.rs

  • EXAMPLE_DEFINITION is declared with include_bytes! mirroring the existing pattern for EXAMPLE_RULES, EXAMPLE_CALIBRATION, EXAMPLE_SNAPSHOT. Doc comment is accurate.

packages/rustev-pkg-support-routing/tests/example.rs

  • The bless/compare block is inserted before the existing compile call. The bless path writes definition.canonical().unwrap() to disk; the non-bless path asserts definition.canonical().unwrap() == pkg::EXAMPLE_DEFINITION. This is the same pattern used for the other synthetic-example.* files in the codebase. The comparison of Vec<u8> (from canonical()) against &[u8] (from include_bytes!) is valid in Rust via PartialEq<&[T]> for Vec<T>.

packages/rustev-pkg-support-routing/data/synthetic-example.definition.json

  • Single-line JSON, no trailing newline. This is consistent with the test: the same canonical() output is both written (bless) and compared (non-bless), so the file contents are deterministically verified by the test.
  • The JSON content references calibration id sha256:13c548a797be50a596dbd2771a84a780349847494bc5b662db1970be9c89d1ad for the topic step, with calibration:"none" for frustration and explicit_deadline, matching the described usage of Params::with_topic(TopicCalibration::Calibrated(...)).
  • uncalibrated_threshold: {"declared": {"reason": "..."}} is used for explicit_deadline in the adjustment's mass_at_least clause, which is the correct form when no calibration artifact exists.

No concrete defects found.

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

Subject: 589185f...f49402e, diff digest 407d12958dc1ab3295f992f1e5d5bf96bc61372d6a3dac4dc185cd4bd49c37aa, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 11, 2026
data/synthetic-example.definition.json is the package definition with topic
bound to the committed synthetic example calibration, exposed as
EXAMPLE_DEFINITION and byte-checked by tests/example.rs. rustev plan check
accepts it with the example rules and calibration alone.
@bartekus
bartekus enabled auto-merge November 11, 2026 00:43
@bartekus
bartekus force-pushed the impl/072-inc1-definition branch from f49402e to 21156e4 Compare November 11, 2026 00:43
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the five changed paths:

synthetic-example.definition.json (new file): Single-line JSON with no trailing newline. Content is consistent with the schema rustev.definition/1, inputs, steps, and calibration reference. The missing newline is noted in the diff marker but poses no functional issue since the file is consumed as raw bytes via include_bytes!, and the bless path writes exactly what canonical() produces.

src/lib.rs: The new EXAMPLE_DEFINITION constant uses include_bytes! on the new data file, consistent with how EXAMPLE_RULES, EXAMPLE_CALIBRATION, and EXAMPLE_SNAPSHOT are declared immediately adjacent. No issue.

tests/example.rs: The bless/check block is inserted after definition is constructed and before compile is called. The write target path (common::data_dir().join("synthetic-example.definition.json")) matches the file added to data/. The check compares definition.canonical().unwrap() against pkg::EXAMPLE_DEFINITION; both paths are consistent. No issue.

specs/072-documentation-source-gaps/spec.md: implementation: pending -> in-progress is a valid lifecycle progression for an approved spec per the contract table. The added extends entry for 031-public-api-and-release-family over tools/rustev-release/ correctly documents the dependency for the archive policy change. The prose description of Increment 1 is consistent with the diff. No ratification claim or authority change is made. No issue.

tools/rustev-release/archive-policy.json: The new entry "data/synthetic-example.definition.json" is inserted in alphabetical order among the other synthetic-example.* entries, consistent with the surrounding list. No issue.

No concrete defects found.

{"head": "21156e4268e8ccbc0487cc0eda1cc3bf071c97f0", "verdict": "no-findings", "findings": []}

Subject: 694866c...21156e4, diff digest 9f123006fa972d411ea9b5ac91bf1b65001098adc71f3192c65af263f8d83c39, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit dc60f26 Nov 11, 2026
49 checks passed
@bartekus
bartekus deleted the impl/072-inc1-definition branch November 11, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

statecraft:stacked-ci Run the full CI matrix on a stacked pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant