Skip to content

Commit 1ff3a8f

Browse files
os-warrenclaude
andauthored
fix(spec): state the row-cap guard ElementDataSourceGate implements, and record where the per-kind view limit actually lands (#19228) (#19533)
Part of #19228 Clause-②: no ## ⚠️ Read this first — the card's causal claim did not reproduce #19228 says an APPLIED `.default(100)` makes the react tier's 「fills it only when unset」 arm **structurally unreachable**. Measured end to end at the objectui pin this repo builds against (`.objectui-sha` = `87af769e9`, 2026-09-21T06:30–06:40Z), **it does not**: - The arm's guard reads the **element-face** key — `readLimit(base, 'limit')` where `base` is the `object-kanban` / `object-timeline` node. That key is `.optional()` with **no** applied default, so an author's silence is still silence at parse time. - The applied default `#19226` added sits on the **view-face** per-kind blocks (`GalleryConfigSchema` / `KanbanConfigSchema` / `TimelineConfigSchema`). Different schemas. - Nothing carries the view-face default across: `composed.limit = config.limit ?? savedViewLimit(view)`, and `savedViewLimit` reads `view.pagination.pageSize`, else a **flat** `limit` on the runtime saved-view RECORD — `ElementSavedView` is an untyped string-keyed record from the adapter's own `listViews()` (`core/src/data-scope/element-data-source.ts:96`, fallback at `:237-241`), ⛔ NOT a document `ListViewSchema` accepts: a flat `limit` on a view document is refused `unrecognized_keys`. A third face, named here so it is not read as the author face — and never a per-kind block. `ListView`'s `baseProps` (`plugin-list/src/ListView.tsx:2840-2865`) carries no `limit` on any branch. ⛔ So no `.default()` moves in this PR, and **no precedence is picked** — both fences the dispatch set hold. What DID measure as a real 说明书脱节 is a different, smaller thing, and that is what is repaired. ## What is repaired **1. The describe's 「only when unset」 is right for its face — and now names the face.** The branch is `if (!fromView || !isUsableRowLimit(authored))` (`react/src/element-data-source/ElementDataSourceGate.tsx:316-331`). ⚠️ **RETRACTED — rounds 1 and 3 both got this backwards, and round 4 measured it.** On THIS face the displacement arm is unreachable: the key is `z.number().int().positive().optional()` and the gate's `isUsableRowLimit` admits integers above zero, so every value the contract accepts is usable and the 「set but not usable」 cell is EMPTY (measured per value: 1 / 25 / 100 / 5000 accepted and usable; 0 / -1 / 2.5 / `'100'` / null refused by both). ⇒ 「fills this key only when it is unset」 — which round 1 retired as too narrow — was never too narrow; it was right for its face, and is restored. The view half is `pagination.pageSize` ALONE on this face, per the bullet above. The describe states the rule that is reachable from the accept set; the unreachable arm is recorded in the docblock, ⛔ not in author prose. **2. The per-kind view `limit` is recorded as WHERE IT LANDS.** ⚠️ An earlier revision of this section said 「read by nobody」; that was measured with an instrument blind to spreads and is retracted — see the CORRECTION sections below. Kanban and timeline DO read it; gallery alone does not. Two instruments, because the first one's answer was wrong. PROPERTY-ACCESS over all 8,228 files tracked at the pin — probe `\.(kanban|gallery|timeline)(\?)?\.limit\b` → 0 lines; control `\.(kanban|gallery|timeline)(\?)?\.(groupByField|scale|coverField)\b` → 13 lines across 6 files. ⚠️ That zero is WRONG as a claim about readers: a spread carries the key without spelling it. SPREADS, by the predicate 「a spread whose target is the object literal an adapter returns as the node」, return four, and they overturn it. Recorded in two places, on two different faces: on `rowLimitKey` in `view.zod.ts` (the VIEW face — flattened onto the node and read, on both routes for kanban, on the plugin-view route for timeline, and read by nobody for gallery), and on the `object-timeline` door in `component.zod.ts` (the ELEMENT face — a node's own nested `timeline.limit`, which is the one read on no route at all). ⛔ Recorded, not repaired: what should read it is the card's open half. **3. `ObjectTimelinePropsSchema` carries two authorable row caps on one strictObject.** Taking `TimelineConfigSchema` by reference imported #19226's `limit` beside the flat `limit`. The published member list for that door omitted the new key; it now names it and says it is inert here. The stale `limit` read anchor (`:234`, `:254`, at the old pin `53ded82b`) is corrected to `:407` at the current pin; ⛔ the other anchors in that list are NOT swept — they remain the `53ded82b` readings the docblock header names, and the note says so. ## The three relayed consumer readings, reproduced first-hand Comment 5747444798 marked these 「复核的读数,⛔ 本席未复现」. All three reproduce **by shape**; two of the three file:line pairs are wrong at this pin, which is why shape was the instrument. | relayed | reproduced at pin `87af769e9` | |:--|:--| | `ListView.tsx:2493` forwards the timeline block nested | ✓ shape — the nested forward is `:3084` inside `case 'timeline':` (`:3062-3117`). `:2493` is a `useMemo` dependency array here (`:2496`). Only `startDateField` / `endDateField` / `titleField` / `groupByField` / `colorField` / `scale` are hoisted flat; `limit` is not | | `ObjectTimeline.tsx:234` reads only the flat `schema.limit` | ✓ shape — the one `$top` is `:407`, `resolveRowLimit(schema.limit, DEFAULT_TIMELINE_LIMIT)`; also `:279` / `:281` / `:442`. No nested read anywhere | | nothing reads `timeline.limit` | ⚠️ RETRACTED — ✓ **0** on that instrument, but see the CORRECTION sections: four flat spreads land the key where kanban/timeline read it | **The zero's instrument and its reach radius.** `git grep` over the 8,228 files tracked at commit `87af769e9` — a literal text search of property-access spellings. Lit control on the identical receiver alternation (`schema.timeline` / `timelineConfig` / `resolvedTimeline` / `mergedTimeline` / `tCfg`): `.startDateField` → **7** hits, `.limit` → **0**. ⚠️ A first attempt at this probe returned 0 for the control too — a broken bracket expression — and is recorded here because a dead instrument and a clean result are indistinguishable without one. **One known target deliberately outside the radius:** a computed read (`cfg[key]` with `key` from a variable) or a wholesale spread of the config into a query builder is invisible to a text search. ⚠️ **CORRECTION (seat, after the at-tier review at head `85ad2898`).** That hole was named and then closed by ASSERTION rather than by an instrument, and the assertion was false. A spread carries a key without ever spelling it, so this radius owed a SECOND instrument with its own lit control; it was not built. Built afterwards, it returns **four** flat spreads, not one: `ListView.tsx:2979` and `ObjectView.tsx:1638` (`...restKanban`), `ObjectView.tsx:1697` (`...(viewOptions.gallery || {})`) and `ObjectView.tsx:1725` (`...(viewOptions.timeline || {})`). Neither `restKanban` destructure strips `limit`. ⭐ Naming a limitation is not discharging it. Also outside the radius: untracked build output, and objectui **HEAD** rather than the pin. ## Verification - `pnpm --filter @objectstack/spec build && typecheck && test` — **509 files / 14,890 tests pass** (post-merge run on this head). - Consumer package: **`@objectstack/lint`** — the only package outside `packages/spec` naming any of the touched symbols (in a comment, not a runtime read; lit control: `ListViewSchema` / `PageComponentSchema` fire across 8+ files, so the instrument discriminates). Its first run was a `Failed to resolve entry` cascade from unbuilt workspace deps; after `pnpm --filter '@objectstack/lint^...' build` it reads **106 files / 4,034 tests pass, 5 skipped**. - `pnpm --filter @objectstack/spec check:generated` — **all 15 generated artifacts up to date** (`content/docs/references/ui/component.mdx` regenerated via `--fix`; three table rows changed in `component.mdx` and nine in `view.mdx`, nothing else). - `pnpm lint` (repo-wide `eslint . --no-inline-config`) — **exit 0**, the whole union, no narrowing. - `check:react-declaration-parity` run exactly as `lint.yml` runs it (`MANIFEST="$PWD/sdui.manifest.json" … --baseline react-declaration-parity.baseline.json --strict`) — **exit 0**, no new declaration divergence. ⚠️ Run WITHOUT the baseline it exits 1 on 126 pre-existing divergences; that invocation is not the gate. - Derived gate families (`scripts/pm/dispatch-gates.mjs --commands`, reconciled with `--ran`): **108 derived, 100 measured green, 8 NOT MEASURED** — every one of the 8 a `PREREQUISITE NOT MET` exit **3** (unbuilt sibling packages; `check-plugin-teardown-shape --self-test` needs an unshallow clone). ⛔ Reported as what they are, never as a pass. None of the 8 reads `packages/spec/src/ui/`. - `origin/main` merged through `scripts/pm/os-regen-merge.sh`; no regeneration debt, and main's newest entry (`filter-between-field-reference-endpoint-refused`) survives at the same 2-file count on both sides. ## ⛔ Refused / not done - ⛔ **No precedence picked.** Which of the per-kind view `limit`, a view's `pagination.pageSize` and a component's flat `limit` wins is untouched, in prose and in code. - ⛔ **`.default(100)` not moved, demoted or removed** on any of the three view configs. - ⛔ **Nothing written in objectui** — read-only at the pin, as dispatched. - ⛔ The 14 other read anchors in the `object-timeline` docblock were NOT re-swept at the current pin. ## Acceptance notes - ⚠️ **File-surface deviation, declared.** The claim's declared surface named `packages/spec/src/ui/component.zod.ts`. Two files fall outside it: `packages/spec/src/ui/view.zod.ts` (the applied default the card is about lives in `rowLimitKey` **there**, not in `component.zod.ts` — the claim and the dispatch were both written against a stale location) and `content/docs/references/ui/component.mdx` (the mandatory regeneration from a `.describe()` change; `check:docs` reds without it — the claim anticipated regeneration but named `packages/spec/json-schema/`, which this diff leaves untouched). Both are inside the seat's measured serial-constraint clearance: zero open PRs hold any path under `packages/spec/src/ui/`. - ⚠️ **`Part of`, not `Fixes`.** This PR delivers the 说明书 half triage queued; the card's own two contract questions stay open, so line 1 is deliberately `Part of #19228` and merging this does not close the card. - noted, not filed: the `object-timeline` docblock header claims every read anchor was taken at pin `53ded82b` while `.objectui-sha` is `87af769e9`; only the `limit` anchor is re-read here. Carrier: a future `object-timeline` card, or the seat that next re-pins that block. - noted, not filed: #17393's own pin text argues an authorable ceiling on the non-grid four 「would be surface no renderer reads」 — the measurement above says the ceiling it DID add is exactly that. The pin is still correct about the four; the irony is a reading, not a defect. ## ⚠️ CORRECTION — the per-kind view `limit` is NOT inert Seat, after the at-tier review at head `85ad2898`, re-measured first-hand at the pin. This PR's earlier claim of zero read points was taken with an instrument blind to spreads. Four flat spreads carry the key onto the generated node (`ListView.tsx:2979`, `ObjectView.tsx:1638` / `:1697` / `:1725`), and `ObjectKanban.tsx` / `ObjectTimeline.tsx` read the resulting flat `limit`. ⛔ **ADR-0049 enforce-or-remove is therefore NOT a live option for kanban or timeline** — retiring that key would break two adapters that actively forward it. It IS the honest reading for **gallery alone**, whose renderer contains no `limit` at all (0 occurrences, against a lit control that fires on the same file). ⚠️ One distinction this correction itself owes: the `$top` those keys would govern is not issued on either route today, because both hosts hand the child its rows as a `data` prop and the child short-circuits its own fetch. So 「governs no query on these two routes」 is true; 「read by nobody」 is not. ⭐ For the decision box: through those same spreads an APPLIED default puts an authored-LOOKING flat `limit: 100` on every node built from a spec-parsed view — a value no author wrote. ## Cross-repo, ⛔ not acted on objectui#7390's acceptance face is where this gets consumed. ⚠️ Corrected: kanban and timeline have a read point today; **gallery** is the one that owes one. Stated here for the seat to file in objectui's queue with a `Blocked-by:` line; ⛔ nothing was written there. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 31184e5 commit 1ff3a8f

6 files changed

Lines changed: 402 additions & 26 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
fix(spec): state the row-cap guard `ElementDataSourceGate` implements, and record where the per-kind view `limit` actually lands (#19228)
6+
7+
Prose and pins only — zero accept-set movement, zero export movement. The same documents parse
8+
to the same values before and after. ⛔ No `.default()` moves, ⛔ no precedence is picked: which
9+
of the per-kind view `limit`, a view's `pagination.pageSize` and a component's flat `limit`
10+
should win is the open half of #19228 and is not answered here.
11+
12+
## What the published text said, and what an author can actually reach
13+
14+
`ObjectKanbanPropsSchema.limit` tells authors that a bound view's `pagination.pageSize` fills it
15+
「only when unset」. Measured first-hand at the objectui pin this repo builds against
16+
(`.objectui-sha` = `87af769e9`), that sentence is exactly right for this face, and the describe
17+
now says WHY rather than leaving it to look narrower than the mechanism.
18+
19+
The gate's branch is `if (!fromView || !isUsableRowLimit(authored))`
20+
(`react/src/element-data-source/ElementDataSourceGate.tsx:316-331`), and `isUsableRowLimit` is
21+
`typeof v === 'number' && Number.isInteger(v) && v > 0` (`:192-194`). Every cap this key ACCEPTS
22+
is one that predicate already calls usable — the accept set is a subset of the usable set — so
23+
across the whole accept set the guard has exactly two outcomes and 「set but not usable」 is
24+
empty. The extra arm, a cap displaced and reported because it is zero, negative or fractional,
25+
is reachable only for a node this contract refuses, so it is recorded in the docblock rather
26+
than in an author-facing sentence.
27+
28+
The view half is `pagination.pageSize` ALONE on this face. `savedViewLimit` does fall back to a
29+
flat `view.limit` (`core/src/data-scope/element-data-source.ts:237-241`), but that names a
30+
saved-view RECORD as the adapter's `listViews()` returns it — a third face, not an authored view
31+
document. Measured on this tree: `ListViewSchema` REFUSES a flat `limit` with
32+
`unrecognized_keys: ["limit"]`, the verdict a bogus key gets, while the same minimal document
33+
parses with `pagination.pageSize: 50` and with a per-kind `kanban.limit: 50`. No view document
34+
declares a flat `limit` and none carries a tombstone for one.
35+
36+
## Where the per-kind VIEW `limit` lands
37+
38+
⚠️ Two different keys are easy to confuse here, so each statement names its face. The **view
39+
face** is a `ListViewSchema` document's `kanban` / `gallery` / `timeline` block — that is where
40+
this key lives. The **element face** is a page component node's own flat `limit`, declared in
41+
`component.zod.ts`, and that is the key every renderer actually reads. An adapter turns the
42+
first into the second.
43+
44+
The adapters spread a view's per-kind block FLAT onto the node they generate — `...restKanban`
45+
(`plugin-list/src/ListView.tsx:2979`, `plugin-view/src/ObjectView.tsx:1638`; neither destructure
46+
strips `limit`) and `...(viewOptions.gallery || {})` / `...(viewOptions.timeline || {})`
47+
(`ObjectView.tsx:1697` / `:1725`). So a view's `kanban.limit` — including the 100 the applied
48+
default materializes — becomes the node's flat `limit`, which `ObjectKanban.tsx:553` reads. A
49+
view's `timeline.limit` is route-dependent: `plugin-view` flattens it and `ObjectTimeline.tsx:279`
50+
reads it, while `plugin-list` forwards the block nested, where nothing does. A view's
51+
`gallery.limit` is flattened too and read by nobody — `ObjectGallery.tsx` contains no `limit` at
52+
all.
53+
54+
Where it is read, the `$top` it would govern is still not issued on either adapter route today,
55+
because both hosts hand rows down as a React `data` prop and both children short-circuit their
56+
own fetch; ⛔ that is a statement about the query, not about the key being unread.
57+
58+
⚠️ For authors of an `object-timeline` NODE: a `limit` written inside that node's own `timeline`
59+
block is read by no renderer on any route — the rail is capped by the flat `limit` beside it,
60+
which is also the only one a bound `dataSource` lowers into. Write the flat one.

‎content/docs/references/ui/component.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ Sort field and direction pair
617617
| **groupBy** | `string` | optional | Field whose values become the board columns |
618618
| **columns** | `any[]` | optional | Swimlane definitions (`{ id, title }` per `groupBy` value, or bare value strings) — NOT a field projection |
619619
| **filter** | `{ field: string; operator: Enum<'equals' \| 'not_equals' \| 'contains' \| 'not_contains' \| 'icontains' \| …>; value?: string \| number \| boolean \| null \| (string \| number)[] }[]` | optional | Base query filter, handed to the wire `$filter` — the ViewFilterRule array form `[{ field, operator, value }, ...]`, the one filter orthography every `filter` door in this map shares. The MongoDB-style record form is refused — see migration `element-data-source-and-object-block-filter-rule-array` |
620-
| **limit** | `integer` | optional | Maximum number of records loaded onto the board (row cap); lowered to the query's top-level `$top` (renderer default 100). The component-level `dataSource.limit` wins when both are set; a bound view's `pagination.pageSize` fills it only when unset |
620+
| **limit** | `integer` | optional | Maximum number of records loaded onto the board (row cap); lowered to the query's top-level `$top` (renderer default 100). The component-level `dataSource.limit` wins when both are set; a bound view's `pagination.pageSize` fills this key only when it is unset — and on this face unset is the whole rule, because every cap this key accepts is one the binding gate already treats as authored |
621621
| **data** | `any[]` | optional | Static inline cards — bypasses the object query |
622622
| **cardTitle** | `string` | optional | Field rendered as each card title |
623623
| **titleField** | `string` | optional | Legacy fallback for `cardTitle` (the board reads `cardTitle \|\| titleField`). Prefer `cardTitle` |
@@ -803,7 +803,7 @@ View filter rule
803803
| Property | Type | Required | Description |
804804
| :--- | :--- | :--- | :--- |
805805
| **objectName** | `string` | optional | Object this timeline binds to. Optional because the component-level `dataSource` binding can supply the object instead — this block registers through `ElementDataSourceGate`, which lowers the binding onto this key before the renderer sees the node |
806-
| **timeline** | `{ startDateField: string; endDateField?: string; titleField: string; groupByField?: string; … }` | optional | Timeline configuration, the author face — the same block `ListViewSchema.timeline` declares: `{ startDateField, endDateField, titleField, groupByField, colorField, scale }`. The flat top-level spellings beside it are the runtime handoff, not a second authoring spelling |
806+
| **timeline** | `{ startDateField: string; endDateField?: string; titleField: string; groupByField?: string; … }` | optional | Timeline configuration, the author face — the same block `ListViewSchema.timeline` declares: `{ startDateField, endDateField, titleField, groupByField, colorField, scale, limit }`. The flat top-level spellings beside it are the runtime handoff, not a second authoring spelling. ⚠️ `limit` is the one member of this block NO renderer reads on any route: the rail is capped by the FLAT `limit` beside this key, which is also the only one a bound `dataSource` lowers into. A `limit` written inside this block is accepted, defaulted to 100, and never read |
807807
| **filter** | `{ field: string; operator: Enum<'equals' \| 'not_equals' \| 'contains' \| 'not_contains' \| 'icontains' \| …>; value?: string \| number \| boolean \| null \| (string \| number)[] }[]` | optional | Base query filter — the ViewFilterRule array form `[{ field, operator, value }, ...]`, the one filter orthography every `filter` door in this map shares; lowered to the wire `$filter`. The MongoDB-style record form is refused — see migration `element-data-source-and-object-block-filter-rule-array` |
808808
| **sort** | `{ field: string; order: Enum<'asc' \| 'desc'> }[]` | optional | Row order for the fetched entries — the SortItem array form `[{ field, order }, ...]`, the one sort orthography every declared `sort` door on this platform shares; lowered to the wire `$orderby`. The legacy string clause (`name desc`) is refused — see migration `object-block-sort-item-array` |
809809
| **limit** | `integer` | optional | Maximum number of records loaded onto the rail (row cap); lowered to the query's top-level `$top` (renderer default 100). A timeline renders one rail with no pagination control, so this is the author's window rather than a page size |
@@ -828,7 +828,7 @@ View filter rule
828828
| **groupByField** | `string` | optional | Field to group timeline rows. NO leading or trailing whitespace: the renderer reads this name off every row verbatim, so a padded spelling drops every row into one ungrouped band. |
829829
| **colorField** | `string` | optional | Field to derive each item color from (it names a field, not a color): the option color declared on that field for the record value, else the value itself when it already is a color literal (hex, rgb() or hsl()), else the timeline default marker color |
830830
| **scale** | `Enum<'hour' \| 'day' \| 'week' \| 'month' \| 'quarter' \| 'year'>` | optional (default: `"week"`) | Default timeline scale |
831-
| **limit** | `integer` | optional (default: `100`) | Row ceiling — the most rows the timeline fetches onto its rail, sent as the query `$top`; default 100 when the key is absent. When the ceiling APPLIES (the filtered set is larger than it), the renderer must show a visible truncation signal saying what is on screen is not the whole set — a bounded view that looks complete is worse than an unbounded one. |
831+
| **limit** | `integer` | optional (default: `100`) | Row ceiling — the most rows the timeline fetches onto its rail; default 100 when the key is absent. The renderer owes two things: bound its fetch at this number, and, when the ceiling APPLIES (the filtered set is larger than it), show a visible truncation signal saying what is on screen is not the whole set — a bounded view that looks complete is worse than an unbounded one. ⚠️ Not every view kind has a renderer that reads this key yet; which do is recorded on the declaration. |
832832

833833
### Nested Shape: `ObjectTimelineProps.filter[number]`
834834

0 commit comments

Comments
 (0)