feat(kitchen): emit mise en place and per-section and upfront schedules #45

Merged
abiwab merged 3 commits from feat/kitchen-schedules into main 2026-09-29 20:59:23 +02:00
198 changed files with 16039 additions and 55 deletions

View file

@ -0,0 +1,10 @@
---
"@gram-lang/kitchen": minor
---
**Kitchen**: Recipes now know when each part of the mise en place should happen:
- Each section reports how long its own preparation takes (new `miseEnPlace` field)
- Two complete timelines are provided: preparation right before each section (`schedules.perSection`) or all of it at the start (`schedules.upfront`)
- The compiled recipe now says which version produced it (new `generator` field)
- Step `timings`, `backgroundTasks` and the `metrics` time breakdowns are deprecated and will be removed in 2.0.0 — read `schedules` instead

View file

@ -171,3 +171,7 @@ suitable for CI.
sibling `.gram` files inside the same case directory. `ast.json` still sibling `.gram` files inside the same case directory. `ast.json` still
documents `getAST(input.gram)` alone (unresolved `imports`); `compiled.json` documents `getAST(input.gram)` alone (unresolved `imports`); `compiled.json`
/ `analyzed.json` reflect the fully composed, spliced document. / `analyzed.json` reflect the fully composed, spliced document.
## The `generator` field
Compiled and analyzed results carry a `generator` field (`@gram-lang/kitchen@<version>`). The runner drops it before writing or comparing `compiled.json` / `analyzed.json`, since it changes on every release. Every other field is compared as usual.

View file

@ -122,5 +122,59 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 1,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 3,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
}
]
},
"upfront": {
"totalTime": 3,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
}
]
}
} }
} }

View file

@ -84,5 +84,59 @@
"duration": 1 "duration": 1
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 1,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 3,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
}
]
},
"upfront": {
"totalTime": 3,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
}
]
}
} }
} }

View file

@ -243,5 +243,65 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 5,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 4,
"duration": 4
},
{
"kind": "gather",
"target": "cookware",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 7,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
}
]
},
"upfront": {
"totalTime": 7,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
}
]
}
} }
} }

View file

@ -181,5 +181,65 @@
"duration": 1 "duration": 1
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 5,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 4,
"duration": 4
},
{
"kind": "gather",
"target": "cookware",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 7,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
}
]
},
"upfront": {
"totalTime": 7,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
}
]
}
} }
} }

View file

@ -280,5 +280,59 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 4,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 4,
"duration": 4
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 6,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 6
}
]
},
"upfront": {
"totalTime": 6,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 6
}
]
}
} }
} }

View file

@ -217,5 +217,59 @@
"duration": 4 "duration": 4
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 4,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 4,
"duration": 4
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 6,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 6
}
]
},
"upfront": {
"totalTime": 6,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 6
}
]
}
} }
} }

View file

@ -132,5 +132,59 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 2,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 2,
"duration": 2
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
},
"upfront": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
}
} }
} }

View file

@ -99,5 +99,59 @@
"duration": 2 "duration": 2
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 2,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 2,
"duration": 2
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
},
"upfront": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
}
} }
} }

View file

@ -147,5 +147,59 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 2,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 2,
"duration": 2
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
},
"upfront": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
}
} }
} }

View file

@ -114,5 +114,59 @@
"duration": 2 "duration": 2
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 2,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 2,
"duration": 2
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
},
"upfront": {
"totalTime": 4,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 2
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 2,
"end": 4
}
]
}
} }
} }

View file

@ -331,5 +331,73 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 5,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 5,
"duration": 5
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 9,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 7,
"end": 9
}
]
},
"upfront": {
"totalTime": 9,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 7,
"end": 9
}
]
}
} }
} }

View file

@ -255,5 +255,73 @@
"duration": 5 "duration": 5
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 5,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 5,
"duration": 5
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 9,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 7,
"end": 9
}
]
},
"upfront": {
"totalTime": 9,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 5
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 5,
"end": 7
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 7,
"end": 9
}
]
}
} }
} }

View file

