Repository navigation
Commit eec1040
docs(adr): ADR-0160 amended — a body outline past its bounds comes in pages (outlineFrom / outlineNext) (#37573)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgKJcxVQvtK7UsENd5xsHrZe)_
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 #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 #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.
<details><summary>Local gates (21, each exit 0 on a3f1e40)</summary>
```text
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
```
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CaY7QjyzmyWTJGfguK
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CaY7QjyzmyWTJGfguK -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4805d83 commit eec1040
1 file changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
223 | 238 | | |
224 | 239 | | |
225 | 240 | | |
| |||
243 | 258 | | |
244 | 259 | | |
245 | 260 | | |
246 | | - | |
247 | | - | |
| 261 | + | |
| 262 | + | |
248 | 263 | | |
249 | 264 | | |
250 | 265 | | |
| |||
385 | 400 | | |
386 | 401 | | |
387 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
388 | 407 | | |
389 | 408 | | |
390 | 409 | | |
| |||
0 commit comments