feat(recipes): expose default_from in the JSON contract - #108
Conversation
recipe show --json and MCP recipe_schema now report a param's default_from alongside default, so a consumer no longer reads docker.user as unset when Stoat fills it from the VM's SSH account. Signed-off-by: NovusEdge <novusedge0@gmail.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
WalkthroughThe change adds optional ChangesRecipe parameter default source
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Manifest
participant CoreRecipeParam
participant WireRecipeParam
participant MCPRecipeSchema
Manifest->>CoreRecipeParam: provide DefaultFrom
CoreRecipeParam->>WireRecipeParam: copy DefaultFrom
WireRecipeParam->>MCPRecipeSchema: serialize default_from
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Follow-up to #107, which added
default_from = "ssh_user"to the schema 3 param table without exposing it to machine consumers.stoat recipe show --jsonand the MCPrecipe_schematool report a param'sdefaultbut had no way to say the value comes from the VM. Sodocker.userread asdefault: "",required: false, and an agent parsing that concluded the param was optional and unset. Stoat in fact fills it fromconfig.VM.SSHUserat apply time.core.RecipeParamand the wireRecipeParamnow carryDefaultFrom, serialized asdefault_fromwithomitempty, so a param that does not declare it emits no new key and existing consumers see no change.The contract stays at 3.
docs/reference/json.md:111states that an additive optional field does not bump it, and this is one.docs/reference/mcp.mdis untouched: it does not documentrecipe_schema's result shape.Tests
TestRecipeSchemaListsParamswas relaxed in #107 to only assert docker'suserparam exists. It now asserts the param reportsdefault_fromasssh_user.TestRecipeSchemaOmitsDefaultFromWhenUndeclaredusespython-dev.venv_dir, which declares a static default and nodefault_from, to prove the key stays out of the JSON.go build ./...,go vet ./...,gofmt -lclean, andgo testforinternal/core,internal/cli,internal/mcpsrv,internal/recipesall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01XNEYeG6gFKQc2hxbzYN1oh
Summary by CodeRabbit
New Features
ssh_user, when no value is provided.default_fromfield where applicable.defaultvalue.Documentation
default_from, its supported values, usage, and compatibility with version 3.