Skip to content

test(cli): prove sync restores only what antigravity setup wrote - #962

Draft
tkman59 wants to merge 1 commit into
feat/511-antigravity-docsfrom
test/511-antigravity-restore
Draft

tkman59 wants to merge 1 commit into
feat/511-antigravity-docsfrom
test/511-antigravity-restore

Conversation

@tkman59

@tkman59 tkman59 commented Oct 5, 2026

Copy link
Copy Markdown

🎯 What & why

Proves the last open criterion of #511: restore (aidd sync) touches only what Antigravity setup wrote. Stacked on #961.

🛠️ How it works

  • antigravity-foreign-files.e2e.test.ts gains a sync --force case: setup aidd-context, add a user named hook lint to .agents/hooks.json and a user skill, drift an AIDD skill, sync.
    • The AIDD skill is restored byte for byte.
    • The user skill is untouched.
    • .agents/hooks.json keeps lint and aidd-context with the same content. The test compares parsed JSON, not bytes: restore unmerges then remerges its own key, so aidd-context moves after lint.
  • The existing clean case moves into the same file, renamed clean-antigravity-foreign-file → antigravity-foreign-files to cover both.

🧪 How to verify

  • cd cli && npx vitest run --project e2e tests/e2e/antigravity-foreign-files.e2e.test.ts: 2 passed.
  • Mutation: making withoutPlugin in antigravity-hooks.ts return {} fails the sync case on the missing lint key; the clean case still passes.
  • pnpm test: 6845 passed, 1 skipped. pnpm smoke: 144 passed, 0 failed, 1 skipped.

⚠️ Heads-up

The test passed on first run: it characterises existing behaviour, it does not drive a fix. Found while writing it, not fixed here (shared project-hooks route, not Antigravity-specific code):

  • A drifted hook script, or an edited AIDD entry in .agents/hooks.json, makes sync --force refuse (hook script '.agents/hooks/aidd-context/update_memory.js' was edited after install; detach refused) and exit 1 having restored nothing, including unrelated drifted skills.
  • Cursor does not detect the same script drift at all: Nothing to restore — all files are unmodified.

🔗 Linked issue

Closes #511

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

sync --force restores a drifted AIDD skill and leaves a user skill and a
user named hook in .agents/hooks.json as they were. The clean case moves
into the same file, renamed for both.

Refs #511

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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