const fs = require('fs');
let content = fs.readFileSync('/home/node/.openclaw/workspace/projects/dev-intel-v2/sysdoc.js', 'utf8');

const oldStr = `## Tech Stack & Dependencies
**Core Images:**
\${patterns.techStack.containerImages.slice(0, 20).map(i => \`- \\\`\${i}\\\`\`).join('\\n')}

## Subsystems`;

const newStr = `## Tech Stack & Dependencies
**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`;

content = content.replace(oldStr, newStr);
fs.writeFileSync('/home/node/.openclaw/workspace/projects/dev-intel-v2/sysdoc.js', content);