Commit Graph

2 Commits

Author SHA1 Message Date
alex 3dbb3cb7b2 Fix discover, improve LLM heuristics, add integration tests
- discover.ts: Fix ignore package path handling for root '.' directories,
  add .pi-map.md to default ignore list
- llm-extract.ts: Fix export regex to only match line-start exports and
  handle 'export async function', fix root package role to 'Project root'
- init.ts: Minor cleanup
- .gitignore: Add .pi-map.md
- tests: 6 integration tests covering init, patch (small/large packages),
  validate (missing, orphaned, stale-signature detection)

All 14 tests pass. TypeScript compiles clean.
2026-06-09 19:14:41 +02:00
alex d311c8fb3c Implement all stubs: parsePackageMap, LLM heuristics, tree-sitter AST, patch rewrite, reinit
- 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
2026-06-09 18:04:57 +02:00