Skip to content

fix(aidd-context): keep memory README links relative on Windows - #987

Merged
blafourcade merged 2 commits into
ai-driven-dev:nextfrom
VincentMenard76:fix/memory-readme-links-windows
Oct 12, 2026
Merged

blafourcade merged 2 commits into
ai-driven-dev:nextfrom
VincentMenard76:fix/memory-readme-links-windows

Conversation

@VincentMenard76

@VincentMenard76 VincentMenard76 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🎯 What & why

On Windows, the memory hook rewrote the table of contents of aidd_docs/memory/README.md with links still prefixed aidd_docs/memory/, so every link in that file pointed nowhere and the hook staged the broken README into the next commit.

🛠️ How it works

memoryRelative strips the memory directory from a path it first normalises to /, but built that prefix with path.join, which answers aidd_docs\memory on win32. The prefix never matched, so nothing was stripped. Both sides of the comparison are now normalised to /. On posix the prefix holds no backslash, so behaviour there is unchanged. memoryRelative only feeds the README table of contents; the CLAUDE.md / AGENTS.md blocks go through other helpers and are untouched.

The regression test runs the real hook as a subprocess and reads the README it writes. A second commit keeps the whole file's subprocesses from inheriting CLAUDE_PROJECT_DIR: run from inside a Claude Code session, the hook would otherwise move into the real project and rewrite its CLAUDE.md and README.

🧪 How to verify

  • node scripts/check-tests-leave-git-alone.js -- node --test scripts/__tests__/update-memory.test.js: 16/16. On Windows, the new test fails without the fix on - [aidd_docs/memory/architecture.md](aidd_docs/memory/architecture.md).

⚠️ Heads-up

  • Committed with lefthook disabled: its Windows hooks are broken (fix(lefthook): Windows/Git Bash pre-commit hooks fail with node syntax error #948). commitlint and the relevant pre-commit checks were run by hand; validate.yml replays the pre-commit on this PR.
  • cli-ci.yml's changes filter does not match plugins/aidd-context/**, so a later change to update_memory.js alone would skip the Windows job that runs this test. Left out of scope.

🔗 Linked issue

Closes #986

✅ 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

VincentMenard76 and others added 2 commits October 9, 2026 21:57
memoryRelative stripped a prefix joined with the platform separator from a
path normalised to "/", so on win32 it matched nothing and every README link
kept its aidd_docs/memory/ prefix and pointed nowhere.

Closes ai-driven-dev#986

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run from inside a Claude Code session, the suite inherited CLAUDE_PROJECT_DIR
and the hook would have rewritten that project's CLAUDE.md and memory README.

Refs ai-driven-dev#986

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@VincentMenard76
VincentMenard76 marked this pull request as ready for review October 9, 2026 20:34
@VincentMenard76
VincentMenard76 requested a review from a team as a code owner October 9, 2026 20:35
@blafourcade
blafourcade merged commit 4205484 into ai-driven-dev:next Oct 12, 2026
25 checks passed
@aidd-bot aidd-bot Bot mentioned this pull request Oct 16, 2026
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