Repository navigation
fix(framework): a context reference in a form its tool cannot resolve - #751
Merged
Merged
Conversation
`AGENTS.md` carried ten `@aidd_docs/…` lines. Codex, Cursor and OpenCode do not resolve that import — it is inert text that loads nothing and reports nothing. `update_memory.js` has written markdown links there since #732; what was missing is anything that notices a file drifting back. Two ways it drifts, both observed today. A machine still holding the released 2.7.0 hook rewrites the block to `@` on every session start, because that older copy declares `at` for `AGENTS.md`. And a stale edit sitting in the index rides into an unrelated commit, which is exactly how the wrong form reached `next`. The check reads `TARGET_FILES` from the hook itself rather than restating it, so the rule and the writer cannot disagree. A table it cannot parse throws: a check that passes because it compared against nothing is worse than no check. Tests first, then the code, then the mutation for each guard — the comparison, the unreadable table, the stop-at-first, and what counts as a reference. All four die, each under the test named for it. Refs #619 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
Merged
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
AGENTS.mdcarried ten@aidd_docs/…lines. Codex, Cursor and OpenCode do not resolve thatimport — it is inert text that loads nothing and reports nothing. This restores the markdown
links and adds the check that notices when a context file drifts back.
🛠️ How it works
Two ways it drifts, both observed today, and one code path covers neither by naming them.
A machine still holding the released
[email protected]hook rewrites the block to@onevery session start, because that older copy declares
atforAGENTS.md— the fix landedin #732 under a
chore, which release-please does not version-bump, so no machine has it.And a stale edit sitting in the index rides into an unrelated commit; that is literally how
the wrong form reached
next, inside #749.scripts/check-context-reference-form.jsreadsTARGET_FILESfromupdate_memory.jsitself rather than restating the table, so the rule andthe writer cannot disagree. A table it cannot parse throws: a check that goes green because
it compared against nothing is worse than no check.
Only lines that are a reference are judged — the block also carries prose, an html comment and
the read-on-demand list. An unpaired marker yields nothing here:
update_memory.jsreportsthat itself, and two voices for one fault help nobody.
Wired into
pre-commitbesidecontext-imports, and answering for the whole repository ratherthan the staged files: the hook rewrites every target at once, so a partial view could call one
file clean while its sibling drifted in the same session.
🧪 How to verify
On
nextbefore this branch, that second command prints the failure it exists for:Tests first, then the code, then the mutation for each guard — the form comparison, the
unreadable table, the stop-at-first, and what counts as a reference. All four die, each under
the test named for it, and M2 and M3 kill exactly one test each.
The root cause is still open. The corrected hook cannot reach anyone:
aidd-contextispinned at 2.7.0, the only commit since that release touched it is a
chore, and release-pleasebumps on
feat/fixalone. Until a legitimate change lands inplugins/aidd-context/, everymachine keeps the old hook and this check is what stops the drift from being committed. I did
not manufacture a version bump to work around it.
🔗 Linked issue
Refs #619
✅ I certify
🤖 Generated with Claude Code
https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp