@thanh01.pmt/domain-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +1101 -0
  2. package/dist/assembly/index.cjs +213 -0
  3. package/dist/assembly/index.cjs.map +1 -0
  4. package/dist/assembly/index.d.cts +66 -0
  5. package/dist/assembly/index.d.ts +66 -0
  6. package/dist/assembly/index.mjs +4 -0
  7. package/dist/assembly/index.mjs.map +1 -0
  8. package/dist/chunk-3H2HX7PR.mjs +324 -0
  9. package/dist/chunk-3H2HX7PR.mjs.map +1 -0
  10. package/dist/chunk-3VVPSRAM.mjs +1297 -0
  11. package/dist/chunk-3VVPSRAM.mjs.map +1 -0
  12. package/dist/chunk-DRVOV5ZD.mjs +314 -0
  13. package/dist/chunk-DRVOV5ZD.mjs.map +1 -0
  14. package/dist/chunk-F4RZNBOE.mjs +3 -0
  15. package/dist/chunk-F4RZNBOE.mjs.map +1 -0
  16. package/dist/chunk-GEUDHZE7.mjs +446 -0
  17. package/dist/chunk-GEUDHZE7.mjs.map +1 -0
  18. package/dist/chunk-HH4UX65C.mjs +100 -0
  19. package/dist/chunk-HH4UX65C.mjs.map +1 -0
  20. package/dist/chunk-KMYENICQ.mjs +3 -0
  21. package/dist/chunk-KMYENICQ.mjs.map +1 -0
  22. package/dist/chunk-KNDBODUQ.mjs +153 -0
  23. package/dist/chunk-KNDBODUQ.mjs.map +1 -0
  24. package/dist/chunk-MM2RWYNW.mjs +3 -0
  25. package/dist/chunk-MM2RWYNW.mjs.map +1 -0
  26. package/dist/chunk-MOKNFLUD.mjs +851 -0
  27. package/dist/chunk-MOKNFLUD.mjs.map +1 -0
  28. package/dist/chunk-ONQHJ4OH.mjs +211 -0
  29. package/dist/chunk-ONQHJ4OH.mjs.map +1 -0
  30. package/dist/chunk-PM42MMDJ.mjs +516 -0
  31. package/dist/chunk-PM42MMDJ.mjs.map +1 -0
  32. package/dist/chunk-RKRNOVKO.mjs +166 -0
  33. package/dist/chunk-RKRNOVKO.mjs.map +1 -0
  34. package/dist/chunk-VFART56O.mjs +884 -0
  35. package/dist/chunk-VFART56O.mjs.map +1 -0
  36. package/dist/chunk-XMHKWHVK.mjs +218 -0
  37. package/dist/chunk-XMHKWHVK.mjs.map +1 -0
  38. package/dist/conceptEscalator-YfMKIKCZ.d.ts +40 -0
  39. package/dist/conceptEscalator-ltRLtPhf.d.cts +40 -0
  40. package/dist/concepts/index.cjs +155 -0
  41. package/dist/concepts/index.cjs.map +1 -0
  42. package/dist/concepts/index.d.cts +79 -0
  43. package/dist/concepts/index.d.ts +79 -0
  44. package/dist/concepts/index.mjs +4 -0
  45. package/dist/concepts/index.mjs.map +1 -0
  46. package/dist/curriculumFeedSchema-TEeQg2bY.d.cts +549 -0
  47. package/dist/curriculumFeedSchema-TEeQg2bY.d.ts +549 -0
  48. package/dist/detector/index.cjs +889 -0
  49. package/dist/detector/index.cjs.map +1 -0
  50. package/dist/detector/index.d.cts +112 -0
  51. package/dist/detector/index.d.ts +112 -0
  52. package/dist/detector/index.mjs +3 -0
  53. package/dist/detector/index.mjs.map +1 -0
  54. package/dist/domainProfileSchema-CwT3Ffsw.d.cts +105 -0
  55. package/dist/domainProfileSchema-CwT3Ffsw.d.ts +105 -0
  56. package/dist/extractors/index.cjs +387 -0
  57. package/dist/extractors/index.cjs.map +1 -0
  58. package/dist/extractors/index.d.cts +46 -0
  59. package/dist/extractors/index.d.ts +46 -0
  60. package/dist/extractors/index.mjs +4 -0
  61. package/dist/extractors/index.mjs.map +1 -0
  62. package/dist/feed/index.cjs +421 -0
  63. package/dist/feed/index.cjs.map +1 -0
  64. package/dist/feed/index.d.cts +23 -0
  65. package/dist/feed/index.d.ts +23 -0
  66. package/dist/feed/index.mjs +4 -0
  67. package/dist/feed/index.mjs.map +1 -0
  68. package/dist/graph/index.cjs +2167 -0
  69. package/dist/graph/index.cjs.map +1 -0
  70. package/dist/graph/index.d.cts +226 -0
  71. package/dist/graph/index.d.ts +226 -0
  72. package/dist/graph/index.mjs +4 -0
  73. package/dist/graph/index.mjs.map +1 -0
  74. package/dist/graphVerifier-DsTP9uAN.d.ts +37 -0
  75. package/dist/graphVerifier-QjgDAJce.d.cts +37 -0
  76. package/dist/hybridGraphSchema-BCgXicgA.d.cts +2840 -0
  77. package/dist/hybridGraphSchema-BCgXicgA.d.ts +2840 -0
  78. package/dist/index.cjs +5539 -0
  79. package/dist/index.cjs.map +1 -0
  80. package/dist/index.d.cts +18 -0
  81. package/dist/index.d.ts +18 -0
  82. package/dist/index.mjs +17 -0
  83. package/dist/index.mjs.map +1 -0
  84. package/dist/keywordExtractor-CKaXqSku.d.ts +34 -0
  85. package/dist/keywordExtractor-zPAz2isq.d.cts +34 -0
  86. package/dist/llmClient-ysPhLjcH.d.cts +16 -0
  87. package/dist/llmClient-ysPhLjcH.d.ts +16 -0
  88. package/dist/parsers/index.cjs +323 -0
  89. package/dist/parsers/index.cjs.map +1 -0
  90. package/dist/parsers/index.d.cts +98 -0
  91. package/dist/parsers/index.d.ts +98 -0
  92. package/dist/parsers/index.mjs +4 -0
  93. package/dist/parsers/index.mjs.map +1 -0
  94. package/dist/pipeline/index.cjs +2166 -0
  95. package/dist/pipeline/index.cjs.map +1 -0
  96. package/dist/pipeline/index.d.cts +45 -0
  97. package/dist/pipeline/index.d.ts +45 -0
  98. package/dist/pipeline/index.mjs +8 -0
  99. package/dist/pipeline/index.mjs.map +1 -0
  100. package/dist/projectGraphSchema-DnD7orZV.d.cts +2581 -0
  101. package/dist/projectGraphSchema-DnD7orZV.d.ts +2581 -0
  102. package/dist/schemas/index.cjs +675 -0
  103. package/dist/schemas/index.cjs.map +1 -0
  104. package/dist/schemas/index.d.cts +253 -0
  105. package/dist/schemas/index.d.ts +253 -0
  106. package/dist/schemas/index.mjs +4 -0
  107. package/dist/schemas/index.mjs.map +1 -0
  108. package/package.json +71 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/parsers/swift.ts","../../src/parsers/typescript.ts","../../src/parsers/python.ts","../../src/parsers/cpp.ts","../../src/extractors/keywordExtractor.ts","../../src/utils/llmClient.ts","../../src/graph/scaffoldExtractor.ts","../../src/graph/overviewExtractor.ts","../../src/graph/stepExtractor.ts","../../src/graph/graphVerifier.ts","../../src/graph/conceptEscalator.ts","../../src/concepts/conceptResolver.ts","../../src/assembly/roadmapAssembler.ts","../../src/extractors/fileSelector.ts","../../src/utils/fileUtils.ts","../../src/pipeline/projectGraphPipeline.ts"],"names":["IMPORT_RE","TYPE_RE","FUNC_RE","resolve","buildSourceText","execSync","extname","join","readdirSync","readFileSync","relative"],"mappings":";;;;;;;AA0BA,IAAM,SAAA,GAAY,mBAAA;AAClB,IAAM,OAAA,GAAU,4DAAA;AAChB,IAAM,OAAA,GAAU,mDAAA;AAChB,IAAM,UAAA,GAAa,sIAAA;AACnB,IAAM,kBAAA,GAAqB,oJAAA;AAEpB,SAAS,cAAA,CAAe,UAAkB,OAAA,EAAmC;AAClF,EAAA,MAAM,MAAA,GAA2B;AAAA,IAC/B,SAAS,EAAC;AAAA,IACV,OAAO,EAAC;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,mBAAmB,EAAC;AAAA,IACpB,gBAAgB,EAAC;AAAA,IACjB,iBAAiB;AAAC,GACpB;AAGA,EAAA,IAAI,KAAA;AACJ,EAAA,OAAA,CAAQ,KAAA,GAAQ,SAAA,CAAU,IAAA,CAAK,OAAO,OAAO,IAAA,EAAM;AACjD,IAAA,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,CAAC,CAAC,CAAA;AAAA,EAC9B;AAGA,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAY;AAC/B,EAAA,OAAA,CAAQ,KAAA,GAAQ,kBAAA,CAAmB,IAAA,CAAK,OAAO,OAAO,IAAA,EAAM;AAC1D,IAAA,IAAI,CAAC,MAAA,CAAO,GAAA,CAAI,KAAA,CAAM,CAAC,CAAC,CAAA,EAAG;AACzB,MAA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,CAAgB;AAAA,IAC7C,QAAA,EAAU,cAAA;AAAA,IACV,IAAA;AAAA,IACA,UAAA;AAAA,IACA,cAEF,CAAC,CAAA;AACD,EAAA,GAAA,CAAI,QAAA,EAAU,CAAA,UAAA,EAAa,gBAAA,CAAiB,OAAA,CAAQ,cAAc,CAAA,YAAA,EAAe,gBAAA,CAAiB,OAAA,CAAQ,cAAc,CAAA,EAAA,EAAK,gBAAA,CAAiB,OAAA,CAAQ,WAAW,CAAA,CAAA,CAAG,CAAA;AAGpK,EAAA,GAAA,CAAI,UAAU,6CAA6C,CAAA;AAE3D,EAAA,MAAM,UAAU,eAAA,CAAgB;AAAA,IAC9B,YAAA,EAAc,aAAA;AAAA,IACd,eAAA;AAAA,IACA,cAAA,EAAgB,EAAA;AAAA,IAChB,cAAA,EAAgB,IAAA;AAAA,IAChB,mBAAA,EAAqB;AAAA,GACtB,CAAA;AACD,EAAA,GAAA,CAAI,UAAU,CAAA,mBAAA,EAAsB,OAAA,CAAQ,OAAO,MAAM,CAAA,SAAA,EAAY,QAAQ,MAAA,CAAO,MAAA,CAAO,CAAC,CAAA,EAAG,MAAM,CAAA,GAAI,CAAA,CAAE,WAAW,MAAA,EAAQ,CAAC,CAAC,CAAA,WAAA,CAAa,CAAA;AAE7I,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,aAAA;AAAA,IACd,gBAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,QAAA,EAAU,WAAA;AAAA,IACV;AAAA,GACF;AACF","file":"index.cjs","sourcesContent":["/**\n * Swift AST-level parser — extracts imports, types, functions, property wrappers,\n * error handling patterns, and framework usage from Swift source files.\n *\n * Ported from knowledge-tree/extract_project_keywords.py parse_swift_file()\n */\n\nexport interface SwiftParseResult {\n imports: string[];\n types: Array<{\n kind: string;\n name: string;\n conforms_to: string[];\n file: string;\n }>;\n functions: Array<{\n name: string;\n params: string;\n returns: string;\n file: string;\n }>;\n property_wrappers: string[];\n error_handling: string[];\n frameworks_used: string[];\n}\n\nconst IMPORT_RE = /^import\\s+(\\w+)/gm;\nconst TYPE_RE = /\\b(class|struct|enum|protocol)\\s+(\\w+)(?:\\s*:\\s*([^{]+))?/g;\nconst FUNC_RE = /\\bfunc\\s+(\\w+)\\s*\\(([^)]*)\\)(?:\\s*->\\s*([^{]+))?/g;\nconst WRAPPER_RE = /@(State|Binding|ObservedObject|StateObject|Published|Environment|EnvironmentObject|AppStorage|SceneStorage|FocusState|Observable)\\b/g;\nconst FRAMEWORK_USAGE_RE = /\\b(URLSession|URLRequest|JSONSerialization|JSONDecoder|JSONEncoder|Task|DispatchQueue|Timer|NotificationCenter|UserDefaults|FileManager|Bundle)\\b/g;\n\nexport function parseSwiftFile(filepath: string, content: string): SwiftParseResult {\n const result: SwiftParseResult = {\n imports: [],\n types: [],\n functions: [],\n property_wrappers: [],\n error_handling: [],\n frameworks_used: [],\n };\n\n // Extract imports\n let match: RegExpExecArray | null;\n while ((match = IMPORT_RE.exec(content)) !== null) {\n result.imports.push(match[1]);\n }\n\n // Extract framework usage (types used in body, not declarations)\n const fwSeen = new Set<string>();\n while ((match = FRAMEWORK_USAGE_RE.exec(content)) !== null) {\n if (!fwSeen.has(match[1])) {\n fwSeen.add(match[1]);\n result.frameworks_used.push(match[1]);\n }\n }\n\n // Extract type declarations\n while ((match = TYPE_RE.exec(content)) !== null) {\n const conforms = (match[3] || '')\n .split(',')\n .map(p => p.trim())\n .filter(Boolean);\n result.types.push({\n kind: match[1],\n name: match[2],\n conforms_to: conforms,\n file: filepath,\n });\n }\n\n // Extract function signatures\n while ((match = FUNC_RE.exec(content)) !== null) {\n const name = match[1];\n if (name.startsWith('_')) continue;\n result.functions.push({\n name,\n params: (match[2] || '').trim(),\n returns: (match[3] || '').trim(),\n file: filepath,\n });\n }\n\n // Extract property wrappers\n const wrapperSet = new Set<string>();\n while ((match = WRAPPER_RE.exec(content)) !== null) {\n wrapperSet.add(match[1]);\n }\n result.property_wrappers = Array.from(wrapperSet);\n\n // Extract error handling patterns\n if (content.includes('do {') || content.includes('do{')) {\n result.error_handling.push('do-catch');\n }\n if (content.includes('throws')) {\n result.error_handling.push('throws');\n }\n if (content.includes('Result<')) {\n result.error_handling.push('Result type');\n }\n if (content.includes('try?')) {\n result.error_handling.push('try?');\n }\n if (content.includes('try!')) {\n result.error_handling.push('try!');\n }\n\n return result;\n}\n\nexport function mergeSwiftResults(results: SwiftParseResult[]): SwiftParseResult {\n const merged: SwiftParseResult = {\n imports: [],\n types: [],\n functions: [],\n property_wrappers: [],\n error_handling: [],\n frameworks_used: [],\n };\n\n const importCounts = new Map<string, number>();\n const wrapperCounts = new Map<string, number>();\n const errorCounts = new Map<string, number>();\n const frameworkSet = new Set<string>();\n\n for (const r of results) {\n for (const imp of r.imports) {\n importCounts.set(imp, (importCounts.get(imp) || 0) + 1);\n }\n merged.types.push(...r.types);\n merged.functions.push(...r.functions);\n for (const w of r.property_wrappers) {\n wrapperCounts.set(w, (wrapperCounts.get(w) || 0) + 1);\n }\n for (const e of r.error_handling) {\n errorCounts.set(e, (errorCounts.get(e) || 0) + 1);\n }\n for (const fw of r.frameworks_used) {\n frameworkSet.add(fw);\n }\n }\n\n // Sort imports by count descending, top 20\n merged.imports = Array.from(importCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 20)\n .map(([mod, count]) => mod);\n\n // Sort wrappers by count, top 10\n merged.property_wrappers = Array.from(wrapperCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 10)\n .map(([w]) => w);\n\n // Sort errors by count, top 10\n merged.error_handling = Array.from(errorCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 10)\n .map(([p]) => p);\n\n merged.frameworks_used = Array.from(frameworkSet).sort();\n\n // Limit types and functions\n merged.types = merged.types.slice(0, 100);\n merged.functions = merged.functions.slice(0, 100);\n\n return merged;\n}\n","/**\n * TypeScript/JavaScript AST-level parser — extracts imports, types, functions,\n * and error handling patterns.\n *\n * Ported from knowledge-tree/extract_project_keywords.py parse_ts_file()\n */\n\nexport interface TsParseResult {\n imports: string[];\n types: Array<{\n kind: string;\n name: string;\n file: string;\n }>;\n functions: Array<{\n name: string;\n params: string;\n file: string;\n }>;\n error_handling: string[];\n}\n\nconst IMPORT_RE = /import\\s+.*?from\\s+['\"]([^'\"]+)['\"]/g;\nconst TYPE_RE = /\\b(interface|type|class|enum)\\s+(\\w+)/g;\nconst FUNC_RE = /\\bfunction\\s+(\\w+)\\s*\\(([^)]*)\\)/g;\nconst ARROW_RE = /\\bconst\\s+(\\w+)\\s*=\\s*\\([^)]*\\)\\s*(?::\\s*\\w+)?\\s*=>/g;\n\nexport function parseTsFile(filepath: string, content: string): TsParseResult {\n const result: TsParseResult = {\n imports: [],\n types: [],\n functions: [],\n error_handling: [],\n };\n\n let match: RegExpExecArray | null;\n\n // Extract imports\n while ((match = IMPORT_RE.exec(content)) !== null) {\n result.imports.push(match[1]);\n }\n\n // Extract type/interface/class/enum declarations\n while ((match = TYPE_RE.exec(content)) !== null) {\n result.types.push({\n kind: match[1],\n name: match[2],\n file: filepath,\n });\n }\n\n // Extract function declarations\n while ((match = FUNC_RE.exec(content)) !== null) {\n result.functions.push({\n name: match[1],\n params: (match[2] || '').trim(),\n file: filepath,\n });\n }\n\n // Extract arrow functions\n while ((match = ARROW_RE.exec(content)) !== null) {\n result.functions.push({\n name: match[1],\n params: '',\n file: filepath,\n });\n }\n\n // Extract error handling patterns\n if (content.includes('try {') || content.includes('try{')) {\n result.error_handling.push('try-catch');\n }\n if (content.includes('Promise')) {\n result.error_handling.push('Promise');\n }\n if (content.includes('.catch(')) {\n result.error_handling.push('.catch()');\n }\n\n return result;\n}\n\nexport function mergeTsResults(results: TsParseResult[]): TsParseResult {\n const merged: TsParseResult = {\n imports: [],\n types: [],\n functions: [],\n error_handling: [],\n };\n\n const importCounts = new Map<string, number>();\n const errorCounts = new Map<string, number>();\n\n for (const r of results) {\n for (const imp of r.imports) {\n importCounts.set(imp, (importCounts.get(imp) || 0) + 1);\n }\n merged.types.push(...r.types);\n merged.functions.push(...r.functions);\n for (const e of r.error_handling) {\n errorCounts.set(e, (errorCounts.get(e) || 0) + 1);\n }\n }\n\n merged.imports = Array.from(importCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 20)\n .map(([mod]) => mod);\n\n merged.error_handling = Array.from(errorCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 10)\n .map(([p]) => p);\n\n merged.types = merged.types.slice(0, 100);\n merged.functions = merged.functions.slice(0, 100);\n\n return merged;\n}\n","/**\n * Python AST-level parser — extracts imports, classes, functions, docstrings,\n * and error handling patterns.\n *\n * Ported from knowledge-tree/extract_project_keywords.py parse_python_file()\n */\n\nexport interface PythonParseResult {\n imports: string[];\n types: Array<{\n kind: string;\n name: string;\n bases: string[];\n file: string;\n }>;\n functions: Array<{\n name: string;\n params: string;\n file: string;\n }>;\n docstrings: string[];\n error_handling: string[];\n}\n\nconst IMPORT_RE = /^(?:import|from)\\s+(\\w+)/gm;\nconst CLASS_RE = /\\bclass\\s+(\\w+)(?:\\s*\\(([^)]+)\\))?/g;\nconst FUNC_RE = /\\bdef\\s+(\\w+)\\s*\\(([^)]*)\\)/g;\nconst DOCSTRING_RE = /\"\"\"([^\"]{20,300})\"\"\"/g;\n\nexport function parsePythonFile(filepath: string, content: string): PythonParseResult {\n const result: PythonParseResult = {\n imports: [],\n types: [],\n functions: [],\n docstrings: [],\n error_handling: [],\n };\n\n let match: RegExpExecArray | null;\n\n // Extract imports\n while ((match = IMPORT_RE.exec(content)) !== null) {\n result.imports.push(match[1]);\n }\n\n // Extract docstrings (module, class, function level) — high-signal domain intent\n while ((match = DOCSTRING_RE.exec(content)) !== null) {\n const firstSentence = match[1].trim().split('\\n')[0].slice(0, 120);\n if (firstSentence.length > 15) {\n result.docstrings.push(firstSentence);\n }\n }\n\n // Extract class declarations\n while ((match = CLASS_RE.exec(content)) !== null) {\n const bases = (match[2] || '')\n .split(',')\n .map(b => b.trim())\n .filter(Boolean);\n result.types.push({\n kind: 'class',\n name: match[1],\n bases,\n file: filepath,\n });\n }\n\n // Extract function declarations\n while ((match = FUNC_RE.exec(content)) !== null) {\n const name = match[1];\n // Skip dunder methods (__init__, __str__)\n if (name.startsWith('__') && name.endsWith('__')) continue;\n result.functions.push({\n name,\n params: (match[2] || '').trim(),\n file: filepath,\n });\n }\n\n // Extract error handling patterns\n if (content.includes('try:')) {\n result.error_handling.push('try-except');\n }\n if (content.includes('raise')) {\n result.error_handling.push('raise');\n }\n\n return result;\n}\n\nexport function mergePythonResults(results: PythonParseResult[]): PythonParseResult {\n const merged: PythonParseResult = {\n imports: [],\n types: [],\n functions: [],\n docstrings: [],\n error_handling: [],\n };\n\n const importCounts = new Map<string, number>();\n const errorCounts = new Map<string, number>();\n\n for (const r of results) {\n for (const imp of r.imports) {\n importCounts.set(imp, (importCounts.get(imp) || 0) + 1);\n }\n merged.types.push(...r.types);\n merged.functions.push(...r.functions);\n merged.docstrings.push(...r.docstrings);\n for (const e of r.error_handling) {\n errorCounts.set(e, (errorCounts.get(e) || 0) + 1);\n }\n }\n\n merged.imports = Array.from(importCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 20)\n .map(([mod]) => mod);\n\n merged.error_handling = Array.from(errorCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 10)\n .map(([p]) => p);\n\n merged.types = merged.types.slice(0, 100);\n merged.functions = merged.functions.slice(0, 100);\n merged.docstrings = merged.docstrings.slice(0, 20);\n\n return merged;\n}\n","/**\n * C++/Arduino AST-level parser — extracts #include, types, functions,\n * and error handling patterns.\n *\n * Ported from knowledge-tree/extract_project_keywords.py parse_cpp_file()\n */\n\nexport interface CppParseResult {\n imports: string[];\n types: Array<{\n kind: string;\n name: string;\n file: string;\n }>;\n functions: Array<{\n name: string;\n file: string;\n }>;\n error_handling: string[];\n}\n\nconst INCLUDE_RE = /#include\\s*[<\"]([^>\"]+)[>\"]/g;\nconst TYPE_RE = /\\b(?:class|struct|enum)\\s+(\\w+)/g;\nconst FUNC_RE = /\\b(?:void|int|float|double|char|bool|String|uint8_t|uint16_t|uint32_t)\\s+(\\w+)\\s*\\(/g;\n\nexport function parseCppFile(filepath: string, content: string): CppParseResult {\n const result: CppParseResult = {\n imports: [],\n types: [],\n functions: [],\n error_handling: [],\n };\n\n let match: RegExpExecArray | null;\n\n // Extract #include\n while ((match = INCLUDE_RE.exec(content)) !== null) {\n result.imports.push(match[1]);\n }\n\n // Extract type declarations\n while ((match = TYPE_RE.exec(content)) !== null) {\n result.types.push({\n kind: 'cpp',\n name: match[1],\n file: filepath,\n });\n }\n\n // Extract function declarations\n while ((match = FUNC_RE.exec(content)) !== null) {\n result.functions.push({\n name: match[1],\n file: filepath,\n });\n }\n\n // Extract error handling patterns\n if (/\\btry\\b|\\bthrow\\b|\\bcatch\\b/.test(content)) {\n result.error_handling.push('try/throw/catch');\n }\n\n return result;\n}\n\nexport function mergeCppResults(results: CppParseResult[]): CppParseResult {\n const merged: CppParseResult = {\n imports: [],\n types: [],\n functions: [],\n error_handling: [],\n };\n\n const importCounts = new Map<string, number>();\n\n for (const r of results) {\n for (const imp of r.imports) {\n importCounts.set(imp, (importCounts.get(imp) || 0) + 1);\n }\n merged.types.push(...r.types);\n merged.functions.push(...r.functions);\n merged.error_handling.push(...r.error_handling);\n }\n\n merged.imports = Array.from(importCounts.entries())\n .sort((a, b) => b[1] - a[1])\n .slice(0, 20)\n .map(([mod]) => mod);\n\n // Deduplicate error handling\n merged.error_handling = [...new Set(merged.error_handling)];\n\n return merged;\n}\n","/**\n * Keyword extraction logic — combines AST parser results into structured keywords\n * with source, weight, and context metadata.\n *\n * Ported from knowledge-tree/extract_project_keywords.py extract_keywords()\n */\n\nimport type { SwiftParseResult } from '../parsers/swift';\nimport type { TsParseResult } from '../parsers/typescript';\nimport type { PythonParseResult } from '../parsers/python';\nimport type { CppParseResult } from '../parsers/cpp';\n\nexport interface Keyword {\n keyword: string;\n source: string;\n platform: string;\n weight: number;\n context: string;\n}\n\nexport type SourceContext = SwiftParseResult | TsParseResult | PythonParseResult | CppParseResult;\n\nexport interface ExtractKeywordsOptions {\n /** Additional stdlib modules to skip (merged with defaults) */\n extraStdlibModules?: string[];\n /** Modules to un-skip even if in stdlib (e.g., 'math' for scientific projects) */\n unskipModules?: string[];\n}\n\n/**\n * Standard library modules that carry no domain signal — skip as keywords.\n */\nconst STDLIB_MODULES = new Set([\n // Python\n 'os', 'sys', 'typing', 'json', 're', 'math', 'random', 'time', 'datetime',\n 'pathlib', 'dataclasses', 'enum', 'collections', 'itertools', 'functools',\n 'logging', 'argparse', 'subprocess', 'threading', 'multiprocessing', 'asyncio',\n 'socket', 'http', 'urllib', 'ssl', 'hashlib', 'base64', 'csv', 'sqlite3',\n 'pickle', 'tempfile', 'shutil', 'glob', 'io', 'string', 'struct', 'uuid',\n 'abc', 'copy', 'decimal', 'fractions', 'statistics', 'queue', 'signal',\n 'traceback', 'warnings', 'weakref', 'contextlib', 'unittest', 'pytest',\n 'tkinter', 'tk', 'ttk', 'types', 'inspect', 'platform',\n // Common third-party generic plumbing\n 'requests', 'urllib3', 'pydantic', 'dotenv', 'yaml', 'tomllib',\n]);\n\n/**\n * Map file path → platform (multi-codebase project: Swift app vs ESP32 firmware).\n */\nfunction platformFromPath(filePath: string): string {\n if (!filePath) return 'app';\n const fp = filePath.toLowerCase();\n if (fp.endsWith('.ino') || fp.endsWith('.cpp') || fp.endsWith('.h') || fp.endsWith('.hpp') || fp.endsWith('.c')) {\n if (fp.endsWith('.ino')) return 'esp32';\n if (fp.includes('firmware') || fp.includes('esp')) return 'esp32';\n return 'app';\n }\n return 'app';\n}\n\n/**\n * Extract structured keywords from source context and basic analysis.\n *\n * Multi-target: each keyword is tagged with platform (app/esp32) from its source file,\n * so downstream SIO generation produces correct keywords for each codebase.\n */\nexport function extractKeywords(\n sourceContext: SourceContext,\n basicAnalysis?: { config_files?: string[] },\n repoDir?: string,\n options?: ExtractKeywordsOptions,\n): Keyword[] {\n const keywords: Keyword[] = [];\n\n // Build effective stdlib set with overrides\n const effectiveStdlib = new Set(STDLIB_MODULES);\n if (options?.extraStdlibModules) {\n for (const m of options.extraStdlibModules) effectiveStdlib.add(m.toLowerCase());\n }\n if (options?.unskipModules) {\n for (const m of options.unskipModules) effectiveStdlib.delete(m.toLowerCase());\n }\n\n // Source 1: Import statements → framework keywords\n if ('imports' in sourceContext) {\n for (const imp of sourceContext.imports) {\n let module: string;\n let count = 1;\n let platform = 'app';\n\n if (typeof imp === 'string') {\n module = imp;\n } else if (imp && typeof imp === 'object' && 'module' in imp) {\n const impObj = imp as { module: string; count?: number; file?: string };\n module = impObj.module;\n count = impObj.count || 1;\n platform = platformFromPath(impObj.file || '');\n } else {\n continue;\n }\n\n // Skip standard library / generic plumbing — no domain signal\n if (effectiveStdlib.has(module.toLowerCase())) continue;\n\n keywords.push({\n keyword: module,\n source: 'import',\n platform,\n weight: 1.0 + (count - 1) * 0.1,\n context: `Imported ${count} times`,\n });\n }\n }\n\n // Source 2: Type declarations → domain concepts\n if ('types' in sourceContext) {\n for (const typeDecl of sourceContext.types) {\n const name = typeDecl.name;\n const kind = typeDecl.kind;\n const platform = platformFromPath(typeDecl.file || '');\n\n // Skip generic/framework types\n if (['View', 'Model', 'ViewModel', 'Controller', 'Service', 'Manager'].includes(name)) continue;\n\n keywords.push({\n keyword: name,\n source: 'type_declaration',\n platform,\n weight: 1.5,\n context: `${kind} declaration`,\n });\n }\n }\n\n // Source 3: Function signatures → business logic\n if ('functions' in sourceContext) {\n for (const func of sourceContext.functions) {\n const name = func.name;\n const platform = platformFromPath(func.file || '');\n\n // Skip generic helpers\n if (['init', 'setup', 'configure', 'initialize'].includes(name)) continue;\n\n keywords.push({\n keyword: name,\n source: 'function_signature',\n platform,\n weight: 1.2,\n context: 'Function signature',\n });\n }\n }\n\n // Source 3.5: Docstrings → domain intent (high signal) — Python only\n if ('docstrings' in sourceContext && Array.isArray(sourceContext.docstrings)) {\n for (const doc of sourceContext.docstrings) {\n const firstSentence = doc.trim().split('\\n')[0].slice(0, 120);\n if (firstSentence.length > 15) {\n keywords.push({\n keyword: firstSentence,\n source: 'docstring',\n platform: 'app',\n weight: 1.8,\n context: 'Docstring (domain intent)',\n });\n }\n }\n }\n\n // Source 3.6: Framework usage → real practice keywords — Swift only\n if ('frameworks_used' in sourceContext && Array.isArray(sourceContext.frameworks_used)) {\n for (const fw of sourceContext.frameworks_used) {\n const fwName = typeof fw === 'string' ? fw : (fw as { framework?: string }).framework || '';\n if (fwName) {\n keywords.push({\n keyword: fwName,\n source: 'framework_usage',\n platform: 'app',\n weight: 1.4,\n context: 'Framework usage (real practice)',\n });\n }\n }\n }\n\n // Source 4: Property wrappers → state management patterns — Swift only\n if ('property_wrappers' in sourceContext && Array.isArray(sourceContext.property_wrappers)) {\n for (const wrapper of sourceContext.property_wrappers) {\n const wrapperName = typeof wrapper === 'string' ? wrapper : (wrapper as { wrapper?: string }).wrapper || '';\n if (wrapperName) {\n keywords.push({\n keyword: `@${wrapperName}`,\n source: 'property_wrapper',\n platform: 'app',\n weight: 2.0,\n context: 'Property wrapper',\n });\n }\n }\n }\n\n // Source 5: Error handling patterns → reliability concerns\n const errorPatterns = 'error_handling' in sourceContext\n ? sourceContext.error_handling\n : 'error_handling_patterns' in sourceContext\n ? (sourceContext as { error_handling_patterns?: Array<{ pattern: string; count?: number; file?: string }> }).error_handling_patterns || []\n : [];\n\n for (const error of errorPatterns) {\n let pattern: string;\n let platform = 'app';\n\n if (typeof error === 'string') {\n pattern = error;\n } else if (error && typeof error === 'object' && 'pattern' in error) {\n const errObj = error as { pattern: string; file?: string };\n pattern = errObj.pattern;\n platform = platformFromPath(errObj.file || '');\n } else {\n continue;\n }\n\n keywords.push({\n keyword: pattern,\n source: 'error_handling',\n platform,\n weight: 1.3,\n context: 'Error handling pattern',\n });\n }\n\n // Deduplicate by keyword (case-insensitive)\n const seen = new Set<string>();\n const uniqueKeywords: Keyword[] = [];\n for (const kw of keywords) {\n const key = kw.keyword.toLowerCase();\n if (!seen.has(key)) {\n seen.add(key);\n uniqueKeywords.push(kw);\n }\n }\n\n return uniqueKeywords;\n}\n","/**\n * LLM client wrapper — provides a unified interface for LLM calls\n * used by the graph generation pipeline.\n *\n * Supports OpenAI-compatible APIs via environment variables:\n * LLM_API_KEY, LLM_BASE_URL, LLM_MODEL (or LLM_TIER_FAST / LLM_TIER_STRONG)\n */\n\nexport interface LlmClientConfig {\n apiKey?: string;\n baseUrl?: string;\n model?: string;\n temperature?: number;\n maxTokens?: number;\n}\n\n/** One callable provider endpoint in the fallback chain. */\nexport interface ProviderSpec {\n label: string;\n baseUrl: string;\n apiKey: string;\n model: string;\n}\n\nexport interface LlmClient {\n chat(messages: LlmChatMessage[], options?: { temperature?: number; maxTokens?: number }): Promise<LlmChatResult>;\n model: string;\n}\n\nexport interface LlmChatMessage {\n role: 'system' | 'user' | 'assistant';\n content: string;\n}\n\nexport interface LlmChatResult {\n content: string;\n model: string;\n /** Provider label that ultimately served the request. */\n provider?: string;\n /** What happened per provider when fallback occurred (empty when first try succeeded). */\n attempts?: string[];\n /** 'stop' when complete; 'length' means the response was TRUNCATED by max_tokens. */\n finishReason?: string;\n usage?: {\n prompt_tokens: number;\n completion_tokens: number;\n total_tokens: number;\n finishReason?: string;\n};\n}\n\nexport class LlmClientError extends Error {\n constructor(\n message: string,\n public readonly status?: number,\n public readonly cause?: Error,\n ) {\n super(message);\n this.name = 'LlmClientError';\n }\n}\n\n/**\n * Create an LLM client from environment variables.\n */\n/**\n * Resolve the provider fallback chain from explicit config and environment.\n * Base order: explicit config > legacy LLM_API_KEY/OPENAI_API_KEY > NVIDIA NIM >\n * OpenRouter > DashScope/Alibaba MaaS. First entry is PRIMARY; the rest are\n * fallbacks tried in order.\n *\n * QUALITY-EVAL MODE: when OPENROUTER_MODEL is set (a paid preset), OpenRouter\n * is promoted to PRIMARY so generation quality is evaluated without free-tier\n * 429/403 noise. NVIDIA/dashscope then act only as safety-net fallbacks.\n */\nexport function resolveProviderChain(config?: LlmClientConfig): ProviderSpec[] {\n const chain: ProviderSpec[] = [];\n const push = (label: string, baseUrl: string, apiKey: string, model: string): void => {\n if (apiKey && baseUrl && model && !chain.some((c) => c.baseUrl === baseUrl && c.model === model)) {\n chain.push({ label, baseUrl, apiKey, model });\n }\n };\n // Explicit single-provider config keeps its historical meaning.\n if (config?.apiKey) {\n push('config', config.baseUrl || 'https://api.openai.com/v1', config.apiKey, config.model || 'gpt-4o-mini');\n }\n // Legacy generic env (knowledge-tree compatible: OPENAI_BASE_URL + LLM_MODEL).\n push('legacy', process.env.LLM_BASE_URL || process.env.OPENAI_BASE_URL || '', process.env.LLM_API_KEY || process.env.OPENAI_API_KEY || '', process.env.LLM_MODEL || process.env.LLM_TIER_FAST || '');\n // DashScope / Alibaba MaaS (OpenAI-compatible endpoints).\n push('dashscope', process.env.DASHSCOPE_BASE_URL || process.env.ALIBABA_BASE_URL || '', process.env.DASHSCOPE_API_KEY || process.env.ALIBABA_API_KEY || '', process.env.DASHSCOPE_MODEL || process.env.DEFAULT_AI_MODEL || '');\n // NVIDIA NIM — hosted provider for generation workloads.\n push('nvidia', 'https://integrate.api.nvidia.com/v1', process.env.NVIDIA_API_KEY || '', process.env.NVIDIA_MODEL || 'nvidia/nemotron-3-ultra-550b-a55b');\n // OpenRouter — paid preset primary when OPENROUTER_MODEL pins a model/preset.\n push('openrouter', 'https://openrouter.ai/api/v1', process.env.OPENROUTER_API_KEY || '', process.env.OPENROUTER_MODEL || 'nvidia/nemotron-3-ultra-550b-a55b');\n // QUALITY-EVAL MODE: paid OpenRouter preset goes FIRST (no 429 noise).\n if (process.env.OPENROUTER_MODEL) {\n const or = chain.find((c) => c.label === 'openrouter');\n if (or) {\n const rest = chain.filter((c) => c !== or);\n return [or, ...rest];\n }\n }\n return chain;\n}\n\n// Free-tier rate limits (NVIDIA NIM, OpenRouter) trip when a pipeline fires\n// many requests in a burst. Global pacing keeps us under the limit; a single\n// isolated call still goes through immediately.\nconst MIN_REQUEST_INTERVAL_MS = 2_500;\nlet lastRequestAt = 0;\n\nasync function pacedDelay(): Promise<void> {\n const wait = lastRequestAt + MIN_REQUEST_INTERVAL_MS - Date.now();\n if (wait > 0) await new Promise((resolve) => setTimeout(resolve, wait));\n lastRequestAt = Date.now();\n}\n\nexport function createLlmClient(config?: LlmClientConfig): LlmClient {\n const chain = resolveProviderChain(config);\n const primary = chain[0];\n if (!primary) {\n throw new LlmClientError(\n 'No LLM provider configured. Set NVIDIA_API_KEY (primary) and/or OPENROUTER_API_KEY (fallback), or pass llmConfig.',\n );\n }\n const apiKey = primary.apiKey;\n const baseUrl = primary.baseUrl;\n const model = primary.model;\n\n async function chat(\n messages: LlmChatMessage[],\n options?: { temperature?: number; maxTokens?: number },\n ): Promise<LlmChatResult> {\n const temperature = options?.temperature ?? config?.temperature ?? 0.1;\n const maxTokens = options?.maxTokens ?? config?.maxTokens ?? parseInt(process.env.LLM_MAX_TOKENS || '65536', 10);\n\n const attempts: string[] = [];\n let lastError: LlmClientError | null = null;\n const TRANSIENT = new Set([408, 429, 500, 502, 503, 504]);\n // Hard per-request cap so a hanging provider degrades to a transient error\n // and the chain falls through instead of blocking the pipeline forever.\n // Reasoning presets (e.g. deepseek-v4-flash) can legitimately think for\n // minutes on large structured outputs — 5 minutes default, env-overridable.\n const REQUEST_TIMEOUT_MS = Number(process.env.LLM_REQUEST_TIMEOUT_MS || 300_000);\n const MAX_CHAIN_ROUNDS = 3;\n for (let round = 1; round <= MAX_CHAIN_ROUNDS; round++) {\n if (round > 1) {\n // Whole chain failed transiently (rate limits / upstream 5xx) — back\n // off and rewalk the chain from the primary instead of dying.\n attempts.push('round ' + (round - 1) + ' failed — backing off 20s before rewalking the chain');\n await new Promise((resolve) => setTimeout(resolve, 20_000));\n }\n for (const provider of chain) {\n try {\n const headers = {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${provider.apiKey}`,\n };\n const payload = {\n model: provider.model,\n messages,\n temperature,\n max_tokens: maxTokens,\n };\n await pacedDelay();\n const doFetch = (): Promise<Response> => fetch(`${provider.baseUrl}/chat/completions`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${provider.apiKey}`,\n },\n body: JSON.stringify({\n model: provider.model,\n messages,\n temperature,\n max_tokens: maxTokens,\n }),\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n // Transient network failures (DNS blip, TLS reset, \"fetch failed\") get\n // one same-provider retry before falling through the chain.\n let response: Response;\n try {\n response = await doFetch();\n } catch (netErr) {\n attempts.push(`${provider.label}: network error (${netErr instanceof Error ? netErr.message : String(netErr)}) — retrying once`);\n await new Promise((r) => setTimeout(r, 5_000));\n lastRequestAt = Date.now();\n response = await doFetch();\n }\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n const err = new LlmClientError(\n `[${provider.label}] LLM API error: ${response.status} ${response.statusText} — ${body.slice(0, 200)}`,\n response.status,\n );\n if (response.status === 429) {\n // Rate-limited: honor Retry-After (bounded) and retry once on the\n // same provider before falling through to the next one.\n const retryAfterRaw = response.headers.get('retry-after');\n const retryAfterMs = Math.min(\n 60_000,\n Math.max(15_000, (Number.isFinite(Number(retryAfterRaw)) ? Number(retryAfterRaw) : 20) * 1_000),\n );\n attempts.push(`${provider.label}: 429 rate-limited — backing off ${Math.round(retryAfterMs / 1000)}s`);\n await new Promise((resolve) => setTimeout(resolve, retryAfterMs));\n lastRequestAt = Date.now();\n const retry = await fetch(`${provider.baseUrl}/chat/completions`, {\n method: 'POST',\n headers,\n body: JSON.stringify(payload),\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n if (!retry.ok) throw err;\n const retryData = await retry.json() as {\n choices?: Array<{ message?: { content?: string }; finish_reason?: string }>;\n model?: string;\n usage?: { prompt_tokens: number; completion_tokens: number; total_tokens: number };\n };\n const retryContent2 = retryData.choices?.[0]?.message?.content || '';\n if (!retryContent2.trim()) throw err;\n return {\n content: retryContent2,\n model: retryData.model || provider.model,\n provider: provider.label,\n attempts: attempts.slice(),\n usage: retryData.usage,\n finishReason: retryData.choices?.[0]?.finish_reason,\n };\n }\n if (TRANSIENT.has(response.status)) {\n await new Promise((r) => setTimeout(r, 3000));\n const retry = await fetch(`${provider.baseUrl}/chat/completions`, {\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${provider.apiKey}`,\n },\n body: JSON.stringify({\n model: provider.model,\n messages,\n temperature,\n max_tokens: maxTokens,\n }),\n });\n if (!retry.ok) throw err; // still transient-failing — fall through to next provider\n const retryData = await retry.json() as {\n choices?: Array<{ message?: { content?: string }; finish_reason?: string }>;\n model?: string;\n usage?: { prompt_tokens: number; completion_tokens: number; total_tokens: number };\n };\n const retryContent = retryData.choices?.[0]?.message?.content || '';\n return {\n content: retryContent,\n model: retryData.model || provider.model,\n provider: provider.label,\n attempts: attempts.slice(),\n usage: retryData.usage,\n finishReason: retryData.choices?.[0]?.finish_reason,\n };\n }\n throw err;\n }\n const data = await response.json() as {\n choices?: Array<{ message?: { content?: string }; finish_reason?: string }>;\n model?: string;\n usage?: { prompt_tokens: number; completion_tokens: number; total_tokens: number };\n };\n const wrappedError = (data as { error?: { message?: string; code?: number } }).error;\n if (wrappedError) {\n // OpenRouter proxies some upstream failures as HTTP 200 with an\n // {\"error\": {...}} body — treat as transient and fall through.\n throw new LlmClientError('[' + provider.label + '] upstream error ' + (wrappedError.code ?? '') + ': ' + (wrappedError.message ?? 'unknown'));\n }\n const content = data.choices?.[0]?.message?.content || '';\n if (!content.trim()) {\n // Empty completion (provider outage / content filter) is transient —\n // fall through to the next provider instead of returning unusable ''.\n throw new LlmClientError('[' + provider.label + '] empty completion returned');\n }\n return {\n content,\n model: data.model || provider.model,\n provider: provider.label,\n attempts: attempts.slice(),\n usage: data.usage,\n finishReason: data.choices?.[0]?.finish_reason,\n };\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n attempts.push(`${provider.label}: ${msg}`);\n lastError = err instanceof LlmClientError ? err : new LlmClientError(`[${provider.label}] ${msg}`);\n // try next provider\n }\n }\n if (round < MAX_CHAIN_ROUNDS) continue; // rewalk the chain\n throw lastError ?? new LlmClientError('All LLM providers failed (empty chain).');\n }\n throw lastError ?? new LlmClientError('All LLM providers failed after ' + MAX_CHAIN_ROUNDS + ' rounds.');\n }\n\n return { chat, model };\n}\n\n/**\n * Parse JSON from LLM response, handling markdown code fences.\n */\nexport function parseJsonFromLlm(text: string): Record<string, unknown> {\n // Strip markdown code fences if present\n let cleaned = text.trim();\n if (cleaned.startsWith('```json')) {\n cleaned = cleaned.slice(7);\n } else if (cleaned.startsWith('```')) {\n cleaned = cleaned.slice(3);\n }\n if (cleaned.endsWith('```')) {\n cleaned = cleaned.slice(0, -3);\n }\n cleaned = cleaned.trim();\n\n try {\n return JSON.parse(cleaned) as Record<string, unknown>;\n } catch {\n // Try to find first complete JSON object using brace-depth tracking\n const start = cleaned.indexOf('{');\n if (start >= 0) {\n let depth = 0;\n let inString = false;\n let escape = false;\n for (let i = start; i < cleaned.length; i++) {\n const ch = cleaned[i];\n if (escape) { escape = false; continue; }\n if (ch === '\\\\') { escape = true; continue; }\n if (ch === '\"') { inString = !inString; continue; }\n if (inString) continue;\n if (ch === '{') depth++;\n if (ch === '}') {\n depth--;\n if (depth === 0) {\n try {\n return JSON.parse(cleaned.slice(start, i + 1)) as Record<string, unknown>;\n } catch {\n // keep looking\n }\n }\n }\n }\n }\n throw new LlmClientError(`Failed to parse JSON from LLM response: ${cleaned.slice(0, 200)}`);\n }\n}\n\n/**\n * Call LLM and parse JSON response.\n */\nexport async function llmChatJson(\n client: ReturnType<typeof createLlmClient>,\n systemPrompt: string,\n userPrompt: string,\n options?: { temperature?: number; maxTokens?: number },\n): Promise<Record<string, unknown>> {\n const result = await client.chat(\n [\n { role: 'system', content: systemPrompt },\n { role: 'user', content: userPrompt },\n ],\n options,\n );\n\n return parseJsonFromLlm(result.content);\n}\n","/**\n * STEP C0: Extract FOUNDATION & SETUP feature (F0) via LLM.\n *\n * Ported from knowledge-tree/llm_project_graph.py extract_scaffold_llm()\n * The F0 feature covers MUST-KNOW steps before the first feature:\n * tools, project creation, minimal programming knowledge, repo map, dev loop.\n */\n\nimport { createLlmClient, llmChatJson, type LlmClientConfig } from '../utils/llmClient';\nimport type { Feature } from '../schemas/projectGraphSchema';\n\nexport interface ExtractScaffoldOptions {\n goal: string;\n techStack: string;\n fileList: string[];\n llmConfig?: LlmClientConfig;\n}\n\n/**\n * Extract the FOUNDATION & SETUP feature (F0) via LLM.\n * Returns a Feature with steps covering tool setup, project creation,\n * minimal programming knowledge, repo map, and dev loop.\n */\nexport async function extractScaffold(options: ExtractScaffoldOptions): Promise<Feature | null> {\n const { goal, techStack, fileList, llmConfig } = options;\n const client = createLlmClient(llmConfig);\n const fileListStr = fileList.length > 0 ? fileList.join('\\n') : '(empty)';\n\n const systemPrompt = (\n 'You are a programming pedagogy expert. For ONE concrete project, extract the '\n + \"'FOUNDATION & SETUP' feature (id F0) — the COMPLETE set of 'MUST-KNOW' steps \"\n + 'the learner needs before studying the first feature. Break it into concrete ACTION '\n + 'steps (5-8 steps), each with completion_level=\\'base\\'. Include:\\n'\n + '1. Tools required for this tech stack (IDE, simulator/emulator, terminal, git, '\n + 'package manager) + basic operations (open project, build, run, debug, commit).\\n'\n + '2. Create the initial project: from a template OR clone/open the base-project (the provided repo).\\n'\n + '3. MINIMAL programming knowledge of the language (variables, types, functions, if/for, view declaration) '\n + '+ build one small demo (e.g. a single-screen Hello World app) BEFORE touching the real project.\\n'\n + '4. Repo map of the actual project: folder structure, entry point, how to build/run, main architecture '\n + '(MVVM/Flux...), important packages/modules.\\n'\n + '5. Development loop (build->run->see result->debug), how to read/fix basic compile errors, '\n + 'minimal git workflow (clone/branch/commit/push).\\n'\n + 'keywords[]: real tool/language terms (e.g. \\'Xcode\\', \\'Simulator\\', \\'Git\\', \\'Swift\\', '\n + '\\'@main\\', \\'MVVM\\'). files[]: leave [] or use real paths if the step touches specific files. '\n + 'description: ONE concise sentence, MAX 140 characters. '\n + 'intent: WHY this step matters. outcome: {user_visible: string, technical: string}. '\n + 'acceptance[]: 2 verifiable criteria. effort: {estimated_minutes: number, complexity: low|medium|high}. '\n + 'NEVER invent. ALL text must be in ENGLISH (technical terms stay as-is). '\n + 'Return JSON containing only feature F0.'\n );\n\n const userPrompt = (\n `App goal: ${goal}\\n`\n + `Tech stack: ${techStack}\\n\\n`\n + 'PROJECT FILE LIST (base-project):\\n'\n + `${fileListStr}\\n\\n`\n + 'Return JSON:\\n'\n + '{\\n'\n + ' \"feature\": {\\n'\n + ' \"id\": \"F0\",\\n'\n + ' \"name\": \"FOUNDATION & SETUP\",\\n'\n + ' \"description\": \"Get familiar with the tools, create/clone the project, learn minimal knowledge and the repo map\",\\n'\n + ' \"platform\": \"app\",\\n'\n + ' \"steps\": [\\n'\n + ' {\\n'\n + ' \"id\": \"F0-S1\",\\n'\n + ' \"sequence\": 1,\\n'\n + ' \"name\": \"Action step name\",\\n'\n + ' \"description\": \"Detailed description of the concrete actions\",\\n'\n + ' \"files\": [],\\n'\n + ' \"api_usage\": [],\\n'\n + ' \"keywords\": [\"Xcode\", \"Terminal\"],\\n'\n + ' \"completion_level\": \"base\",\\n'\n + ' \"intent\": \"Learn how to setup the IDE and run a minimal Swift app\",\\n'\n + ' \"outcome\": {\"user_visible\": \"App builds and runs\", \"technical\": \"Toolchain verified\"},\\n'\n + ' \"acceptance\": [\"Xcode builds without errors\", \"Simulator launches successfully\"],\\n'\n + ' \"effort\": {\"estimated_minutes\": 20, \"complexity\": \"low\"}\\n'\n + ' }\\n'\n + ' ]\\n'\n + ' }\\n'\n + '}\\n'\n );\n\n try {\n const result = await llmChatJson(client, systemPrompt, userPrompt, {\n temperature: 0.1,\n maxTokens: parseInt(process.env.PG_C0_MAX_TOKENS || '16384', 10),\n });\n\n const feat = result.feature as Record<string, unknown> | undefined;\n if (!feat || !Array.isArray(feat.steps) || feat.steps.length === 0) {\n console.warn('[WARN] Scaffold LLM returned no steps — skipping F0');\n return null;\n }\n\n // Normalize step IDs and ensure required fields\n const steps = (feat.steps as Record<string, unknown>[]).map((s, i) => ({\n id: `F0-S${i + 1}`,\n sequence: i + 1,\n name: String(s.name || `Step ${i + 1}`),\n description: String(s.description || ''),\n files: Array.isArray(s.files) ? s.files : [],\n api_usage: Array.isArray(s.api_usage) ? s.api_usage : [],\n keywords: Array.isArray(s.keywords) ? s.keywords : [],\n completion_level: 'base' as const,\n platform: String(s.platform || 'app'),\n intent: String(s.intent || ''),\n outcome: s.outcome && typeof s.outcome === 'object' ? s.outcome as { user_visible?: string; technical?: string } : undefined,\n acceptance: Array.isArray(s.acceptance) ? s.acceptance : [],\n effort: s.effort && typeof s.effort === 'object' ? s.effort as { estimated_minutes?: number; complexity?: 'low' | 'medium' | 'high' } : undefined,\n requirement_ids: [] as string[],\n concept_codes: [] as string[],\n }));\n\n return {\n id: 'F0',\n name: String(feat.name || 'FOUNDATION & SETUP'),\n description: String(feat.description || ''),\n platform: String(feat.platform || 'app'),\n steps,\n } as Feature;\n } catch (err) {\n console.error(`[ERROR] extractScaffold failed: ${err}`);\n return null;\n }\n}\n","/**\n * STEP C1: Extract PROJECT OVERVIEW via LLM (features meta — NO steps).\n *\n * Ported from knowledge-tree/llm_project_graph.py extract_project_overview_llm()\n * Output: project, product, features[], user_journeys, architecture, decomposition.\n */\n\nimport { createLlmClient, llmChatJson, type LlmClientConfig } from '../utils/llmClient';\nimport type { Keyword } from '../extractors/keywordExtractor';\n\nexport interface ExtractOverviewOptions {\n goal: string;\n techStack: string;\n sdkApiIndex: { sdk_apis: Array<{ name: string; kind: string; used_in_demo: boolean }> };\n fileContentsMap: Map<string, string>;\n astKeywords?: Keyword[];\n llmConfig?: LlmClientConfig;\n}\n\nfunction buildSourceText(fileContentsMap: Map<string, string>): string {\n const blocks: string[] = [];\n for (const [relPath, content] of fileContentsMap) {\n blocks.push(`### FILE: ${relPath}\\n${content}`);\n }\n return blocks.join('\\n\\n');\n}\n\n/**\n * Extract project overview (features meta) via LLM.\n * Does NOT include steps — those are extracted per-feature in STEP C2.\n */\nexport async function extractProjectOverview(options: ExtractOverviewOptions): Promise<Record<string, unknown>> {\n const { goal, techStack, sdkApiIndex, fileContentsMap, astKeywords, llmConfig } = options;\n const client = createLlmClient(llmConfig);\n\n const usedSdkApis = sdkApiIndex.sdk_apis\n .filter(api => api.used_in_demo)\n .map(api => api.name)\n .slice(0, 2000);\n\n const allFilesStr = buildSourceText(fileContentsMap);\n\n // Build AST keywords anchor\n let keywordsAnchor = '';\n if (astKeywords && astKeywords.length > 0) {\n const kwItems = astKeywords.slice(0, 30).map(kw =>\n `- ${kw.keyword} (from ${kw.source})`,\n );\n if (kwItems.length > 0) {\n keywordsAnchor = (\n '\\nAST Domain Keywords & Patterns (from static analysis — use as context anchor):\\n'\n + kwItems.join('\\n')\n + '\\n'\n );\n }\n }\n\n const systemPrompt = (\n 'You are a software architect. The app the user will build IS EXACTLY the provided files '\n + '(not an SDK/lib). Analyze them and return a PROJECT OVERVIEW — meta only, '\n + 'DO NOT list steps (steps are handled in a later step). '\n + 'NEVER invent files/APIs. NEVER reference internal SDK/lib unless it appears in the given files.\\n'\n + 'END-USER VIEW (M1/Design Thinking): product.purpose must describe the USER PROBLEM '\n + '(what the user does with the app, which need it solves). NEVER describe repo/artifacts.\\n'\n + 'DEVELOPMENT STAGES: Include 4-6 development stages in product.development_stages. '\n + 'Each stage must have: stage (name), need (list of feature needs), learn (concepts learned), '\n + 'product_state (what works), temporary_approach, and validation.\\n'\n + 'MISSING GAPS: Identify 0-5 missing_gaps (features/functionality that should exist but don\\'t).\\n'\n + 'TECH DEBT: Identify 0-5 tech_debt issues (code quality problems).\\n'\n + 'ALL text must be in ENGLISH.'\n );\n\n const userPrompt = `App goal: ${goal}\nTech stack: ${techStack}\n${keywordsAnchor}\nFiltered SDK API list (used_in_demo):\n${JSON.stringify(usedSdkApis, null, 0)}\n\nSource code of the files:\n${allFilesStr}\n\nReturn JSON per the schema:\n{\n \"schema_version\": 2,\n \"project\": {\"name\": \"...\", \"project_type\": \"app\", \"platforms\": [\"ios\"]},\n \"product\": {\n \"purpose\": \"END-USER problem being solved\",\n \"problem_statement\": \"Core user problem\",\n \"primary_users\": [\"who the main users are\"],\n \"development_stages\": [\n {\n \"stage\": \"Stage 1: Foundation & Setup\",\n \"need\": [\"Core app shell\"],\n \"learn\": [\"App lifecycle, basic UI\"],\n \"product_state\": \"App launches with static mock data\",\n \"temporary_approach\": \"Hardcoded array\",\n \"validation\": \"Main screen loads\"\n }\n ],\n \"features\": [\n {\"id\": \"F1\", \"name\": \"Feature name\", \"description\": \"Feature description\", \"platform\": \"ios\"}\n ],\n \"user_journeys\": [{\"name\": \"...\", \"feature_ids\": [\"F1\"]}]\n },\n \"architecture\": {\"layers\": [], \"services\": [], \"state_management\": \"...\"},\n \"decomposition\": {\"milestones\": [{\"id\": \"M1\", \"phase\": \"MVP\", \"name\": \"...\", \"goal\": \"...\", \"feature_ids\": [\"F1\"]}]}\n}`;\n\n const result = await llmChatJson(client, systemPrompt, userPrompt, {\n temperature: 0.1,\n maxTokens: parseInt(process.env.PG_C1_MAX_TOKENS || '32768', 10),\n });\n\n // Ensure development_stages exists\n const prod = result.product as Record<string, unknown> | undefined;\n if (prod && !Array.isArray(prod.development_stages)) {\n prod.development_stages = [];\n }\n\n return result;\n}\n","/**\n * STEP C2: Extract feature STEPS via LLM.\n *\n * Ported from knowledge-tree/llm_project_graph.py\n * - extract_feature_steps_llm() — single feature\n * - extract_feature_steps_batched() — batch of features\n */\n\nimport { createLlmClient, llmChatJson, type LlmClientConfig } from '../utils/llmClient';\nimport type { Feature, Step } from '../schemas/projectGraphSchema';\n\nexport interface ExtractStepsOptions {\n goal: string;\n techStack: string;\n sdkApiIndex: { sdk_apis: Array<{ name: string; kind: string; used_in_demo: boolean }> };\n fileContentsMap: Map<string, string>;\n feature: Feature;\n llmConfig?: LlmClientConfig;\n}\n\nfunction buildSourceText(fileContentsMap: Map<string, string>): string {\n const blocks: string[] = [];\n for (const [relPath, content] of fileContentsMap) {\n blocks.push(`### FILE: ${relPath}\\n${content}`);\n }\n return blocks.join('\\n\\n');\n}\n\n/**\n * Extract steps for a SINGLE feature via LLM.\n */\nexport async function extractFeatureSteps(options: ExtractStepsOptions): Promise<Step[]> {\n const { goal, techStack, sdkApiIndex, fileContentsMap, feature, llmConfig } = options;\n const client = createLlmClient(llmConfig);\n\n const usedSdkApis = sdkApiIndex.sdk_apis\n .filter(api => api.used_in_demo)\n .map(api => api.name)\n .slice(0, 2000);\n\n const allFilesStr = buildSourceText(fileContentsMap);\n const fid = feature.id || 'F_UNK';\n const fname = feature.name || fid;\n const fdesc = feature.description || '';\n\n const systemPrompt = (\n 'You are a software architect. Split ONE feature into ACTION steps '\n + '(implementation steps) the learner must code sequentially. Each step must carry '\n + 'files[] (CORRECT paths in the source), api_usage[] (only from the provided SDK API index), '\n + 'keywords[] (real terms/language features in the files), '\n + 'and completion_level ∈ {base, mvp, extend, polish}.\\n'\n + ' - base = foundation/setup\\n'\n + ' - mvp = make the app minimally WORKING for this feature\\n'\n + ' - extend = make it real/richer\\n'\n + ' - polish = robustness (error handling, tests, validation)\\n'\n + 'Include metadata: intent, outcome ({user_visible, technical}), '\n + 'acceptance[] (2 verifiable criteria), effort ({estimated_minutes, complexity}).\\n'\n + 'description: ONE concise sentence, MAX 140 characters. '\n + 'NEVER invent files/APIs. Return ONLY the steps array. '\n + 'ALL text must be in ENGLISH.'\n );\n\n const userPrompt = `App goal: ${goal}\nTech stack: ${techStack}\n\nFEATURE TO SPLIT: ${fid} — ${fname}\nFeature description: ${fdesc}\n\nSDK API list (used_in_demo):\n${JSON.stringify(usedSdkApis)}\n\nSource code:\n${allFilesStr}\n\nSplit this feature into 2-6 action steps. Return JSON:\n{\n \"steps\": [\n {\n \"id\": \"${fid}-S1\",\n \"sequence\": 1,\n \"name\": \"Action step name\",\n \"description\": \"One concise sentence (max 140 chars)\",\n \"files\": [\"path/to/file.swift\"],\n \"api_usage\": [\"ChatClient\"],\n \"keywords\": [\"@State\", \"NavigationStack\"],\n \"completion_level\": \"mvp\",\n \"intent\": \"Create reactive state container\",\n \"outcome\": {\"user_visible\": \"Chat view updates\", \"technical\": \"ChatViewModel conforms to ObservableObject\"},\n \"acceptance\": [\"ViewModel publishes messages\", \"UI re-renders on state mutation\"],\n \"effort\": {\"estimated_minutes\": 30, \"complexity\": \"medium\"}\n }\n ]\n}`;\n\n const result = await llmChatJson(client, systemPrompt, userPrompt, {\n temperature: 0.1,\n maxTokens: parseInt(process.env.PG_C2_MAX_TOKENS || '32768', 10),\n });\n\n const rawSteps = (result.steps || []) as Record<string, unknown>[];\n // Clamp to 2-6 steps per prompt contract\n const clampedSteps = rawSteps.length > 6 ? rawSteps.slice(0, 6) : rawSteps.length < 2 && rawSteps.length > 0 ? rawSteps : rawSteps;\n if (rawSteps.length > 6) {\n console.warn(`[WARN] LLM returned ${rawSteps.length} steps for ${fid}, clamped to 6`);\n } else if (rawSteps.length === 0) {\n console.warn(`[WARN] LLM returned 0 steps for ${fid}`);\n }\n return clampedSteps.map((s, i) => ({\n id: `${fid}-S${i + 1}`,\n sequence: i + 1,\n name: String(s.name || `Step ${i + 1}`),\n description: String(s.description || ''),\n files: Array.isArray(s.files) ? s.files as string[] : [],\n api_usage: Array.isArray(s.api_usage) ? s.api_usage as string[] : [],\n keywords: Array.isArray(s.keywords) ? s.keywords as string[] : [],\n completion_level: (String(s.completion_level || 'mvp') as 'base' | 'mvp' | 'extend' | 'polish'),\n platform: String(s.platform || feature.platform || 'app'),\n intent: String(s.intent || ''),\n outcome: s.outcome as Step['outcome'],\n acceptance: Array.isArray(s.acceptance) ? s.acceptance as string[] : [],\n effort: s.effort as Step['effort'],\n requirement_ids: [],\n concept_codes: [],\n }));\n}\n\n/**\n * Extract steps for MULTIPLE features in a single LLM call.\n */\nexport async function extractFeatureStepsBatched(\n goal: string,\n techStack: string,\n sdkApiIndex: { sdk_apis: Array<{ name: string; kind: string; used_in_demo: boolean }> },\n fileContentsMap: Map<string, string>,\n featuresMeta: Feature[],\n llmConfig?: LlmClientConfig,\n): Promise<Map<string, Step[]>> {\n const client = createLlmClient(llmConfig);\n\n const usedSdkApis = sdkApiIndex.sdk_apis\n .filter(api => api.used_in_demo)\n .map(api => api.name)\n .slice(0, 2000);\n\n const sourceText = buildSourceText(fileContentsMap);\n\n const featuresListing = featuresMeta.map(f =>\n `- ${f.id || 'F?'}: ${f.name || ''} — ${f.description || ''}`,\n ).join('\\n');\n\n const systemPrompt = (\n 'You are a software architect. Split MULTIPLE features into ACTION steps. '\n + 'Each step must carry files[], api_usage[], keywords[], and '\n + 'completion_level ∈ {base, mvp, extend, polish}. '\n + 'Include metadata: intent, outcome ({user_visible, technical}), '\n + 'acceptance[] (2 verifiable criteria), effort ({estimated_minutes, complexity}). '\n + 'description: ONE concise sentence, MAX 140 characters. '\n + 'NEVER invent files/APIs. Return ONLY the JSON. '\n + 'ALL text must be in ENGLISH.'\n );\n\n const userPrompt = `App goal: ${goal}\nTech stack: ${techStack}\n\nSDK API list (used_in_demo):\n${JSON.stringify(usedSdkApis)}\n\nSource code:\n${sourceText}\n\nFEATURES to split into steps:\n${featuresListing}\n\nFor EACH feature above, produce 4-6 action steps. Each step must include:\nid, sequence, name, description, files, api_usage, keywords, completion_level, platform,\nintent, outcome ({user_visible, technical}), acceptance[] (2 criteria), effort ({estimated_minutes, complexity}).\n\nReturn JSON with a \"steps\" dict keyed by feature_id:\n{\n \"steps\": {\n \"<feature_id>\": [\n {\n \"id\": \"<feature_id>-S1\",\n \"sequence\": 1,\n \"name\": \"Step name\",\n \"description\": \"Concise sentence (max 140 chars)\",\n \"files\": [\"path/to/file\"],\n \"api_usage\": [\"APIName\"],\n \"keywords\": [\"keyword\"],\n \"completion_level\": \"mvp\",\n \"platform\": \"app\",\n \"intent\": \"Step intent\",\n \"outcome\": {\"user_visible\": \"User visible result\", \"technical\": \"Technical result\"},\n \"acceptance\": [\"Criterion 1\", \"Criterion 2\"],\n \"effort\": {\"estimated_minutes\": 30, \"complexity\": \"medium\"}\n }\n ]\n }\n}`;\n\n const result = await llmChatJson(client, systemPrompt, userPrompt, {\n temperature: 0.1,\n maxTokens: parseInt(process.env.PG_C2_MAX_TOKENS || '32768', 10),\n });\n\n const stepsDict = result.steps as Record<string, Record<string, unknown>[]> | undefined;\n const output = new Map<string, Step[]>();\n\n if (stepsDict && typeof stepsDict === 'object') {\n for (const [fid, rawSteps] of Object.entries(stepsDict)) {\n if (!Array.isArray(rawSteps)) continue;\n const featMeta = featuresMeta.find(f => f.id === fid);\n const steps = rawSteps.map((s, i) => ({\n id: `${fid}-S${i + 1}`,\n sequence: i + 1,\n name: String(s.name || `Step ${i + 1}`),\n description: String(s.description || ''),\n files: Array.isArray(s.files) ? s.files as string[] : [],\n api_usage: Array.isArray(s.api_usage) ? s.api_usage as string[] : [],\n keywords: Array.isArray(s.keywords) ? s.keywords as string[] : [],\n completion_level: (String(s.completion_level || 'mvp') as 'base' | 'mvp' | 'extend' | 'polish'),\n platform: String(s.platform || featMeta?.platform || 'app'),\n intent: String(s.intent || ''),\n outcome: s.outcome as Step['outcome'],\n acceptance: Array.isArray(s.acceptance) ? s.acceptance as string[] : [],\n effort: s.effort as Step['effort'],\n requirement_ids: [],\n concept_codes: [],\n }));\n output.set(fid, steps);\n }\n }\n\n return output;\n}\n","/**\n * STEP D: Ground-truth verification of project graph against code and SDK API index.\n *\n * Ported from knowledge-tree/llm_project_graph.py verify_project_graph()\n * Removes invalid files, APIs, keywords and logs hallucinations.\n */\n\nimport type { ProjectGraph, Feature, Step } from '../schemas/projectGraphSchema';\n\nexport interface Hallucination {\n type: string;\n item: string;\n feature_id: string;\n step_id: string;\n reason: string;\n}\n\nexport interface VerifyOptions {\n repoDir: string;\n sdkApiIndex: { sdk_apis: Array<{ name: string; kind: string; used_in_demo: boolean }> };\n fileContentsMap: Map<string, string>;\n}\n\n/**\n * Verify project graph against actual code. Remove hallucinated files, APIs, keywords.\n * F0 (foundation) keywords are kept as-is since they are pedagogical terms.\n */\nexport function verifyProjectGraph(\n projectGraph: ProjectGraph,\n options: VerifyOptions,\n): { graph: ProjectGraph; hallucinations: Hallucination[] } {\n const { sdkApiIndex, fileContentsMap } = options;\n const sdkApiNames = new Set(sdkApiIndex.sdk_apis.map(api => api.name));\n const hallucinations: Hallucination[] = [];\n\n const features = projectGraph.features || [];\n\n for (const feature of features) {\n const fid = feature.id || 'F_UNK';\n const isFoundation = fid === 'F0';\n\n for (const step of feature.steps || []) {\n const sid = step.id || `${fid}-SUNK`;\n\n // Verify files[]\n const validFiles: string[] = [];\n for (const f of step.files || []) {\n if (fileContentsMap.has(f)) {\n validFiles.push(f);\n } else {\n hallucinations.push({\n type: 'file',\n item: f,\n feature_id: fid,\n step_id: sid,\n reason: `File '${f}' not found in repository`,\n });\n }\n }\n step.files = validFiles;\n\n // Verify api_usage[]\n const validApis: string[] = [];\n for (const api of step.api_usage || []) {\n if (sdkApiNames.size === 0 || sdkApiNames.has(api)) {\n validApis.push(api);\n } else {\n hallucinations.push({\n type: 'api',\n item: api,\n feature_id: fid,\n step_id: sid,\n reason: `API '${api}' not found in SDK API index`,\n });\n }\n }\n step.api_usage = validApis;\n\n // Verify keywords[] — skip for F0 (foundation keywords are pedagogical)\n if (isFoundation) continue;\n\n const validKws: string[] = [];\n for (const kw of step.keywords || []) {\n const kwLow = kw.toLowerCase();\n // Single-word keywords: use word boundary match to avoid\n // false positives (\"app\" should NOT match \"mapping\" or \"happen\")\n const isSingleWord = !kwLow.includes(' ');\n let found = false;\n // Check in step's files\n for (const f of validFiles) {\n const content = (fileContentsMap.get(f) || '').toLowerCase();\n if (isSingleWord) {\n found = new RegExp(`\\\\b${kwLow.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}\\\\b`).test(content);\n } else {\n found = content.includes(kwLow);\n }\n if (found) break;\n }\n // Check in any file\n if (!found) {\n for (const content of fileContentsMap.values()) {\n const lc = content.toLowerCase();\n if (isSingleWord) {\n found = new RegExp(`\\\\b${kwLow.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}\\\\b`).test(lc);\n } else {\n found = lc.includes(kwLow);\n }\n if (found) break;\n }\n }\n\n if (found) {\n validKws.push(kw);\n } else {\n hallucinations.push({\n type: 'keyword',\n item: kw,\n feature_id: fid,\n step_id: sid,\n reason: `Keyword '${kw}' not found in target files`,\n });\n }\n }\n step.keywords = validKws;\n }\n }\n\n return { graph: projectGraph, hallucinations };\n}\n","/**\n * STEP E: Escalate keywords/api_usage to neutral concepts + ULO/CIO/SIO depth + evidence files join.\n *\n * Ported from knowledge-tree/llm_project_graph.py escalate_and_map_concepts()\n * Maps concrete keywords to technology-neutral concept codes WITH depth levels.\n *\n * ULO/CIO/SIO model:\n * - ULO: WHAT + WHY — concept is introduced (what it is, why it exists)\n * - CIO: HOW — mechanism is explained (how it works)\n * - SIO: IMPLEMENTATION — concrete tech-specific usage (syntax, API)\n */\n\nimport { createLlmClient, llmChatJson, type LlmClientConfig } from '../utils/llmClient';\nimport type { ProjectGraph, Feature } from '../schemas/projectGraphSchema';\n\nexport interface ConceptMapping {\n concept_code: string;\n concept_name: string;\n keyword: string;\n depth: 'ulo' | 'cio' | 'sio';\n depth_rationale: string;\n evidence_files: string[];\n}\n\nexport interface EscalateOptions {\n projectGraph: ProjectGraph;\n fileContentsMap: Map<string, string>;\n availableConcepts?: string[];\n conceptMapOverride?: Record<string, { concept_code: string; concept_name: string; depth?: string }>;\n llmConfig?: LlmClientConfig;\n}\n\nfunction toUpperSnake(term: string): string {\n let s = term.replace(/^[^\\w]+/, '');\n s = s.replace(/([a-z0-9])([A-Z])/g, '$1_$2');\n s = s.replace(/[^\\w]+/g, '_');\n const res = s.toUpperCase().replace(/^_+|_+$/g, '');\n return res || 'CONCEPT';\n}\n\nfunction extractTermSnippets(term: string, fileContentsMap: Map<string, string>, maxSnippets = 1): string[] {\n const snippets: string[] = [];\n const termLow = term.toLowerCase();\n for (const [relPath, content] of fileContentsMap) {\n const lines = content.split('\\n');\n for (let idx = 0; idx < lines.length; idx++) {\n if (lines[idx].toLowerCase().includes(termLow)) {\n const start = Math.max(0, idx - 1);\n const end = Math.min(lines.length, idx + 2);\n let snippet = lines.slice(start, end).map(l => l.trim()).filter(Boolean).join(' ');\n if (snippet.length > 120) snippet = snippet.slice(0, 120) + '...';\n if (snippet) snippets.push(`[${relPath}]: ${snippet}`);\n if (snippets.length >= maxSnippets) break;\n }\n }\n if (snippets.length >= maxSnippets) break;\n }\n return snippets;\n}\n\n/**\n * Determine ULO/CIO/SIO depth based on keyword usage context.\n */\nfunction inferDepthFromContext(\n keyword: string,\n fileContentsMap: Map<string, string>,\n): { depth: 'ulo' | 'cio' | 'sio'; rationale: string } {\n const kw = keyword.toLowerCase();\n\n // SIO: specific implementation keywords (API names, decorators, syntax)\n const sioPatterns = [\n /^@/, // SwiftUI decorators: @State, @Binding\n /^import\\s/, // Import statements\n /\\(\\)$/, // Function calls\n /\\.prototype/, // Prototype methods\n /^new\\s/, // Constructor calls\n /^async\\s/, // Async keywords\n /^await\\s/,\n ];\n\n if (sioPatterns.some(p => p.test(keyword))) {\n return { depth: 'sio', rationale: `Keyword '${keyword}' is a specific API/syntax pattern` };\n }\n\n // CIO: mechanism-level keywords (patterns, protocols, design patterns)\n const cioPatterns = [\n /pattern/i, /protocol/i, /architecture/i, /lifecycle/i,\n /observer/i, /singleton/i, /factory/i, /delegate/i,\n /state\\s*management/i, /data\\s*flow/i, /binding/i,\n /mvvm/i, /mvc/i, /flux/i, /redux/i,\n /authentication/i, /authorization/i,\n /persistence/i, /caching/i, /serialization/i,\n ];\n\n if (cioPatterns.some(p => p.test(keyword))) {\n return { depth: 'cio', rationale: `Keyword '${keyword}' represents a mechanism/pattern` };\n }\n\n // ULO: general concept keywords (what/why level)\n const uloPatterns = [\n /design\\s*thinking/i, /user\\s*needs/i, /problem\\s*statement/i,\n /foundation/i, /setup/i, /overview/i, /introduction/i,\n /scaffold/i, /hello\\s*world/i, /getting\\s*started/i,\n ];\n\n if (uloPatterns.some(p => p.test(keyword))) {\n return { depth: 'ulo', rationale: `Keyword '${keyword}' is a foundational/introductory concept` };\n }\n\n // Default: check evidence in code — if it appears in import/declaration → SIO, in comment → ULO\n for (const content of fileContentsMap.values()) {\n const lines = content.split('\\n');\n for (const line of lines) {\n if (line.toLowerCase().includes(kw)) {\n if (/^(import|from|require|use |#include)/.test(line.trim())) {\n return { depth: 'sio', rationale: `Keyword '${keyword}' found in import statement` };\n }\n if (/^\\/\\/|^\\/\\*|^#|^-->/.test(line.trim())) {\n return { depth: 'ulo', rationale: `Keyword '${keyword}' found in comment/doc` };\n }\n // Found in code body → likely SIO\n return { depth: 'sio', rationale: `Keyword '${keyword}' used in implementation code` };\n }\n }\n }\n\n return { depth: 'sio', rationale: `Default: treating '${keyword}' as SIO (implementation-level)` };\n}\n\n/**\n * Escalate keywords/api_usage to neutral concepts with ULO/CIO/SIO depth and join evidence files.\n */\nexport async function escalateAndMapConcepts(\n options: EscalateOptions,\n): Promise<Map<string, ConceptMapping[]>> {\n const { projectGraph, fileContentsMap, availableConcepts, conceptMapOverride, llmConfig } = options;\n\n const features = projectGraph.features || [];\n\n // Collect all terms from all features\n const allTerms = new Set<string>();\n for (const feature of features) {\n for (const step of feature.steps || []) {\n for (const api of step.api_usage || []) allTerms.add(api);\n for (const kw of step.keywords || []) allTerms.add(kw);\n }\n }\n\n if (allTerms.size === 0) return new Map();\n\n const termList = Array.from(allTerms).sort();\n let llmResults: Record<string, { concept_code?: string; concept_name?: string; depth?: string }> = {};\n\n if (conceptMapOverride) {\n llmResults = conceptMapOverride;\n } else {\n try {\n const client = createLlmClient(llmConfig);\n const conceptBank = (availableConcepts || []).sort().join(', ') || '(empty)';\n\n const termEntries = termList.map(term => {\n const snippets = extractTermSnippets(term, fileContentsMap);\n return snippets.length > 0\n ? `- ${term} (Usage context: ${snippets[0]})`\n : `- ${term}`;\n });\n\n const systemPrompt = (\n 'You are a knowledge classification expert. For each concrete keyword/API, determine:\\n'\n + '1. The neutral concept it belongs to (UPPER_SNAKE_CASE)\\n'\n + '2. The depth level: ulo | cio | sio\\n\\n'\n + 'DEPTH DEFINITIONS:\\n'\n + '- ulo (WHAT + WHY): The keyword introduces a concept — \"what is it, why does it exist\"\\n'\n + ' Example: In a scaffold step, \"@State is SwiftUI\\'s way of managing local view state\"\\n'\n + '- cio (HOW): The keyword demonstrates a mechanism — \"how it works\"\\n'\n + ' Example: \"@State triggers view re-render when value changes — mechanism is value-type observation\"\\n'\n + '- sio (IMPLEMENTATION): The keyword is a concrete API/syntax used in code\\n'\n + ' Example: \"Using @State var isActive: Bool = false in ContentView\"\\n\\n'\n + 'RULES:\\n'\n + '1. PREFER an EXISTING concept from the CONCEPT_BANK below if the keyword is a manifestation of that concept.\\n'\n + '2. ONLY create a NEW concept (UPPER_SNAKE_CASE, NOT ending in _CONCEPT, NOT containing a specific technology name) when NO concept in the bank covers it.\\n'\n + `3. CONCEPT_BANK: ${conceptBank.slice(0, 12000)}\\n`\n + '4. Depth is per-keyword-in-context, NOT per-concept. The same concept can have ULO at one step and SIO at another.\\n'\n + 'Return JSON: {\"results\": {\"<keyword>\": {\"concept_code\": \"...\", \"concept_name\": \"...\", \"depth\": \"ulo|cio|sio\"}}}'\n );\n\n const userPrompt = (\n 'Classify the following keyword/API list into neutral concepts WITH depth levels.\\n'\n + 'Code usage context is provided to disambiguate depth:\\n'\n + termEntries.join('\\n')\n + '\\n\\nReturn JSON: {\"results\": {\"<keyword>\": {\"concept_code\": \"...\", \"concept_name\": \"...\", \"depth\": \"ulo|cio|sio\"}}}'\n );\n\n const result = await llmChatJson(client, systemPrompt, userPrompt, {\n temperature: 0.1,\n maxTokens: 16384,\n });\n\n llmResults = (result.results || {}) as Record<string, { concept_code?: string; concept_name?: string; depth?: string }>;\n } catch (err) {\n console.warn(`[WARN] Concept escalation LLM failed (${err}), using fallback depth inference`);\n }\n }\n\n // Join results into feature_concepts\n const featureConcepts = new Map<string, ConceptMapping[]>();\n\n for (const feature of features) {\n const fid = feature.id || 'F_UNK';\n const featureFiles = new Set<string>();\n for (const step of feature.steps || []) {\n for (const f of step.files || []) featureFiles.add(f);\n }\n\n const fTerms = [\n ...(feature.api_usage || []),\n ...(feature.steps || []).flatMap(s => [...(s.api_usage || []), ...(s.keywords || [])]),\n ];\n\n const items: ConceptMapping[] = [];\n const seen = new Set<string>();\n\n for (const kw of fTerms) {\n const info = llmResults[kw] || {};\n const cCode = info.concept_code || toUpperSnake(kw);\n const cName = info.concept_name || kw;\n\n // Determine depth: LLM result > fallback inference\n let depth: 'ulo' | 'cio' | 'sio' = 'sio';\n let depthRationale = 'Default: SIO';\n\n if (info.depth && ['ulo', 'cio', 'sio'].includes(info.depth)) {\n depth = info.depth as 'ulo' | 'cio' | 'sio';\n depthRationale = `LLM classified as ${depth}`;\n } else {\n const inferred = inferDepthFromContext(kw, fileContentsMap);\n depth = inferred.depth;\n depthRationale = inferred.rationale;\n }\n\n // Allow multiple keywords per concept — don't dedup by concept_code\n const kwKey = `${cCode}::${kw}`;\n if (seen.has(kwKey)) continue;\n seen.add(kwKey);\n\n // Evidence: files that actually contain this term\n const evidenceFiles: string[] = [];\n for (const f of featureFiles) {\n const content = fileContentsMap.get(f) || '';\n if (content.toLowerCase().includes(kw.toLowerCase())) {\n evidenceFiles.push(f);\n }\n }\n\n items.push({\n concept_code: cCode,\n concept_name: cName,\n keyword: kw,\n depth,\n depth_rationale: depthRationale,\n evidence_files: evidenceFiles,\n });\n }\n\n featureConcepts.set(fid, items);\n }\n\n return featureConcepts;\n}\n","/**\n * Concept resolution — maps keywords to Master Tree concepts.\n *\n * Ported from knowledge-tree/resolve_concepts.py\n * Uses ULO/CIO/SIO-aware matching:\n * - SIO keywords → match against concept.keywords (tech-specific)\n * - CIO keywords → match against concept.description (mechanism)\n * - ULO keywords → match against concept.ulo (what/why, tech-independent)\n *\n * Fallback: keyword overlap matching when embeddings unavailable.\n *\n * NOTE: This module requires sentence-transformers Python package for embeddings.\n * In pure TypeScript mode, it falls back to keyword overlap matching.\n */\n\nimport { createLlmClient, llmChatJson, type LlmClientConfig } from '../utils/llmClient';\nimport type { Keyword } from '../extractors/keywordExtractor';\n\nexport interface ResolvedConcept {\n keyword: string;\n source: string;\n depth: 'ulo' | 'cio' | 'sio';\n concept_codes: string[];\n matches: ConceptMatch[];\n override?: boolean;\n rechecked?: boolean;\n}\n\nexport interface ConceptMatch {\n code: string;\n name: string;\n description: string;\n keywords: string;\n ulo?: string;\n cio?: string;\n score: number;\n matched_level: 'ulo' | 'cio' | 'sio';\n method: 'embedding' | 'keyword_overlap';\n}\n\nexport interface ProposedConcept {\n keyword: string;\n source: string;\n depth: 'ulo' | 'cio' | 'sio';\n reason: string;\n best_match?: ConceptMatch;\n}\n\nexport interface ResolveConceptsResult {\n resolved: ResolvedConcept[];\n proposed: ProposedConcept[];\n summary: {\n total_keywords: number;\n resolved_count: number;\n proposed_count: number;\n search_mode: string;\n };\n}\n\nexport interface ResolveConceptsOptions {\n keywords: Keyword[];\n goal: string;\n embeddings?: Record<string, { embedding?: number[]; name?: string; description?: string; keywords?: string; ulo?: string; cio?: string }>;\n /** Pre-computed depth from conceptEscalator — overrides inferDepthFromSource */\n depthOverrides?: Map<string, 'ulo' | 'cio' | 'sio'>;\n topK?: number;\n threshold?: number;\n llmConfig?: LlmClientConfig;\n}\n\n// Source-based thresholds\nconst SOURCE_THRESHOLDS: Record<string, number> = {\n docstring: 0.45,\n readme_description: 0.45,\n readme: 0.50,\n type_declaration: 0.55,\n function_signature: 0.55,\n import: 0.60,\n property_wrapper: 0.55,\n error_handling: 0.60,\n config: 0.60,\n framework_usage: 0.45,\n};\n\nconst DEFAULT_THRESHOLD = 0.55;\n\nfunction cosineSimilarity(a: number[], b: number[]): number {\n if (!a.length || !b.length || a.length !== b.length) return 0;\n let dot = 0, normA = 0, normB = 0;\n for (let i = 0; i < a.length; i++) {\n dot += a[i] * b[i];\n normA += a[i] * a[i];\n normB += b[i] * b[i];\n }\n if (normA === 0 || normB === 0) return 0;\n return dot / (Math.sqrt(normA) * Math.sqrt(normB));\n}\n\n/**\n * ULO/CIO/SIO-aware keyword overlap scoring.\n * Matches against different concept fields based on depth level.\n */\nfunction uloCioAwareScore(\n query: string,\n depth: 'ulo' | 'cio' | 'sio',\n conceptData: { keywords?: string; description?: string; ulo?: string; cio?: string },\n): number {\n const queryTerms = new Set(query.toLowerCase().split(/\\s+/));\n\n // Choose which fields to match based on depth\n let targetText = '';\n if (depth === 'sio') {\n // SIO: match against keywords (tech-specific terms)\n targetText = conceptData.keywords || '';\n } else if (depth === 'cio') {\n // CIO: match against description + cio (mechanism)\n targetText = [conceptData.description || '', conceptData.cio || ''].join(' ');\n } else {\n // ULO: match against ulo + description (what/why, tech-independent)\n targetText = [conceptData.ulo || '', conceptData.description || ''].join(' ');\n }\n\n const targetTerms = new Set(targetText.toLowerCase().split(/\\s+/));\n if (!queryTerms.size || !targetTerms.size) return 0;\n\n let overlap = 0;\n for (const t of queryTerms) {\n if (targetTerms.has(t)) overlap++;\n }\n return Math.min(overlap / queryTerms.size, 1.0);\n}\n\n\nfunction inferFieldsFromGoal(goal: string): string[] {\n const goalLower = goal.toLowerCase();\n const fieldKeywords: Record<string, string[]> = {\n ASE: ['algorithm', 'software', 'programming', 'code', 'develop', 'build', 'app'],\n DAI: ['data', 'database', 'storage', 'query', 'sql', 'analytics'],\n CSN: ['network', 'protocol', 'server', 'client', 'api', 'http'],\n HCI: ['user', 'interface', 'ui', 'ux', 'interaction', 'design'],\n MOB: ['mobile', 'ios', 'android', 'swift', 'kotlin', 'flutter'],\n WEB: ['web', 'html', 'css', 'javascript', 'react', 'vue'],\n };\n\n const matched: string[] = [];\n for (const [code, keywords] of Object.entries(fieldKeywords)) {\n if (keywords.some(kw => goalLower.includes(kw))) matched.push(code);\n }\n return matched.length > 0 ? matched : ['ASE'];\n}\n\n/**\n * Infer depth from keyword source and context.\n */\nfunction inferDepthFromSource(source: string): 'ulo' | 'cio' | 'sio' {\n const uloSources = ['docstring', 'readme', 'readme_description', 'framework_usage'];\n const cioSources = ['type_declaration', 'function_signature', 'config'];\n\n if (uloSources.includes(source)) return 'ulo';\n if (cioSources.includes(source)) return 'cio';\n return 'sio';\n}\n\n/**\n * Resolve keywords to concepts using ULO/CIO/SIO-aware matching.\n */\nexport async function resolveConcepts(\n options: ResolveConceptsOptions,\n): Promise<ResolveConceptsResult> {\n const { keywords, goal, embeddings, depthOverrides, topK = 3, threshold = DEFAULT_THRESHOLD, llmConfig } = options;\n\n const relevantFields = inferFieldsFromGoal(goal);\n const resolved: ResolvedConcept[] = [];\n const proposed: ProposedConcept[] = [];\n const hasEmbeddings = Object.keys(embeddings || {}).length > 0 &&\n Object.values(embeddings || {}).some(d => d.embedding && d.embedding.length > 0);\n let search_mode = hasEmbeddings ? 'embedding' : 'keyword_overlap';\n\n const concepts = embeddings || {};\n\n for (const kwData of keywords) {\n const keyword = kwData.keyword;\n const source = kwData.source;\n // Use escalator's depth override if available, else infer from source\n const depth = depthOverrides?.get(keyword) || inferDepthFromSource(source);\n\n // Search concepts via ULO/CIO/SIO-aware matching\n const scored: ConceptMatch[] = [];\n for (const [code, data] of Object.entries(concepts)) {\n const conceptKeywords = data.keywords || '';\n const conceptDesc = data.description || '';\n const conceptUlo = (data as Record<string, unknown>).ulo as string | undefined;\n const conceptCio = (data as Record<string, unknown>).cio as string | undefined;\n\n // Primary: ULO/CIO-aware score based on depth level\n const awareScore = uloCioAwareScore(keyword, depth, {\n keywords: conceptKeywords,\n description: conceptDesc,\n ulo: conceptUlo,\n cio: conceptCio,\n });\n\n // Fallback: broad keyword overlap across all fields\n const queryTerms = new Set(keyword.toLowerCase().split(/\\s+/));\n const allTerms = new Set([\n ...conceptKeywords.toLowerCase().split(/\\s+/),\n ...conceptDesc.toLowerCase().split(/\\s+/),\n ...(conceptUlo || '').toLowerCase().split(/\\s+/),\n ...(conceptCio || '').toLowerCase().split(/\\s+/),\n ].filter(Boolean));\n let overlapCount = 0;\n for (const t of queryTerms) { if (allTerms.has(t)) overlapCount++; }\n const fallbackScore = queryTerms.size > 0 ? Math.min(overlapCount / queryTerms.size, 1.0) : 0;\n\n // Use the higher score, but track which method won\n const usedAware = awareScore >= fallbackScore;\n const finalScore = usedAware ? awareScore : fallbackScore;\n\n if (finalScore > 0) {\n scored.push({\n code,\n name: data.name || code,\n description: conceptDesc,\n keywords: conceptKeywords,\n ulo: conceptUlo,\n cio: conceptCio,\n score: finalScore,\n matched_level: usedAware ? depth : 'sio',\n method: hasEmbeddings && data.embedding && data.embedding.length > 0 ? 'embedding' : 'keyword_overlap',\n });\n }\n }\n\n scored.sort((a, b) => b.score - a.score);\n const topMatches = scored.slice(0, topK);\n\n if (topMatches.length === 0) {\n proposed.push({\n keyword,\n source,\n depth,\n reason: 'No matches in Master Tree',\n });\n continue;\n }\n\n const effThreshold = SOURCE_THRESHOLDS[source] || threshold;\n const topMatch = topMatches[0];\n\n if (topMatch.score >= effThreshold) {\n resolved.push({\n keyword,\n source,\n depth,\n concept_codes: topMatches.filter(m => m.score >= effThreshold).map(m => m.code),\n matches: topMatches,\n });\n } else {\n proposed.push({\n keyword,\n source,\n depth,\n best_match: topMatch,\n reason: `Low confidence (${topMatch.score.toFixed(2)} < ${effThreshold})`,\n });\n }\n }\n\n return {\n resolved,\n proposed,\n summary: {\n total_keywords: keywords.length,\n resolved_count: resolved.length,\n proposed_count: proposed.length,\n search_mode,\n },\n };\n}\n","/**\n * Roadmap assembly — assembles final roadmap with keyword tracking and time awareness.\n *\n * Ported from knowledge-tree/assemble_roadmap.py\n * Handles: topo sort, phases, keyword-per-milestone tracking.\n *\n * Improvements:\n * - Time budget per session/lesson\n * - Overhead factor (setup, transitions, review)\n * - Smart feature → milestone splitting (respect time constraints)\n * - Phase grouping based on concept progression\n */\n\nimport type { ProjectGraph, Feature, Step } from '../schemas/projectGraphSchema';\nimport type { ConceptMapping } from '../graph/conceptEscalator';\n\nexport interface AssembledMilestone {\n id: string;\n name: string;\n description: string;\n feature_id: string;\n feature_name: string;\n concept_code: string;\n depth: 'ulo' | 'cio' | 'sio';\n all_keywords: string[];\n new_keywords: string[];\n prerequisite_keywords: string[];\n steps: Step[];\n estimated_minutes: number;\n adjusted_minutes: number; // with overhead\n completion_level: string;\n}\n\nexport interface AssembledPhase {\n phase_id: number;\n phase_name: string;\n milestones: AssembledMilestone[];\n total_minutes: number;\n concept_progression: string; // e.g., \"ULO → CIO → SIO\"\n}\n\nexport interface AssembledRoadmap {\n project: ProjectGraph['project'];\n product: ProjectGraph['product'];\n phases: AssembledPhase[];\n feature_concepts: Map<string, ConceptMapping[]>;\n time_budget: {\n session_minutes: number;\n overhead_factor: number;\n total_estimated_minutes: number;\n total_adjusted_minutes: number;\n };\n}\n\nexport interface AssembleOptions {\n projectGraph: ProjectGraph;\n featureConcepts?: Map<string, ConceptMapping[]>;\n sessionMinutes?: number; // Target minutes per session/lesson (default: 90)\n overheadFactor?: number; // Overhead multiplier (default: 1.15 = 15% overhead)\n maxMilestoneMinutes?: number; // Max minutes before splitting a milestone (default: 120)\n}\n\n// ─── Overhead Calculation ────────────────────────────────────────────────────\n\n/**\n * Calculate overhead-adjusted minutes for a milestone.\n * Overhead includes: setup time, transitions, review, Q&A.\n */\nfunction calculateOverhead(\n rawMinutes: number,\n overheadFactor: number,\n): number {\n return Math.ceil(rawMinutes * overheadFactor);\n}\n\n// ─── Milestone Splitting ─────────────────────────────────────────────────────\n\n/**\n * Split a feature's steps into multiple milestones if they exceed maxMilestoneMinutes.\n * Splits at natural break points (between steps of different complexity).\n */\nfunction splitFeatureIntoMilestones(\n feature: Feature,\n featureConcepts: ConceptMapping[],\n maxMinutes: number,\n overheadFactor: number,\n): AssembledMilestone[] {\n const steps = feature.steps || [];\n if (steps.length === 0) return [];\n\n const featureId = feature.id || 'F_UNK';\n\n // Calculate raw minutes per step\n const stepMinutes = steps.map(s => s.effort?.estimated_minutes || 15);\n const totalRawMinutes = stepMinutes.reduce((a, b) => a + b, 0);\n\n // If within budget, return as single milestone\n if (calculateOverhead(totalRawMinutes, overheadFactor) <= maxMinutes) {\n return [buildMilestone(feature, featureConcepts, steps, stepMinutes, featureId, 1)];\n }\n\n // Split into multiple milestones\n const milestones: AssembledMilestone[] = [];\n let currentSteps: Step[] = [];\n let currentMinutes: number[] = [];\n let milestoneIndex = 1;\n\n for (let i = 0; i < steps.length; i++) {\n const step = steps[i];\n const mins = stepMinutes[i];\n\n // Check if adding this step would exceed budget\n const currentTotal = currentMinutes.reduce((a, b) => a + b, 0);\n if (calculateOverhead(currentTotal + mins, overheadFactor) > maxMinutes && currentSteps.length > 0) {\n // Split here\n milestones.push(buildMilestone(\n feature, featureConcepts, currentSteps, currentMinutes,\n featureId, milestoneIndex,\n ));\n milestoneIndex++;\n currentSteps = [];\n currentMinutes = [];\n }\n\n currentSteps.push(step);\n currentMinutes.push(mins);\n }\n\n // Don't forget the last group\n if (currentSteps.length > 0) {\n milestones.push(buildMilestone(\n feature, featureConcepts, currentSteps, currentMinutes,\n featureId, milestoneIndex,\n ));\n }\n\n return milestones;\n}\n\n/**\n * Build a single AssembledMilestone from steps.\n * Concept codes are mapped per-step, not per-feature.\n */\nfunction buildMilestone(\n feature: Feature,\n featureConcepts: ConceptMapping[],\n steps: Step[],\n stepMinutes: number[],\n featureId: string,\n milestoneIndex: number,\n): AssembledMilestone {\n const rawMinutes = stepMinutes.reduce((a, b) => a + b, 0);\n const levels = steps.map(s => s.completion_level || 'mvp');\n const completionLevel = levels.includes('extend') ? 'extend'\n : levels.includes('mvp') ? 'mvp'\n : 'base';\n\n // Collect concept codes PER STEP (not per feature)\n const milestoneConcepts = new Set<string>();\n const milestoneKeywords = new Set<string>();\n for (const step of steps) {\n // Use step-level concept_codes if propagated, else match by keyword\n const stepConceptCodes = step.concept_codes || [];\n for (const code of stepConceptCodes) {\n milestoneConcepts.add(code);\n }\n // Also match by keyword presence\n const stepKws = [...(step.keywords || []), ...(step.api_usage || [])];\n for (const cm of featureConcepts) {\n if (stepKws.includes(cm.keyword)) {\n milestoneConcepts.add(cm.concept_code);\n milestoneKeywords.add(cm.keyword);\n }\n }\n }\n\n // Determine dominant depth from step-level concept mappings\n const depthCounts = { ulo: 0, cio: 0, sio: 0 };\n for (const cm of featureConcepts) {\n if (milestoneKeywords.has(cm.keyword)) {\n depthCounts[cm.depth]++;\n }\n }\n const dominantDepth: 'ulo' | 'cio' | 'sio' =\n depthCounts.sio >= depthCounts.cio && depthCounts.sio >= depthCounts.ulo ? 'sio'\n : depthCounts.cio >= depthCounts.ulo ? 'cio'\n : 'ulo';\n\n return {\n id: milestoneIndex === 1 ? featureId : `${featureId}-M${milestoneIndex}`,\n name: milestoneIndex === 1 ? (feature.name || featureId) : `${feature.name || featureId} (Part ${milestoneIndex})`,\n description: feature.description || '',\n feature_id: featureId,\n feature_name: feature.name || '',\n concept_code: [...milestoneConcepts].join(', '),\n depth: dominantDepth,\n all_keywords: [],\n new_keywords: [],\n prerequisite_keywords: [],\n steps,\n estimated_minutes: rawMinutes,\n adjusted_minutes: rawMinutes, // placeholder — assembleRoadmap() applies actual overheadFactor\n completion_level: completionLevel,\n };\n}\n\n// ─── Keyword Tracking ────────────────────────────────────────────────────────\n\n/**\n * Build keyword map: concept_code → [keywords]\n */\nfunction buildKeywordMap(\n featureConcepts: Map<string, ConceptMapping[]>,\n): Map<string, string[]> {\n const map = new Map<string, string[]>();\n for (const mappings of featureConcepts.values()) {\n for (const m of mappings) {\n const existing = map.get(m.concept_code) || [];\n if (!existing.includes(m.keyword)) {\n existing.push(m.keyword);\n map.set(m.concept_code, existing);\n }\n }\n }\n return map;\n}\n\n/**\n * Attach keywords to milestones, computing new vs prerequisite.\n */\nfunction attachKeywordsToMilestones(\n milestones: AssembledMilestone[],\n keywordMap: Map<string, string[]>,\n): AssembledMilestone[] {\n const cumulativeKeywords = new Set<string>();\n\n for (const milestone of milestones) {\n // Aggregate keywords from concept codes\n const allKw = new Set<string>();\n const conceptCodes = milestone.concept_code.split(',').map((c: string) => c.trim()).filter(Boolean);\n for (const code of conceptCodes) {\n const kws = keywordMap.get(code) || [];\n for (const kw of kws) allKw.add(kw);\n }\n\n milestone.all_keywords = Array.from(allKw).sort();\n\n // Compute new vs prerequisite\n const newKw: string[] = [];\n const prereqKw: string[] = [];\n for (const kw of milestone.all_keywords) {\n if (cumulativeKeywords.has(kw)) {\n prereqKw.push(kw);\n } else {\n newKw.push(kw);\n cumulativeKeywords.add(kw);\n }\n }\n\n milestone.new_keywords = newKw;\n milestone.prerequisite_keywords = prereqKw;\n }\n\n return milestones;\n}\n\n// ─── Phase Grouping ──────────────────────────────────────────────────────────\n\n/**\n * Group milestones into phases based on time budget and concept progression.\n */\nfunction groupIntoPhases(\n milestones: AssembledMilestone[],\n sessionMinutes: number,\n): AssembledPhase[] {\n const phases: AssembledPhase[] = [];\n let currentMilestones: AssembledMilestone[] = [];\n let currentMinutes = 0;\n let phaseNum = 1;\n\n for (const milestone of milestones) {\n const milestoneMinutes = milestone.adjusted_minutes;\n\n // If adding this milestone would exceed session budget, start new phase\n if (currentMinutes + milestoneMinutes > sessionMinutes && currentMilestones.length > 0) {\n phases.push(buildPhase(currentMilestones, phaseNum));\n phaseNum++;\n currentMilestones = [];\n currentMinutes = 0;\n }\n\n currentMilestones.push(milestone);\n currentMinutes += milestoneMinutes;\n }\n\n // Don't forget the last phase\n if (currentMilestones.length > 0) {\n phases.push(buildPhase(currentMilestones, phaseNum));\n }\n\n return phases;\n}\n\nfunction buildPhase(milestones: AssembledMilestone[], phaseNum: number): AssembledPhase {\n const totalMinutes = milestones.reduce((sum, m) => sum + m.adjusted_minutes, 0);\n\n // Determine concept progression\n const depths = milestones.map(m => m.depth);\n const uniqueDepths = [...new Set(depths)];\n const progression = uniqueDepths.map(d => d.toUpperCase()).join(' → ');\n\n return {\n phase_id: phaseNum,\n phase_name: `Phase ${phaseNum}`,\n milestones,\n total_minutes: totalMinutes,\n concept_progression: progression,\n };\n}\n\n// ─── Main Assembly ───────────────────────────────────────────────────────────\n\n/**\n * Assemble project graph into a roadmap with phases and keyword tracking.\n */\nexport function assembleRoadmap(options: AssembleOptions): AssembledRoadmap {\n const {\n projectGraph,\n featureConcepts = new Map(),\n sessionMinutes = 90,\n overheadFactor = 1.15,\n maxMilestoneMinutes = 120,\n } = options;\n\n const features = projectGraph.features || [];\n const keywordMap = buildKeywordMap(featureConcepts);\n\n // Build milestones from features (with splitting)\n const allMilestones: AssembledMilestone[] = [];\n\n for (const feature of features) {\n const fid = feature.id || 'F_UNK';\n const fConcepts = featureConcepts.get(fid) || [];\n\n const milestones = splitFeatureIntoMilestones(\n feature,\n fConcepts,\n maxMilestoneMinutes,\n overheadFactor,\n );\n\n allMilestones.push(...milestones);\n }\n\n // Apply overhead factor\n for (const milestone of allMilestones) {\n milestone.adjusted_minutes = calculateOverhead(milestone.estimated_minutes, overheadFactor);\n }\n\n // Attach keywords (new vs prerequisite)\n attachKeywordsToMilestones(allMilestones, keywordMap);\n\n // Group into phases based on session time\n const phases = groupIntoPhases(allMilestones, sessionMinutes);\n\n // Calculate totals\n const totalEstimatedMinutes = allMilestones.reduce((sum, m) => sum + m.estimated_minutes, 0);\n const totalAdjustedMinutes = allMilestones.reduce((sum, m) => sum + m.adjusted_minutes, 0);\n\n return {\n project: projectGraph.project,\n product: projectGraph.product,\n phases,\n feature_concepts: featureConcepts,\n time_budget: {\n session_minutes: sessionMinutes,\n overhead_factor: overheadFactor,\n total_estimated_minutes: totalEstimatedMinutes,\n total_adjusted_minutes: totalAdjustedMinutes,\n },\n };\n}\n","/**\n * LLM-based File Selector — sends file tree to LLM, asks it to pick\n * which files are most relevant to the project goal.\n *\n * This mirrors knowledge-tree's approach:\n * 1. git_tracker generates project_structure.txt (file tree)\n * 2. Agent/LLM reads tree → selects important files\n * 3. Only selected files are read for analysis\n */\n\nimport { createLlmClient, llmChatJson, type LlmClientConfig } from '../utils/llmClient';\n\nexport interface FileSelectionResult {\n selected: string[];\n reasoning: string;\n}\n\n/**\n * Ask LLM to select which files from the file tree are relevant to the goal.\n * Input: file tree (names only, very small) + goal\n * Output: list of file paths to analyze\n */\nexport async function selectFilesWithLlm(\n filePaths: string[],\n goal: string,\n techStack: string,\n llmConfig?: LlmClientConfig,\n): Promise<FileSelectionResult> {\n // If very few files, no need to filter\n if (filePaths.length <= 15) {\n return { selected: filePaths, reasoning: 'Too few files to filter' };\n }\n\n const client = createLlmClient(llmConfig);\n\n // Build file tree for LLM (just names, grouped by directory)\n const treeLines = buildFileTree(filePaths);\n\n const systemPrompt = (\n 'You are a software architect analyzing a project repository.\\n'\n + 'Given a file tree and a project goal, select which files are MOST IMPORTANT '\n + 'to read for understanding the project architecture and implementation.\\n\\n'\n + 'RULES:\\n'\n + '1. Prioritize source code files (Swift, TS, Python, C++) over config/docs\\n'\n + '2. Include entry points (App.swift, main.py, index.ts)\\n'\n + '3. Include core domain files (models, services, views, controllers)\\n'\n + '4. EXCLUDE test files, mock files, generated files\\n'\n + '5. EXCLUDE config files (package.json, Podfile, etc.) unless they reveal architecture\\n'\n + '6. Include files that directly implement the features mentioned in the goal\\n'\n + '7. Return 20-40 files maximum (fewer is better if the project is small)\\n\\n'\n + 'Return JSON: {\"selected\": [\"path/to/file1\", \"path/to/file2\"], \"reasoning\": \"brief explanation\"}'\n );\n\n const userPrompt = (\n `Project goal: ${goal}\\n`\n + `Tech stack: ${techStack}\\n\\n`\n + `FILE TREE (${filePaths.length} files):\\n${treeLines}\\n\\n`\n + 'Select the most important files to analyze. Return JSON.'\n );\n\n try {\n const result = await llmChatJson(client, systemPrompt, userPrompt, {\n temperature: 0.1,\n maxTokens: 4096,\n });\n\n const selected = Array.isArray(result.selected) ? result.selected as string[] : [];\n const reasoning = String(result.reasoning || '');\n\n // Validate: only keep files that exist in the original list\n const pathSet = new Set(filePaths);\n const validSelected = selected.filter(p => pathSet.has(p));\n\n if (validSelected.length === 0) {\n // LLM returned nothing valid — fallback to all files\n return { selected: filePaths, reasoning: 'LLM selection empty, using all files' };\n }\n\n return { selected: validSelected, reasoning };\n } catch (err) {\n console.warn(`[WARN] LLM file selection failed (${err}), using all files`);\n return { selected: filePaths, reasoning: `LLM failed: ${err}` };\n }\n}\n\n/**\n * Build a compact file tree string for LLM consumption.\n * Groups files by top-level directory, shows only filenames.\n */\nfunction buildFileTree(filePaths: string[]): string {\n const byDir = new Map<string, string[]>();\n\n for (const fp of filePaths) {\n const parts = fp.split('/');\n const dir = parts.length > 1 ? parts.slice(0, -1).join('/') : '(root)';\n const file = parts[parts.length - 1];\n if (!byDir.has(dir)) byDir.set(dir, []);\n byDir.get(dir)!.push(file);\n }\n\n const lines: string[] = [];\n for (const [dir, files] of byDir) {\n lines.push(`${dir}/`);\n for (const f of files.sort()) {\n lines.push(` ${f}`);\n }\n }\n\n return lines.join('\\n');\n}\n","/**\n * File I/O utilities for domain-kit pipeline.\n */\n\nimport { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync } from 'node:fs';\nimport { join, extname, relative, resolve } from 'node:path';\nimport { execSync } from 'node:child_process';\n\n/**\n * Read JSON file safely, returns null if not found or invalid.\n */\nexport function readJsonFile<T = unknown>(filePath: string): T | null {\n try {\n if (!existsSync(filePath)) return null;\n const content = readFileSync(filePath, 'utf-8');\n return JSON.parse(content) as T;\n } catch {\n return null;\n }\n}\n\n/**\n * Write JSON file, creating parent directories if needed.\n */\nexport function writeJsonFile(filePath: string, data: unknown): void {\n mkdirSync(join(filePath, '..'), { recursive: true });\n writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');\n}\n\n/**\n * Read text file safely, returns null if not found.\n */\nexport function readTextFile(filePath: string): string | null {\n try {\n if (!existsSync(filePath)) return null;\n return readFileSync(filePath, 'utf-8');\n } catch {\n return null;\n }\n}\n\n/**\n * Collect source files from a directory, filtering by allowed extensions.\n */\nexport function collectSourceFiles(\n dir: string,\n options?: {\n allowedExtensions?: string[];\n skipDirs?: string[];\n maxFiles?: number;\n },\n): string[] {\n const allowedExts = options?.allowedExtensions || ['.swift', '.ts', '.tsx', '.js', '.jsx', '.py', '.ino', '.cpp', '.c', '.h', '.hpp'];\n const maxFiles = options?.maxFiles || 70;\n\n // Try git ls-files first — respects .gitignore, handles submodules, symlinks\n const gitFiles = collectViaGit(dir, allowedExts, maxFiles);\n if (gitFiles.length > 0) return gitFiles;\n\n // Fallback: filesystem walk (non-git directories)\n return collectViaFilesystem(dir, allowedExts, maxFiles, options?.skipDirs);\n}\n\n/**\n * Collect source files using `git ls-files`.\n * Respects .gitignore, handles symlinks, much faster than walk.\n */\nfunction collectViaGit(dir: string, allowedExts: string[], maxFiles: number): string[] {\n try {\n const raw = execSync('git ls-files --cached --others --exclude-standard', {\n cwd: dir,\n encoding: 'utf-8',\n timeout: 5000,\n maxBuffer: 1024 * 1024,\n });\n const extSet = new Set(allowedExts.map(e => e.toLowerCase()));\n return raw\n .split('\\n')\n .filter(line => line.length > 0)\n .filter(line => extSet.has(extname(line).toLowerCase()))\n .slice(0, maxFiles)\n .map(rel => join(dir, rel));\n } catch {\n // Not a git repo or git not available — fall through to filesystem walk\n return [];\n }\n}\n\n/**\n * Collect source files using recursive directory walk (non-git fallback).\n */\nfunction collectViaFilesystem(\n dir: string,\n allowedExts: string[],\n maxFiles: number,\n skipDirs?: string[],\n): string[] {\n const skipSet = new Set(skipDirs || [\n 'node_modules', '.build', 'Pods', '.git', '.venv', 'venv',\n '__pycache__', 'build', 'dist', '.idea', '.vscode',\n 'test', 'tests', 'demo', 'sample', 'example', 'playground',\n ]);\n const extSet = new Set(allowedExts.map(e => e.toLowerCase()));\n const result: string[] = [];\n\n function walk(currentDir: string) {\n if (result.length >= maxFiles) return;\n let entries;\n try {\n entries = readdirSync(currentDir, { withFileTypes: true });\n } catch {\n return; // permission error\n }\n for (const entry of entries) {\n if (result.length >= maxFiles) return;\n const fullPath = join(currentDir, entry.name);\n if (entry.isDirectory()) {\n if (!skipSet.has(entry.name)) {\n walk(fullPath);\n }\n } else if (entry.isFile()) {\n const ext = extname(entry.name).toLowerCase();\n if (extSet.has(ext)) {\n result.push(fullPath);\n }\n }\n }\n }\n\n walk(dir);\n return result;\n}\n\n/**\n * Collect file contents map (relative path → content).\n */\nexport function collectFileContents(\n dir: string,\n options?: {\n allowedExtensions?: string[];\n skipDirs?: string[];\n maxFiles?: number;\n maxChars?: number;\n },\n): { paths: string[]; contents: Map<string, string> } {\n const maxChars = options?.maxChars || 500000;\n const files = collectSourceFiles(dir, options);\n const contents = new Map<string, string>();\n let totalChars = 0;\n\n for (const filePath of files) {\n const relPath = relative(dir, filePath);\n try {\n const content = readFileSync(filePath, 'utf-8');\n if (totalChars + content.length > maxChars) {\n const remaining = maxChars - totalChars;\n if (remaining > 100) {\n contents.set(relPath, content.slice(0, remaining));\n totalChars += remaining;\n }\n break;\n }\n contents.set(relPath, content);\n totalChars += content.length;\n } catch {\n // Skip unreadable files\n }\n }\n\n return { paths: files.map(f => relative(dir, f)), contents };\n}\n\n/**\n * Read contents of SPECIFIC files (by relative path) — no directory scan.\n * Used for 2-pass approach: scan tree first, then read only selected files.\n */\nexport function collectSpecificFileContents(\n dir: string,\n relativePaths: string[],\n maxChars: number = 500000,\n): Map<string, string> {\n const contents = new Map<string, string>();\n let totalChars = 0;\n\n for (const relPath of relativePaths) {\n const fullPath = join(dir, relPath);\n try {\n const content = readFileSync(fullPath, 'utf-8');\n if (totalChars + content.length > maxChars) {\n const remaining = maxChars - totalChars;\n if (remaining > 100) {\n contents.set(relPath, content.slice(0, remaining));\n totalChars += remaining;\n }\n break;\n }\n contents.set(relPath, content);\n totalChars += content.length;\n } catch {\n // Skip unreadable files\n }\n }\n\n return contents;\n}\n\n/**\n * Detect primary language from file extensions.\n */\nexport function detectPrimaryLanguage(filePaths: string[]): string {\n const counts = new Map<string, number>();\n for (const fp of filePaths) {\n const ext = extname(fp).toLowerCase();\n let lang = 'unknown';\n if (ext === '.swift') lang = 'Swift';\n else if (ext === '.ts' || ext === '.tsx') lang = 'TypeScript';\n else if (ext === '.js' || ext === '.jsx') lang = 'JavaScript';\n else if (ext === '.py') lang = 'Python';\n else if (ext === '.ino' || ext === '.cpp' || ext === '.c' || ext === '.h') lang = 'C++';\n else if (ext === '.kt' || ext === '.kts') lang = 'Kotlin';\n counts.set(lang, (counts.get(lang) || 0) + 1);\n }\n\n let maxCount = 0;\n let primary = 'unknown';\n for (const [lang, count] of counts) {\n if (count > maxCount) {\n maxCount = count;\n primary = lang;\n }\n }\n return primary;\n}\n\n/**\n * Read README.md and extract project description.\n */\nexport function readReadmeDescription(repoDir: string): string | null {\n const readmePath = join(repoDir, 'README.md');\n if (!existsSync(readmePath)) return null;\n try {\n const content = readFileSync(readmePath, 'utf-8');\n const lines = content.split('\\n').map(l => l.trim()).filter(Boolean);\n // Skip patterns: badges, images, table of contents, HTML tags\n const skipPatterns = [/^\\[!/, /^<img/, /^<a /, /^#+\\s+Table of/i, /^---$/];\n let foundTitle = false;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (line.startsWith('#') && !line.startsWith('##')) {\n foundTitle = true;\n continue;\n }\n if (!foundTitle) continue;\n // Skip empty lines, badges, images, TOC, horizontal rules\n if (skipPatterns.some(p => p.test(line))) continue;\n if (line.startsWith('#')) return null; // hit next heading — no description found\n if (line.startsWith('```')) return null; // code block\n if (line.startsWith('|')) return null; // table\n if (line.length > 15) return line;\n }\n return null;\n } catch {\n return null;\n }\n}\n","/**\n * Project Graph Pipeline — full orchestrator.\n *\n * Ported from knowledge-tree/generate_roadmap_v3.py PipelineOrchestrator\n * Coordinates: AST analysis → keyword extraction → LLM graph generation →\n * verification → concept escalation → concept resolution → assembly.\n */\n\nimport type { ProjectGraph, Feature } from '../schemas/projectGraphSchema';\nimport { parseSwiftFile, mergeSwiftResults, type SwiftParseResult } from '../parsers/swift';\nimport { parseTsFile, mergeTsResults, type TsParseResult } from '../parsers/typescript';\nimport { parsePythonFile, mergePythonResults, type PythonParseResult } from '../parsers/python';\nimport { parseCppFile, mergeCppResults, type CppParseResult } from '../parsers/cpp';\nimport { extractKeywords, type Keyword, type SourceContext } from '../extractors/keywordExtractor';\nimport { extractScaffold } from '../graph/scaffoldExtractor';\nimport { extractProjectOverview } from '../graph/overviewExtractor';\nimport { extractFeatureSteps, extractFeatureStepsBatched } from '../graph/stepExtractor';\nimport { verifyProjectGraph, type Hallucination } from '../graph/graphVerifier';\nimport { escalateAndMapConcepts, type ConceptMapping } from '../graph/conceptEscalator';\nimport { resolveConcepts, type ResolveConceptsResult } from '../concepts/conceptResolver';\nimport { assembleRoadmap, type AssembledRoadmap } from '../assembly/roadmapAssembler';\nimport { selectFilesWithLlm } from '../extractors/fileSelector';\nimport { collectSourceFiles, collectSpecificFileContents, detectPrimaryLanguage, readReadmeDescription } from '../utils/fileUtils';\nimport { relative } from 'node:path';\nimport { createLlmClient, type LlmClientConfig } from '../utils/llmClient';\n\nexport interface PipelineOptions {\n repoDir: string;\n goal: string;\n techStack: string;\n llmConfig?: LlmClientConfig;\n embeddings?: Record<string, { embedding?: number[]; name?: string; description?: string; keywords?: string }>;\n onProgress?: (step: string, message: string) => void;\n}\n\nexport interface PipelineResult {\n projectGraph: ProjectGraph;\n resolvedConcepts: ResolveConceptsResult;\n roadmap: AssembledRoadmap;\n hallucinations: Hallucination[];\n keywords: Keyword[];\n featureConcepts: Map<string, ConceptMapping[]>;\n}\n\n/**\n * Run the full project graph generation pipeline.\n */\nexport async function runProjectGraphPipeline(\n options: PipelineOptions,\n): Promise<PipelineResult> {\n const { repoDir, goal, techStack, llmConfig, embeddings, onProgress } = options;\n\n const log = (step: string, msg: string) => {\n console.log(`[${step}] ${msg}`);\n onProgress?.(step, msg);\n };\n\n // ─── STEP 1A: File Tree Scan (names only — no content reading) ─────────\n log('STEP_1', 'Scanning file tree (names only)...');\n\n const allFilePaths = collectSourceFiles(repoDir);\n const allRelPaths = allFilePaths.map(fp => relative(repoDir, fp));\n log('STEP_1', `Found ${allRelPaths.length} source files in repository`);\n\n // ─── STEP 1B: LLM File Selection (sends tiny file tree to LLM) ────────\n log('STEP_1', 'Asking LLM to select relevant files from file tree...');\n\n const { selected: selectedPaths, reasoning } = await selectFilesWithLlm(\n allRelPaths, goal, techStack, llmConfig,\n );\n log('STEP_1', `LLM selected ${selectedPaths.length}/${allRelPaths.length} files: ${reasoning.slice(0, 100)}`);\n\n // ─── STEP 1C: Read content only for LLM-selected files ─────────────────\n log('STEP_1', 'Reading content for selected files...');\n\n const fileContentsMap = collectSpecificFileContents(repoDir, selectedPaths);\n const filePaths = selectedPaths;\n const primaryLang = detectPrimaryLanguage(filePaths);\n log('STEP_1', `Primary language: ${primaryLang}, ${filePaths.length} files loaded (${fileContentsMap.size} with content)`);\n\n // Parse source files\n log('STEP_1', 'Parsing source files with AST-level analysis...');\n\n const allParseResults: SourceContext[] = [];\n for (const [relPath, content] of fileContentsMap) {\n const fullPath = relPath;\n if (fullPath.endsWith('.swift')) {\n allParseResults.push(parseSwiftFile(fullPath, content));\n } else if (fullPath.endsWith('.ts') || fullPath.endsWith('.tsx') || fullPath.endsWith('.js') || fullPath.endsWith('.jsx')) {\n allParseResults.push(parseTsFile(fullPath, content));\n } else if (fullPath.endsWith('.py')) {\n allParseResults.push(parsePythonFile(fullPath, content));\n } else if (fullPath.endsWith('.ino') || fullPath.endsWith('.cpp') || fullPath.endsWith('.c') || fullPath.endsWith('.h')) {\n allParseResults.push(parseCppFile(fullPath, content));\n }\n }\n\n // Merge parse results by language\n let mergedContext: SourceContext;\n if (primaryLang === 'Swift') {\n mergedContext = mergeSwiftResults(allParseResults.filter((r): r is SwiftParseResult => 'property_wrappers' in r));\n } else if (primaryLang === 'TypeScript' || primaryLang === 'JavaScript') {\n mergedContext = mergeTsResults(allParseResults.filter((r): r is TsParseResult => !('docstrings' in r) && !('property_wrappers' in r) && !('frameworks_used' in r)));\n } else if (primaryLang === 'Python') {\n mergedContext = mergePythonResults(allParseResults.filter((r): r is PythonParseResult => 'docstrings' in r));\n } else {\n mergedContext = mergeCppResults(allParseResults.filter((r): r is CppParseResult => 'error_handling' in r && !('docstrings' in r) && !('property_wrappers' in r)));\n }\n\n // ─── STEP 2: Keyword Extraction ──────────────────────────────────────────\n log('STEP_2', 'Extracting keywords from AST analysis...');\n\n const astKeywords = extractKeywords(mergedContext);\n log('STEP_2', `Extracted ${astKeywords.length} keywords`);\n\n // ─── STEP 3: Build SDK API Index (simplified — use AST keywords as proxy) ──\n log('STEP_3', 'Building SDK API index...');\n\n const sdkApiIndex = {\n sdk_apis: astKeywords.map(kw => ({\n name: kw.keyword,\n kind: kw.source,\n used_in_demo: true,\n })),\n };\n\n // ─── STEP 4: LLM Project Graph Generation ────────────────────────────────\n log('STEP_4', 'Generating project graph via LLM (C0: Scaffold, C1: Overview, C2: Steps)...');\n\n // C0: Scaffold (F0) — uses file list (names only, not content)\n log('STEP_4_C0', 'Extracting FOUNDATION & SETUP feature (F0)...');\n const scaffoldFeature = await extractScaffold({\n goal,\n techStack,\n fileList: filePaths,\n llmConfig,\n });\n\n // C1: Overview (features meta) — uses already-filtered fileContentsMap\n log('STEP_4_C1', 'Extracting project overview (features meta)...');\n const overview = await extractProjectOverview({\n goal,\n techStack,\n sdkApiIndex,\n fileContentsMap,\n astKeywords,\n llmConfig,\n });\n\n // Build PBL step (Design Thinking)\n const product = overview.product as Record<string, unknown> | undefined;\n const pblStep: Feature['steps'] extends (infer T)[] ? T : never = {\n id: 'F0-S1',\n sequence: 1,\n name: 'Frame the problem & understand user needs (Design Thinking)',\n description: 'BEFORE CODING — frame the problem and understand what the user needs',\n files: [],\n api_usage: [],\n keywords: ['Design Thinking', 'User Needs', 'Problem Statement', 'User Journey', 'PBL'],\n completion_level: 'base',\n platform: 'app',\n intent: 'Understand user needs and frame problem before writing code',\n outcome: { user_visible: 'Defined problem statement', technical: 'Problem frame context' },\n acceptance: ['Problem statement is clear', 'Primary users identified'],\n requirement_ids: [],\n concept_codes: [],\n effort: { estimated_minutes: 15, complexity: 'low' },\n };\n\n // Merge scaffold F0 with PBL step\n let featuresFull: Feature[] = [];\n if (scaffoldFeature) {\n const scaffoldSteps = [pblStep, ...(scaffoldFeature.steps || [])].map((s, i) => ({\n ...s,\n id: `F0-S${i + 1}`,\n sequence: i + 1,\n }));\n featuresFull.push({\n ...scaffoldFeature,\n id: 'F0',\n name: 'FOUNDATION & SETUP',\n steps: scaffoldSteps,\n });\n } else {\n featuresFull.push({\n id: 'F0',\n name: 'FOUNDATION & SETUP',\n description: 'Frame the problem, get familiar with the tools',\n steps: [pblStep],\n } as Feature);\n }\n\n // Add features from overview\n const overviewFeatures = (product?.features || []) as Feature[];\n featuresFull = [...featuresFull, ...overviewFeatures];\n\n // C2: Extract steps per feature\n log('STEP_4_C2', `Extracting steps for ${overviewFeatures.length} features...`);\n\n const nonF0Features = overviewFeatures.filter(f => f.id !== 'F0');\n if (nonF0Features.length > 0) {\n try {\n const batchedSteps = await extractFeatureStepsBatched(\n goal, techStack, sdkApiIndex, fileContentsMap, nonF0Features, llmConfig,\n );\n for (const feature of nonF0Features) {\n const steps = batchedSteps.get(feature.id || '');\n if (steps) feature.steps = steps;\n }\n } catch (err) {\n log('STEP_4_C2', `Batch extraction failed (${err}), falling back to per-feature...`);\n for (const feature of nonF0Features) {\n try {\n const steps = await extractFeatureSteps({\n goal, techStack, sdkApiIndex, fileContentsMap, feature, llmConfig,\n });\n feature.steps = steps;\n } catch (e) {\n log('STEP_4_C2', `Failed for ${feature.id}: ${e}`);\n }\n }\n }\n }\n\n // Build project graph\n const projectGraph: ProjectGraph = {\n schema_version: 3,\n project: {\n id: (overview.project as Record<string, unknown>)?.name?.toString().toLowerCase().replace(/\\s+/g, '-') || 'project',\n name: (overview.project as Record<string, unknown>)?.name?.toString() || 'Project',\n purpose: goal,\n version: '0.1.0',\n project_type: 'app',\n platform: ((overview.project as Record<string, unknown>)?.platforms as string[]) || ['ios'],\n tech_stack: techStack.split(',').reduce((acc, t) => {\n const key = t.trim().toLowerCase();\n if (key) acc[key] = [t.trim()];\n return acc;\n }, {} as Record<string, string[]>),\n architecture: (overview.architecture as Record<string, unknown>)?.layers as string[] || [],\n },\n product: {\n goals: (product?.goals as Array<{ id: string; description: string }>) || [],\n users: (product?.users as Array<{ id: string; goals: string[] }>) || [],\n journeys: (product?.user_journeys as Array<{ id: string; name: string; requirement_ids: string[]; steps: string[]; feature_ids: string[] }>) || [],\n requirements: [],\n development_stages: (product?.development_stages as Array<{ stage: string; product_state: string; need: string[]; learn: string[]; validation: string; cross_feature_value: string; temporary_approach: string }>) || [],\n purpose: String(product?.purpose || ''),\n problem_statement: String(product?.problem_statement || ''),\n primary_users: (product?.primary_users as string[]) || [],\n },\n features: featuresFull,\n capabilities: [],\n implementation: {\n tasks: [],\n },\n missing_gaps: [],\n tech_debt: [],\n };\n\n // ─── STEP 5: Verification ────────────────────────────────────────────────\n log('STEP_5', 'Verifying project graph against source code...');\n\n const { graph: verifiedGraph, hallucinations } = verifyProjectGraph(projectGraph, {\n repoDir,\n sdkApiIndex,\n fileContentsMap,\n });\n log('STEP_5', `Verification complete: ${hallucinations.length} hallucinations found`);\n\n // ─── STEP 6: Concept Escalation ──────────────────────────────────────────\n log('STEP_6', 'Escalating keywords to neutral concepts...');\n\n const featureConcepts = await escalateAndMapConcepts({\n projectGraph: verifiedGraph,\n fileContentsMap,\n llmConfig,\n });\n log('STEP_6', `Concept mapping complete: ${featureConcepts.size} features mapped`);\n\n // Propagate concept_codes back into verified graph steps\n for (const feature of verifiedGraph.features || []) {\n const fid = feature.id || '';\n const fConcepts = featureConcepts.get(fid) || [];\n for (const step of feature.steps || []) {\n const stepConcepts = fConcepts\n .filter(cm => {\n // Match concept to step: check if step contains the keyword\n const stepKws = [...(step.keywords || []), ...(step.api_usage || [])];\n return stepKws.some(k => k === cm.keyword);\n })\n .map(cm => cm.concept_code);\n // Merge with any existing concept_codes from LLM\n const existing = step.concept_codes || [];\n step.concept_codes = [...new Set([...existing, ...stepConcepts])];\n }\n }\n\n // ─── STEP 7: Concept Resolution ──────────────────────────────────────────\n log('STEP_7', 'Resolving keywords to Master Tree concepts...');\n\n // Collect LLM-generated keywords from verified graph (not just AST)\n const llmKeywords: Keyword[] = [];\n const seenKw = new Set<string>();\n for (const feature of verifiedGraph.features || []) {\n for (const step of feature.steps || []) {\n for (const kw of [...(step.keywords || []), ...(step.api_usage || [])]) {\n if (!seenKw.has(kw.toLowerCase())) {\n seenKw.add(kw.toLowerCase());\n llmKeywords.push({ keyword: kw, source: 'llm_step', platform: 'app', weight: 1.0, context: 'LLM-generated step keyword' });\n }\n }\n }\n }\n // Merge with AST keywords (AST takes precedence for source/weight)\n const astKwMap = new Map(astKeywords.map(k => [k.keyword.toLowerCase(), k]));\n const mergedKeywords: Keyword[] = [];\n const mergedSeen = new Set<string>();\n for (const kw of [...astKeywords, ...llmKeywords]) {\n const key = kw.keyword.toLowerCase();\n if (!mergedSeen.has(key)) {\n mergedSeen.add(key);\n mergedKeywords.push(astKwMap.get(key) || kw);\n }\n }\n\n // Build depth overrides from concept escalation\n const depthOverrides = new Map<string, 'ulo' | 'cio' | 'sio'>();\n for (const mappings of featureConcepts.values()) {\n for (const cm of mappings) {\n if (!depthOverrides.has(cm.keyword)) {\n depthOverrides.set(cm.keyword, cm.depth);\n }\n }\n }\n\n const resolvedConcepts = await resolveConcepts({\n keywords: mergedKeywords,\n goal,\n embeddings,\n depthOverrides,\n llmConfig,\n });\n log('STEP_7', `Resolved: ${resolvedConcepts.summary.resolved_count}, Proposed: ${resolvedConcepts.summary.proposed_count} (${resolvedConcepts.summary.search_mode})`);\n\n // ─── STEP 8: Assembly ────────────────────────────────────────────────────\n log('STEP_8', 'Assembling roadmap with keyword tracking...');\n\n const roadmap = assembleRoadmap({\n projectGraph: verifiedGraph,\n featureConcepts,\n sessionMinutes: 90,\n overheadFactor: 1.15,\n maxMilestoneMinutes: 120,\n });\n log('STEP_8', `Roadmap assembled: ${roadmap.phases.length} phases, ${roadmap.phases.reduce((s, p) => s + p.milestones.length, 0)} milestones`);\n\n return {\n projectGraph: verifiedGraph,\n resolvedConcepts,\n roadmap,\n hallucinations,\n keywords: astKeywords,\n featureConcepts,\n };\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import { u as ProjectGraph } from '../projectGraphSchema-DnD7orZV.cjs';
2
+ import { K as Keyword } from '../keywordExtractor-zPAz2isq.cjs';
3
+ import { H as Hallucination } from '../graphVerifier-QjgDAJce.cjs';
4
+ import { C as ConceptMapping } from '../conceptEscalator-ltRLtPhf.cjs';
5
+ import { ResolveConceptsResult } from '../concepts/index.cjs';
6
+ import { AssembledRoadmap } from '../assembly/index.cjs';
7
+ import { L as LlmClientConfig } from '../llmClient-ysPhLjcH.cjs';
8
+ import 'zod';
9
+ import '../parsers/index.cjs';
10
+
11
+ /**
12
+ * Project Graph Pipeline — full orchestrator.
13
+ *
14
+ * Ported from knowledge-tree/generate_roadmap_v3.py PipelineOrchestrator
15
+ * Coordinates: AST analysis → keyword extraction → LLM graph generation →
16
+ * verification → concept escalation → concept resolution → assembly.
17
+ */
18
+
19
+ interface PipelineOptions {
20
+ repoDir: string;
21
+ goal: string;
22
+ techStack: string;
23
+ llmConfig?: LlmClientConfig;
24
+ embeddings?: Record<string, {
25
+ embedding?: number[];
26
+ name?: string;
27
+ description?: string;
28
+ keywords?: string;
29
+ }>;
30
+ onProgress?: (step: string, message: string) => void;
31
+ }
32
+ interface PipelineResult {
33
+ projectGraph: ProjectGraph;
34
+ resolvedConcepts: ResolveConceptsResult;
35
+ roadmap: AssembledRoadmap;
36
+ hallucinations: Hallucination[];
37
+ keywords: Keyword[];
38
+ featureConcepts: Map<string, ConceptMapping[]>;
39
+ }
40
+ /**
41
+ * Run the full project graph generation pipeline.
42
+ */
43
+ declare function runProjectGraphPipeline(options: PipelineOptions): Promise<PipelineResult>;
44
+
45
+ export { type PipelineOptions, type PipelineResult, runProjectGraphPipeline };
@@ -0,0 +1,45 @@
1
+ import { u as ProjectGraph } from '../projectGraphSchema-DnD7orZV.js';
2
+ import { K as Keyword } from '../keywordExtractor-CKaXqSku.js';
3
+ import { H as Hallucination } from '../graphVerifier-DsTP9uAN.js';
4
+ import { C as ConceptMapping } from '../conceptEscalator-YfMKIKCZ.js';
5
+ import { ResolveConceptsResult } from '../concepts/index.js';
6
+ import { AssembledRoadmap } from '../assembly/index.js';
7
+ import { L as LlmClientConfig } from '../llmClient-ysPhLjcH.js';
8
+ import 'zod';
9
+ import '../parsers/index.js';
10
+
11
+ /**
12
+ * Project Graph Pipeline — full orchestrator.
13
+ *
14
+ * Ported from knowledge-tree/generate_roadmap_v3.py PipelineOrchestrator
15
+ * Coordinates: AST analysis → keyword extraction → LLM graph generation →
16
+ * verification → concept escalation → concept resolution → assembly.
17
+ */
18
+
19
+ interface PipelineOptions {
20
+ repoDir: string;
21
+ goal: string;
22
+ techStack: string;
23
+ llmConfig?: LlmClientConfig;
24
+ embeddings?: Record<string, {
25
+ embedding?: number[];
26
+ name?: string;
27
+ description?: string;
28
+ keywords?: string;
29
+ }>;
30
+ onProgress?: (step: string, message: string) => void;
31
+ }
32
+ interface PipelineResult {
33
+ projectGraph: ProjectGraph;
34
+ resolvedConcepts: ResolveConceptsResult;
35
+ roadmap: AssembledRoadmap;
36
+ hallucinations: Hallucination[];
37
+ keywords: Keyword[];
38
+ featureConcepts: Map<string, ConceptMapping[]>;
39
+ }
40
+ /**
41
+ * Run the full project graph generation pipeline.
42
+ */
43
+ declare function runProjectGraphPipeline(options: PipelineOptions): Promise<PipelineResult>;
44
+
45
+ export { type PipelineOptions, type PipelineResult, runProjectGraphPipeline };
@@ -0,0 +1,8 @@
1
+ export { runProjectGraphPipeline } from '../chunk-GEUDHZE7.mjs';
2
+ import '../chunk-DRVOV5ZD.mjs';
3
+ import '../chunk-XMHKWHVK.mjs';
4
+ import '../chunk-MOKNFLUD.mjs';
5
+ import '../chunk-KNDBODUQ.mjs';
6
+ import '../chunk-ONQHJ4OH.mjs';
7
+ //# sourceMappingURL=index.mjs.map
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}