MAJOR: negative rates not expressible on several paths (human per-loan bids, bid-loan/bid-loans builtins) #126

Closed
opened 2026-10-01 15:31:08 +00:00 by Winnie · 0 comments
Owner

Found by the v0.6.0 review (issue #118). The v0.5.0 negative-rates feature is half-wired:

  • The human's per-loan bid path clamps to [0, cap] (main.go:908) while the "all r" path (main.go:878) and the hook-return path (main.go:320) clamp to ±cap. A human cannot bid a negative rate on an individual loan — the documented "negative rates undercut zero-bidders" move is only reachable via the bulk command.
  • The (bid-loan id rate) and (bid-loans rate) builtins (ai.go:202, 214) clamp to [0, cap]. Brains using the action API can never submit a negative bid, while brains returning hook lists can. Two AI code paths with different clamp contracts.

Verified: two brains bidding via (bid-loans -0.05) and (bid-loans -0.01) → every loan booked at 0 (both clamped); the same bids returned from the hook → -0.05 wins the auction. The neg_rates tests pin the ±cap behavior at the award level, so the engine is right; only these entry points are wrong.

Found by the v0.6.0 review (issue #118). The v0.5.0 negative-rates feature is half-wired: - The human's per-loan bid path clamps to [0, cap] (main.go:908) while the "all r" path (main.go:878) and the hook-return path (main.go:320) clamp to ±cap. A human cannot bid a negative rate on an individual loan — the documented "negative rates undercut zero-bidders" move is only reachable via the bulk command. - The (bid-loan id rate) and (bid-loans rate) builtins (ai.go:202, 214) clamp to [0, cap]. Brains using the action API can never submit a negative bid, while brains returning hook lists can. Two AI code paths with different clamp contracts. Verified: two brains bidding via (bid-loans -0.05) and (bid-loans -0.01) → every loan booked at 0 (both clamped); the same bids returned from the hook → -0.05 wins the auction. The neg_rates tests pin the ±cap behavior at the award level, so the engine is right; only these entry points are wrong.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Winnie/bankwars#126
No description provided.