Skip to content

fix(027): bound the binding tests' waits by time; record 021's passing candidate - #167

Merged
bartekus merged 1 commit into
mainfrom
impl/027-flake-021-evidence
Oct 22, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/027-flake-021-evidence

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Summary

Small follow-up in lane C (specs 027, 021, 045).

  • Binding test flake (027). integrations/rustev-node/test/negative.test.mjs and the conformance driver (tools/rustev-conformance/js/run.mjs) bounded their waits for an engine-side condition by 100,000 event-loop turns. A loaded CI runner exhausted them in "a host backend resolving after the deadline is discarded and counted" (impl(028): boundary telemetry rule and the contract's redaction policy and trace line #151's bindings / wasm, "waited forever"). Both waits are now bounded by 120 s of wall time, still yielding with setImmediate and never sleeping; no assertion changed.
  • Release candidate evidence (021, 045). make release-candidate passed in full at 419b664 (a reviewed head of impl(031): increment 5, the npm members and the absences in the release set #162), locally on macOS arm64: eleven archives byte-identical across two clean runs, archive policy, unpacked tests on 1.98.1 and MSRV 1.88, cargo deny clean with no exception, SBOMs, changelog, and the release manifest (SHA-256 8b4e92e8dbd42fb91394474bb02fd58a59875c8fe8310f066174d44069b4761a). Recorded in 021 as evidence for that commit only; the release candidate is rerun at the commit the owner names. 045's second acceptance item is met; it stays pending on the upload-order item, which waits for the owner.

Nothing is signed, tagged or published.

Checks

  • node --check on both scripts: OK. make gate: passed. spec-spine couple: OK. check-authored-content.sh: clean.
  • The Node tests run in CI's bindings jobs.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the five changed paths for bugs, security issues, and governance inconsistencies.

integrations/rustev-node/test/negative.test.mjs
Switches the until helper from a loop-count bound (100,000 iterations) to a wall-time bound (120 s). The post-loop final check before throwing is correct — it handles the race where the condition becomes true at the exact moment the deadline expires. UNTIL_MS is declared as a named constant and referenced consistently in both the loop guard and the error message.

tools/rustev-conformance/js/run.mjs
Same wall-time pattern. The numeric literal 120_000 in the while condition and 120000 in the error string are the same value (JavaScript numeric separator); no bug. c.id and what were already in scope in the original error message — the diff only changes the surrounding control flow.

specs/027-node-and-wasm-bindings/spec.md
Follow-up note accurately describes both changed files and confirms no assertion was changed. Consistent with the code diff.

specs/021-packaging-and-first-release/spec.md
Adds a dated candidate-run evidence record at a specific commit, scoped explicitly to that commit, noting nothing was signed/tagged/uploaded. No forward-looking claims that contradict the governance requirement that the release commit is owner-named.

specs/045-command-surface-release-layer/spec.md
Records the second acceptance item as met, cross-references spec 021's record, and correctly notes the upload-order item still belongs to the owner. No issues.

No governance violations: none of the changed paths are under .github/workflows/, scripts/statecraft/, or scripts/check-authored-content.sh, so the statecraft-review-exception Environment approval is not triggered. The test-harness fix is accompanied by a spec follow-up note in spec 027 as expected by the spec-first convention.

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

Subject: 6060167...ea2a634, diff digest d1eeb7c587e131e36daefb131ee1d27bf01c936ee86306e7a79934c6bbe3fc65, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus enabled auto-merge (squash) October 22, 2026 07:22
@bartekus
bartekus disabled auto-merge October 22, 2026 07:32
…g candidate

The rustev-node negative tests and the conformance driver waited for an
engine-side condition for at most 100,000 event-loop turns, which a
loaded CI runner exhausted (#151's bindings / wasm, the late-resolution
test). Both waits are now bounded by 120 s of wall time, still yielding
with setImmediate; no assertion changes.

Spec 021: make release-candidate passed in full at 419b664 (archives
byte-identical, archive policy, unpacked tests on 1.98.1 and 1.88, audit,
SBOMs, release manifest 8b4e92e8...). Spec 045: its second acceptance
item is met; only the upload order remains for the owner.
@bartekus
bartekus force-pushed the impl/027-flake-021-evidence branch from ea2a634 to 1dc4815 Compare October 22, 2026 07:58
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the five changed paths for bugs, security issues, and inconsistencies.

Code changes (negative.test.mjs, run.mjs)

Both files replace a 100,000-iteration event-loop spin with a wall-time while loop bounded at 120 s (120,000 ms). The logic is sound:

  • Each loop body checks the condition first, then yields via setImmediate, so CPU is never held.
  • After the while exits due to timeout, a final if (cond()) return correctly handles the window between the last successful setImmediate resolution and the Date.now() check that terminated the loop. Without this extra check the original race would remain; with it, the change is strictly more robust than the iteration-count version.
  • The UNTIL_MS named constant in negative.test.mjs and the inline 120_000 in run.mjs are a minor style inconsistency (magic number vs. named constant) but not a defect.

Spec changes (021, 027, 045)

  • spec 027 follow-up entry correctly describes both changed files and the nature of the fix; consistent with the diff.
  • spec 021 candidate-run record is a documentation-only entry; the SHA-256 value (8b4e92e8dbd42fb91394474bb02fd58a59875c8fe8310f066174d44069b4761a) is 64 hex characters, the correct length for SHA-256.
  • spec 045 progress note references spec 021's record and makes no new normative claim.

No concrete defects found.

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

Subject: 21a00fc...1dc4815, diff digest d1eeb7c587e131e36daefb131ee1d27bf01c936ee86306e7a79934c6bbe3fc65, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus enabled auto-merge (squash) October 22, 2026 08:05
@bartekus
bartekus merged commit 63334d6 into main Oct 22, 2026
26 checks passed
@bartekus
bartekus deleted the impl/027-flake-021-evidence branch October 22, 2026 08:32
bartekus added a commit that referenced this pull request Oct 22, 2026
Spec 029 increment 3: repeat sets and `rustev.repeat-report/1` (3.1,
3.2.5, 3.5, 3.6). Library only; no CLI, ledger, baseline or gate yet; no
live run, provider call or spend. `implementation` stays `in-progress`.

- `rustev-eval/src/repeat.rs` (new): `repeat(RepeatInputs)` over N
reconciled runs. Refuses the `live` source (`live-source-unavailable`),
  N outside 1 to 64, unreconciled case measures (`reconcile`), runs that
  differ in dataset, split, evaluator configuration, plan or metric list
  or do not list the split's cases in manifest order (`mixed-runs`), a
  `replay` set whose runs are not identical (`not-reproducible`), an
  unreported stability metric or override, and a cohort over the
  bootstrap bound (`bootstrap-too-large`). The report names the source,
  configurations, dataset, split and fixed role (3.7.1), provenance,
  adapter rules, plan, each run's document digests and run seed, the
  stable cohort, and per cohort (`all`, then each slice) every metric's
per-run values, `mean`, `sd`, `min`, `max`, `pooled`, interval and band
  with its basis. Slices below their minimum are unknown throughout; a
metric without a per-case measure (cost totals, `brier`) has across-run
  statistics in `all` only. Latency, queue and cost metrics state their
observation (`historical` for candidate runs, 3.11.2). A held-out report
  records `held_out` as unknown until increment 4 adds the ledger.
- `rustev-eval/src/report.rs`, `eval_cases.rs`: `cost_per_1000/observed`
  and `/estimated` case measures (3.2.5), unknown unless cost units are
  declared comparable, the observed series unknown for a case with
  liability or an unknown charge; none for a candidate.
- `rustev-eval/src/repeat_stats.rs`: `across_runs`, factored out of
  `run_stats` unchanged, for metrics stated only by the run reports.
- Tests (`tests/reports.rs`): replay set (zero `deterministic_replay`
  band, pooled equal to the report, distinct run seeds, stable cohort,
  totals and `brier`, observations, unknown `cost_per_1000`, a reported
  slice and one below its minimum, round trip and byte determinism);
  captured set with a case losing its bundle (stable cohort, positive
  `k_sd` band); one captured run (unknown band); differing replays, the
  live source and N of 0 and 65 refused; mixed baseline and candidate
runs, unreconciled measures and an unreported stability metric refused;
  a candidate set with historical observations and `interval_width`
  bands.
- `tools/rustev-release/archive-policy.json`: `src/repeat.rs`.
- Spec 029: increment 3 record and engineering choices.

Still open from increment 2: owner decision D-029-1 (Brier per-case
measures), recorded in spec 029's implementation record.

Local verification (macOS arm64): `make gate` passes with spec-spine
0.31.0; `cargo clippy -p rustev-eval --all-targets -- -D warnings`,
`cargo test -p rustev-eval` and `cargo test -p rustev-fp-corpus` pass.

Review round 1 (1 finding, not a defect, evidence added): the finding
says
a candidate's cases get a known `cost_per_1000/observed` when costs are
comparable and known. The cost measures sit inside `case_measures_of`'s
`if inputs.candidate.is_none()` block (opened above the latency loop,
outside the reviewed hunk), so a candidate's cases carry none. A comment
now says so in the hunk, and a new test,
`cost_per_1000_is_measured_for_a_baseline_and_never_for_a_candidate`,
declares cost units comparable and checks that the baseline's cases
carry
cost per 1000 while the candidate's carry none and its repeat report's
`cost_per_1000/observed` is historical and unknown.

Review round 2: no findings. Rebased onto `main` after #159 (no
conflict).
`make code` passes locally on this head, except two failures caused by
other worktrees sharing the build target (a test binary removed by a
concurrent `cargo clean`, and `rustev-jev`'s `lodging_swap` finding its
output directory already created by a concurrent run); each passes when
rerun alone.

