From a12bd7ce7f98058c035ed30de66d403ec3f6b7af Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 12:07:51 +0300 Subject: [PATCH] One-liner koodi: system prompt vaatii rivinvaihdot + staattinen tarkistus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ollaman system prompt: 'Use proper newlines and indentation'. Staattinen analyysi: havaitsee jos .py-tiedosto on yhdellä rivillä. Native node vaatii rebuildin. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/native-node/src/inference.rs | 2 +- network-poc/static/index.html | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/network-poc/native-node/src/inference.rs b/network-poc/native-node/src/inference.rs index b6bde90..6275141 100644 --- a/network-poc/native-node/src/inference.rs +++ b/network-poc/native-node/src/inference.rs @@ -49,7 +49,7 @@ impl LlmEngine { } pub async fn generate(&self, prompt: &str, max_tokens: usize) -> Result { - let system = "You are a coding assistant. Respond with ONLY code. No explanations, no markdown, no comments unless asked."; + let system = "You are a coding assistant. Respond with ONLY code. Use proper newlines and indentation. No explanations, no markdown fences, no comments unless asked."; let model = self.model.borrow().clone(); let start = Instant::now(); diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 837a19e..e621fd6 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2597,6 +2597,10 @@ IMPORTANT: Keep the code SHORT. Max ~60 lines. No comments, no docstrings. Write // Tarkista tyhjät funktiot const emptyFuncs = code.match(/def \w+\([^)]*\):\s*\n\s*(pass|\.\.\.)/g); if (emptyFuncs) staticIssues.push(`${name}: ${emptyFuncs.length} tyhjää funktiota`); + // Tarkista one-liner koodi (kaikki yhdellä rivillä) + if (lines.length <= 2 && code.length > 200) { + staticIssues.push(`${name}: koodi on yhdellä rivillä (${code.length} merkkiä) — generoi uudelleen`); + } // Tarkista tiedostojen väliset importit (from db import get_db → onko get_db db.py:ssä?) for (const imp of imports) {