{"record":{"id":"8588878c2f0f238b","repo":"affaan-m/ECC","slug":"warn","errorCode":null,"errorMessage":"[WARN] $*","messagePattern":"\\[WARN\\] \\$\\*","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"scripts/gan-harness.sh","lineNumber":57,"sourceCode":"HARNESS_DIR=\"${PROJECT_DIR}/gan-harness\"\nFEEDBACK_DIR=\"${HARNESS_DIR}/feedback\"\nSCREENSHOTS_DIR=\"${HARNESS_DIR}/screenshots\"\nSTART_TIME=$(date +%s)\n\n# Colors\nRED='\\033[0;31m'\nGREEN='\\033[0;32m'\nYELLOW='\\033[1;33m'\nBLUE='\\033[0;34m'\nPURPLE='\\033[0;35m'\nCYAN='\\033[0;36m'\nNC='\\033[0m'\n\n# ─── Helpers ─────────────────────────────────────────────────────────────────\n\nlog()    { echo -e \"${BLUE}[GAN-HARNESS]${NC} $*\"; }\nok()     { echo -e \"${GREEN}[✓]${NC} $*\"; }\nwarn()   { echo -e \"${YELLOW}[WARN]${NC} $*\"; }\nfail()   { echo -e \"${RED}[✗]${NC} $*\"; }\nphase()  { echo -e \"\\n${PURPLE}═══════════════════════════════════════════════${NC}\"; echo -e \"${PURPLE}  $*${NC}\"; echo -e \"${PURPLE}═══════════════════════════════════════════════${NC}\\n\"; }\n\nextract_score() {\n  # Extract the TOTAL weighted score from a feedback file\n  local file=\"$1\"\n  # Look for **TOTAL** or **X.X/10** pattern\n  grep -oP '(?<=\\*\\*TOTAL\\*\\*.*\\*\\*)[0-9]+\\.[0-9]+' \"$file\" 2>/dev/null \\\n    || grep -oP '(?<=TOTAL.*\\|.*\\| \\*\\*)[0-9]+\\.[0-9]+' \"$file\" 2>/dev/null \\\n    || grep -oP 'Verdict:.*([0-9]+\\.[0-9]+)' \"$file\" 2>/dev/null | grep -oP '[0-9]+\\.[0-9]+' \\\n    || echo \"0.0\"\n}\n\nscore_passes() {\n  local score=\"$1\"\n  local threshold=\"$2\"\n  awk -v s=\"$score\" -v t=\"$threshold\" 'BEGIN { exit !(s >= t) }'\n}","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/affaan-m/ECC/blob/d8409a4b0813771235555e32e3d8046a73988bfa/scripts/gan-harness.sh#L39-L75","documentation":"warn() at scripts/gan-harness.sh:57 prints '[WARN] <text>' in yellow as the generate-vs-evaluator harness's non-fatal degradation channel. Two live call sites use it: 'Evaluator did not produce feedback file. Assuming score 0.0' (the evaluator stage emitted no feedback file, so extract_score falls through its grep chain to 0.0) and 'Score plateau detected (no improvement for 2 iterations). Stopping early.' (the loop's early-stop heuristic on the TOTAL weighted score).","triggerScenarios":"The evaluator command/agent fails or writes its feedback file somewhere the harness does not look, so no file is found; the feedback file exists but none of extract_score's patterns match (**TOTAL** N, 'TOTAL | ... | **N**', 'Verdict: ... N.N'), also yielding 0.0; the generator's TOTAL weighted score stays flat for 2 consecutive iterations, triggering early stop.","commonSituations":"Misconfigured evaluator output path; evaluator crashing on malformed spec.md; genuine convergence/plateau; feedback format drift breaking the grep patterns so real scores read as 0.0 and the loop 'plateaus' immediately.","solutions":["Confirm the evaluator writes its feedback file to the exact path the harness greps and that the run order (planner -> generator -> evaluator) completed.","Check the evaluator's own stderr/logs — a missing feedback file usually means it crashed.","If scores are wrongly 0.0, align the feedback file's format with extract_score's patterns (emit '**TOTAL** N.N' or 'Verdict: ... N.N').","For genuine plateaus, inspect the last two feedback files to confirm scores truly flatlined before accepting the early stop."],"exampleFix":"# before: feedback file only says \"looks good\" -> extract_score returns 0.0 -> '[WARN] ... Assuming score 0.0'\n# after: emit a parseable score the harness recognizes\nprintf '**TOTAL** 7.5/10\\n' >> \"$FEEDBACK_FILE\"","handlingStrategy":"fallback","validationCode":"# After the evaluator stage, confirm a parseable feedback file exists before scoring\nif [ ! -s \"$FEEDBACK_FILE\" ]; then\n  echo \"evaluator produced no feedback file; check evaluator logs\" >&2\n  exit 1\nfi\nif ! grep -qE '\\*\\*TOTAL\\*\\*[0-9 ]+\\.[0-9]|Verdict:.*[0-9]+\\.[0-9]+' \"$FEEDBACK_FILE\"; then\n  echo \"feedback file lacks a parseable score line\" >&2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make the evaluator's output path and score format (e.g. '**TOTAL** N.N') an explicit contract with the harness.","Fail the harness on a missing feedback file when you care about real scores instead of accepting the 0.0 fallback.","Log evaluator stderr alongside the loop so '[WARN] ... Assuming score 0.0' has an explanation next to it.","Tune or disable the plateau early-stop when iterating on prompts, or you will mistake it for convergence."],"tags":["shell","gan-harness","evaluation","cli"],"backgroundTag":"evaluator-output-missing","analyzedSha":"d8409a4b0813771235555e32e3d8046a73988bfa","analyzedAt":"2026-08-26T12:15:34.022Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}