Relationships
#4969 ensureReadSet downloads every text resource of a referenced model, not just the instances an expression reads
Opened by zack · 11/20/2026
Follow-up to #4958. On a lazy-hydration datastore, ModelResolver.ensureReadSet (src/domain/expressions/model_resolver.ts) downloads every text resource of a model an expression reads through model..resource before evaluating it. analyzeExpression records only a per-model resource flag in syncDataReads, not the spec or instance. An expression such as model.big.resource.blob[blob-0].attributes therefore downloads every instance of every spec of big, which costs disk and network in proportion to the whole behavior instead of the one instance. After #4958 the heap cost is per instance, but the download is not. Record the literal spec and instance keys in syncDataReads where the expression names them, and ensure only those, falling back to the whole model for a computed key.
Open
No activity in this phase yet.
zack commented 11/20/2026, 10:33:09 PM
Same root cause, second site: synchronousSensitiveReferences in src/infrastructure/cel/sensitive_record_adapter.ts, run by prepareSynchronousReads for workflow-level expressions (step inputs, task, placement), reads the attributes of every record of a named model whose tags declare sensitive fields, to authorize their vault references. After #4958 that is the only remaining place where an expression reading item a can be refused on an oversized sensitive sibling, with an error naming that sibling. Once syncDataReads records the literal spec and instance keys, the scan can collect references only from those instances, falling back to the whole model for a computed key, the same narrowing this issue asks for in ensureReadSet.
Sign in to post a ripple.