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) {