From 9aff2ec154181f96d475f1125059b6f83e906bf1 Mon Sep 17 00:00:00 2001 From: Jaakko Vanhala Date: Fri, 10 Apr 2026 07:59:10 +0300 Subject: [PATCH] uv kauttaaltaan + Tarkkailijan raportti rakenteelliseksi markdowniksi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uv-päivitykset: - Koodarin NEVER-lista: ei requirements.txt, ei pip, käytä uv - Template pyproject.toml: PEP 621, uv-yhteensopiva - Raportin Quick Start: uv sync + uv run uvicorn Tarkkailijan raportti uudessa formaatissa: - Overview (yksi kappale) - Files (taulukko: tiedosto + tarkoitus) - Quick Start (uv-komennot koodiblokissa) - Docker (build + run koodiblokissa) - API Endpoints (taulukko: method, path, description) - Architecture (rakenne ja päätökset) - Risk Assessment (taulukko: severity, issue) Malli saa taulukkopohjat valmiina → täyttää ne oikealla datalla. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../public/templates/fastapi-crud.json | 2 +- network-poc/frontend/src/pages/index.astro | 34 ++++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/network-poc/frontend/public/templates/fastapi-crud.json b/network-poc/frontend/public/templates/fastapi-crud.json index 1f642d0..cc6c988 100644 --- a/network-poc/frontend/public/templates/fastapi-crud.json +++ b/network-poc/frontend/public/templates/fastapi-crud.json @@ -20,7 +20,7 @@ "pyproject.toml": { "description": "Project dependencies", "example": "[project]\nname = \"myapp\"\nversion = \"0.1.0\"\nrequires-python = \">=3.11\"\ndependencies = [\n \"fastapi\",\n \"uvicorn[standard]\",\n \"sqlalchemy\",\n]\n\n[project.scripts]\ndev = \"uvicorn main:app --reload\"", - "instructions": "List the exact dependencies needed. Use [project.scripts] for run commands." + "instructions": "Use [project] format (PEP 621, compatible with uv). List dependencies under [project.dependencies]. Add [project.scripts] with dev command. Never use requirements.txt or Poetry format. Run with: uv run uvicorn main:app --reload" } }, "order": ["models.py", "schemas.py", "main.py", "pyproject.toml"] diff --git a/network-poc/frontend/src/pages/index.astro b/network-poc/frontend/src/pages/index.astro index 4f95a1b..346b5f0 100644 --- a/network-poc/frontend/src/pages/index.astro +++ b/network-poc/frontend/src/pages/index.astro @@ -101,7 +101,9 @@ NEVER: - Add explanations or comments like "# Add routes here" - Leave placeholder code or TODO comments - Use Flask syntax (app.run) in FastAPI projects -- Forget to import from other project files` }, +- Forget to import from other project files +- Use requirements.txt or Poetry — always use pyproject.toml with [project] format (PEP 621) +- Use pip install — use uv (e.g. uv run uvicorn main:app --reload)` }, data: { name: 'Data', avatar: '/avatars/pesukarhu_notext.png', model: 'qwen-coder', order: 2, temperature: 0.5, topK: 40, repeatPenalty: 1.15, maxTokens: 1024, prompt: `You are a database architect specializing in SQLAlchemy and relational databases. @@ -878,15 +880,29 @@ OUTPUT FORMAT: highlightAgent('observer'); explainStep('Raportti', `${obs.name} kokoaa yhteenvedon ja antaa arvosanan.`); const finalCode = Object.entries(files).map(([n,c]) => `--- ${n} ---\n${c}`).join('\n\n'); + const fileList = Object.keys(files).join(', '); const obsPrompt = (obs.prompt ? obs.prompt+'\n\n' : '') + - `Write a project README.md report in markdown for: ${task}\n\n` + - `IMPORTANT: Start the FIRST LINE with exactly one of these verdicts:\n` + - `VERDICT: GREEN — project is production-ready, no issues\n` + - `VERDICT: ORANGE — project works but has warnings or improvements needed\n` + - `VERDICT: RED — project has critical issues that must be fixed\n\n` + - `Then include:\n` + - `# Project: ${task}\n` + - `## Files\n## How to run\n## API Endpoints\n## Architecture\n## Risk assessment\n\n` + + `Write a project report in clean markdown for: ${task}\n\n` + + `FIRST LINE must be exactly one of:\n` + + `VERDICT: GREEN\nVERDICT: ORANGE\nVERDICT: RED\n\n` + + `Then write this report:\n\n` + + `# ${task}\n\n` + + `## Overview\nOne paragraph describing what this project does.\n\n` + + `## Files\n| File | Purpose |\n|------|---------|` + + Object.entries(files).map(([n]) => `\n| ${n} | ... |`).join('') + `\n\n` + + `## Quick Start\n` + + '```bash\n' + + `git clone \ncd project\nuv sync\nuv run uvicorn main:app --reload\n` + + '```\n\n' + + `## Docker\n` + + '```bash\n' + + `docker build -t ${task.toLowerCase().replace(/[^a-z0-9]/g, '-')} .\ndocker run -p 8000:8000 ${task.toLowerCase().replace(/[^a-z0-9]/g, '-')}\n` + + '```\n\n' + + `## API Endpoints\n| Method | Path | Description |\n|--------|------|-------------|` + + `\n| POST | /items/ | Create |\n| GET | /items/ | List all |\n| GET | /items/{id} | Get by ID |\n| PUT | /items/{id} | Update |\n| DELETE | /items/{id} | Delete |\n` + + `(Adapt paths and descriptions to match the actual code)\n\n` + + `## Architecture\nDescribe the project structure and design decisions.\n\n` + + `## Risk Assessment\n| Severity | Issue |\n|----------|-------|\n| ... | ... |\n\n` + `Project code:\n${finalCode}`; const readme = await kpnRun(obs.model, obsPrompt); if (readme) {