🍳 Foodlang

Validation Levels

Foodlang grades every recipe across seven levels, from human-readable to industrial. The point is honesty: a recipe can be a great human document and still not be robot-plannable, and Foodlang tells you exactly where it stands.

Level Name Passes when…
0 readable it has a recipe name
1 parseable it parses as YAML
2 structured_ingredients ingredients carry quantities
3 process_aware transformations carry input/output states
4 appliance_mappable at least one appliance target is present
5 robot_plannable a non-trivial action graph (with dependencies) exists
6 industrial_mappable an S88 procedure is present

Each level reports one of three statuses:

  • pass β€” the level is fully satisfied.
  • partial β€” the structure exists but is incomplete, or the output is a mapping/inspiration rather than a directly executable artifact.
  • fail β€” the level is not satisfied.

Why some levels cap at partial

Levels 4 (appliance) and 6 (industrial) deliberately top out at partial even for complete recipes, because their outputs are mappings and inspiration, not live device execution or certified batch recipes. Foodlang refuses to report "pass" for something it cannot actually run.

A single appliance target reports partial; two or more complementary targets (say OPC UA and MQTT) report pass for level 4.

Example output

Validation: PASS

Levels:
  readable: pass
  parseable: pass
  structured_ingredients: pass
  process_aware: pass
  appliance_mappable: pass
  robot_plannable: pass
  industrial_mappable: partial

Warnings:
  - Home Connect program names are illustrative and may vary by appliance.
  - OPC UA node IDs are not specified; output is a mapping, not executable network code.

Programmatic use

import { parseFoodRecipe, validateFoodRecipe } from "@foodlang/core";

const result = validateFoodRecipe(parseFoodRecipe(yaml));
if (!result.valid) {
  for (const e of result.errors) console.error(e.path, e.message);
  process.exit(1);
}
console.log(result.levels.robot_plannable); // "pass" | "partial" | "fail"