Skip to content

Comments

feat: Step inputs override model definition attributes (implicit inputs)#240

Merged
stack72 merged 2 commits intomainfrom
feat/implicit-input-overrides
Feb 10, 2026
Merged

feat: Step inputs override model definition attributes (implicit inputs)#240
stack72 merged 2 commits intomainfrom
feat/implicit-input-overrides

Conversation

@keeb
Copy link
Contributor

@keeb keeb commented Feb 10, 2026

Summary

  • Model definition attributes now act as implicit inputs — defaults that step inputs can override
  • Eliminates the need for verbose CEL workarounds like ${{ has(inputs.memory) ? inputs.memory : 2048 }} on every overridable attribute
  • Applied after CEL evaluation in both the workflow path (execution_service.ts) and CLI path (model_method_run.ts), so expressions resolve first, then concrete input values take precedence

How it works

If a model defines memory: 2048 and a workflow step passes inputs: { memory: 1024 }, the execute function sees memory: 1024. Static attributes are defaults; step inputs override them.

Test plan

  • Workflow path: 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)
  • CLI path: swamp model method run testVm delete --input '{"vmName":"test-stateful"}' — worked correctly
  • Non-overridden attributes retain their evaluated values
  • CEL expressions evaluate before input overrides are applied

🤖 Generated with Claude Code

keeb and others added 2 commits February 9, 2026 18:43
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>
@keeb keeb marked this pull request as ready for review February 10, 2026 16:29
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 any types 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 Definition entity's setAttribute() method is an existing pattern in the codebase
  • The change appropriately treats inputs as runtime overrides at the application layer

Suggestions (non-blocking)

  1. 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.

Verified Behavior

  • Step inputs override evaluated attributes after CEL expressions are resolved
  • Both model_method_run.ts (CLI path) and execution_service.ts (workflow path) are updated consistently
  • Vault expressions are resolved after input overrides, preserving the security model

@stack72 stack72 merged commit b8daf2f into main Feb 10, 2026
6 checks passed
@stack72 stack72 deleted the feat/implicit-input-overrides branch February 10, 2026 16:32
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.

2 participants