fetch_ml/internal/worker
Jeremie Fraeys 3187ff26ea
refactor: complete maintainability phases 1-9 and fix all tests
Test fixes (all 41 test packages now pass):
- Fix ComputeTaskProvenance - add dataset_specs JSON output
- Fix EnforceTaskProvenance - populate all metadata fields in best-effort mode
- Fix PrewarmNextOnce - preserve prewarm state when queue empty
- Fix RunManifest directory creation in SetupJobDirectories
- Add ManifestWriter to test worker (simpleManifestWriter)
- Fix worker ID mismatch (use cfg.WorkerID)
- Fix WebSocket binary protocol responses
- Implement all WebSocket handlers: QueueJob, QueueJobWithSnapshot, StatusRequest,
  CancelJob, Prune, ValidateRequest (with run manifest validation), LogMetric,
  GetExperiment, DatasetList/Register/Info/Search

Maintainability phases completed:
- Phases 1-6: Domain types, error system, config boundaries, worker/API/queue splits
- Phase 7: TUI cleanup - reorganize model package (jobs.go, messages.go, styles.go, keys.go)
- Phase 8: MLServer unification - consolidate worker + TUI into internal/network/mlserver.go
- Phase 9: CI enforcement - add scripts/ci-checks.sh with 5 checks:
  * No internal/ -> cmd/ imports
  * domain/ has zero internal imports
  * File size limit (500 lines, rigid)
  * No circular imports
  * Package naming conventions

Documentation:
- Add docs/src/file-naming-conventions.md
- Add make ci-checks target

Lines changed: +756/-36 (WebSocket fixes), +518/-320 (TUI), +263/-20 (Phase 8-9)
2026-02-17 20:32:14 -05:00
..
execution refactor: Phase 7 - TUI cleanup - reorganize model package 2026-02-17 20:22:04 -05:00
executor feat: Implement all worker stub methods with real functionality 2026-02-17 17:37:56 -05:00
integrity refactor: Phase 7 - TUI cleanup - reorganize model package 2026-02-17 20:22:04 -05:00
interfaces refactor: Phase 1 - Extract worker interfaces 2026-02-17 14:10:03 -05:00
lifecycle refactor: Implement TaskExecutorAdapter and Worker.runningCount() 2026-02-17 16:15:41 -05:00
artifacts.go perf: add profiling benchmarks and parallel Go baseline for C++ optimization 2026-02-12 12:04:02 -05:00
config.go refactor: Phase 4 - split worker package into focused files 2026-02-17 12:57:02 -05:00
factory.go refactor(phase7): Initialize JobRunner in factory.go 2026-02-17 16:40:03 -05:00
gpu.go feat: Implement all worker stub methods with real functionality 2026-02-17 17:37:56 -05:00
gpu_detector.go feat(worker): add integrity checks, snapshot staging, and prewarm support 2026-01-05 12:31:13 -05:00
hash_selector.go feat: Implement all worker stub methods with real functionality 2026-02-17 17:37:56 -05:00
metrics.go feat: Implement all worker stub methods with real functionality 2026-02-17 17:37:56 -05:00
native_bridge.go feat: implement C++ native libraries for performance-critical operations 2026-02-16 20:38:04 -05:00
native_bridge_libs.go feat: add native library bridge and queue integration 2026-02-16 20:38:30 -05:00
native_bridge_nocgo.go feat: add native library bridge and queue integration 2026-02-16 20:38:30 -05:00
snapshot_store.go refactor: Phase 6 - Complete migration, remove legacy files 2026-02-17 14:39:48 -05:00
testutil.go refactor: Phase 7 - TUI cleanup - reorganize model package 2026-02-17 20:22:04 -05:00
worker.go refactor: complete maintainability phases 1-9 and fix all tests 2026-02-17 20:32:14 -05:00