[SUPERSEDED 2026-10-02 — do not pick up as written.] Section 1's edgeDemand protocol is superseded by the shipped scrollEdge event and its consumers (#19357, #19364; Institution #420 / #434 / #459). Section 2's Store append commit is the surviving substance and is being extracted into its own bounded leaf (Sophie's current-source fork, 2026-10-02; the two defects re-verified on dev 42b80fee, Store blob a025804e). This ticket closes with a salvage map once that leaf has a number.
Context
Operator direction on the Institution pane design arc (neomjs/neo-agent-institution#20, 2026-08-28): paging chrome ("newer/older", prev/next, "more") must not exist on surfaces whose destination is a buffered primitive — the surface scrolls, and loads fold in at the scroll edge. The design sketches promise that behavior; the engine carries the buffered windows and the streamed adds, but not the seam that lets a view ask for more.
Repaired in place on 2026-09-01 after the intake handback (comment): the consumer story and the Store append contract below are re-anchored on current source.
The Problem
Two engine surfaces know how much of a corpus is rendered, and neither can express demand for the rest:
src/grid/Body.mjs owns the buffered window (mountedRows, visibleRows, startIndex_, availableRows, bufferRowRange_) over the locally loaded collection; src/grid/ScrollManager.mjs owns the scroll truth (onContainerScroll, the 150ms-buffered onScrollEnd). src/list/Buffered.mjs owns the same window math for component lists. None of them fires a signal when the window approaches the end of what is loaded — the view windows beautifully over an incomplete corpus and simply ends.
src/data/Store.mjs#load() carries currentPage_, pageSize_, totalCount and an opts.append flag, but append is not one coherent contract yet (verified at dev@0659b0e42d): the flag is honored only in the Pipeline branch's clear (if (me.items.length > 0 && !opts.append) me.clear()); a non-streaming Pipeline response is added only when me.count === 0, so a populated append swallows the page it fetched; the API branch assigns me.data = … and replaces regardless of append; currentPage never advances on a successful read (load() only reads it into params); and isLoading is cleared on the first streamed chunk inside onData for progressive rendering, while the read stays open — that flag cannot certify a single in-flight acquisition.
The Institution consumers this ticket was first written against no longer page through a remote Store at all: the mailbox pane (view/fleet/mailbox/Container.mjs) and the memories pane (view/fleet/memories/Container.mjs) hold URL-less local projection stores, acquire windows through pane-owned intents (pageRequest {offset}, memoriesRequest {agentIdentity, offset}) served by the cockpit's producers, and run a drainArmed chain that requests the next window on every received snapshot while the producer reports hasMore / count < total. That is an eager full-corpus drain at the pane's own pace — no chrome, but also no bound: every corpus is pulled to its end whether or not anyone scrolls toward it.
The Architectural Reality
Views own scroll truth; acquisition owns transport. The buffered primitives know the rendered edge but must not know how the rest is fetched (Store page, pane intent, streamed producer). The seam therefore has to be an acquisition-neutral event: the view names what is missing, the consumer decides how to get it.
grid.Body and list.Buffered already compute the last mounted index on every window move (updateMountedAndVisibleRows / the buffered-list equivalent) — the edge test is one comparison against the bound collection's count, in code that already runs per scroll settle.
Store#load({append}) is the natural optional adapter for remote-Store consumers: one call per demand, committed as one page. Its current three inconsistencies (swallowed non-streaming page, replacing API branch, non-advancing currentPage) are Store defects independent of the view seam and are fixed under this ticket so the adapter can exist; the view contract must not depend on them.
Remote sort/filter/reload already reset _currentPage = 1 (Store.mjs:360, :384, :411, :1148, :1515) and clear — correct for an appended corpus: invalidation restarts from page 1, and a cleared collection re-arms the view.
The Fix
1. The view contract — edgeDemand, acquisition-neutral
grid.Body and list.Buffered gain one opt-in config, edgeDemandRange_ (rows; 0 = off, default off), and one event:
Fire: when, after a window move, lastMountedIndex >= count - edgeDemandRange and count > 0, the view fires edgeDemand {edge: 'end', count, index: lastMountedIndex, demandId, source} — exactly once per crossing.
Single flight: a view holds at most one open demand (openEdgeDemand); while it is open, no second edgeDemand fires, whatever the scroll does. The fence is the view's own — it never reads store.isLoading.
Fulfillment: the demand closes when the bound collection's count grows past demand.count (any transport), or when the consumer calls settleEdgeDemand(demandId, {exhausted}). A grown count re-arms the threshold against the new count; if the appended page is smaller than the range the next crossing may fire immediately — bounded by single flight, never by a timer.
Retry: a settled-but-unfulfilled demand (refusal, error, {exhausted: false} with no growth) re-arms on the next threshold crossing — the user's scroll is the retry; the view never retries on its own clock.
Honest end:settleEdgeDemand(demandId, {exhausted: true}) silences the edge until the collection is cleared or replaced (which resets exhausted and re-arms). The view holds no notion of totalCount — the consumer, who owns the transport, declares the end.
Default: with edgeDemandRange off, both views are byte-identical to today.
2. The optional Store adapter — one coherent append commit
Neo.data.Store#load({append: true, params: {page}}) becomes a commit, consistent across paths:
never clears; the page's records are added exactly once — streamed Pipeline chunks progressively (as today), a non-streaming Pipeline response regardless of count (the count === 0 guard becomes !opts.append || streamed), and the API branch appends instead of assigning data;
on success currentPage advances to the committed page (_currentPage = params.page, silent), totalCount updates, and the load event carries append: true; on rejection nothing moves — count, currentPage, totalCount stay byte-identical;
isLoading keeps its progressive-rendering meaning and is not the single-flight fence (the view's demand is).
A grid or list bound to a remote Store then needs one listener: edgeDemand → store.load({append: true, params: {page: store.currentPage + 1}}) → settle {exhausted: store.count >= store.totalCount}. That listener is the adapter, shipped as the example wiring, not as view behavior.
3. The Institution prescription — bounded acquisition replaces eager drains
The mailbox and memories panes keep their intents and producers and drop the drainArmed chains: the pane listens to its grid's edgeDemand, fires exactly the next window (pageRequest {offset: count} / memoriesRequest {offset: count}), and settles the demand from the envelope (hasMore: false / count >= total → exhausted). The corpus then assembles only as far as someone scrolls, one bounded window per crossing, with the same honest end. The adoption lives in neomjs/neo-agent-institution under #24's primitive map (mailbox / memories / catch-up → grid.Container); that leaf is the product witness, this ticket's ACs are engine-only.
Contract Ledger
Target surface
Source of authority
Proposed behavior
Fallback / failure surface
Docs
Evidence
edgeDemand event on grid.Body / list.Buffered
new, view-owned; edgeDemandRange_ opt-in
fires once per threshold crossing while no demand is open; carries {edge, count, index, demandId, source}
off by default (byte-identical); no listener → the demand stays open until the collection changes; refusal/error re-arms on the next crossing
class JSDoc
unit: threshold, single flight, re-arm on growth, re-arm on crossing after refusal; component: real scroll crossing on a bound store
settleEdgeDemand(demandId, {exhausted})
view method
closes the open demand; exhausted: true silences the edge until clear/replace
unknown demandId → ignored, returns false
class JSDoc
unit: exhausted silence + re-arm on clear
Store#load({append: true}) commit
src/data/Store.mjs#load (Pipeline + API branches)
one page committed once; currentPage advances on success; streamed and non-streaming Pipeline results and the API path all append
unit: append after a populated store (streamed + non-streamed + API), currentPage advance, reset on remote sort/filter
Institution mailbox / memories acquisition
neomjs/neo-agent-institution#24 primitive map
drainArmed chains replaced by edgeDemand-driven bounded windows
producer intents unchanged
pane JSDoc
live receipt on the adoption leaf (residual owner)
Decision Record impact
None — applies the existing buffered-window primitives and Store paging contracts; no topology or ADR change.
Acceptance Criteria
grid.Body and list.Buffered fire edgeDemand once per threshold crossing when edgeDemandRange is set, and never while a demand is open (unit: crossing, single flight, re-arm after growth, re-arm on the next crossing after a refusal).
settleEdgeDemand(id, {exhausted: true}) silences the edge; a clear/replace of the collection re-arms it (unit).
Store#load({append: true}) commits one page exactly once on the streamed Pipeline, the non-streaming Pipeline and the API path, advancing currentPage only on success; a rejected read moves nothing (unit, mutation control on the count === 0 guard).
A buffered grid bound to a remote store with totalCount > pageSize and the example adapter reaches the full corpus by scrolling alone, then goes silent at the end — zero paging chrome (component, real scroll).
Remote sort/filter/reload over an appended corpus resets to page 1 with a cleared collection and a re-armed edge (unit).
With edgeDemandRange unset, existing buffered views and every existing load() caller behave byte-identically (the full grid/list/data suites stay green).
Out of Scope
The Institution pane adoption (the #24 leaf; product witness, residual owner).
Backward paging into evicted pages and eviction under memory pressure.
Store-side auto-magic: the store never fires demands; views opt in.
A totalCount-aware view: totals stay with the transport owner.
Avoided Traps
Gating single flight on store.isLoading — it is cleared on the first streamed chunk by design (progressive rendering) and cannot fence an open read.
Letting the view read totalCount — that binds the view to the Store transport; the panes that motivated this ticket have no remote Store at all.
Timer-based retry — a refused acquisition that re-fires on a clock turns a broken producer into a polling loop; the next scroll is the honest retry.
Keeping the eager drain and adding the seam beside it — two acquisition paths on one pane is the drift class #24 exists to remove.
Context
Operator direction on the Institution pane design arc (neomjs/neo-agent-institution#20, 2026-08-28): paging chrome ("newer/older", prev/next, "more") must not exist on surfaces whose destination is a buffered primitive — the surface scrolls, and loads fold in at the scroll edge. The design sketches promise that behavior; the engine carries the buffered windows and the streamed adds, but not the seam that lets a view ask for more.
Repaired in place on 2026-09-01 after the intake handback (comment): the consumer story and the Store append contract below are re-anchored on current source.
The Problem
Two engine surfaces know how much of a corpus is rendered, and neither can express demand for the rest:
src/grid/Body.mjsowns the buffered window (mountedRows,visibleRows,startIndex_,availableRows,bufferRowRange_) over the locally loaded collection;src/grid/ScrollManager.mjsowns the scroll truth (onContainerScroll, the 150ms-bufferedonScrollEnd).src/list/Buffered.mjsowns the same window math for component lists. None of them fires a signal when the window approaches the end of what is loaded — the view windows beautifully over an incomplete corpus and simply ends.src/data/Store.mjs#load()carriescurrentPage_,pageSize_,totalCountand anopts.appendflag, but append is not one coherent contract yet (verified atdev@0659b0e42d): the flag is honored only in the Pipeline branch's clear (if (me.items.length > 0 && !opts.append) me.clear()); a non-streaming Pipeline response is added only whenme.count === 0, so a populated append swallows the page it fetched; the API branch assignsme.data = …and replaces regardless ofappend;currentPagenever advances on a successful read (load()only reads it intoparams); andisLoadingis cleared on the first streamed chunk insideonDatafor progressive rendering, while the read stays open — that flag cannot certify a single in-flight acquisition.The Institution consumers this ticket was first written against no longer page through a remote Store at all: the mailbox pane (
view/fleet/mailbox/Container.mjs) and the memories pane (view/fleet/memories/Container.mjs) hold URL-less local projection stores, acquire windows through pane-owned intents (pageRequest {offset},memoriesRequest {agentIdentity, offset}) served by the cockpit's producers, and run adrainArmedchain that requests the next window on every received snapshot while the producer reportshasMore/count < total. That is an eager full-corpus drain at the pane's own pace — no chrome, but also no bound: every corpus is pulled to its end whether or not anyone scrolls toward it.The Architectural Reality
grid.Bodyandlist.Bufferedalready compute the last mounted index on every window move (updateMountedAndVisibleRows/ the buffered-list equivalent) — the edge test is one comparison against the bound collection's count, in code that already runs per scroll settle.Store#load({append})is the natural optional adapter for remote-Store consumers: one call per demand, committed as one page. Its current three inconsistencies (swallowed non-streaming page, replacing API branch, non-advancingcurrentPage) are Store defects independent of the view seam and are fixed under this ticket so the adapter can exist; the view contract must not depend on them._currentPage = 1(Store.mjs:360,:384,:411,:1148,:1515) and clear — correct for an appended corpus: invalidation restarts from page 1, and a cleared collection re-arms the view.The Fix
1. The view contract —
edgeDemand, acquisition-neutralgrid.Bodyandlist.Bufferedgain one opt-in config,edgeDemandRange_(rows;0= off, default off), and one event:lastMountedIndex >= count - edgeDemandRangeandcount > 0, the view firesedgeDemand {edge: 'end', count, index: lastMountedIndex, demandId, source}— exactly once per crossing.openEdgeDemand); while it is open, no secondedgeDemandfires, whatever the scroll does. The fence is the view's own — it never readsstore.isLoading.demand.count(any transport), or when the consumer callssettleEdgeDemand(demandId, {exhausted}). A grown count re-arms the threshold against the new count; if the appended page is smaller than the range the next crossing may fire immediately — bounded by single flight, never by a timer.{exhausted: false}with no growth) re-arms on the next threshold crossing — the user's scroll is the retry; the view never retries on its own clock.settleEdgeDemand(demandId, {exhausted: true})silences the edge until the collection is cleared or replaced (which resetsexhaustedand re-arms). The view holds no notion oftotalCount— the consumer, who owns the transport, declares the end.edgeDemandRangeoff, both views are byte-identical to today.2. The optional Store adapter — one coherent append commit
Neo.data.Store#load({append: true, params: {page}})becomes a commit, consistent across paths:count(thecount === 0guard becomes!opts.append || streamed), and the API branch appends instead of assigningdata;currentPageadvances to the committed page (_currentPage = params.page, silent),totalCountupdates, and theloadevent carriesappend: true; on rejection nothing moves — count,currentPage,totalCountstay byte-identical;isLoadingkeeps its progressive-rendering meaning and is not the single-flight fence (the view's demand is).A grid or list bound to a remote Store then needs one listener:
edgeDemand→store.load({append: true, params: {page: store.currentPage + 1}})→ settle{exhausted: store.count >= store.totalCount}. That listener is the adapter, shipped as the example wiring, not as view behavior.3. The Institution prescription — bounded acquisition replaces eager drains
The mailbox and memories panes keep their intents and producers and drop the
drainArmedchains: the pane listens to its grid'sedgeDemand, fires exactly the next window (pageRequest {offset: count}/memoriesRequest {offset: count}), and settles the demand from the envelope (hasMore: false/count >= total→exhausted). The corpus then assembles only as far as someone scrolls, one bounded window per crossing, with the same honest end. The adoption lives in neomjs/neo-agent-institution under #24's primitive map (mailbox / memories / catch-up →grid.Container); that leaf is the product witness, this ticket's ACs are engine-only.Contract Ledger
edgeDemandevent ongrid.Body/list.BufferededgeDemandRange_opt-in{edge, count, index, demandId, source}settleEdgeDemand(demandId, {exhausted})exhausted: truesilences the edge until clear/replacedemandId→ ignored, returnsfalseStore#load({append: true})commitsrc/data/Store.mjs#load(Pipeline + API branches)currentPageadvances on success; streamed and non-streaming Pipeline results and the API path all appendcurrentPage/totalCountuntouchedcurrentPageadvance, reset on remote sort/filterdrainArmedchains replaced byedgeDemand-driven bounded windowsDecision Record impact
None — applies the existing buffered-window primitives and Store paging contracts; no topology or ADR change.
Acceptance Criteria
grid.Bodyandlist.BufferedfireedgeDemandonce per threshold crossing whenedgeDemandRangeis set, and never while a demand is open (unit: crossing, single flight, re-arm after growth, re-arm on the next crossing after a refusal).settleEdgeDemand(id, {exhausted: true})silences the edge; a clear/replace of the collection re-arms it (unit).Store#load({append: true})commits one page exactly once on the streamed Pipeline, the non-streaming Pipeline and the API path, advancingcurrentPageonly on success; a rejected read moves nothing (unit, mutation control on thecount === 0guard).totalCount > pageSizeand the example adapter reaches the full corpus by scrolling alone, then goes silent at the end — zero paging chrome (component, real scroll).edgeDemandRangeunset, existing buffered views and every existingload()caller behave byte-identically (the full grid/list/data suites stay green).Out of Scope
totalCount-aware view: totals stay with the transport owner.Avoided Traps
store.isLoading— it is cleared on the first streamed chunk by design (progressive rendering) and cannot fence an open read.totalCount— that binds the view to the Store transport; the panes that motivated this ticket have no remote Store at all.Related
neomjs/neo-agent-institution#20 (pane information design — scroll-only sketches) · neomjs/neo-agent-institution#24 (primitive map: mailbox / memories / catch-up →
grid.Container; the adoption coordinate).Origin Session ID: 4f07d934-f43f-4406-98a0-9562e122e471 · repair session 8c42ad77-48b0-448a-992a-219df09cd4c6
Retrieval Hint:
query_raw_memories("edgeDemand acquisition-neutral scroll-edge buffered grid list Store append commit eager drain")Authored by Clio (Fable 5, Claude Code); repaired by Clio (Fable 5.1, Claude Code).