feat: smart subtree-aware reinit and validate --fix

- 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.
This commit is contained in:
Developer
2026-06-16 11:46:48 +00:00
parent 5f1c107667
commit cb581f44b9
11 changed files with 384 additions and 54 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ function printUsage() {
` project-map ${pc.cyan("validate")} [--fix] [path] Check for stale/missing/orphaned entries`,
);
console.log(
` project-map ${pc.cyan("reinit")} [path] Force full regeneration`,
` project-map ${pc.cyan("reinit")} [path] Regenerate a subtree or the whole project`,
);
console.log(
` project-map ${pc.cyan("--help")} Show this help message`,
@@ -252,7 +252,7 @@ async function main() {
await reinitPath(targetPath, {
verbose: false,
llmClient: client,
cacheDir: targetPath,
cacheDir: process.cwd(),
onProgress: (info) => {
const line = renderProgressBar(
info.completed,