Commit graph

102 commits

Author SHA1 Message Date
8873920b83 feat: SftCard — quality chip, prompt collapsible, action buttons, correction area slot 2026-04-08 15:19:37 -07:00
2d939b77f9 feat: SftCorrectionArea — inline correction text area component 2026-04-08 15:16:45 -07:00
137a9dbb8e fix: nullable failure_reason, factory fixture for sft store tests 2026-04-08 15:14:29 -07:00
9c11916d81 feat: useSftStore — SftQueueItem type and Pinia store 2026-04-08 15:11:17 -07:00
b6d45c746c fix: shared _is_exportable predicate, return type annotations on export/stats 2026-04-08 15:07:24 -07:00
07807f0d05 feat: sft router — /export and /stats endpoints 2026-04-08 14:46:08 -07:00
4ad2907ae8 fix: use Literal type for SubmitRequest.action field 2026-04-08 14:33:38 -07:00
f19cab60f7 feat: sft router — /queue, /submit, /undo endpoints 2026-04-08 14:22:06 -07:00
b330e84111 fix: sft router — yaml error handling, none filter, shared jsonl utils, fixture restore 2026-04-08 14:07:09 -07:00
597ffc7324 feat: sft router skeleton — /api/sft/runs and /api/sft/import 2026-04-08 13:54:58 -07:00
cfde474454 fix: log on malformed json in _read_jsonl, use streaming id dedup 2026-04-08 07:37:22 -07:00
bbfae1a622 fix: log warning when sft record is missing id field 2026-04-08 07:30:46 -07:00
03dac57fd9 feat: sft_import.py — run discovery and JSONL deduplication 2026-04-08 07:13:37 -07:00
25880e377d refactor: consolidate HTML extraction into app/utils.py
Rename _strip_html/_extract_body to strip_html/extract_body (public API).
Remove duplicate _TextExtractor, strip_html, and _extract_body from
imap_fetch.py; import from app.utils instead. Update test_label_tool.py
to use the new public names.
2026-04-08 06:52:15 -07:00
ae0ac19505 chore: retire Streamlit app, scaffold sft branch
- Delete app/label_tool.py (Streamlit UI retired; Vue SPA is sole UI)
- Extract _strip_html and _extract_body into app/utils.py (stdlib-only, reusable)
- Update tests/test_label_tool.py import to app.utils
- Rename start-api/stop-api/restart-api/open-api → start/stop/restart/open in manage.sh
- Remove STREAMLIT variable and all Streamlit-specific case blocks from manage.sh
- Update manage.sh usage section to reflect Vue+FastAPI-only commands
- Add data/sft_candidates.jsonl and data/sft_approved.jsonl to .gitignore
- Add sft.bench_results_dir key to config/label_tool.yaml.example
2026-04-08 06:18:12 -07:00
de2a2935b9 chore: gitignore CLAUDE.md and docs/superpowers (BSL 1.1 compliance) 2026-03-27 01:00:30 -07:00
0d252da2a0 feat(avocet): add cancel buttons for benchmark and fine-tune runs 2026-03-15 18:15:35 -07:00
e38a28dcc3 fix(avocet): narrow cancel except clause, clear stale cancel flags on new run
- except clause in cancel_benchmark/cancel_finetune narrowed from Exception
  to _subprocess.TimeoutExpired (C1)
- _cancelled_jobs.discard() called after registering new proc to prevent
  a stale flag from a prior run masking errors (I2)
- local `import subprocess` removed from run_benchmark and
  run_finetune_endpoint; all Popen calls updated to _subprocess.Popen (I1)
- test patch targets updated from subprocess.Popen to app.api._subprocess.Popen;
  cancelled-event tests updated to set flag in proc.wait() side-effect so
  the discard-on-new-run logic is exercised correctly
2026-03-15 18:13:01 -07:00
0ab49609c0 feat(avocet): add cancel endpoints for benchmark and finetune jobs
Adds POST /api/benchmark/cancel and POST /api/finetune/cancel endpoints
that terminate the running subprocess (kill on 3s timeout), and updates
the run generators to emit a cancelled SSE event instead of error when
the job was intentionally stopped.
2026-03-15 18:09:20 -07:00
db44c9323e fix(avocet): use_reentrant=False for gradient checkpointing
Reentrant gradient checkpointing (the default) conflicts with Accelerate's
gradient accumulation context manager -- causes 'backward through graph a
second time' on the first training step. use_reentrant=False uses the
non-reentrant autograd hook path which is compatible with Accelerate >= 0.27.
2026-03-15 17:23:40 -07:00
cbc382cc88 fix(avocet): reduce deberta-small VRAM + auto-select freest GPU for training
- deberta-small: batch_size 16→8 + grad_accum 1→2 (same effective batch),
  gradient_checkpointing=True (fp16 stays off: DeBERTa v3 disentangled
  attention overflows fp16 at the gather step)
- api: _best_cuda_device() picks highest free-VRAM GPU via nvidia-smi;
  sets CUDA_VISIBLE_DEVICES in subprocess env to prevent DataParallel
  replication across both GPUs; adds PYTORCH_ALLOC_CONF=expandable_segments
