scidex/senate/cgroup_isolation.py already enforcesRESOURCE_LIMITS. Half thescidex/forge/resource_predictor.py exposespredict(script_text, runtime_name, input_sizes_mb) returning{cpu_seconds, peak_rss_mb, wall_seconds, confidence}.
RuntimeResult history rows (joined to existingforge_runtime log lines); features include script-token counts ofscanpy, torch, pyscenic, pymc), runtime name,resource_prediction(analysis_id, predicted_cpu_s,deterministic mode is off, setmemory_limit_mb = 1.5 * predicted_rss_mb, capped to host budget;timeout_seconds = max(60, 1.3 * predicted_wall_s).
/forge/resource-predictor page renders prediction-vs-actual scatterscidex-predictor-retrain.timer oncesklearn.ensemble.GradientBoostingRegressor per target —tool_chains.py import-detection scaffolding.predicted ± 1.96 * residual_std_for_this_runtime.scidex/senate/cgroup_isolation.py, forge/runtime.py,scidex/forge/executor.py.Files created/modified:
scidex/forge/resource_predictor.py — GBR model per target; predict(), train(),record_prediction(), settle_actuals(), get_accuracy_stats(), retrain_if_ready().analyses.resource_costmigrations/add_resource_prediction_table.py — Creates resource_prediction table withsettled_at.
scidex/forge/executor.py — LocalExecutor.run_analysis now calls predict() pre-run,record_prediction(), overrides memory_limit_mb and timeout_seconds1.5×predicted_rss / max(60, 1.3×predicted_wall) when confidence > 5%, and callssettle_actuals() post-run.
api.py — Added GET /forge/resource-predictor (HTML dashboard with Chart.js scatter),GET /api/forge/resource-predictor/stats, POST /api/forge/resource-predictor/predict.
deploy/bootstrap/systemd/scidex-predictor-retrain.service + .timer — weekly retrainretrain_if_ready() (no-op until ≥100 settled rows).Dry-run mode: Set RESOURCE_PREDICTOR_DRY_RUN=1 to predict without enforcing.
Acceptance criteria status:
predict() function with correct signature and return keysresource_prediction migration applied1.5×rss + 1.3×wall with host budget ceiling/forge/resource-predictor scatter + R² dashboardscidex-predictor-retrain.timer weekly, ≥100-row guard