Skip to content

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

Open
tkman59 wants to merge 2 commits into
feat/511-antigravity-docsfrom
test/511-antigravity-restore
Open

tkman59 wants to merge 2 commits 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: 7094 passed, 1 skipped. CI cli / Smoke green.

⚠️ Heads-up

  • The test passed on first run: it characterises that restore keeps foreign files, it does not drive a fix.
  • The sync --force refusal on an edited hook script or entry, found while writing it, is fixed in feat(cli): merge plugin hooks into antigravity's .agents/hooks.json #958 (force now reaches the hooks guard; reproductions in antigravity-edited-hooks.e2e.test.ts).
  • This PR also carries the review-fix plan and its check report, in aidd_docs/tasks/2026_10/2026_10_14_antigravity-review-fixes/.

🔗 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

@tkman59
tkman59 marked this pull request as ready for review October 7, 2026 20:38
@tkman59
tkman59 requested a review from a team as a code owner October 7, 2026 20:38
@tkman59
tkman59 force-pushed the test/511-antigravity-restore branch from 3050f70 to d5f8c01 Compare October 13, 2026 20:48
@tkman59
tkman59 force-pushed the feat/511-antigravity-docs branch 2 times, most recently from 4bd1de6 to a591727 Compare October 13, 2026 21:22
@tkman59
tkman59 force-pushed the test/511-antigravity-restore branch from d5f8c01 to 0a2f383 Compare October 13, 2026 21:22

@blafourcade blafourcade left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test passes on its first run: it characterises existing behavior and would not catch a rewrite that keeps lint and aidd-context identical. Fine as such, but the refusal it documents (sync --force aborting on an edited hook script) is real; I reproduced it on the stack tip (see my review on #958). Mergeable once that is fixed or tracked in an issue.

tkman59 and others added 2 commits October 14, 2026 22:38
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 <[email protected]>
@tkman59
tkman59 force-pushed the feat/511-antigravity-docs branch from a591727 to bd05700 Compare October 14, 2026 20:52
@tkman59
tkman59 force-pushed the test/511-antigravity-restore branch from 0a2f383 to 5ea8103 Compare October 14, 2026 20:52
@tkman59

tkman59 commented Oct 15, 2026

Copy link
Copy Markdown
Author

The refusal is fixed in #958 (force now reaches the hooks guard; reproductions in antigravity-edited-hooks.e2e.test.ts). This PR's test is unchanged and still green on the replayed stack.

@tkman59
tkman59 requested a review from blafourcade October 15, 2026 05:33
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.

2 participants