131 KiB
Changelog
1.6.0 - 2026-12-01
New features
- CLI:
gram checknow matches editor diagnostics and adds automation options:--fixapplies safe fixes in place (~{15%min}→~{15 min}, spaced composites, deprecated frontmatter keys, missing blank lines).--format jsonoutputs a versioned JSON report for CI and AI agents.--strictnow also flags ingredients missing from the database (use--skip-dbto opt out).
- Parser & Kitchen: Common writing mistakes now raise actionable warnings with editor quick fixes (
REFERENCE_TO_INGREDIENTfor&flouron raw ingredients,%in~{15%min}/@flour{200%g}, and#oven{180°C}→^oven{180°C}). - Docs & Playground: Redesigned dark theme with a softer charcoal palette and improved contrast.
- Kitchen & Renderer: Unified frontmatter key registry (
FRONTMATTER_KEYS, includinglanguage), cleanerlastUpdateddisplay in HTML recipes, and newDEPRECATED_FRONTMATTER_KEYwarning. - Language Server: Configurable linting and new writing checks:
- Tune rules in
.gram/config.yaml(lint.rules) or silence per step with// gram-ignore CODE. - Adds
LOST_INGREDIENT,MERGED_STEP_LINE,SUSPECT_INGREDIENT_NAME, andUNREAD_FRONTMATTER, plus a quick fix to add unknown ingredients toingredients.yaml. - Exposes the shared lint layer via the experimental
@gram-lang/modules/lintentry point.
- Tune rules in
- Language Server: New editing aids across all LSP editors — frontmatter completion and hover, completion for existing cookware/timers/tracks (
#,^,~,~_),Ctrl+Clickand export completion on@use, and symbol occurrence highlighting. - Language Server & CLI: Standalone
gram-language-serverbinary andgram lspcommand for any LSP editor (Neovim, Helix, Emacs, Zed, Sublime Text), withinitializationOptions: { views: false }to disable preview rendering in editors without side panels. - Parser & Kitchen: Component aliases must now immediately follow
:(@dry white wine:wine{10ml});:is now ordinary punctuation instead of swallowing text, and spaced aliases raiseALIAS_AFTER_BLANK(auto-fixable with--fix). - Parser: Also ships
syntaxes/gram.tmLanguage(plist) so Sublime Text highlights.gramfiles out of the box. - CLI: New
gram view <file> --servecommand for live browser preview from any editor, reloading automatically on save (supports--port,--no-open, and--view).
Bug fixes and improvements
- Analyzer: With mass standardization off, percentages and ratios targeting mass-based ingredients now resolve and merge cleanly in sections and shopping lists (fixing false
RELATIVE_QUANTITY_UNKNOWN_MASSwarnings). - CLI: Multi-file commands (
check,format,build,shop,db sync,suggest --pattern) now accept folder paths, andgram suggestnow includes recipes without##sections. - Format: Multiple blank lines after the frontmatter now collapse to a single blank line.
- Parser: Frontmatter values now support YAML quote escapes (
'',\",\\) and commas inside quoted inline list items. - Kitchen:
@&flournow matches@Flour{100 g}case-insensitively instead of raisingUNDEFINED_REFERENCE. - Renderer: Baker's percentages in ingredient and shopping lists now render as subtle text with an explanatory tooltip.
- Modules, CLI & Language Server: Hardened
@usepaths across platforms — rejects backslashes (MODULE_SPECIFIER_INVALID) and null bytes, allows folders starting with..(e.g...notes/), and confines editor@usecompletion to the project.
Deprecated
@gram-lang/kitchen&@gram-lang/renderer: Frontmatter keysservings,yield, andyieldswill be removed in 2.0.0. Useportionsinstead ofservings, andmakesinstead ofyieldoryields.@gram-lang/language-server: OmittinginitializationOptions.viewsto receive legacygram/previewUpdatednotifications will be removed in 2.0.0. Passviews: trueorviews: falseexplicitly.
1.5.2 - 2026-11-27
Bug fixes and improvements
- Kitchen, Analyzer & Renderer: Composite ingredients used in different units (e.g.
@butter{100 g}and@brown butter{1}<@butter{2}) now stay separate on the shopping list instead of adding up incompatible units, and a parent also used whole (@eggs{1}next to@egg yolks{2}<@eggs{2}) can now be targeted by--scale. - CLI / Import:
gram importnow tells you which step failed (source, recipe extraction, or AI model), handles more website recipe formats without crashing, and stops generating#comments in frontmatter. - CLI: Commands (
view,export,print,build,plan,shop,scale,cook…) now fail cleanly on syntax errors instead of showing an empty recipe,gram printprints the file path if no browser is available, and multi-file commands process files in sorted order. - Kitchen & i18n: Timers with decimal fractions (
~{1.5/2 min},~{1,5/2 h}) now work instead of raisingINVALID_DURATION. - Format: Fixed four edge cases where
gram formatcould slightly alter a recipe (section headers containing<, non-breaking spaces around<,---blocks inside steps, and trailing zeros in duration fractions). - Language Server: Fixed ingredient database detection and false warnings in editors:
- Now reads
database:from.gram/config.yaml(updating live on edit), detects.gram/ingredients.yamlin more editors, and translates the "Preview" button. - Unknown-ingredient warnings and nutrition hovers now match actual nutrition lookup (ignoring case, accents, hyphens, and apostrophes, without guessing plurals).
- Intermediates used in percentages/ratios/timers or declared on section headings (
## Dough ->&dough) are no longer flagged as unused.
- Now reads
- Parser & VS Code: A trailing colon after an ingredient (
Add @salt:) is now kept in the step text instead of disappearing, and temperature names (ovenin^oven{180°C}) are now highlighted like timer names in VS Code. - Renderer: The HTML recipe view no longer shows
languageas custom metadata in the header. - Kitchen & Language Server: Writing spaces around
<in a composite (@lemon zest{1} < @lemon{2}) now raises aSPACED_COMPOSITEwarning with a one-click fix in the editor instead of silently counting both ingredients.
1.5.1 - 2026-11-22
Bug fixes and improvements
- Kitchen: Intermediates and task-graph links now match by canonical ID, ignoring case and accents:
->&Doughand&dough{}(or->&Pâte{}and&pate{}) now link reliably in the schedule, and circular references across mismatched casing (&A/&B) are properly detected.- Compiled task graphs now store canonical IDs in
produces,consumes, andintermediateso formatting no longer alters them.
- Kitchen & Analyzer: Unresolved shopping list entries (shares and ratios with a missing or weightless target) are now built from parsed values rather than copied from source text, so
gram formatno longer alters them:- Ratios drop trailing zeros, extra spaces, and a denominator of 1 (
15 g / L @&water). - Shares preserve the decimal separator written by the author (
12,5% of flour).
- Ratios drop trailing zeros, extra spaces, and a denominator of 1 (
- Renderer, CLI & i18n: Displayed quantities now round by significant digits rather than a fixed decimal per unit, fixing inaccurate or zeroed amounts introduced in 1.4.0:
- Amounts keep three significant digits (two below 1) without truncating whole numbers (
0.15 kgstays0.15 kg,0.02 kgno longer reads0), while kitchen fractions stay unchanged. - Weights in grams keep one decimal from
1 gupwards and no longer render as0 gbelow0.05 g. - Adds
formatAmount,roundAmount, andamountDecimalsin@gram-lang/i18n.
- Amounts keep three significant digits (two below 1) without truncating whole numbers (
- Kitchen, Analyzer & i18n: Small quantities are no longer stored as zero across scaled amounts, shopping totals, resolved ratios, and standardized weights:
- Stored values keep two decimals as before, but never fewer than two significant digits (
0.02 kgdivided by 10 stays0.002 kg, and a ratio weighing0.0047 gkeeps its weight). - Adds
roundQuantityin@gram-lang/i18n(re-exported by@gram-lang/kitchen).
- Stored values keep two decimals as before, but never fewer than two significant digits (
- Parser: Fixed syntax edge cases and parsing performance across empty files, headers, and inline elements:
- Empty or blank-only files, as well as a trailing comment after
@usewithout a final newline, now parse cleanly instead of failing or becoming a step. - Bare
##headers now parse as untitled sections (instead of a#tool), empty~{}stays an anchor, and->&dough ~{}declaresdough. - Symbol-only tokens (
##,@@,#~,&&) and&followed by a space (such assalt & pepper) now stay plain text instead of creating phantom tools, ingredients, or references. - Actions (
[…]), text temperatures (^{…}), and section anchors (~{…}) now end on their own line (leaving unclosed[or^{as plain text), while/* … */block comments still span lines. - Long quantity sums (
@flour{1 cup + 2 tbsp + …}) now parse in linear time so they no longer slow down editors on every keystroke.
- Empty or blank-only files, as well as a trailing comment after
- Parser & Format: The parser and
gram formatnow share the same rules for whitespace and line breaks:- Lines containing only spaces or tabs end a step just like empty lines, and trailing spaces or tabs on step lines are ignored.
- Lone
\rline breaks are recognized, a leading UTF-8 BOM is skipped by the parser and kept by the formatter, and non-ASCII spaces (such as non-breaking spaces) stay plain text. gram formatwrites line breaks as LF without stripping non-ASCII whitespace.
- Format:
gram formatand format-on-save now rewrite only valid elements and preserve author text and line structure:- Plain text in section titles, preparations, comments, and unparsed files stays as written (unparseable files are only repaired and trimmed).
- Free-text units (
@e{%1.0}), text temperatures or durations (^{160 °C/320 °F}), blank lines inside/* … */, and tabs or trailing blanks inside names and titles are kept untouched. - Formatting no longer joins text across line breaks (such as
@flourfollowed by{200 g}on the next line or unclosed{) and handles many unclosed braces in linear time. - Tab-spaced composite separators (
@yolks{3} < @eggs{3}) now format cleanly in a single pass.
- Kitchen: Marking more than one ingredient as the baker's-percentage base (
@*flour{500 g}and@*rye{100 g}) now keeps the first base and raises aMULTIPLE_BAKERS_PERCENTAGEwarning for the others instead of aborting compilation and hiding all diagnostics.
1.5.0 - 2026-11-20
New features
- Scheduler, Renderer & CLI: Clock times can now be entered and displayed in 12-hour (
1:00 PM) as well as 24-hour (13:00) format:--available,--meal-times,--serve,--find, theiravailabilityandmealTimessettings, and the editor's serving time accept 12-hour times in any case or spacing (8am-10pm,fri=6pm-12am,12:30pm,8pm,"2026-10-11 1:00 pm"), rejecting invalid forms like13pm,0am, or bare hours.- Adds a
clockview setting (auto,12h,24h) controlling time formatting in the run sheet, serving-time suggestions, and iCalendar descriptions;auto(default) follows the reader's locale region rather than the recipe language. - Configurable via
--clock(gram plan,gram export,gram print),clockin.gram/config.yaml(or global config),gram.clockin VS Code, and the playground's Display menu. - Adds
localesupport toprepareViews(), anhourCycleoption to run sheets, clock helpers (formatClock,chooseClock,resolveHourCycle,systemLocale) in@gram-lang/renderer, andparseTimeOfDay/parseLocalDateTimein@gram-lang/scheduler(JSON and ISO data remain unchanged).
- Parser & Kitchen: An ingredient or intermediate quantity can now be written as a sum or difference of terms (
@flour{1 cup + 1 tbsp},@sugar{1 cup - 2 tbsp},@butter{1 cup + 20 g},&dough{1 kg + 200 g}):- Supports any number of
+/-terms (including fractions and ranges) on ingredients, composite parents (<@oranges{1 lb + 4 oz}), and intermediates (including@usebase yields); scaling multiplies each term, andgram importnow preserves multi-measure sums instead of folding them into decimals. - Steps and section ingredient lists keep sums as written (
100 g + 100 g), while scaled amounts format cleanly for cooking (2 cup + 2 tbsp,2.4 kg); compiled JSON stores terms inparts(withminus: truefor subtraction) and totals inqty/unit(or full text inunitfor mixed unit kinds). - Invalid sums (missing unit, percentage, multiplication, subtracting a range or across unit kinds, zero total) raise
INVALID_QUANTITYwith a suggestion indata;OZ_AFTER_VOLUMEflagsozafter a volume ({1 cup + 2 oz}), andINVALID_UNITsuggests a sum for adjacent quantities ({1 kg 200 g}). - Masses and nutrition weigh each term individually (returning no mass if any term cannot be weighed),
gram diffshows formatted quantities viafromText/toText,@gram-lang/rendererexportsformatUsageQuantity, and@gram-lang/i18nexportstermsTotal,mergeTerms,formatTerms, andTerm.
- Supports any number of
- Language Server, VS Code & Format: Editors and the formatter now support sums of quantities (
@flour{1 cup + 1 tbsp}):- Quick fixes convert adjacent quantities into a sum (
{1 cup 5 tbsp}→{1 cup + 5 tbsp}), apply suggested percentage resolutions ({100 g + 10%}→{110 g}), and clarifyozafter a volume asfl oz. - Hover previews show the combined total (
= 17 tbsp) or distinct unit kinds, along with estimated weight from the ingredient database. - Unit completion works inside each term of a sum once its number is typed (
{1 cup + 2). gram formatspaces+and-in ingredient sums (leaving ranges, timers, and temperatures untouched) and trims trailing zeros across quantities ({1.50 kg}→{1.5 kg},~{1.50 h}→~{1.5 h}), reporting operator spacing fixes inquantityOperatorSpacing.
- Quick fixes convert adjacent quantities into a sum (
- Parser & Kitchen: Decimal numbers can now be written with a comma as well as a point (
{1,5 kg}and{1.5 kg}):- Supported in all braced numbers (ingredients, ranges, relative quantities, cookware, temperatures, timers, and section anchors) and displayed in the reader's locale.
- Commas followed by exactly three digits (
{1,000 g}) are still read as decimals (1 g), with a newAMBIGUOUS_NUMBERwarning in case a thousand was intended (while{1.000 kg}remains1 kgwithout warning). gram formattrims trailing zeros after a comma ({1,50}→{1,5}) while keeping{1,000}as written.
- Parser & Kitchen: Timers and section anchors now support natural duration syntax in English and French, with or without spaces:
- Accepts compound durations (
~{1h30},~{1 hr 30 mins},~{1 heure 30},~{1h + 30min},~{2min30}), clock notation (~{1:30 h},~{0:04:30}), primes (~{5'30"},~{10'}), ranges (~{1h30-2h},~{45 min - 1 h}), section anchors (~{-1h30},~{-1j 12h}), and aliases likehr,hrs, andmn.gram importnow outputs these natural forms and avoids ambiguous notations like~{1:30}. - Ambiguous or invalid durations (
~{1:30},~{1h75}, reversed ranges) raiseINVALID_DURATIONwith a suggested fix and are excluded from total time; anchor warnings now point directly to the anchor. - Compiled timers store the source text in
rawand total minutes inminutes(normalizingquantity/unitto the smallest written unit for new forms) and are scheduled like any other timer. - Exposes
parseDuration(@gram-lang/i18n) andreadAnchor(@gram-lang/kitchen), and addslocto AST section anchors.
- Accepts compound durations (
- Playground: The playground now exposes the example ingredient database behind its weight and nutrition calculations:
- Adds a read-only
ingredients.yamltab alongside recipe files, using the same format as a project database and linking to the database guide. - Missing-ingredient and missing-data warnings link directly to open the database tab.
- Adds a read-only
- CLI / Shop:
gram shop --format jsonnow exposes numeric ingredient amounts alongside the formattedqtystring:- Adds
amount(numeric value in the displayed unit) and canonicalunit(nullfor counts). - Adds
rangebounds when an entry is a range (with the midpoint inamount). - Lists unmerged unit groups in
partsand non-numeric quantities inunresolved(excluded fromamount).
- Adds
- Kitchen & Rendering: The shopping list merges repeated quantities of an ingredient wherever possible:
- Units from the same measuring system combine onto one line in natural cooking units (
1 cupand2 tbspbecome1 cup + 2 tbsp;1 kgand200 gbecome1.2 kg), reducing mixed-unit warnings and supportinggram scale --target. - Different measuring systems (
1 cupand100 ml) or unit kinds (volume and weight) stay on separate lines. - Ranges add by their bounds (
2-3 gand200 gbecome202-203 ginstead of202.5 g). - In compiled JSON, merged entries store the total in the smallest unit written (
18 tbsp,1200 g) and, for ranges, keep the midpoint inqtyalongside a newrangefield.
- Units from the same measuring system combine onto one line in natural cooking units (
- Parser & Kitchen: Steps can now mark inline target states with an optional glued verification note (
Whisk until ={ribbon stage}(the batter falls back in a continuous ribbon).):- Only the state sits inside
={…}, with an optional single-line note attached to}; unclosed or empty={raises a syntax error, and braceless@ingredientnames end before a target state (@salt until ={taste}). - Compiled steps emit a
checkpointtoken (state, plus optionalnote) without affecting scaling, scheduling, or the shopping list. - Rendered across HTML, Markdown, plain text, and print views;
gram cookshows checkpoints below each step and reminds you when a step timer rings. gram difftracks added, removed, and changed target states,gram importpreserves them from sources, and editors highlight them.
- Only the state sits inside
- Parser & Kitchen: Temperatures can now carry a glued parenthetical note for oven mode or probe placement (
^{160°C}(fan),^oven{180°C}(grill),^{63°C}(internal),^{high heat}(covered)):- Only parentheses touching
}on the same line are parsed as a note; spaced parentheses remain plain step text. - Displayed alongside the temperature in HTML, Markdown, plain text, print, and
gram cook(which now formats temperatures consistently, including word-based ones like^{high}). - Adds an optional
notefield on AST and compiled JSON temperatures, tracks note changes ingram diff, and exportsformatTemperaturefrom@gram-lang/renderer. gram importpreserves oven modes as temperature notes rather than leaving them in prose.
- Only parentheses touching
- Rendering: Timers in steps now format durations consistently with the rest of the page using non-breaking spaces (
~{90min}and~{1h30}display as1 h 30 min, ranges as45 min – 1 hor1–2 h), across views,gram cook, and the run sheet, via the newformatDurationRangeandformatTimerDurationhelpers and theformatDurationoption. - Language Server & VS Code: Editors now understand natural timer and anchor syntax:
- Hovering a timer shows its normalized duration (
~{1:30 h}→1 h 30 min), and hovering a section anchor shows its lead time and whether it starts a separate working day. - Unit completion inside
~{…}suggests only time units (and no longer offers time units for ingredients). - Syntax highlighting distinguishes numbers and units in
~{1h30},~{1:30 h},~{5'30"}, and duration ranges.
- Hovering a timer shows its normalized duration (
- Parser, Kitchen & Analyzer: Ingredients, intermediates, and timers can now be written as unit ratios:
- Supports ratios across units or counts on ingredients (
@eggs{1 / 100 g @&flour},@salt{15 g / 1 L @&water}), homemade preparations (&stock{250 ml / 100 g @&rice}, plus percentages like&stock{250% @&rice}), and proportional timers (~{15 min / 500 g @&roast},~{4 min / @&cutlet}). - Resolves compatible units at compile time and cross-family ratios via the ingredient database; incompatible or zero-denominator ratios raise
RELATIVE_QUANTITY_UNKNOWN_MASS(withreason) orINVALID_QUANTITY(reason: "zeroRatioDenominator") instead of guessing. - Whole-use references to a section preparation (
Roll out the &dough) now estimate mass from the producing section, while step-produced intermediates (Mix … ->&dough) require an explicit amount (reason: "stepProducer"); warnings and formulas in imported bases display original author names rather than internal aliases. - Scaling a recipe re-resolves all ratios and recomputes the schedule, total times, and shopping list.
- Views display resolved ratios in tooltips, and the language server provides syntax highlighting, target completion, intermediate renaming, hover previews, and inlay hints.
- Supports ratios across units or counts on ingredients (
Bug fixes and improvements
- Analyzer:
analyze()no longer mutates the compiled recipe's warnings array, preventing duplicate warnings when re-analyzing the same recipe in editors and the playground. - CLI: Fixed
gram plan --findrejecting single-digit hours (such as9:00), accepting impossible times (such as25:99), and failing late on out-of-rangeavailabilitytimes (such as24:30). - Rendering: Narrow ingredient lists now switch to a single column before stacking amounts below ingredient names.
- Language Server & VS Code: Fixed the live-preview CodeLens above
.gramfiles to display▶ Previewin English instead of▶ Aperçu. - Analyzer & Kitchen: Percentages inside alternatives (
@butter{10% @&flour}|@oil{8% @&flour}) are now resolved per option (including references to earlier options in the same group) without summing across alternatives, anddetectCyclesnow traverses alternative formulas. - Kitchen: Percentages on composite parents (
@eggs{3}<@box{50% @&flour}>) now raiseINVALID_QUANTITY(reason: "relativeNotSupported") instead of being silently dropped. - Kitchen: Fixed relative quantities targeting a step-declared intermediate (
->&dough) in an earlier section falsely raisingVARIABLE_NOT_FOUND. - Kitchen & Rendering: Fixed text-only quantities (
@sel{une pincée},@pepper{to taste}) disappearing from steps, section ingredient lists, and shopping lists (stored invariable_entriesin compiled JSON). - Parser & Kitchen: Fractions with a zero denominator (
@flour{1/0 cup}) now raiseINVALID_QUANTITY(reason: "zeroDenominator") and drop the invalid number (preserving it in ASTinvalidNumber) instead of silently misreading it.
Deprecated
@gram-lang/i18n:runSheetRangein the renderer dictionary ("{min} to {max}"), no longer used by the run sheet, will be removed in 2.0.0. UseformatDurationRange()from@gram-lang/rendererinstead.
1.4.2 - 2026-11-17
Bug fixes and improvements
- CLI / Cook: Fixed
gram cooktimers that never finished: a timer now rings when its time is up and shows as done, ready to be dismissed with any key. - Format: Fixed a temperature written with a space and trailing zeros, such as
^{160.0 °C}, that took two runs of the formatter to become^{160°C}: it is now fixed in one. - Parser: Fixed an unclosed parenthesis in a preparation note (such as
@flour{200g}(sifted and) swallowing the rest of the recipe up to the next), including later steps and sections. Preparations now stay on one line, so an unclosed(or a note split across lines is kept as plain step text. - Kitchen, Analyzer, Renderer & CLI: Fixed lost, split, or skipped ingredient quantities across shopping lists, views, and diffs:
- Shopping lists now merge different spellings of the same unit (
1 cupand2 cups,1 c.à.sand2 tbsp) onto a single line, which also makes those ingredients work again withgram scale --target. - The HTML view now displays every quantity when an ingredient uses multiple units in the same section (
100 g + 1 cup), instead of showing only the first. gram shopno longer drops ingredients whose quantity cannot be computed (such as a percentage of a missing intermediate) and lists them as written.gram diffnow compares each unit separately when an ingredient appears in multiple units, and ignores changes that only affect how a unit is spelled.
- Shopping lists now merge different spellings of the same unit (
- Renderer: Fixed a missing space between two consecutive elements in a step, such as an ingredient followed by a timer or cookware (
@flour{500 g} ~{1h}rendered as "flour (500 g)1 h"), across all views andgram view.
1.4.1 - 2026-11-14
Bug fixes and improvements
- Parser: Section headers with leftover text after an anchor or intermediate (such as a multi-word
->&glazed rhubarbmissing braces) now raise a clear error instead of blaming the timer or turning the section into a step, and a section header on the last line with no trailing newline is now recognized. - Kitchen: Split quantities across two units (
@flour{1 cup 5 tbsp}) or prefixed with words (@flour{about 200g}) now raise anINVALID_UNITwarning instead of being misread or dropped when scaling (while unit-only descriptors like{1 tin of 400 g}or{a pinch}remain valid). - Analyzer: An ingredient whose unit holds a quantity of its own (
@tomatoes{1 tin of 400 g}) no longer falls back to the database's per-piece weight (which counted one tin as one tomato); its mass is reported as unknown until Gram parses the inner quantity. - Renderer: Hovering a preparation (
&dough) in HTML now highlights the entire section that makes it,formatFractionis now applied to ingredient quantities across recipe views, and ingredients written inkgormgno longer repeat their standardized mass next to them. - Renderer & CLI: Totals where you buy or read an overview (shopping list, recipe/section weight, nutrition base,
gram shop) convert metric amounts from 1000 g/ml up tokgorl(3.9 kginstead of3900 g), while steps, section ingredients, the run sheet, andgram cookkeep grams for weighing (API helpers:toLargerMetricUnit,isMetricMassUnitin@gram-lang/i18n). - Renderer & CLI: Numbers follow the recipe's language (
lang/ projectlanguage, with decimal commas in French and no thousands separators ingram shop/gram scale), and spoons, cups, and imperial measures display as fractions (1 3/4 cup) across views and CLI commands while keeping machine attributes unchanged (API helpers:formatNumber,localizeDecimals,toKitchenFractionin@gram-lang/i18n). - CLI / Cook: Timer countdowns in
gram cooknow honor the unit written in the recipe (~{1h}counts down 1 hour and~{30 s}30 seconds, instead of treating every timer as minutes).
1.4.0 - 2026-11-13
New features
- Scheduler: The planning engine now lives in its own package,
@gram-lang/scheduler, which@gram-lang/kitchenuses. Compiled recipes keep every field published in 1.3.0, and everything@gram-lang/kitchenexported before is still exported from it:layout(tasks, { miseEnPlace, rests })lays a recipe's list of tasks out on a timeline, for any mise en place plan and any choice of waits, and reports what cannot work (a time paradox, a track contention, a working day pushed before its 24 hours)project(recipes, context)places a recipe on the calendar from a serving time, a time zone and when the cook is available; it stretches or shortens the waits written as a range so the cook's own work avoids the night, and reports what it could not fixrunSheet(plan)groups a plan into the days of the recipe, the visits to the kitchen (with the sections each one cooks and how early it could be done) and the waits that go on without the cookfindServeTimes()ranks the serving times that work over a range of days, with the reasons of the others, andearliestServe()gives the first one that works if the cook starts nowparseAvailability(),parseMealTimes()and the other readers of a project's settings (08:00-22:00,fri=18:00-22:00,2026-10-09=none) are shared by the CLI and the editor
- Kitchen: Recipes now know when each part of the mise en place should happen:
- New fields on the compiled recipe:
miseEnPlace(how long each section's own preparation takes),tasks(the list of tasks and what each one waits for),schedule(a default timeline, with the preparation right before each section and the shortest rests),days(the working days of a timeline) andgenerator(the version that compiled it). A recipe with no step at all now has a preparation time of 0 - Any other timeline comes from the same list, without compiling again: all the preparation at the start (
upfront) or at the start of each working day (perDay), with the shortest, middle or longest of every rest written as a range (newlayout(), from@gram-lang/scheduler) - A timer is exact (
~_{12h}lasts exactly 12 hours); a rest written as a range (~_{12-24h}) is planned on its shortest figure unless you pick another, and an active timer written as a range (~{20-25min}) on its longest, so dinner is never late. Only an anchor in days (~{-1d}) opens a working day - New warnings:
DAY_OVERFLOWflags a working day pushed before its 24 hours by a long rest,DURATION_OUT_OF_RANGEflags a duration over 1000 years (capped, instead of breaking the timeline with0,InfinityorNaN), and aPASSIVE_OVERLAP_SAME_COOKWAREnotice flags two passive timers that overlap on the same cookware with no named track in common - An intermediate (
&dough) is gathered in the section that uses it, and JSON compiled before 1.4.0 still gets a total and idle time in the renderer outputs, the editor hint andgram diff
- New fields on the compiled recipe:
- Run sheet: A new run sheet shows what the scheduler computed, and replaces the Gantt chart as the view of the schedule:
runSheetToText,runSheetToMarkdown,runSheetToHTMLandrunSheetToPrintHTMLwrite the plan: the days of the recipe, then for each visit to the kitchen a worksheet in three parts: the mise en place (what to take out, with the weights, the preparations made before and the bases in stock), the execution (the steps of each section, numbered as in the recipe) and what to do on leaving (what goes on afterwards, and when to come back)- Each visit says how early it could be done ("Possible from 18:00") or which wait holds it in place, and a wait the plan stretched or shortened is reported on its day
- A recipe with no serving time is told in days before the service (D-2, D-1, day D); the printed plan has one day per page, with boxes to tick for the mise en place
- The recipe views no longer carry schedule details: the run sheet is its own view. For developers,
describeRunSheet()gives the same plan in words
- Renderer / Mise en place: The mise en place can now be planned right before each section, all at the start, or at the start of each working day:
- New
miseEnPlaceoption ("perSection"by default,"upfront"or"perDay") on the HTML, Markdown and print outputs, and a newrestsoption ("shortest"by default,"balanced"or"longest") for the waits written as a range (~_{12-24h}) - The total time follows the chosen schedule, and its tooltip explains how it adds up (preparation, active time and waits), then points to the run sheet for the hour-by-hour plan
- The recipe no longer shows the waiting time on its own, in any format: it is counted in the total time, and the run sheet is where the waits are planned
- New
- CLI / Plan: A new
gram plan <recipe>command plans a recipe: the days of work, the visits to the kitchen, what to take out and which steps of each section to read:--serve "2026-10-11 13:00"plans it backward from the time it is served; without it, the plan is told in days before the service (D-2, D-1, day D) and ends with the earliest time it could be ready if you start now--tz Europe/Parissets the time zone and--availablesays when you can cook (08:00-22:00for every day,fri=18:00-22:00for a day of the week,2026-10-09=nonefor a date). By default they come from the newtimezoneandavailabilitysettings of.gram/config.yaml(gram config set availability 08:00-22:00), and only then from this machine- A wait written as a range (
~_{8-16h}) is made longer or shorter to keep your own work out of the hours you are not available, and the plan says which one and why; what cannot be fixed is listed at the top --find 2026-10-12/2026-10-15lists the serving times that work between two moments, at your meal times (--meal-times 12:30,20:00, or the newmealTimessetting), best first, and why each of the others does not--format text|md|html|jsonpicks the output, and--ics plan.icsalso writes a calendar file with an event and an alarm for every visit to the kitchen--mise-en-place,--rests,--scaleand--stockwork as they do ingram view
- CLI / Run sheet:
gram exportandgram printcan now write the run sheet instead of the recipe:--view run-sheet(the recipe remains the default) supports--serve,--tzand--available; without--serve, the plan is told in days before the service (D-2,D-1,Day D)gram exportwrites<recipe>.run-sheet.md(or.html,.txt) next to the recipe unless--outputis given, andgram printputs one day per page- Each view offers only the formats it has: asking the recipe for
--format textsays which formats it offers instead of writing something else
- CLI / View & Export:
gram view,gram exportandgram printaccept a new--mise-en-place <per-section|upfront|per-day>option, to see the recipe with the mise en place planned right before each section (the default), all at the start, or at the start of each working day:- A new
--rests <shortest|balanced|longest>option does the same for a wait written as a range (~_{12-24h}): the shortest by default, the middle or the longest, in the total time as in the length shown on the step itself gram cookaccepts both options too, for the total time it shows and the length of the timer of such a wait
- A new
- VS Code / Run sheet: The editor shows the run sheet of the recipe in place of the Gantt chart:
- A new
Gram: Run Sheetcommand opens it next to the recipe, in days before the service (D-2, D-1, day D); it follows thegram.miseEnPlace,gram.restsandgram.commentssettings - A Served at field at the top of the run sheet puts it on the calendar, with dates and clock times, in your project's time zone and hours (
timezoneandavailabilityin.gram/config.yaml); When to serve? proposes the times that work over the next seven days, the earliest first, and says why the others do not. The serving time is kept per recipe while VS Code is open, never saved - A Scale and stock section at the top of the recipe and of the run sheet adjusts this sitting, as
--scale,--stockand--bakers-referencedo in the CLI: a scale in percent or a target quantity of one ingredient, the baker's reference, and the imports already made. These choices are shared by every panel of the recipe and kept while VS Code is open, never saved
- A new
- Analyzer / Diff:
gram diffnow compares the total and idle times of the default schedule, with the mise en place right before each section, so the times it reports match whatgram viewshows by default; the active time is the schedule's too, so changing the range of a cooking time (~{20-25min}, planned on its longest figure) shows in the comparison, and the preparation time is compared as before - CLI / Settings: Every setting of a recipe now has a flag named after it, on every command where it changes something, with the same values and default as in the editor and the playground:
--step-quantities show|hideand--nutrition-basisare the new names of--no-step-qtyand--nutrition, which still work- What the analyzer computes can now be turned off on
gram view,gram print,gram export,gram cook,gram build,gram watchandgram shop:--no-mass-standardization,--no-yield-calculation,--no-nutrition-estimationand--no-bakers-math; everything stays on by default - An unknown value stops the command and lists the values it accepts, under the name you typed
- VS Code / Settings: The editor now offers every setting of a recipe, with the same values and default as the command line and the playground:
gram.miseEnPlace(perSection, the default,upfrontorperDay) chooses when the mise en place is planned, andgram.rests(shortest, the default,balancedorlongest) how long a rest written as a range (~_{12-24h}) lasts; the preview, the run sheet and the total time hint next to the recipe title all follow themgram.stepQuantitieswrites the quantities in the text of the steps, or leaves them out,gram.nutritionBasispins the basis of the nutrition (autois the default) andgram.bakersMathOnlyshows only the baker's percentagesgram.bakersMath,gram.massStandardization,gram.yieldCalculationandgram.nutritionEstimationchoose what is computed from the ingredient database; all are on by default- Changing a
gram.*setting now reaches the language server straight away, without reloading the window (this also applies togram.ingredientDatabase.path), updates every open recipe, and a recipe already open when the editor starts follows it too
- Renderer / Settings: The renderer now describes, in one place, every setting a reader can choose about a recipe, so that tools built on Gram can offer the same choices as the command line, the editor and the playground:
VIEW_SETTINGSlists what the views show (mise en place, rests, comments, nutrition basis, baker's percentages only, quantities in the steps) andRECIPE_SETTINGSwhat the analyzer computes (baker's percentages, weights in grams, preparation losses, nutrition), each with its values, its default and a short descriptionparseViewSettings()andparseRecipeSettings()read them from any configuration object, and fall back on the default for anything missing or unknown, so a mistyped setting never blanks a viewviewSettingsToRendererOptions()andrecipeSettingsToAnalyzerOptions()turn them into the options of the renderer and of the analyzer
- Comments: You can now choose whether the comments of a recipe (
// like this) are shown or left out, in every view:- The renderer takes a new
comments: "show" | "hide"option (default"show") that the recipe views, the print and the run sheet follow; hiding leaves no empty notes section behind gram export,gram printandgram planaccept--comments <show|hide>, and the editor has a newgram.commentssetting for the preview and the run sheet; the playground gets a Display section with a switch- In the run sheet, a note alone on a line sits under its step in small muted text, and one at the end of a line stays in the sentence, between parentheses
- The renderer takes a new
- Renderer / HTML recipe: The HTML recipe has a new design, and the printed recipe follows it:
- A better organized header (title, description, author, source, tags), a summary bar with the portions, the yield, the mass and the energy, and a bar for the times
- Tooltips that stay readable wherever they open in the window, with more practical information: quantity, weight and how it was estimated, preparation, what a part is taken from
- A more interactive recipe: hover an ingredient or a piece of cookware to see the steps that use it, tick the steps off, and follow what a step makes to the steps that use it
- The printed recipe (
gram print,gram export --format html) now looks like the one on screen, in black and white, with boxes to tick - Each view keeps its own styles (
@gram-lang/renderer/gram.cssis imported as before and relies on the CSS@scoperule, supported by every current browser), so one view can no longer change another
- Renderer / Nutrition: The nutrition of the HTML recipe is now a compact table, like a European food label, and easy to reach from the top of the recipe:
- One column per basis, side by side (per 100 g, then per portion), with the energy as the first row in kJ and kcal and the whole recipe underneath; no more switching between bases
- A
%RIcolumn gives each nutrient's share of the reference intake of an average adult (8,400 kJ / 2,000 kcal), per portion - The hero bar shows the energy (
493 kcal per portion, or per 100 g when the recipe declares no portions); clicking it jumps to the table - Sodium is now shown as salt, in grams (sodium × 2.5), and calories as energy, in every view and every language
- With the
nutritionBasissetting set to one basis, the table and the hero bar show that basis alone - The Markdown and plain text recipes show the same table by default, instead of the values per portion only
- Renderer / Quantities: Quantities read the same in every format, on screen and on paper:
- The quantity is written after its ingredient in the text of each step in the HTML views and the print, as Markdown already did, so a printed recipe shows them too, and the weight in grams is written next to the quantity as written in the recipe whenever it tells something more (
flour (250 ml, ~148 g), butsugar (100 g)), in Markdown as well - Hiding the quantities of the steps (
hideStepQty) now works in the HTML views and the print, not only in Markdown
- The quantity is written after its ingredient in the text of each step in the HTML views and the print, as Markdown already did, so a printed recipe shows them too, and the weight in grams is written next to the quantity as written in the recipe whenever it tells something more (
- Renderer / Durations: Durations read more naturally, in the reader's language:
- A duration of a day or more is written in days and hours (a recipe of 25 hours shows
1d 1h,1j 1hin French), and minutes are writtenmin(1h 30min), in every view; the total time tooltip ends on the exact total (= 25h 6min) formatDuration()takes the language as an optional second argument and{ days: false }as a third, and a newdurationUnitsentry of@gram-lang/i18nholds the units of each language
- A duration of a day or more is written in days and hours (a recipe of 25 hours shows
- Renderer / Text: The recipe can now be written as plain text, for a terminal or a plain file:
- A box with the title, the servings and the times, then the shopping list, the cookware, each section with its numbered steps, the notes and the nutrition, in the reader's language and following the same settings as the other formats
gram export --format textwrites it next to the recipe (brioche.txt), and the playground offers it as a format of the recipe; for developers,toText()and thetextformat of the recipe view- The Markdown, HTML and print versions of the recipe now speak the reader's language too: "Instructions", "Ingredients", "or", "optional" and the other words that were always in English follow the language setting (the English output is unchanged)
- CLI / View:
gram viewnow shows the recipe the way every other view of Gram does:- The headings, the labels and the nutrition follow the language of your project, instead of always being English
- The steps repeat the quantity next to each ingredient (
flour (200 g)), comments are shown as notes (--comments hideleaves them out), and a wait written as a range (8-16 h) is shown as written - The colors follow your terminal: plain text when the output goes to a file or another command,
NO_COLORrespected,FORCE_COLOR=1to keep them ingram view | less -R
- Renderer / Views: A new
prepareViews()gathers everything a view of a recipe is built from, worked out once and only when a view asks for it (the timeline, the run sheet, the serving time search):viewslists the views of a recipe (the recipe, the run sheet) with the formats each one offers, the settings it follows and what it needs worked out, andrender(view, input, format)writes one of them;toHTML,runSheetToHTMLand the other functions stay as they areinspectorslists the looks at the pipeline (the composed AST as an S-expression, the analyzed recipe as JSON or as a folding tree) andoutputslists the views and the inspectors together, for an interface that offers bothdescribeError()picks the error to show when a recipe stops compiling and gives its code, message, file, position and a title in the recipe's language, so every interface reports it the same way, andsuggestServeTimes()puts the serving time search in words
- Language Server / Views: Editors can now request only active views through a dedicated views protocol:
- A client declaring
initializationOptions.viewsspecifies open recipe outputs viagram/setOpenViewsand receives targeted updates ingram/viewUpdated: recipe and run sheet views as HTML, or AST and compiled JSON as text or interactive trees. Closed outputs are no longer evaluated - When a recipe encounters compilation errors, open outputs are paused rather than replaced by an error card: editors retain their last valid rendered view, while localized error summaries are provided alongside standard LSP diagnostics
gram/setSessionconfigures transient session parameters for a recipe: target serving time (projecting the run sheet onto the calendar in the project'stimezoneand within itsavailability), scaling factor, pre-prepared imports in stock, and baker's percentage reference. Sessions are held per document in memory, while compiler diagnostics continue evaluating the recipe as written- The outputs a client can open are listed in the
initializeresult, each with its name in the editor's language and what it reads from the plan, so an editor shows a new view of Gram without an update of its own, and offers a serving time for any view laid out in time - A
gram/serveTimesrequest gives the serving times to propose for a recipe, in words: those that work over the next seven days at the project'smealTimes, why the others do not, and the earliest one - A
gram/sessionChoicesrequest gives what session controls offer for a recipe as written: its ingredients, its@useimports (nested ones included), whether baker's math is on, and why the session's scale could not be applied - Editing
.gram/config.yaml(itstimezone,availabilityorpaths) now updates the open recipes and their views right away, instead of at their next edit
- A client declaring
- VS Code / Views: Unified view panels and new developer inspectors:
- A new
Gram: Show View...command lists all available views and opens the selected one: recipe preview, run sheet, and developer inspectors (composed AST and compiled JSON, as source text or an interactive tree).Gram: Live Preview,Gram: Run SheetandGram: Macrosremain available as direct shortcuts - Open panels follow the active
.grameditor tab, refresh when brought back into focus, and the language server computes only the panels that are visible - When a recipe contains errors, panels keep their last valid rendering, dimmed beneath a banner with a button that jumps to the error, instead of going blank
- The live preview always shows the nutrition summary, as the playground does: the Macros button is gone, and
Gram: Macrosscrolls to the table - The Scale and stock section has a Portions field, shown when the recipe states its portions, that scales the recipe when you change it
- A new
- Playground: The views of a recipe are now in front, and the studio offers every setting:
- The recipe and the run sheet are tabs above the output, always in sight. The inspectors (the AST, the JSON, the JSON tree) sit behind one quieter Inspect tab on the right, and turn into a dropdown when the tabs no longer fit, on a phone or in a narrow output column
- A slim bar above the view holds what changes with it, starting with a format menu that shows the view as HTML, Markdown or text (the run sheet can now be read and copied in Markdown and in plain text too), and a Print button opens the view in its print layout, to print it or save it as a PDF
- Every setting of a recipe is now offered, including the quantities in the steps and the nutrition basis, and remembered in the browser (except the serving time, which belongs to the visit); yield management and baker's percentages are on by default, as on the command line and in the editor
- The "Schedule & Service" settings say what they change (mostly the run sheet, and in the recipe only the total and idle times), and the "Portions & Scale" settings have a Portions field, opened by a click on the portions of the recipe, which replaces the small stepper the recipe used to show
- I18n: A new
fillTemplate(template, values)fills the{name}placeholders of a dictionary string ("Serve at {time}"becomes"Serve at 20:00"), leaving a name with no value as written.
Bug fixes and improvements
- Kitchen: Scaling an already compiled recipe (
applyScale) now also scales the quantity a step quotes for an intermediate (Use &dough{100g}), so it gives the same result as compiling the recipe with that scale factor - CLI / Stock:
gram view,gram cook,gram check,gram scale,gram exportandgram printnow warn on stderr when a--stockentry matches none of the recipe's@use, asgram buildandgram shopalready did, instead of ignoring it silently — most often a relative path typed from another directory, since it is resolved from the current directory - Language Server / Diagnostics: Fixed diagnostics and previews that could go back to an older version of a recipe until the next edit, when it was edited quickly while its imports were being read.
- CLI: Every command now stops on an unexpected error the same way: a one-line message instead of a stack trace, which
--verbosestill shows. - Renderer / Markdown: The Markdown recipe is tidier: the headings and alerts have no more emoji prefixes, a blank line separates the notes from the nutrition, and temperatures show a thermometer (
🌡️ 180 °C,🌡️ fridge) instead of a flame. - Playground: The Recipe Studio drawer is fully translated, in English and French: the scheduling settings, the summary of each section, the explanation of every setting, the physical analysis and the list of serving times that do not work, and the serving time field is called "Serving time" ("Heure de service" in French).
Deprecated
- Renderer: the Gantt chart (
toGanttHTML,attachGanttInteractivity,formatTime,formatAxisTime, theGantt*types),@gram-lang/renderer/gantt.cssand thegantt_*strings of the playground, removed in 2.0.0. No Gram surface draws it any more. Use the run sheet (runSheetToHTML), or build a view of your own from the data ofrunSheet();toGanttHTMLwarns once on the console. The Deprecated features page shows how: https://gram-lang.org/docs/how-to/deprecations/ - Kitchen:
steps[].timingsandsteps[].backgroundTasks, removed in 2.0.0. Read thestepandpassiveblocks ofschedule.blocksinstead - Kitchen:
metrics.totalTimeandmetrics.idleTime, removed in 2.0.0. Readschedule.totalTimeandschedule.idleTimeinstead (the oldmetrics.totalTimeis the total with every preparation first:layout(tasks, { miseEnPlace: "upfront" })gives the same number unless the recipe has intermediates, which it prepares once they exist) - Kitchen:
metrics.activeTime, removed in 2.0.0. Readschedule.activeTimeinstead (a timer written as a range counts as its average inmetrics.activeTime, and as its longest figure in the schedule) - Kitchen:
metrics.activeBreakdown,metrics.prepBreakdownandmetrics.totalBreakdown, removed in 2.0.0. UsemiseEnPlaceandscheduleinstead - Kitchen: the
breakdownreturned bycalculatePreparationTime, removed in 2.0.0 (the function then returns{ total }, so code readingtotalis unaffected). Read theitemsofcomputeMiseEnPlace()instead - Kitchen: reading the old
metricsfields when compiled JSON has notasks(JSON compiled before 1.4.0), removed in 2.0.0. Compile your recipes again with 1.4.0 or later - Everything above keeps working, with the same values, until 2.0.0. The Deprecated features page shows what to change for each of them: https://gram-lang.org/docs/how-to/deprecations/
- VS Code: the
Gram: Gantt Chartcommand, removed in 2.0.0. It still works and opens the run sheet, with a notice once. UseGram: Run Sheet - Language server: the
gram/ganttUpdatednotification, removed in 2.0.0. It is still sent to clients that do not declare the views protocol, and the VS Code extension no longer reads it. Readgram/viewUpdatedwith therunSheetoutput, or the data of the compiled recipe - Renderer: the
interactiveScalingoption oftoHTML(), and thedecreasePortions,increasePortionsandeditPortionsstrings of@gram-lang/i18n, removed in 2.0.0. The portions stepper they draw only works where the page around the recipe handles its buttons, so it did nothing in an exported file or an editor preview. Scale the recipe before rendering it instead (applyScale()of@gram-lang/kitchen): the recipe then shows its portions and its scale factor by itself. The option keeps working until 2.0.0 - Renderer: the
interactiveNutritionoption no longer has any effect, since every basis is shown at once, and is removed in 2.0.0. Remove it from your calls - Language Server: the
gram/previewUpdatednotification, sent to clients that do not declare the views protocol, is deprecated and will be removed in 2.0.0. Adoptgram/viewUpdatedwith therecipeoutput instead (see the deprecations page of the docs) @gram-lang/i18n: the labels of the old view selector (playground.viewLabel, andplayground.views.json,ast,jsonTree,markdown,previewandrunSheet) are removed in 2.0.0. Userenderer.outputs(by output id),renderer.formatsandplayground.output.views/inspect
1.3.0 - 2026-09-29
New features
- CLI / Requirements: The CLI now requires Node.js 22 or later (Bun keeps working as before).
- Parser & Kitchen: Units written with abbreviation dots are now understood:
{1/2 c.à.s},{1 c. à c.},{2 fl. oz.}and similar spellings now parse and are recognized as the same unit ascàs,càcorfl oz
Bug fixes and improvements
- CLI / View: Fixed several display issues in
gram viewand cook mode:- Timers now show their real unit (
~{1h}is shown as~1h,~{20s}as~20s) instead of always "min". - Recipe durations are rounded and readable (
1h 5m,25m 5s) instead of raw decimals like1h4.5. - The resting time now appears in the recipe header.
- Common fractions such as
1/4 tspstay fractions in the shopping list instead of becoming0.3.
- Timers now show their real unit (
- Modules: Fixed a misleading error message: a syntax error in the recipe you are editing was reported as coming from an "imported module", even when the recipe imports nothing. It now shows the plain syntax error, and the "imported module" wording is kept only for errors that really are in an imported file.
- Analyzer: Fixed ingredients being ignored for density conversion and nutrition when their entry in
ingredients.yamlisn't spelled exactly like the recipe name, such as "Huile d'olive" stored underhuile-dolive:- Volumes like
@Huile d'olive{10ml}are now converted to grams and no longer trigger "ingredient missing nutrition data" gram db lintnow reports ingredients whose names or aliases would be confused with each other
- Volumes like
- Modules & Rendering: Intermediates declared inside imported modules now show the name you wrote (for example
pressed) instead of an internal path liketofu$marinated$pressed, ingram view, HTML and Markdown output.
Breaking
- CLI: Node.js 20 reached end of life in April 2026 and is no longer supported: upgrade to Node.js 22+ before updating the CLI
Fixed
- Parser: A quantity in braces that can't be read (for example
@salt{1 g/l}or a missing}) is now reported as an error pointing at the brace, instead of being ignored and merging the ingredient with others that share the same first word
1.2.1 - 2026-08-25
Bug fixes and improvements
- Renderer: Switched icons to embedded inline SVGs, removing external CDN dependencies (
unpkg.com) and enabling full offline previews in VS Code. - CLI / Export: Fixed missing ingredient quantities in
gram printand HTML exports (gram export --format html). - Documentation & Playground: Improved accessibility and keyboard navigation across the website and interactive playground (ARIA roles, tab navigation,
prefers-reduced-motion).
1.2.0 - 2026-08-22
New features
- Parser & Kitchen: Introduced modular recipes and multi-file imports via the
@usedirective:- Import external base recipes directly into a recipe using
@use "./bases/shortcrust-pastry.gram" as &shortcrust. - Imported steps seamlessly interleave into the global ALAP scheduling timeline, preserving resting times and dependencies.
- Automatically scales imported base quantities when referenced with specific yields (e.g.
&shortcrust{250g}halves a 500 g base recipe). - Supports destructured multi-yield imports (e.g.
@use "./bases/tart-elements.gram" as { &crust, &frangipane }) scaling each component independently. - Supports multi-word bindings using bracket notation (e.g.
@use "..." as &pastry dough{}). - Resolves project-root paths (
@/bases/...) and custom path aliases defined underpaths:in.gram/config.yaml. - Added
--stockCLI flag to treat pre-made base imports as stock items (zero timeline overhead, single shopping list line, retaining full nutritional totals). - Supports retro-planning timeline offsets directly on
@useimport lines (e.g.@use "./bases/levain-starter.gram" as &starter ~{-2d}). - Spliced sections in HTML, Markdown, and print outputs display origin badges crediting their source module.
gram diffandgram watchnow track import additions, removals, rebinding, rescaling, and dependency file changes.- Language Server and VS Code extension support live dependency composition, Go to Definition into base files, path auto-completion, and quick-fix diagnostics for missing exports.
- Exported
createMemoryHostfrom@gram-lang/modulesfor browser and in-memory module graph resolution. - Corrected whole-recipe mass and nutrition totals to accurately include spliced intermediate (
-> &) masses. - Normalized rescaled ingredient quantities to one decimal place for display consistency across all outputs.
- Import external base recipes directly into a recipe using
- CLI: Added automatic update checking and a new
gram upgradecommand:- gram now checks npm in the background and prints a short "update available" notice after a command finishes (skipped in CI and non-interactive runs).
- Added
gram upgradeto check for and install the latest version on demand — it always performs a fresh check and asks for confirmation before running the install. - Added an
updateCheck: falsesetting inconfig.yaml(or theGRAM_NO_UPDATE_CHECKenvironment variable for a single run) to opt out of the passive notice.
- Parser & Kitchen: Composite ingredients written with a short, generic child name (like
@juice<@lemon) are now protected against a silent ingredient-database mix-up:- The compiler now warns when the same short composite name (e.g. "juice") is drawn from two different parents within one recipe (lemon in one step, orange in another) — until now this went unnoticed and the two usages silently shared one entry in the ingredient database.
gram db syncreports the same conflict across your whole recipe collection, so two unrelated recipes that happen to use the same generic composite name don't overwrite each other's nutrition and density data.- The AI recipe importer (
gram import) now writes composite ingredients with their full name (e.g. "lemon juice") instead of a short generic one, so newly imported recipes don't create this conflict in the first place.
Bug fixes and improvements
- Parser & Kitchen: Fixed
gram scale(and any other caller that re-scales an already-compiled recipe) silently leaving alternative ingredient groups (@butter|@margarine) and composite parent-draw quantities (@egg-yolks{2}<@eggs{3}) unscaled. - Parser & Kitchen: Improved clarity and tone for diagnostic messages and revised severity tiers:
- Reworded compiler and module diagnostic messages to provide actionable guidance and avoid alarmist phrasing for standard culinary approximations.
- Reclassified non-critical notices (
MISSING_MACROS,UNKNOWN_MASS,TRACK_CONTENTION) toinfoseverity so they do not clutter warning counters. - Enhanced Playground and editor diagnostic styling with dedicated color schemes for errors (red), warnings (amber), and notices (blue).
- Language Server: Normalized error states and unified diagnostic handling across Playground and VSCode extensions:
- Unified Playground diagnostics into a centralized full-width debug console with filter pills and interactive jump-to-location navigation.
- Added mobile segmented tab navigation (
[Editor]/[Preview]) and responsive single-row toolbar layout for mobile viewports. - Resolved nutrition diagnostics disconnection in the analyzer by merging physical and nutritional warnings into primary compiler warnings — the editor only turns these into squiggles when they carry a real position, so an incomplete-nutrition notice no longer misplaces itself at the top of the file.
- Markdown and print HTML exports keep their explicit "incomplete data" note next to the affected nutrition figures; the interactive HTML preview conveys the same gap through its coverage badge instead.
- A scale-target that fails to resolve (e.g. an unconvertible unit) now correctly turns the Playground's status badge and error panel red instead of being undersold as a warning, without marking the file tab as if the recipe itself had a syntax error.
- The Playground diagnostics console no longer gets stuck filtered on a category that just emptied out (e.g. after fixing the warning it was showing).
- Resolved silent compilation failures in the Language Server by capturing pipeline exceptions and pushing actionable error notifications to webviews — including when the thrown error carries no message, which previously slipped past the check silently.
- A compile-time failure (parses fine, but
compile()/analyze()throws) now also surfaces as an editor diagnostic, not only as a webview notification, so it's still visible with the preview panel closed. - Added bidirectional webview messaging in the VSCode extension to jump directly to error offsets in the active editor.
- Localized the Playground diagnostics console's collapse/expand tooltip, previously hardcoded in French regardless of site locale.
- Parser & Kitchen: Fixed a false circular reference warning when multiple sections used percentage-of formulas on same-named ingredients by scoping cycle detection per section.
1.1.0 - 2026-08-16
New features
- CLI / Import: Support importing recipes directly from YouTube videos and Shorts via
gram import:- Uses Gemini multimodal video understanding to analyze cooking videos and generate structured
.gramrecipes. - Automatically populates
title:,author:(channel name), andsource:metadata from YouTube. - Automatically normalizes YouTube Shorts URLs to standard video formats.
- Added
--max-duration(default 20 minutes) to prevent accidental token overconsumption on long videos. - Displays upfront video duration and estimated token cost when
YOUTUBE_API_KEYis configured.
- Uses Gemini multimodal video understanding to analyze cooking videos and generate structured
- CLI / AI: Explicit AI model and provider selection for all AI commands (
gram import,gram db lint,gram db enrich):- Added
--model,--provider, and--pick-modelCLI flags to inspect or override the active model per run without altering persistent config. - The CLI now displays the active AI provider, model, and configuration source before execution.
- Isolated provider API keys so credentials configured for a specific provider are never leaked or reused when switching providers.
- Fixed
gram importhanging in non-interactive environments when--outputwas used without--yes.
- Added
- CLI / Database: Added physical coherence and sanity checks across
gram db validateandgram db enrich:gram db validatechecks calorie consistency against Atwater estimates (4 kcal/g protein/carbs, 9 kcal/g fat, 7 kcal/g alcohol).gram db validatechecks sub-macro coherence (sugars exceeding total carbs, fat sub-types exceeding total fat).gram db validateenforces category-based density sanity ranges and unit weight bounds.gram db enrichconstrains AI estimates within physical limits and prompts self-verification of Atwater consistency.gram db enrichpasses known ingredient categories to the AI to reduce guesswork.
- CLI / Database:
gram db enrichnow walks you through an interactive review before writing AI estimates toingredients.yaml:- Preview, accept, edit, or skip AI-proposed density, unit weight, and nutrition values per ingredient.
- Unedited AI values are tagged with
# [LLM]iningredients.yamlto track provenance. - Added
--report(-r) to preview needed database enrichments without writing changes, matchinggram db lint --report(replaces--dry-run/-n). - Added
--yes(-y) to accept all estimates automatically for non-interactive scripting. - Automatically falls back to accepting values with a warning when executed in non-interactive (non-TTY) environments.
- CLI / Import: Added integrity guardrails and diagnostic reporting to
gram import:- Validates compiled AST tokens against AI output to detect lost ingredients or truncated steps, aborting instead of writing corrupted files (overridable with
--force). - Reports uncorrected AI generation errors with actionable diagnostics.
- Identifies imported ingredients missing quantities and lists their line numbers for easy manual completion.
- Reports unknown database ingredients and unweighed units when an ingredient database is present.
- Prevented hallucinated placeholder metadata in
author:andsource:fields. - Redirected progress indicators to
stderrso stdout redirection (gram import ... > recipe.gram) produces clean recipe files.
- Validates compiled AST tokens against AI output to detect lost ingredients or truncated steps, aborting instead of writing corrupted files (overridable with
- Nutrition & Rendering: Support flexible nutrition serving bases (per portion and per 100 g) alongside whole-recipe totals:
- Declaring
portions:in recipe frontmatter now calculates per-portion nutrition and keeps values constant when scaling recipes. - Added a standardized
per-100gnutrition basis calculated from raw assembled recipe mass. - Added the
--nutrition <auto|total|per-portion|per-100g>option togram view,gram export, andgram print. - Added nutrition basis toggles in the web playground and VS Code live preview.
- Localized all nutrient names and table headers across supported languages (French and English).
- Declaring
Bug fixes and improvements
- Parser & Kitchen: Fixed an issue where multi-word composite ingredients marked with
&(e.g.@juice{1}<@&unwaxed lemon{}) were duplicated in the shopping list instead of being combined into a single purchase item. - Analyzer & Language Server: Improved nutrient calculation completeness and editor hover precision:
- Saturated, monounsaturated, polyunsaturated fats, and alcohol are now included in recipe nutrition totals instead of being omitted.
gram db enrichcan now propose monounsaturated and polyunsaturated fat values during ingredient enrichment.- Fixed the editor hover tooltip incorrectly displaying sodium in grams instead of milligrams.
- Analyzer: Fixed recipe total mass and section weights to include ingredients defined as relative percentages of another ingredient (e.g.
@water{60% @&flour}).
1.0.1 - 2026-08-07
Bug fixes and improvements
- Fixed the
--helpdescription ofgram checkto clarify that it also checks database completeness by default, unless--skip-dbis used. - Reduced the AI provider costs of running
gram import:- Prompt caching is now enabled, so retries reuse the cached prompt instead of paying full price.
- The command now sends a minimized recipe payload instead of the full raw webpage data.
- The self-correction loop no longer spends retries on informational warnings (like missing database ingredients).
- Formatting is now handled locally instead of spending an AI call to fix it.
- Improved the quality and correctness of recipes generated by
gram import:- Fixed an issue where English words would leak into non-English recipes.
- Fixed grammatical errors (dropped articles) around ingredient and cookware references in non-English output.
- Descriptive adjectives (like "boneless skinless") are now correctly extracted as preparation steps instead of creating unwieldy ingredient names.
- Corrected the generated syntax for multi-word cookware references.
- Fixed an issue where the target language was sometimes incorrectly inferred.
- Improved decoding of accented characters and punctuation from the source recipe.
- Improved the CLI guidance printed after running
gram import:- It now correctly points to
gram db syncas the recommended next step. - It accurately reports any remaining compiler warnings (e.g., missing ingredients) instead of silently discarding them.
- It now correctly points to
- Fixed
gram initto ensure the interactive AI provider setup accurately offers the currently recommended models (e.g., llama4).
1.0.0 - 2026-08-06
Breaking changes
- Gram v1.0.0 Official Launch! 🎉 This milestone release marks the official 1.0.0 launch of Gram:
- Brand-New Website & Documentation: Rebuilt using Astro and Starlight with refined guides and an integrated blog.
- Refreshed Visual Identity: Brand-new logo.
- Infrastructure & Stability: Monorepo stability, test coverage, and migration to new Forgejo (
git.gram-lang.org) mirrored to GitHub and Codeberg.
[1.0.0-beta.5] - 7/26/2026
New features
- Introduce
@gram-lang/format, a standalone canonical code formatting engine for.gramfiles with 13 deterministic rules, used by the CLI and Language Server. convertUnit,standardizeMass, andanalyze()now accept an optionallangparameter/option, so unit names are resolved against the recipe's own language when there's an ambiguity between languages, instead of always falling back to a single global guess.UNIT_CONVERSIONS(the mass/volume conversion table) has moved to@gram-lang/i18n— if you imported it from@gram-lang/analyzer, import it from@gram-lang/i18ninstead.- The
language:setting in.gram/config.yamlnow also affects unit conversion and the shopping list's category order (e.g. a database with French category names like "Légumes" now sorts correctly whenlanguage: "fr"is set) — previously it only affected AI-generated content. - Fixed two bugs in the recipe formatter:
- A
#cookwarereference at the very start of a line (e.g.#pan(20cm)) was incorrectly treated as a malformed section header and got a space inserted after the#, turning it into plain text and silently breaking the recipe. - Blank-line spacing before a
## Sectionheader was being promoted to two blank lines instead of Gram's actual convention of exactly one blank line between every step and/or section. The formatter now consistently enforces a single blank line everywhere, including before section headers. As a result, thesectionSpacingcounter (previously reported alongsideconsecutiveBlankLines) has been removed — this kind of spacing fix is now reported as part ofconsecutiveBlankLines.
- A
@gram-lang/i18nnow also owns the numeric conversion factors for units (grams, milliliters, etc.) and time (minutes, hours, etc.), exported asUNIT_CONVERSIONSandTIME_TO_MINUTES— previously split across@gram-lang/analyzerand hardcoded inside@gram-lang/kitchen. No behavior changes; this just puts everything about units and time in one place.- Food categories now have stable, language-independent keys (
CATEGORY_KEYS,CategoryKey,getCategoryLabels,isCategoryKey) instead of only translated display labels. This meansgram db enrichnow stores a category identity that stays consistent regardless of your configured language, rather than a French or English label baked in at write time. - The Markdown, HTML, and printable/PDF outputs now show the same information consistently:
- Markdown recipes now include a nutrition summary (calories, carbs, protein, fat, etc.), which was previously only shown in HTML and print.
- Recipe comments now appear as numbered footnotes in Markdown and print output too, instead of only in HTML.
- When a shopping-list ingredient's purchasing weight differs from what actually goes in the bowl (e.g. "1 avocado" vs. its usable flesh), Markdown and print now show the extra "gross weight" note, matching HTML.
- When the same ingredient appears in incompatible units that can't be combined (e.g. "100g" and "1 cup" with no density available), Markdown and print now group them together with a "mixed units" warning, matching HTML.
gram formatand the editor's "format on save" now share the exact same formatting rules, so a recipe formatted by one always looks identical when opened in the other. This adds a few new automatic cleanups to both: normalizing spacing around composite ingredients (@a{} < @b{}→@a{}<@b{}), tidying up intermediate-result declarations (->&name {}→->&name{}), making sure section headers have exactly one space after the#s, and converting tabs to spaces.- Add an interactive Gantt Chart view to the VS Code extension and export reusable Gantt chart rendering helpers (
toGanttHTML,attachGanttInteractivity) from@gram-lang/renderer. Provides a real-time timeline visualization of recipe steps, background timers, and target serving times directly in your editor and the web playground.
Bug fixes and improvements
- Fixed a bug where the wrong API key could be sent to the wrong AI provider. If you had, say,
GEMINI_API_KEYset in your environment but configuredprovider: openaiin.gram/config.yaml, your Gemini key could be sent to OpenAI instead. Each provider now only ever uses its own key. - Baker's Percentage is now shown on an ingredient's inline mention within step text, not just in the recipe's ingredient list and shopping list — a dead type check meant this data was computed but never actually reached the inline token.
- The ingredient database schema no longer requires
densityon every entry that has aphysicalblock — an ingredient described only byunit_weight(e.g. "1 avocado") is valid, matching the analyzer's own documented example. Previously,gram db enrichcould write entries thatgram build/gram db validatewould then reject. gram diff(anddiffRecipes) now detects quantity changes inside composite ingredients (<@parent) and alternative groups (@a|@b), which it previously ignored entirely — a recipe that doubled a composite or alternative's quantities used to be reported as having no changes at all. It also no longer loses one of two same-titled sections, or two same-named timers/temperatures within a single section, when comparing two recipes.- Fixed the same ingredient sometimes getting two different
normalizedMassvalues in one analyzed recipe (e.g.250.78328000000002in a recipe section vs.250.78in the shopping list) — the section-level and composite-child mass calculations now go through the same rounding as the shopping list, instead of duplicating the sequence without it. - Removed all uses of
anyfrom the physical/nutrition analysis layer's internal types, typing them against the real shapes already exported by@gram-lang/kitchenand this package's ownAnalyzedUsage/NutritionItem. No behavior change for this package beyond the fixes already released separately (see the relative-quantity type changeset). The renderer's printable/PDF view gained one internalanyto stay compatible with the analyzer's now-stricter shopping-list type — purely a type-level adjustment, no output change. - A relative-quantity ingredient's resolved quantity (e.g.
@water{50% @&flour}) is now tagged with the correct"single"type instead of a value that didn't match any of the documented quantity shapes — it happened to still render correctly today only because of an unrelated fallback, so this is a safety fix rather than a visible change. - Fixed a major parsing bug where a bare
@ingredientor#cookwaremention (one written without its own{}) would silently swallow an unrelated timer, temperature, cookware, or ingredient that appeared later on the same line into its own name, if that later element happened to close with a valid quantity — losing that element from the recipe entirely. For example,Brown the @&chicken for ~{3min}.used to lose the timer completely, turning it into a single ingredient named "chicken for ~". Both the ingredient and cookware name now stop at the same sigils (@,#,~,^,&) that a bare reference (&name) already correctly stopped at. - Warnings about invalid ingredient database entries now go to stderr instead of stdout, so commands like
gram build recipe.gram | jqno longer break when the database has a bad entry. gram shopnow groups the shopping list by the same category names used everywhere else in the project (e.g. "Seafood" instead of "Fish", "Vegetables" instead of "Produce") instead of its own inconsistent list.- Fixed
gram formatrewriting values inside the recipe's frontmatter (the---metadata block at the top of a.gramfile). For example, an email address likeJean@Example.cominauthor:used to get incorrectly lowercased toJean@example.com. Frontmatter is no longer touched by formatting rules meant for the recipe body. File writes are also now atomic and lock-protected, matching the rest of the CLI. - Fixed several French unit words silently resolving to the wrong physical quantity:
quart/quartsno longer resolves to the US liquid quart (946 mL) in French recipes — it's a false friend ("un quart d'heure" means "a quarter of an hour", not a unit of volume). It's now reported as an unknown unit instead of silently misinterpreted. The English wordquart/quartsstill works in English recipes; only the spelled-out alias was removed,qtstill works everywhere.livrenow converts using the French "livre métrique" (500 g) instead of being silently treated as the imperial pound (453.592 g) — a ~10% error.tassenow converts using the French cup (250 mL) instead of being silently treated as the US cup (236.588 mL) — a ~6% error.pinteno longer resolves at all: the historical French pinte has no single reliable modern value, so an explicit "unknown unit" is better than a confident-looking wrong number.gallon/gallonsnow resolve correctly (previously only the abbreviationgalworked).
- The compiler now detects indirect circular dependencies between section intermediates (e.g. section A's result depends on section B's, whose result depends back on section A's) and reports a
CIRCULAR_REFERENCEwarning for each one — previously only a direct self-reference was caught. - Removed all uses of
anyfrom the compiler's internal types, replacing them with the real shapes already exported by the package (Usage,CompositeItem,StepToken, etc.), and cleaned up dead code paths in shopping-list aggregation. - Scaling a recipe by an extreme factor now fails with a clear error instead of silently producing
Infinity(serialized asnullin the output JSON). Scaled quantities are also rounded consistently, including a composite ingredient's total, so results no longer show float noise like110.00000000000001. - Scaling a fraction quantity (e.g.
1/2 cup) no longer produces a malformed value in the compiled JSON ({"type": "fraction", "value": 1}with no numerator/denominator) — it's now correctly represented as a plain numeric quantity. - Fixed several compiler correctness bugs:
- An empty section (or one containing only a comment) between two sections with steps used to break ALAP scheduling: the step right after the gap could get scheduled to overlap a timer still running from before the gap. It now correctly chains past the gap.
applyScale()(used bygram scaleand the playground) now scales cookware quantities. Previously it only scaled cookware "by accident" when called from insidecompile({ scaleFactor }), soapplyScale(compile(recipe), factor)silently left cookware unscaled.- A timer with an unrecognized time unit (e.g.
~{3 bananas}) or a missing unit no longer silently contributes a fabricated duration to the recipe's total/active time. Both now raise a warning instead, matching how temperatures and retro-planning already behave. - Timer units are now displayed consistently (e.g. always "min", never a mix of "min"/"mins"/"minutes" for the same physical duration in the same recipe).
- Fixed a spurious
TRACK_CONTENTIONwarning on the ordinary, intended use of named passive tracks (~_name{...}) — chaining several steps on the same physical resource (an oven, a fridge shelf) back-to-back no longer warns just because nothing else linked those steps together. The scheduler now understands that shared-track ordering the same way it already understands&intermediatedependencies, so the warning only fires when a real, unforeseen conflict remains. - Fixed several ways the language server could crash the whole editor session instead of just failing gracefully: a malformed entry in
ingredients.yaml(e.g. missingname) no longer crashes the server, opening a project in a virtual or remote workspace no longer crashes initialization, and a failed background database reload can no longer take down the process. Formatting, rename, and code actions also now always operate on the current document content instead of a possibly-stale cached version. ASTNodeis now a fully exhaustive, discriminated union that matches what the parser actually produces (CompositeAST,QuantityAST,TextQuantityAST, andRelativeQuantityASTwere previously missing from it), and composite ingredients (<@parent) now carry source location info like every other node. Making these types honest surfaced and fixed three real bugs in the language server: outline (document symbols), syntax highlighting (semantic tokens), and go-to-definition/rename/hover (reference and intermediate lookups) could silently miss or crash on content that isn't wrapped in a## Sectionheader — a recipe with no headers at all, or with a comment before the first header.- Fixed two silent quantity-corruption bugs in fraction parsing: a decimal numerator (e.g.
1.5/2) used to be truncated to an integer before dividing, silently turning1.5/2into0.5instead of0.75; a zero denominator (e.g.1/0) used to produceInfinity, which serializes tonullin JSON, instead of being rejected outright. - The
hideStepQtyrendering option (hides ingredient quantities from step text) now works withtoHTMLandtoMarkdown, not justtoPrintHTML— it was previously silently ignored by the other two. - Fixed an HTML injection vulnerability (XSS) in
toHTML's timing-card tooltips: a section title or named timer containing HTML would render unescaped in the "Active Time" / "Total Time" tooltips, exploitable via the playground or the VS Code preview. Both are now properly escaped like every other text field. toHTML,toMarkdown, andtoPrintHTMLnow type theirdataparameter instead of acceptingany. Typing it surfaced two real bugs, now fixed: the HTML nutrition panel's "incomplete data" warning was never actually shown (it read a field that never existed, always showing a blank 0-calorie panel instead), and the printable/PDF view displayed sodium in grams instead of milligrams (1000x too high).- Fixed syntax highlighting (TextMate grammar): a bare
@ingredient,#cookware, or<@parentmention with no{}of its own would have its highlighted span incorrectly extend all the way to the next unrelated{...}on the line (e.g. a later&reference{}), coloring everything in between as if it were part of the same name. The name-matching patterns now stop at@,#,~,^, and&, the same sigils the compiler itself stops at. toMarkdownnow neutralizes raw HTML (<and&) in recipe titles, ingredient names, and step text. Previously, a recipe containing something like<img onerror=...>in its title would pass through untouched, which could run as a script if that Markdown was later converted to HTML — this is now escaped automatically, closing that gap for imported or shared recipes.gram import <url>now refuses to fetch addresses that aren't publicly routable (localhost, private networks, link-local/cloud metadata addresses), including on redirects — closing a way for a malicious or compromised page to make the CLI fetch internal network resources. API keys stored viagram init/gram config setare now actually picked up when running the CLI under Node (previously only worked when run via Bun).gram db enrichnow clearly reports when nothing was written to disk instead of claiming success; AI-suggested ingredient values that are physically implausible (like an ingredient density far outside any real food) are now rejected instead of being written to your ingredient database.QuantityValueAST(the parser's internal representation of a parsed number/fraction/range) is now a proper discriminated union instead of a flat interface with every field optional. This is an internal type-safety improvement with no behavior change — it's what would have caught, at compile time, a real bug fixed earlier indiffRecipes(checkingqty.from/qty.to, fields that never existed on any variant).
[1.0.0-beta.4] - 7/23/2026
Breaking changes
- Section retro-planning (e.g.
## Section ~{-2h}) now enforces a strict signed-duration syntax instead of accepting arbitrary free text, preventing invalid timeline calculations. Added support for thed(day) time unit.
New features
- Added support for ALAP (As Late As Possible) scheduling. Passive timers and their dependencies are now natively pushed backwards from the end of the recipe, ensuring ingredients are prepared just-in-time rather than sitting idle on the counter. Also introduces two new compiler warnings for timeline conflicts:
TIME_PARADOXandTRACK_CONTENTION. - Exported the
runPipelinefunction alongside its associated types from@gram-lang/clito facilitate library and programmatic usage of the core compiler orchestration. - Renamed the
cookTimemetric toidleTimeacross the ecosystem to better reflect hands-off wait time. Additionally, passive timers sharing the same name are now automatically sequenced one after another on the same background track. - Added
llms.txtandllms-full.txtto the documentation site, providing a curated index and full concatenated specification tailored for AI assistants and agents.
Bug fixes and improvements
- Fixed the display of alternative ingredient and cookware groups (
@egg|@tofu). They now correctly render inline as a single joined line in shopping and section lists, rather than being dropped or rendered as oddly-wrapped sub-lists. - Fixed mass standardization silently failing for alternative ingredient groups. Mass and estimate metrics are now properly computed for each option independently, fixing missing totals in the shopping list.
- Added support for bare single-word children in composite ingredients (e.g.,
@juice<@lemon), and allowed independent preparation instructions on the parent side. Fixed section ingredient lists silently dropping the parent reference. - Fixed bare ingredient names incorrectly absorbing trailing punctuation (like periods). Also fixed multi-word unbraced names breaking alternative group parsing. (An orphan
|in step text is now correctly flagged as a parse error). - Fixed a bug where scaled fractions (e.g., when doubling a recipe) would incorrectly display their original, unscaled text values in section ingredient lists instead of the correctly multiplied amount.
- Fixed an issue where scaled fractions resulting in values below 1 (e.g.,
0.5) were rendered as raw decimals instead of common fractions (e.g.,1/2) in the section ingredient list. - Updated the AI generation prompt to accurately reflect the latest language syntax, strict retro-planning rules, and active/passive timer terminology.
- Fixed shopping list ingredient names defaulting to the database's canonical wording when the recipe used a valid alias. The lists now correctly preserve the recipe's original wording or translated alias, ensuring consistent language throughout.
- Fixed a parser crash that occurred when a section header named the section (
->&name) before defining its retro-planning (~{-2h}). - Fixed section and mise-en-place ingredient lists displaying raw database slug IDs (e.g.,
oeufs) instead of their correct, localized display names (e.g.,œufs). - Added detailed per-contribution time breakdowns (Active, Prep, Total) to compiled recipe metrics, and surfaced them as explanatory tooltips on the time summary badges in the HTML renderer.
[1.0.0-beta.3] - 7/14/2026
Bug fixes and improvements
gram checknow resolves syntax error line numbers from the parser's structuredGramParseError.offsetinstead of regexing "line N" out of ohm's prose message — line numbers are now always correct, not just when they happened to match that pattern.- Downgrade minimum VS Code version requirement to 1.75.0
- Updated deployment configuration to automate npmjs packages publication
- Updated docs for clarity and accuracy.
[1.0.0-beta.2] - 7/13/2026
Breaking changes
- fix!: load valid ingredients even when the database has a bad entry, and fix five correctness bugs
- fix!:
gram checkonly fails on structural errors by default (use--strictfor the old behavior), fix LSP completion race, and add ingredients.yaml live reload - feat!: validate and normalize temperature units, add a shared warning severity map, and fix accented/non-Latin ingredient slugs
- feat!: replace the
°temperature sigil with^, the~&passive timer marker with~_, and add mixed/Unicode fraction support
New features
- Added a bilingual (EN/FR) "API Reference" section covering the programmatic API of
@gram-lang/parser,@gram-lang/kitchen,@gram-lang/analyzer,@gram-lang/renderer, and@gram-lang/i18n— function signatures, options, JSON data formats, and the full warning-code catalogue. Reference tables (warning codes, AST node types, unit conversions, categories) are generated at build time directly from each package's source, so they can't drift out of sync with the code. Also fixed an incorrectanalyze()call example inhow-to/build-custom-ui.md. - Export
fetchRecipeandvalidateGramfrom the recipe-import service, enabling direct testing and reuse of the import validation pipeline. - Add
round2(value: number): number, exported from@gram-lang/kitchen. It centralizes the 2-decimal rounding rule (parseFloat(x.toFixed(2))) previously duplicated across kitchen, analyzer, and renderer, giving quantity/mass rounding a single documented implementation. No observable output changes — same rounding rule as before, just in one place. getASTnow throwsGramParseErrorinstead of a plainErroron syntax errors. This new error type includes structured fields (offsetandexpected) while preserving the original human-readable message. The language server now uses theoffsetfield to report parse-error diagnostics at their exact location in the document, rather than defaulting to line 1 column 1.- The playground now shows a red squiggly marker at the exact location of a syntax error using the new
offsetfield. Fixed a crash in the playground on mount in real browsers caused by an aggressive automated lint fix that removed necessary Vue<template>bindings and component imports. toHTMLno longer stamps footnote anchor ids withMath.random(). Output is now deterministic by default (ids likenote-1), which is required for byte-stable golden/conformance testing. If you render multiple recipes on the same page and relied on random ids to avoid anchor collisions, pass a newrenderIdoption (e.g. a recipe slug) to disambiguate.- Upgraded all monorepo dependencies to their latest versions and implemented a TypeScript 7 dual setup for faster typechecking while preserving compilation toolchain compatibility. Fixed type errors arising from Node 26 and VS Code LSP v10 updates.
Bug fixes and improvements
- Added a global
--verbose/--debugflag (works with any subcommand) that prints the full stack trace alongside the usual terse error message — useful when filing a bug report or diagnosing an unexpected failure. - Fix
_usageIdleaking a global counter across separatecompile()calls in the same process (affected the language server andgram scale's parallel compiles, making ids non-deterministic for an unchanged recipe). Fix nutrition analysis always reportingisEstimate: trueregardless of actual data precision. Fix the section mass badge in HTML output missing its scale icon. - Fixed a regression introduced alongside the new
--verboseflag wheregram -vstopped printing the version and showed the help text instead (-vis citty's own--versionshorthand — it's no longer swallowed as part of the verbose flag). Also fixedgram import's fetch timeout message not showing up when the timeout fires while reading a slow response body instead of during the initial connection. .envis now written with0600permissions instead of the OS default, so API keys are no longer group/world-readable on shared machines..gram/config.yamlis now validated at load time (invalid fields fail with a clear error instead of crashing deep in the pipeline).gram importnow times out after 15s, caps response bodies at 10MB, and asks for confirmation before writing AI-converted content from an untrusted external source to disk (skippable with--yes).- Performance improvements for CLI tools: -
gram formatnow processes files concurrently, significantly speeding up execution on large recipe collections. -gram db syncnow uses a length-based pre-check for fuzzy matching to speed up similarity comparisons against large databases. - Fixed a bug in
applyScale()where scaled quantities were incorrectly squared instead of multiplied for inline step ingredients, resulting in incorrect values (e.g., displaying800ginstead of400gwhen using--scale 2). The aggregated shopping list was unaffected. - chore: declare
sideEffects: falseso bundlers can tree-shake unused exports from these packages No package previously declared this, so third-party bundlers had to assume every module might have side effects and couldn't safely drop unused code. - fix: sync TextMate grammar with the
^/~_sigil changes and stop mis-highlighting invalid temperature units - Updated TextMate grammar to use^(Temperature) and~_(Passive Timer) sigils. - Temperature unit highlighting now mirrors the compiler's whitelist (e.g.,180C/180°F). Invalid units now receive a distinctinvalid.illegal.unit.gramscope. - Name matching now correctly stops at the new^sigil. - Compiler warnings (
CompilationResult.warnings,NutritionMetrics.warnings) are now always structuredWarningobjects ({ code, message, item?, loc?, section? }) instead of sometimes being plain strings depending on call order — a latent inconsistency that could previously produce"[object Object]"in some rendered output.Usage.composite,Usage.options, andProcessedStep.contentare now properly typed instead ofany. Also fixes range-based timer quantities (e.g.~{5-10min}) never displaying correctly ingram diffoutput, due to a pre-existing typo checking non-existent fields.
Breaking
validateIngredientDatabaseno longer throws an error on a single malformed entry. It now validates entry-by-entry, returning both valid data and rejected keys. This preventsgram checkorgram cookfrom hard-failing due to one unrelated bad line.physical.yieldmust now be> 0(previously>= 0) to prevent producingInfinitymass downstream.gram checknow only fails on structural issues (like undefined references) and uses a sharedwarningSeveritymap. Nutritional gaps and incomplete annotations are reported as warnings instead of failing the build. Use--strictfor the old all-warnings-fail behavior.GramConfigErrorexit code changed from 2 to 1 (user error, not internal crash).- The Temperature sigil is now
^(e.g.^{180C}).°is no longer a block-opening character, but remains valid inside unit spellings (°C). - The Timer passive marker is now
~_(e.g.~_{45min}) instead of~&. - Temperature units now accept bare
C/Fin addition to°C/°F.
Fixed
- Added a guard in
applyYieldagainst non-positive yield factors. - Shopping list aggregation: The
optionalmodifier is now treated as an intersection rather than a union. diffRecipes: Temperature ranges that change bounds but keep the same average are now correctly detected in the diff. Fixed an issue where identical section titles would drop timer/temperature tokens.calculateMassMetrics: Excludesoptionalingredients fromtotalMassto match nutritional calculations.calculateNutrition: Missing nutrient data now propagates asundefinedrather than an indistinguishable0.- Language Server: Fixed a race condition where completions immediately after
@or&could return nothing. - Language Server: Diagnostics now correctly use the shared
warningSeveritymap. - Language Server:
ingredients.yamlis now actively watched via LSP. External edits instantly refresh diagnostics without restarting the editor.
New syntax
- Added support for mixed-number fractions (
1 1/2) and Unicode vulgar fraction glyphs (½).
Kitchen
warningSeverity: a new exported map to separate structural errors from recoverable warnings.- Temperature units are now validated and normalized to canonical
°C/°F. slugifynow preserves non-Latin letters via\p{L}/\p{N}.
Analyzer
- Fixed
parseDensityOverridesname normalization for accented ingredient names.
[1.0.0-beta.1] - 7/5/2026
Breaking changes
- refactor: rename
isAsynctoisPassiveto align with domain terminology
To better align the codebase with the actual domain model of a kitchen, the "asynchronous" timer concept has been completely renamed to "passive". This introduces the following breaking changes for tool builders:
- AST: The
TimerASTnode propertyisAsync: booleanis nowisPassive: boolean. - CSS: The
.timer.asyncclass generated by the renderer has been renamed to.timer.passive. - Kitchen Metrics: All internal variables and comments referring to
asyncbackground tasks have been updated topassive. - Breaking Change: Refactored Physical Engine Nomenclature
The physical enrichment options and internal APIs have been renamed for clarity and to align with professional culinary terminology.
If you are using @gram-lang/analyzer programmatically, please update your configuration:
enableMassNormalizationis nowenableMassStandardizationenableYieldManagementis nowenableYieldCalculation- The exported
normalizeMasshelper is nowstandardizeMass
This update ensures total parity with the updated official documentation.
- Introduction of the official Gram CLI (
@gram-lang/cli), a comprehensive command-line tool to manage, compile, and interact with your recipes.
Project & Recipe Management:
- Project Setup:
gram initsafely scaffolds a.gramenvironment, including interactive AI provider setup (Google, OpenAI, Anthropic, Ollama) and secret management. - Automated Import:
gram importscrapes recipes from any URL and uses AI to flawlessly translate and convert them into native.gramsyntax. - Validation & Compilation:
gram checkinstantly validates syntax and database integrity.gram buildcompiles recipes to robust JSON with full physical and nutritional enrichment. - Smart Scaling & Diff:
gram scaledynamically resizes recipes (e.g.,--scale flour=300g) with a visual before/after comparison.gram diffprovides a semantic "git diff" for cooking, tracking changes in quantities, timings, and steps. - Export & Print:
gram printgenerates a beautifully typeset A4 HTML recipe card.gram exportconverts recipes to clean Markdown or static HTML. - Auto-formatting & Watcher:
gram formatautomatically enforces.gramlanguage styling standards.gram watchprovides real-time validation upon saving.
Interactive Cooking & Daily Use:
- Terminal Cooking Assistant (
gram cook): A step-by-step interactive TUI (Terminal User Interface) that guides you through the recipe, featuring a dynamic ingredient checklist and live background timers. - Smart Shopping List (
gram shop): Aggregates ingredients across multiple recipes, automatically converting volumes to masses and sorting them by supermarket aisle. - Recipe Search (
gram suggest): An alias-aware search engine to find recipes based on your available ingredients (e.g.,--with "butter, eggs" --without "milk"). - Rich Terminal Preview (
gram view): Renders recipes directly in the terminal with color coding, active timers, and nutritional tables.
AI-Powered Database Management (gram db):
- Smart Database Sync & Enrichment:
gram db syncautomatically tracks new ingredients across your project.gram db enrichuses AI to automatically fill in missing densities, unit weights, categories, and nutrition facts. - Semantic Linting & Conflict Resolution:
gram db lintuses AI to detect plural mistakes and semantic duplicates (e.g.,scallionvsgreen onion).gram db mergehandles conflicts when integrating external community databases.
New features
- docs: update timer terminology from synchronous/asynchronous to active/passive
To better align with real-world culinary concepts and eliminate confusion, the terminology for timers has been updated throughout the documentation.
Previously, Gram used computer-science terms (synchronous / asynchronous) to describe how timers affected the recipe flow. However, in a kitchen environment, almost all timers block the preparation itself, even if they run in the background.
To clarify this, we have shifted the terminology to focus on the cook's availability rather than the execution thread:
- Synchronous timers are now referred to as Active timers. These timers require the cook's attention and add to the
activeTimemetric. - Asynchronous (
~&) timers are now referred to as Passive (or Idle) timers. These timers represent background tasks (like resting or baking) that free up the cook to perform other steps concurrently.
Note: This is a purely conceptual nomenclature change to make the documentation and learning curve more intuitive for non-developers. The underlying syntax (~{} and ~&{}) and the compiler's Gantt chart logic remain exactly the same.
-
Major overhaul of the documentation and playground infrastructure:
-
Documentation Rewrite & i18n: The documentation has been completely rewritten, thoroughly verified, and is now fully translated into French (in addition to the English version).
-
Advanced Vue 3 Playground: The legacy playground has been removed and rebuilt from the ground up using Vue 3. This new version is directly integrated into the documentation and introduces powerful new features, including recipe scaling and baker's math.
-
The
@gram-lang/compilerpackage has been renamed to@gram-lang/kitchento fully embrace the Gram language's domain identity. -
docs: integrate new Vitepress documentation site and embedded playground
-
Documentation: Complete overhaul of the Gram documentation site using Vitepress. Improved layout, better navigation, and comprehensive coverage of the new syntax and APIs.
-
Playground: Replaced the legacy standalone playground with a new, fully integrated version directly within the Vitepress documentation site. Features live-reloading, side-by-side editing, and syntax highlighting via Shiki.
-
Complete overhaul of the VS Code Extension with Language Server, Live Preview, and advanced assistance
Major New Features:
- Full Language Server (LSP): The extension now ships with a complete language server. All advanced features activate instantly upon opening a
.gramfile. - Dynamic Live Preview: A side-by-side WebView panel displaying the real-time HTML render of the recipe as you type.
- Gracefully handles syntax errors via a visual fallback.
- Integrates the official Playground styles for perfect consistency.
- CodeLens & Inlay Hints:
- Inlay Hints: Displays the cumulative total time in gray next to section titles.
- CodeLens: Clickable buttons
▶ Previewand📊 Macrosabove the main recipe title for quick access.
Ingredient Database & Nutrition:
- Automatic Loading: Automatically detects and loads
.gram/ingredients.yamlfrom the workspace root (or via the path configured ingram.ingredientDatabase.pathsettings). Optimized indexing (O(1)) for maximum performance. - Seamless Plural Management: The extension silently handles plurals (e.g.,
@carrots{3}will automatically matchcarrot). No error diagnostics are raised, everything is transparent. - Nutritional Hover & Macros Panel:
- Hovering over an ingredient displays a complete nutritional table (calories, proteins, carbs, fats, etc.).
- The Live Preview integrates a Macros panel (hidden by default) that can be shown via CodeLens, featuring clear visual alerts for ingredients missing data.
- Fuzzy Matching "Did you mean?": Levenshtein algorithm (distance ≤ 2) suggests corrections if an ingredient is misspelled (e.g.,
@tomaatosuggests@tomato). Directly integrated into Quick Fix code actions. - On-Hover Unit Conversion: Automatically converts volumes (ml, tbsp, etc.) to grams when hovering over an ingredient if its density is known in the database.
Editing Assistance & Navigation:
- Advanced Contextual Autocompletion:
- After
@: Suggests ingredients and their aliases from the YAML database. Automatically adds curly braces{}for multi-word names. - After
&: Suggests only the existing intermediate declarations in the document. - Inside
{}: Suggests canonical units (mass, volume, time) and their aliases (French/English) as soon as a digit is typed.
- After
- Smart Navigation:
- Go to Definition (
Ctrl+Click/F12) on a&refreference to jump to its->&refdeclaration. - Find All References (
Shift+F12) to list all usages of an intermediate. - Rename Symbol (
F2) to atomically rename an intermediate (declaration + references). - Outline Panel showing the hierarchy of sections and elements, with foldable code in the gutter.
- Go to Definition (
- Intermediate Hover: Displays the full text of the step where the intermediate was created.
Diagnostics & Code Actions (Quick Fixes):
- Real-Time Diagnostics:
- Red underline for an orphaned
&refreference. - Warning for an unused
->&refdeclaration. - Warning if the frontmatter (title) is missing.
- Red underline for an orphaned
- Code Actions (💡):
- Quick Fix: Insert the missing
title:in the frontmatter. - Quick Fix: Remove an unused intermediate declaration.
- Quick Fix: Declare a missing intermediate for an existing reference.
- Refactor: Convert a volume quantity to mass directly in the code.
- Refactor: Replace a misspelled ingredient with the closest Fuzzy match suggestion.
- Quick Fix: Insert the missing
Semantic Highlighting, Formatting & Snippets:
- Semantic Tokens: Regex-based syntax highlighting (TextMate) is replaced by AST-driven highlighting. Offers surgical precision for ingredients, timers, temperatures, comments, and nested units (e.g., precise separation of value and unit in
{10g}). - Auto-formatting (
Alt+Shift+F):- Normalization of spaces inside curly braces (
{ 200 g }→{200g}). - Normalization of composite ingredients (
@a < @b→@a<@b). - Alignment of section titles and tab-to-space conversions.
- Normalization of spaces inside curly braces (
- Built-in Snippets: Keyboard shortcuts for the basic structure (frontmatter, sections, steps), ingredient variants (
@ing,@?,@-), cookware (#cw), and timers/temperatures. - Core language update to enforce new syntax adjustments (breaking changes).
- Grammar & Parsing:
- Made
{}optional for single-word ingredients. - Replaced temperature symbol with
°. - Replaced async timers with
~&{}. - Replaced aliases brackets with
:. - Tightened
<@with no spaces allowed. - Added fixed modifier
=. - Mandatory
@&inside relative quantities declarations. (e.g:@water{60% @&flour}) - Top-Level Support: Allowed writing comments and recipe steps globally, anywhere in the document (even before the first
## Section).
- Made
- Compiler Analysis:
- Added
INVALID_MODIFIER_COMBINATIONwarnings. - Updated AST transformations to support the new modifiers parsing rules and the implicit top-level sections grouping.
- Added
- Aligned visual tooling and test recipes with the new grammar.
GramHighlight.ts(Playground & VSCode): Updated all syntax highlighting regular expressions to accurately match the new syntax (new temperature symbols, updated modifiers, etc.).- Examples (
basquaise_chicken.gram,lemon_meringue_pie.gram,torture.gram): Fully migrated recipe code to comply with the new grammar.
-
Fixed several correctness bugs found during a documentation audit, and added alias-aware cross-unit shopping list aggregation.
-
@gram-lang/analyzer:
unit_weight-based conversions (e.g.@avocado{1}) were being double-divided byyield— the whole-unit weight is now correctly treated as Gross Mass, with Net Mass derived forward (Gross × yield), while explicit mass/volume entries keep deriving Gross backward (Net ÷ yield) as before. Optional ingredients (?) are no longer counted in nutrition totals. NewresolveCanonicalId()resolves an ingredient name/alias to its database key, and a newaggregateShoppingList()step re-groups the shopping list by canonical id — merging aliased ingredients (e.g.beurre/butter) and cross-unit quantities (e.g.100g+1 cup) into a single gram total whenever every entry resolves to a mass, falling back to separate entries flaggedmultiUnit: truewhen a density is missing. -
@gram-lang/renderer: The HTML shopping list now clusters consecutive
multiUnit-flagged entries for the same ingredient under one heading with a "⚠️ Mixed units" badge, instead of listing them as unrelated lines. -
@gram-lang/cli:
shopper's alias resolution now reuses@gram-lang/analyzer'sresolveCanonicalId()instead of a separate, duplicated alias map. -
- Playground: Migrated syntax highlighting engine from Highlight.js to Shiki. The playground now natively uses the official VSCode TextMate grammar, ensuring 100% consistency across environments.
-
VSCode Extension: Improved syntax coloring by mapping custom Gram tokens (cookware, intermediate ingredients, units) to standard semantic TextMate scopes, restoring vibrant and legible colors across all VSCode themes.
-
Improve ingredient preparation tracking and display.
-
Kitchen:
aggregateSectionIngredientsnow groups ingredients by bothidandpreparation, creating separate entries for the same ingredient if it requires different preparations (e.g. cold vs melted). -
Renderer: A new
formatModeoption in the render context controls preparation rendering. Preparations remain visible in inline text to prevent information loss. In the section's ingredient list (Mise-en-place), they are cleanly displayed with an em-dash. In the global shopping list, they remain hidden. -
Refactor TextMate grammar to
@gram-lang/parser
The TextMate grammar (gram.tmLanguage.json) has been moved from @gram-lang/vscode-extension to @gram-lang/parser to colocate the structural (Ohm) and lexical (TextMate) definitions of the Gram language.
This resolves architectural issues where consumers like the playground had to perform brittle, deep relative imports into the VSCode extension package. The syntax grammar is now officially exported and accessible via @gram-lang/parser/textmate.
-
Added a centralized
ScaleEnginein@gram-lang/kitchento make recipe scaling (--scale) and Baker's Percentage math safer and more consistent everywhere. -
@gram-lang/kitchen: New
resolveScaleFactor()/applyScale()API validates a--scaletarget before computing a factor — rejecting fixed (@=) ingredients, relative quantities, ingredients only used inside a sub-recipe, ingredients inside an alternative-ingredient group, and ingredients split across incompatible units, with a clear error instead of a silently wrong number. A sub-recipe's own total (e.g. "2 lemons") is itself a valid scale target. Scaling is now a pure operation (never mutates the original recipe), and the compiled recipe now carries an explicitscaleFactorfield. Covered by a new unit test suite. -
@gram-lang/analyzer: Fixed the
@*Baker's-reference auto-detection (it silently never matched before), and it now refuses to use a relative-quantity ingredient as the 100% base instead of computing bogus percentages. The enriched JSON AST now natively includes abakersPercentagefield for all ingredients if a reference ingredient is declared or passed via thebakersReferenceoption.convertUnit()now accepts an optional density (g/mL) to bridge mass ↔ volume conversions; newresolveIngredientDensity()andparseDensityOverrides()helpers resolve that density from a recipe'sdensities:frontmatter. Also includes a critical null-safety fix when parsing recipes containing standalone comments. -
@gram-lang/renderer: Natively supports formatting Baker's Percentages provided by the analyzer (for HTML and Markdown exports, and the Playground), removing its legacy calculation logic. Fixed
gram print --bakers-math-onlyhaving no effect. -
@gram-lang/cli: The CLI now cleanly acts as a presentation layer for Baker's Math, reading percentages directly from the AST. Added
--bakers-math,--bakers-reference, and--bakers-math-onlyflags to theview,printandexportcommands.--scale id=valuenow supports same-family unit conversion and cross-family conversion when a density is available; suggests the closest matching ingredient name on a typo; no longer shows corrupted comparison rows for an ingredient split across multiple units ingram scale. -
Major architecture refactoring, ESM Migration, performance optimizations and code cleanup
-
Complete overhaul of the documentation to reflect the new syntax changes.
Bug fixes and improvements
-
Fix: Allow preparations on bare ingredients and cookware Previously, the parser and the TextMate syntax highlighter required quantity braces
{}to attach a preparation to an element (e.g.@butter{}(melted)or#pan{}(20cm)). The grammar has been updated to support attaching preparations directly to bare elements without braces. You can now write@butter(melted)or#pan(20cm)naturally. The AST will correctly extract thepreparationproperty, and your editor will highlight it properly. -
NutritionMetrics output field renamed from
salttosodiumto match the ingredient database schema -
Refined formatting and mass normalization for relative quantities:
-
Cleaner Display: Relative quantities are now seamlessly displayed without internal
@or&markers (e.g.,125% of lemon juice). The redundant formula brackets[125% of...]have been removed from inline instructions. -
Robust Shopping List Aggregation: The compiler (
@gram-lang/kitchen) now strictly tracks ingredient lineage using_usageIds. This allows the analyzer (@gram-lang/analyzer) to flawlessly compute exact masses for complex items in the shopping list without confusing standard ingredients and their alternatives. -
Shopping List Accuracy: When mass normalization is enabled, the shopping list will now accurately display the fully resolved physical mass for relative quantities (e.g.,
sugar (156 g)) instead of falling back to the formula string. -
Fixed an issue in the parser where composite ingredients without braces (e.g.,
<@lemon,) would incorrectly consume subsequent text on the same line, causing missing ingredients and breaking relative quantity resolutions. -
Fix total recipe time calculation when using background timers
Previously, the compiler did not wait for passive tasks (like resting dough in the fridge) to finish before letting you use the result. This caused the estimated "Total Time" to be unrealistically short. The engine now properly understands dependencies and waits for intermediate preparations to be fully ready before proceeding to steps that need them.
[1.0.0-beta.0] - 6/29/2026
Breaking changes
- Introduction of the official GRAM CLI (
@gram-lang/cli), a comprehensive command-line tool to manage, compile, and interact with your recipes.
Project & Recipe Management:
- Project Setup:
gram initsafely scaffolds a.gramenvironment, including interactive AI provider setup (Google, OpenAI, Anthropic, Ollama) and secret management. - Automated Import:
gram importscrapes recipes from any URL and uses AI to flawlessly translate and convert them into native.gramsyntax. - Validation & Compilation:
gram checkinstantly validates syntax and database integrity.gram buildcompiles recipes to robust JSON with full physical and nutritional enrichment. - Smart Scaling & Diff:
gram scaledynamically resizes recipes (e.g.,--scale flour=300g) with a visual before/after comparison.gram diffprovides a semantic "git diff" for cooking, tracking changes in quantities, timings, and steps. - Export & Print:
gram printgenerates a beautifully typeset A4 HTML recipe card.gram exportconverts recipes to clean Markdown or static HTML. - Auto-formatting & Watcher:
gram formatautomatically enforces.gramlanguage styling standards.gram watchprovides real-time validation upon saving.
Interactive Cooking & Daily Use:
- Terminal Cooking Assistant (
gram cook): A step-by-step interactive TUI (Terminal User Interface) that guides you through the recipe, featuring a dynamic ingredient checklist and live background timers. - Smart Shopping List (
gram shop): Aggregates ingredients across multiple recipes, automatically converting volumes to masses and sorting them by supermarket aisle. - Recipe Search (
gram suggest): An alias-aware search engine to find recipes based on your available ingredients (e.g.,--with "butter, eggs" --without "milk"). - Rich Terminal Preview (
gram view): Renders recipes directly in the terminal with color coding, active timers, and nutritional tables.
AI-Powered Database Management (gram db):
- Smart Database Sync & Enrichment:
gram db syncautomatically tracks new ingredients across your project.gram db enrichuses AI to automatically fill in missing densities, unit weights, categories, and nutrition facts. - Semantic Linting & Conflict Resolution:
gram db lintuses AI to detect plural mistakes and semantic duplicates (e.g.,scallionvsgreen onion).gram db mergehandles conflicts when integrating external community databases.
New features
- The
@gram-lang/compilerpackage has been renamed to@gram-lang/kitchento fully embrace the Gram language's domain identity. - Complete overhaul of the VS Code Extension with Language Server, Live Preview, and advanced assistance
Major New Features:
- Full Language Server (LSP): The extension now ships with a complete language server. All advanced features activate instantly upon opening a
.gramfile. - Dynamic Live Preview: A side-by-side WebView panel displaying the real-time HTML render of the recipe as you type.
- Gracefully handles syntax errors via a visual fallback.
- Integrates the official Playground styles for perfect consistency.
- CodeLens & Inlay Hints:
- Inlay Hints: Displays the cumulative total time in gray next to section titles.
- CodeLens: Clickable buttons
▶ Previewand📊 Macrosabove the main recipe title for quick access.
Ingredient Database & Nutrition:
- Automatic Loading: Automatically detects and loads
.gram/ingredients.yamlfrom the workspace root (or via the path configured ingram.ingredientDatabase.pathsettings). Optimized indexing (O(1)) for maximum performance. - Seamless Plural Management: The extension silently handles plurals (e.g.,
@carrots{3}will automatically matchcarrot). No error diagnostics are raised, everything is transparent. - Nutritional Hover & Macros Panel:
- Hovering over an ingredient displays a complete nutritional table (calories, proteins, carbs, fats, etc.).
- The Live Preview integrates a Macros panel (hidden by default) that can be shown via CodeLens, featuring clear visual alerts for ingredients missing data.
- Fuzzy Matching "Did you mean?": Levenshtein algorithm (distance ≤ 2) suggests corrections if an ingredient is misspelled (e.g.,
@tomaatosuggests@tomato). Directly integrated into Quick Fix code actions. - On-Hover Unit Conversion: Automatically converts volumes (ml, tbsp, etc.) to grams when hovering over an ingredient if its density is known in the database.
Editing Assistance & Navigation:
- Advanced Contextual Autocompletion:
- After
@: Suggests ingredients and their aliases from the YAML database. Automatically adds curly braces{}for multi-word names. - After
&: Suggests only the existing intermediate declarations in the document. - Inside
{}: Suggests canonical units (mass, volume, time) and their aliases (French/English) as soon as a digit is typed.
- After
- Smart Navigation:
- Go to Definition (
Ctrl+Click/F12) on a&refreference to jump to its->&refdeclaration. - Find All References (
Shift+F12) to list all usages of an intermediate. - Rename Symbol (
F2) to atomically rename an intermediate (declaration + references). - Outline Panel showing the hierarchy of sections and elements, with foldable code in the gutter.
- Go to Definition (
- Intermediate Hover: Displays the full text of the step where the intermediate was created.
Diagnostics & Code Actions (Quick Fixes):
- Real-Time Diagnostics:
- Red underline for an orphaned
&refreference. - Warning for an unused
->&refdeclaration. - Warning if the frontmatter (title) is missing.
- Red underline for an orphaned
- Code Actions (💡):
- Quick Fix: Insert the missing
title:in the frontmatter. - Quick Fix: Remove an unused intermediate declaration.
- Quick Fix: Declare a missing intermediate for an existing reference.
- Refactor: Convert a volume quantity to mass directly in the code.
- Refactor: Replace a misspelled ingredient with the closest Fuzzy match suggestion.
- Quick Fix: Insert the missing
Semantic Highlighting, Formatting & Snippets:
- Semantic Tokens: Regex-based syntax highlighting (TextMate) is replaced by AST-driven highlighting. Offers surgical precision for ingredients, timers, temperatures, comments, and nested units (e.g., precise separation of value and unit in
{10g}). - Auto-formatting (
Alt+Shift+F):- Normalization of spaces inside curly braces (
{ 200 g }→{200g}). - Normalization of composite ingredients (
@a < @b→@a<@b). - Alignment of section titles and tab-to-space conversions.
- Normalization of spaces inside curly braces (
- Built-in Snippets: Keyboard shortcuts for the basic structure (frontmatter, sections, steps), ingredient variants (
@ing,@?,@-), cookware (#cw), and timers/temperatures. - Core language update to enforce new syntax adjustments (breaking changes).
- Grammar & Parsing:
- Made
{}optional for single-word ingredients. - Replaced temperature symbol with
°. - Replaced async timers with
~&{}. - Replaced aliases brackets with
:. - Tightened
<@with no spaces allowed. - Added fixed modifier
=. - Mandatory
@&inside relative quantities declarations. (e.g:@water{60% @&flour}) - Top-Level Support: Allowed writing comments and recipe steps globally, anywhere in the document (even before the first
## Section).
- Made
- Compiler Analysis:
- Added
INVALID_MODIFIER_COMBINATIONwarnings. - Updated AST transformations to support the new modifiers parsing rules and the implicit top-level sections grouping.
- Added
- Aligned visual tooling and test recipes with the new grammar.
GramHighlight.ts(Playground & VSCode): Updated all syntax highlighting regular expressions to accurately match the new syntax (new temperature symbols, updated modifiers, etc.).
- Major architecture refactoring, ESM Migration, performance optimizations and code cleanup
- Complete overhaul of the documentation to reflect the new syntax changes.
Bug fixes and improvements
- NutritionMetrics output field renamed from
salttosodiumto match the ingredient database schema
[0.10.1] - 6/14/2026
Bug fixes and improvements
- Cleaned up and updated dependencies.
- Implemented Turborepo to optimize and simplify project building.
[0.10.0] - 6/14/2026
New features
- Added Bun snapshot testing to the development environment for compiler validation.
- Created a new shared @gram-lang/renderer package to handle HTML and Markdown generation.
- Refactored unit translation and normalization into a new centralized @gram-lang/i18n package to remove redundancy between the compiler and analyzer.
Bug fixes and improvements
- Refactored the analyzer to reuse the compiler's getNumericQty utility, improving code DRYness and type safety.
- Migrated to full Bun environment using 'workspace:*' dependencies
- Added Zod to automatically catch invalid data and prevent crashes.
- Improved code safety in the compiler by adding strict type checking for recipe elements.
- Introduce a unified
getNumericQtyutility inutils.tsto safely extract numeric values from AST Quantity structures (including fractions, ranges, and nested nodes). This fixes a bug where composite child ingredient quantities using fractions (e.g.@zest{1/2}) aggregated to zero in the shopping list. - Format decimal values strictly below 1 (e.g.
0.5,0.25) as clean culinary fractions (1/2,1/4) in the shopping list, while keeping standard decimal formatting for values greater than or equal to 1 (e.g.1.5). - Cleaned up repetitive code that manages and saves ingredients and cookware.
- Standardized the warning system to provide consistent and reliable error messages across all tools.
- Improved parser stability and removed complex build workarounds for web environments.
- Refactored AST processing for improved maintainability.
- Standardized how recipe elements are identified across the system to prevent typos and errors.
[0.9.0] - 6/7/2026
New features
- Ingredients states (
@ingredient:state{}) are removed. While the idea was to better organize the ingredient's database, it just happened to be too confusing to use. - Updated unit resolution to allow for french aliases (e.g: tsp = càc)
- Ingredient references without quantities (
@&ingredient{}) are now excluded from section ingredients summaries. This keeps section-level mise en place lists clean by filtering out pure flow instructions (like removing or re-inserting) while preserving separate measured portions. - Fixed multiple issues with mass calculations
- Extracted analyzer logic (mass normalization, yield management, nutritional estimation) into its own package. Ingredients database must now be provided by the user.
- GRAM syntax now also accepts semantic temperatures (e.g: Cook on !{low heat})
Bug fixes and improvements
- Cleaned repo with removal of /dist folders
- Using changesets to simplify changelog management
- Clarification of global comments for a recipe, to be declared in the front matter as "notes"
- Removed unwanted spaces from default playground input
- Empty ingredient masses now count as zero.
0.7.0 - 2026-05-10
New features
- Reclassified database-backed features (mass unification, yield management, and nutrition estimation) as experimental feature flags in
CompilerOptionsand the Playground. - Ingredients with empty braces (
@salt{}) now count as negligible mass (0 g) so total recipe mass can still be computed. - Centralized unit translations in
i18n.tswith support for standard French culinary abbreviations.
Bug fixes and improvements
- The Playground nutrition panel now hides automatically when any ingredient is missing macro data or has an undetermined mass, avoiding misleading partial totals.
0.6.0 - 2026-01-18
New features
- Overhauled the ingredient database into categorized YAML files (
~900ingredients sourced from ANSES CIQUAL and USDA FoodData Central), with English/French lookup and user-defined entries. - Introduced ingredient states (
@ingredient:state{qty}) and compiler warnings for missing ingredients or incomplete nutrition data.
Bug fixes and improvements
- Replaced the Playground syntax highlighter with
code-inputand improved warning display. - Fixed mass calculations for section intermediates and composite ingredient aggregation in shopping lists.
0.5.0 - 2026-01-06
New features
- Mass unification: Added volume-to-gram conversion via average densities, net vs. purchasing mass (yield/waste), custom frontmatter densities, and an initial proof-of-concept ingredient database.
- Nutrition & time estimation: Added per-recipe and per-portion nutritional estimates and distinct active, total, and estimated prep ("mise en place") time metrics in the Playground.
- Migrated repository hosting to Codeberg.
Bug fixes and improvements
- Fixed comment rendering so notes no longer shift step numbering, fixed percentages inside alternative groups, and improved parser robustness.
0.4.0 - 2026-01-04
New features
- Added asynchronous (background) timer support (
~{1h}&) to distinguish active work from total duration, with dedicated styling in the Playground. - Added a raw AST view and a view-selector dropdown in the Playground.
Bug fixes and improvements
- Fixed shopping-list aggregation when multiple composite ingredients share the same parent.
0.3.1 - 2026-01-03
Bug fixes and improvements
- Fixed composite sub-ingredient quantities not summing properly across multiple sections in the shopping list.
- Updated documentation links and recipe examples after the workspace reorganization.
0.3.0 - 2026-01-02
New features
- Restructured the project into a workspace monorepo under
packages/(parser,compiler,playground,vscode-extension). - Separated the Ohm.js parser (
packages/parser) from the semantic compiler (packages/compiler) and added anexamples/library synced with the Playground.
0.2.0 - 2025-12-30
Bug fixes and improvements
- Migrated
gram-parserfrom JavaScript to TypeScript with strict AST/compiler interfaces and generated.d.tsdeclarations.
[0.1.0] - 2025-12-28
New features
- Initial alpha release of Gram: language specification, Ohm.js reference parser (
gram-parser), web Playground (JSON, AST tree, and Markdown views), and VS Code syntax highlighting extension. - Core recipe features: separation of ingredients, cookware, and instructions, section vs. aggregated shopping lists, relative quantities (baker's percentages), intermediate references, and composite ingredients.