Design authority: src/collection/Filter.mjs:115-118 (Filter#effective) and src/collection/Base.mjs:1601 (Collection#splice), introduced in #19792 / #19796 and mirrored in TreeStore#filter (#20258 / PR #20259).
Context
Promoted from defect-note (MESSAGE:aa316289-880e-4cc4-86a3-afdf047f35f2, observed by @neo-opus-grace while reviewing #20259).
Neo.collection.Filter#effective (src/collection/Filter.mjs:115-118) defines whether a filter actively narrows a collection:
- When a
filterBy callback is configured, the filter is effective whenever !this.disabled.
- Otherwise, it is effective when
!this.disabled && this.value !== null.
While Collection#splice (src/collection/Base.mjs:1601) and TreeStore#filter (#20258 / PR #20259) gate on Filter#effective, Neo.data.Store still gates its Turbo-Mode (autoInitRecords: false) soft-hydration passes on the pre-#19792 predicate !f.disabled && f.value !== null.
The Problem
In src/data/Store.mjs:
Store#filter() (src/data/Store.mjs:732) selects activeFilters via: activeFilters = me.filters.filter(f => !f.disabled && f.value !== null),
Store#isFilteredItem() (src/data/Store.mjs:1114) gates per-item soft hydration via: if (!filter.disabled && filter.value !== null) {
When a Store runs in Turbo Mode (autoInitRecords: false) with a Model that has complex fields (calculate, convert, or mapping), and an enabled filterBy filter declares fields without setting value (value: null), both Store#filter() and Store#isFilteredItem() skip soft hydration for that filter's fields. The filterBy callback then still runs inside Filter.isFiltered() (src/collection/Filter.mjs:146-152), reading undefined for those unhydrated fields on raw items.
The Architectural Reality
Filter#effective (src/collection/Filter.mjs:115-118) is the single source of authority for whether a Filter instance is active.
Store#filter() (src/data/Store.mjs:732) and Store#isFilteredItem() (src/data/Store.mjs:1114) should gate on f.effective / filter.effective so Turbo-Mode soft hydration resolves fields for every effective filter before super.filter(silent) or super.isFilteredItem(item) evaluates Filter.isFiltered().
The Fix
- In
src/data/Store.mjs:
- Line 732 (
Store#filter): replace !f.disabled && f.value !== null with f.effective.
- Line 1114 (
Store#isFilteredItem): replace !filter.disabled && filter.value !== null with filter.effective.
- In
test/playwright/unit/data/StoreFilter.spec.mjs (or existing Store unit spec):
- Add unit test coverage verifying that in a Turbo-Mode
Store (autoInitRecords: false) with a calculated model field, an enabled filterBy filter declaring fields: [' doubled'] without a value soft-hydrates doubled on raw items during both store.filter() and store.isFilteredItem(rawItem).
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
Neo.data.Store#filter (src/data/Store.mjs:732) |
Neo.collection.Filter#effective (src/collection/Filter.mjs:115-118) |
Selects activeFilters via f => f.effective |
Inert filters (disabled: true or no filterBy and value === null) are skipped |
JSDoc in src/data/Store.mjs |
Playwright unit spec |
Neo.data.Store#isFilteredItem (src/data/Store.mjs:1114) |
Neo.collection.Filter#effective (src/collection/Filter.mjs:115-118) |
Gates per-item soft hydration via if (filter.effective) |
Inert filters are skipped |
JSDoc in src/data/Store.mjs |
Playwright unit spec |
Decision Record impact: none.
Acceptance Criteria
Out of Scope
- Modifying
Filter#effective or TreeStore#filter (covered by #19792 and #20258 / PR #20259).
Avoided Traps
- Duplicating
f.filterBy ? !f.disabled : (!f.disabled && f.value !== null) inline in Store.mjs instead of delegating to Filter#effective.
Related
- #19792 / PR #19796: introduced
Filter#effective and Filter#fields.
- #20258 / PR #20259: fixed the same predicate in
TreeStore#filter.
Live latest-open sweep: checked latest 20 open issues at 2026-11-03T19:24Z; no equivalent found (#20258 scopes TreeStore#filter only).
A2A in-flight claim sweep: checked list_messages({ status: 'all', limit: 30 }) at 2026-11-03T19:24Z; promoting MESSAGE:aa316289-880e-4cc4-86a3-afdf047f35f2 with no competing claim.
Memory Core rationale sweep: query_raw_memories (Store#filter Store#isFilteredItem Filter#effective filterBy without a value Turbo Mode autoInitRecords) and ask_knowledge_base (type: 'ticket') returned #19792/#19643 context and no prior exclusion.
Own-assignment sweep: checked gh issue list --state open --assignee @me (#20264, #20260, #20258, #20256); #20258 is the TreeStore sibling.
unowned-rationale: Claimed by @neo-gemini-julia for immediate execution.
Origin Session ID: 50cec9b3-cbdc-4b13-befe-10aaa76a14d1
Retrieval Hint: "Store#filter Store#isFilteredItem Filter#effective filterBy without value Turbo Mode soft hydration"
Design authority:
src/collection/Filter.mjs:115-118(Filter#effective) andsrc/collection/Base.mjs:1601(Collection#splice), introduced in #19792 / #19796 and mirrored inTreeStore#filter(#20258 / PR #20259).Context
Promoted from defect-note (
MESSAGE:aa316289-880e-4cc4-86a3-afdf047f35f2, observed by @neo-opus-grace while reviewing #20259).Neo.collection.Filter#effective(src/collection/Filter.mjs:115-118) defines whether a filter actively narrows a collection:filterBycallback is configured, the filter is effective whenever!this.disabled.!this.disabled && this.value !== null.While
Collection#splice(src/collection/Base.mjs:1601) andTreeStore#filter(#20258 / PR #20259) gate onFilter#effective,Neo.data.Storestill gates its Turbo-Mode (autoInitRecords: false) soft-hydration passes on the pre-#19792 predicate!f.disabled && f.value !== null.The Problem
In
src/data/Store.mjs:Store#filter()(src/data/Store.mjs:732) selectsactiveFiltersvia:activeFilters = me.filters.filter(f => !f.disabled && f.value !== null),Store#isFilteredItem()(src/data/Store.mjs:1114) gates per-item soft hydration via:if (!filter.disabled && filter.value !== null) {When a
Storeruns in Turbo Mode (autoInitRecords: false) with aModelthat has complex fields (calculate,convert, ormapping), and an enabledfilterByfilter declaresfieldswithout settingvalue(value: null), bothStore#filter()andStore#isFilteredItem()skip soft hydration for that filter'sfields. ThefilterBycallback then still runs insideFilter.isFiltered()(src/collection/Filter.mjs:146-152), readingundefinedfor those unhydrated fields on raw items.The Architectural Reality
Filter#effective(src/collection/Filter.mjs:115-118) is the single source of authority for whether aFilterinstance is active.Store#filter()(src/data/Store.mjs:732) andStore#isFilteredItem()(src/data/Store.mjs:1114) should gate onf.effective/filter.effectiveso Turbo-Mode soft hydration resolvesfieldsfor every effective filter beforesuper.filter(silent)orsuper.isFilteredItem(item)evaluatesFilter.isFiltered().The Fix
src/data/Store.mjs:Store#filter): replace!f.disabled && f.value !== nullwithf.effective.Store#isFilteredItem): replace!filter.disabled && filter.value !== nullwithfilter.effective.test/playwright/unit/data/StoreFilter.spec.mjs(or existingStoreunit spec):Store(autoInitRecords: false) with a calculated model field, an enabledfilterByfilter declaringfields: [' doubled']without avaluesoft-hydratesdoubledon raw items during bothstore.filter()andstore.isFilteredItem(rawItem).Contract Ledger
Neo.data.Store#filter(src/data/Store.mjs:732)Neo.collection.Filter#effective(src/collection/Filter.mjs:115-118)activeFiltersviaf => f.effectivedisabled: trueor nofilterByandvalue === null) are skippedsrc/data/Store.mjsNeo.data.Store#isFilteredItem(src/data/Store.mjs:1114)Neo.collection.Filter#effective(src/collection/Filter.mjs:115-118)if (filter.effective)src/data/Store.mjsDecision Record impact: none.
Acceptance Criteria
Store#filter(src/data/Store.mjs:732) selectsactiveFiltersusingf => f.effective.Store#isFilteredItem(src/data/Store.mjs:1114) gates per-item soft hydration usingif (filter.effective).Store(autoInitRecords: false) with a calculated model field soft-hydratesfieldsdeclared on afilterByfilter withvalue: nullin bothfilter()andisFilteredItem(rawItem).Out of Scope
Filter#effectiveorTreeStore#filter(covered by #19792 and #20258 / PR #20259).Avoided Traps
f.filterBy ? !f.disabled : (!f.disabled && f.value !== null)inline inStore.mjsinstead of delegating toFilter#effective.Related
Filter#effectiveandFilter#fields.TreeStore#filter.Live latest-open sweep: checked latest 20 open issues at 2026-11-03T19:24Z; no equivalent found (#20258 scopes
TreeStore#filteronly). A2A in-flight claim sweep: checkedlist_messages({ status: 'all', limit: 30 })at 2026-11-03T19:24Z; promotingMESSAGE:aa316289-880e-4cc4-86a3-afdf047f35f2with no competing claim. Memory Core rationale sweep:query_raw_memories(Store#filter Store#isFilteredItem Filter#effective filterBy without a value Turbo Mode autoInitRecords) andask_knowledge_base(type: 'ticket') returned #19792/#19643 context and no prior exclusion. Own-assignment sweep: checkedgh issue list --state open --assignee @me(#20264, #20260, #20258, #20256); #20258 is theTreeStoresibling.unowned-rationale: Claimed by @neo-gemini-julia for immediate execution.
Origin Session ID: 50cec9b3-cbdc-4b13-befe-10aaa76a14d1
Retrieval Hint: "Store#filter Store#isFilteredItem Filter#effective filterBy without value Turbo Mode soft hydration"