Skip to content

feat(ios): serve catalog recipes to the assistant, finalization, and cloud ranking - #185

Draft
obvious-autobuild[bot] wants to merge 13 commits into
obv/burst8-fridgeluck-goal-pathfrom
obv/burst9-fridgeluck-screen-path
Draft

obvious-autobuild[bot] wants to merge 13 commits into
obv/burst8-fridgeluck-goal-pathfrom
obv/burst9-fridgeluck-screen-path

Conversation

@obvious-autobuild

@obvious-autobuild obvious-autobuild Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

CI status — green

  • Run 38853295885 at merge commit c9c7ceab (this branch merged with the green burst8 base e87ee7b2): both jobs pass. build-and-test 4m31s, dead-code-advisory 3m1s.
  • The two earlier red runs are fully explained in the section above: the first was a real branch bug (preferredID rename) fixed in 25f23ad9; the second was inherited base breakage (SubstitutionService.swift:346) that the base thread fixed in 457be20d two minutes after this branch's merge ref was computed. Base has since landed green, and this merge proves the combined tree compiles and tests clean on macOS.
  • Portable Linux harness: 15/15 tests pass at d84b6ca7 (before the merge; macOS CI above is the authoritative check for the merged tree).
  • Remaining known limits (unchanged): no Xcode/device run here — SwiftUI view rendering, navigation, and the live /v1/reverse-scan/rank round trip were not exercised; the hosted CI build + unit suites are the compile and behavior evidence that exists.

ObviousApp and others added 11 commits October 16, 2026 01:33
The claims schema has no low-carb field, so no catalog recipe can prove
keto compliance, while the legacy pool enforces the .lowCarb tag mask —
without this arm a keto user loses every legacy result yet keeps every
catalog result. Fails-first: testKetoDietExcludesCatalogPoolFailingClosed
reproduces the ungated catalog entry before the gate arm lands.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
Catalog entries materialize as nil-id legacy stand-ins, so Start Cooking
rendered an empty guide, loadIngredients returned nothing, and Le Chef
received zero ingredient context. Add catalogCookPacket(for:) and
cookPacketIngredients(_:) on the repository — the single structured path
— and route the preview drawer, the cooking guide, and the assistant
context through it. Fails-first: the packet path had no repository API
before this commit and
testCatalogRecommendationYieldsCookPacketAndBridgedIngredients pins
non-empty steps and bridged ingredient lines for a catalog result.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
TasteEventStoreTests declared cookedEvent -> TasteEvent while
constructing a TasteEventRecord, which Linux Swift 6.4 rejects with 16
conversion errors (reproduced in the portable harness; fails-first).
Ports trunk commit 9de2985 so the Linux portable checks compile on this
lineage too. macOS CI compiles both forms; semantics are unchanged.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
Two review findings, both in glue no test exercised: the guide resolved
the cook packet only through a legacy integer id, so catalog-native
recommend results (Recipe(id: nil, ...)) fell back to the legacy path
with a synthetic ref, and the journal computed macros from legacy
ingredient rows instead of the frozen snapshot the meal was logged
against. The gate is extracted from CookingGuideView into a static
helper so tests drive the exact production resolution; the journal test
logs a real catalog meal through the full flow and asserts the journal
reports the snapshot. Both new tests fail at this head — the helper and
journal still resolve the old way; the next commit fixes them.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
The fail-first run proved both review findings (38835855949 red at
5c8ac46): the catalog-native gate test got nil content, and the journal
reported 0.0 kcal where the frozen snapshot says 840.

The guide now resolves catalog content from the result's own catalog ref
when there is no persisted integer id — the shape the recommend pool
builds for every catalog-native recipe — keeping the legacy bridge and
the parsed-instructions fallback for drafts and unloadable packets. The
journal reports the frozen per-serving nutrition snapshot at the linked
revision, scaled by servings consumed and portion multiplier, and keeps
the legacy ingredient math for cooks with no catalog link. The bridge
test inserts the legacy recipe before referencing it (FK order).

Co-authored-by: Sam Gu <sgu07966@gmail.com>
RecipeCatalogNutrition lives in the FLFeatureLogic package module;
RecipeRepositoryCatalog already imports it, UserDataRepository did not.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
…cloud ranking

The LeChef recipe context, its cook session, the meal finalization log, and
the cloud reverse-scan ranking round trip now resolve a catalog result through
its packet identity instead of the legacy integer id.

Co-authored-by: Obvious <obvious@obvious.ai>
…e catalog surfaces

Home cards carry ScoredRecipeID through the route, so auto-present resolves the
exact recommended result — catalog ref, legacy id, or unsaved title — instead of
the integer column. New suites cover the handle rule, the resolver, the packet
context, and the catalog finalization log.

Co-authored-by: Obvious <obvious@obvious.ai>
…ation id

The portable harness run surfaced two issues. ReverseScanCandidateHandle
numbered catalog candidates off the global list index, so a catalog entry
between legacy rows got -2 and -4 instead of its own counter (-1, -2);
both ranking request paths and the map-back share the enum, so the fix
keeps them consistent. The legacy finalization test fabricated a recipe
id with no backing row and tripped the cooking_history foreign key; the
sheet in production receives recipes loaded from the store, so the test
now pins the id through resolvePersistedRecipeID over the hydrated
mirror row, and the two context assertions use the real member name
(catalogSteps).

Verified: portable harness swift test 15/15 (5 resolver, 5 handle, 5
context-and-finalization) after both fixes, fails-first confirmed with
the red run before them.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
Co-authored-by: obvious-autobuild[bot] <262744130+obvious-autobuild[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be16e60b-5e82-42f0-aec1-0de03774a250

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

macOS CI caught what the Linux portable check cannot compile: the
RecipeResultsView init still declared preferredRecipeID: Int64? against
the stored preferredID: ScoredRecipeID?, ContentView passed
route.preferredRecipeID (a member the route struct does not have), and
the HomeRecommendation fallback construction still passed
recipeID: scored.recipe.id. All three now go through the scored
identity: init param preferredID: ScoredRecipeID?, call sites
route.preferredID / recommendation.preferredID, fallbacks scored.id.

Verified: swiftc -parse clean on ContentView, RecipeResultsView, and
HomeDashboardViewModel; repo-wide grep shows no preferredRecipeID or
recipeID: references remain in Home/Results/ContentView paths.

Co-authored-by: Sam Gu <sgu07966@gmail.com>
Co-authored-by: obvious-autobuild[bot] <262744130+obvious-autobuild[bot]@users.noreply.github.com>
Base obv/burst8-fridgeluck-goal-path is green on hosted macOS CI at
e87ee7b (run 38851718150). Merging it in so PR #185's CI runs against
the fixed base instead of the broken lineage that produced the
SubstitutionService/CookModeViewModel/fixture failures.

Co-authored-by: obvious-autobuild[bot] <262744130+obvious-autobuild[bot]@users.noreply.github.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.

2 participants