- project_map_reinit now regenerates only the target subtree + ancestors
by default, falling back to full reinit when subtree file count exceeds
reinitFullThresholdPercent (default 10%).
- Add reinitFullThresholdPercent config option.
- Expose fix=true on project_map_validate Pi tool for localized repair.
- Update docs and runtime guidance to prefer patch / validate --fix
before full reinit.
- Add integration tests for smart reinit and update typebox mock.
- Cache now lives in <project>/.pi-project-map/cache/llm-cache.json
- Removed global ~/.cache/pi-project-map/ usage
- Cache travels with the project, no cross-project collisions
- Easy to invalidate: rm -rf .pi-project-map/cache/
Files changed:
- llm-cache.ts: accept cacheDir parameter, default to project-local
- llm-extract.ts: pass cacheDir through to cache functions
- init.ts: pass rootPath as cacheDir
- patch.ts: accept and pass cacheDir
- cli.ts: pass targetPath as cacheDir
- pi-extension.ts: pass ctx.cwd as cacheDir
- Tests updated to use temp dirs for cache isolation
- format.ts: Full parsePackageMap implementation with round-trip support
- llm-extract.ts: Heuristic-based extraction without LLM API (regex exports,
imports, purpose inference from filename patterns)
- ast-extract.ts: Tree-sitter integration for TypeScript/TSX with fallback
for other languages
- init.ts: Refactored to expose generateDirectoryMap helper, reinitPath
delegates to initProject
- patch.ts: Small packages now use generateDirectoryMap for full rewrite
- discover.ts: Cleaned up require('fs') to use proper ES import
- Tests: 8 tests covering format round-trip and LLM heuristics
- All TypeScript compiles clean, all tests pass
- Design doc with full spec (dense markdown format, hybrid AST+LLM pipeline,
consumption model, stale data mitigation)
- Implementation plan with 6 milestones and rollout strategy
- TypeScript package structure with all source stubs
- CLI entry point, formatter, discover, init, patch, validate, extract, merge
- Pi SKILL.md with tool definitions and format documentation