Skip to content

feat(bets): live bets per goal is an operator setting, not a constant (v0.460.0) - #867

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/bets-live-cap
Oct 12, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/bets-live-cap

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Why

The 4-live-bet cap exists so a loop cannot run more experiments than a human can attribute. It cuts both ways, and today showed the other edge: expresstech's goal has been regressing for two weeks in a page family its agent had no slot left to bet on — four running bets (n8n, Fly.io, Google Forms, Indonesian) all judging in November. The agent correctly reported "slots are full, so no new bet", which means the cap was holding the loop back rather than protecting it.

What

  • settings.betsLiveCap (key bets_live_cap) is the operator override. Resolution — default 4, clamp 1..MAX_LIVE_BETS_CEILING(8) — lives with the store in resolveLiveBetCap, the same split as the concurrency cap: settings holds the raw override, the resolver owns the default.
  • BetStore takes a thunk, not a number, and resolves per create, so a cap change takes effect with no restart. The refusal names the cap actually in force.
  • GET/PUT /api/settings/bets — owner/admin, audited settings.betsCap.updated. A value past the ceiling is a 400 naming the ceiling, never a silent clamp: an operator who asks for 20 should be told the limit, not handed 8 and left believing they got 20.
  • The goal room's Bets header shows N/M live (amber when full) and, for an owner/admin, a picker — the cap is only interesting while looking at a full board, so it lives there rather than in Settings.
  • bet_list returns cap + live. The agent's actual decision is "have I got a slot", and it used to learn the answer only by being refused at bet_propose.

Testing

scripts/bets-test.cjs → 53 passed, 0 failed (10 new in case 11b): the store enforces a raised cap with no restart, the 5th and 6th propose now succeed, the refusal names 6, past-the-ceiling is a 400 that leaves the cap untouched, no cookie cannot change it, both read sides carry the cap, and clearing returns to 4. Full npm run test:governance green; npm run typecheck + both bundles build.

🤖 Generated with Claude Code

… (v0.460.0)

The 4-live-bet cap exists so a loop cannot run more experiments than a human can
attribute. It cuts both ways: on 2026-10-12 expresstech's goal was regressing in a
page family its agent had no slot left to bet on, so four running bets were holding
the loop back rather than protecting it.

- `settings.betsLiveCap` (key `bets_live_cap`) is the operator override; resolution
  (default 4, clamp 1..8) lives with the store in `resolveLiveBetCap`, the same split
  as the concurrency cap. `BetStore` takes a thunk and resolves per `create`, so a
  change takes effect with no restart, and the refusal names the cap in force.
- `GET`/`PUT /api/settings/bets` (owner/admin, audited `settings.betsCap.updated`).
  Past the ceiling is a 400 naming it, never a silent clamp.
- The goal room's Bets header shows "N/M live" and, for an owner/admin, a picker.
- `bet_list` returns `cap` + `live` so an agent knows its slots instead of learning
  them from a refused propose.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit 7307e76 into main Oct 12, 2026
1 check passed
@vikasprogrammer
vikasprogrammer deleted the feat/bets-live-cap branch October 12, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant