Skip to content

feat: recipes declare components as data (4.2.0) - #11

Merged
dasmig merged 2 commits into
mainfrom
recipes
Oct 18, 2026
Merged

dasmig merged 2 commits into
mainfrom
recipes

Conversation

@dasmig

@dasmig dasmig commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

add_recipe(path) and add_recipe_from_string(text) register components written as rows of a tab-separated file (constant, choice, weighted, int, real, with label, depends_on and weight), so components that only draw from a list or a range need no recompiling. They are field() components, so dependencies, ordering, weights, batches and replay work as for code. A bad row throws a core::tsv_error with file, line and column and adds nothing; each row's text is the component's data hash, so a changed recipe changes the signature.

Additive, so a minor version. weighted_choice_component already uses the core's weighted choice (core::discrete), which closes the other half of the plan's entity-generator item.

Test plan

  • 10 new test cases (every kind, JSON types and labels, replay and signature, dependencies and weight 0, code depending on recipe keys, replacing, errors that add nothing, a clashing path, a file, batches); 303 test cases pass with clang 22, lint clean
  • CI on all compilers

🤖 Generated with Claude Code

https://claude.ai/code/session_01DPV1MNDvin2F6GasC4QwMf

dasmig and others added 2 commits October 18, 2026 12:15
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPV1MNDvin2F6GasC4QwMf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPV1MNDvin2F6GasC4QwMf
@dasmig
dasmig merged commit 51dabb4 into main Oct 18, 2026
20 checks passed
@dasmig
dasmig deleted the recipes branch October 18, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant