From f14eba1b49559f5fdab780a9bff7f409c41d7c39 Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 10:22:03 +0300 Subject: [PATCH] Projektiraportti: HTML-dokumentaatio pipeline-vaiheista ja tiedostoista MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pipeline generoi HTML-raportin joka sisältää: - Pipeline-vaiheet prompteineen ja tuloksineen (avattavat details) - Staattisen analyysin tulokset - Kaikki generoidut tiedostot korostettuina - Raportti avautuu uuteen välilehteen linkistä terminaalissa - Projektikorttiin lisätty 📄 Raportti -nappi Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 80 ++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 2 deletions(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 00a3fa5..de17040 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2191,7 +2191,7 @@ IMPORTANT: Include get_db() dependency for FastAPI` }, // Globaali storage projektikorttien tiedostoille (välttää JSON data-attribuuttien ongelmat) const projectFiles = {}; - function renderProjectCard(files, projectName) { + function renderProjectCard(files, projectName, reportUrl) { const fileEntries = Object.entries(files); if (fileEntries.length === 0) return; @@ -2219,6 +2219,7 @@ IMPORTANT: Include get_db() dependency for FastAPI` }, + ${reportUrl ? `📄 Raportti` : ''}
${tabsHtml}
@@ -2736,8 +2737,83 @@ ${fixableFiles}`; pipelineStep('coder', 'Korjaukset', 'done', 'Korjaukset generoitu', fixedCode); } + // Generoidaan projektin dokumentaatio HTML-raporttina + const reportHtml = generateProjectReport(task, generatedFiles, pipelineSteps, staticIssues); + const reportBlob = new Blob([reportHtml], { type: 'text/html' }); + const reportUrl = URL.createObjectURL(reportBlob); + termLog(`\n━━━ Pipeline valmis (${Object.keys(generatedFiles).length} tiedostoa) ━━━`); - renderProjectCard(generatedFiles, task); + termLog(` 📄 Avaa projektiraportti`); + renderProjectCard(generatedFiles, task, reportUrl); + } + + function generateProjectReport(task, files, steps, staticIssues) { + const fileEntries = Object.entries(files); + const agentNames = { manager: 'Manageri', coder: 'Koodari', tester: 'DevOps', qa: 'QA', data: 'Data' }; + const agentColors = { manager: '#d29922', coder: '#3fb950', tester: '#58a6ff', qa: '#a371f7', data: '#d2a8ff' }; + + const stepsHtml = steps.map((s, i) => { + const color = agentColors[s.agent] || '#8b949e'; + const icon = s.status === 'done' ? '✓' : '◷'; + const outputPreview = (s.output || '').substring(0, 500); + return ` +
+
+ ${icon} ${agentNames[s.agent] || s.agent} — ${s.label} + Vaihe ${i + 1} +
+ ${s.input ? `
Prompti
${s.input.replace(/
` : ''} + ${outputPreview ? `
${outputPreview.replace(/` : ''}
+                    
`; + }).join(''); + + const filesHtml = fileEntries.map(([name, content]) => ` +
+
${name}
+
${(content || '').replace(/
+                
`).join(''); + + const staticHtml = (staticIssues || []).length > 0 + ? `
+ Staattinen analyysi (${staticIssues.length} huomautusta) +
    ${staticIssues.map(i => `
  • ${i}
  • `).join('')}
+
` + : '

✓ Staattinen analyysi: ei huomautuksia

'; + + return ` + + + + +Kipinä Raportti — ${task} + + + +

🔥 Kipinä Projektiraportti

+

${task} — ${new Date().toLocaleString('fi-FI')} — ${fileEntries.length} tiedostoa, ${steps.length} vaihetta

+ +

📋 Pipeline-vaiheet

+${stepsHtml} + +

🔍 Staattinen analyysi

+${staticHtml} + +

📁 Tiedostot

+${filesHtml} + +
+

Generoitu Kipinä Agentic Playground v0.2.2 — kipina.studio

+`; } // Yksinkertainen pipeline (vanha: manageri → koodari → testaaja)