Repository navigation
impl(027): increment 6, the native conformance cases - #132
Conversation
AI review (findings)Reviewing the PR, which adds the native conformance adapter for Finding 1 — const at = text.indexOf(`"${key}":`);This performs a raw string scan for Finding 2 — dead const records = [];
...
sink: { ..., deliver: async (rec) => (records.push(rec), 'ack') },
Finding 3 — permanently pending Promise when call.signal.addEventListener('abort', () => {
gates.delete(call.attemptId);
const on = b.on_cancel;
if (on === 'ignore') return; // promise stays pending forever
...
});The Promise returned by No issues found with the {"head": "9aaaec6218326301fd27c3dea31a69cb1e78c782", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "rawMember scans for the first occurrence of the key string rather than parsing JSON structurally, so it silently extracts the wrong value if 'judgment:' appears earlier in the golden file (e.g., nested or inside a string value)."}, {"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "The `records` array in `runCase` is populated by the sink's deliver callback but never read; `res.raw.evidence` is used for comparison instead, making the sink accumulation dead code."}, {"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "When on_cancel is 'ignore', the Promise returned by scripted() is never resolved or rejected, creating a permanently leaked Promise per cancelled attempt."}]}Subject: 30f0d54...9aaaec6, diff digest e211b76c8d7136e13dc11abbe9f790bb7105c93fc6404b8815339eca84349b41, 1 call(s). An AI comment is not an approval. |
30f0d54 to
c9000ff
Compare
9aaaec6 to
cdfebed
Compare
c9000ff to
11a1b4e
Compare
cdfebed to
9e5fad5
Compare
11a1b4e to
08f56b1
Compare
9e5fad5 to
92aeaad
Compare
08f56b1 to
a079e9b
Compare
92aeaad to
401ea61
Compare
a079e9b to
5033d49
Compare
401ea61 to
d4e8298
Compare
5033d49 to
904e9c9
Compare
d4e8298 to
f489c8f
Compare
AI review (findings)Reviewing the diff carefully across the JavaScript runner, the runtime case split, and the conformance manifest.
Lines adding const isKey = depth === 1 && text[k + 1] === ':';
if (isKey && ...) return valueAt(text, k + 2);
In ignored.push(() => rejectP(new rustev.SeamFailure({...})));Called after manifest.json / runtime.cancel split — consistent The split of the old
The
The rationale (a synchronous Rust seam can poll the {
"head": "f489c8fadb940aca232af5efc949d65872540db4",
"verdict": "findings",
"findings": [
{
"path": "tools/rustev-conformance/js/run.mjs",
"line": 80,
"summary": "rawMember assumes compact JSON: `text[k+1] === ':'` breaks silently for any golden that contains a space after the colon, returning null and reporting a false failure with no diagnostic."
},
{
"path": "tools/rustev-conformance/js/run.mjs",
"line": 331,
"summary": "Late rejection of `ignored` infer-promises after Promise.all completes may produce unhandled rejections in Node.js ≥15 strict mode if the native engine does not attach a .catch() to abandoned infer promises before the decide() settles."
}
]
}Subject: 904e9c9...f489c8f, diff digest 213cea627412821d9b048d9382b7555ddc2ace5d475a1e6160acaef4d37e2417, 1 call(s). An AI comment is not an approval. |
904e9c9 to
2c0874d
Compare
f489c8f to
4640bc6
Compare
2c0874d to
da7b57e
Compare
4640bc6 to
03b24c3
Compare
AI review (findings)Review
|
da7b57e to
8f44c05
Compare
03b24c3 to
d1520b5
Compare
8f44c05 to
9878333
Compare
d1520b5 to
3ecc132
Compare
9878333 to
3628179
Compare
3ecc132 to
b34691f
Compare
3628179 to
2910a8d
Compare
8563bae to
7a00fda
Compare
AI review (findings)Looking at this PR, which adds a native (Node.js) conformance adapter, splits
In status = { decision_id: id, status: d.ok.completion };The field name
Object.values(engine.gauges().backendInFlight).every((n) => n === 0)The Rust conformance runner uses Everything else looks sound: the {"head": "7a00fda2d5d8169e66c7ed2f2ed35f2af822fd7f", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "In runtimeCaseWith, d.ok.completion is read for the decision status, but if the native plan.decide() result uses a different field name (e.g. status), all runtime native comparisons silently produce wrong JSON — verify against index.d.ts."}, {"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "The advance_timer condition uses engine.gauges().backendInFlight (camelCase), but the Rust API uses backend_in_flight; if the Node.js gauges object uses snake_case, Object.values(undefined) throws a TypeError and breaks every advance_timer step."}]}Subject: d131805...7a00fda, diff digest 4741e52c9c9352023c5c529458d0d6e8d4f3cf23edcec971a0eb0d5ebab1fb80, 1 call(s). An AI comment is not an approval. |
d131805 to
9c164ee
Compare
7a00fda to
4e4aaed
Compare
AI review (findings)Reviewing the PR, which adds a "native" (Node-API) conformance surface alongside WebAssembly, splits the
The refactored WASM adapter changed the Original (inside const b = store !== undefined ? files.get(`${store}/${reference}`) : undefined;
return b ?? null;New (inside return (store !== undefined && files.get(`${store}/${reference}`)) || null;
Both functions handle
The Rust
The split is internally consistent:
{"head": "4e4aaed25d63f1594b2b1cb506c40e0c86a0aa46", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "In wasmAdapter, resolveItem uses `||` instead of `??`, so a found-but-empty Buffer is incorrectly treated as absent and returns null; the original code used `??` (nullish coalescing)."}]}Subject: 9c164ee...4e4aaed, diff digest 4fd61e2390640a434873b7ddb9011a6d263e55fdc0b4cab0e6f1bceae2c9038a, 1 call(s). An AI comment is not an approval. |
9c164ee to
d72ed52
Compare
0558532 to
6e0226e
Compare
d72ed52 to
61f70d2
Compare
6e0226e to
f2e36e1
Compare
AI review (findings)Reviewing this PR, which adds the native conformance adapter (increment 6, second change of spec 027), splits Key areas reviewed:
Cancel-case split: Manifest consistency: Standalone case files and manifest.json agree on sha256, mirrors, on_cancel values, and surfaces for both cancel variants. {
"head": "f2e36e1043fc647fcdbac993e82bf4ecc7332888",
"verdict": "findings",
"findings": [
{
"path": "tools/rustev-conformance/js/run.mjs",
"line": null,
"summary": "In `scripted()`, the late resolution for `on_cancel === 'ignore'` passes `output: {}` (an empty object not shaped like a real inference result); if the engine validates the payload before discarding it, this could cause an unhandled rejection in test runs."
}
]
}Subject: 61f70d2...f2e36e1, diff digest 3702edbe0a3b18ab846df27439f9f6e8ef2e44a817b7ab23adf1f3482b6c0b0d, 1 call(s). An AI comment is not an approval. |
61f70d2 to
7d50b93
Compare
AI review (no-findings)Reviewed the diff thoroughly across the Rust runtime changes, JavaScript conformance runner refactor, fixture updates, and case manifest changes.
The outer scanner tracks
The code first tests
The comment explicitly says the native seam discards the settlement value once the attempt is marked finished. The
The Rust
The split correctly separates "backend ignored cancellation → Minor variable shadow in
No actionable defects found. {"head": "b6b0f0ae5c46f28b4d2909d5ffd68062c3666742", "verdict": "no-findings", "findings": []}Subject: 1a218ba...b6b0f0a, diff digest 9030006ab8cfb0f306fa7715b5099263661477abbce1bc2e4f2d7c8844c2afde, 1 call(s). An AI comment is not an approval. |
AI review (findings)Reviewing the diff, the main changes are: (1) adding "native" surface to all conformance cases, (2) splitting
The const got = Buffer.concat([Buffer.from(res.raw.evidence), Buffer.from('\n')]);
if (!got.equals(golden)) failures.push(`${c.id}: the record differs from ${o.golden}`);The byte comparison is unconditional. When a case declares
The engine used for pure commands is created with: const quiet = { queueCapacity: 1, deliver: async () => 'unused' };The {
"head": "eab4cd41af33ce628af76e36e8c17c11f7008e70",
"verdict": "findings",
"findings": [
{
"path": "tools/rustev-conformance/js/run.mjs",
"line": 270,
"summary": "In runCase, record bytes are compared against the golden unconditionally before normalization is checked; if CLI-generated golden records contain non-zero timing fields, every native run case with normalize:[\"timing\"] logs a false byte-mismatch failure even when the logic is correct."
},
{
"path": "tools/rustev-conformance/js/run.mjs",
"line": 191,
"summary": "The pure engine's sink returns 'unused' instead of 'ack'; if the native SDK validates the acknowledgment string after delivering replay evidence, replay conformance cases on the native surface will throw rather than pass."
}
]
}Subject: 1d0b10b...eab4cd4, diff digest 1056eb4f07855c76fa6ce8cf3d40c2facf882959181efbb80e2126756d623b15, 1 call(s). An AI comment is not an approval. |
AI review (findings)Looking through this PR, which adds a "native" conformance adapter for the Node.js package alongside new runtime test cases (
The new "runtime.cancel-stop" => {
...
assert_eq!(
q.attempts[0].cancellation,
Cancellation::Requested {
answer: CancelAnswer::NotObserved // ← wrong
}
);
assert_eq!(q.attempts[0].remote, RemoteState::PossiblyContinuing); // ← wrong
assert_eq!(r.cost.liability, 15); // ← wrong
}But the golden file No other substantive bugs found. The {"head": "ae1ee146f5f4432053cf1d36d159466690ff476e", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/tests/runtime.rs", "line": 362, "summary": "The `runtime.cancel-stop` arm in `mirrors` asserts `CancelAnswer::NotObserved`, `RemoteState::PossiblyContinuing`, and `liability==15` — copy-pasted from the updated `runtime.cancel` arm — but the golden file and the mirrored test require `CancelAnswer::Stopped`, `RemoteState::Stopped`, and `cost.observed==6`, so the conformance test will fail."}]}Subject: 1d0b10b...ae1ee14, diff digest 9ba17169d5c0616494e206ab52e25704201e0e0df3a1471b737f910781b04543, 1 call(s). An AI comment is not an approval. |
AI review (no-findings)Reviewing the diff carefully across all changed paths.
SHA-256 hashes — All No bugs, security issues, or inconsistencies found. {"head": "8cdf584b3c187d4f923e182eaa1363128e380017", "verdict": "no-findings", "findings": []}Subject: 21bb55f...8cdf584, diff digest 8e924cd7c27976176d804d70fd69fa5e6b689205ab7b5e7ef01032e7e8b958af, 1 call(s). An AI comment is not an approval. |
AI review (no-findings)Reviewing the diff carefully across all changed files.
The condition change at line ~213 from
Both functions correctly handle escape sequences (
The comparison for stdout outputs extracts the One variable-name shadow: the inner
For
The new step correctly calls Manifest / case file consistency
No security issues found. The one latent risk is the {"head": "cd65eb76585ebfaf3830ec4593688c0af607fd12", "verdict": "no-findings", "findings": []}Subject: 2fdea99...cd65eb7, diff digest e8d87ec082e38dc833f64fe9f703231bb9b5c4e477f601f75259d72a2ad6b317, 1 call(s). An AI comment is not an approval. |
AI review (findings)Review
|
AI review (findings)Reviewing the changes carefully across the spec update, the Rust conformance driver, the JS runner, and the corpus of fixture/case files. Makefile / spec / fixture files: The additions look consistent. The new
In const got = Buffer.concat([Buffer.from(res.raw.evidence), Buffer.from('\n')]);
if (!got.equals(golden)) failures.push(`${c.id}: the record differs from ${o.golden}`);The comment says the golden "holds the normalized form (timings zero)". This relies entirely on the CLI test producing zero-millisecond timings for the rules backend. The normalization loop that follows is a post-hoc sanity check, not a pre-comparison normalizer — if the golden was captured with non-zero All other pieces — {"head": "de50f99f3571408d30ad03b7c96fdf78d1c9f442", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/run.mjs", "line": 249, "summary": "runCase compares the record output byte-for-byte against the CLI golden without applying timing normalization to the golden first; if any golden was captured with non-zero dispatched_ms/ended_ms the test permanently fails with a misleading message, because the normalize entries are only used to assert zeros in `got`, never to normalize `golden`."}]}Subject: 6a59143...de50f99, diff digest 8f124e11a65cebb2f1b5e5362d937a673294f7ef5680c8d9c215261e8d73b4bc, 1 call(s). An AI comment is not an approval. |
AI review (no-findings)The PR adds the Consistency checks:
Code review of
No correctness bugs, security issues, or inconsistencies found. {"head": "6b12322a1b3b89b12396c606921865febd452f52", "verdict": "no-findings", "findings": []}Subject: 3864be6...6b12322, diff digest 6d1ed0c530b9c839d2addd00aef388479dd1ac2902977cc3586cf54b3d114df6, 1 call(s). An AI comment is not an approval. |
AI review (findings)Reviewing the PR, which adds a native (Node.js) conformance adapter, splits
Old: De Morgan check: for a non-pure, non-run case
The hand-rolled JSON scanner skips strings by advancing
const answer = list.length ? list[...] : null;
if (answer !== 'gate') return Promise.resolve().then(() => settle(answer));
engine.clockDelays().includes(arg.delay_ms)If the native module returns delays as Cancel-case split consistency
Step::AdvanceTimer { delay_ms } => {
until("the timer, with no attempt in flight", || {
clock.pending_delays().contains(delay_ms)
&& rt.gauges().backend_in_flight.values().all(|n| *n == 0)
}).await?;
clock.advance(*delay_ms);
}
Bundle fixture re-generation
Minor: {"head": "297fd90f32e425a2bc3ff0144c97d2ebef7d6aa1", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "scripted() throws 'unknown answer' for any non-null, non-object, non-'gate' string in an answer list (e.g. 'finished'), silently failing future cases that use such answers"}, {"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "advance_timer driver step uses .includes(arg.delay_ms) where arg.delay_ms is a JS number; if the native engine.clockDelays() returns BigInt values, strict equality silently never matches and the until-loop exhausts its limit, reporting a misleading 'waited forever' error"}]}Subject: ba225e8...297fd90, diff digest 6d1ed0c530b9c839d2addd00aef388479dd1ac2902977cc3586cf54b3d114df6, 1 call(s). An AI comment is not an approval. |
AI review (findings)Reviewing the key changes: new Finding:
Step::AdvanceTimer { delay_ms } => {
until("the timer, with no attempt in flight", || {
clock.pending_delays().contains(delay_ms) // ← new method
&& rt.gauges().backend_in_flight.values().all(|n| *n == 0)
})
.await?;
clock.advance(*delay_ms);
}
Everything else is internally consistent: the cancel/cancel-stop case split correctly threads through {"head": "935813f396240d9b27db56437816aabb71c96fff", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/runtime.rs", "line": 476, "summary": "AdvanceTimer calls clock.pending_delays() which the spec describes as a new accessor on ManualClock, but crates/rustev-runtime/src/clock.rs is absent from the changed paths, so the method is not implemented and the crate will not compile."}]}Subject: ba225e8...935813f, diff digest 04d049de8dbb672665746474e308059b77b482ed8a87f4ca7a233410d33af28c, 1 call(s). An AI comment is not an approval. |
AI review (no-findings)Reviewing the diff across all changed paths.
The condition change from
The new
The Cross-file SHA-256 consistency All SHA-256 values cross-check cleanly:
Fixture descriptors New No findings identified. The logic, cross-file consistency, golden content, and surface assignments are all correct. {"head": "e96e1231e89458aaa7f1e40240991ea6cfed5343", "verdict": "no-findings", "findings": []}Subject: ba225e8...e96e123, diff digest 98f9806b46614fe125ec27399f8d66c7807816a58649d3e37513489ac35751e0, 1 call(s). An AI comment is not an approval. |
AI review (no-findings)Reviewing this PR carefully: it adds a "native" surface to all CLI conformance cases, splits Checked items:
No bugs, security issues, or inconsistencies found. {"head": "e87f305fd0b25a2629199e8e32468f0496423e6f", "verdict": "no-findings", "findings": []}Subject: 7d37649...e87f305, diff digest 98f9806b46614fe125ec27399f8d66c7807816a58649d3e37513489ac35751e0, 1 call(s). An AI comment is not an approval. |
Spec 027, increment 6 (second change): the native conformance adapter. Stacked on #131.
tools/rustev-conformance/js/run.mjsgains thenativeadapter: every CLI case runs natively (pure commands compared whole with exit codes;runcompared on the judgment and the run record, the envelope's paths, receipt and exit code being CLI presentation), and every runtime case runs with TypeScript scripted seams driven on a manual clock. All 34 native cases produce their expected bytes, repeatedly; the 23 WebAssembly cases still pass.cli/native/wasm,runcli/native, runtime casesrust-api/native).advance_timer { delay_ms }advances only when that retry delay is pending and no attempt is in flight (viaManualClock::pending_delays, impl(027): increment 6, the native crate #131). Both runners use it.cancel.rs::no_answer_means_local_waiting_stopped_and_nothing_more; the confirmed-stop case stays Rust-only (runtime.cancel-stop), because the runtime polls a cancelled attempt once and a host seam can never answer within that poll (recorded in the spec as an owner finding).make bindingsruns the native conformance after the native tests.Review round 1 (3 findings, fixed): (1)
rawMemberwalks the document's structure and matches only a top-level key, never a nested key or text inside a string. (2) The sink's records are now checked: aruncase requires the sink to have received exactly the bytes the result carries. (3) An attempt whose scripted backend ignores cancellation is settled when its case ends, as the late resolution the engine discards, so no promise is left pending. Restacked on #131; native 34/34 (three runs) and wasm 23/23.Review round 2 (2 findings, fixed): (1)
rawMembertolerates whitespace around the colon and before the value (canonical goldens are compact, but nothing depends on it); checked on nested keys, spaced JSON and a key inside a string. (2) An attempt whose scripted backend ignored cancellation is settled after its case by resolving, never rejecting, so a discarded late settlement cannot surface as an unhandled rejection. Restacked after #133 merged; native 34/34 (twice), wasm 23/23.Review round 3 (3 findings, fixed): (1) an unknown
on_cancelvalue rejects at once as a script error instead of leaving the attempt waiting. (2) the sink check runs for everyruncase, whatever outputs it pins: the sink must have received exactly the result's record bytes. (3)rawMember's string scans are bounded by the text's length, so malformed JSON ends the scan. Native 34/34 (twice), wasm 23/23.Review round 4 (1 finding): by design: the native package links the rules backend (3.3.2) and reads a rules program itself, as the CLI does, so the native adapter passes the program's own bytes and every check and compile case with a rules program produces the CLI's bytes natively (34/34); only the WebAssembly adapter, which cannot read a rules program (3.10.1), substitutes the derived descriptor. The code now says so.
Restacked after #130 stopped recording derived descriptors on
runcases: this PR now records them forruncases itself (the harvest gives them to pure andruncases; the native runner prepares a compiled plan against them), restored byte-identical to the descriptors the pure cases carry. Native 34/34, wasm 23/23.Review round 5 (3 findings): (1)
ManualClock::pending_delaysis incrates/rustev-runtime/src/clock.rsfrom #131, this PR's base, so it is in the tree this PR builds on; the workspace compiles and the Rust runner uses it. (2) fixed:valueAthas one exit per kind of value: a container ends at its matching bracket, a scalar before the delimiter after it; checked on nested, spaced, string and number members. (3) fixed: each runtime case keeps its own list of ignored attempts and settles it when the case ends, however it ends, so none reaches a later case. Native 34/34 (twice), wasm 23/23.Review round 6 (1 finding, fixed): a record output is compared byte for byte, and every normalization its case declares must already hold:
timingrequires the record's timings to be the normalized zeros (they are, under the manual clock), and any other normalization fails the case, so none passes unchecked. Native 34/34 (twice), wasm 23/23.Review round 7 (2 findings, both verified against #131):
DecideResult.completionis the declared field (index.d.ts), and the native gauges object's key isbackendInFlight(src/lib.rsbuilds it in camelCase for JavaScript); every runtime case drivesadvance_timerthrough it, and native passes 34/34.Review round 8 (1 finding, fixed): the WebAssembly adapter's store resolver returns an item that exists but is empty; only an absent item is null. Restacked after #129 was split (#134 holds the runtime cases).
Review round 9 (1 finding): the late settlement's value is never read: the native seam (
integrations/rustev-node/src/seams.rs, #131) takes a host's settlement as plain JSON, and when the attempt has already finished it discards and counts it before anything parses it, so no shape can cause a rejection; the runner's comment now says so. Restacked; native 34/34 (twice), wasm 23/23.Restacked on #134's fixes: the native runner gains the
wait_sleeperstep (the deadline case now waits for the runtime's timer) and fails arelease_allthat frees nothing, as the Rust runner does. Native 34/34 (twice), wasm 23/23.CI
codefailed on the previous head: this PR had removed the Rust runner'swait_sleeperstep (its retry case moved toadvance_timer) while #134 now uses it in the deadline case. Restored, with both runners supporting it; verified from a clean build ofrustev-runtimeandrustev-conformance(an earlier local run had used a stale shared build). Native 34/34 (twice).Restacked on #130's last round: the runner's pure-command comparison (
comparePure) checks written outputs against the published artifact (never skipping one), and the WebAssembly path requires its commands' flags by name. Native 34/34 (twice), wasm 23/23.Review round 10 (2 findings): (1) The record goldens hold the normalized form (timings zero, written by the CLI tests through the shared normalization), and a decision under the manual clock produces exactly those bytes, so the byte comparison is the right one; native passes 34/34. The comment says so. (2) fixed: the pure-command engine decides nothing, so its sink now throws if ever delivered to, failing the case, instead of answering a placeholder receipt.
Restacked on #135 after #131 was split: this PR is now increment 6's third change, on the JavaScript layer. Native 34/34 (twice), wasm 23/23.
Rebased after #130 merged: the harvest keeps main's staleness checks (inputs, derived descriptors, surfaces) with this PR's surfaces (
nativeon every CLI case) and derived descriptors onruncases; the runner keeps its scope object with main's required fields. A re-harvest reproduces every case file (the wall-clock replay bundle aside). Native 34/34 (twice), wasm 23/23.Review round 11 (3 findings): (1) fixed: the attempt loop no longer shadows the flags object. (2) Not so: the native
commandtakes its arguments as a JSON value and deserializesscopefrom an object (integrations/rustev-node/src/commands.rs,replay_config), and the native replay cases pass; the comment says why it differs from the WebAssembly call, which takes a string. (3) Repeated:ManualClock::pending_delaysis in #131, this PR's base.Review round 12 (1 finding, raised before): the record goldens are written in their normalized form by the CLI tests (timings zero), so normalizing them would change nothing; the runner now checks that on the golden too, failing with a message naming it if a golden were ever stored unnormalized, as it checks the record. Native 34/34 (twice).
Split (the AI review was cancelled at its 15-minute limit twice): this PR is now increment 6's third change, the native conformance cases (surfaces, derived descriptors on
runcases, the runtime driver's corrections and the Rust-only cancel-stop case); the JavaScript runner's native adapter (run.mjsand itsmake bindingsstep) moves to a PR stacked on this one.Review round 13 (1 finding, raised before):
ManualClock::pending_delaysis on main (crates/rustev-runtime/src/clock.rs, from #131, increment 6's first change), so this PR does not change that file and the crate builds; the spec record now names where the accessor comes from rather than reading as if this change adds it.