Skip to content

impl(019): dynamic questions - #148

Merged
bartekus merged 5 commits into
mainfrom
impl/019-dynamic-questions
Oct 21, 2026
Merged

bartekus merged 5 commits into
mainfrom
impl/019-dynamic-questions

Conversation

@bartekus

@bartekus bartekus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Review

crates/rustev-runtime/src/dynamic.rs — bounded_raw does not filter NaN/infinity from distribution masses

bounded_raw truncates label keys and limits collection length, but passes f64 mass values from a backend's distribution through unchanged:

R::Distribution(m) => R::Distribution(
    m.into_iter()
        .take(rustev_contract::dynamic::MAX_CLASSIFY_LABELS + 1)
        .map(|(k, v)| (cut(&k, DETAIL_BYTES), v))   // v is f64, NaN/inf retained
        .collect(),
),

core::judge → Distribution::new correctly returns InvalidOutput for NaN masses (tested in rustev-core/tests/dynamic.rs). The runtime then builds:

DynamicRaw::Output(raw)   // raw = Distribution({...: f64::NAN})

and stores it in DynamicOutcome.raw. Because DynamicRawOutput::Distribution is BTreeMap<String, f64>, calling record_canonical() on the outcome returns a serde_json serialization error for NaN — the evidence record for the InvalidOutput case cannot be written or delivered. The runtime test for malformed outputs (adapter_failures_and_malformed_outputs_are_named_and_never_retried) does not include NaN in its distribution cases and does not call round_trips for that coverage gap.

The fix is to map masses through a guard (e.g., if v.is_finite() && v >= 0.0 { v } else { f64::NAN } kept as a sentinel that is then caught by Distribution::new, or simply not stored in the distribution if non-finite), or to serialize the raw distribution as a structured enum that rejects non-finite values at the type level.


{"head": "e1396d1b93f5ff1592b585baebd9f2909f82989f", "verdict": "findings", "findings": [{"path": "crates/rustev-runtime/src/dynamic.rs", "line": 556, "summary": "bounded_raw passes NaN/infinity f64 mass values through unchanged; a backend returning such values produces a DynamicOutcome whose record_canonical() fails, silently losing evidence for the InvalidOutput case."}]}

Subject: 1204bc8...e1396d1, diff digest 50914b9724ce907fa0003cfa9b390bb1a253497db74d42ea96ca15942680d7b0, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 18:38 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/019-dynamic-questions branch from deb4f24 to 48c6c15 Compare October 21, 2026 19:51
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reading through the diff carefully, checking the contract types, core validation, runtime execution, and eval logic against each other and against the spec.

Contract (crates/rustev-contract/src/dynamic.rs)

  • DYNAMIC_QUESTION_V1 limits (256 KiB raw, 128 KiB max string, 64 collection length, depth 8, no fractional numbers) are consistent with the structural bounds they guard (128 KiB canonical, 64 KiB context values, 64 context fields, labels/privacy up to 64). Valid distributions are never truncated by the scanner.
  • DynamicCapability::check_bounds correctly enforces the served.identity present-exactly-when-pinned invariant, which the test confirms for all four cases.
  • DynamicQuestion::check_bounds uses MAX_CLASSIFY_LABELS.max(MAX_RUBRIC_LEVELS) for the label-count scan — intentionally operation-agnostic; per-operation limits are enforced by core::validate.
  • canonical_bytes failure during check_bounds produces a BoundsError rather than silently passing; the canonical-size bound is checked after the structural scan.

Core (crates/rustev-core/src/dynamic.rs)

  • validate checks: proposition fixed labels, per-operation label-count maxima, output-kind/operation compatibility, abstention-policy/output-kind consistency, threshold range [0, 1], positive deadline and cost cap, and the host allowlist. All match spec §3.2.
  • admit checks schema string, check_bounds, artifact, operation+output support, task family, every declared limit (without truncation), privacy options, and cost == Bounded; admit_cost separately enforces the per-call bound.
  • judge checks served-identity mismatch before output shape; distributions are validated via Distribution::new (exact label set, finite non-negative masses summing to 1 within DISTRIBUTION_TOLERANCE); abstention applies min_top_mass then min_margin, naming the rule.
  • Compile-fail doc-tests confirm that DynamicOutcome, DynamicRawOutput, and DynamicProposal cannot be laundered into Supplied, Evaluation::supply, or Judgment, and that ValidatedQuestion cannot be forged.

