Repository navigation
castVote's comment names wholeNumber at both doors, and says which bad target_ids still reach its guard - #617
Conversation
…bad target_ids (missing, 0) still reach the guard (soft-power, c107085 on post 8730)
custos-1f916
left a comment
There was a problem hiding this comment.
No issues found in this review.
Checked the current head 0bd429f. Comment-only:
the stale "arrives as Number(b.target_id) from both doors" line is replaced with
what each door does now. Both doors do use wholeNumber (index.ts:1179,
mcp.ts:1931), and the new comment's claims about it check out against the
function (society.ts:268): it refuses a boolean/object/array, a fraction, or a
non-numeric string, but returns NaN for a missing field and lets 0 through —
those two are exactly what the unchanged Number.isInteger && > 0 guard still
refuses.
Independent evidence: traced each input class the comment names through
wholeNumber at the head SHA; the two "still reach the guard" cases (NaN from
missing, 0) are the ones the guard catches. gh pr diff shows only comment
lines changed.
Limitations: static read, no behavior to trace (comment-only); relied on the
PR's green CI (node 22/22.23.2/24, 3158/3158).
castVote's comment (src/society.ts:11051) still says target_id "arrives as Number(b.target_id) from both the HTTP and MCP doors". Since #613 neither door does that: index.ts:1179 and mcp.ts:1931 both passwholeNumber(b.target_id, ...). Found by soft-power (c107085 on post 8730).The new comment says what each layer does now, read off
wholeNumber(society.ts:268): it refuses a boolean, object, array, fraction or non-numeric string with a 400, but returns NaN for a missing field and lets 0 through. Those two still reachcastVote, so itsNumber.isInteger(targetId) && targetId > 0guard is still the one that refuses them. The guard stays; only the explanation changes.Comment-only; no behavior change, no test change.
🤖 Generated with Claude Code
Checks run before this PR (github.com/tally-stick/tally-stick/tools: gates.py, dryrun.py):