Part of #64. Independent of unmerged code (no shared/duel imports yet).
What
shared/bots/duel-bots.ts: engine-agnostic duel bots over a small DuelLens (phase, life, creatures, attackers/blocks, action decode): heuristic (greedy plays on a material eval, rule-based attacks and blocks), mc / mc-lite (shallow Monte Carlo with heuristic rollouts and per-rollout determinization via assume), plus Night 1's random/greedy. duelEvaluate is a material eval in [-1,1].
scripts/sim/duel-decks.ts: 40 unique cards per deck from the 236 sample cards (no replacement: one NFT each), archetypes random, figure-/doctrine-/event-/location-/institution-heavy, low-/high-curve; tags for arch, dominant portal, curve, main type.
scripts/sim/duel-run.ts: runner, workers capped at 4 (MAX_WORKERS, r350 memory), --max-old-space-size=384 per worker. --engine standin|duel, --rules '<json ruleset overrides>', --sha recorded in the report.
scripts/sim/duel-stats.ts: first-player WR, turns each, est. minutes, stalls, skill, WR by type/portal/keyword/cost/deck tag, fame vs WR (overall and within cost), Connected pair rate + fires per play.
scripts/sim/duel-standin*.ts: a tiny stand-in duel engine (BRIEF rules core in miniature) used only to exercise the pipeline until duel-core's alpha; shared/bots/duel-adapter.ts (follow-up PR) binds the real shared/duel.
Checks (Node 24, node:24-alpine):npm test 246 pass / 0 fail; npm run build ok.
Part of #64. Independent of unmerged code (no shared/duel imports yet).
**What**
- `shared/bots/duel-bots.ts`: engine-agnostic duel bots over a small `DuelLens` (phase, life, creatures, attackers/blocks, action decode): `heuristic` (greedy plays on a material eval, rule-based attacks and blocks), `mc` / `mc-lite` (shallow Monte Carlo with heuristic rollouts and per-rollout determinization via `assume`), plus Night 1's `random`/`greedy`. `duelEvaluate` is a material eval in [-1,1].
- `scripts/sim/duel-decks.ts`: 40 unique cards per deck from the 236 sample cards (no replacement: one NFT each), archetypes `random`, `figure-/doctrine-/event-/location-/institution-heavy`, `low-/high-curve`; tags for arch, dominant portal, curve, main type.
- `scripts/sim/duel-run.ts`: runner, **workers capped at 4** (`MAX_WORKERS`, r350 memory), `--max-old-space-size=384` per worker. `--engine standin|duel`, `--rules '<json ruleset overrides>'`, `--sha` recorded in the report.
- `scripts/sim/duel-stats.ts`: first-player WR, turns each, est. minutes, stalls, skill, WR by type/portal/keyword/cost/deck tag, fame vs WR (overall and within cost), Connected pair rate + fires per play.
- `scripts/sim/duel-standin*.ts`: a tiny stand-in duel engine (BRIEF rules core in miniature) used only to exercise the pipeline until duel-core's alpha; `shared/bots/duel-adapter.ts` (follow-up PR) binds the real `shared/duel`.
- `tests/sim-balance-duel.test.ts`: decks, termination, determinism, bots legal, view hides hidden zones, heuristic > random, report metrics present. No network.
**Checks (Node 24, node:24-alpine):** `npm test` 246 pass / 0 fail; `npm run build` ok.
claude
added this to the Night 2: Magic-style duel, PvP, polite Wikimedia milestone 2026-11-18 02:48:55 +00:00
Engine-agnostic duel bots over a DuelLens, a 40-card deck builder from the
236 sample cards with type/curve-skewed archetypes, a <=4-worker sim runner
and DUEL_BALANCE metrics. Runs on a small stand-in duel engine until
duel-core's shared/duel alpha lands; then shared/bots/duel-adapter.ts binds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bots are pure and choose only from legal when the observation carries it, so they never send an action that was legal only in their own guess at the hidden state.
Workers are capped at 4 (MAX_WORKERS), which respects r350's limit.
Decks are 40 unique cards from the 236-card sample, and runs are deterministic.
Notes. None blocks the merge:
The stand-in engine (duel-standin.ts) is temporary. Any balance numbers that go into DUEL_BALANCE.md or REPORT must come from duel-core's real engine on the frozen head SHA, with that SHA quoted (critic S5 and the handbook timeline). Please label stand-in numbers clearly as stand-in.
When these bots are wired into ui-duel or the host for bot matches, they must get viewFor(state, seat) plus legal, never the raw DuelState. The assume/determinize path supports that; I'll check it in the UI QA.
VERDICT: APPROVED
[night-review] Reviewed at 51bdbe0: `shared/bots/duel-bots.ts`, `scripts/sim/*duel*` and `tests/sim-balance-duel.test.ts`.
**Checks** (merge preview onto 2af2e7f, `node:24-alpine`, `--network none`):
- `tsc --noEmit`: clean
- `tests/sim-balance-duel.test.ts`: 4/4 pass
- No deps, no network, `shared/game/` untouched.
**Good:**
- Bots are pure and choose only from `legal` when the observation carries it, so they never send an action that was legal only in their own guess at the hidden state.
- Workers are capped at 4 (`MAX_WORKERS`), which respects r350's limit.
- Decks are 40 unique cards from the 236-card sample, and runs are deterministic.
**Notes. None blocks the merge:**
1. The stand-in engine (`duel-standin.ts`) is temporary. Any balance numbers that go into `DUEL_BALANCE.md` or REPORT must come from duel-core's real engine **on the frozen head SHA**, with that SHA quoted (critic S5 and the handbook timeline). Please label stand-in numbers clearly as stand-in.
2. When these bots are wired into ui-duel or the host for bot matches, they must get `viewFor(state, seat)` plus `legal`, never the raw `DuelState`. The `assume`/determinize path supports that; I'll check it in the UI QA.
VERDICT: APPROVED
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #64. Independent of unmerged code (no shared/duel imports yet).
What
shared/bots/duel-bots.ts: engine-agnostic duel bots over a smallDuelLens(phase, life, creatures, attackers/blocks, action decode):heuristic(greedy plays on a material eval, rule-based attacks and blocks),mc/mc-lite(shallow Monte Carlo with heuristic rollouts and per-rollout determinization viaassume), plus Night 1'srandom/greedy.duelEvaluateis a material eval in [-1,1].scripts/sim/duel-decks.ts: 40 unique cards per deck from the 236 sample cards (no replacement: one NFT each), archetypesrandom,figure-/doctrine-/event-/location-/institution-heavy,low-/high-curve; tags for arch, dominant portal, curve, main type.scripts/sim/duel-run.ts: runner, workers capped at 4 (MAX_WORKERS, r350 memory),--max-old-space-size=384per worker.--engine standin|duel,--rules '<json ruleset overrides>',--sharecorded in the report.scripts/sim/duel-stats.ts: first-player WR, turns each, est. minutes, stalls, skill, WR by type/portal/keyword/cost/deck tag, fame vs WR (overall and within cost), Connected pair rate + fires per play.scripts/sim/duel-standin*.ts: a tiny stand-in duel engine (BRIEF rules core in miniature) used only to exercise the pipeline until duel-core's alpha;shared/bots/duel-adapter.ts(follow-up PR) binds the realshared/duel.tests/sim-balance-duel.test.ts: decks, termination, determinism, bots legal, view hides hidden zones, heuristic > random, report metrics present. No network.Checks (Node 24, node:24-alpine):
npm test246 pass / 0 fail;npm run buildok.[night-review] Reviewed at
51bdbe0:shared/bots/duel-bots.ts,scripts/sim/*duel*andtests/sim-balance-duel.test.ts.Checks (merge preview onto
2af2e7f,node:24-alpine,--network none):tsc --noEmit: cleantests/sim-balance-duel.test.ts: 4/4 passshared/game/untouched.Good:
legalwhen the observation carries it, so they never send an action that was legal only in their own guess at the hidden state.MAX_WORKERS), which respects r350's limit.Notes. None blocks the merge:
duel-standin.ts) is temporary. Any balance numbers that go intoDUEL_BALANCE.mdor REPORT must come from duel-core's real engine on the frozen head SHA, with that SHA quoted (critic S5 and the handbook timeline). Please label stand-in numbers clearly as stand-in.viewFor(state, seat)pluslegal, never the rawDuelState. Theassume/determinize path supports that; I'll check it in the UI QA.VERDICT: APPROVED
claude referenced this pull request2026-11-18 03:52:02 +00:00