- SSE log now reports which GPU was selected
2026-03-15 17:09:06 -07:00
ed818dc341 feat(avocet): add restart-api command to manage.sh 2026-03-15 17:04:00 -07:00
5d68b0706f fix(avocet): use startsWith for error class in ft-log (consistent with benchmark log) 2026-03-15 16:14:47 -07:00
65548f4ddb feat(avocet): add fine-tune section and trained models badge row to BenchmarkView 2026-03-15 16:09:51 -07:00
dd352f07cd fix(avocet): _MODELS_DIR overridable in tests; sanitize score paths against path traversal 2026-03-15 16:07:27 -07:00
903624a4b8 feat(avocet): add /api/finetune/status and /api/finetune/run endpoints 2026-03-15 16:04:34 -07:00
48e02f2ed6 fix(avocet): move TorchDataset import to top; split sample_count into total+train 2026-03-15 16:02:43 -07:00
939ce06f45 feat(avocet): run_finetune, CLI, multi-score-file merge with last-write-wins dedup
- load_and_prepare_data() now accepts Path | list[Path]; single-Path callers unchanged
- Dedup by MD5(subject + body[:100]); last file/row wins (lets later runs correct labels)
- Prints summary line when duplicates are dropped
- Added _EmailDataset (TorchDataset wrapper), run_finetune(), and argparse CLI
- run_finetune() saves model + tokenizer + training_info.json with score_files provenance
- Stratified split guard: val set size clamped to at least n_classes (handles tiny example data)
- 3 new unit tests (merge, last-write-wins dedup, single-Path compat) + 1 integration test
- All 16 tests pass (15 unit + 1 integration)
2026-03-15 15:52:41 -07:00
4e70e79b26 fix(avocet): tighten body truncation test to exact 400-char assertion 2026-03-15 15:44:19 -07:00
de5794611b feat(avocet): add finetune data pipeline, class weights, WeightedTrainer
Implements load_and_prepare_data (JSONL ingestion with class filtering),
compute_class_weights (inverse-frequency, div-by-zero safe), compute_metrics_for_trainer
(macro F1 + accuracy), and WeightedTrainer.compute_loss (**kwargs-safe for
Transformers 4.38+ num_items_in_batch). All 12 tests pass.
2026-03-15 15:38:45 -07:00
d1a36bfd63 fix(avocet): guard discover_finetuned_models against malformed/incomplete training_info.json 2026-03-15 15:18:13 -07:00
df37a8e16d feat(avocet): auto-discover fine-tuned models in benchmark harness 2026-03-15 11:59:13 -07:00
179cb67e1c fix(avocet): FineTunedAdapter GPU device routing + precise body truncation test 2026-03-15 10:56:47 -07:00
dc321de59f feat(avocet): add FineTunedAdapter for local checkpoint inference 2026-03-15 10:54:38 -07:00
f4a654933d chore(avocet): add scikit-learn to classifier env 2026-03-15 09:44:04 -07:00
a53f3a7341 feat(avocet): benchmark UI, label fixes, BenchmarkView with charts and SSE run 2026-03-15 09:39:37 -07:00
ce1b8c2215 fix(avocet): reset card element state when new item loads to clear previous animation inline styles 2026-03-08 07:44:02 -07:00
f1933ab51c feat(avocet): badge pop via Anime.js spring transition hook 2026-03-08 07:35:49 -07:00
6a898bbdee fix(avocet): constrain grid-active to 640px on wide viewports using left/right offsets 2026-03-08 07:26:46 -07:00
efc2d33de2 feat(avocet): animate bucket grid rise with Anime.js spring 2026-03-08 07:17:56 -07:00
5c6aa02998 fix(avocet): restore drag aura color feedback via updateAura in useCardAnimation 2026-03-08 07:14:24 -07:00
9302644259 feat(avocet): wire Anime.js card animation into EmailCardStack
Replace CSS keyframe dismiss classes and inline cardStyle/deltaX/deltaY
with useCardAnimation composable — pickup/setDragPosition/snapBack/animateDismiss
are now called from pointer event handlers and a dismissType watcher.
2026-03-08 07:07:58 -07:00
b68c176278 feat(avocet): add useCardAnimation composable with Anime.js
TDD: 8 tests written first (red), then composable implemented (green).
Adapts to Anime.js v4 API: 2-arg animate(), object-param spring(),
utils.set() for instant drag-position updates without cache desync.
2026-03-08 06:52:27 -07:00
d02c937ff1 feat(avocet): add animejs v4 dependency 2026-03-08 06:47:50 -07:00
611f510547 docs: add privacy policy reference 2026-03-05 20:59:37 -08:00
1a95d4d580 fix(avocet): ball escapes overflow clip, floats above header/footer with z-index + transparency 2026-03-05 15:14:24 -08:00
351703d9db fix(avocet): grid pinned to viewport with height 100dvh + card ball floats above finger at scale 0.55 2026-03-05 15:07:58 -08:00
d7cd01a8da feat(avocet): add velocity-based fling detection to toss gesture (option B: speed + alignment) 2026-03-05 14:55:10 -08:00
8947dc5d05 feat(avocet): add toss-zone overlays and grid-rise animation to LabelView 2026-03-05 13:41:52 -08:00
fc8cb9a8bd feat(avocet): replace swipe+HTML5-drag with unified pointer-events toss gesture 2026-03-05 10:38:52 -08:00