Skip to content

fix(project): adopt moved stores by explicit identity - #4701

Merged
ScriptedAlchemy merged 5 commits into
masterfrom
fix/issue-4429-explicit-project-adoption
Nov 3, 2026
Merged

ScriptedAlchemy merged 5 commits into
masterfrom
fix/issue-4429-explicit-project-adoption

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

Moved-project adoption scanned every registered project before honoring an explicit ID. An unrelated unreadable store could block adoption, and uniqueness-based selection could choose a history for a new directory. Some daemon and cached routes could also ignore --adopt-project and return a different registered project.

Changes

  • Resolve only the named project and validate its canonical profile shard, manifest identity, and old/new-root linkage.
  • Make ordinary init fresh; require --adopt-project <id> for adoption and interrupted-remap retries.
  • Remove candidate enumeration, sorting, AdoptUnique, OfferCandidates, and --fresh.
  • Reject bare init --yes with an explicit replacement instruction instead of silently changing its meaning. Help directs discovery to tracedecay projects list.
  • Preserve manifest-first, registry-last remap ordering and retained graph data; verify the authoritative registry result.
  • Enforce the requested identity on cold admission, retained and joined routes, and composition-cache returns.
  • Require canonical-root agreement before treating a same-project alias as a completed adoption. A path alias alone cannot bypass the existing move and manifest checks.

Verification before the alias-replay follow-up

Passed 16 focused tests on the earlier combined worktree:

  • 8 moved-store lifecycle tests: explicit identity, unrelated malformed stores, conflicting roots, unreadable/foreign evidence, retained data, and interrupted-remap recovery.
  • 2 registry tests: a replacement file at the former root permits remapping; an uninspectable former root refuses without registry writes.
  • The production handshake regression covering cold and retained/cached routes plus matching-ID reuse.
  • 2 CLI explicit-adoption tests and all 3 handshake decoding tests.

The application and registry now agree that only a surviving directory at the former root prevents non-Git relocation; metadata errors remain typed refusals.

That local validation used the combined worktree for #4698–#4703 with pinned Rust 1.99.1. Native Cargo compilation includes #4703 and the checked-in scripts/bazel/patches/grafeo-core-read-allocation.patch applied to Cargo's pinned Grafeo checkout, matching MODULE.bazel; dependency revisions and the lockfile are unchanged. Profile fixtures ran on supported tmpfs because that container's overlay filesystem is rejected by existing storage admission. Production project admission remained enabled. Formatting, whitespace checks, and independent source review passed for that earlier tree. Hosted CI still needs to verify each PR branch independently.

Alias-replay follow-up

Commit 3cb3e1a103720e17a4798b19057c3020c9eef9dc fixes an additional source-confirmed shortcut: the real registry may retain the live canonical root while recording another alias for the same project. The adoption path previously returned success solely because the alias matched the requested project ID.

Added named_adoption_requires_canonical_root_agreement_for_existing_alias using the existing registered-database fixture and actual registry writer. It verifies refusal while the original directory survives, unchanged manifest/registration/source after refusal, successful remapping after the actual directory move, and idempotent replay after completion.

The new regression and this commit have not been compiled or executed locally. This repair session has no supplied checkout or Bazel toolchain, and no Cargo commands were run. Hosted validation is pending in https://github.com/ScriptedAlchemy/tracedecay/actions/runs/41572545625; the earlier 16-test result is not a pass claim for this new revision.

Fixes #4429.

@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd6d557

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review November 3, 2026 02:09
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) November 3, 2026 02:22
@ScriptedAlchemy
ScriptedAlchemy merged commit ba90ba5 into master Nov 3, 2026
20 checks passed
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.

simplify(project): replace moved-project candidate guessing with explicit identity-based adoption

1 participant