43634ef77a
cli.py and scripts/train.py duplicated ~140 lines of training setup and had drifted (scripts/train.py forgot to save model_config, breaking predict on those checkpoints). Extract shared logic into giant/constants.py (X_DIM, target names), giant/config.py (device/git/TOML/seeding helpers, run metadata), and giant/pipeline.py (the actual training-job orchestration), so both entry points become thin CLI wrappers around the same code path. Also adds --seed/--resume support (checkpoints now carry optimizer/scheduler state, epoch, and best_val_loss), a richer [meta] section in the saved config.toml (git hash, seed, versions, timestamp, invocation, dataset stats), and a metrics.csv (train/val loss, lr, epoch time) written every epoch and append-safe across resumes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>