Skip to content

feat(experience): parameterized recipes — typed decls, easy defaults, resolved params on the binding (#433) - #2306

Merged
joelteply merged 1 commit into
canaryfrom
feat/433-parameterized-recipes
Aug 14, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/433-parameterized-recipes

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

The code half of #433 (the design merged as docs/planning/ACTIVITIES-CATALOG.md in #2304). Recipes gain parameters as data, activity/spawn resolves them, and the room's wall binding carries the resolved set.

The param model (per the catalog)

  • ParamDecl { default, doc } — the default IS the type declaration. A param cannot be authored without a default, so "a zero-arg spawn always works" holds by construction; a supplied value whose JSON type differs from the default's is refused at spawn, naming the declared set with its docs.
  • ExperienceRecipe.params (serde default) — every existing recipe is a parameterless recipe, unchanged. Authoring a parameterized activity stays a file, zero code.
  • activity/spawn gains params overrides. validate_recipe grew into resolve_recipe (returns the later-wins-by-purpose match; thin wrapper kept so the install.sh: auto-install training deps on GPU machines #431/Dispatch: feature/bug/review overrides simple command gate #432 gate tests stand untouched) + resolve_params (defaults merged under overrides; unknown names and type mismatches refuse loud).
  • RoomRecipeBinding.params — the RESOLVED set rides the wall, so the room is self-describing: a citizen, a renderer, or a grader reads what this room is parameterized to do from the same pipe as everything else (BENCHMARKS-ARE-ADAPTERS law). serde(default) keeps pre-MoE expert paging: load only the needed expert on demand, page rest from HF cache #433 bindings readable. Eq dropped (serde_json::Value is PartialEq only; nothing keyed on it).
  • Benchmark dispatch passes an empty map (= the recipe's defaults, honestly on the binding). Threading the run's real targeting (suite/instances/team/budget) through dispatch is the remaining MoE expert paging: load only the needed expert on demand, page rest from HF cache #433 slice, with the shipped benchmark recipe's param decls.

Tests (all // what this catches documented, in the existing mods)

  • zero-arg → exactly the declared defaults; override merges over remaining defaults
  • unknown name refused naming the declared set with docs; wrong JSON type refused naming both types
  • parameterless recipe refuses any override plainly ("declares NO parameters")
  • resolve_recipe honors overlay-wins-by-purpose (authored param decls govern)
  • binding round-trip now exercises params; legacy binding JSON (no params) still reads

Validation

  • cargo check -p continuum-core --features metal,accelerate clean
  • targeted cargo test --lib: 65 activity/experience + 61 sdk_codegen/benchmark/purpose-index, all green
  • ts-rs regen committed: ParamDecl.ts (new), ExperienceRecipe.ts, RoomRecipeBinding.ts

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… defaults, resolved onto the room's binding (#433)

The code half of #433 (the ACTIVITIES-CATALOG doc merged as the design).
Recipes gain params as DATA: each declared knob is a ParamDecl whose
DEFAULT is also its TYPE declaration — a param cannot be authored without
a default, so "a zero-arg spawn always works" holds by construction, and
a supplied value must carry the same JSON type as the default or the
spawn refuses naming the declared set with its docs.

- ExperienceRecipe.params: BTreeMap<String, ParamDecl> (serde default —
  every existing recipe is a parameterless recipe unchanged)
- activity/spawn accepts params overrides; resolve_recipe (validate_recipe
  grown to RETURN the later-wins-by-purpose match, thin wrapper kept) +
  resolve_params (defaults merged under overrides; unknown names and JSON
  type mismatches refuse loud)
- RoomRecipeBinding.params carries the RESOLVED set on the wall, so the
  room is SELF-DESCRIBING: citizens, renderers and graders read what this
  room is parameterized to do from the same pipe as everything else
  (BENCHMARKS-ARE-ADAPTERS law); serde default keeps pre-#433 bindings
  readable. Eq dropped (Value is PartialEq only; nothing keyed on it)
- benchmark dispatch passes an empty map (defaults) — threading the run's
  real targeting through is the remaining #433 dispatch slice
- source::known_recipes exposed (known_purposes now derives from it)
- tests: zero-arg defaults, merge-over-defaults, unknown-name refusal
  carrying docs, type-mismatch refusal, parameterless-recipe refusal,
  overlay-wins resolution; binding round-trip now exercises params
- ts-rs regen: ParamDecl.ts new, ExperienceRecipe.ts + RoomRecipeBinding.ts

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 3ef777d into canary Aug 14, 2026
5 checks passed
@joelteply
joelteply deleted the feat/433-parameterized-recipes branch August 14, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant