Skip to content

Five things pokersolver does that its README does not mention - #99

Merged
will-lamerton merged 1 commit into
mainfrom
post/pokersolver-undocumented
Aug 29, 2026
Merged

Five things pokersolver does that its README does not mention#99
will-lamerton merged 1 commit into
mainfrom
post/pokersolver-undocumented

Conversation

@pip-robot

@pip-robot pip-robot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

A new blog post at /blog/pokersolver-undocumented, plus the test that keeps it true.

What it is

We wrap pokersolver in src/lib/poker/handEval.ts and hit five of its behaviours that the README does not mention. Four of them are open questions on the library's own tracker, unanswered for between three and six years. This is one page documenting them, each with the exact Hand.solve call that produces it.

Every case was produced by running the installed pokersolver@2.1.4, not read off the source.

The one that is a contradiction rather than an omission

The README documents toString() as "Returns a formatted string of all cards involved in the identified hand type (maximum of 5 cards)."

Hand.solve(['Ah','Kh','9h','7h','5h','3h','2h']).toString()
-> Ah, Kh, 9h, 7h, 5h, 3h, 2h

Seven. The other four are omissions: the six-card full house, the low ace rewritten to '1', the overflow ordering, and a royal flush whose name is "Straight Flush".

It is also the guard handEval.ts has never had

bestFive() asserts three of these behaviours (the overflow, the low ace, and that the hand-making cards stay first so slice(0, 5) is correct) in a doc comment. Nothing in the build checked it, and a minor version changing any of them would break every showdown silently. That is technology#78.

tests/pokersolverQuirks.test.ts now runs all seven published cases against the installed library, checks the README sentence is still the one the post quotes, and exercises the three bestFive claims through our own wrapper. So the post and the guard are the same work: if the library moves, the build fails before the page lies.

The published outputs are typed out by hand in src/config/pokersolverQuirks.ts rather than derived at render time, same rule as dailyProof.ts (a value read out of the library can never disagree with it and therefore proves nothing).

Gate

pnpm test:all green (515 tests, +12 new). pnpm build clean, 22 markdown mirrors. biome-formatted.

Merge order

This is the least urgent of the open PRs and should go last. #96 is the one that matters and carries the fix for a price claim that is false and live right now. #97 is the roundup and is dated 1 September.

We wrap pokersolver and hit five undocumented behaviours building the wrapper.
Four of them are open questions on the library's own tracker, unanswered for
three to six years. This documents them with the input that produces each one.

The sharpest is stronger than an omission: the README documents toString() as
"maximum of 5 cards", and a seven-card flush returns seven. Verified against
the installed 2.1.4, not read off the source.

Every published row lives in src/config/pokersolverQuirks.ts and is re-run
against the installed library by tests/pokersolverQuirks.test.ts, so a version
bump that changes a behaviour fails the build instead of leaving the post wrong
at a permanent URL. That test is also the guard bestFive() has never had: it
asserts the overflow, the low ace and the ordering in a doc comment, and a
comment about a dependency is checked by nobody (technology#78).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pip-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: df7b023
Status: ✅  Deploy successful!
Preview URL: https://c578c411.pip-web-9oj.pages.dev
Branch Preview URL: https://post-pokersolver-undocumente.pip-web-9oj.pages.dev

View logs

@will-lamerton
will-lamerton merged commit aa1d04f into main Aug 29, 2026
2 checks passed
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