Skip to content

chore(048): adopt Statecraft profile revision 17 and spec-spine 0.31.0 - #146

Merged
bartekus merged 1 commit into
mainfrom
chore/statecraft-r17-spine-0.31.0
Oct 21, 2026
Merged

bartekus merged 1 commit into
mainfrom
chore/statecraft-r17-spine-0.31.0

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Spec 048: move Statecraft github-actions-rust from revision 14 to 17 and the exact spec-spine pin from =0.28.0 to =0.31.0.

  • Produced through the profile's consented pin move (revision 15): statecraft-cli init plan --profile github-actions-rust --spine =0.31.0, then init apply --plan spine-init:d27f45d6f2a0f94365a522d0284fdef6d9d8fa0ee08365861ce4d29dad12f26c, judged by an exact spec-spine 0.31.0 binary. Apply reported every rendered path at its intended digest.
  • Producer: statecraft-cli commit 2f366913240ab9c6a13e4da46d057b165574bd71; profile revision 17, identity fe0e763c8f217652df7975e429a8eb2c762657abc33344ef79f6d4e18733e7a6.
  • Managed files re-rendered: statecraft-ci.yml, statecraft-ai-review.yml, scripts/statecraft/*, .github/CODEOWNERS, .statecraft/setup/github-actions-rust.json, and the new revision 16 remote desired-state document .statecraft/setup/github-actions-rust.remote.json. All recorded setup parameters are kept: ordinary Rust code gate, boundaries and verify extra jobs.
  • standards/spec/constitution.md and specs/000-bootstrap/spec.md were withheld as owner-edited and are unchanged.
  • .statecraft/derived/ regenerated by 0.31.0; AGENTS.md names revision 17; the spec-spine.toml pin history comment is updated.
  • New spec 048 records the owner's 2026-10-21 consent and the implementation record.

This PR changes the authority set, so it needs the owner's approval of the statecraft-review-exception Environment once.

Local verification (macOS arm64): make gate and make code pass with spec-spine 0.31.0 in .bin.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the non-managed changed files for internal consistency, correctness, and security issues.

Cross-reference checks across .statecraft/environment.json and .statecraft/setup/github-actions-rust.json:

All managed-file digests match between the two files for every entry: statecraft-ci.yml, statecraft-ai-review.yml, install-spec-spine.sh, gate.sh, ci-gate.sh, ai-review.sh, CODEOWNERS, and the new github-actions-rust.remote.json. The setup identity fe0e763c8f217652df7975e429a8eb2c762657abc33344ef79f6d4e18733e7a6 agrees across both files and the spec's implementation record.

github-actions-rust.remote.json triple-consistency: The digest dddf74b51172890721fdd50965d5672acc21ccff9dcb4d79402bc7b8ffcf3199 appears consistently in environment.json's file entry, in environment.json's remoteState block, and in github-actions-rust.json's file list.

spinePin block: Source 0.28.0 → target 0.31.0 matches spec-spine.toml's required_version = "=0.31.0" and the pins.spec_spine update in environment.json. Plan identity spine-init:d27f45d6f2a0f94365a522d0284fdef6d9d8fa0ee08365861ce4d29dad12f26c matches the spec's implementation record.

spec-spine.toml: Comment history updated to include 0.31.0 with date and spec 048 reference; required_version updated to =0.31.0. Consistent.

AGENTS.md: Revision bump from 14 to 17 is the only change, correct.

Spec 048: amends: 018-statecraft-profile-14 and both depends_on entries (001-boundaries-and-authority, 018-statecraft-profile-14) reference specs that exist in the repo context. Revision 17 identity in the implementation record matches all other files. The spec correctly notes that the ordinary code gate (not external code lane) is retained, consistent with github-actions-rust.json revision notes and spec section 3.

No bugs, security issues, or inconsistencies found.

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

Subject: 541f3ca...4cecab0, diff digest d7bd40e372e6c7afc451101ad99efdb643e087aead1e7c8d688283ae1b7295ec, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception October 21, 2026 17:24 — with GitHub Actions Inactive
@bartekus
bartekus enabled auto-merge (squash) October 21, 2026 17:26
@bartekus
bartekus merged commit 1204bc8 into main Oct 21, 2026
7 checks passed
@bartekus
bartekus deleted the chore/statecraft-r17-spine-0.31.0 branch October 21, 2026 17:46
bartekus added a commit that referenced this pull request Oct 21, 2026
Spec 027 increment 7, third change: the differential floating-point
corpus (3.11.3, 3.11.5).

After spec 047 (#138, #139) every transcendental call reachable from a
pure command is a call of `rustev_core::math`, at four sites: `exp` in
core's softmax, `ln` in core's calibration, `ln` in evaluation's log
loss, `ln` in its temperature fit.

- `tools/rustev-conformance/fp-corpus/` (new crate `rustev-fp-corpus`,
`publish = false`, excluded from the release set as tooling; an explicit
workspace member, since it sits inside the conformance suite's
directory):
- 131,072 inputs per site, drawn as each site sees them (non-positive
`exp` arguments; positive finite masses; probabilities in (0, 1] and
just above). Each set starts with boundary values: zeros, the smallest
and largest subnormals, `MIN_POSITIVE`, one ulp either side of 1, where
`exp` leaves the normal range and where it rounds to 0, and the format's
extremes. It continues with a seeded SplitMix64 using integer arithmetic
and correctly rounded basic operations only, so every target draws the
same bits.
- Per site, the SHA-256 of the input bits and of the output bits, both
committed in `expected.json`.
- A native runner (`rustev-fp-corpus check expected.json`) and a
WebAssembly build of the same crate with plain exports and no imports
(`corpus_sites`, `corpus_run`, `corpus_digest_byte`). The exports need
`#[unsafe(no_mangle)]`, so the crate relaxes `unsafe_code` to `deny` and
allows it on those three functions only; there is no `unsafe` block.
- Tests: every `rustev_core::math` call in the pure crates is a corpus
site and vice versa (a new call site cannot go unmeasured); the inputs
meet 3.11.3 (at least 100,000, no NaN, subnormal and extreme magnitudes,
distinct draws for the two evaluation sites); this target reproduces the
committed digests.
- `tools/rustev-conformance/js/fp-corpus.mjs`: the WebAssembly module in
Node and in headless Chromium against the committed digests, writing a
result document.
- `make bindings`: the corpus natively, then in Node and Chromium.
- Release set: `rustev-fp-corpus` excluded with its reason.
- Spec 027: implementation record.

Local verification (macOS arm64, before the rebase onto `main`): native,
Node 24.6.0 and Chromium 153.0.8010.12 agree on all four sites; `make
bindings` passes end to end with the corpus steps; `cargo test -p
rustev-fp-corpus` (3 tests); clippy `-D warnings`; `cargo test -p
rustev-release` with the new exclusion. Seeded check: putting the
platform's `exp` and `ln` back into `rustev_core::math` makes the native
macOS run differ from the committed digests and fail, while WebAssembly
(whose standard library already uses the pure implementation) still
matches. That is the divergence spec 047 removed. After the rebase:
`make gate`, `bash scripts/check-authored-content.sh`. The results on
every CI target come with the `bindings` job, the next PR.

Rebased onto `main` after #142 merged. One conflict, in
`tools/rustev-release/release-set.json`, resolved by hand: #142 removed
lodging's exclusion (lodging became a member), and this PR adds
`rustev-fp-corpus`'s, so the result keeps the new exclusion and not
lodging's.

Review round 1 (1 finding, fixed): `corpus_digest_byte`'s out-of-range
sentinel `u32::MAX` reaches JavaScript as -1 (a wasm `i32` result is
signed), so `b > 255` never caught it. The runner now accepts only
integers 0 to 255 and throws naming the value otherwise; the Rust doc
comment states the -1. Checked locally against the module:
`corpus_digest_byte(5, 0)` and `(0, 99)` return -1, which the new guard
refuses.

Review round 2 (2 findings, fixed):
1. `check` compared the committed file byte for byte, so a CRLF checkout
(Windows with `core.autocrlf`) would fail with correct digests; the
committed text is now compared with carriage returns removed.
2. The call-site guard stripped only `//` comments; it now scans code
alone, with line, block (nested) comments and string and character
literals blanked (`code_only`, with its own test), counts every
occurrence rather than one per line, and compares `/`-separated paths on
every host.

Local: `cargo test -p rustev-fp-corpus` 4/4, clippy `-D warnings`.

Review round 3 (1 finding, fixed): `code_only` did not blank raw string
literals. It now recognizes `r"..."`, `r#"..."#` with any number of `#`,
and the `br` forms (not when `r` ends an identifier), and the scanner
test includes a raw string and a raw byte string holding `math::exp(`
and `math::ln(`, which are not counted. Local: `cargo test -p
rustev-fp-corpus` 4/4, clippy `-D warnings`.

Rebased onto `main` after #146 (profile revision 17, spec-spine 0.31.0):
derived shards regenerated with spec-spine 0.31.0; no other conflict.
bartekus added a commit that referenced this pull request Oct 21, 2026
…checks (#143)

Spec 031 increment 2: the partial-adoption subsets, MSRV and
API-compatibility checks, as repository commands (3.5, 3.6.7, 3.8).

- `tools/rustev-release/adoption.sh` (`make adoption [subset ...]`):
each subset is a fresh consumer project outside the workspace (its own
empty `[workspace]`, the workspace's `Cargo.lock` and
`rust-toolchain.toml` copied in) depending on the facade by path with
`default-features = false` and exactly the subset's features (plus
`rustev-pkg-support-routing` for embedded decisions). Its test names
every module the subset takes and parses a definition through the
facade, and must run and pass (a build alone fails); `cargo tree -e
normal` must contain each chosen crate and none of the omitted ones
(tokio and hyper included where omitted). Subsets: documents (no
feature), embedded (`runtime`, `rules`), evaluation (`eval`), remote
over HTTP (`runtime`, `remote-http`), and `runtime`, `rules`,
`remote-http` alone. `serve`, `bedrock`, `typesafe`, `otel`,
`local-embed` print "skipped, not passed" with the reason their crate is
not in this release.
- `tools/rustev-release/msrv.sh` (`make msrv`): `cargo +<MSRV> test
--locked` of every release member, the MSRV read by the release policy
from the members' `rust-version`.
- `tools/rustev-release/semver.sh` (`make semver`): for each member, the
newest earlier non-yanked version in the crates.io sparse index; with
one, `cargo semver-checks check-release` at the exact pin 0.51.0
(refusing any other version); with none, `no-baseline`, written as "not
applicable, not passed". The npm packages report `no-baseline` while
unpublished and refuse a verdict once published until their declaration
diff exists; the service API has no crate in this release. Registry
reads only, with a project User-Agent; no credential.
- `Makefile`: `adoption`, `msrv`, `semver`.
- Spec 031: implementation record.

The CI jobs that will run these come in a later workflow change,
together with spec 027's `bindings` job (one
`statecraft-review-exception` approval); this PR changes no workflow.

#142 has merged; this PR is rebased onto `main`.

Local verification (macOS arm64):
- `make adoption`: all 7 subsets pass (normal graphs of 30 to 62
crates), 5 skipped with reasons.
- `make semver`: 11 crates and 2 npm packages `no-baseline`; nothing
compared.
- `make msrv`: every member builds at 1.88 and its tests started, but
this Mac's `syspolicyd` held the freshly built CLI binaries in
`_dyld_start` for over 20 minutes in `rustev-cli`'s `actionability`
test, so I stopped it; the MSRV test run is not locally verified. The CI
job is the verdict.
- `make gate`, `bash scripts/check-authored-content.sh`.

Review round 1 (3 findings, fixed):
1. The record said the CI jobs "are registered"; no workflow changes
here. It now says they will be registered by a later workflow change,
with spec 027's `bindings` job, and that this increment changes no
workflow (this body likewise).
2. `semver.sh` created a temporary file per crate outside any trap; it
now uses one scratch directory removed by an `EXIT` trap.
3. `adoption.sh` matched `test result: ok. 1 passed` as a regex; it is
now a fixed-string match (`grep -qF`).

Review round 2 (2 findings, both mistaken, answered in the diff):
1. "`process.argv.slice(1)` is off by one under `node -e`." Under `-e`
there is no script path, so the first argument after the program is
`argv[1]`: `node -e 'console.log(process.argv.slice(1))' a b` prints
`["a","b"]` (checked on Node 24). A comment at the call now says so, and
the local `make semver` run read the index responses this way.
2. "The documents subset references `rustev::decision_core::compile`,
which may be feature-gated." It is not: `contract` and `decision_core`
are the facade's always-present modules (031 3.2.1, `#[cfg]`-free in
`lib.rs`, checked by `tests/public_items.rs`), and the documents subset
passed locally. A comment in the generator now says so.

Review round 3 (1 finding, the round-2 claim again, made moot): the
index file and version now reach the inline script as environment
variables (`INDEX_FILE`, `CURRENT`) rather than arguments, so no
argument indexing remains to dispute. Checked locally on a synthetic
index (`0.0.9`, `0.1.0`, yanked `0.0.5`, current `0.1.0`): it selects
`0.0.9`.

Review round 4 (3 findings: 2 fixed, 1 answered in the diff):
1. The consumer ran without `--locked`. `--locked` cannot hold for a
fresh consumer (the copied lockfile names the workspace's packages,
which the consumer's root replaces), so the guarantee is now checked
directly: after the build, every registry package in the consumer's
lockfile must be at a version the workspace's `Cargo.lock` pins, or the
subset fails naming it. Seeded locally on a copy of the lockfile:
identical gives nothing; `serde` at `9.9.9` is reported.
2. `curl` had no timeout; every registry request now has `--max-time
60`.
3. "`use rustev::contract::Document` is unused." It is the trait whose
`parse` the generated test calls (`Definition::parse` is
`Document::parse`); a comment in the generator now says so.

Review round 5 (1 finding, answered and guarded): "a pre-release family
version makes the comparator return NaN." The release policy refuses any
family version that is not `X.Y.Z` (`check_set`, 021 3.2), so none
reaches this script. `semver.sh` now also refuses a non-`X.Y.Z` version
itself before comparing (checked locally: `0.1.0` accepted, `0.1.0-rc.1`
and `1..0` refused).

The previous round's review was cancelled at its time limit; it was
rerun once by re-signing the commit.

Review round 6 (4 findings, fixed):
1. A four-part version passed the shape check; the family version must
now have exactly two dots and digits only.
2. The consumer's edition was hard-coded; it is now the workspace's own
`edition`, read from the root manifest (refusing when absent).
3. Whether the subset test ran was read from the harness's summary text;
the generated test now writes a mark file (`RUSTEV_ADOPTION_MARK`) and
the script checks that file instead.
4. The pinned `cargo-semver-checks` was probed only when a baseline
existed; it is now required up front on every run (exact version), so a
missing or wrong tool is found before the first release needs it. The CI
job installs it.

Review round 7 (1 finding, answered and made explicit): "a failing
`node` leaves `baseline` empty and reads as `no-baseline`." In POSIX
`sh` an assignment's exit status is its command substitution's, so `set
-e` already stops the script (`sh -c 'set -eu; b=$(false); echo
reached'` prints nothing and exits 1). The lookup now also has an
explicit `|| { ...; exit 1; }` naming the crate ("could not read its
index response; no verdict"), checked against a non-JSON index file.

Rebased onto `main` after #142 merged. The round-7 review (on `3451a98`)
repeated the `node` substitution finding, which `3305bd4` had already
answered with the explicit guard (`|| { echo "$name: could not read its
index response; no verdict" >&2; exit 1; }`); that head's review was
cancelled at the time limit, so this push is its rerun.

Review round 8 (3 findings, fixed):
1. A missing `node` surfaced as "could not read its index response":
`semver.sh` now checks `git`, `cargo`, `curl` and `node` on PATH before
anything else and names the missing one.
2. `make semver` computed the report path with an inline `node` call, so
a missing `node` gave `/semver.txt`: the script now defaults the report
to `semver.txt` in the cargo target directory it already resolves, and
the Makefile target passes nothing.
3. `adoption.sh` ignored an unknown subset name: a requested name that
is neither a present nor a skipped subset now exits 2 naming it (checked
locally: `adoption.sh nosuch` gives "no subset named 'nosuch'").

Review round 9 (1 finding, mistaken, answered in the diff): "`IFS='|'`
on `read` persists into the loop body, so the lists split as one token."
A prefix assignment to a regular built-in such as `read` lasts for that
command only (POSIX); `sh -c 'printf "a|x y z\n" | while IFS="|" read -r
n l; do for c in $l; do echo $c; done; done'` prints `x`, `y`, `z` on
separate lines (macOS `sh` and `bash`). The local adoption run is the
same evidence: the embedded subset's chosen-crate check passed over
three names, which it could not with `|` as the separator. A comment at
the loop now says so.

Review round 10 (1 finding, fixed): an empty member list from the
release policy would have run `cargo test` over the whole workspace;
`msrv.sh` now refuses an empty package list or MSRV.

Review round 11 (1 finding, fixed): Node's role in `semver.sh` is now
documented where a user meets it: the script's header, the Makefile
target's comment and the spec record each state that `make semver` needs
`curl`, Node 20 or later (to read the index's JSON lines) and the pinned
`cargo-semver-checks`; the script still refuses each by name when
missing.

Rebased onto `main` after #146 (profile revision 17, spec-spine 0.31.0):
derived shards regenerated with 0.31.0.

Review round 12 (3 findings, fixed):
1. The pinned `cargo-semver-checks` is now checked with the other tools,
before anything is built.
2. Node's version is checked too (20 or later), not only its presence.
3. Both remote subsets now require `tokio` in their graph (the remote
binding depends on it normally), as the runtime-only subset does.

Review round 13 (1 finding, fixed): the embedded subset (which enables
`runtime`) now also requires `tokio` in its graph, like every subset
that takes the runtime or the remote binding.

Rebased onto `main` after #145 merged (derived shards only).
bartekus added a commit that referenced this pull request Oct 21, 2026
…#144)

Spec 031 increment 3: the release changelog generated from the governed
corpus (3.10, R-4), and the crates' SBOMs in the candidate (3.9.1).

- `tools/rustev-release/src/changelog.rs` (new): `render(&Inputs)` is a
pure function of the specs at the previous release and now (`spec-spine
registry list --json`), the decision rows that ratified or approved each
spec, the commits since the previous release that touched it, and the
compatibility facts of 3.6 and 3.7. A spec is listed when new, when its
status or implementation state changed, or when its approved text
changed (every section digest except the implementation record's).
Compatibility comes first: MSRV and edition, each reference plan's
`PlanId` (a change stated as breaking under 3.6.4), superseded versions
with end dates. Unit tests: what is listed and in what order, order
independence of the inputs, a changed `PlanId`, an
implementation-record-only change, decision-row parsing.
- `rustev-release changelog <out> [<previous tag>]` (`make changelog`,
`PREVIOUS=<tag>`): gathers those inputs at a clean commit (the previous
corpus from the tag's tree via `git archive`, never from
`.statecraft/derived/` directly) and prints the changelog's digest.
- `candidate.sh`: requires `cargo-cyclonedx` 0.5.9 exactly; run a's
clean tree writes one CycloneDX 1.5 SBOM per crate member (all targets'
dependencies) at the source date; the changelog of the candidate commit
is generated as a step.
- `release-manifest.json`'s evidence map now carries each
`sbom-<member>.cdx.json` and `changelog.md` digest; a missing one fails
the candidate.
- Spec 031: implementation record.

#143 has merged; this PR is rebased onto `main`.

Local verification (macOS arm64): `cargo test -p rustev-release` (all
pass, changelog 5 unit tests), `cargo clippy -p rustev-release
--all-targets -D warnings`, `cargo fmt --check`, `sh -n candidate.sh`;
`rustev-release changelog` at one commit twice gives byte-identical
output (47 specs for the first release, both reference `PlanId`s
listed). `cargo cyclonedx` 0.5.9 run on the workspace writes
`<member>.cdx.json` files with no serial number and the
`SOURCE_DATE_EPOCH` timestamp. The full candidate with SBOMs runs at the
release-candidate step; `make gate`, `bash
scripts/check-authored-content.sh`.

Review round 1 (2 findings, fixed):
1. A missing `changelog.md` was reported under "031 3.9"; each evidence
file now carries its own clause (SBOMs 3.9.1, changelog 3.10).
2. The SBOM lookup's first search (`git ls-files --others --ignored`)
could never match, since the generated files are untracked but not
ignored; it is removed, and the lookup is the `find` (outside `target/`)
that always did the work.

Rebased onto #143's review rounds.

Review round 2 (2 findings, fixed):
1. The changelog's temporary tree was left behind when `git archive` or
`tar` failed (`?` returned first); the three steps are now chained and
their result taken after the directory is removed.
2. The SBOM lookup took the first `find` match. It now requires exactly
one `<member>.cdx.json` outside `target/` and fails naming the count and
paths otherwise (`cargo cyclonedx` without `--target-in-filename` writes
one per member, which the local run showed).

Rebased onto #143's round 4.

Review round 3 (3 findings, fixed):
1. MSRV and edition came from the first member alone. The release policy
already refuses a member that differs, and the changelog now also checks
every member and refuses to state an MSRV the members disagree on.
2. A failing `cargo cyclonedx` stopped the candidate with its output
only in `sbom.log`; the log is now printed to stderr first.
3. The implementation-record exclusion matched by substring, which would
have excluded spec 031's own section
`3-10-changelog-from-implementation-records` from approved-text
detection. It now matches `implementation-record` or a numbered
`<n>-implementation-record` exactly; a unit test covers both anchors and
the 3.10 section counting as text.

Review round 4 (2 findings: 1 fixed, 1 answered in the diff):
1. "The commit may carry a trailing newline into the Markdown."
`command_line` returns `stdout.trim()`, so it cannot; the generated
changelog's first line showed the bare hash. A comment at the call now
says so.
2. Only one leading section number was stripped.
`is_implementation_record` now drops every leading `<digits>-` group, so
`3-2-implementation-record` counts as the record too; the unit test
covers it.

Review round 5 (3 findings, fixed):
1. `make changelog` passed `$(PREVIOUS)` unquoted; it is now quoted when
given and omitted when not (`make -n` shows both forms).
2. The SBOM count counted lines of the path list; it now counts files
(one character per file found), so no path content can change it
(checked on a scratch tree with two matches: 2).
3. The changelog's temporary tree used a PID-named path and removed it
first; it now comes from `mktemp -d` (fresh, private), with nothing
removed beforehand.

Rebased onto #143's round 5. Local note: the run of `changelog` against
a previous ref after this change is waiting on this Mac's `syspolicyd`,
which has held the freshly built binary in `_dyld_start` for 30 minutes;
the first-release path ran earlier.

Review round 6 (3 findings, fixed):
1. The SBOM was located by `find` (twice); each member's SBOM path now
comes from its manifest directory in `cargo metadata`, so there is no
search to race or miscount.
2. Any `git show` failure for a previous `PlanId` read as "unchanged"; a
golden absent at the previous release is `None`, and one present but
unreadable (or without a `plan_id`) is an error.
3. A spec whose only change was its amendment edges was omitted; a
change of `amends` is now listed, with a unit test.

Rebased onto #143's round 6. Locally against `origin/main` as the
previous ref (after round 5): 3 specs listed as changed, both `PlanId`s
unchanged, and the temporary tree removed.

Review round 7 (2 findings, fixed):
1. A removed spec was listed without its title; it now prints `### <id>:
<title>` from the previous registry, with a unit test.
2. The candidate reads SBOM paths with Node; it now checks `node` is on
PATH first and says so, rather than reporting a missing SBOM.

Local note: this Mac's `syspolicyd` currently holds new build scripts
and test binaries in `_dyld_start` for 30 minutes or more, so the new
unit test is verified by CI on this push.

Review round 8 (1 finding, answered in the diff): "`render(&inputs())`
compared with `a` is a tautology." It is the repeatability check 3.10
asks for (a second run on the same inputs gives identical bytes); the
next assertion is the order-independence one. Both now carry a comment
and an assertion message saying which is which.

Review round 9 (1 finding, fixed): a `plan check` golden at HEAD without
a `plan_id` was skipped silently while the same condition at the
previous release was an error; both are errors now (every `plan check`
golden carries one).

Review round 10 (1 finding, mistaken, answered in the diff): "`cargo
cyclonedx` needs `--workspace` in a virtual workspace." The pinned
cargo-cyclonedx 0.5.9 has no such flag: `cargo cyclonedx --workspace`
exits with "unexpected argument '--workspace' found". Run at the root of
this virtual workspace, it writes `<name>.cdx.json` beside every
member's manifest (the local run did, for every member). The candidate
then requires each release member's file by its `cargo metadata` path
and fails if one is missing. A comment at the call now says so.

Rebased onto #143's rebase onto `main`.

Review round 11 (2 findings, fixed):
1. `make changelog` ran `cargo run ... field target` twice in one line;
it now resolves the target directory once into a shell variable and uses
it for both the binary and the output path.
2. A `cargo metadata` failure in the SBOM step surfaced as "no SBOM
generated": the metadata is now read once before the loop with an
explicit failure message, and a failed path lookup for a member says so.

Rebased onto #143's round 8.

Review round 12 (1 finding, mistaken, answered in the diff):
"`${PREVIOUS:-}` passes `""` when unset." Unquoted, an empty expansion
is removed by field splitting and passes no argument: `sh -c 'set --
${PREVIOUS:-}; echo $#'` prints `0`. So the first-release form
(`changelog <out>`) runs. A comment at the call now says this is
deliberate.

Rebased onto #143's round 9.

Rebased onto #143 after #146 (profile revision 17, spec-spine 0.31.0):
derived shards regenerated with 0.31.0.

Review round 13 (1 finding, fixed): a member absent from `cargo
metadata` gave an empty directory and the message "expected
/<name>.cdx.json"; the lookup now fails, and the candidate says "cargo
metadata lists no package <name>".

Rebased onto #143's round 12.

Rebased onto `main` after #143 merged (derived shards only).

Review round 14 (2 findings, fixed):
1. `make changelog` spliced `$(PREVIOUS)` into the recipe's text; the
recipe now reads it from the environment (`${PREVIOUS:+"$PREVIOUS"}`;
make exports command-line variables), so its contents are never shell
syntax. Checked with a scratch Makefile: `PREVIOUS='a"b; echo pwned'`
arrives as one literal argument.
2. `SPEC_SPINE` could point the changelog at any binary; the generator
now accepts a spec-spine only when `--version` equals the exact pin in
`spec-spine.toml` (`=0.31.0`), whichever path supplies it.
bartekus added a commit that referenced this pull request Oct 21, 2026
Spec 020: remote protocol refinements, increments 1 to 6 (phase
ceilings, the host-endpoint principal reference and `rustev.remote/2`,
bounded connection reuse, `rustev.run/2`, runtime-planned remote
batches, Jev and verification). Every refinement is disabled by default,
and a binding with every refinement disabled keeps its spec 009 bytes,
artifact and `PlanId`.

**Awaiting the owner.** Spec 020 stays `implementation: pending`, and so
stays out of `make verify`, because two acceptance items are not
verifiable as written (recorded in the spec's implementation record):

1. Multiplex cancellation (pool acceptance). The HTTP binding speaks
HTTP/1.1 only, so a pool policy must declare one stream per connection;
nothing is multiplexed and there is no multiplexed cancellation to test.
Covering it needs an HTTP/2 binding, a new dependency that spec 021's
audit would have to admit.
2. "New qualification evidence for every enabled refinement" (Jev). No
refinement is enabled on the Jev adapter, so there is none to produce;
enabling one would need a new mapping version and a newly authorized
qualification, which this spec does not authorize (3.7).

The ruling on these two decides whether 020 can be marked implemented.

## Per increment

- **1, phase ceilings (3.4, 3.1).** `rustev-remote-http/src/phases.rs`
(new): `PhasePolicy` (a positive ceiling per phase; zero refused at
construction), `TransportPhases` (disabled by default), `PhaseClock`
(each phase's allowance is the lesser of its ceiling and the budget left
when it starts; phases only move forward) and `phased`.
`HttpTransport::with_phases` enters resolution, connect, TLS handshake,
request write, first response byte and response body on the real
connection; `TransportError::PhaseExpired`. An expiry before request
bytes is `transport_unsent`, after them `transport_interrupted`; no
retry is added. The cancellation acknowledgement ceiling bounds every
cancel exchange. `rustev.remote-exchange/1` gains an optional
`phase_expiry`; `AdapterBinding::transport_phases` is not written when
disabled.
- **2, principal reference and `rustev.remote/2` (3.6, 3.7).**
`rustev-contract`: `PROTOCOL_V2`, `InferRequest::principal`
(`WirePrincipal`, omitted when absent, refused in version 1 or when not
canonical) and its domain-separated evidence digest; the exchange
record's optional `principal` holds only that digest.
`rustev-remote-http/src/principal.rs` (new): `EndpointOperator`,
`PrincipalSource`, `HandleAsReference`, `PrincipalPosture`,
`PrincipalWire`. The client negotiates exactly `protocol_major` (1 by
default) and refuses a principal for a third-party endpoint, over
version 1, or with a bad label. The server serves
`ServerConfig::versions` (`[1]` by default) and includes the principal
in idempotency content. Redirects stay unfollowed.
- **3, bounded connection reuse (3.5).**
`rustev-remote-http/src/pool.rs` (new): `PoolPolicy`, host-owned
`ConnectionPool`, `KeyMaterial` (every isolation member; credential and
principal only as digests; unknown material never reuses).
`HttpTransport::post_observed` swaps stream hooks per exchange, so the
tracker and phase clock are always the current exchange's. A stale
connection is never replaced mid-exchange; exhaustion is
`transport_unsent` with `observed{0}`. The exchange record gains an
optional `connection`; the binding gains `connection_pool`, not written
when disabled.
- **4, `rustev.run/2` (3.2, I-4).** `rustev-contract`: `RUN_V2`,
`RunRecord::remote_evidence` and `remote_evidence_truncated` (absent in
every other version, so version 1 and 3 bytes are unchanged), bounded
`RemoteEvidence`, `check_version_members`, `project_v1`. `rustev-core`:
`EvidenceSink::run_schema` and `DecisionBackend::take_remote_evidence`,
both defaulted. `rustev-runtime`: version 2 exactly when the sink
selects it; one entry per remote attempt in order; a rejected version 2
record is never retried as version 1. `rustev-remote-http`:
`ClientConfig::run_evidence`, `ExchangeSink::deliver_located`, and
`Exchanges::deliver` now returns the record digest and delivery result.
`rustev-eval`: bundles hold the version 1 projection, so replay is
unchanged and offline; `remote_evidence::availability` checks references
against a host store, apart from judgment parity.
- **5, runtime-planned remote batches (3.3).** `RemoteClient` offers
spec 017's `batch_capability` only when `ClientConfig::batch_dispatch`
and the negotiated terms both allow shared-state batching (bound is the
lesser). `infer_batch` refuses an oversized or mixed batch before any
byte, checks each member as an independent attempt, sends one exchange
in the runtime's order bounded by the earliest member budget, and
answers each member from its own answer. New exchange attribution
`runtime_planned`.
- **6, Jev, drift, verification.** A negotiated endpoint answering
another protocol version is `identity_mismatch`.
`rustev-jev/tests/refinements.rs`: Jev offers no general batch seam, its
adapter-scoped batch stays shared-state, and no spec 020 member or
remote evidence appears; its binding and mapping are unchanged. Spec
020: acceptance mapped item by item and a declared `verify:cli` block.

Amended specs whose shared APIs change: 003 (runtime run/2 delivery),
004 (eval bundles and availability), 009 (binding members, exchange
record, `TransportError`, `Exchanges::deliver`), 012 (Jev), 017 (the
batch seam's remote side). Their verify passes.

## Interpretations recorded in the implementation record

- 3.1's explicit `disabled` values are explicit in the configuration
types but not written into the binding document, so every existing
adapter's artifact and `PlanId` stay byte-identical (section 2).
- The request-write phase ends at the first completed flush after the
connection took the request body; the response-body phase includes the
response head.
- The cancellation acknowledgement ceiling bounds the whole cancel
exchange, whose own transport phases also apply.
- `rustev.remote/2` keeps the HTTP paths `/rustev/remote/1/...` and the
schema strings; the `version` member distinguishes it. A version 1
server refuses a version 2 describe with 400, reported at construction
as a negotiation failure.
- The isolation key's authority is the configured scheme, host and port,
not the resolved address.
- Replay never consults an exchange store; "without a transport or store
call" is read as that, and availability is a separate, explicit check.
- A plan 3 decision's record stays `rustev.run/3` without remote
evidence even for a sink that selected version 2.
- Spec 017's batch report has one cancellation answer and one remote
state, so one possibly continuing member makes every member of its batch
possibly continuing with charge unknown: never understated, possibly
overstated until the host reconciles.
- A host-operated server hands a version 2 request's reference to the
hosted backend as `CallContext::principal_handle`; version 1 keeps spec
009's empty handle.

## Local verification (macOS arm64)

Rebased onto `main` at df053f6 (4cecab0 dropped as already applied as
#146), then onto 2d6a1f2 after #143 and #144 merged, then onto c58c52e
after #150 (spec 026) merged; no conflicts and no call sites to fix.
`.bin/spec-spine verify 026` also passes. `make gate`, `make code`
(build, test, clippy `-D warnings`, fmt, boundaries), `.bin/spec-spine
verify` for 020, 003, 004, 009, 012 and 017 (spec-spine 0.31.0), `bash
scripts/check-authored-content.sh`.

Review round 1 (1 finding, reported by two groups, fixed): the
`RustevRun1` and `RustevRun3` declarations (both packages) carried
`remote_evidence` and `remote_evidence_truncated`, which spec 020 says
are `rustev.run/2` only. The declarations were faithful to the schemas,
and the schemas to the parser: the run record's parser read every
version with one type and did not refuse those members outside version
2. Fixed at the source: `versioned_document!` takes an optional `check =
f` rule, and the run record's parser applies `check_version_members`
(refusing either member in version 1 or 3, and a version 2 record
without the list or beyond its bounds, as `ParseError::Schema`). The run
schemas now state that rule: `rustev.run-1` and `rustev.run-3` drop both
members and their now-unreferenced `$defs` (byte-identical to `main`
again), and `rustev.run-2` requires a non-null list. Declarations
regenerated with `gen-types.mjs`.
`crates/rustev-contract/tests/run_v2.rs`
(`the_parser_and_the_schemas_hold_the_version_rule`) checks parser and
schemas agree for each case; the implementation record says so.

Review round 2 (1 finding, fixed): an attempt that passed `prepare`
(which records its evidence as `pending`) and was then withdrawn from a
coalescing exchange before it sent kept `pending`: `finish` completes
only the members in the exchange record, and `note_unexchanged` leaves
an existing entry alone. Both "stopped before sending" paths of
`cancel_member` (withdrawn while collecting, and a lone member that
stops the send) now go through `stopped_unsent`, which turns a
still-pending entry into `no_exchange` with code `cancelled` and charge
provenance `nothing_sent`. `tests/batching.rs`
(`a_member_withdrawn_before_sending_has_no_exchange_in_its_evidence`)
fails without the fix and passes with it; the implementation record says
so. Round 2's review job reached its 15-minute limit right after posting
its comment, so that run recorded no evidence artifact; this push runs a
fresh review.

Review round 3 (0 findings), after the rebase onto #150. The first
attempt of this round reached the review job's 15-minute limit without a
verdict; the rerun returned no findings in both groups.
bartekus added a commit that referenced this pull request Oct 21, 2026
Spec 019, increments 1 and 2: dynamic questions as a narrow evaluated
class. The documents, pure validation and identity, `ask_dynamic`,
offline reproduction and the dynamic evaluation report. Scripted
backends only; nothing here selects a backend, authorizes live inference
or spend, or claims accuracy or calibration.

- `crates/rustev-contract/` (`src/dynamic.rs`, `ids.rs`, `limits.rs`):
`rustev.dynamic-question/1`, `rustev.dynamic-capability/1` (identified
by `DynamicCapabilityId`) and `rustev.dynamic-outcome/1` (`RECORD_V1`);
`DynamicRequestId`, `TemplateId`; the `DYNAMIC_QUESTION_V1` scan limits.
Parsing scans the bytes first, then checks the structural bounds of 3.2
(sizes, counts, byte-exact uniqueness of labels and context names, 64
KiB of context values, 128 KiB canonical); unknown members are refused.
The canonical request identity covers what a backend computes from,
including label order, template and preprocessing; the backend receives
a projection under fixed member names only.
- `crates/rustev-core/` (`src/dynamic.rs`, `seams.rs`): `validate`
builds the only `ValidatedQuestion`; `admit` (capability fit, no
truncation, `bounded` cost model only), `admit_cost` (enforceable bound
at or below the hard cap), `judge` (exact support, non-answer material
is invalid, pinned served identity, named abstention rules), `proposal`
(`model-derived`, with lineage). `DynamicBackend` and
`DynamicEvidenceSink` seams, separate from `DecisionBackend`, with no
tool, function or retrieval surface. Compile-fail tests with a compiling
control keep dynamic outcomes, raw outputs and proposals out of
`Supplied`, `Evaluation::supply` and `Judgment`, and keep
`ValidatedQuestion` unforgeable.
- `crates/rustev-runtime/` (`src/dynamic.rs`): `ask_dynamic`, one
attempt under a fresh hard ledger at the request's cap (and the optional
host ledger), deadline over every phase, spec 003/013 cancellation
evidence, optional sink whose delivery never changes the outcome. No
retry, fallback, batching or cache on this path.
- `crates/rustev-eval/` (`src/dynamic.rs`): `reproduce` takes no
backend; a changed canonical identity is `incomparable{request_changed}`
(section 5's last row: reordered labels), another declaration
`capability_changed`, a missing raw response `raw_response_unavailable`,
a different judgment `diverged`. `rustev.dynamic-dataset/1` and
`rustev.dynamic-evaluator-config/1` bind task family, exact question
schema, artifact and template; the dataset requires an
injection-adversarial case and refuses leakage across splits.
`rustev.dynamic-eval-report/1`: coverage, abstention by reason, accepted
error, uncalibrated Brier and log loss or mean level distance, overall
and over adversarial cases; `uncalibrated`, `mechanics_only` on
synthetic data, every gate `unknown`.
- Tests: `rustev-contract/tests/dynamic_wire.rs`,
`rustev-core/tests/dynamic.rs` (including adversarial text in every
caller-controlled field), `rustev-runtime/tests/dynamic.rs` (section 5
rows 1 to 7 with a dispatch counter), `rustev-eval/tests/dynamic.rs`.
- `tools/rustev-release/archive-policy.json`: the four new source files
join the reviewed archive lists; 019 now `extends`
`tools/rustev-release/` (additive) for it.
- `tools/rustev-conformance/fp-corpus` (spec 027, 3.11.3): the dynamic
log loss's `rustev_core::math::ln` call joins the differential corpus as
`eval.dynamic_log_loss.ln` (probability domain, as the existing log-loss
site), with its digests committed in `expected.json`; 019 `extends`
`tools/rustev-conformance/` (additive) and its verification runs the
corpus test.
- `Makefile`: 019 joins `VERIFIED_SPECS`.
- Spec 019: `implementation: complete`, Verification declares the
acceptance commands, implementation record. No existing document,
golden, plan id or test changed.

What remains: nothing in 019's acceptance. Calibration of a dynamic task
family needs a separately fitted artifact with its own binding; none
exists and none is claimed.

Owner decisions:
1. Whether the dynamic documents join spec 027's JSON Schema emitter
(3.2.2, "every public document type"). They are not emitted here: doing
so adds schema files under `crates/rustev-contract/schema/` and changes
the generated binding types under `integrations/rustev-wasm/types/` that
spec 027 owns, and neither spec says whether dynamic documents belong in
the binding surface.
2. Defaults chosen where the spec is silent, recorded in the
implementation record:
- `DISTRIBUTION_TOLERANCE` is 0.000001, equal to the reference plans'
tolerance.
- `min_margin` is top mass minus the second mass; ties go to the earlier
declared label.
- Free-text backend output retained in an outcome is cut to 256 bytes.
- Every evaluation gate is reported `unknown`: over synthetic data a
gate would claim quality from mechanics, and real data needs separately
governed admission (spec 023) that no dynamic dataset binds yet.

Local verification (macOS arm64): `make gate`, `make code` (build, test,
clippy `-D warnings`, fmt, boundaries), `.bin/spec-spine verify 019` (12
commands, passed), `rustev-fp-corpus check` (5 sites agree natively).
The WebAssembly corpus runs (`make bindings`) were not run locally: this
toolchain lacks the `wasm32-unknown-unknown` target. Rebased onto `main`
after #146, again after #143 to #145 merged (#145's corpus test required
the new site), and again after #150 (`VERIFIED_SPECS` and the contract's
schema constants unioned); derived shards regenerated each time.

Review round 1 (1 finding, fixed): `bounded_raw` kept NaN and infinite
distribution masses, so the outcome for that invalid output could not be
serialized and the evidence was lost. Such a distribution is now
recorded, and judged, as `Unrecognized { shape: non_finite_mass }` with
the masses as text (a new `ResponseShape` variant), so the outcome stays
a writable record and offline reproduction judges exactly what was
recorded.
`adapter_failures_and_malformed_outputs_are_named_and_never_retried` now
includes a NaN and an infinite distribution, asserts the recorded shape
and round-trips both outcomes. The implementation record says so.

Review round 1 (1 finding, fixed): `bounded_raw` kept NaN and infinite
distribution masses, so the outcome for that invalid output could not be
serialized and the evidence was lost. Such a distribution is now
recorded, and judged, as `Unrecognized { shape: non_finite_mass }` with
the masses as text (a new `ResponseShape` variant), so the outcome stays
a writable record and offline reproduction judges exactly what was
recorded.
`adapter_failures_and_malformed_outputs_are_named_and_never_retried` now
includes a NaN and an infinite distribution, asserts the recorded shape
and round-trips both outcomes. The implementation record says so.

Review round 2 (0 findings) on the rebased head 48c6c15.

Review round 3 (1 finding, fixed in the docs, behavior kept):
"`proposal()` omits `abstention` from `exact_processing` for label
answers, contradicting its doc comment and the implementation record."
The behavior is intended: under the explicit `label_only` posture no
abstention rule runs (`judge` returns `AbstentionDecision::LabelOnly`),
so listing `abstention` would claim an exact step that never ran. The
doc comment and the implementation record were wrong and now say
`validate` always, `abstention` only when thresholds were applied. The
core test for label output now builds the proposal and asserts its
lineage is exactly `["validate"]`.

Review round 4 (0 findings) on f9c4045. Rebased onto `main` after #152
(no conflicts, shards current).

Review round 5 (0 findings) on 54587eb; ci-gate passed.

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 4cecab0b Deployed Oct 21, 2026 by bartekus via review-exception #978
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