Repository navigation
fix(reggie,filters): keep medals without a brew name, match multi-club fields, repair double-encoded text - #19
Conversation
The raw-page parser required every string field of a medal record to be non-empty, so a medal whose entry has no brew name (or whose brewer has no club) was silently dropped. Hot N Humid 2024 lost 13 of its 113 medals this way, including Ken Johnson's 2nd in Czech Lager; Ozarks Open Season 2024 lost 3 of 53, including two Bru Club 3rds. The brew name and club may now be empty, so the row is emitted with an empty Brew Name column. Accepting empty fields would also let the "Heavy Medal" points summaries (MedalType 2 and 3, which have no brew name or club) through, so only MedalType 0 (medal) and 1 (Best of Show) records are read, and the rendered HTML path skips Heavy Medal tables. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019WNgkFdWRPDsrg7QyXsqtu
BAP publishes a brewer in several clubs as one string, e.g. "The Brü Club / Little Mountain Brewers" (Steve Micco, 2nd in Porters & Stouts, 2024 Copper State Cup), so an exact whole-field comparison missed the medal. The club (and brewer) field is now also split on " / ", ";" and "," and the filter must equal the whole field or one complete name in it. Still case- and diacritic-insensitive and never a substring match, so "ASH" does not match "CASH CIDER". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019WNgkFdWRPDsrg7QyXsqtu
Reggie's pages publish some text double-encoded: a brewer entered as Randall "Scott" Gordon (curly quotes) is served as the UTF-8 bytes of its Windows-1252 misreading, "“Scottâ€<U+009D> Gordon". The CLI passed that through, so the CSV/JSON showed garbage in place of the quotes. The server sends charset=UTF-8 and the BAP output keeps the same quotes intact, so neither the fetch nor the CSV sanitizer is at fault. Names and beer names from Reggie are now repaired: each character is read as the Windows-1252 byte it stands for, and a lead byte with its continuation bytes is decoded as UTF-8 only when that is valid. Text that is already correct (Brü, Kölsch, ’) is left alone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019WNgkFdWRPDsrg7QyXsqtu
Review by Claude Opus (claude-opus-5-5)Verdict: No findings. Not checked: I could not run the test suite (the checkout has no Generated by Claude Code |
Review by Claude Sonnet (claude-sonnet-5-5)Verdict: No findings. Nits and pre-existing (1)
Not checked: I could not run the test suite (mocha is not installed in the checkout). I did not compare the new Reggie fixtures with live pages. The medal-type split (0 and 1 are medals, 2 and 3 are Heavy Medal summaries) was checked only against the fixtures already in the repo. Generated by Claude Code |
Review by Claude Fable 5.1 (claude-fable-5-1)Verdict: 0 Important, 1 Nit Nits and pre-existing (1)
Verified against live sources (no 2024 raw captures exist on the circuit repo's Not checked: the test suite and lint could not be run (no Generated by Claude Code |
Pull Request
Description
Three bugs found while archiving the 2024 circuit (Hot N Humid and Ozarks Open Season on Reggie, Copper State Cup on BAP):
aaReggieMedalsrecord to be non-empty, so medals such as Ken Johnson's 2nd in Czech Lager (Hot N Humid) or Kurt LaPak's 3rd in American Pale Ale (Ozarks) never reached the output. They are now emitted with an empty Entry Name. Only medal types 0 (medal) and 1 (Best of Show) count; the "Heavy Medal - Brewer / Club" summary rows (types 2 and 3) are not medals and stay skipped, in the JS data and in the rendered-HTML fallback.--clubneeded the whole club field to match exactly. BAP publishes multi-club fields such asThe Brü Club / Little Mountain Brewers, so Steve Micco's Copper State Cup medal was missed when filtering onThe Brü Club. The filter now equals the whole field or one complete club in it (split on/,;and,). It is not a substring match:ASHdoes not matchCASH CIDER, andAC/DCstays whole. The same logic applies to--brewers.Randall “Scott” Gordonarrives as“Scottâ€<U+009D> Gordon). A new decoder (src/parsers/mojibake.ts) re-reads each character as its Windows-1252 byte and decodes lead and continuation bytes as UTF-8 only when the sequence is valid, so correct text (Brü, Kölsch, ’) is untouched. It is applied to brewer, category, style, brew name and club on Reggie only; BAP and BCOEM captures contain no such text.Fixes # (none)
Type of Change
Changes Made
src/parsers/reggie-parser.ts: accept empty brew name, club and ShowLabel; only medal types 0 and 1; skip rows underHeavy Medal*group headers in the HTML path; repair double-encoded characters.src/filters.ts:fieldKeys()splits an entry's club and brewer fields;shouldIncludeEntrycompares the filter to the whole field or one complete name.src/parsers/mojibake.ts: the decoder.reggie_trimmed_2024_hot_n_humid.html,reggie_trimmed_2024_ozark_open_season.html,bap_trimmed_results_2024_ash_copper_state_cup.json.--club),docs/BCOEM_IMPLEMENTATION.md,docs/PLATFORM_SUPPORT.md.Brewers, Inc.) can match a filter equal to just one part. Documented in the README and CHANGELOG.Platform(s) Affected
Testing
npm test)On Node 22.23.4:
yarn testpasses on each commit (617, 636, 703 tests; 612 on main) with 0 lint errors. On the real captures: Hot N Humid 113 medals (13 without a brew name), Ozarks 53 (3 without), both existing full-page Reggie fixtures 103; the club filter finds Steve Micco at Copper State Cup and does not matchASHagainstCASH CIDER; only the three "Scott" Gordon rows change from the decoder. Independent reviews: an adversarial correctness review (found that the first version also emitted the Heavy Medal summary rows; fixed) and a mutation review (79 mutants on the changed lines; the 16 real test gaps are closed, the 11 survivors are equivalent).Test Commands
Test URLs
Checklist
Documentation
docs/folderAdditional Notes
Not covered: the rendered-HTML Heavy Medal guard is tested with a synthetic table only (no real rendered Heavy Medal table was available); a genuine
éin a real name would be repaired toé(indistinguishable from the double encoding).🤖 Generated with Claude Code
https://claude.ai/code/session_019WNgkFdWRPDsrg7QyXsqtu
Change log
Newest first.
a52c9c2,0f43eab,899cd62: review fixes folded in: only medal types 0 and 1 (Heavy Medal summary rows are skipped, JS and HTML paths), explicit Windows-1252 table and lead-byte range tests, filter separator tests, style repair in both paths, comma side effect documented. 703 tests.Generated by Claude Code