From 75310c989e980a7333ed2a1d76c2cac46bcb542c Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 07:43:13 +0300 Subject: [PATCH] QA validointivaihe: tarkistaa tiedostojen yhteensopivuuden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uusi vaihe DevOps-vaiheiden jälkeen: QA tarkistaa että Dockerfile, docker-compose, README ja testit viittaavat oikeisiin tiedostoihin ja riippuvuuksiin. Jos ongelmia löytyy, DevOps korjaa Dockerfilen automaattisesti. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) 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); }