Add deep extractors, reference pages, keyword index; eval 53.3%
- extract-deep.js: mines addon versions, TF configs, script params, helm values, state services - generate-reference-pages.js: creates operations.md, configuration.md, network-architecture.md - reference/index.md: keyword-rich topic-to-file routing table - Enriched CIDR extractor with inline comment capture - Eval progression: 28.7% -> 33.4% -> 46.7% -> 52.5% -> 53.3% - NOT_FOUND: 25 -> 20 -> 16 -> 10 -> 11 - Top scores: config-region-code 95%, argo-gen-params 95%, multiple 100%s - Remaining gap: agent planner (haiku) doesn't consistently follow index routing
This commit is contained in:
15
sysdoc.js
15
sysdoc.js
@@ -9,6 +9,7 @@ const { discoverCharts, chartsToGraph, generateHelmDiagram } = require('./extrac
|
||||
const { queryImpact, formatImpactMarkdown } = require('./impact.js');
|
||||
const { extractAllPatterns } = require('./extract-patterns.js');
|
||||
const { buildAgentKB } = require('./agent-kb.js');
|
||||
const { extractDeep } = require('./extract-deep.js');
|
||||
|
||||
/**
|
||||
* Phase 7D: Hierarchical Doc Generator
|
||||
@@ -48,6 +49,7 @@ async function generateDocs(graph, srcRoot, outDir, opts = {}) {
|
||||
|
||||
// 4b. Extract architectural patterns from code artifacts
|
||||
const patterns = extractAllPatterns(srcRoot);
|
||||
const deepData = extractDeep(srcRoot);
|
||||
|
||||
// Merge Helm into main graph so Subsystem Aggregator sees it
|
||||
for (const e of helmGraph.entities) {
|
||||
@@ -182,6 +184,17 @@ ${patterns.naming.slice(0, 15).map(n => `- \`${n.pattern}\` (via \`${n.file}\`)`
|
||||
**Core Images:**
|
||||
${patterns.techStack.containerImages.slice(0, 20).map(i => `- \`${i}\``).join('\n')}
|
||||
|
||||
## Configuration & Operational Defaults
|
||||
**State Management Services:** ${deepData.stateServices.map(s => s.name).filter((v, i, a) => a.indexOf(v) === i).join(', ')}
|
||||
**Cluster Addons (EKS/GKE):**
|
||||
${deepData.addons.map(a => `- ${a.name}: ${a.version}`).join('\n')}
|
||||
**Key Script Parameters (Timeouts/Retries):**
|
||||
${deepData.scriptParams.filter(p => p.name.includes('TIMEOUT') || p.name.includes('WAIT')).map(p => `- ${p.name} = ${p.value} (${p.file})`).join('\n')}
|
||||
**Infrastructure Configs:**
|
||||
${deepData.tfConfigs.filter(c => c.key.includes('backup')).map(c => `- ${c.key}: ${c.value} (${c.file})`).join('\n')}
|
||||
**Account/Template Values:**
|
||||
${deepData.helmValues.map(v => `- ${v.key}: ${v.value} (${v.file})`).join('\n')}
|
||||
|
||||
## Subsystems
|
||||
|
||||
| Subsystem | Kind | Files | Modules | Functions |
|
||||
@@ -472,7 +485,7 @@ ${sub.files.map(f => `- \`${f}\``).join('\n')}
|
||||
// Generate Agent Knowledge Base (JSON)
|
||||
const agentKB = buildAgentKB(graph, srcRoot, helmCharts, subs, contractsResult, patterns, impactResults);
|
||||
fs.writeFileSync(path.join(outDir, 'agent-kb.json'), JSON.stringify(agentKB, null, 2));
|
||||
console.log(`Agent KB: ${agentKB.facts.length} facts indexed`);
|
||||
console.log(`Agent KB: ${agentKB.reference.subsystems.length} subsystems, ${agentKB.reference.helm.charts.length} charts`);
|
||||
|
||||
return {
|
||||
subsystems: subs.subsystems.length,
|
||||
|
||||
Reference in New Issue
Block a user