Skip to content

tests: per-run TempDir scratch directories (#246), and the v0.47.0 lean scope in rivet - #337

Merged
avrabe merged 2 commits into
mainfrom
fix/test-scratch-246
Nov 7, 2026
Merged

avrabe merged 2 commits into
mainfrom
fix/test-scratch-246

Conversation

@avrabe

@avrabe avrabe commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Closes #246.

This PR does two things, in two commits:

  • Each test scratch directory becomes its own tempfile::TempDir.
  • The v0.47.0 scope you chose on 2026-11-07 is recorded in rivet.

1. Test scratch directories (#246)

Before this change, tests across both crates staged files under fixed names in the shared temp directory and wiped that path on entry. That covered deposit, stage, source, advisorywatch, store, docsexport, realm, zephyrmodule and the varve docs tests. When two runs of one test binary overlapped, which happens when two mutation shards share a host, one run deleted the other's staged files. The test then failed, and cargo-mutants could count that failure as a kill the mutant never earned.

  • A new #[cfg(test)] pub(crate) mod testscratch in varve-producer wraps tempfile::TempDir. It provides Scratch::new(tag), Deref<Target = Path> and AsRef<Path>, so each call site keeps its shape.
  • Every test scratch directory in the modules above is now a TempDir. It is unique to the run and removed on drop.
  • The production uses of std::env::temp_dir() are deliberately unchanged: varve-producer main.rs lines 323, 618 and 810, and varve-serve harvest.rs line 137. These are the only temp_dir() calls left in crates/.

Evidence

Concurrent-run check. Two copies of the same test binary started at once, 10 rounds per filter:

Binary Filter Failing rounds
varve-producer deposit 0
varve-producer stage 0
varve-core store 0
varve-core docsexport 0

The before case was not re-run in this session. The collision is described in #246.

2. v0.47.0 scope

You chose the lean v0.47.0 cut on 2026-11-07, recorded as factory-notice 20261107T114914-ac99a4. This commit moves the 12 requirements outside that cut from release v0.47.0 to v0.48.0, using rivet modify --where. Only their release: field changes:

ADVISORYWATCH-003, AGENTDOCS-004, BLOBLICENCE-001, BUILTINDOCS-001, COMPOSEWINDOW-003, DOCSINLAYER-001, EVIDENCE-001, JESSRENODE-001, OWNYAML-001, RENODE-001, TOOLCHAIN-001 and ZMODEXPORT-002.

Three requirements stay in v0.47.0: REQ-AGENTDOCS-005, REQ-SIGNEDSUMS-001 and REQ-VERIFYPAR-001 (clause 1).

The scope change rides here rather than in its own PR, because CI runs are queueing for about 3 hours. The commit touches only artifacts/requirements.yaml.

Local gates, rebased on 44701d7 (#336)

  • cargo fmt --check: OK.
  • clippy with -D warnings: clean.
  • Workspace tests: 1980 passed, 0 failed.
  • tools unittest: OK.
  • rivet validate: exits 0.
  • rivet check verification-evidence, trace-gate (with gates: close the three weak spots of the v0.46.0 potency audit (#333) #336's stricter evidence rule), claim-check, tracepack-check and review-check all exit 0.
  • tools/systest/install-shadow.sh: exits 0.
  • shellcheck 0.11.0, -S warning: clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu

avrabe and others added 2 commits November 7, 2026 18:08
Tests derived scratch paths from fixed names in the shared temp dir and
wiped them on entry, so two concurrent runs of one test binary deleted
each other's staged files, and cargo-mutants counted the collision as a
kill. Every such scratch is now a per-call tempfile::TempDir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
The maintainer chose the lean v0.47.0 scope on 2026-11-07 (factory-notice
20261107T114914-ac99a4). REQ-AGENTDOCS-005, REQ-SIGNEDSUMS-001 and
REQ-VERIFYPAR-001 (clause 1, the cold measurement) stay in v0.47.0 beside
the defects #286, #246 and #234 and the follow-ups #331 and #333. The
other 12 requirements move to v0.48.0:

REQ-ADVISORYWATCH-003, REQ-AGENTDOCS-004, REQ-BLOBLICENCE-001,
REQ-BUILTINDOCS-001, REQ-COMPOSEWINDOW-003, REQ-DOCSINLAYER-001,
REQ-EVIDENCE-001, REQ-JESSRENODE-001, REQ-OWNYAML-001, REQ-RENODE-001,
REQ-TOOLCHAIN-001, REQ-ZMODEXPORT-002.

Only the release field changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
@avrabe
avrabe merged commit 3bf991c into main Nov 7, 2026
47 checks passed
@avrabe
avrabe deleted the fix/test-scratch-246 branch November 7, 2026 19:42
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.

deposit tests wipe a fixed temp path, so two concurrent runs collide — and a mutation shard can record a kill it did not earn

1 participant