Phase 6+7: LLM prose generation pass over Foxtrot docs\n\n- Ran Claude Haiku to generate prose for architecture, subsystems, flows, and 124 Helm contracts\n- Fixed describeContract prompt in prose.js to correctly identify and describe Helm contract types without hallucinating\n- 80 files generated with rich architectural summaries

This commit is contained in:
Jarvis Prime
2026-03-09 20:15:50 +00:00
parent 4f7c77b3b1
commit d9fa087e22

View File

@@ -108,14 +108,23 @@ Write ONLY the narrative paragraph, no heading. Explain what happens when this e
async function describeContract(contract, xref, llmOpts) {
const usedBy = xref?.[contract.name]?.usedBy || [];
let details = '';
if (contract.type === 'Interface' && contract.fields) {
details = `Fields: ${contract.fields.map(f => `${f.name}: ${f.type}`).join(', ')}`;
if (contract.extends) details += `\nExtends: ${contract.extends.join(', ')}`;
} else if (contract.type === 'Enum' && contract.members) {
details = `Members: ${contract.members.join(', ')}`;
} else if (contract.type.startsWith('Helm')) {
// Helm contract types
if (contract.fields) {
details = `Fields: ${contract.fields.slice(0, 20).map(f => `${f.name}: ${f.type}`).join(', ')}`;
if (contract.fields.length > 20) details += ` (+${contract.fields.length - 20} more)`;
}
}
const prompt = `Write a 1-2 sentence description of this TypeScript ${contract.type.toLowerCase()}.
const typeLabel = contract.type.startsWith('Helm') ? `Helm ${contract.type.replace('Helm', '').toLowerCase()} contract` : `TypeScript ${contract.type.toLowerCase()}`;
const prompt = `Write a 1-2 sentence description of this ${typeLabel}.
Name: ${contract.name}
Type: ${contract.type}
@@ -124,7 +133,7 @@ Visibility: ${contract.visibility}
${details}
${usedBy.length > 0 ? `Used by subsystems: ${usedBy.join(', ')}` : 'Not referenced cross-subsystem'}
Write ONLY the description, no heading.`;
Write ONLY the description, no heading. Do not ask for more information.`;
return callLLM(prompt, { ...llmOpts, maxTokens: 256 });
}