Relationships
#3196 swamp model validate checks globalArguments without applying the model's upgrades chain
Opened by skunk-ape · 10/8/2026· Shipped 10/12/2026
Problem
swamp runs a model type's upgrades (upgradeAttributes) only when a method executes (src/domain/models/method_execution_service.ts, executeWorkflow, around line 478). ValidationService (src/domain/models/validation_service.ts, around lines 488-532) checks a definition's globalArguments against the model's current globalArguments schema without applying the upgrade chain first.
So once a type bumps its version with an upgrade that changes the globalArguments shape, swamp model validate reports a schema failure for every instance still at an older typeVersion. The same instance would upgrade cleanly the next time any of its methods ran.
Example
The @swamp/stagecraft factory type will declare upgrades that move its globalArguments.definition from schemaVersion 1 to 2 (swamp-club #3194, #3190). A factory file still at v1 fails swamp model validate until a factory method happens to run and the upgrade is written back.
Expected
Validation applies the same DefinitionUpgradeService chain in memory, without writing it back, before checking globalArguments. A definition the next method run would upgrade then validates, and the upgrade path itself gets checked.
Workaround
An extension can make its globalArguments schema accept older shapes itself; stagecraft does this for #3194.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.