Classifier models Willett exact-cask photo creates as standalone bottle instead of bottling
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 103
- Forks
- 18
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 555
Description
Summary
Photo add-bottle classification can create non-SMWS single-barrel / exact-cask whiskies as standalone bottles instead of creating a stable parent bottle plus a child bottling/release.
Observed example:
- Willett Family Estate Bottled Single Barrel Bourbon
- Barrel No. 4769
- 5 years old
- 64.2% ABV / 128.4 proof
In a clean DB, the classifier preserved the important label facts but returned create_bottle with identityScope: "exact_cask" instead of a bottling-oriented result such as create_bottle_and_release.
Why This Matters
The resulting data is factually useful, but likely not the intended Peated model for recurring single-barrel programs. For Willett Family Estate, Family Estate Bottled Single Barrel Bourbon looks like the reusable parent identity, while Barrel No. 4769, age, ABV, cask-strength, and single-cask traits are bottling/release identity.
This means the current eval can pass while the persisted catalog shape is still wrong.
Current Behavior
The checked-in Willett fixture expects the standalone bottle shape:
action: "create_bottle"identityScope: "exact_cask"proposedRelease: null- proposed bottle name includes
Family Estate,Single Barrel, and4769
Relevant fixture:
packages/bottle-classifier/src/eval-fixtures/decision-cases/new_bottles/image-backed-photo-creates-willett-family-estate-barrel-4769.json
The eval therefore proves "do not match the wrong existing row and preserve 4769", but it does not prove "model this as parent plus bottling."
RCA / Hypothesis
The release is not being dropped by the add-bottle create plumbing.
Server create plumbing supports create_bottle_and_release:
apps/server/src/lib/classifierDecisionCreateInputs.tsmapscreate_bottle_and_releaseto both bottle input and release input.apps/server/src/lib/bottleReferenceResolution.tspersists both the bottle and release forcreate_bottle_and_release.apps/server/src/orpc/routes/tastings/photo-identification-create.tsaccepts create-bottle, create-release, and create-bottle-and-release decisions.
The likely root cause is classifier semantics:
packages/bottle-classifier/src/classifierTypes.tsrejectsidentityScope: "exact_cask"withcreate_release,create_bottle_and_release, orrepair_parent_and_create_release.packages/bottle-classifier/src/instructions.tssays "Exact-cask identity does not create child releases/bottlings."packages/bottle-classifier/src/reviewPolicy.tshas a post-model rewrite that downgradescreate_bottle_and_releasetocreate_bottlewhen exact-cask scope is inferred, merging release traits back into the bottle.packages/bottle-classifier/src/classifier.eval.test.tstreats exact-cask normalization as requiring no child release identity.
Hypothesis: the exact-cask rule was originally intended to prevent SMWS-style exact cask identities from being split into weak parents and child releases, but it now applies too broadly to non-SMWS recurring single-barrel programs like Willett Family Estate.
Expected Direction
For Willett Family Estate barrel 4769, we likely want:
action: "create_bottle_and_release"in a clean DB, orcreate_releaseif a clean parent exists.- Parent bottle:
- brand:
Willett - name:
Family Estate Bottled Single Barrel Bourbonor equivalent stable family name - category:
bourbon
- brand:
- Release / bottling:
- edition:
Barrel No. 4769 - statedAge:
5 - abv:
64.2 - singleCask:
true - caskStrength:
true
- edition:
We may need to split the concepts:
- exact-cask as a precision/evidence property
- standalone exact-cask bottle as a storage decision
SMWS exact cask rows may remain standalone bottles, while non-SMWS exact barrels can become releases when a stable parent family is supported.
Suggested Acceptance Criteria
- Update classifier policy/schema so non-SMWS exact-cask identity is allowed to create or match a child release when a stable parent family is supported.
- Preserve the current SMWS behavior unless intentionally changed.
- Update the Willett barrel 4769 fixture to assert bottling-oriented storage shape instead of standalone exact-cask bottle shape.
- Add or update a regression case proving a clean DB creates parent plus bottling for Willett Family Estate barrel 4769.
- Ensure photo-identification create still signs a create token and persists both bottle and release for the corrected decision.
Useful Search Terms
Exact-cask identity cannot create a child release beneath the bottleExact-cask identity does not create child releases/bottlingsimage-backed-photo-creates-willett-family-estate-barrel-4769maybeSplitMisScopedExactCaskBottleCreation
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Willett fixture at packages/bottle-classifier/src/eval-fixtures/decision-cases/new_bottles/image-backed-photo-creates-willett-family-estate-barrel-4769.json and the exact-cask rules in classifierTypes.ts, instructions.ts, and reviewPolicy.ts. Run the related classifier eval, then inspect classifierDecisionCreateInputs.ts, bottleReferenceResolution.ts, and photo-identification-create.ts to verify the existing persistence path. Done means non-SMWS Willett barrel 4769 produces a parent plus release, preserves the current SMWS behavior, and has regression coverage for the decision and creation flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100