Skip to content

Fix cooking-domain match coverage warning and add RFQ generation - #354

Merged
touchthesun merged 3 commits into
mainfrom
fix/cooking-match-coverage-and-rfq
Aug 12, 2026
Merged

Fix cooking-domain match coverage warning and add RFQ generation#354
touchthesun merged 3 commits into
mainfrom
fix/cooking-match-coverage-and-rfq

Conversation

@touchthesun

Copy link
Copy Markdown
Contributor

Summary

Two follow-ups from the live cooking-test deployment:

  1. "Coverage unknown · confidence 30%" on every kitchen result — cooking matches never got a structured explanation.requirement_matches, because that block was gated to domain == "manufacturing" in POST /api/match. CookingMatcher already computed ingredient/tool overlap; it now also reports which ingredients/tools matched vs. were missing, and the match route turns that into a real MatchExplanation. Kitchens now show e.g. "Missing 2 of 13 requirements" instead of an unexplained percentage.
  2. No way to generate an RFQ from a cooking match, unlike the manufacturing flow. CookingMatchView gets a "Contact selected kitchens →" action next to the existing selection controls, and POST /api/rfq/generate accepts a domain field: domain="cooking" renders a recipe-flavoured RFQ (ingredients, equipment, and the match explanation from fix Harry does not have access to the Azure Non Profit Grant #1), while the existing manufacturing path is untouched.

Test plan

  • uv run pytest tests/unit/test_cooking_matchers.py tests/unit/test_cooking_match_explanation.py tests/api/test_rfq_routes.py -v
  • uv run pytest tests/unit tests/api (1181 passed)
  • npx vitest run in frontend/ (348 passed, including new CookingMatchView and RfqView cooking-domain tests)
  • npx tsc --noEmit in frontend/
  • make ready (all 11 gates pass)

Made with Cursor

MakerNetwork and others added 3 commits August 11, 2026 20:33
Cooking matches never got a requirement_matches explanation (that block
was gated to domain == "manufacturing"), so every kitchen card showed
"Coverage unknown" regardless of how well it actually matched the
recipe. CookingMatcher already computed ingredient/tool overlap; it now
also reports which items matched vs. were missing, and the match route
turns that into a MatchExplanation so the frontend can show real
coverage ("Missing N of M requirements") instead of a bare, unexplained
confidence percentage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extends the existing RFQ generation flow (design + facility) to also
cover recipe + kitchen matches, the same way manufacturing users can
today. CookingMatchView gets a "Contact selected kitchens" action next
to the existing selection controls; POST /api/rfq/generate now accepts
a domain field and renders a recipe-flavoured RFQ (ingredients,
equipment, and the match explanation from the coverage fix) when
domain="cooking", leaving the manufacturing path unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
Two issues surfaced only under project-reference builds (tsc -b), not
tsc --noEmit -p .: a facility fixture missing the Facility type's
required manufacturing_processes field, and a mutable let captured by
an msw handler that a later toMatchObject assertion narrowed to a type
tsc -b's stricter incremental build considered incompatible. Switched
the capture to a resolved promise instead of a polled variable, which
sidesteps the narrowing entirely and is more direct besides.

Co-authored-by: Cursor <cursoragent@cursor.com>
@touchthesun
touchthesun merged commit acbeb88 into main Aug 12, 2026
7 checks passed
touchthesun added a commit that referenced this pull request Aug 12, 2026
#355)

Now that cooking-domain matches carry a real requirement-coverage
explanation (fixed in #354), the near-miss tolerance filter actually
does something — and recipes with several ingredients/tools routinely
exceed the default tolerance of 1, so every kitchen got filtered out
with a blank "No matches found" empty state and no way to reveal them,
since the tolerance slider itself was only rendered inside the
already-filtered results branch.

Split the empty-state check: "No matches found" now only fires when
the API returned zero solutions. When solutions exist but are all
hidden by tolerance, the slider (and hidden-count message) render with
a "No matches within tolerance" message instead, so raising the slider
reveals them.

Co-authored-by: maker-nathan <nathan@makernet.work>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Harry does not have access to the Azure Non Profit Grant

2 participants