Runtime (crates/rustev-runtime/src/dynamic.rs)

  • ask_dynamic follows the specified order: early cancel/deadline check → admit → identity → projection → cost_bound (panic-safe) → admit_cost → reserve in fresh hard ledger → reserve in shared ledger → second early check → one attempt raced against cancel and deadline → settle both ledgers. No retry, fallback, or cache.
  • bounded_raw converts NaN/infinite distributions to NonFiniteMass material before the outcome is written as a record, preserving reproducibility; valid distributions (≤32 entries, all finite) are never truncated.
  • bounded_served cuts identity to 256 bytes, consistent with MAX_META_BYTES.
  • The answered helper in driver.rs is promoted to pub(crate) for reuse — the only driver.rs change.

Eval (crates/rustev-eval/src/dynamic.rs)

  • reproduce revalidates the request against its own task family (safe since dataset.check already validated it against the dataset's family), recomputes both identities, then re-judges the retained raw response. Changed identity → RequestChanged; changed capability → CapabilityChanged; no raw response → RawResponseUnavailable; different judgment → Diverged.
  • DynamicDataset::check enforces: non-empty cases, non-blank provenance fields (both dataset-level and Real-specific), at least one adversarial case, no duplicate case ids, no source/request-id leakage across splits, each case valid for the dataset's task family/question-schema/artifact/context-sources/labels.
  • All gates are always Unknown; synthetic provenance claims mechanics only; hidden-state capability is flagged non-qualifiable. These match spec §3.7 and R-04.
  • Metric ordering (coverage, abstention total, abstention.{reasons}, accepted_error, class-appropriate) is confirmed by the test.

Spec (specs/019-dynamic-questions/spec.md)

  • Transition from implementation: pending → complete is the correct lifecycle move for a fully implemented approved spec.
  • New extends entries for spec 031 (tools/rustev-release/, additive) and spec 027 (tools/rustev-conformance/, additive) cover the archive-policy and FP-corpus additions respectively, consistent with how spec 001 covers the Makefile.
  • Verification section enumerates concrete cargo test commands matching the actual new test targets.

No concrete defects found.

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

Subject: 2d6a1f2...48c6c15, diff digest 218d955dd97cf973487ab5b5decb0cb3098449664ce09deb167f82a7e7981eb9, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the PR implementing spec 019 (dynamic questions) across rustev-contract, rustev-core, rustev-runtime, and rustev-eval.

Analysis

Contract layer (rustev-contract/src/dynamic.rs): Document bounds, schema strings, and parse limits are consistent. The two-stage scan (raw bytes → check_bounds) correctly gates before expensive allocation. The DYNAMIC_QUESTION_V1 limit of 256 KiB raw for a 128 KiB canonical cap is justified. The pinned-identity invariant in DynamicCapability::check_bounds is implemented correctly.

Core layer (rustev-core/src/dynamic.rs): Validation logic is layered correctly. Operation-specific label counts (classify ≤ 32, rubric ≤ 16) tighten the document-level max(32,16)=32 after parsing. The abstention/output-kind pairing is correctly enforced. judge_distribution correctly uses the declared-label order for tie-breaking and for second-mass computation. The Judged type and the ValidatedQuestion newtype together enforce the type boundary preventing dynamic results from entering plan evaluation.

Runtime layer (rustev-runtime/src/dynamic.rs): One attempt, no retry, no fallback. Cost reservation and release are correctly balanced on every early-exit path. The NaN/infinite mass conversion to NonFiniteMass keeps the outcome a writable RECORD_V1. Cancellation and deadline paths replicate the plan driver's answered() pattern correctly.

Eval layer (rustev-eval/src/dynamic.rs): Reproduction checks identity first (request changed → incomparable), capability identity second, then re-judges the raw response. Gates always report Unknown, per spec. Corpus site eval.dynamic_log_loss.ln correctly uses the Probability domain since p > 0.0 is checked before calling ln.

Concrete defect found: In crates/rustev-core/src/dynamic.rs, the proposal() function's own doc comment states "the exact validation and abstention steps are listed, never a relabeling," and the spec's implementation record explicitly says the lineage always holds "the exact steps (validate, abstention)." However, the code omits "abstention" from exact_processing whenever the answer is DynamicAnswer::Label:

let mut exact_processing = vec!["validate".to_string()];
if !matches!(answer, DynamicAnswer::Label { .. }) {
    exact_processing.push("abstention".into());   // skipped for label-only posture
}

For a label-only request where the backend returns a valid label, DynamicOutcome.abstention is correctly set to AbstentionDecision::LabelOnly, but DynamicProposal.lineage.exact_processing is just ["validate"]. The acceptance under the explicit label-only posture is the abstention step being applied; not recording it makes the lineage incomplete and inconsistent with the spec's stated guarantee. No test covers the exact_processing content for accepted label-only proposals (the core test for a label answer only asserts j.result and j.abstention, not proposal(…).lineage.exact_processing).

{"head": "af32a7817de1b261c1c28f67ce66a859d7f1e6ad", "verdict": "findings", "findings": [{"path": "crates/rustev-core/src/dynamic.rs", "line": null, "summary": "proposal() omits \"abstention\" from exact_processing for DynamicAnswer::Label answers, contradicting the function's own doc comment and the spec's implementation record that both \"validate\" and \"abstention\" steps are always listed in the lineage."}]}

Subject: c58c52e...af32a78, diff digest dc3d21791347061fcf37f618502c4d5955d3fb2f7fd8d8e7a1036c10ba71ebac, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception October 21, 2026 20:35 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR, which implements spec 019 (dynamic questions) across rustev-contract, rustev-core, rustev-eval, and rustev-runtime, and marks the spec implementation: complete.

Document/type separation (§3.1): The contract module uses deny_unknown_fields on all three document types, and the core compile-fail tests verify no conversion path from DynamicOutcome, DynamicRawOutput, or DynamicProposal to Supplied, Evaluation::supply, or Judgment exists. The negative-control block confirms the refusals are structural, not typos.

Projection integrity (§3.3): DynamicProjection::of strips provenance, source, derivation, source_revision, scope, request_id, artifact, privacy, and abstention. The adversarial test in rustev-core/tests/dynamic.rs walks the projection JSON and asserts no role, system, tool, function, header, endpoint, model, artifact, url, or $schema key appears anywhere in the tree. The DynamicCall struct passes only projection bytes, template, attempt_id, cancel, and cx; it offers no tool, function, or retrieval surface.

Bounds and scanner ordering (§3.2): DYNAMIC_QUESTION_V1 sets max_bytes = 256 KiB (twice MAX_CANONICAL_BYTES), so whitespace and escape expansion cannot exhaust an allocation before the scan gate rejects the document. The check_bounds call follows deserialization, and the test for the canonical-size overflow (64 context fields of 1000 backslashes passes the raw byte limit and the value budget but exceeds the 128 KiB canonical limit) confirms that both passes run in the right order.

Non-finite mass handling: bounded_raw converts a distribution with any NaN or infinite mass into ResponseShape::NonFiniteMass + an excerpt before the value ever reaches judge_distribution. This keeps the outcome a writable RECORD_V1 document and ensures offline reproduction judges what was recorded, not something that cannot round-trip through JSON.

Cost admission and ledger path: admit_cost refuses Estimated and Unknown bounds. For a fresh per-request ledger with max_units = q.max_cost_units, the Ledger::reserve call immediately after a successful admit_cost should never fail (the reserved units are ≤ cap, ledger starts at zero), making the fallback CostAboveCap refusal at that point unreachable but inert.

answered visibility change: driver::answered is widened to pub(crate) so dynamic.rs can reuse the existing cancellation/remote-state mapping. No public API surface change.

Spec lifecycle: The implementation: pending → complete transition is in the contributor-controlled diff; owner ratification is enforced outside this review.

fp-corpus addition: The new eval.dynamic_log_loss.ln site follows the seed sequence (0x0027_3113_0000_0005) and uses Domain::Probability, consistent with the existing log-loss site. The digests in expected.json must be verified by cargo test -p rustev-fp-corpus --locked --test corpus per the verification block.

No concrete defects found.

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

Subject: c58c52e...f9c4045, diff digest 9e6365c267402e82ef0b2c8d7906a3191b98819cb47311f066a0f1547eb39da5, 1 call(s). An AI comment is not an approval.

Spec 019, increment 1 of 2: the dynamic question documents, pure
validation and identity, and the runtime entry point (3.1 to 3.6). Plan
in the spec's new implementation record.

- `rustev-contract/src/dynamic.rs`: `rustev.dynamic-question/1`,
  `rustev.dynamic-capability/1` (identified) and
  `rustev.dynamic-outcome/1` (RECORD_V1); `DynamicRequestId`,
  `DynamicCapabilityId`, `TemplateId`; the `DYNAMIC_QUESTION_V1` scan
  limits. Parsing checks the structural bounds of 3.2 (sizes, counts,
  byte-exact uniqueness, 64 KiB of context values, 128 KiB canonical).
  The canonical identity covers what a backend computes from, including
  label order, template and preprocessing; the projection carries data
  under fixed member names only.
- `rustev-core/src/dynamic.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, invalid non-answer material, pinned
  served identity, named abstention rules), `proposal` (model-derived,
  with lineage). `DynamicBackend` and `DynamicEvidenceSink` seams,
  separate from `DecisionBackend`. Compile-fail tests with a compiling
  control keep dynamic results out of `Supplied`, `Evaluation::supply`
  and `Judgment`.
- `rustev-runtime/src/dynamic.rs`: `ask_dynamic`, one attempt under a
  fresh hard ledger, deadline over every phase, spec 003/013 cancellation
  evidence, optional host ledger and sink.
- Tests: `dynamic_wire.rs` (contract), `dynamic.rs` (core, including the
  adversarial fixtures), `dynamic.rs` (runtime: section 5 rows 1 to 7
  with a dispatch counter and the scripted acceptance cases).
- The three new source files join spec 021's reviewed archive list; 019
  now extends `tools/rustev-release/` for it. No existing document,
  golden, plan id or test changed.
Spec 019, increment 2 of 2: offline reproduction, the dedicated dynamic
dataset, evaluator configuration and report (3.7), Verification, and
`implementation: complete`.

- `rustev-eval/src/dynamic.rs`: `reproduce` takes no backend; a changed
  canonical identity (section 5's last row: reordered labels) is
  `incomparable{request_changed}`, another declaration
  `capability_changed`, a missing raw response
  `raw_response_unavailable`, a different judgment `diverged`.
- `rustev.dynamic-dataset/1` binds task family, exact question schema,
  context sources, artifact, template, provenance, license, labeling,
  exclusions and limitations, requires an injection-adversarial case and
  refuses leakage across splits; `rustev.dynamic-evaluator-config/1`
  binds the same.
- `rustev.dynamic-eval-report/1`: coverage, then abstention by reason,
  then accepted error, then uncalibrated Brier and log loss or mean level
  distance, overall and over adversarial cases; `uncalibrated`,
  `mechanics_only` on synthetic data, every gate `unknown`.
- `crates/rustev-eval/tests/dynamic.rs`: reproduction, section 5's last
  row with a dispatch counter, dataset and binding checks, a synthetic
  evaluation.
- Verification declares the acceptance commands; `make verify` runs 019.
  The new source file joins the reviewed archive list.
- Left for the owner: the spec 027 JSON Schema emitter does not emit the
  dynamic documents (doing so changes the generated binding types spec
  027 owns).
…aterial

A backend distribution with a NaN or infinite mass made the outcome's
record_canonical() fail, losing the invalid-output evidence. It is now
recorded and judged as non_finite_mass material with the masses as text.
The runtime test covers NaN and infinite masses and round-trips both.
After rebasing onto #145, the corpus test refuses an unmeasured
rustev_core::math call. The dynamic report's log-loss ln joins the corpus
as eval.dynamic_log_loss.ln with its committed digests; 019 extends
tools/rustev-conformance/ for it and verifies the corpus test.
proposal() lists abstention only when thresholds were applied; a label
accepted under label_only runs no abstention rule. The doc comment and the
implementation record now say so, and a core test pins the label-only
lineage as ["validate"].
@bartekus
bartekus force-pushed the impl/019-dynamic-questions branch from f9c4045 to 54587eb Compare October 21, 2026 21:35
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff carefully across all changed paths.

Contract (rustev-contract/src/dynamic.rs, ids.rs, lib.rs, limits.rs)

  • Structural bounds in DynamicQuestion::check_bounds correctly use MAX_CLASSIFY_LABELS.max(MAX_RUBRIC_LEVELS) = 32 as the per-parse structural ceiling; per-operation enforcement (rubric ≤ 16, proposition = exactly [false, true]) is deferred to validate in rustev-core. This is consistent with the module doc's stated division.
  • DYNAMIC_QUESTION_V1 scan limit at 256 KiB raw vs. 128 KiB canonical is intentional: whitespace and escaping cannot double the canonical size beyond a factor of two by construction.
  • DynamicCapability::check_bounds correctly enforces served.identity present iff disclosure == Pinned and size-bounds it.
  • Schema strings are new, distinct from any plan schema.

Core (rustev-core/src/dynamic.rs, seams.rs)

  • validate redundantly calls check_bounds after parse; this is defensive, not a bug.
  • judge correctly handles the label_only / distribution / ordinal_distribution output-kind/abstention cross-constraints enforced by validate.
  • judge_distribution guards the unreachable LabelOnly case correctly.
  • DynamicBackend and DynamicCall carry no tool, function, retrieval or raw completion surface; compile-fail doc-tests close the type-boundary.
  • proposal lists "abstention" in exact_processing iff the answer is not a plain label, consistent with the spec's note that the LabelOnly posture runs no abstention rule.

Runtime (rustev-runtime/src/dynamic.rs)

  • Hard ledger is fresh per request; admit_cost ensures units ≤ cap before reserve, so the ledger.reserve().is_err() fallback is defensive-only.
  • bounded_raw uses take(MAX_CLASSIFY_LABELS + 1 = 33) for any distribution; rubric operations can have at most 16 declared levels, but the judgment's Distribution::new check against q.labels will reject the extra keys, and the raw is evidence only.
  • NaN/infinite mass is converted to NonFiniteMass before serialization; outcome stays a valid bounded record and reproduction judges what was recorded.
  • Served identity is recorded as reported, never replaced by the requested artifact. bounded_served cuts to DETAIL_BYTES.
  • Deadline and cancellation paths correctly release the ledger reservation before returning an undispatched outcome; settle is called after every dispatched attempt.

Eval (rustev-eval/src/dynamic.rs)

  • reproduce correctly compares capability identity via capability.id().ok(): if id() fails, the result is None, and retained.capability != None would return CapabilityChanged; if retained.capability is also None (no dispatch), RawResponseUnavailable fires first.
  • DynamicDataset::check requires at least one adversarial case globally; no per-split requirement is stated and an empty split produces Unknown metrics from measured(_, 0).
  • Leakage detection is on source and request_id across splits; same-split duplicates are expected and allowed.
  • All gates are always GateStatus::Unknown; this is by design per the spec (synthetic provenance or missing spec-023 admission).

Spec (specs/019-dynamic-questions/spec.md)

  • implementation: pending → complete is correct for a fully delivered approved spec.
  • New extends entries for spec 031 and spec 027 are nature: additive and match the archive-policy and fp-corpus changes in the diff.

Makefile, archive-policy, fp-corpus

  • Spec 019 inserted in numerical order in VERIFIED_SPECS. Archive entries inserted in alphabetical file order. Corpus site seed follows the sequence (0x0005).

No concrete defects found.

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

Subject: 0d67a8f...54587eb, diff digest 314c2d5f449053f297c3aa953fa7f1a4ed770f0731fef8079c8fc0248d53f60c, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus merged commit d058b43 into main Oct 21, 2026
7 checks passed
@bartekus
bartekus deleted the impl/019-dynamic-questions branch October 21, 2026 22:04
bartekus added a commit that referenced this pull request Oct 21, 2026
…153)

Registers the two remaining required CI jobs: spec 027's `bindings`
(3.12.5) and spec 031's `release-checks` (3.5, 3.6.7, 3.8, 3.12).

- `.github/workflows/bindings.yml` (owned by spec 027): `make bindings`
on the reference runner (`ubuntu-24.04` x64, Node 22), the native suite
under Node 20 and 24, and the seven-platform native matrix. On each
platform the matrix builds the addon, runs the differential corpus, and
installs both packages from their tarballs into a fresh project.
- `.github/workflows/release-checks.yml` (owned by spec 031):
`adoption`, one job per partial-adoption subset (the five subsets whose
crate is absent are reported as skipped, never passed); `msrv` at the
toolchain the members' `rust-version` declares; `semver` with the pinned
`cargo-semver-checks` 0.51.0, where `no-baseline` is recorded as not
applicable.
- Both are registered by adding them to `ci.extra_required_jobs` in
`project.setup.parameters` of `.statecraft/environment.json`, then
re-rendering with the revision-17 renderer (statecraft-cli commit
`2f366913240ab9c6a13e4da46d057b165574bd71`, profile identity
`fe0e763c8f21`): `init plan . --profile github-actions-rust` produced
plan `df5491a7507d9a49ad1df28ec2bfc1e69f63f0af47557c3f22076fc511009bcd`,
which `init apply` applied, reporting every rendered path at its
intended digest. The renderer changed only `statecraft-ci.yml` (the two
`uses:` jobs and `ci-gate`'s `needs`) and the two setup documents.
`specs/000-bootstrap/spec.md` and `standards/spec/constitution.md` were
withheld as owner-edited and are unchanged.
- Specs 027 and 031: implementation-record paragraphs (027 increment 7,
fourth change; 031 increment 4).

This PR changes the authority set, so it needs the owner's approval of
the `statecraft-review-exception` Environment once. Once the
seven-platform matrix passes, specs 046 and 027 can be marked complete
in a follow-up.

Local verification (macOS arm64): `make gate` passes with spec-spine
0.31.0. The new jobs themselves run only in CI.

Round 1 CI (win32-x64-msvc): all 34 conformance cases failed their
pinned fixture digests, because the Windows runner checks out with
`core.autocrlf=true`. The `native` job now disables it before checkout;
spec 027 records why.

Review round 2 (1 finding, fixed): the WebAssembly tools cache key did
not name the tool pins, and its `restore-keys` prefix could restore an
older cache whose tools then passed the `test -x` check. The key now
carries `wasm-bindgen-cli` 0.2.129 and `wasm-opt` 0.116.1, and each tool
is installed under a root named by its version, so a restored older
cache never supplies a stale tool. (Round 2 first failed on reviewer
infrastructure, "claude native binary not installed", and was rerun.)

Review round 3 (0 findings). Rebased onto `main` after #150, #152 and
#148 (no conflict; none touched a managed or workflow file); `make
gate`, `couple` and the authored-content check pass again.
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