Skip to content

impl(043): resumed probes take fresh decision ids - #440

Merged
bartekus merged 1 commit into
mainfrom
impl/043-probe-ids
Nov 2, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/043-probe-ids

Conversation

@bartekus

@bartekus bartekus commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Spec 043 follow-up: a resumed run's probe calls take fresh decision ids, so the journal never holds a repeat reservation of a probe attempt id.

  • crates/rustev-live/src/probe.rs: on --resume, probe decisions are live/<run_id>/.probe/resume-<n>/<binding>/<call>, with n one more than the largest resume-<n> reserved under the run's probe prefix (0 if none). The sequence is read once before dispatch from every reservation, including released and crash-liability ones, so a probe interrupted during a resume is found and the next resume takes n + 1.
  • crates/rustev-live/src/journal.rs: SpendJournal::attempts_with_prefix (crate-private), a typed query over the in-memory reservations; the journal file is never re-read.
  • The first run's probe ids and the probe/ file names of 3.13.3 are unchanged. No normative change: probe decision ids are fixed only in increment 4's record.

Spec: a dated paragraph in 043's implementation record.

Verification

  • cargo test -p rustev-live --locked (new: resumed_completed_probe_reserves_fresh_ids, crash_mid_resumed_probe_advances_reserved_sequence), cargo test -p rustev-live-crash --locked, clippy -D warnings on rustev-live with and without fault-injection, cargo fmt --all --check, make gate, scripts/check-authored-content.sh.

A resumed run's probe decisions are live/<run_id>/.probe/resume-<n>/...,
so the journal never holds a repeat reservation of a probe attempt id.
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the five changed files for bugs, security issues, and spec/implementation inconsistencies.

crates/rustev-live/src/journal.rs — attempts_with_prefix

The method collects all attempt keys with the given prefix. The docstring claims "reservation sequence order" but .values() on whatever map backs .res gives either BTreeMap-sorted or HashMap-unordered output, not insertion order. However, the sole caller (decision_prefix) uses .max() on the extracted integers, so ordering is irrelevant to correctness. Minor doc inaccuracy only.

crates/rustev-live/src/probe.rs — decision_prefix

Non-resume path returns the original live/<run_id>/.probe/ prefix unchanged, preserving the old decision-id format. Resume path:

  1. Strips the probe prefix, then resume-, then splits on / to extract the sequence integer as u64 — correctly skips non-resume attempts because strip_prefix("resume-") returns None for <digit>/... tails.
  2. Takes .max() with .unwrap_or(0) so first resume gets sequence 1. ✓
  3. checked_add(1) guards overflow. ✓
  4. Attempts from other runs (live/other/...) don't share the prefix and are excluded. ✓
  5. Dataset-path attempts (live/run/a/...) don't match .probe/ and are excluded. ✓

The new decision_id format {decision_prefix}{index+1}/{call} expands identically to the old format when resume=false and to live/<run_id>/.probe/resume-<n>/<index+1>/<call> when resume=true. Both match the spec addition.

crates/rustev-live/src/run.rs

Passes self.opts.resume into probe_recorded straightforwardly. No issue.

crates/rustev-live/tests/run.rs

  • resumed_completed_probe_reserves_fresh_ids: iterates three times over the same journal directory; each adds 3 reservations (matching the config), and the assertion on unique_reservations (3 → 6 → 9) is consistent.
  • crash_mid_resumed_probe_advances_reserved_sequence: verifies both numeric sort-safety (previous=10 must beat previous=9) and that released reservations count. The previous+1 next-sequence assertion follows from the max()+1 logic. Unique-reservation counts and the liability assertion (35) are consistent with the crash setup.

specs/043-live-re-execution-at-scale/spec.md

The prose description matches the implementation exactly: n is the max existing resume-<n> under the run's probe prefix across all reservation types, defaulting to 0 so first resume is resume-1. Test names cited match those added in the diff.

No concrete defects found.

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

Subject: cf797a0...4f7fb55, diff digest 10d3bd9f33aedd5f02ca6ffd0a44a49e8110c3f5e45b16f854ae870a014d4b92, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 9d4356b Nov 2, 2026
30 checks passed
@bartekus
bartekus deleted the impl/043-probe-ids branch November 2, 2026 15:34
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