soup/soup_cli
Alpamys 600686cd70 feat(advise): soup advise — pre-flight decision (v0.54.0)
`soup advise <data.jsonl> --goal "..."` returns one of PROMPT_ENG /
RAG / SFT / DPO / GRPO with a confidence, reason, and reverse-when
criterion BEFORE the user spends 8 hours on a GPU. Layer above
autopilot — autopilot picks hyperparams AFTER the training decision;
advise picks the training decision itself.

Three Parts:
- Part A: Verdict engine — TASK_CATEGORIES + CHOICES allowlists,
  frozen Verdict / DatasetProfile / ROIEstimate dataclasses, pure-
  Python classify_task + compute_dataset_profile + build_verdict
  rubric (DPO / GRPO floor 500 / PROMPT_ENG floor 50 / RAG / SFT).
- Part B: Probe runner — synth_probe_baselines + synth_probe_lora_delta
  heuristic stubs with forward-compat model/device/lr/timeout_seconds
  kwargs (v0.54.1 lifts to live model loading per stub-then-live
  cadence used by v0.27.0 MII / v0.37.0 multipack / v0.50.0 GRPO Plus).
- Part C: Cross-project learning — ~/.soup/advise_history.jsonl with
  cross-process file locking (fcntl on POSIX, sidecar <path>.lock +
  msvcrt on Windows). `soup advise compare` reads history; env
  override SOUP_ADVISE_HISTORY_PATH containment-checked to $HOME /
  $CWD / tempdir (mirrors v0.36.0 SOUP_BATCH_CACHE_PATH policy).

CLI: Typer subcommand group `run` / `explain` / `compare` plus argv
preprocessor in cli.py that maps `soup advise data.jsonl` →
`soup advise run data.jsonl`. Scoped to argv[1] == "advise" only
(code-review HIGH fix — defends against rewrites when an unrelated
arg contains the literal string "advise").

Schema: AdviseConfig (goal / probe / record) field on SoupConfig
honors the plan's cross-cutting bullet.

Security: cwd-containment + os.lstat + S_ISLNK symlink reject on
every path input; atomic writes via tempfile.mkstemp + os.replace
on scratch + history; per-line 64 KB cap + 16 MiB file cap on
history reads; bool / finite / NUL / oversize guards on every public
input; Rich markup escape on user-controlled output.

Reviewed by python / code / security / tdd / architect agents — every
finding fixed before commit (0 CRITICAL + 5 HIGH + 7 MEDIUM + 4 LOW).

Test count: 8400 → 8571 (+136 in tests/test_v0540.py, +35 net
adjustments to v0.53.x version-pin assertions to forward-compat >=).

Note: Windows CRLF / LF warnings during stage are .gitattributes-
governed and benign. CI runs on ubuntu-latest / windows-latest /
macos-latest × Python 3.9 / 3.11 / 3.12.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 21:48:19 +05:00
..
autopilot feat(v0.53.1): Quant Menu II + Export pipeline live 2026-05-13 00:16:03 +05:00
cans fix(v0.33.0): review-wave findings (CRITICAL + HIGH + MEDIUM + LOW) 2026-04-27 19:57:57 +05:00
commands feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
config feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
data feat(v0.53.8): Remote data + Hubs + Trackers (wave 2) — 6 features 2026-05-13 23:55:23 +05:00
eval feat(eval): Tracker & Eval Pro — 18 features (v0.43.0) 2026-05-10 18:04:40 +05:00
experiment feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00
migrate feat: v0.21.0 — migrate, recipes, NEFTune, rsLoRA 2026-04-02 14:08:36 +05:00
monitoring feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
plugins feat(v0.45.0): Plugin System & Ecosystem Wins — 5 Parts, +169 tests 2026-05-10 21:21:04 +05:00
recipes feat(adaptive): v0.53.5 — Adaptive Training (BETA → stable) 2026-05-13 15:55:28 +05:00
registry fix(v0.33.0): review-wave findings (CRITICAL + HIGH + MEDIUM + LOW) 2026-04-27 19:57:57 +05:00
templates feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
trainer feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
ui feat(v0.53.10): Quick wins + packaging + UX wiring 2026-05-14 13:58:20 +05:00
utils feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
__init__.py feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
__main__.py Add Phase 3.1: friendly errors, soup doctor, soup quickstart, UX polish (v0.3.1) 2026-03-05 19:10:36 +05:00
cli.py feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
tui_app.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00