Repository navigation
feat(experience): parameterized recipes — typed decls, easy defaults, resolved params on the binding (#433) - #2306
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The code half of #433 (the design merged as
docs/planning/ACTIVITIES-CATALOG.mdin #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/spawngainsparamsoverrides.validate_recipegrew intoresolve_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.Eqdropped (serde_json::ValueisPartialEqonly; nothing keyed on it).Tests (all
// what this catchesdocumented, in the existing mods)resolve_recipehonors overlay-wins-by-purpose (authored param decls govern)params; legacy binding JSON (no params) still readsValidation
cargo check -p continuum-core --features metal,acceleratecleancargo test --lib: 65 activity/experience + 61 sdk_codegen/benchmark/purpose-index, all greenParamDecl.ts(new),ExperienceRecipe.ts,RoomRecipeBinding.ts🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo