Skip to content

docs(adr): ADR-0160 amended — a body outline past its bounds comes in pages (outlineFrom / outlineNext) - #37573

Draft
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-towppa
Draft

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-towppa

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CaY7QjyzmyWTJGfguK

Fixes #37490

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:这是一条架构记录的第四次修订,只改文字。把已经上线的「长正文目录分页」写进记录,包括怎么翻页、每页都带哪些提示、以及翻页中途正文被改时可能漏列或重列标题。
  • 为什么做:记录 AI 问询专题里,资料包读取工具的目录分页已经合并,但架构记录还停在「目录只有一页」的说法,后续施工和审阅的人会读到过时的约定。
  • 出错会怎样:不改代码、不改发布包;合并后若发现措辞有误,再开一次修订即可改回。
  • 要你做什么:这是受管的架构记录,需要你批准后才能合并。

What changes

One file, docs/adr/0160-record-scoped-ai-inquiry.md (+22 / −3). It is the fourth amendment of the record. It writes down what PR #37484 put on main (merge commit 59571b2f07, for card #37233) and carries the scope note on this card (comment 7187692455, N1 of contract review 7187652688). Every sentence was read against body-outline.ts, record-context-tools.ts, sentences.ts and record-context-tools.zod.ts on main at 41164656.

  • Status line and amendment log: the status line names the second amendment date; the header's Amended list gains a fourth entry naming this card, PR feat(service-record-context): get_record_context lists a long body's outline in pages (outlineFrom / outlineNext) #37484, the readings commit and the three things recorded. It says in words that the amendment rests on no ruling of its own.
  • D3, a new paragraph "Outline pages", placed after "The body" (whose text stands and is not restated):
    1. The two outline bounds bound one answer, not which headings can be listed; an outline past either comes in pages (boundedOutline).
    2. The order: shallowest level first, body order within a level; each page lists its own headings in body order.
    3. The continuation: a page that leaves headings for a later page carries outlineNext on its body, and that number as outlineFrom lists the next page. An anchor reads its section whichever page issued it.
    4. Coverage: within one state of the body, every heading is on exactly one page with its anchor. The exception is a heading whose entry alone passes the body bound: no page lists it, no anchor is issued for it, and the cut statement counts it.
    5. The per-body-state qualifier (N1): outlineFrom is a position in the page order of the body as the call reads it, and the tool keeps nothing between calls. An edit between two page calls can make the walk skip a heading or list one twice, with no signal; the anchors on each page stay current.
    6. The notes on every page: the outline statement on each page, and the cut statement on each page that does not list every heading. The cut statement carries counts and a position, never an anchor.
    7. A page that does not exist: an outlineFrom above 0 with no heading left to list from it gets one RESOURCE_NOT_FOUND (404) answer whatever the reason, so outlineFrom, like anchor, cannot show that a pack has a body the caller's schema hides.
  • D4 "Definition": the input row gains outlineFrom?: integer and the exclusion: a call that names both anchor and outlineFrom is refused VALIDATION_ERROR (400) in step 1, before any gate is judged and any record is read. The output row gains outlineNext on the body.
  • Points that go past the card's words gains the fourth amendment's introduction and point 24: paging stays on the same tool, and the cursor is a position and not an anchor because a note may carry no record text. The alternative it names is the one PR feat(service-record-context): get_record_context lists a long body's outline in pages (outlineFrom / outlineNext) #37484 weighed.

Nothing else in the record changes: "The body" paragraph, the TL;DR, the implementation split and every other decision stand as they were.

Read first (by risk): the bullet "One state of the body" in D3 "Outline pages" (the N1 qualifier), then "A page that does not exist" (the list of reasons behind the one 404), then the D4 input row (the exclusion and where it is refused).

Two-minute verification: pnpm check:adr-symbol-anchors — expected: green, with the new body-outline.ts symbol anchor boundedOutline found.

Tests

