Repository navigation
fix(aidd-telemetry): keep a worktree's sessions in every report, even after the worktree is removed - #988
Open
VincentMenard76 wants to merge 18 commits into
Conversation
…on git directory The hook wrote each session's journal at the root of the checkout it ran in, so a session run in a linked worktree was missing from every report outside it and lost for good on git worktree remove. Runs now land in <git common dir>/aidd/runs/, shared by every worktree and outside every working tree. AIDD_RUNS_DIR still replaces the location. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader resolves the common git directory from files, as the hook's git rev-parse does, and still reads the pre-move aidd_docs/runs of every live checkout so earlier sessions stay counted; the new copy wins for one session. forget previews and removes those earlier journals too, and check names the real directory. The bundle budget moves with its registry entry. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the decision record, points the journal contract, the plugin README and its init skill at the new location, and keeps the task's brainstorm, plan and review beside it. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…matted A runner's tmpdir can be an 8.3 alias of the directory git records, so the path tests now start from the canonical temp root. One e2e expression is reformatted to satisfy the formatter. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the probes The identifier-join probe and the real-tools smoke both looked under aidd_docs/runs, so they reported a journal as missing once the hook moved it under the common git directory. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An older CLI never reads the new journal location, so a newer plugin alone would drop new sessions from its reports and from forget. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
telemetry on still said deleting the aidd_docs/runs/ line would commit the journal; new journals live under the clone's git directory, so the line now only keeps an earlier version's journals out of a commit. The reader also drops a filter that could never remove a directory. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the sink empty and the worktree removed, a report from the main checkout reads the session from Claude Code's own transcript and attributes it to its task, through the journal the real hook wrote. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sion once check counted run files from the earlier aidd_docs/runs too but named only the new directory, and listForeignSchemas reported one session twice when it had a file in both places. The label now names every directory read, and foreign schemas go through the same one-file-per-session walk as list. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd verify The architecture table still called the journal git-ignored, and the verify step used a bash-only glob and ignored AIDD_RUNS_DIR. The worktree e2e also names what its removal case asserts. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The schema test now proves the common-dir copy is the one judged, and the removal e2e proves the pre-move session's cost is still reported, unattributed, rather than passing when its row vanished. The plugin README paragraph is rewrapped. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…get per directory legacyRunsDirs compared paths as spelled, so a worktree opened through a junction or symlink appeared twice and forget previewed and counted its files twice. It now compares real paths. forget also reports each earlier journal on its own line, as the preview does, and names the directory of a file it could not remove. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…emove A failure in the project's own journal still showed only a file name; it now carries its directory like an earlier journal's does. The store port documents listRunFilesIn, and the decision record names the separate-git-dir and submodule limit. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on failure Two reader tests removed their extra directory only on success; it now goes in the shared teardown. The port states listForeignSchemas reports one entry per session. The plan records why telemetry on changed, and the review is refreshed with the final verdict and its evidence. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts evidence The previous commit announced this refresh but the file write had failed; the review now records the seven rounds, the mutation evidence and the accepted limits. Refs ai-driven-dev#932 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VincentMenard76
marked this pull request as ready for review
October 10, 2026 03:37
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
A session run in a linked worktree was missing from every report outside that worktree, and lost for good on
git worktree remove: the journal lived at the worktree's own root, git-ignored, and the CLI only read the checkout it ran in. Agent runners give every agent its own worktree, so this was the common case.🛠️ How it works
<git common dir>/aidd/runs/(repo.cjsrunsDir). Outside every working tree: never committed, no branch dirtied, untouched bygit worktree remove, and a bare clone has one too.AIDD_RUNS_DIRstill replaces it. Decision and refused alternatives: one-run-journal-per-clone.md.git rev-parseand the CLI's file walk side by side over a plain checkout, a subdirectory, a linked worktree and a bare clone's worktree.aidd_docs/runsof every live checkout of the clone, never writes there, and prefers the new copy when one session has both.forgetpreviews and removes those directories too;checknames the real directory instead of a hardcodedaidd_docs/runs.worktree_idstays in the journal. fix(aidd-telemetry): a session run in a git worktree is missing from every report outside that worktree, and lost when the worktree is removed #932 was amended to say so.🧪 How to verify
node scripts/check-tests-leave-git-alone.js -- node --test 'scripts/__tests__/**/*.test.js'andcd cli && pnpm test.telemetry-worktree-journal.e2e.test.tsis fix(aidd-telemetry): a session run in a git worktree is missing from every report outside that worktree, and lost when the worktree is removed #932's QA through the built binary on real worktrees, before and after removal.main/.git/aidd/runs/, attributed to its task from the main checkout and from the worktree, and still aftergit worktree removewithout--force.aidd-telemetryplugin, the reader in@ai-driven-dev/cli, released apart. A newer CLI reads both locations; an older CLI with a newer plugin sees no new session. The plugin README now says to updateaiddfirst, and the decision record lists it. If maintainers prefer a transition period where the hook also writes the old location, that is a follow-up.nextwas already at 733.98 KB, this change measures 737.25 KB.nonefor a task folder that exists only on another worktree's unmerged branch.validate.ymlreplays them here.🔗 Linked issue
Closes #932
✅ I certify
🤖 Generated with Claude Code