Repository navigation
Description
mcpx(daemon): /v1/interactions score filters silently misbehave — a non-numeric minScore returns the unfiltered list, NaN/Inf return an empty one
Evidence (verified this run, main 319e6c21)
pkgs/mcpx/internal/daemon/routes_feedback.go:95-115 (handleInteractionsList, GET /v1/interactions):
if minStr := q.Get("minScore"); minStr != "" {
if val, err := strconv.ParseFloat(minStr, 64); err == nil {
filter.MinScore = &val
}
}
if maxStr := q.Get("maxScore"); maxStr != "" {
if val, err := strconv.ParseFloat(maxStr, 64); err == nil {
filter.MaxScore = &val
}
}A parse failure leaves the filter unset and the handler returns 200 with the
unfiltered list — the caller asked for a score band and silently got
everything. A parse success is not safe either: Go's ParseFloat accepts
NaN, Inf, +Inf, -Inf, and the filter is passed straight into
pkgs/mcpx/internal/logstore/feedback.go:303-310 (score >= ? / score <= ?
against SQLite, modernc driver). SQLite treats a NaN bound as NULL, so every
comparison is NULL and no row matches; +Inf as a minimum likewise
matches nothing.
Verified with a probe on the laptop (test file
pkgs/mcpx/internal/logstore/probe_laneB_test.go in worktree
~/git/fleet/probe-2026-10-29-laneB-feedback-wt/, whose feedback.go /
routes_feedback.go are md5-identical to this main; real
logstore.FeedbackStore, 3 seeded interactions scored 0.2 / 0.5 / 0.9,
handler parse block replicated verbatim; go test PASS):
- no filter → 3 rows;
minScore=0.4(control) → 2 rows minScore=abc→ filter never set → 3 rows (unfiltered)minScore=1e999→ ParseFloat range error → filter never set → 3 rows (unfiltered)minScore=NaN→ filter set to NaN → 0 rowsminScore=Inf→ 0 rowsmaxScore=xyz→ filter never set → 3 rows (unfiltered)maxScore=NaN→ 0 rows
limit/offset in the same handler (lines 107-115) have the same
silent-drop shape, but the store neutralizes them (feedback.go List:
limit <= 0 falls back to the default page size, offset only applied when
> 0), so they are cosmetic; the score filters are the correctness bug
because both failure directions reach the caller as a plausible 200 result.
No test covers this: no test in internal/logstore/feedback_test.go or the
daemon tests references MinScore/minScore.
Why it matters
/v1/interactions is the feedback-review surface: a reviewer (or a script)
asking "show me interactions scored below X" to find bad responses gets
either everything (typo'd / out-of-range bound) or nothing (NaN/Inf), with a
200 and no hint the band was not applied. Both directions look like real
answers — the unfiltered direction reads as "all interactions pass", the
empty direction as "no interactions in band".
Acceptance criteria
- A non-numeric, NaN, or infinite
minScore/maxScoreon GET /v1/interactions is rejected with 400 naming the parameter (the handler already 400s on other bad input, e.g.handleInteractionGet's missing id), OR is otherwise surfaced — never silently dropped. - Valid finite bounds behave exactly as today (
minScore=0.4over scores 0.2/0.5/0.9 returns the 0.5 and 0.9 rows). - Handler/store tests cover:
abc,NaN,Inf,1e999for both bounds, plus the finite control case. - Triage pins whether the same 400 rule should extend to this handler's
limit/offset(store-neutralized today) — recorded on the issue; not required for the score fix itself.
Activity
developing-today commentedon Oct 29, 2026
CODE-1098
dezren39 commentedon Oct 29, 2026
🤖 Agent note · filed
22 remaining items
dezren39 commentedon Oct 31, 2026
agent-note:v1 — task 4284 resumed by lane F: PR #3081 @e5804657 rechecked fresh — all substantive checks SUCCESS (build, lint, plugin tests, stress changed-tests), Codex review clean on the head (has_unresolved_findings: false, 0 unresolved threads). Only
final: CI time budgetremains QUEUED (fleet runner backlog); waited ~4 min per the 5-minute rule, still queued. Task parked 1h; resume: budget check completes green -> merge PR #3081 -> close this issue -> complete task 4284 fixed_merged.dezren39 commentedon Oct 31, 2026
🤖 Agent note · picked up
Merge pull request #3081 from developing-today/queue/4284-2223-score-…
dezren39 commentedon Oct 31, 2026
🤖 Agent note · done