n/a — docs/adr/** text; no package, test or schema is touched. The verification is the derived gate set below.

Acceptance notes

  • Acceptance bullet 1 (the sentences match record-context-tools.zod.ts and body-outline.ts on main): outlineFrom is z.number().int().min(0).optional(), written as outlineFrom?: integer with "outlineFrom 0 is the first page"; outlineNext is present only when a heading remains that a later page lists; the page order and the skipped over-long heading are boundedOutline's; the 400 and the 404 are the executor's (executeGetRecordContext, step 1 and the body block).
  • Acceptance bullet 2 (the amendment log cites this card): the fourth Amended entry and the introduction of point 24.
  • Acceptance bullet 3: Clause-②: no, Metadata-protocol: none, as claimed.
  • Where the text differs from the card's draft sentences, on purpose. The card says "outlineFrom past the last page, or on a body that is no outline" is the 404. main answers the first page for outlineFrom: 0 on any body, so the text says "an outlineFrom above 0 with no heading left to list from it". It does not say "a position that starts no page": main answers a page from any position that still has a heading to list, whether or not an earlier answer issued that position, and the text neither promises nor forbids that. The card says "every heading is listed on exactly one page"; the text scopes that to one state of the body, as the scope note asks.
  • One structural choice. The paging text is a new paragraph after "The body", and "The body" is left byte-identical, so the amendment adds to D3 and rewrites nothing there. One phrase of "The body" now reads slightly narrow beside it ("the most headings one outline lists" is, since the paging, the most one page lists); the first sentence of "Outline pages" says so. carrier: none.
  • An observation, not acted on. D4's input row says "with the record tools' aliases for the first two"; the schema on main also aliases pack and contextName to context, and section to anchor. That sentence predates this card and is outside its claim. carrier: none.
  • Tier H by path. docs/adr/** is governed whatever the body says. The Rule-change: line is left out: the diff does not touch .claude/**.
  • No changeset. docs/adr/** is on the fast track (not published); skip-changeset is declared with this create.

Verification

  • Two commits. 98e42a52 is the amendment; a3f1e40a (+3 / −3 inside the new paragraph) makes three of its sentences exact after a second reading against the executor: when a page call is refused, what the cut statement carries, and that an edit between two page calls can also end in that refusal.
  • Gate list derived on the final head a3f1e40a: node scripts/pm/dispatch-gates.mjs --commands → 21 commands (1 path vs merge base 41164656).
  • All 21 exited 0 on a3f1e40a, each exit code captured before any pipe. On the first head, check:doc-formula-expressions had exited 3 (PREREQUISITE NOT MET, no built output) until @objectstack/formula... and @objectstack/lint... were built under the verify lock (VERDICT command-exit 0).
  • --ran reconciliation on a3f1e40a: 21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED (a DERIVED zero — all 21 recorded an exit code and none of them is 3).
  • dispatch-gates --tier: docs/adr/** is the mandatory contract tier; changed lines 25 vs the human-merge threshold 3000: under.
  • overlap-check --branch=HEAD before each push: VERDICT clean exit 0 against origin/main at 4116465625 and 0 PR heads.
  • CI-owned families (type-check lanes, artifact rosters, the always-runs tail) are this PR's check-runs.
Local gates (21, each exit 0 on a3f1e40)
node scripts/check-adr-links.mjs [+ --self-test]
node scripts/check-closing-keyword-parity.mjs [+ --self-test]
node scripts/check-comment-mask-corpus.mjs
node scripts/ci/plan-test-core-shards.mjs --self-test
pnpm --filter @objectstack/lint run check:doc-formula-expressions
pnpm check:adr-anchors · check:adr-index · check:adr-symbol-anchors
pnpm check:ci-filter-parity · check:closed-ceremony-text · check:cross-package-test-inputs
pnpm check:doc-authoring · check:driver-memory-census · check:gitlink-declared
pnpm check:nul-bytes · check:pm-governed-merges · check:pm-prior-rulings
pnpm check:refd-timer-probe · check:watch-hint-literal

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CaY7QjyzmyWTJGfguK

… comes in pages

D3 gains "Outline pages": the page order, the outlineFrom / outlineNext
continuation, the one-state-of-the-body qualifier, the notes on every
page and the one refusal for a page that does not exist. D4's input row
gains outlineFrom and the anchor / outlineFrom exclusion; its output row
gains outlineNext. Point 24 lists the text's own settlement.

Claude-Session: https://claude.ai/code/session_01Utp6CaY7QjyzmyWTJGfguK
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 26, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Nov 26, 2026
…ge is refused

The refusal is for a position with no heading left to list from it, not
for a position that is not a page boundary; the cut statement carries
counts and a position; an edit between two page calls can also end in
that refusal.

Claude-Session: https://claude.ai/code/session_01Utp6CaY7QjyzmyWTJGfguK
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head a3f1e40 · 2026-11-26T14:17Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a3f1e40ab150ad4c05e9128ba6500e09b503ade2
Local-runs: none
Scope: docs/adr/0160-record-scoped-ai-inquiry.md + none
Security-touching: yes

PR #37573 for card #37490: the fourth amendment of ADR-0160, one file, +22/−3. Read against main at 6c290d3af7. The four files the text describes (body-outline.ts, record-context-tools.ts, sentences.ts, record-context-tools.zod.ts) are unchanged since the dev's reading commit 41164656, which is also the merge base.

Security-touching: yes because the new D3 text teaches a non-disclosure rule: one 404 for a hidden, withheld or absent body, so outlineFrom cannot show that a hidden body exists. The PR is Tier H by path either way.

① Derived judgments

② Semver level

  • skip-changeset is right: docs/adr/** is not published, and Check Changeset is skipped under the label.
  • Clause-②: no is right: the text records what main already does. Metadata-protocol: none is right too.

③ Boundary flags

④ Design judgment

No must-fix, no should-fix.

Each sentence was checked against the code on main.

D3 "Outline pages" — holds.

  • Order: boundedOutline sorts by level, then body index, takes from from, and re-sorts the page into body order.
  • Continuation: next is set only at a listable heading that would pass a bound, so the page it names is never empty. The executor writes it as outlineNext only when set. A section call resolves anchor against every heading, not the page.
  • Coverage and the exception: an entry with JSON.stringify(entry).length + 2 > 8000 is skipped on every page, gets no anchor and is counted in unlistable, which the cut sentence states.
  • One state of the body (N1 of the card's scope note): the executor reads the body afresh on each call and keeps no state. The qualifier is in the coverage bullet, in its own bullet and in the Amended entry.
  • Notes: body_outline is pushed on every outline page. outline_truncated is pushed when omitted > 0, with the listed count, the remainder, and outlineFrom N or "No later page lists more". It carries no anchor.
  • A page that does not exist: from > 0 with no listed heading throws RESOURCE_NOT_FOUND 404 with one sentence (outlineFromUnresolved) for every listed reason: past the end, a body carried whole, a body cut without an outline, no body, a dropped body, a withheld body. anchorUnresolved has the same code and status. outlineFrom: 0 answers the first page. A test pins four of the reasons as one equal answer (past the end, whole, no body, hidden); the cut-without-outline and withheld cases are read from the code only.

D4 input row — holds. Schema: outlineFrom: z.number().int().min(0).optional(). The executor refuses anchor with outlineFrom as VALIDATION_ERROR 400 straight after the parse, under its "1. The arguments" step, before readGuard, assertApiExposed and every read. The only door call before it is the locale lookup, which is no gate and no record read. Pinned by test ("refused before anything is read").

D4 output row — holds. outlineNext: z.number().int().min(1).optional() on RecordContextBodySchema.

The Amended entry and point 24 — hold.

Nits, none affecting the contract:

  • N1 (nit) — the D4 row says outlineFrom?: integer; the schema admits 0 or more and refuses a negative at parse. "0 or more" would say it.
  • N2 (nit) — point 24 does not name the over-long heading that gets no anchor. D3 states it, and it is the one case where a section cannot be read by itself. A body whose headings are all over-long has no outline at all, so there "the cut statement counts it" has no statement to point at.
  • N3 (nit) — the 404's list of reasons omits a body field the pack names with a non-body type (an author defect). "Whatever the reason" covers it.

All three can ride on #37386 with the alias sentence.

Implemented-by: claude/project-thread-towppa
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

  • 改了什么:ADR-0160 第四次修订,补记 PR feat(service-record-context): get_record_context lists a long body's outline in pages (outlineFrom / outlineNext) #37484 已合并的「大纲分页」。D3 新增「Outline pages」一节,D4 输入行加 outlineFrom、输出行加 outlineNext,再加 Amended 条目和第 24 点。1 个文件,+22/−3。
  • 为什么:37233 跟进:ADR-0160 补写目录分页(outlineFrom / outlineNext) #37490。代码已在 main 上,ADR 要如实记录它;这次修订不依赖任何新裁定。
  • 风险:只改文字,每句都对照 main 的代码核过。一个你要知道的行为:页与页之间记录被编辑时,可能无提示地跳过或重复某个标题(D3、Amended 条目、第 24 点都写明了)。另外隐藏、截留、不存在的正文都回同一个 404,不泄露正文是否存在,所以加了 security 标签。
  • 要你做什么:批准合并。契约复核 PASS 在评论 7194836142,Head-sha a3f1e40ab150ad4c05e9128ba6500e09b503ade2。

席位意见:ACCEPT。三个 nit 和别名那句一起放到 #37386。

席位核对

Head-sha: a3f1e40ab150ad4c05e9128ba6500e09b503ade2
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: draft against main. docs/adr/0160-record-scoped-ai-inquiry.md, +22/−3. GOVERNED, Tier H. skip-changeset, Clause-②: no, Metadata-protocol: none.
  2. Premise: records merged behaviour from PR feat(service-record-context): get_record_context lists a long body's outline in pages (outlineFrom / outlineNext) #37484 as a dated fourth amendment in the form of the three before it, ending "Nothing else changes". It presents nothing as ruled.
  3. Gates: contract record 7194836142 (CONTRACT_REVIEW_TIER, verified on the transcript) reads PASS, no must-fix, no should-fix. CI on this head: 26 success, 22 skipped, 0 failed.
  4. Security-touching: yes. D3 teaches a non-disclosure rule (one 404 for a hidden, withheld or absent body), so the seat adds security.
  5. Out of scope and where it went: N1–N3 and the D4 alias sentence (pack / contextName / section) go to 37203 跟进:ADR-0160 D1 补「排序字段不可排序」这条作者错误,并把计算字段类型收成一个出处 #37386, the next edit of this file. The note 7194545072 is a comment only; the seat asks the area to copy it into 37203 跟进:ADR-0160 D1 补「排序字段不可排序」这条作者错误,并把计算字段类型收成一个出处 #37386's body.
  6. Landing terms: Tier H. The seat adds pm:awaiting-merge and requests os-zhuang. The maintainer's approval decides; after approval the seat or the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Adding security: the new D3 text teaches a non-disclosure rule (seat ACCEPT 7194846763, item 4).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Approval requested (Tier H, docs/adr/**; security-touching, label added). Seat ACCEPT: comment 7194846763. Contract review PASS at CONTRACT_REVIEW_TIER: comment 7194836142, Head-sha a3f1e40ab150ad4c05e9128ba6500e09b503ade2. After approval the seat or area lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue security size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

37233 跟进:ADR-0160 补写目录分页(outlineFrom / outlineNext)

2 participants