Skip to content

fix: align dotgitignore facet paths with actual directory structure#535

Merged
nrslib merged 1 commit intonrslib:mainfrom
kenfdev:fix/dotgitignore-facet-paths
Mar 20, 2026
Merged

fix: align dotgitignore facet paths with actual directory structure#535
nrslib merged 1 commit intonrslib:mainfrom
kenfdev:fix/dotgitignore-facet-paths

Conversation

@kenfdev
Copy link
Contributor

@kenfdev kenfdev commented Mar 20, 2026

Summary

The .takt/.gitignore template listed facet types (personas, policies, etc.) without the facets/ prefix, so files ejected to .takt/facets/{type}/ were not tracked by git.

Add the facets/ prefix to each allowlist entry and update the integration test to derive facet directories from getProjectFacetDir and VALID_FACET_TYPES instead of hardcoded values.

Closes #513


Takt Review Summary

Overall Verdict: APPROVE

Summary

All five reviewers unanimously approved this change. The fix correctly aligns .takt/.gitignore facet path patterns with the actual directory structure (.takt/facets/{type}/ instead of .takt/{type}/), and the tests now derive expected paths from canonical source-of-truth functions (getProjectFacetDir, VALID_FACET_TYPES), eliminating hardcoded values and preventing this class of bug from recurring.

Review Results

Review Result Key Findings
Architecture APPROVE Clean, well-scoped bugfix; tests derive from canonical source of truth
Security APPROVE No security concerns; tighter gitignore scoping improves data protection
QA APPROVE All 4 integration tests pass; parseFacetType()! non-null assertion safe in test context
Testing APPROVE Proper regression coverage; real git operations against isolated temp repos
Requirements APPROVE All 3 requirements satisfied; no scope creep detected

Current Iteration Findings (new)

None

Carry-over Findings (persists)

None

Resolved Findings (resolved)

None

Improvement Suggestions

  • None — the change is minimal, well-tested, and correctly scoped.

Rejection Gate

  • No findings exist in new or persists. APPROVE is valid.

The `.takt/.gitignore` template listed facet types (personas, policies,
etc.) without the `facets/` prefix, so files ejected to
`.takt/facets/{type}/` were not tracked by git.

Add the `facets/` prefix to each allowlist entry and update the
integration test to derive facet directories from `getProjectFacetDir`
and `VALID_FACET_TYPES` instead of hardcoded values.

Closes nrslib#513

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor Author

@kenfdev kenfdev left a comment

Choose a reason for hiding this comment

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

少しテスト方法を変えてしまっているのですが、「こうしてほしい!」があればご指摘お願いします! 🙏

Comment on lines +14 to +15
import { getProjectPiecesDir, getProjectFacetDir } from '../infra/config/paths.js';
import { VALID_FACET_TYPES, parseFacetType } from '../features/config/ejectBuiltin.js';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ここまでやるのか、という議論はあるかと思います(元々のテストのやり方を変更しているため)

ただし、元々の問題もキャッチできるようにするためアプリ側のロジックから持ってくるようにしました

Comment on lines -61 to -62
mkdirSync(join(testDir, '.takt', facet), { recursive: true });
writeFileSync(join(testDir, '.takt', facet, 'test.md'), `# ${facet}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ここに単純に facets/ を追加するテストを追加するだけ(piecesは別階層ですが)でも良かったのですが、もう少し踏み込んだテストにしています。

@kenfdev kenfdev marked this pull request as ready for review March 20, 2026 02:20
@nrslib
Copy link
Owner

nrslib commented Mar 20, 2026

ありがとうございます!
LGTMです!

@nrslib nrslib merged commit d839d87 into nrslib:main Mar 20, 2026
6 of 8 checks passed
@nrslib nrslib mentioned this pull request Mar 20, 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.

.gitignore テンプレートのファセットパスが実際のディレクトリ構造と不一致

2 participants