Repository navigation
impl(067): resume, rerun, shutdown during a run, native live conformance and closure (increments 3 and 4) - #563
Conversation
AI review (findings)Looking at the four changed files, I'll examine the shutdown logic, seams accounting, and the checkpoint validation.
The // index.js ~875
const abandonedPending = this.gauges().seams.reduce((n, s) => n +
(s.name.startsWith('backend:') ? s.queueDepth : (s.abandonedPending ?? 0)), 0);The Rust changes in
// index.js ~866
while (remaining > 0 && (running.get(this).size > liveRuns.get(this).size || remaining > liveRuns.get(this).size) && Date.now() < settleBy) {
No findings in {"head": "0ee6097facbbcbd3906a61f0ffe6f8a87ddfe6a2", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/index.js", "line": 875, "severity": "medium", "category": "correctness", "summary": "abandonedPending for backend seams is computed from s.queueDepth (queued-but-unstarted items, never backed by a JS Promise) instead of s.abandonedPending, which seams.rs now tracks correctly via the new callbacks flag; this overestimates the returned count and contradicts the Rust changes in the same PR."}, {"path": "integrations/rustev-node/index.js", "line": 866, "severity": "low", "category": "correctness", "summary": "The settlement-loop exit condition compares the native runtime's remaining count against the JS-side liveRuns handle count; because one live-run handle can correspond to multiple native tasks, the comparison is unreliable and can keep the loop running unnecessarily or exit it before a regular decision has settled."}]}Subject: 601fd89...0ee6097, diff digest 73f0f6fcfc9e2de2676a360e813526591fe708d4c8b815e976e48c19ee50a6e2, 1 call(s). An AI comment is not an approval. |
0ee6097 to
7917113
Compare
AI review (findings)Reviewing the four changed files for bugs, security problems, and correctness issues. index.js — shutdown changes The live_run.rs — checkpoint pre-validation Reading with seams.rs — The increment/decrement invariants for
Corresponding path in
Currently safe because test/live.test.mjs The {"head": "7917113ffdb7a89a5b05ca8272ee26305e19dd5d", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/src/seams.rs", "line": 439, "severity": "low", "category": "correctness", "summary": "The new `abandoned_pending.fetch_sub(1)` in HostBackend::infer is not guarded by `stats.callbacks`, while both the corresponding increment and the try_recv-branch decrement in Reply::drop are guarded; if callbacks were ever false on a HostBackend stats object the counter would underflow."}]}Subject: dfbb4e9...7917113, diff digest dbb41541d954d3800d9229a7f5955b57ff3cc4cd082d42e7417c15571d2366ec, 1 call(s). An AI comment is not an approval. |
7917113 to
ad0e734
Compare
AI review (no-findings)Reviewing the four changed files:
The new flow snapshots
The read uses
The increment-before-close pattern is correct. For every
Covers the main new paths: resume with changed config, resume after journal replacement, shutdown-writes-checkpoint, concurrent lock contention, and the drainMs variants. The No concrete defects found. {"head": "ad0e7341d3953c5d968efc3f329340bfb0d12430", "verdict": "no-findings", "findings": []}Subject: e4a1b8d...ad0e734, diff digest 82f1156db86015725ee874a465f6c58a78316921bfcca43cb8de2756de455ad1, 1 call(s). An AI comment is not an approval. |
e4a1b8d to
131d112
Compare
ad0e734 to
576d7b0
Compare
AI review (findings)Review
|
576d7b0 to
3dc49b4
Compare
AI review (no-findings)Reviewing the diff for correctness, security, and consistency against the governance context.
The new logic increments
Reading
The
Conformance output snapshotting The Rust runner now prefixes outputs under No concrete defects found. {"head": "3dc49b430d1040976a8a1db07419d8aa00f4a72f", "verdict": "no-findings", "findings": []}Subject: fc2980b...3dc49b4, diff digest de5c31cc36b91647fa5d94b40d6a3bd98756ab251d3accb8b47fb8f21af1ac10, 1 call(s). An AI comment is not an approval. |
fc2980b to
ebafa69
Compare
3dc49b4 to
affbb99
Compare
AI review (no-findings)Reviewing the diff for spec 067's implementation closure: the
The new logic increments
Reading
Path containment validation (
Each run's output tree and journal are now prefixed
The prefix selection ( Spec lifecycle transition
No concrete defects are supported by the supplied evidence. {"head": "affbb99a71eda71affda704321f78b8b78d749ab", "verdict": "no-findings", "findings": []}Subject: ebafa69...affbb99, diff digest de5c31cc36b91647fa5d94b40d6a3bd98756ab251d3accb8b47fb8f21af1ac10, 1 call(s). An AI comment is not an approval. |
affbb99 to
95f921c
Compare
95f921c to
010e828
Compare
AI review (no-findings)Reviewing the PR which closes spec 067 (node live repeat runs) by adding the native runner, shutdown cancellation of live runs, checkpoint-mismatch detection, and Makefile / scripts/acceptance/verify.py:
Spec lifecycle: No concrete defects found. {"head": "010e8284ad07643deb17ac21ce44fe9d8ad9f9ee", "verdict": "no-findings", "findings": []}Subject: a26ec07...010e828, diff digest b1c2c2b6466152c35d39f1c7e984b9d752e5580e5695d3f2ad23479912b19772, 1 call(s). An AI comment is not an approval. |
010e828 to
a1d4cb1
Compare
AI review (no-findings)Reviewing the diff across the seven primary code paths plus the spec and conformance artifacts.
{"head": "a1d4cb13f7f9bdca0bac7e889d2c6b0da4cca18e", "verdict": "no-findings", "findings": []}Subject: a26ec07...a1d4cb1, diff digest 32f87c2dd9d203d75971096afc616de10411a8f36020e7634f90cd03ea90a982, 1 call(s). An AI comment is not an approval. |
a1d4cb1 to
5512435
Compare
AI review (findings)ReviewThe PR implements and closes spec 067 (Node binding live repeat runs). It adds the native conformance runner, shutdown cancellation of live runs, Finding
} else if dir.ends_with('/') || dir.ends_with(std::path::MAIN_SEPARATOR) {
format!("{dir}{name}") // preserves trailing '\' on Windows
} else {
format!("{dir}/{name}")
}On Windows, } else if dir.ends_with('/') || dir.ends_with(std::path::MAIN_SEPARATOR) {
let dir = dir.trim_end_matches(['/', std::path::MAIN_SEPARATOR]);
format!("{dir}/{name}")No other concrete defects were found. The {"head": "551243546f7785caf2a59ccd15f55159d4877348", "verdict": "findings", "findings": [{"path": "integrations/rustev-node/src/live_fs.rs", "line": 184, "severity": "medium", "category": "correctness", "summary": "The `join` branch for `dir.ends_with(std::path::MAIN_SEPARATOR)` on Windows emits `format!(\"{dir}{name}\")` which preserves the trailing backslash in the label rather than normalizing to `/`, contradicting the stated cross-platform byte-identical output invariant (I-3)."}]}Subject: a26ec07...5512435, diff digest 3bff2ee9307d7f6c73eafc1c748ed4804b721552087a63e2287b536cfd7b87bf, 1 call(s). An AI comment is not an approval. |
…nce and closure (increments 3 and 4) Increment 3: resume with another live configuration is checkpoint-mismatch before the journal is opened; shutdown raises cancellation for running live runs at once, waits up to drainMs, and counts unsettled host backend calls in abandonedPending. The live conformance cases gain the native runner over engine.liveRun and per-run snapshots, so every run's documents, including the interrupted run before a resume, compare byte for byte on rust-api and native. Increment 4: the host-seam cases left (SeamFailure charge, no-spend binding, estimated exposure in full, retry reserves anew, full seam queue, replay bundle with admission), 067 in VERIFIED_SPECS and its own node-live acceptance group, the 001 and 030 extends edges, declared verification, the full implementation record and implementation complete.
5512435 to
d899c03
Compare
AI review (findings)ReviewThe PR implements the closure increment of spec 067, adding the native conformance runner over Code correctness
Spec / governance
- { spec: "030-bedrock-backend", unit: { kind: directory, path: "integrations/rustev-bedrock/" }, nature: additive }The spec text explains the Bedrock live example constructs The Verification sectionThe Conformance expected filesThe per-run snapshot structure ( {"head": "d899c03ed77bc50f136e02b63f18c477e32f3185", "verdict": "findings", "findings": [{"path": "specs/067-node-live-repeat-runs/spec.md", "line": 49, "severity": "medium", "category": "authority", "summary": "The extends edge claiming additive ownership of integrations/rustev-bedrock/ is added retroactively: the directory is not changed in this PR and the spec text locates the actual change in increment 1a (PR #550), meaning spec 067 did not own that unit when it was modified and the coupling gate for #550 could not have validated this claim."}]}Subject: a26ec07...d899c03, diff digest ba3f0eb488b97fb6c2d691c9fb35310a09788558584121718d0a00c22c4d5b99, 1 call(s). An AI comment is not an approval. |
|
Review note: the |
Summary
Spec 067 increments 3 and 4: the last 067 code and the spec's closure in one pull request.
Based on
mainafter #550, #551 and #564; reviewed earlier while stacked on them (no findings at the same diff).Increment 3 (3.6.4, 3.7.2, 3.7.3, 3.8.2)
resume: truewith a checkpoint whoseLiveConfigIddiffers iscode4,checkpoint-mismatch, before the journal is opened (live_run.rs). Completed items are never re-sent, the run spend is read from the journal, a replaced journal is refused by itsjournal_id(043 3.10.2, throughrustev-live).live-interrupted); with it the item is re-sent as<id>/rerun-1under a new reservation, the old one kept as liability.engine.shutdown({ drainMs })raises cancellation for every runningliveRunat once, waits up todrainMs, keeps the existing bounded settle wait, and reportsabandonedPendingfrom every seam's own count (backend seams now count abandoned host calls as source and scorer seams do; a late settlement is discarded and counted, never both). Decisions keep drain-then-cancel.js/run.mjsruns the six live cases overengine.liveRunwith the cases' scripted host backends and anAbortSignal; both runners snapshot every run's documents and journal underrun-<n>/, so the interrupted run oflive.resumeis compared byte for byte, not only its status (I-3). Surfacesrust-apiandnative; expected bytes re-blessed (layout only).test/live.test.mjs): resume over completed and interrupted items,rerunInterrupted, another configuration, a replaced journal, a reached cap, shutdown withdrainMs0 and 10,000 then resume on a new engine, a secondliveRunon a held journal (code3,journal-locked, nothing sent), a fresh journal after deleting the first (this_run, new id,spendBefore0).Increment 4 (closure)
SeamFailurecharge settles its ticket without liability;cost_unit: nonereserves zero and is recordeddeclared_no_spend; anestimatedbound is reserved in full before the host observes the call; a retry reserves anew; a full seam queue sends nothing and spends nothing; a run over a replay bundle with an admission record.VERIFIED_SPECSand alone in a newnode-liveacceptance group (the groups beside 027 and 043 are near the 45-minute limit);extendsedges onMakefileandscripts/acceptance/(001, additive, as 2 Territory states) and onintegrations/rustev-bedrock/(030, whose live example constructs theRunOptionsimpl(067): live runs bind the journal identity: checkpoint digest, journal member, --require-existing-journal, new_journal (increment 1a, run binding) #550 changes); the full implementation record (every 067 PR's paragraph, held for this PR so 067's derived shards did not collide in the queue);implementation: complete.settle, not arelease(3.3.5), because the seam reports observed 0 and 043 3.6.6 settles by charge; totals are identical and changing it needsrustev-runtime, outside 067's territory. Two readings are recorded: a refusal'sstatusis the CLI's (invalid_input,io_error) withjournal: null, and an already-aborted signal rejects with the existingCancelledBeforeAdmission.scripts/acceptance/verify.pychanges, so this needs the review-exception approval (preapproved for 0.6.0).Checks (on the combined tree: main + #550 + #551 + #564 + this)
spec-spine verify 067(passed, 6 commands),cargo test -p rustev-node,-p rustev-conformance,-p rustev-live,-p rustev-cli --test eval_live,-p rustev-surface --all-features, the native addon build,node --test integrations/rustev-node/test/*.test.mjs(all pass except six telemetry tests blocked by the sandbox'slisten EPERM, which pass in CI),node tools/rustev-conformance/js/run.mjs native integrations/rustev-node(all 244 cases, exact bytes),make bindings(pass, including everynode --testfile and the native conformance runner),make semver(pass: 13 crates and both npm packages against 0.5.0),rustev-boundaries, workspace clippy-D warnings, fmt,make gate. No live or paid call (R-1).