soup/soup_cli
Alpamys 7da82d355a feat(adapters): v0.57.0 — git for LoRA (diff, merge, blame, branch)
Ships "soup adapters {diff,merge,blame,branch,checkout,branches}" — git-shaped
UX for LoRA adapter management. Pure-numpy math (no torch); TOCTOU defence on
every path; atomic writes throughout.

Part A — adapters diff (utils/adapter_diff.py, ~270 LOC):
  Per-layer ΔW Frobenius norm + relative drift; effective-rank delta via
  SVD entropy; top-K changed projections; JSON/Markdown/table output.

Part B — adapters merge (utils/adapter_merge.py, ~280 LOC):
  Four strategies — linear (weighted avg), ties (Yadav et al. — trim/
  elect-sign/disjoint), dare (Yu et al. — drop+rescale, deterministic),
  svd (low-rank reconstruction). MergeReport.verdict='UNKNOWN' is a stub;
  live canary verdict via v0.55 eval gate ships in v0.57.1.

Part C — adapters blame (utils/blame.py, ~190 LOC):
  Leave-one-out plan emitter + budget tracker (parse_budget mirrors v0.48.0
  data_mix idiom). Per-shard work table + feasibility check. Live ablation
  runner raises NotImplementedError v0.57.1 (mirrors v0.27.0 / v0.50.0 /
  v0.56.0 stub-then-live pattern).

Part D — adapters branch / checkout / branches (utils/adapter_branch.py,
~230 LOC):
  SHA-256 snapshot pointers under ~/.soup/branches/ (SOUP_BRANCHES_DIR
  override, $HOME/$CWD/$TMPDIR-bounded). Drift detection on checkout —
  refuses restore when source SHA != snapshot SHA. CRLF/null-byte
  rejection on env override (mirrors v0.51.0 hub-endpoint policy).

5-agent review-fix wave (1 CRITICAL + 9 HIGH + 11 MEDIUM + 4 LOW):
  - TIES tied-sign defaults to +1 (np.sign(0)==0 would silently zero all
    tied parameters)
  - load_branch / delete_branch reject symlinks via os.lstat + S_ISLNK
    before read/unlink
  - merge output safetensors + adapter_config.json atomic writes with
    symlink target rejection at output path; source config size-capped
    at 256 KB
  - compute_adapter_diff weights-file path symlink-rejected via lstat
    BEFORE is_file() (defends against .safetensors -> /etc/passwd escape)
  - _count_dataset_rows opens via realpath captured at containment check
    (closes TOCTOU window)
  - diff --output write is atomic (tempfile + os.replace)
  - SOUP_BRANCHES_DIR rejects every C0 control char, not just null
  - SUPPORTED_STRATEGIES is now frozenset (matches v0.41.0+ allowlist
    policy); STRATEGY_ORDER tuple preserved for canonical iteration
  - 5× pytest.raises(Exception) tightened to FrozenInstanceError
  - 2 zero-assertion Part D tests converted to real assertions
  - Added: bool base_model rejection, top_k boundary 1/201, density=1.0
    inclusive bound, inf weight rejection, tied-sign positive default,
    bool False for num_shards/budget_seconds, POSIX symlink rejections
    for diff weights / merge output / load_branch / delete_branch,
    no-top-level-torch source-grep guards, traversal delete_branch.

Plus v0.56.0 follow-up: test_v0560.py version-floor tests widened from
exact-match to floor-check (matches v0.51.0 / v0.54.0 idiom — every
subsequent release would otherwise edit this one line).

Test count: 8849 → 8998 (+149 net in 4 new files; 4 POSIX-only symlink
tests skipped on Windows). Full suite green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 18:37:14 +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(adapters): v0.57.0 — git for LoRA (diff, merge, blame, branch) 2026-05-15 18:37:14 +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(eval): soup eval design — derive evals from data (v0.55.0) 2026-05-15 12:44:14 +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 feat(diagnose): soup diagnose — post-training model report card (v0.56.0) 2026-05-15 15:03:00 +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(adapters): v0.57.0 — git for LoRA (diff, merge, blame, branch) 2026-05-15 18:37:14 +05:00
__init__.py feat(adapters): v0.57.0 — git for LoRA (diff, merge, blame, branch) 2026-05-15 18:37:14 +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(diagnose): soup diagnose — post-training model report card (v0.56.0) 2026-05-15 15:03:00 +05:00
tui_app.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00