Repository navigation
fix(bap): emit Best of Show and custom awards - #14
Conversation
|
Automated review of this PR (Claude Code Worth addressing
Smaller
Generated by Claude Code |
|
Addressed the automated review. I checked each finding against the code and real BAP captures first; results below (pushed through
A scoped adversarial re-review of these changes (opus, plus ~90 mutants across the rounds) came back safe to merge. Its remaining notes, left as they are: the saved-page path also strips a trailing One downstream note from the review: the CLI still exits 0 when a medal's line is unreadable, with the warning only on stderr. The TBC archive's Generated by Claude Code |
Export wantedBrewers() so the comma-separated, normalized, blank-dropping parsing of --brewers lives in one place. shouldIncludeEntry uses it and its behaviour is unchanged. The BAP parser reuses it in the next commit to decide whether an unreadable award line mentions a requested brewer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GP39ZPN7EzLLdoKcJkGD4
The BAP parser dropped Best of Show entirely: the API path read only
results.miniBos and skipped any category named "Best of Show", and the saved
page path skipped Best of Show headings and custom award lines. BAP keeps the
overall Best of Show in results.bos and extra awards (for example "Best of Show
- Mead & Cider") in results.custom.awards, so a Brü Club Best of Show winner
never reached the output.
Both the API path and the saved-page path now emit:
- results.bos positions as category "Best of Show" (blank entry count; the
saved-page card's count is always blank to match)
- results.custom.awards positions, one display string per place
("entry \ M2A - Style \ Brewer, City, ST, USA \ Club: X", with optional
"Collaboration with ..." parts), category = the award name; --club and
--brewers apply to them like any other row
Details that matter:
- An unreadable custom award line never fails the run on the API path: every
readable row is still emitted, the line is reported on stderr, and a line
that mentions the requested club or brewer (whole-word match) gets a
prominent WARNING that its medal is missing. Skipped lines are counted and
mentioned in the final message. On a saved page a single-line row with
neither " \ " nor " / Club:" still raises BapHtmlStructureError.
- A bos or custom row identical to a row from a table named "Best of Show..."
(compared ignoring case, accents and spacing) is dropped so a response that
lists both never double counts.
- Null or oddly shaped bos, miniBos and custom data is tolerated.
- Place mapping is unchanged, so a Best of Show "4th" prints as HM.
- Collectors return their rows and skipped lines instead of keeping state on
the parser, so overlapping calls on one parser are independent.
Fixtures: the trimmed 2026 Boneyard and Copper State Cup API fixtures gain bos
and custom taken from the real captures (names, styles, brewer and club only).
Tests cover both paths agreeing on those pages, the custom award wording cases,
dedupe, filters, stderr output and the shapes above; behaviour was checked with
mutation testing.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GP39ZPN7EzLLdoKcJkGD4
Describe where Best of Show and custom awards come from, the row shapes both paths produce, how unreadable custom award lines are handled (non-fatal on the API path, WARNING when they name the requested club or brewer), the dedupe, and the saved-page limits. Add the CHANGELOG entry under Unreleased. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GP39ZPN7EzLLdoKcJkGD4
ca5bb4b to
654132c
Compare
Description
The BAP parser dropped Best of Show entirely: the API path read only
results.miniBos(with an explicit "Skip Best of Show for now"), and the saved-HTML path skipped Best of Show headings and custom award lines. BAP keeps the overall Best of Show inresults.bos.positionsand extra awards (e.g. "Best of Show - Mead & Cider") inresults.custom.awards, so a Brü Club Best of Show winner at Boneyard and Copper State Cup 2026 never reached the output. This matters for circuit scoring, where only the 1st place Best of Show earns the multiplier.Type of Change
Changes Made
results.bos.positions(categoryBest of Show, blank entry count) andresults.custom.awards(category = award name; position strings of the formentry \ M2A - Style \ Brewer, City, ST, USA \ Club: X). Filters (--club,--brewers) apply to both.--club/--brewersfilter it fails loudly withBapUnrecognizedAwardErrorinstead, so a medal is never silently lost behind a misleading "no medals matched".bos,miniBosandcustomare tolerated;parseApiDatacomplexity reduced (extractedcollectCustomAwards).HM, so a Best of Show "4th" prints as HM).Best of Show...is now emitted as an ordinary table (it was skipped before).bos/customtaken from the real 2026 Boneyard and Copper State captures (names, styles, brewer, club only; no personal data).docs/BAP_IMPLEMENTATION.md) and CHANGELOG updated.Platform(s) Affected
Testing
npm test): 605 passing (557 on main)Real captures, club "The Brü Club" (new rows only; every pre-existing row is byte-identical to main on both paths, with and without filters):
Review: went through the repo's adversarial-review-loop (opus correctness review, sonnet test-adequacy review with ~80 mutants, then a scoped opus re-review of the fixes); all verdicts SAFE TO MERGE, every surviving mutant found along the way now has a killing test.
Known limits, left as follow-ups: the "mentions the filter" check is a loose substring match (a short
--clubsuch asASHcan trip it for an old-wording award that merely contains that text), andhidePositionson custom awards is ignored.Checklist
Documentation
docs/folderGenerated by Claude Code