Restore the process runtime state the money journeys pin - #24
Closed
Parad0x-Labs wants to merge 2 commits into
Closed
Parad0x-Labs wants to merge 2 commits into
Parad0x-Labs wants to merge 2 commits into
Conversation
added 2 commits
September 22, 2026 02:02
configure_home and the provider_home fixtures pin VOOL_HOME, the runtime-home override, and the db paths, but every test-side restore was partial: configure_runtime_home(None) cleared the session home the root conftest installed, and nothing restored the VOOL_HOME env write. The race children seal their node signer record under the pinned home with their own passphrase, so the next signer reload in the same pytest process resolves into that home and fails with InvalidTag under the suite passphrase. Measured 2026-09-21: shard tests(3) of PR run 35640946053 sent test_identity_lifecycle (2) and tests/legacy/* (2) red this way; the same four-file order fails identically on main 8153a96 (shards merely did not collide them there). money_race_probe gains runtime_state_snapshot/restore_runtime_state (and pinned_runtime composing them) beside configure_home, the mutation owner; the served-daemon journey, shared_home, and both provider_home fixtures restore exactly what they pinned. A guard case directly after the served-daemon journey pins the invariant.
CI run 35665692856: the guard's module-import snapshot blamed a runtime-home override that an UNRELATED earlier test in the shard had cleared and never restored -- correct detection of drift, wrong attribution. The journey now records the exact state it restored in its finally, and the guard asserts the present state equals that give-back: immune to earlier drift, still failing on any leak of the journey itself (verified by removing the restore and watching the guard name the served home). The default-db piece is excluded -- the package's own autouse store fixture repoints it per test by design.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What failed
Shard
tests (3)of CI run 35640946053 (PR #22) failed four cases withcryptography.exceptions.InvalidTagatnetwork/signer.py:302:tests/test_identity_lifecycle.py::test_mesh_message_rejects_revoked_peertests/test_identity_lifecycle.py::test_signed_write_rejects_revoked_peertests/legacy/test_learning.py::test_swarm_learningtests/legacy/test_pow_genesis.py::test_sybil_defenseThese four also fail on main (
8153a96) when the same files run in oneprocess in this order — reproduced locally in both trees:
Main's CI never showed it only because the round-robin shard split (descending
file size) puts
test_money_served_apiin shard 3 andtest_identity_lifecyclein shard 2 — PR #22's new guard file shifted the indices and collided them.
Any future test-file addition can reshuffle shards the same way.
Root cause
money_race_probe.configure_homepins FOUR pieces of process-global state(
VOOL_HOMEenv, runtime-home override, default db override, continuity dboverride), but every test-side restore was partial:
finallyrestored the override + continuitypath — never the
VOOL_HOMEenv write (active_vool_home()reads envfirst, so the drift survives
configure_runtime_home(None));shared_homehad the same two-line partial restore;provider_homefixtures "restored" withconfigure_runtime_home(None),which CLEARS the session home the root conftest installed instead of undoing
their pin.
The race children (
VOOL_KEY_PASSPHRASE="money-race-probe") seal their nodesigner record under the pinned served home; after the journey, the next
signer reload in the same pytest process re-resolves
_KEY_DIRinto that homeand opens the record with the suite passphrase
(
test-suite-only-never-a-real-key) →InvalidTag.Repair (test-infrastructure only; no production semantics touched)
money_race_probe.runtime_state_snapshot()/restore_runtime_state()snapshot and put back exactly the four pinned pieces, beside
configure_home(the mutation owner);pinned_runtime()composes them forcontext-manager callers. The CLI children keep plain
configure_home(the mutation dies with their process).
shared_home, and bothprovider_homefixtures restore exactly what they pinned.test_the_served_daemon_test_leaves_the_process_runtime_home_behind_itruns directly after the served-daemon journey in every shard/ordering (same
module ⇒ same shard ⇒ same order) and pins the invariant against the
module-import snapshot. Verified it fails with the drift message when the
restore is removed, and passes with it.
Validation
stash on the same tree).
tests/effect_budget/package: 174 passed, 1 failed —test_door_command_machine.py::TestZeroBudgetRefusal::test_zero_command_budget_means_zero_subprocess_transport_and_journal_calls,which fails identically on clean main locally and in every CI census (main
35570948370 and PR runs 35637092451/35637818825/35640946053/35642039754) —
pre-existing baseline, untouched here (manual-mode approval genus).
network_identity_defects + maintenance_dht_discovery + mesh_workproof_reward
identity_lifecycle + legacy learning/pow + signer_key_storage +
secret_storage_truth: 42 passed.
ruff check .clean (pinned 0.16.7).Base: main
8153a96. Head:e904c27. Test-only diff (5 files undertests/effect_budget/).