From 308f71b5669c12995e069216bc698fa96e8980d7 Mon Sep 17 00:00:00 2001 From: mathias Date: Fri, 24 Jul 2026 15:26:01 +0200 Subject: [PATCH] fix(ci): Taskfile YAML syntax error + staticcheck tagged-switch (jepa-fx-risk#19) 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: ... }`. --- Taskfile.yml | 2 +- internal/eval/var.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index d0a27b7..e637399 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -43,7 +43,7 @@ tasks: cmds: [.venv/bin/python scripts/fetch_multipair.py] data:prepare:pair: desc: "Build {PAIR}_hourly.parquet from data/raw/{PAIR}/ (e.g. PAIR=gbpusd)" - cmds: [PAIR={{.PAIR}} .venv/bin/python scripts/prepare_hourly.py {{.EXTRA_ARGS}}] + cmds: ["PAIR={{.PAIR}} .venv/bin/python scripts/prepare_hourly.py {{.EXTRA_ARGS}}"] vars: PAIR: '{{default "eurusd" .PAIR}}' data:prepare:multipair: diff --git a/internal/eval/var.go b/internal/eval/var.go index aa55bb7..5efe236 100644 --- a/internal/eval/var.go +++ b/internal/eval/var.go @@ -40,11 +40,11 @@ func kupiecPOF(n, n1 int, p0 float64) float64 { phat := float64(n1) / float64(n) var lr float64 - switch { - case n1 == 0: + switch n1 { + case 0: // 0 × ln(0/p0) = 0 by convention; only the n0 term contributes lr = 2 * float64(n0) * math.Log((1-phat)/(1-p0)) - case n1 == n: + case n: // n0 term vanishes lr = 2 * float64(n1) * math.Log(phat/p0) default: