Generator training mode: train pool, eval overlap check, category mix, error-targeted tasks

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 11:53:07 +02:00
parent 3a9f9e75fc
commit 229f862600
3 changed files with 261 additions and 1 deletions

View File

@@ -393,7 +393,8 @@ def failure_summary(rep):
def generate(task_id, pool, object_type, category, difficulty, model, base_url, run_base, topic=None,
max_repairs=3):
max_repairs=3, extra_check=None):
"""extra_check(bundle) -> list of problems; it runs with the static checks (training mode: overlap)."""
check_budget()
pool_root = os.path.join(ROOT, "tasks_gen", pool)
task_dir = os.path.join(pool_root, task_id)
@@ -411,6 +412,8 @@ def generate(task_id, pool, object_type, category, difficulty, model, base_url,
b = parse_bundle(text)
b.get("task", {}).setdefault("category", category)
found = {"structure": check_bundle(b), "static": lint_files(b), "abaplint": abaplint_files(b)}
if extra_check and not found["structure"]:
found["extra"] = extra_check(b)
except Exception as e: # noqa: BLE001
b, found = None, {"json": [f"invalid JSON: {e}"]}
errs = [e for v in found.values() for e in v]