Repository navigation
impl(019): dynamic questions - #148
Conversation
AI review (findings)Review
|
deb4f24 to
48c6c15
Compare
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 (
Core (
Runtime (
Eval (
Spec (
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. |
48c6c15 to
af32a78
Compare
AI review (findings)Reviewing the PR implementing spec 019 (dynamic questions) across AnalysisContract layer ( Core layer ( Runtime layer ( Eval layer ( Concrete defect found: In 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, {"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. |
AI review (no-findings)Reviewing the PR, which implements spec 019 (dynamic questions) across Document/type separation (§3.1): The contract module uses Projection integrity (§3.3): Bounds and scanner ordering (§3.2): Non-finite mass handling: Cost admission and ledger path:
Spec lifecycle: The fp-corpus addition: The new 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"].
f9c4045 to
54587eb
Compare
AI review (no-findings)Reviewing the diff carefully across all changed paths. Contract (
Core (
Runtime (
Eval (
Spec (
Makefile, archive-policy, fp-corpus
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. |
…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.
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 byDynamicCapabilityId) andrustev.dynamic-outcome/1(RECORD_V1);DynamicRequestId,TemplateId; theDYNAMIC_QUESTION_V1scan 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):validatebuilds the onlyValidatedQuestion;admit(capability fit, no truncation,boundedcost 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).DynamicBackendandDynamicEvidenceSinkseams, separate fromDecisionBackend, with no tool, function or retrieval surface. Compile-fail tests with a compiling control keep dynamic outcomes, raw outputs and proposals out ofSupplied,Evaluation::supplyandJudgment, and keepValidatedQuestionunforgeable.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):reproducetakes no backend; a changed canonical identity isincomparable{request_changed}(section 5's last row: reordered labels), another declarationcapability_changed, a missing raw responseraw_response_unavailable, a different judgmentdiverged.rustev.dynamic-dataset/1andrustev.dynamic-evaluator-config/1bind 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_onlyon synthetic data, every gateunknown.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 nowextendstools/rustev-release/(additive) for it.tools/rustev-conformance/fp-corpus(spec 027, 3.11.3): the dynamic log loss'srustev_core::math::lncall joins the differential corpus aseval.dynamic_log_loss.ln(probability domain, as the existing log-loss site), with its digests committed inexpected.json; 019extendstools/rustev-conformance/(additive) and its verification runs the corpus test.Makefile: 019 joinsVERIFIED_SPECS.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:
crates/rustev-contract/schema/and changes the generated binding types underintegrations/rustev-wasm/types/that spec 027 owns, and neither spec says whether dynamic documents belong in the binding surface.DISTRIBUTION_TOLERANCEis 0.000001, equal to the reference plans' tolerance.min_marginis top mass minus the second mass; ties go to the earlier declared label.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 thewasm32-unknown-unknowntarget. Rebased ontomainafter #146, again after #143 to #145 merged (#145's corpus test required the new site), and again after #150 (VERIFIED_SPECSand the contract's schema constants unioned); derived shards regenerated each time.Review round 1 (1 finding, fixed):
bounded_rawkept 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, asUnrecognized { shape: non_finite_mass }with the masses as text (a newResponseShapevariant), so the outcome stays a writable record and offline reproduction judges exactly what was recorded.adapter_failures_and_malformed_outputs_are_named_and_never_retriednow 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_rawkept 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, asUnrecognized { shape: non_finite_mass }with the masses as text (a newResponseShapevariant), so the outcome stays a writable record and offline reproduction judges exactly what was recorded.adapter_failures_and_malformed_outputs_are_named_and_never_retriednow 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()omitsabstentionfromexact_processingfor label answers, contradicting its doc comment and the implementation record." The behavior is intended: under the explicitlabel_onlyposture no abstention rule runs (judgereturnsAbstentionDecision::LabelOnly), so listingabstentionwould claim an exact step that never ran. The doc comment and the implementation record were wrong and now sayvalidatealways,abstentiononly 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
mainafter #152 (no conflicts, shards current).Review round 5 (0 findings) on 54587eb; ci-gate passed.