diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 0400d5e..70cdec9 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2302,6 +2302,45 @@ Files: ${Object.keys(generatedFiles).join(', ')}`; if (readme) generatedFiles['README.md'] = readme; pipelineStep('tester', 'README', 'done', 'README.md', readme); + // Validointivaihe: QA tarkistaa kaikkien tiedostojen yhteensopivuuden + const stepV = step8 + 1; + termLog(`\n[${stepV}] QA — validointi`); + pipelineStep('qa', 'Validointi', 'active', 'Tarkistetaan yhteensopivuus'); + const allFiles = Object.entries(generatedFiles).map(([n, c]) => `--- ${n} ---\n${c}`).join('\n\n'); + const validatePrompt = `Check these project files for consistency issues. Report ONLY problems found. If everything is fine, say "OK". + +Check: +1. Dockerfile COPY references files that exist in the project +2. Dockerfile dependencies match what the code imports +3. docker-compose.yml services match what the app needs +4. README commands match actual file names and structure +5. Test file imports match actual module names +6. pyproject.toml dependencies cover all imports (if pyproject.toml exists) + +Files in project: ${Object.keys(generatedFiles).join(', ')} + +${allFiles}`; + const validation = await kpnRun(agentPrompts.qa.model, validatePrompt, false, 256); + pipelineStep('qa', 'Validointi', 'done', 'Yhteensopivuus', validation); + + // Jos QA löysi ongelmia, korjataan + if (validation && !validation.toLowerCase().startsWith('ok') && !validation.toLowerCase().includes('no issues') && !validation.toLowerCase().includes('everything is fine')) { + const stepFix = stepV + 1; + termLog(`\n[${stepFix}] DevOps — korjaukset`); + pipelineStep('tester', 'Korjaukset', 'active', validation); + // Korjataan vain Dockerfile ja docker-compose + const fixPrompt = `Fix ONLY the Dockerfile based on this feedback. Output the corrected Dockerfile, nothing else. + +Feedback: ${validation} + +Current files: ${Object.keys(generatedFiles).join(', ')} +Current Dockerfile: +${generatedFiles['Dockerfile'] || '(puuttuu)'}`; + const fixedDockerfile = await kpnRun(agentPrompts.tester.model, fixPrompt, false, 256); + if (fixedDockerfile) generatedFiles['Dockerfile'] = fixedDockerfile; + pipelineStep('tester', 'Korjaukset', 'done', 'Dockerfile korjattu', fixedDockerfile); + } + termLog(`\n━━━ Pipeline valmis (${Object.keys(generatedFiles).length} tiedostoa) ━━━`); renderProjectCard(generatedFiles, task); }