Repository navigation
feat(ios): serve catalog recipes to the assistant, finalization, and cloud ranking - #185
Draft
obvious-autobuild[bot] wants to merge 13 commits into
Draft
obvious-autobuild[bot] wants to merge 13 commits into
obvious-autobuild[bot] wants to merge 13 commits into
Conversation
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>
…t9-fridgeluck-screen-path
…t9-fridgeluck-screen-path
…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>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI status — green
c9c7ceab(this branch merged with the green burst8 basee87ee7b2): both jobs pass.build-and-test4m31s,dead-code-advisory3m1s.25f23ad9; the second was inherited base breakage (SubstitutionService.swift:346) that the base thread fixed in457be20dtwo 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.d84b6ca7(before the merge; macOS CI above is the authoritative check for the merged tree)./v1/reverse-scan/rankround trip were not exercised; the hosted CI build + unit suites are the compile and behavior evidence that exists.