From bef5b6fc3c003979f5c645010d42a3eba920f584 Mon Sep 17 00:00:00 2001 From: Jaakko Vanhala Date: Mon, 6 Apr 2026 07:43:47 +0300 Subject: [PATCH] uv/pyproject.toml tuki projektipipelineen, requirements.txt fallbackina MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Managerin prompti ohjaa käyttämään pyproject.toml:ia (.toml sallittu). Koodari saa pyproject.toml-tiedostolle eksplisiittisen esimerkkiformaatin jossa [project] + dependencies + [project.scripts] start-komennolla. requirements.txt toimii edelleen fallbackina jos malli tuottaa sen. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 2ccbd71..039f5a1 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2025,9 +2025,10 @@ filename.py: what this file contains Rules: - Max 4 files -- Only .py, .txt, .json, .html files +- Only .py, .toml, .json, .html files - No directories, no paths, just filenames - List dependencies first, then main app (e.g. models.py before main.py) +- Use pyproject.toml for dependencies (not requirements.txt) Project: ${task}`; const plan = await kpnRun(agentPrompts.manager.model, managerPrompt); @@ -2055,7 +2056,7 @@ Project: ${task}`; // Fallback: manageri ei tuottanut tiedostolistaa, käytetään koko vastausta ohjeena termLog(' Ei tiedostojakoa — generoidaan yhtenä kokonaisuutena'); termLog(`\n[2] Koodari — toteutus`); - const code = await kpnRun(agentPrompts.coder.model, `Project: ${task}\nFiles: ${plan}\n\nWrite all the code for this project. Use the exact libraries mentioned in the project description.`); + const code = await kpnRun(agentPrompts.coder.model, `Project: ${task}\nFiles: ${plan}\n\nWrite all the code for this project. Use the exact libraries mentioned in the project description. Use pyproject.toml for dependencies (not requirements.txt).`); if (code) { termLog(`\n━━━ Pipeline valmis ━━━`); } @@ -2080,8 +2081,24 @@ Project: ${task}`; ).join('\n\n') + '\n\n'; } + // Erityisohjeet pyproject.toml / requirements.txt -tiedostoille + let extraInstructions = ''; + if (file.name === 'pyproject.toml') { + extraInstructions = `\nUse this exact format: +[project] +name = "projectname" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = ["fastapi", "uvicorn"] + +[project.scripts] +start = "uvicorn main:app --reload"`; + } else if (file.name === 'requirements.txt') { + extraInstructions = '\nList one dependency per line. No version pins unless necessary.'; + } + const coderPrompt = `${context}Project: ${task} -Write ONLY the file "${file.name}"${file.desc ? ': ' + file.desc : ''}. +Write ONLY the file "${file.name}"${file.desc ? ': ' + file.desc : ''}.${extraInstructions} Use the exact libraries mentioned in the project description. Write correct, working code.`; const code = await kpnRun(agentPrompts.coder.model, coderPrompt); if (!code) {