@ -166,5 +166,81 @@
"isEstimate": false, "isEstimate": false,
"coverage": 0 "coverage": 0
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 4,
"items": [
{
"kind": "gather",
"target": "cookware",
"count": 2,
"duration": 2
},
{
"kind": "prepare",
"ref": {
"type": "cookware",
"id": "big-pot"
},
"duration": 2
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 39,
"idleTime": 30,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 9
},
{
"kind": "passive",
"section": 0,
"step": 0,
"start": 9,
"end": 39
}
]
},
"upfront": {
"totalTime": 39,
"idleTime": 30,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 9
},
{
"kind": "passive",
"section": 0,
"step": 0,
"start": 9,
"end": 39
}
]
}
} }
} }

View file

@ -148,5 +148,81 @@
"duration": 2 "duration": 2
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 4,
"items": [
{
"kind": "gather",
"target": "cookware",
"count": 2,
"duration": 2
},
{
"kind": "prepare",
"ref": {
"type": "cookware",
"id": "big-pot"
},
"duration": 2
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 39,
"idleTime": 30,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 9
},
{
"kind": "passive",
"section": 0,
"step": 0,
"start": 9,
"end": 39
}
]
},
"upfront": {
"totalTime": 39,
"idleTime": 30,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 9
},
{
"kind": "passive",
"section": 0,
"step": 0,
"start": 9,
"end": 39
}
]
}
} }
} }

View file

@ -239,5 +239,97 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 3,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 3,
"duration": 3
}
]
},
{
"section": 1,
"duration": 1,
"items": [
{
"kind": "gather",
"target": "cookware",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 8,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 3
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 3,
"end": 5
},
{
"kind": "prep",
"section": 1,
"start": 5,
"end": 6
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 6,
"end": 8
}
]
},
"upfront": {
"totalTime": 8,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 3
},
{
"kind": "prep",
"section": 1,
"start": 3,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 6
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 6,
"end": 8
}
]
}
} }
} }

View file

@ -184,5 +184,97 @@
"duration": 1 "duration": 1
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 3,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 3,
"duration": 3
}
]
},
{
"section": 1,
"duration": 1,
"items": [
{
"kind": "gather",
"target": "cookware",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 8,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 3
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 3,
"end": 5
},
{
"kind": "prep",
"section": 1,
"start": 5,
"end": 6
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 6,
"end": 8
}
]
},
"upfront": {
"totalTime": 8,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 3
},
{
"kind": "prep",
"section": 1,
"start": 3,
"end": 4
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 4,
"end": 6
},
{
"kind": "step",
"section": 1,
"step": 0,
"start": 6,
"end": 8
}
]
}
} }
} }

View file

@ -142,5 +142,73 @@
} }
] ]
} }
},
"miseEnPlace": [
{
"section": 0,
"duration": 1,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 5,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
},
{
"kind": "step",
"section": 0,
"step": 1,
"start": 3,
"end": 5
}
]
},
"upfront": {
"totalTime": 5,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
},
{
"kind": "step",
"section": 0,
"step": 1,
"start": 3,
"end": 5
}
]
}
} }
} }

View file

@ -104,5 +104,73 @@
"duration": 1 "duration": 1
} }
] ]
},
"miseEnPlace": [
{
"section": 0,
"duration": 1,
"items": [
{
"kind": "gather",
"target": "ingredient",
"count": 1,
"duration": 1
}
]
}
],
"schedules": {
"perSection": {
"totalTime": 5,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
},
{
"kind": "step",
"section": 0,
"step": 1,
"start": 3,
"end": 5
}
]
},
"upfront": {
"totalTime": 5,
"idleTime": 0,
"blocks": [
{
"kind": "prep",
"section": 0,
"start": 0,
"end": 1
},
{
"kind": "step",
"section": 0,
"step": 0,
"start": 1,
"end": 3
},
{
"kind": "step",
"section": 0,
"step": 1,
"start": 3,
"end": 5
}
]
}
} }
} }

Some files were not shown because too many files have changed in this diff Show more