feat(lifeboard): packs, recipes and the shopping-list arithmetic - #316
Open
ivanmkc wants to merge 1 commit into
Open
feat(lifeboard): packs, recipes and the shopping-list arithmetic#316ivanmkc wants to merge 1 commit into
ivanmkc wants to merge 1 commit into
Conversation
Packs are data, never code. A pack names a capability and a view builder; the app owns both and looks them up in a table. Validation is the security boundary and is written as one: allow-lists throughout, https-only feeds, a refresh floor of 30 seconds, and a declared `writes` set that is enforced at the point of application rather than trusted in each capability. Selection caps at two packs per turn. Each one adds a few hundred tokens of instructions, and a prompt carrying six answers worse than one carrying the right one. The arithmetic is code, and this is the part every competitor gets visibly wrong. An item's quantity is the sum of its contributions, one per recipe, so re-scaling pancakes from 6 servings to 4 updates that recipe's share of a line already on the list instead of adding a second flour. Amounts that cannot be honestly summed -- 100 g butter plus 1 cup butter, or "a handful" -- are shown as the part we know plus "+ more", never as an invented total. Ranges take the top: running out is worse than a spare onion. Nothing is ever silently removed. Pantry staples are marked and left on the list for you to tick; taking a recipe back off leaves its lines with a note rather than deleting them. Plan to Eat shipped the opposite and withdrew it. Instacart's schema is adopted rather than hand-rolled -- name separate from display_text, the measurements array rather than the deprecated flat pair. The call is written and injectable but off without a key, which this app has nowhere to keep; the floor that always works is a prefilled search per item. Amazon's legacy add-to-cart URL is deliberately unused: it is not a contractual API. A bound board is authored once and re-rendered from data forever after -- no model on a timer. A failed refresh keeps the last good data behind a visible stale marker instead of blanking, and probeSource runs at authoring time so "your browser cannot read this feed" is said while the board is being made rather than silently every hour afterwards. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 2, 2026
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.
The stack
localStoragefor the test suite on Node 25@ivanmkc/termchart-canvas; injectable interact transportEvery branch in the stack was checked out on its own and verified independently:
npm install,tsc --noEmitfor every package,npm testacross the workspace, and the offline e2e where it exists. All twenty are green — no branch depends on a later one to build or pass. Full viewer e2e (11 suites, 106 assertions) was run on #312 as the behaviour-preservation evidence for the extraction.Stack position: 6 of 10. Base:
lifeboard/04-agent.Packs — recurring operations as data — and recipes as the first consumer.
Packs are data, never code. A pack names a capability and a view builder; the app owns both and looks them up in a table. Installing one can never introduce behaviour the app did not already have. Validation is the security boundary and is written as one: allow-lists throughout, https-only feeds, a refresh floor of 30 seconds, and a declared
writesset enforced at the point of application rather than trusted in each capability.Selection caps at two packs per turn. Each adds a few hundred tokens of instructions, and a prompt carrying six answers worse than one carrying the right one.
The arithmetic is code, and this is where every competitor is visibly wrong. An item's quantity is the sum of its contributions, one per recipe, so re-scaling pancakes from 6 servings to 4 updates that recipe's share of a line already on the list instead of adding a second flour. Amounts that cannot honestly be summed — 100 g butter plus 1 cup butter, or "a handful" — are shown as the part we know plus "+ more", never as an invented total. Ranges take the top: running out is worse than a spare onion.
Nothing is ever silently removed. Pantry staples are marked and left on the list to tick; taking a recipe back off leaves its lines with a note rather than deleting them. Plan to Eat shipped the opposite and withdrew it.
Instacart's schema is adopted rather than hand-rolled —
nameseparate fromdisplay_text, the measurements array rather than the deprecated flat pair. The call is written and injectable but off without a key, which this app has nowhere to keep; the floor that always works is a prefilled search per item. Amazon's legacy add-to-cart URL is deliberately unused: it is not a contractual API.A bound board is authored once and re-rendered from data forever after — no model on a timer. A failed refresh keeps the last good data behind a visible stale marker instead of blanking, and
probeSourceruns at authoring time so "your browser cannot read this feed" is said while the board is being made.Verified: 231 unit tests, including the 6→4 re-scale, the staples rule, and a pack that declares an undeclared write being refused.
🤖 Generated with Claude Code