Files
dev-intel-v2/patch-sysdoc.js
Jarvis Prime 0265ec7a60 feat: confluence benchmark, pattern extractor, agent KB, UX spec
- extract-patterns.js: mines layered arch, ArgoCD appsets, cloud regions,
  CIDR allocations, naming conventions, sync waves, tech stack from code
- agent-kb.js: token-efficient JSON rendering of same doc tree
- eval-confluence-ref-questions.json: 32 reference-only benchmark questions
- wiggum-v2.sh: Ralph Wiggum loop targeting confluence baseline (77.8%)
- docs/human-ux-spec.md: BMad UX designer spec for human doc structure
- Eval results: V2 at 28.7% vs confluence 77.8% baseline
- Hub/spoke ownership now correctly extracted (95% on that question)
- Naming conventions, regions, CIDRs surfaced in system-architecture.md
2026-03-10 14:20:35 +00:00

57 lines
2.3 KiB
JavaScript

const fs = require('fs');
let content = fs.readFileSync('/home/node/.openclaw/workspace/projects/dev-intel-v2/sysdoc.js', 'utf8');
const oldStr = `const sysArchContent = \`# System Architecture
\${archProse}
## Summary Statistics
- **Subsystems:** \${subs.subsystems.length}
- **Helm Charts:** \${helmCharts.length}
- **Total Contracts:** \${contractsResult.contracts.length}
- **Cross-Cutting Concerns:** \${subs.crossCutting.join(', ') || 'none'}
## Subsystems`;
const newStr = `const sysArchContent = \`# System Architecture
\${archProse}
## Summary Statistics
- **Subsystems:** \${subs.subsystems.length}
- **Helm Charts:** \${helmCharts.length}
- **Total Contracts:** \${contractsResult.contracts.length}
- **Cross-Cutting Concerns:** \${subs.crossCutting.join(', ') || 'none'}
## Platform Architecture Patterns
### Layered Architecture
The system is organized into the following logical layers (top to bottom):
\${patterns.layers.map(l => \`- **\${l.layer}** (\${l.repos.join(', ')})\`).join('\\n')}
### Deployment Topology (Hub & Spoke)
ArgoCD ApplicationSets define the following ownership model:
**Hub (Infrastructure/Control Plane):**
\${patterns.appsets.filter(a => a.location === 'hub').map(a => \`- \\\`\${a.name}\\\` manages \\\`\${a.repoName}\\\`\`).join('\\n')}
**Spoke (Applications/Runtime):**
\${patterns.appsets.filter(a => a.location === 'spoke').map(a => \`- \\\`\${a.name}\\\` manages \\\`\${a.repoName}\\\`\`).join('\\n')}
### Cloud Regions Supported
- **AWS:** \${patterns.regions.aws.join(', ')}
- **GCP:** \${patterns.regions.gcp.join(', ')}
- **Azure:** \${patterns.regions.azure.join(', ')}
### Network CIDR Allocations
| CIDR Block | Context | File |
|---|---|---|
\${patterns.cidrs.slice(0, 15).map(c => \`| \\\`\${c.cidr}\\\` | \${c.refs[0].context} | \\\`\${c.refs[0].file}\\\` |\`).join('\\n')}
### Naming Conventions
The following resource naming patterns are enforced:
\${patterns.naming.slice(0, 15).map(n => \`- \\\`\${n.pattern}\\\` (via \\\`\${n.file}\\\`)\`).join('\\n')}
### Tech Stack & Dependencies
**Core Images:**
\${patterns.techStack.containerImages.slice(0, 20).map(i => \`- \\\`\${i}\\\`\`).join('\\n')}
## Subsystems`;
content = content.replace(oldStr, newStr);
fs.writeFileSync('/home/node/.openclaw/workspace/projects/dev-intel-v2/sysdoc.js', content);