feat: Step inputs override model definition attributes (implicit inputs)#240
Merged
feat: Step inputs override model definition attributes (implicit inputs)#240
Conversation
Model attributes now act as defaults that step inputs can override,
eliminating the need for verbose CEL expressions like
`${{ has(inputs.memory) ? inputs.memory : 2048 }}` on every
overridable attribute.
Applied in both the workflow path (execution_service.ts) and CLI path
(model_method_run.ts), after CEL evaluation so expressions resolve
first, then concrete input values take precedence.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Review Summary
This PR correctly implements implicit input overrides, allowing step inputs to override model definition attributes after CEL evaluation.
Blocking Issues
None.
Code Quality ✅
- TypeScript strict mode: No
anytypes introduced - Named exports: Follows the project's export conventions
- The changes are consistent across both paths (CLI and workflow execution)
- Order of operations is correct: CEL evaluation → input overrides → vault resolution
- No security vulnerabilities introduced
DDD Compliance ✅
- The
Definitionentity'ssetAttribute()method is an existing pattern in the codebase - The change appropriately treats inputs as runtime overrides at the application layer
Suggestions (non-blocking)
-
Test coverage: Consider adding a unit test that specifically verifies input override behavior. For example, a test that:
- Creates a definition with
memory: 2048 - Passes
inputs: { memory: 1024 } - Verifies the final evaluated definition has
memory: 1024
This would provide regression protection for the new behavior. However, given the straightforward nature of the change and the documented manual testing, this is not blocking.
- Creates a definition with
Verified Behavior
- Step inputs override evaluated attributes after CEL expressions are resolved
- Both
model_method_run.ts(CLI path) andexecution_service.ts(workflow path) are updated consistently - Vault expressions are resolved after input overrides, preserving the security model
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.
Summary
${{ has(inputs.memory) ? inputs.memory : 2048 }}on every overridable attributeexecution_service.ts) and CLI path (model_method_run.ts), so expressions resolve first, then concrete input values take precedenceHow it works
If a model defines
memory: 2048and a workflow step passesinputs: { memory: 1024 }, the execute function seesmemory: 1024. Static attributes are defaults; step inputs override them.Test plan
swamp workflow run create-stateful-vm --input '{"vmName":"test-stateful","memory":1024,"cores":1,"diskSize":4}'— VM created with overridden specs (1024MB, 1 core, 4GB) instead of model defaults (2048/2/32)swamp model method run testVm delete --input '{"vmName":"test-stateful"}'— worked correctly🤖 Generated with Claude Code