Commit graph

2 commits

Author SHA1 Message Date
Ninym
bd71377fdd docs(optimize): remove references to non-existent .claudeignore
Claude Code does not document or implement a .claudeignore feature.
The junk-reads detector's fix is now a CLAUDE.md instruction asking
Claude to avoid generated/dependency directories. The separate
detectMissingClaudeignore finding and its tests are removed; checking
for the presence of a non-existent file has no signal.

Closes #61.
2026-04-17 08:32:07 +02:00
AgentSeal
c02f63235a test(optimize): add 34 filesystem-mocking tests
Covers previously untested detectors and helpers with real temp-dir
fixtures (not stubs) to verify behavior against actual file I/O.

New coverage:
- detectMissingClaudeignore: project with/without junk dirs and
  .claudeignore, impact scaling.
- detectBloatedClaudeMd: plain oversized file, @-import expansion,
  circular import safety, email/npm-scope @-token filtering.
- loadMcpConfigs: project reads, colon-to-underscore normalization,
  malformed JSON tolerance.
- detectUnusedMcp: 24-hour grace period, config vs invocation merge.
- detectBashBloat: env var unset, configured under/over limit.
- detectGhostCommands: path prefixes are not commands, <command-name>
  tag parsing.
- scanJsonlFile: missing file, tool_use parsing, malformed line
  skipping, date-range filter.
- scanAndDetect: empty projects returns healthy result.
- estimateContextBudget: system base, MCP tools, memory files.
- discoverProjectCwd: empty dir, no jsonl, cwd extraction.

Uses vi.mock to redirect os.homedir() to a disposable temp directory,
so tests do not read the tester's real ~/.claude. 34 tests, <30ms
wall time. Total suite now 160 tests.
2026-04-16 09:33:03 -07:00