6 Commits
Author SHA1 Message Date
mathias 308f71b566 fix(ci): Taskfile YAML syntax error + staticcheck tagged-switch (jepa-fx-risk#19)
CD / Build & Import (push) Failing after 10s
CD / Deploy via GitOps (push) Has been skipped
CD / Lint / Test / Vet (push) Successful in 7s
Taskfile.yml line 46 had an unquoted Go-template `{{.VAR}}` inside a YAML
flow sequence (`cmds: [...]`) -- the literal braces broke YAML parsing
outright ("did not find expected ',' or ']'"), so `task check` (and thus
CI's push-triggered check job) failed before running a single command.
A manual `workflow_dispatch` re-run passed because the autoresearch
workflow never calls `task check` at all -- unrelated path, not an
env/secret difference as first suspected. Quoted the string.

Also fixed a staticcheck QF1002 in internal/eval/var.go: a boolean
switch comparing the same variable (n1) in every case is a tagged
switch in disguise -- converted to `switch n1 { case 0: ... case n: ...
}`.
2026-07-24 15:26:01 +02:00
mathiasandClaude Sonnet 4.6 68bf8f15c5 feat(eval): VaR breach rate metric (#12) + HMM regime detector (#13) — rq-04 prep
CD / Lint / Test / Vet (push) Failing after 2s
CD / Build & Import (push) Has been skipped
CD / Deploy via GitOps (push) Has been skipped
#12 — VaR_breach_rate_99_oos_regime_cond metric:
- internal/eval/var.go: VaRBreachRate() + kupiecPOF() + LinearProbePredict() (stdlib math only)
- internal/eval/var_test.go: 8 golden tests (zero/all breach, perfect calibration, boundary)
- cmd/eval/main.go: -metric var flag (no-leakage probe → VaR → Kupiec P)
- scripts/var_breach.py: Python equivalent with METRIC_KEY constant (13 TDD tests)
- train.py LOCKED VaR EVAL BLOCK: writes VaR_breach_rate_99_oos_regime_cond + kupiec_p to metrics.json
- Fixed bug: train.py used bare 'os' before import; now uses module-level '_os' consistently

#13 — HMM regime detector + JEPA conditioning seam:
- scripts/prepare_regime.py: GaussianHMM (diag, 3-state) on realized_vol; states sorted by mean vol
  (0=calm, 1=stressed, 2=crisis); deterministic (random_state=42); outputs eurusd_regime.parquet
- tests/test_regime.py: 11 TDD tests (dtype, states, determinism, vol sort, daily fallback)
- train.py: JEPA_ENABLE_REGIME toggle + REGIME CONDITIONING SEAM (concat baseline, agent-editable)
- requirements.txt: hmmlearn>=0.3, scikit-learn>=1.4

78 Python + all Go tests green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 10:35:10 +02:00
mathiasandClaude Sonnet 4.6 20aeecb971 fix(eval): correct probe metric to use true year-based OOS split
CD / Lint / Test / Vet (push) Successful in 4s
CD / Build & Import (push) Failing after 7s
CD / Deploy via GitOps (push) Has been skipped
- train.py build(): year-based split (train≤2021, OOS≥2022) replaces
  misleading 70/30 mixed-period split; true OOS val_vol_r2 now ~-0.36
  vs previously reported +0.18 (artefact of cross-period data leakage)
- train.py: EXPORT_EMBEDDINGS block now exports both train+OOS embeddings
  with dates and HV labels for Go eval harness
- cmd/eval: LinearProbeTrainTest uses train stats for standardisation of
  both sets (no leakage); standardiseCompute/applyStandardise helpers
- internal/eval: add LinearProbeTrainTest (fit-on-train, eval-on-OOS)
  alongside LinearProbe (same-set); 8/8 tests still green

Phase-0 gate result: val_vol_r2=-0.36, silhouette=0.043, erank=58.9/64.
Backbone produces high-rank embeddings (SIGReg working) but does NOT
generalize across 2021→2022 regime boundary. Gate: INCONCLUSIVE/FAIL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 22:57:14 +02:00
mathiasandClaude Sonnet 4.6 e11e7d2524 feat(eval): Go evaluation harness — LinearProbe, Silhouette, EffectiveRank (#4)
CD / Build & Import (push) Failing after 7s
CD / Deploy via GitOps (push) Has been skipped
CD / Lint / Test / Vet (push) Successful in 4s
internal/eval: three pure-Go diagnostics on frozen embeddings:
  LinearProbe(emb, y, λ) → val_vol_r2 (OOS R², closed-form ridge, Cholesky)
  Silhouette(emb, labels) → mean silhouette (Euclidean, multi-label, errors on <2 classes)
  EffectiveRank(emb) → Roy effective rank (Jacobi eigenvalues → entropy → exp(H))

cmd/eval/main.go: CLI driver reading embeddings.json (exported by train.py with
EXPORT_EMBEDDINGS=1), standardises per-dim, dispatches to -metric flag.
task eval:probe / eval:silhouette / eval:collapse wired in Taskfile.

8/8 tests pass (red-green: perfect clusters, rank-1, full-rank, noise, constant
target, single-label error). Pure stdlib, no external deps.

Closes #4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 12:01:04 +02:00
mathiasandClaude Sonnet 4.6 f01bdde7c2 refactor: rename hostexecutor → jepa-fx-risk (#9)
Module path gitea.d-ma.be/mathias/hostexecutor → jepa-fx-risk.
cmd/hostexecutor → cmd/jepa-fx-risk. templ upgraded 0.2.778 → 0.3.1020.
Clean build + tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 11:58:42 +02:00
mathias d1193a57c6 Initial commit 2026-05-27 21:55:18 +00:00