Fix runaway experiments: cap at 50 trials, fix DB permissions

Bugs fixed:
- Ratchet loop had no trial cap — experiment #1 ran 3762 trials
  unchecked. Now capped at max_trials=50 per start cycle.
- meta_pipelines, meta_runs, self_reports tables had no GRANT
  for kbuser — fixed permissions for all tables and sequences.

All 4 running experiments auto-paused on restart.
Stress test confirms all tables accessible, all models responding,
meta-pipeline creation working, self-report save/retrieve working.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
root 2026-03-26 04:56:37 -05:00
parent 4dc561af12
commit 28df789745

View File

@ -6339,8 +6339,9 @@ def _ratchet_loop(exp_id):
# Pick meta-model (largest in pool)
meta_model = models_pool[-1] if models_pool else "qwen2.5:latest"
judge_model = models_pool[0] if models_pool else "llama3.2:latest"
max_trials = 50 # safety cap — prevents runaway experiments
while True:
while trial_num < max_trials:
# Check if still running
with get_db() as conn:
with conn.cursor() as cur: