Repository navigation
fix(git-exclude): classify internal Claude instruction files - #1318
Conversation
- Include resolved claude-internal and tclaude instruction targets in the shared-file judgement used by the delivered Git exclude block. - Exclude a file only when complete TeamAI-managed blocks occupy all of its content; keep authored text, malformed/duplicate markers and tracked files visible using the existing tracking and delivery safeguards. - Reuse the instruction block editor to judge ownership without changing the instructions or introducing blanket directory exclusions. - Verify 269 focused unit tests and 10 real-CLI self-mode scenarios, including both internal editions, repeated pulls, member-text visibility and tracked instruction files; build and static checks also pass. Refs Tencent#1221.
|
No findings in the scoped diff. The PR description includes sufficient real-CLI verification: a build followed by 10 passing E2E tests, including both internal Claude editions. This satisfies the testing requirement. Review was read-only; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Thanks, approving. This closes the #1221 item "Self scope leaves .claude-internal/CLAUDE.md and .tclaude/CLAUDE.md neither committed nor excluded".
We ran init --self and teamai pull with the built CLI in a self-mode fixture, on this head and on the base 2401d047. On the base, a .claude-internal/CLAUDE.md that holds only teamai's blocks shows as ??. Here .git/info/exclude covers it, and only the member's own notes.md is untracked. Once the member adds their own text, the file shows again, with the new notice. The off and remove settings behave as on the base. The new e2e cases fail on the base and pass here. tsc, lint and the unit tests pass.
Not blocking:
[P2 non-blocking]skill-data/setup/references/manage-admin.md:206-207lists what pull keeps out of git, and AGENTS.md asks forskill-data/to follow behavior. Suggested line:- config file (MCP, `.codex/hooks.json`, OpenCode's) while it holds only teamai's entries, + config file (MCP, `.codex/hooks.json`, OpenCode's) while it holds only teamai's entries, + and each internal Claude instruction file (`.claude-internal/CLAUDE.md`, + `.tclaude/CLAUDE.md`) while it holds only teamai's blocks,
[P2 non-blocking]#915's table said these two files stay visible until a live check. #1221 now treats "neither committed nor excluded" as the gap, so this change follows the newer call. Citing #1221 in the body and saying it replaces #915's row would help the next reader.[P3 nit]src/__tests__/instruction-targets.test.ts:63castscontent as string. A typedit.eachtable would remove the cast.
Summary
With project Git exclusion enabled, TeamAI-generated
.claude-internal/CLAUDE.mdand.tclaude/CLAUDE.mdremained untracked noise after every self-mode pull. Their shared-file ownership was never classified.Include resolved internal Claude instruction targets in the existing teamai-only judgement. Exclude a file only while complete managed blocks occupy all its content; authored text and tracked files remain visible.
Type of Change
Test Plan
npx tsc --noEmit,npm run lint, andgit diff --check.npx vitest run src/__tests__/instruction-targets.test.ts src/__tests__/git-exclude-delivered.test.ts: 269 passed, including authored text, incomplete/duplicate markers and empty files.npm run build, thennpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/self-mode-git-exclude-915.test.ts: 10 passed. Both editions initialize through the compiled CLI, keep generated blocks excluded across pulls, become visible after authored text is appended, and remain outside the exclude block when tracked.Additional integration validation with all five fixes applied together to
origin/main(2401d04): build, type checking and lint passed; the five affected E2E files passed all 19 tests.npx vitest run --maxWorkers=4finished with 12,232 passed, 36 skipped and two existing baseline failures. Both failures aresubmodule-checkout.test.tscases preserving empty old.claude/settings.local.json/.codex/hooks.json:git config --get hook.teamai-post-checkout.commandfails. Both were independently reproduced on a clean, unchanged2401d04checkout usingnpx vitest run src/__tests__/submodule-checkout.test.ts -t 'preserves an empty old'; no tests were skipped or weakened to hide them.The PR's native Windows CI job (paths, hook rendering and hook shells) also passed at the submitted head.
Related Issues
Refs #1221. This PR addresses only the finding described above and does not close the umbrella issue.
Notes for Reviewers
Uses the existing block editor and Git tracking/delivery safeguards. No blanket tool-directory ignore is added; custom tool mappings are resolved through instruction targets. Other tools' instruction files retain their existing classification policy.