Review round 3 (1 finding, fixed by making the rule explicit): the
finding
says `cost_unknown_attempts` should carry no observation. It is one of
the
four cost series a spec 004 candidate report replaces with "the
candidate
was not executed; latency and cost are the baseline's", so it is an
observation of the runs and historical for a candidate, as 3.12.4 needs.
`observation` now lists latency, queue, the four cost series and
`cost_per_1000/*` by name instead of a `cost_` prefix, with that reason
in
its comment; the candidate test checks the cost series are historical
and
a quality metric has no observation.

Local on this head: `make gate` passes; `cargo test --workspace
--no-fail-fast` passes except `rustev-release --test manifests`, which
reports a `rustev-aicortex` member that exists only in another lane's
worktree sharing the build target, and passes when run alone; clippy,
fmt and boundaries pass.
Rebased onto `main` after #157 (no conflict); `rustev-eval` and
`rustev-release` tests (including `manifests`, now that
`rustev-aicortex` is on `main`) and `rustev-eval` clippy pass on the
rebased head.
Review round 4: no findings. Rebased onto `main` after #162 (no
conflict).
Review round 5: no findings. Rebased onto `main` after #160 (no
conflict); `make code` and `make gate` pass locally on this head.
Review round 6: no findings. Its `code` run failed in
`rustev-remote-http --test runtime_batch`

(`a_deadline_or_a_cancellation_after_send_ends_every_member_as_independent_calls_do`),
a timing test in a crate this PR does not touch. Rebased onto `main`
after
#167, which changes no Rust source, so the previous head's local `make
code`
still covers the Rust tree; `make gate` passes.
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