Skip to content

test(mcp): store template seeding always fails and falls back to full init #2215

Description

@ScriptedAlchemy

Symptom

crates/tracedecay/tests/mcp_suite/fixture.rs::seed_store rewrites config.json in the seeded project data dir, but project stores no longer contain config.json (configuration lives in the store databases; the only remaining config.json references are the retired checkout layout list and a test that writes it as a stale input). rewrite_json therefore returns NotFound after the whole template tree has already been copied into place, init_project_from_template* swallows the error (seed_store(..).is_ok()), and every caller falls back to TraceDecay::init on top of the partially seeded directory.

So the template never saves the init cost it exists for, and a stale template still breaks init: the copied store stays in place, which is how #2213 surfaced as ResetRequired instead of a clean rebuild.

Evidence

Calling seed_store directly on a freshly built template (while writing the test for #2213) on origin/master f1576d0:

thread 'fixture::template_recorded_at_an_older_git_correlation_version_is_rebuilt' panicked at crates/tracedecay/tests/mcp_suite/fixture.rs:562:66:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Expected

Seeding either rewrites only files the current store layout has and opens the seeded store, or the template is deleted if it no longer saves anything. A failed seed must not leave a partial store for the fallback init to trip over.

Found while fixing #2213; not changed there (that fix only keys the template on the schema versions).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions