Repository navigation
Commit db77cc4
docs(adr): ADR-0160 amended — a citation names its pack and is verified once as the asking user (D9) (#37370)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg67aVMQDE1RzpDASKD6gP9f)_
repo:objectstack#5 · os-bill · session_01Utp6CYRWEQbrHTNYDXienp
Fixes #37363
Clause-②: no
Metadata-protocol: none
Container & model: `S`, `mode:thread`, `model: claude-fable-5-1 (claim
7178304155 on #37363: dispatch-gates --tier mandates claude-fable-5-2
for docs/adr/**; measured unavailability, built at 5-1 above the default
tier; compensating control: L2 at CONTRACT_REVIEW_TIER at handoff)`,
`effort: xhigh (ADR amendment, standing order)`
## 维护者速读
-
用户无感:这是一条架构记录的第三次修订,只改文字。引用格式加上可选的资料包名,并写明引用在回答生成时按提问人权限核一次、核不上的不显示、关联记录的摘句指向主记录。
- 为什么做:记录 AI
问询专题里,引用这一项拆成三张施工卡之前,先把你在决策卡上选定的三条答案写进架构记录,后面三张卡照它施工,不再各自解释。
- 出错会怎样:不改代码、不改发布包;合并后若发现措辞有误,再开一次修订即可改回。
- 要你做什么:无。受管文件需要两位审批人批准,批准后席位落地。
## What changes
One file, `docs/adr/0160-record-scoped-ai-inquiry.md` (+22 / −7 against
`main`; the rework commit below is +4 / −4 inside that). It is the third
amendment of the record, by the maintainer's ruling on card #37144
(ruling comment 7177410380, four-axis analysis 7177223845; the option
picked on the decision card at 2026-11-25T23:18Z was
「生成时核·D9加context·开主」).
- **Amendment log** (the header's `Amended` list): a third entry naming
the card, the ruling comment, the readings commit (`main` at `98bda0ac`)
and the three answers.
- **D9 — The citation shape**:
1. The shape becomes `{ object, id, context?, anchor?, quote }`.
`context` is the pack's name, spelt as `get_record_context`'s `context`
argument takes it (`packages/spec/src/ai/record-context-tools.zod.ts`,
`GetRecordContextInputSchema`). On an object with several packs a
citation without `context` is not verified: the verifier's call meets
D4's several-packs refusal and the refusal stands.
2. A new paragraph, **When a citation is verified**: once, when the
answer is produced, by the platform as the asking user, by calling the
tool with the citation's four arguments and looking for `quote` verbatim
in the answer's data member (`RecordContextDataSchema`). Not found, or
the call refused, drops the citation before the answer is shown. The
surviving list is persisted with the message; a surface never
re-verifies on display. The sentence that left "whether a surface
verifies before it renders" to row 10 is removed.
3. A new paragraph, **A quote from a related row**: `object`/`id` name
the pack's root record; the quote is matched across the whole data
member, related-list cells included; the surface opens the root record;
`anchor` keeps its one meaning, a heading of the root record's body.
4. The closing sentence now leaves to row 10 which member carries the
list, which strings of the data member a quote is matched against and
how a non-text value is compared, and how a surface opens the root
record at `anchor`. The stale "Shape only." opener is gone (also from
TL;DR point 9).
- **Three places that restate D9**, updated so the record does not
contradict itself: TL;DR point 9; the "Citation rendering and
verification" bullet of *Not decided here* (verification is now decided;
rendering stays row 10's); and *Points that go past the card's words*,
which gains the third amendment's introduction and **point 23**.
- **Point 23** is the one settlement past the ruling's words (after the
rework the text goes past the ruling nowhere else): the ruling says a
citation without `context` on a several-packs object is not verified
because the tool's refusal stands; the text reads every refusal the same
way (a `context` no pack has, an `anchor` that does not resolve), since
a refused call answers no data member. The alternative not taken is a
second call without the offending argument, which would pick a pack or a
body the model did not cite.
Nothing else in the record changes: no decision outside D9, no row of
the implementation split, the `**Status**:` line unchanged (so
`docs/adr/README.md` stays current — `check:adr-index` green below).
**Read first** (by risk): the D9 paragraph *When a citation is verified*
(the one normative addition: what is dropped, what is persisted, what is
never re-done), then the `context` bullet of D9 (the several-packs
rule), then point 23 (the only text past the ruling).
**Two-minute verification**: `pnpm check:adr-symbol-anchors` — expected:
green, with the two new `record-context-tools.zod.ts` symbol anchors
resolved.
## Tests
n/a — `docs/adr/**` text; no package, test or schema is touched. The
verification is the derived gate set below.
## Acceptance notes
- **Rework at `e2a5535d`** (seat's 席位核对 REWORK on the L2 record
7178586654, PASS with two should-fixes). S1: the citation check reads
"to the asking user", not "the reading user" (the principal Q1 = A
names). S2: the parenthetical gloss listing what the data member carries
is dropped; what a quote is matched against, and how a non-text value is
compared, are left to row 10 explicitly. N1: "Shape only." dropped in
D9's closing paragraph and TL;DR 9. N2 (a call that fails rather than
refuses) is left to row 10c as the review suggests. No other hunk
changed.
- **Tier H by path.** `docs/adr/**` is Tier H whatever the body says
(AGENTS.md Prime Directive #14); the ruling names the approvers
os-zhuang and hotlong. The `Rule-change:` line is left out as the PR
template asks for a diff that does not touch `.claude/**`; it would not
change the tier.
- **Three consistency touches beyond D9 and the log** are listed above
(TL;DR 9, *Not decided here*, point 23). The card says "nothing else in
the ADR changes"; these are the sentences that restate D9 and would
otherwise contradict it. No other decision is touched.
- **A consequence of the ruling, as ruled, not re-opened:** because a
surface never re-verifies on display, a later reader of a persisted
message sees the citations that were verified as the *asking* user, not
as themselves. That is Q1 = A; the surfaces of rows 10b and 10c inherit
it. `carrier: none` — recorded here for the seat's L1/L2 reading.
- **Card labels.** #37363 carries `area:ai`, `priority:p2`, `pm:queue`
and no `domain:*`; the ruling filed it as `domain:skills`. Observation
for the seat; not written by this thread.
- **No changeset.** `docs/adr/**` is on the fast track (not published);
`skip-changeset` is declared with this create.
- Gate run notes: the first local pass hit exit 3 (PREREQUISITE NOT MET:
no `node_modules`) on eight families and was discarded; after `pnpm
install` and building `@objectstack/formula...` and
`@objectstack/lint...`, every family ran green, and the whole set was
re-run on the final head.
## Verification
- Gate list derived on the final head `e2a5535d` (identical to the list
derived at `44767fb0`): `node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack` → 21 commands (1 path vs merge base
`98bda0ac`).
- All 21 exited 0 on `e2a5535d`, each exit code captured before any pipe
(the same 21 were green on `44767fb0`).
- `--ran` reconciliation on `e2a5535d`: `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/**` ⇢ mandatory fable tier, effort
floor xhigh; changed lines 29 vs the human-merge threshold 3000: under.
- `check-prior-rulings --paths
docs/adr/0160-record-scoped-ai-inquiry.md` at `98bda0ac`: 15 hit lines
read; the three Amended entries and the Decided-by line are the rulings
in force, none re-opened; the same-day churn line (dfdebfa, a ui fix in
the same merge) does not touch this file.
- CI-owned families (type-check lanes, artifact rosters, `test:repo`,
the always-runs tail) are this PR's check-runs.
<details><summary>Local gates (21, each `exit 0` on e2a5535)</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_01Utp6CYRWEQbrHTNYDXienp
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CYRWEQbrHTNYDXienp -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 98b17fe commit db77cc4
1 file changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
70 | | - | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
323 | | - | |
| 329 | + | |
324 | 330 | | |
325 | | - | |
326 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
327 | 334 | | |
328 | 335 | | |
329 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
330 | 341 | | |
331 | | - | |
| 342 | + | |
332 | 343 | | |
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
339 | | - | |
| 350 | + | |
340 | 351 | | |
341 | 352 | | |
342 | 353 | | |
| |||
370 | 381 | | |
371 | 382 | | |
372 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
373 | 388 | | |
374 | 389 | | |
375 | 390 | | |
| |||
0 commit comments