overwrite
overwrite mutates simple values in-place for assign/alias-backed variables. It is designed for controlled runtime updates without redefining full command lines.
Syntax
overwrite ~varName "new value"
overwrite aliasVar "new value"
Example
@var0 :=
@var1 := $var0
@var2 := $var1
@firstOverwrite overwrite ~var1 "SHOULD NOT WORK" await $var2
overwrite ~var0 "v1" await $var2 await $firstOverwrite
@a := A
@b alias "doc1" a
overwrite b "B"
Based on tests/pipelines/overwrite/basicOverwriteTest.mjs. Overwriting dependency-bearing variables is ignored by design, while alias overwrite propagates to the referenced base variable.
Step-by-Step Interaction
The runtime first resolves alias chains recursively until it reaches the concrete target variable that should be mutated. After resolution, the runtime validates that the target is a simple assign or alias variable without dependency inputs, because overwriting derived variables would violate reactive graph consistency. If validation succeeds, the runtime updates the target value and advances the variable clock so dependent nodes can recompute. If validation fails, the runtime leaves output undefined and stores diagnostic error metadata.
Runtime Behavior Notes
The command allows direct mutation only for simple scalar variables that do not depend on other inputs, and this restriction protects graph determinism. Alias targets are always dereferenced to their real source variables before mutation. Chain aliases and custom type member paths are rejected for direct overwrite because they represent computed or object-scoped structures rather than direct assign slots. When overwrite changes a value successfully, the build system is notified and a recomputation cycle can restart from that mutation point.