Relationships
#3029 CEL data.version, data.listVersions and data.findBySpec drop data written before a model instance rename
Opened by stack72 · 10/5/2026· Shipped 10/5/2026
Description
Sibling of swamp-club#3011, which fixed context.readModelData. Three CEL data functions in src/domain/expressions/model_resolver.ts (buildDataNamespace) still select by the modelName tag only:
- data.version(model, name, version) - predicate modelName == && name == ... && version == ...
- data.listVersions(model, name) - modelName predicate via querySync
- data.findBySpec(model, spec) - modelName predicate
The modelName tag records the name at write time and is not updated when a model instance is renamed (definition name changed, same id). After a rename, these functions skip every item written under the old name and not written again since, with no error or warning. swamp data list still shows those items.
Not affected: model..resource and model..file (loaded per model coordinates, by type and id) and data.latest for own-namespace models found in the run's coordinates map (reads by type and id). data.latest still falls back to the name tag when the model has no coordinates.
Steps to reproduce (from code reading; not yet reproduced)
- Create model old-name and run a method that writes resource foo-one of spec foo.
- Rename the definition name to new-name (same id).
- Write another foo item from new-name.
- Evaluate data.findBySpec("new-name", "foo") in a workflow expression.
Expected: both items. Likely actual: only the item written after the rename. data.version("new-name", "foo-one", 1) and data.listVersions("new-name", "foo-one") likely return nothing.
Suggested fix
Follow #3011 (PR #2826): keep the name-tag read and also read by the resolved definition identity (modelType and modelId), using modelIdentityPredicate and mergeModelData from data_access_service.ts, with modelType/modelId pushdown already in place. The coordinates map in model_resolver.ts already holds the identity for own-namespace models.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.