Repository navigation
Conversation
683c750 to
710ca6b
Compare
6b213e8 to
5c423e9
Compare
710ca6b to
f7fe515
Compare
5c423e9 to
058b4ef
Compare
f7fe515 to
90beffc
Compare
blafourcade
left a comment
There was a problem hiding this comment.
Reviewed line by line and exercised on the stack tip (agy 1.3.5).
Major: sync --force and clean --force abort on any edit of an AIDD hook
Reproduced on a fresh aidd setup --ai antigravity --plugins recommended:
- edit
.agents/hooks/aidd-context/update_memory.js, thensync --force:hook script ... was edited after install; detach refused,Sync failed for: config-restore, nothing restored (a drifted skill stays drifted); - edit the AIDD entry in
.agents/hooks.json, thensync --force: same refusal; - same edits, then
clean --force: refusal, all 435 files remain.
Cursor refuses clean the same way, but its sync is not affected: its install tracks only 4 files, so restore never re-applies it. Here sync re-applies the plugin on any drift (ApplyPluginFilesUseCase -> assertProjectHooksUnchanged). #962 documents this without fixing it. Please fix it here or link an issue before merge.
Question
.agents/hooks/aidd-context/update_memory.jsis recorded twice in.aidd/manifest.json(pluginfilesandprojectHooks.scripts). Intended?
Minor
translate --as flatwith an unparsable.agents/hooks.jsonfails with a rawExpected property name or '}' in JSON..., without the file name. The "left untouched" message only exists on thesetuppath.aidd-telemetryinstalls onlysession-start;StopandPostToolUseare skipped with a warning. Is a partial journal acceptable?antigravity-hooks.ts: the comment pinsagy 1.2.17; it will go stale.
Checked and fine
- Cursor's behavior is unchanged (same functions, same assertions). A user key such as
lintsurvives merge, sync and clean. A second setup is a no-op.cd .. &&makes the hook work from.agents(smoke on 1.3.5 refreshesAGENTS.md).
Antigravity now receives the aidd-context memory hook. Setup and plugin
install merge each plugin's hooks into .agents/hooks.json under one key
named after the plugin, copy its scripts under .agents/hooks/<plugin>/,
and clean removes that key alone, deleting the file only when empty.
The project-hooks route Cursor used is generalised: a tool declares a
ProjectHooksFormat beside hooksDestination "project", now allowed in flat
mode too, and the installer and uninstaller read only that. Cursor's
behaviour is unchanged. An unparsable project hooks file now stops the
install with the file named.
agy 1.2.17 rejects Claude's nested { hooks: [...] } groups and runs a
workspace hook from <repo>/.agents through a shell, so each command is
prefixed with "cd .. && "; events other than SessionStart are skipped
with a warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
058b4ef to
7a4f6bc
Compare
90beffc to
b864c7f
Compare
|
Thanks, all addressed in the hooks commit (stack replayed).
|
|
Thanks for the fixes. I reproduced two remaining issues on the stack tip (#962):
Please make local-plugin restoration rematerialize the project hooks, and persist hook provenance changes even when no ordinary plugin files were rewritten. |
🎯 What & why
aidd setup --ai antigravitynow installs the AIDD memory hook:agyrefreshes the project memory at session start. Phase 3 of #511, stacked on #957.🛠️ How it works
aidd-contextplugin, not throughHooksCapability. Codex'sHooksCapabilityis never fed: nocodex-hooksconfig ref exists, so copying it would have written nothing. Antigravity uses the project-hooks route Cursor already had, with idempotent merge, per-entry provenance and safe clean.ProjectHooksFormatbesidehooksDestination: "project", which flat mode may now declare too.project-hooks-materializer.tsandremove-project-hooks.tsread only that format, with no Cursor import left. Cursor's suites pass with no assertion changed.antigravity-hooks.ts):SessionStart;.agents/hooks/<plugin>/;cd .. &&;translate --to antigravity --as flatuses the same merge function;hooksMergenow receives the plugin name.agy1.2.17, with an interactive session under a pty (script -q /dev/null agy -i … --add-dir <ws>). In print mode the model is never called, so no hook fires.[{ "hooks": [...] }]is rejected:invalid hook "aidd-probe": command hook must specify 'command'.<repo>/.agents, through a shell. A probe hook logged"cwd":".../agy-cwd-probe/.agents"with"workspacePaths":[".../agy-cwd-probe"]. Withcd .. &&, the marker readAIDD-MEMORY-MARKER cwd=<repo> docs=true.--forcereaches the edit guard.sync --forceandclean --forcepassforcedown to the project-hooks guard (RestoreUseCase→RestoreAllPluginsUseCase→ApplyPluginFilesUseCase→ translator →ProjectHooksMaterializer;CleanUseCase→ preflight and removal). Under--forceonly the "edited after install" refusals are lifted: an unproven script path or install digest still refuses. Without--forcethe refusal says how to proceed.plugin add,updateandremovenever pass it, so they still refuse. Cursor gets the same behaviour, since it shares the guard.projectHooks.scriptsonly, no longer also inplugins[].files..agents/hooks.jsonnow stops the install with the file named (.agents/hooks.json is not valid JSON (…); left untouched.), for Cursor too.translate --to antigravity --as flatreports the same message.🧪 How to verify
cd cli && pnpm test: 7082 passed, 1 skipped. CIcli / Smokegreen.tests/e2e/antigravity-edited-hooks.e2e.test.ts: an edited hook script, an edited AIDD entry in.agents/hooks.json, thensync --forceorclean --force. Red before the fix (... was edited after install; detach refused), green after, with the userlintkey kept.aidd_docs/memory/andAGENTS.mdcarrying the memory markers):aidd setup --source local --path <framework> --ai antigravity --plugins recommended --yeswrites.agents/hooks.jsonwith theaidd-contextkey and.agents/hooks/aidd-context/update_memory.js.lint, then run setup again:.agents/hooks.jsonis byte-identical.script -q /dev/null agy -i "reply OK" --add-dir <repo>logsloaded 2 named hooks from 1 hooks.json file(s), andAGENTS.mdat the repo root gains the memory list.aidd clean --forceleaves.agents/hooks.jsonholding onlylint, and removes.agents/hooks/.antigravity:flatcell moved (.agents/hooks.jsonand the copied script).HooksCapabilityandmergeCodexHooksJsonare dead code.🔗 Linked issue
Refs #511
✅ I certify
🤖 Generated with Claude Code