fix(taste): drop unused now param + tighten test (golangci-lint revive)
golangci-lint v2 (CI-only; local is v1) flagged two unused-parameter issues: - BuildTasteProfile's `now` was genuinely dead — decay/windowing are computed DB-side via now(), so no Go-side timestamp is threaded. Removed it (a phase-3 context model that needs a pinned reference time would re-add it); updated the scheduler call site. - the degenerate-params engagement test ignored t; reworked it to assert the result stays in [-1,1], which also strengthens the test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,11 +44,15 @@ func TestEngagement_MonotonicNonDecreasing(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEngagement_DegenerateParamsNoPanic(t *testing.T) {
|
||||
// Non-increasing thresholds must collapse ramps, not divide by zero.
|
||||
func TestEngagement_DegenerateParamsStayInRange(t *testing.T) {
|
||||
// Non-increasing thresholds must collapse ramps (no divide-by-zero) and
|
||||
// still produce a value in [-1, 1].
|
||||
p := EngagementParams{HardSkip: 0.5, NeutralCompletion: 0.5, FullCompletion: 0.5}
|
||||
for _, c := range []float64{0, 0.25, 0.5, 0.75, 1} {
|
||||
_ = Engagement(c, p)
|
||||
got := Engagement(c, p)
|
||||
if got < -1 || got > 1 {
|
||||
t.Errorf("Engagement(%.2f) = %.3f out of [-1,1]", c, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user