Skip to content

fix(adopt): match byte-for-byte hand copies during adoption - #22

Open
iagodahlem wants to merge 1 commit into
mainfrom
iago/fix-adopt-byte-match
Open

fix(adopt): match byte-for-byte hand copies during adoption#22
iagodahlem wants to merge 1 commit into
mainfrom
iago/fix-adopt-byte-match

Conversation

@iagodahlem

Copy link
Copy Markdown
Owner

Summary

Symmetric metadata skip: the working-copy side of the byte-match comparison now passes the same skipRootMeta option as the registry side, so a workspace whose skill tree still carries module.json/CHANGELOG.md (the natural result of copying a registry module by hand) is compared on its actual content instead of failing on a file-count mismatch first.

Regression test: added a case that hand-copies a registry module verbatim, metadata files included, and asserts the workspace lands in adopted, not differing; confirmed the test fails against the old code and passes against the fix.

Test plan

  • pnpm typecheck && pnpm lint && pnpm test all green (277/277 tests passing)
  • New test adopts a hand-copied working tree that still carries registry metadata files reproduces the bug against the old code and passes against the fix
  • Existing adopt suite (20 tests in tests/integration/init-adopt.test.ts) still passes unchanged

collectDirFiles was called with skipRootMeta on the registry side but
not on the working-copy side, so a workspace whose skills/<name>/ tree
still carried module.json or CHANGELOG.md (the natural result of
copying a registry module by hand) failed the equality check before
its actual content was ever compared, landing in "differing" instead
of "adopted".
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.

1 participant