Skip to content

Commit d089dac

Browse files
docs(spec): the record-page timeline total is an upper bound of the drawn 动态 entries (#29120)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb9gurNw6gZxbtcW3PW4QG67)_ Fixes #28998 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:记录页 `timeline` 计数的文档注释改为说明总数统计的是各来源表定义的行数,是「动态」面板实际绘制条目数的上界,并点名两种少画的情形;API 参考页同步重新生成。 - **为什么改**:总监对 PR #28991 的契约复核记录 6570231752 的 ④-1 指出原注释读起来像「面板画出的条目数」,而面板会因 `showCompleted` / `types` 配置与无可显示差异的台账行少画。 - **风险与回滚**:仅注释与生成文档,不动 schema 形状、`.describe()` 文本与运行时行为;回滚即 revert 本 PR。 - **先看**:`packages/spec/src/api/record-page.zod.ts`(`RecordPageTimelineRequestSchema` 注释与文件头 `timeline` 句)、`content/docs/references/api/record-page.mdx`(生成结果)、`.changeset/28998-timeline-count-upper-bound.md`。 - **两分钟验证**:`pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated`,预期 All 14 generated artifacts are up to date。 - **需要你做的**:无,席位落地。 ## What changes - `packages/spec/src/api/record-page.zod.ts`, comments only: - the `RecordPageTimelineRequestSchema` docblock: "The total is their sum" now goes on to say the total counts the sources' rows as the table defines them, so it is an upper bound of the entries the 动态 panel draws, not their number, and names the two cases where the panel draws fewer (its `showCompleted` / `types` configuration, and a ledger row with no displayable diff); - the file header's `timeline` sentence carries the same statement. The API reference page is generated from that header, so this is how the sentence reaches the mdx (Wanted 2). - `content/docs/references/api/record-page.mdx`: regenerated by `pnpm --filter @objectstack/spec gen:docs`, the one artefact `check:generated` named stale. It is not hand-edited. - `.changeset/28998-timeline-count-upper-bound.md`: `@objectstack/spec: patch`. The docblock ships in the published `dist/api/index.d.ts` / `.d.mts` (and in `src/**/*.zod.ts`, both in the package's `files`), so the published bytes move. No `.describe()` string, schema shape or behaviour changes. ## Tests No behaviour changed, so there is no new test and no ablation. <details><summary>spec typecheck + api tests (at 36952b4, before the main merge)</summary> `pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/api` under the verify lock: VERDICT command-exit 0, Test Files 59 passed (59), Tests 1804 passed (1804). The rest of the spec suite is left to CI's Test Core. </details> ## Acceptance notes - **Deviation from the claimed surface, declared.** The claim names the `RecordPageTimelineRequestSchema` docblock as the one comment in `record-page.zod.ts`. `content/docs/references/` is generated (AGENTS.md, Documentation Guardrails) and the build does not render a schema's own docblock, only the file header. So the mirrored sentence in the mdx comes from the file header's `timeline` sentence, in the same file, comment only. - **Finding, not changed here: one `.describe()` string reads the same wrong way.** `RecordPageTimelineCountSchema.total` says "How many entries the record's timeline stream holds for this caller, over the sources the request named." It feeds the published JSON schema and the reference table (`RecordPageTimelineCount`, and `RecordPageResponse.timeline[option 1]`). Per the ruling it stays, and moving it owes a contract review. - **Finding, not changed here: the `RecordPageTimelineCountSchema` docblock** ("how many entries the record's 动态 stream holds") is the same misreading in a comment outside the claimed surface. ## Verification <details><summary>generated artefacts</summary> - Before regeneration: `check:generated` exit 1, "1 of 14 artifact(s) stale: content/docs/references/**". - After `gen:docs`: `check:generated` exit 0, "All 14 generated artifacts are up to date". - After merging main (c566f35): spec rebuilt under the lock, `check:generated` "All 14 generated artifacts are up to date"; the branch delta vs main is still these 3 files (+27 / -3). </details> <details><summary>dispatch-gates, at c566f35</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 97 commands. All were run on c566f35 with exit codes captured before any pipe. 96 exited 0. `pnpm check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET: 8 workspace packages have no `dist/`) and is NOT MEASURED locally; CI's Lint and Repo Gates runs it. `--ran` reconciliation: "97 derived famil(ies) accounted for — 96 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". The same 97 also ran on 36952b4 before the merge, with the same result. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jRs3fMDRLr3zkuDuVo)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0c0d3b6 commit d089dac

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the record-page `timeline` total is documented as an upper bound of the entries the 动态 panel draws
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `RecordPageTimelineRequestSchema` docblock, and the record-page file header that the API reference page is generated from, now say what the `timeline` total counts: the sources' rows as the schema's table defines them. That makes it an upper bound of the entries the 动态 panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. Prose only: no schema shape, `.describe()` text or behaviour changes.

‎content/docs/references/api/record-page.mdx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ and how many rows. Paging further, posting, reacting and uploading keep
4242
their own routes. [#28737] The `timeline` part is the size of the record's
4343
动态 stream — the comments, the activity and the field changes it merges —
4444
counted by those reads as the caller (`RecordPageTimelineRequestSchema`), so
45-
a page draws the stream's count without holding every row of it. Object permissions, row-level security, sharing and
45+
a page draws the stream's count without holding every row of it. The total
46+
counts the sources' rows as that schema's table defines them, so it is an
47+
upper bound of the entries the 动态 panel draws, not their number. The panel
48+
draws fewer where its `showCompleted` / `types` configuration filters entries
49+
out, and where a ledger row has no displayable diff and so draws no entry.
50+
Object permissions, row-level security, sharing and
4651
field-level security therefore apply exactly as they apply to those reads.
4752
A part whose read refuses carries that refusal in place of an answer — a
4853
related list the caller may not read carries neither a count nor rows — and

‎packages/spec/src/api/record-page.zod.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ import type { SysActivityBuiltinType } from '../data/feed.zod';
4343
* their own routes. [#28737] The `timeline` part is the size of the record's
4444
* 动态 stream — the comments, the activity and the field changes it merges —
4545
* counted by those reads as the caller (`RecordPageTimelineRequestSchema`), so
46-
* a page draws the stream's count without holding every row of it. Object permissions, row-level security, sharing and
46+
* a page draws the stream's count without holding every row of it. The total
47+
* counts the sources' rows as that schema's table defines them, so it is an
48+
* upper bound of the entries the 动态 panel draws, not their number. The panel
49+
* draws fewer where its `showCompleted` / `types` configuration filters entries
50+
* out, and where a ledger row has no displayable diff and so draws no entry.
51+
* Object permissions, row-level security, sharing and
4752
* field-level security therefore apply exactly as they apply to those reads.
4853
* A part whose read refuses carries that refusal in place of an answer — a
4954
* related list the caller may not read carries neither a count nor rows — and
@@ -167,7 +172,11 @@ export type RecordPageActivityRequestParsed = z.infer<typeof RecordPageActivityR
167172
* | `fieldChanges` | `sys_audit_log` where `object_name` = `{object}`, `record_id` = `{id}` and `action` is a |
168173
* | | write (`create`, `update`, `delete`) |
169174
*
170-
* The total is their sum. A source this deployment does not serve (its read
175+
* The total is their sum: it counts the sources' rows as this table defines
176+
* them, so it is an upper bound of the entries the 动态 panel draws, not their
177+
* number. The panel draws fewer where its `showCompleted` / `types`
178+
* configuration filters entries out, and where a ledger row has no
179+
* displayable diff and so draws no entry. A source this deployment does not serve (its read
171180
* answers `OBJECT_NOT_FOUND`) holds no entry, as the page reads such a stream
172181
* as an empty one. The field changes are the history the stream merges only
173182
* where the caller may read it: a refused `sys_audit_log` read counts none, as

0 commit comments

Comments
 (0)