State
An update produces the next value; it does not alter a value another caller already holds.
Immutable ownership
Why
An installation plan must stay stable while it is inspected and applied. Storing its file count separately or mutating its changes array introduces avoidable disagreement.
Rules
MUST regard received arguments and module-level data as readonly inputs.[review]
MUST return a fresh object or array when an operation changes domain data.[review]
MUST keep assignment, mutating array methods, andObject.assignaway from arguments and shared state.[review]
MUST derive counts, totals, and filtered views from the authoritative collection.[review]
MUST maintain one authoritative representation of each domain value.[review]
MUST use immutable application collections rather than authoredMap,Set,WeakMap, orWeakSetstate.[review]
MUST keep mutable application data out of module bindings and factory closures.[review]
MAY capture resource clients in factories or keep handles at lifetimes owned by a framework.[review]
Example
[review]
Readonly types cover supported mutation paths. Tests and review check aliasing, nested fields, and mutable application state that annotations alone cannot prevent.
Enforcement
Readonly types cover supported mutation paths. Tests and review check aliasing, nested fields, and mutable application state that annotations alone cannot prevent.