Skip to content

fix(git-exclude): classify internal Claude instruction files - #1318

Merged
SaulMoro merged 1 commit into
Tencent:mainfrom
nateEc:fix/1221-internal-instruction-excludes
Oct 23, 2026
Merged

SaulMoro merged 1 commit into
Tencent:mainfrom
nateEc:fix/1221-internal-instruction-excludes

Conversation

@nateEc

@nateEc nateEc commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With project Git exclusion enabled, TeamAI-generated .claude-internal/CLAUDE.md and .tclaude/CLAUDE.md remained 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

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • npx tsc --noEmit, npm run lint, and git 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, then npx 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.
  • The two new real-CLI cases were also run against original baseline sources and failed because the generated instruction files were not ignored.

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=4 finished with 12,232 passed, 36 skipped and two existing baseline failures. Both failures are submodule-checkout.test.ts cases preserving empty old .claude/settings.local.json / .codex/hooks.json: git config --get hook.teamai-post-checkout.command fails. Both were independently reproduced on a clean, unchanged 2401d04 checkout using npx 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.

- 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.
@github-actions

Copy link
Copy Markdown

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 SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-207 lists what pull keeps out of git, and AGENTS.md asks for skill-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:63 casts content as string. A typed it.each table would remove the cast.

@SaulMoro
SaulMoro merged commit c3bf248 into Tencent:main Oct 23, 2026
18 checks passed
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.

3 participants