Repository navigation
impl(063): increment 2, profiles and variants in the Node binding - #520
Conversation
AI review (findings)Reviewing the diff for bugs, security problems, and inconsistencies across the eight changed paths. Structural correctness: The JS Command routing ( Routing
The four guards are enforced in the stated order and cover plan-mode/definition-mode exclusion, pair completeness, at-least-one-side-specification, and mandatory Concrete defect: template detection in In let template = parse_bounded::<Value>(definitions[0], &DEFINITION_V1)
.ok()
.is_some_and(|v| {
v["schema"] == "rustev.definition/2"
&& (v.get("parameters").is_some()
|| v.get("variants").is_some()
|| Definition::parse(definitions[0]).is_err())
});If the definition's byte size exceeds if template || profile.is_some() || !bases.is_empty()
|| present(a, "variant") || present(a, "definitionVersion")
|| definitions.len() != 1is entirely false, so execution falls to No other concrete bugs or security issues found. The {"head": "7972eb57eed04112ed9573acc790cee13d4da7d5", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/src/profile.rs", "line": null, "severity": "medium", "category": "correctness", "summary": "Template detection in `compile` calls `parse_bounded::<Value>(definitions[0], &DEFINITION_V1)`; a v2 definition template whose byte size exceeds the DEFINITION_V1 parse limit, supplied without any instantiation hint (profile, variant, profileBases, definitionVersion), sets `template = false` and falls to `Definition::parse` / `compile_with_sources`, yielding a confusing InvalidDocument error instead of routing through `compile_profiled_with` as spec 063 §3.2.1 requires."}]}Subject: 49fac12...7972eb5, diff digest f5fc2eb40af31196a21de49401b28dc64ba99a308cc35f697f51bf38bd1fe1fa, 1 call(s). An AI comment is not an approval. |
AI review (findings)Review of PR 4dc430aThis PR implements increment 2 of spec 063 (node-binding-parity): adds FindingsTypeScript type declaration inconsistency ( The export type PlanDiffArgs = { ... }
| { definitions: string[]; leftProfile?: string; rightProfile?: string;
leftVariant?: string; rightVariant?: string; ... out: string };The TypeScript type therefore permits if !plans
&& !["leftProfile", "rightProfile", "leftVariant", "rightVariant"]
.iter()
.any(|k| present(a, k))
{
return Err(usage("planDiff (c): a side profile or variant required"));
}A TypeScript caller using these declarations gets no compile-time warning but a runtime No other findingsThe rest of the implementation is consistent:
{"head": "4dc430a943e723f8d314ca41446169e2041f77d5", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/index.d.ts", "line": 385, "severity": "low", "category": "correctness", "summary": "PlanDiffArgs definitions-mode variant allows all of leftProfile/rightProfile/leftVariant/rightVariant to be absent, but profile.rs::validate rule (c) requires at least one; TypeScript callers receive no compile-time warning for a runtime-rejected input."}]}Subject: 49fac12...4dc430a, diff digest c2d78ddd81dd5ac185d67a243c09e77fbe7f016a475b87a5865c492612ad5728, 1 call(s). An AI comment is not an approval. |
|
Review note: the finding on
The earlier finding on 7972eb5 (template detection under the definition parse bound) was fixed in 4dc430a. An oversized definition is now refused before detection, matching the bound |
4dc430a to
8f33e60
Compare
AI review (findings)Looking through the diff carefully, focusing on correctness, security, and consistency between the JS validation layer and the Rust implementation. Review
|
|
Review note on the 8f33e60 findings:
The squashed head also fixes the governance failure on 8f33e60: its intermediate commits had stale 063 shards after the rebase onto #518. The branch is now one commit whose tree passes |
8f33e60 to
535487d
Compare
AI review (findings)Reviewing the diff for bugs, security problems, and inconsistencies against the governance context and spec 063. Key areas examined:
Finding: In profileCheck(inputs, args) {
return this.commandSync('check', inputs, args);
}It passes The spec increment 2 text (added in this same PR, No other concrete defects were found. The JS-side validation in {"head": "535487d48f87407c92c333f5bf41d71eba644e9c", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/index.js", "line": 512, "severity": "medium", "category": "correctness", "summary": "profileCheck calls this.commandSync('check', …) instead of this.commandSync('profileCheck', …), routing to plan_command(\"plan check\") rather than profile::check(\"profile check\") as spec 063 increment 2 requires."}]}Subject: 86bfc94...535487d, diff digest b7d130be1fecd85e752eb93af20dfa1d6b65074fcf8ab8c22a1833921bd9849e, 1 call(s). An AI comment is not an approval. |
|
Review note on the 535487d finding (index.js line 512): a false positive. |
AI review (findings)Reviewing the diff across all eight changed paths for bugs, security problems, and inconsistencies against the governance context.
The two branches of the union are not mutually exclusive: TypeScript does not reject an object that supplies both
The revision note at the bottom of the diff records "Increment 2, 2026-11-05" while the subsequent "Increment 3a" entry is dated 2026-11-06. The PR head is submitted on 2026-11-06. The date for increment 2 appears to be one day early.
For the non-
For No other concrete defects found. The JS-side {"head": "e35cee5b09b0daf065d9d95b3427d80f6bae7075", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/index.d.ts", "line": 388, "severity": "low", "category": "correctness", "summary": "PlanDiffArgs is a plain union, not a discriminated union, so TypeScript accepts objects mixing plans-mode fields (leftPlan/rightPlan) with defs-mode fields (definitions), which the runtime rejects with error (a)."},{"path": "specs/063-node-binding-parity/spec.md", "line": 773, "severity": "low", "category": "other", "summary": "Increment 2 revision note is dated 2026-11-05 while Increment 3a immediately following is dated 2026-11-06 and the PR is submitted 2026-11-06, making the increment 2 date one day early."},{"path": "integrations/rustev-node/src/profile.rs", "line": 42, "severity": "low", "category": "correctness", "summary": "validate() for non-planDiff commands does not check that at least one of definition/definitions is present; the missing-definition error is raised by the subsequent definitions() call, outside the centralised validation boundary the spec describes."}]}Subject: 86bfc94...e35cee5, diff digest 132fe2827914a7dcc42c5d68ac779223669245a6130d4f0416419dda837fce03, 1 call(s). An AI comment is not an approval. |
|
Review note on the e35cee5 findings (all low; none changes behavior):
|
|
M1: removed from the merge queue at 03:23. |
…derive PlanId-keyed baselines, ledgers and caches (#528) ## Summary The release family moves from `0.4.1` to `0.5.0` in lockstep. The owner set release 0.5.0 as the sprint goal on 2026-11-05, within the release approval of 2026-11-03 extended through the final release. Only the timing is earlier: the move lands ahead of the 0.5.0 feature freeze because spec 031 3.8's npm declaration check (`make semver`, `tools/rustev-release/npm-api-diff.mjs`) classes a new required member of the Node binding's `Engine` (spec 063 increment 2's `planDiff` and `profileCheck`, #520) as breaking, and refuses it until the version moves to the breaking position over the 0.4.1 baseline. Before 1.0 that is the minor number. #520 failed in the merge queue on exactly that. No behavior changes. The same procedure as #511 and #480. - **Why a minor step:** the binding increments add required `Engine` members, a breaking change under 031 3.8; a `0.x` family takes a break in its minor version, so `cargo semver-checks` and the npm check against 0.4.1 report rather than refuse. - **Version sites:** the workspace `version` and its internal `=0.5.0` pins, `Cargo.lock`, the nine npm `package.json` files, and `tools/rustev-release/release-set.json` (version and tag `v0.5.0`). - **Regenerated fixtures:** spec 002 3.3.4 puts `rustev-core/<crate version>` in every plan document, so every PlanId moves, and everything derived from one: `RUSTEV_BLESS=1 UPDATE_REPEAT_GOLDENS=1 UPDATE_SELECTION_GOLDENS=1 UPDATE_HOST_GOLDENS=1 cargo test --workspace`, the CLI re-bless, `make conformance-harvest`, the embed-linear ignored bless test, the `rustev-otel` bless, the byte copies #480 lists, and the `rustev-serve` Sigstore fixture re-signed with its throwaway local keys (four-argument `regenerate_sigstore.py`). The diff is hashes, version strings, recorded timing and the re-signed throwaway certificates. - **Spec 058:** a dated record entry for the 0.5.0 move: a breaking-position release; every PlanId changes from 0.4.1 to 0.5.0 and anything keyed by one must be re-derived on upgrade; the npm `Engine` gains required members (031 3.8). - **Release notes:** this title (the squash subject) carries the re-derive note, so the 0.5.0 changelog states it. - **`.statecraft/derived`:** refreshed (root `Cargo.toml` is a hashed input; the spec edit). Left unchanged on purpose: historical text naming 0.4.0 and 0.4.1, and synthetic versions under test. ## Verification - Bless and harvest paths on lane 1: after the last bless pass, `cargo test --workspace --locked --no-fail-fast` gave 2645 passed and 2 failed, the two byte-copy checks (`rustev-bedrock` `identity`, the pinned reference PlanIds; `rustev-eval` `packaged_fixtures`, the retained record). Both were refreshed from their sources (the core `*.plan-id` goldens; the harvested `lodging.replay` bundle's retained bytes). - `make refresh`, `make gate`: clean. - The final local run (full workspace tests, clippy `-D warnings`, fmt, `make boundaries`, `spec-spine verify` 058, 031 and 021, `make semver`) is reported in a comment on this pull request when it completes. `couple`: the regenerated fixtures are claimed through many specs' `extends` whose text this change does not touch. Spec 058 carries the authoring edit; the remaining paths are covered by the owner's waiver, as in #480 and #511. Policy isolation (profile revision 22, `guard-policy-files.sh`): this change touches `Cargo.toml` and `Cargo.lock` beside the fixtures, so governance's "Policy isolation" step is expected to fail. It cannot be split into parts that pass on their own: a pull request with only `Cargo.toml` and `Cargo.lock` fails its own tests (every PlanId fixture is stale), and one with only the fixtures fails against the 0.4.1 crates. The owner decided on 2026-11-06 to land it as one pull request by admin merge, bypassing only that guard, once every other check passes (code, verify, bindings, release-checks with semver, boundaries, and the AI review). The merged commit is never tagged: the 0.5.0 tag goes on a later commit whose own ci-gate passed. Spec-Drift-Waiver: family version bump to 0.5.0 (release 0.5.0, the owner's sprint goal decided on 2026-11-05), moved ahead of the feature freeze because spec 031 3.8 refuses the binding increments' new required `Engine` members until the breaking position moves. Every PlanId embeds the compiler crate version (spec 002 3.3.4), so fixtures are regenerated mechanically through their bless and harvest paths; no behavior changes. Approved by the owner on 2026-11-03 (release approval extended through the final release) and 2026-11-05 (sprint direction: release 0.5.0). Labelled `statecraft:stacked-ci` so this pull request's own run covers every acceptance group, release-checks and bindings: an admin merge skips the merge queue's full run.
compile and compileSync take definitions, execution, profile, profileBases, variant and definitionVersion (3.2), with sources reaching both compile paths; profileCheck and planDiff join the binding and command (3.3). The 23 parameterized cases run on cli and native.
e35cee5 to
409842d
Compare
AI review (no-findings)Reviewing the diff across all changed files. I'll work through validation logic, Rust/JS consistency, type declarations, and security surface.
Validation order:
For Check (a): Check (c) requires at least one side profile or variant in defs-mode. No path skips it incorrectly. The
if matches!(name, "check" | "compile" | "profileCheck" | "planDiff") {
return crate::profile::command(name, inputs, a);
}For
Increment 2 changelog accurately describes the routing, error types, detail shapes, and test coverage. No internal contradiction with the code changes. No concrete defects found. {"head": "409842d77ddbe3f1afacd0d2accb7e34154d48f1", "verdict": "no-findings", "findings": []}Subject: 4503383...409842d, diff digest 132fe2827914a7dcc42c5d68ac779223669245a6130d4f0416419dda837fce03, 1 call(s). An AI comment is not an approval. |
What
Spec 063 increment 2, profiles and variants in the Node binding.
compileandcompileSynctakedefinitions,execution,profile,profileBases,variantanddefinitionVersion(3.2). Usage rules throwInvalidDocumentnaming the field before any document is serialized or parsed (3.2.2). A version 2 template or an instantiation field compiles throughcompile_profiled_with; anything else throughcompile_with_sources, soexecutionnow reaches a persistent-tier plan (3.2.1).sources(increment 3a, impl(063): increment 3a, sources on compile and load in the Node binding #518) reach both compile paths, profiled or not. A definition overDEFINITION_V1.max_bytesis refused before template detection, asplan_command's bounded host read refuses it.CompileRefusalwith the 034 code in snake case and the surface'sstage,code,subject,detail; later compile refusals keep their category code withstage: "compile"andparameters(3.2.3, 3.10).command('check' | 'compile')routes throughrustev_surface::profile::plan_command(3.2.4).profileCheck(sync) andplanDiff(async) callprofile::checkandplan_diff::diff, also joincommand, and apply 034 3.14.4's checks (a) to (d) in order (3.3).index.d.ts(3.11); no generated declaration change.parameterized.*cases run oncliandnativewith unchanged expected bytes (3.13.1); onlymanifest.jsonis re-blessed.test/profile.test.mjs: each usage rule, both refusal kinds with their detail objects, PlanId and plan bytes equal to the CLI golden and theplan_commandoutput,executionreaching a persistent tier (store_missingat prepare without a store), base chains and version pins,profileCheck/planDiffhappy and refusal paths.Spec sections: 063 3.2, 3.3, 3.10 (034 codes), 3.11 (declarations), 3.13.1, and the profile rows of section 5.
Checks (local, macOS arm64)
cargo build --workspace --locked: passcargo test -p rustev-node --locked: passcargo test -p rustev-conformance --locked: passcargo clippy -p rustev-node -p rustev-conformance --all-targets --locked -- -D warnings: passcargo fmt --all --check: passcargo build -p rustev-node --locked --release,copy-addon.mjs: passtsc --noEmit --strict --lib es2022,dom integrations/rustev-node/index.d.ts: passnode --test integrations/rustev-node/test/*.test.mjs: 77 tests, 73 pass, 0 fail, 4 skipped (after rebasing onto impl(063): increment 3a, sources on compile and load in the Node binding #518;source.test.mjsincluded) (thelocal-embedfeature tests, skipped in a build without that feature as before)node tools/rustev-conformance/js/run.mjs native integrations/rustev-node: 218 cases, 0 failuresmake gate: passOTLP note: the OTLP Node tests (049 3.3 to 3.5) were skipped in the implementation sandbox, which refused
listen(EPERM); they were run here outside it and pass.