Skip to content

training_producer test owns its home (fixes the staged_credit flake, card d4909786) - #5246

Merged
joelteply merged 1 commit into
canaryfrom
fable/staged-credit-test-owns-its-home
Oct 21, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/staged-credit-test-owns-its-home

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The one data-writing test in training_producer without HomeGuard raced the home-mutating fixtures. Its ensure-schema and batch resolved @persona:kimi under two different $HOME values, which gave 'no such table: staged_credit' (#5239 at 815bdba, #5244 at 3676ae9; canary green). It also wrote into the real ~/.continuum/personas/kimi. Now it pins a tempdir home under HomeGuard::set, like its siblings. A scan found no other unguarded data test in the module. CI compiles it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…iblings

Card d4909786. the_lived_copy_is_shed_by_the_substrate_not_by_her_identity was
the only data-writing test in training_producer without HomeGuard. Her store
resolves through the process home (`@persona:kimi` -> $HOME/.continuum/
personas/kimi/data/longterm.db). A parallel test that pinned and restored
HOME could move it between this test's ensure-schema and its batch, so the two
calls hit different databases: "Delete failed: no such table: staged_credit".
Seen on #5239 at 815bdba and on #5244 at 3676ae9, while canary passed. It
also wrote into the real ~/.continuum/personas/kimi on every machine that ran
it.

The fix: a tempdir home under HomeGuard::set, held for the whole test. This
is the same pattern its siblings in part_2..part_6 already use. A scan of
every tokio::test in training_producer/tests that touches data found no other
test without the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Source APPROVE at 2746bbc. The data-writing fixture now acquires the existing crate-wide HomeGuard before creating its runtime or staging credit. The guard pins all four home variables across awaits and drops before the temporary directory, preserving the original authorization and lived-copy assertions. No production behavior changes. Reviewed HomeGuard implementation and fixture scope; no local compilation. Exact-head CI remains required. This addresses the missing fixture isolation behind the staged_credit failure observed on #5244; passing compilation alone would not establish the full-suite result.

@joelteply
joelteply merged commit 4337184 into canary Oct 21, 2026
9 checks passed
@joelteply
joelteply deleted the fable/staged-credit-test-owns-its-home branch October 21, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant