Skip to content

Commit 6211ddf

Browse files
docs(adr): ADR-0150 addendum — ai_context joins the package-scoped bucket beside skill (#37209)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBEaJzgBWzjWCNjBjkVoeRto)_ repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK Fixes #37180 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感(只改决定记录,不改代码);提议两个应用各带的同名 AI 资料包按「应用+名字」分开认,和技能现在的做法一样,AI 点名某个应用的资料包时用「应用前缀-名字」的写法。 - 为什么做:属于「记录级 AI 问询」这项工作;现在同名的资料包在系统里只留后装的那一份,规则要先定,再由后续实现卡 #37216(把资料包加进按应用区分的名单)落地,而它必须排在 #37141(让技能写明用哪个资料包)之前。 - 出错会怎样:规则定错的话,后面的实现会照着错的做;本次只有文档,撤回这次合并即可。 - 要你做什么:这条只能由你本人定,合并就等于批准,其中两处超出卡面原话(AI 用「应用前缀-名字」点名资料包;同一应用前缀下不许两个应用包带同名资料包);不同意就不合并,那样只保留「同一对象上两个同名资料包不替用户挑、一律拒绝」这一条。 ## What changes Two files under `docs/adr/`: 44 lines added, 1 line changed. No schema, no code, no changeset. **ADR-0150** (Accepted) gains a dated addendum. No ruled sentence is rewritten. - The status line gains one **Amended** clause, dated 2026-11-25. This is the one changed line: the clause is appended, and nothing before it is edited. - The D1 table gains one row, marked with the date, between bucket 3 and bucket 4. - A new section at the end of D1, "Addendum (2026-11-25): `ai_context` joins bucket 3". It proposes that the context pack type of ADR-0160 is identified by `(package, name)`, in bucket 3 beside `skill`. The addendum says, in this order: 1. **The type**, and what D2, D3, D6 and D8 mean for it. A package's pack is spelled `NS-NAME` where its name crosses the AI face. 2. **The tree today**, measured on `main` at `0a1b69c0`. The type and its pack selection are on `main`. The registry keeps each package's item. The metadata service keeps one copy per name, the one registered last. 3. **What changes with the bucket**: the service's copy, overlays, owner stamps (unchanged) and uninstall. 4. **The readers that move.** It names three and moves none. 5. **The follow-up**, #37216, which lands before row 8 (#37141). 6. **The interim rule**: two parsed packs that share a name and a root are never chosen between. 7. **Past the card's words**: two points that are the maintainer's decision alone, and one that is no new decision. **ADR-0160** gains one cross-reference note under D1, which also names the follow-up and its order. No sentence of it is changed. **Not in this PR**, by the card's contract: `PACKAGE_SCOPED_TYPES` is not edited and no reader is moved. That is #37216's work, after the ruling. ## Round 2 The contract review of the first head passed with two should-fix findings and four nits. This head closes them. - **S1, the tree moved.** `main` gained the type and the tool (#37173) and the ADR-0160 amendment (#37196) after the first measurement. `main` is merged into the branch (a merge commit, no rebase and no force-push), and every "today" sentence is re-measured at `0a1b69c0`. The addendum now cites the merged code. "Nothing first-party is refused" is restated against the showcase app, the one declarer: one package, two packs of different names on different roots. `objectstack-ai/hotcrm` at `b1ea6fcc` declares none. - **S2, who rules.** The addendum no longer lets any authorized approval be its ruling. Points 1 and 3 are the maintainer's alone, so the record is ruled by the maintainer's own merge or word. Point 2 is stated as following from ADR-0160 D4, not as a new decision. - **N1.** The interim rule no longer says "one answer". A `context` that names the two packs answers `409`. So does an omitted `context` when theirs is the only name on the root. With another name on the root, an omitted `context` gets the several-packs answer, which lists the shared name once. The first match is taken in none of these. - **N2.** The overlays bullet now says a package-less row under a name a package ships is not served, that this is D4 as for `skill`, and that #37216 measures it. - **N3.** The follow-up is filed as #37216 and named in both records. - **N4.** The no-hyphen premise of the face is anchored to the name pattern. ## Tests No package is touched, so no package build or test is owed. The checks that read these two files are the docs gates under Verification. ## Acceptance notes - **The chain.** This PR is the ruling. #37216 implements it and is blocked by this PR. #37141 (the skill key) waits for #37216, because the one rule throws for a type outside `PACKAGE_SCOPED_TYPES`. - **Two decisions are the maintainer's alone.** 1. Bucket 3 and not bucket 2: a package's pack is spelled `NS-NAME` in the tool's `context` argument. This widens D6 from the names a server lists to the value of an argument. The alternative, an optional `namespace` input on the tool, adds a key to two shapes ADR-0160 has ruled. 2. Child N's predicate carries the install refusal: the type joins `NAMESPACE_UNIQUE_TYPES`, whose header reserves a further type to the maintainer. - **Not a new decision.** The root object narrows the candidates before the one rule picks. ADR-0160 D4 already requires it: step 3 selects among the packs rooted on the requested object, and the naming bound lets no refusal name a pack beyond those. - **The card's step 3 names one list, and the bucket takes four.** They are `PACKAGE_SCOPED_TYPES`, `PACKAGE_SCOPED_READ_TYPES`, `PACKAGE_SLOTTED_METADATA_TYPES` and `NAMESPACE_UNIQUE_TYPES`. The service's one copy per name is governed by the third, not the first. `skill` is in the first three; its one-holder rule inside a namespace is phase 1's, which a new type never had. - **Citation form.** `check:adr-symbol-anchors` refuses a line anchor under `docs/adr/`, so the record cites `path#Symbol`, and the line numbers are in the table under Verification. - **No changeset.** `docs/adr/` ships in no package, so this PR carries `skip-changeset`. - **Tier H.** This PR stays draft. The merge is the maintainer's, and it is the ruling. - **Shallow checkout.** No claim here is read from history dates. - **Noted, not filed.** On `main` the several-packs answer lists pack names only (`packages/services/service-record-context/src/sentences.ts`, `severalPacks`). ADR-0160 D4, as amended on 2026-11-25, says each candidate is listed by name with its `label`. This is read from source, not measured through the tool, and no first-party object has several packs. The addendum leaves what that answer carries to D4. ## Verification **Read first**, by risk: 1. `docs/adr/0150-…-literal-prefix.md`, "Past the card's words" at the end of the addendum: the two decisions that are the maintainer's. 2. The same file, the D1 table hunk: one row inserted into a ruled table. Check that it reads as an addition and changes no ruled row. 3. The same file, the status line: the appended clause. **Two-minute check**: run `node scripts/check-adr-symbol-anchors.mjs`. Expect `4186 anchors across 163 records resolve` and exit 0. Fourteen of them are this diff's `path#Symbol` anchors. <details> <summary>Measured anchors on main at 0a1b69c (file:line)</summary> | What the addendum says | Where it is read | |---|---| | The type is on `main`, and a pack name holds no hyphen | `packages/spec/src/ai/ai-context.zod.ts:136` (`AiContextSchema`), `:157`; `packages/spec/src/kernel/address-grammar.ts:68` (`ROUTER_ADDRESSABLE_NAME_PATTERN`) | | Pack selection keeps the packs rooted on the object and matches a bare name | `packages/services/service-record-context/src/read-set.ts:65` (`selectContextPack`) | | Two packs of one name on one root: `409`; with another name and no `context`: the several-packs answer | `packages/services/service-record-context/src/record-context-tools.ts:266`, `:265` | | The one rule resolves only its listed types | `packages/core/src/package-scoped-resolution.ts:245` (`PACKAGE_SCOPED_TYPES`; `skill` at `:270`) | | It throws for a type outside the list | `packages/core/src/package-scoped-resolution.ts:740`, `packages/objectql/src/package-scoped-resolver.ts:148` | | A by-name read consults (package, name) for listed types | `packages/objectql/src/package-scoped-read.ts:88` (`PACKAGE_SCOPED_READ_TYPES`; `skill` at `:96`), read by `packages/objectql/src/registry-package-addressing.ts:433` | | The service keeps one slot per (package, name) for listed types | `packages/spec/src/api/protocol.zod.ts:2753` (`PACKAGE_SLOTTED_METADATA_TYPES`; `skill` at `:2754`), `packages/metadata/src/package-slotted-store.ts:154` | | Any other type is keyed by name alone | `packages/metadata/src/package-slotted-store.ts:797` (`storeWriteKey`), `:820` | | The last registration replaces the copy | `packages/metadata/src/metadata-manager.ts:1499`, `packages/metadata-protocol/src/protocol-registry-hydration.ts:148` | | One package holder of a name inside a namespace | `packages/objectql/src/namespace-co-owner-names.ts:96` (`NAMESPACE_UNIQUE_TYPES`); the list is reserved to the maintainer at `:27` | | The type opens no overlay channel, and its row is not among the served overrides | `packages/spec/src/kernel/metadata-plugin.zod.ts:1388`, `packages/metadata-protocol/src/protocol-package-bindings.ts:388` (`SEALED_ROW_SERVED_OVERRIDE_TYPES`) | | A skill prompt's name: a face, else a bare name by the one rule | `packages/mcp/src/skill-prompts.ts:373` (`lookupSkillPrompt`) | | The one face derivation | `packages/spec/src/ai/face-name.ts:86` (`deriveAiFaceName`) | | The owner stamp's judge, and the pack's collection among those it judges | `packages/spec/src/kernel/collection-item-owner-stamp.ts:129`, `:107` | | Uninstall, the registry's half | `packages/objectql/src/registry.ts:5328` (`uninstallPackage`) | | Uninstall, the service's half | `packages/metadata/src/metadata-manager.ts:2880` (`unregisterPackage`) | | The one first-party declarer: two packs, two names, two roots | `examples/app-showcase/objectstack.config.ts:223`, `examples/app-showcase/src/ai/record-context.ai-context.ts:20`, `:30` | Absence readings, each with a positive control: - `ai_context` in the four list files and in `packages/metadata/src/package-slotted-store.ts`: 0 lines each. Control: `skill` is in the first three lists, at the lines the table gives. - The skill key: `packages/spec/src/ai/skill.zod.ts` has 0 `context:` property lines. Control: 1 `tools:` line. - `objectstack-ai/hotcrm` at `b1ea6fcc`: `ai_context`, `aiContexts` or `ai-context`, 0 files. Control: `skills:`, 6 files. </details> <details> <summary>Local gates at head deee29a: 21 derived, 21 run, all exit 0</summary> Derived with `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands`, and reconciled with `--ran`: ``` Run reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 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). ``` Each exit code was captured before any pipe: ``` 0 node scripts/check-adr-links.mjs 1222 relative link destination(s) under docs/adr/ resolve 0 node scripts/check-adr-links.mjs --self-test 0 node scripts/check-closing-keyword-parity.mjs 0 node scripts/check-closing-keyword-parity.mjs --self-test 0 node scripts/check-comment-mask-corpus.mjs 23898 files, 0 disagree, 0 unparseable 0 node scripts/ci/plan-test-core-shards.mjs --self-test 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions 0 pnpm check:adr-anchors 0 pnpm check:adr-index docs/adr/README.md is current, every record parsed 0 pnpm check:adr-symbol-anchors 4186 anchors across 163 records resolve 0 pnpm check:ci-filter-parity 0 pnpm check:closed-ceremony-text 0 pnpm check:cross-package-test-inputs 0 pnpm check:doc-authoring 0 pnpm check:driver-memory-census 0 pnpm check:gitlink-declared 0 pnpm check:nul-bytes no raw ASCII control bytes 0 pnpm check:pm-governed-merges 0 pnpm check:pm-prior-rulings 0 pnpm check:refd-timer-probe 0 pnpm check:watch-hint-literal ``` `check:doc-formula-expressions` reads the compiled output of `@objectstack/formula` and `@objectstack/lint`. Those two and their dependencies were built first, under the shared verify lock (`VERDICT command-exit 0`). `docs/adr/README.md` is generated from each record's status keyword. ADR-0150's keyword stays Accepted, so the index does not change and is not in this diff. </details> <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c355f85 commit 6211ddf

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

‎docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ADR-0150: Behavioural metadata is addressed by (package, name) — objects keep the literal prefix; ADR-0028 re-opened for the behavioural tier
22

3-
**Status**: Accepted (2026-11-08, merged in #31586). `docs/adr/` is Tier H (Prime Directive #14): this record became **Accepted** by the maintainer's merge of #31586 (commit `5d1382a54c`), on the day it was proposed. The child cards under [Execution plan](#execution-plan-after-acceptance) are filed under the epic ruling [`6723499113`](https://github.com/objectstack-ai/objectstack/issues/31527#issuecomment-6723499113) (child R is #31575); ⛔ no child lands before this record is accepted. **This record declares; it implements nothing**: no schema, no code, no changeset. · **Supersedes in part** [ADR-0028](./0028-metadata-naming-and-namespace-isolation.md) (D1 and D3, for the metadata types of buckets 2–4 below; ADR-0028 stays Deferred for objects and everything else) · **Amends** [ADR-0048](./0048-cross-package-metadata-collision.md) §3.3 and its 2026-11-06 addendum (the one-holder refusal retires per type as that type's readers carry the package, [D9](#d9--what-retires-and-what-stays)) · **Withdraws** the non-object half of ruling C on #30798: phase 3 (#30806 S1 and S5) does not ship. · **Amended** (2026-11-09, [#31685](https://github.com/objectstack-ai/objectstack/issues/31685), child A): the rulings and epic-seat readings recorded on the children since acceptance are written in: D2 (the shareable namespaces), D3 ((c) and the caller-less references), D4 (owner-less functions), TL;DR 7, and the execution plan's releasability sentence and covered-types paragraph. · **Amended** (2026-11-10, [#32060](https://github.com/objectstack-ai/objectstack/issues/32060), after G1 [#31691](https://github.com/objectstack-ai/objectstack/issues/31691) closed): dated notes record what G1 and its follow-ups landed: TL;DR 7 (where the address literals are refused), D4 (one armed flow per bare name until B #31696), D5 (the R1 boot reading, the literal rules after a qualifier, and the `runs` qualifier), and row K (what each door compares). No ruled sentence is rewritten. · **Amended** (2026-11-17, [#34704](https://github.com/objectstack-ai/objectstack/issues/34704)): the status keyword now records the acceptance, and two counts in the execution plan that still read as they did before `tool` joined phase 1 (#31414) are corrected: the B row's label (`B1…B14`, as "14 in all" below it), and "For the other 9" with the "those 9 types" that refers back to it (11 uncovered types, less hook and job). No ruled sentence is rewritten.
3+
**Status**: Accepted (2026-11-08, merged in #31586). `docs/adr/` is Tier H (Prime Directive #14): this record became **Accepted** by the maintainer's merge of #31586 (commit `5d1382a54c`), on the day it was proposed. The child cards under [Execution plan](#execution-plan-after-acceptance) are filed under the epic ruling [`6723499113`](https://github.com/objectstack-ai/objectstack/issues/31527#issuecomment-6723499113) (child R is #31575); ⛔ no child lands before this record is accepted. **This record declares; it implements nothing**: no schema, no code, no changeset. · **Supersedes in part** [ADR-0028](./0028-metadata-naming-and-namespace-isolation.md) (D1 and D3, for the metadata types of buckets 2–4 below; ADR-0028 stays Deferred for objects and everything else) · **Amends** [ADR-0048](./0048-cross-package-metadata-collision.md) §3.3 and its 2026-11-06 addendum (the one-holder refusal retires per type as that type's readers carry the package, [D9](#d9--what-retires-and-what-stays)) · **Withdraws** the non-object half of ruling C on #30798: phase 3 (#30806 S1 and S5) does not ship. · **Amended** (2026-11-09, [#31685](https://github.com/objectstack-ai/objectstack/issues/31685), child A): the rulings and epic-seat readings recorded on the children since acceptance are written in: D2 (the shareable namespaces), D3 ((c) and the caller-less references), D4 (owner-less functions), TL;DR 7, and the execution plan's releasability sentence and covered-types paragraph. · **Amended** (2026-11-10, [#32060](https://github.com/objectstack-ai/objectstack/issues/32060), after G1 [#31691](https://github.com/objectstack-ai/objectstack/issues/31691) closed): dated notes record what G1 and its follow-ups landed: TL;DR 7 (where the address literals are refused), D4 (one armed flow per bare name until B #31696), D5 (the R1 boot reading, the literal rules after a qualifier, and the `runs` qualifier), and row K (what each door compares). No ruled sentence is rewritten. · **Amended** (2026-11-17, [#34704](https://github.com/objectstack-ai/objectstack/issues/34704)): the status keyword now records the acceptance, and two counts in the execution plan that still read as they did before `tool` joined phase 1 (#31414) are corrected: the B row's label (`B1…B14`, as "14 in all" below it), and "For the other 9" with the "those 9 types" that refers back to it (11 uncovered types, less hook and job). No ruled sentence is rewritten. · **Amended** (2026-11-25, [#37180](https://github.com/objectstack-ai/objectstack/issues/37180)): an [addendum under D1](#addendum-2026-11-25-ai_context-joins-bucket-3) puts the context pack `ai_context` (ADR-0160 D1) in bucket 3 beside `skill`, with one dated row added to the D1 table, and says what that changes for the metadata service's copy, overlays, uninstall and the readers of a pack name. It is the maintainer's alone to rule, by the maintainer's own merge of the PR that carries it or by the maintainer's word: it widens D6 and admits a type to a list reserved to the maintainer. No ruled sentence is rewritten.
44

55
- **Date**: 2026-11-08
66
- **Supersedes**: [ADR-0028](./0028-metadata-naming-and-namespace-isolation.md) in part (D1 and D3, for buckets 2–4)
@@ -91,6 +91,7 @@ On 2026-11-08 the maintainer redirected it: 「你不能只考虑现状,还要
9191
| **1 — global literal prefix, unchanged** | `object` (ADR-0129 D2, the table name) · `field` · `object_extension` · `view` (object-derived) · `capability` (`NS.SHORT`, ruling 6683456244) · `doc` (ADR-0046 doc lint) · an api's `path` (globally unique) | the literal name | unchanged |
9292
| **2 — (package, name)** (20 types) | `flow` · `action` (`objectName:name` plus package) · `hook` · `job` (`jobKeyFor` aligned to the package coordinate) · `webhook` · `mapping` · `connector` · `permission` (set) · `sharing_rule` · `queue` · `assignment_rule` · `app` · `page` · `dashboard` · `report` · `dataset` · `analytics_cube` · `picklist` · `email_template` · `book`; an api item's `name` | `(package, name)` | D3 resolution; D5 addresses |
9393
| **3 — (package, name) plus a derived flat name on the AI face** | `tool` · `skill` · `agent` · `rag_pipeline` (retired (#31456) before the ruled table was measured; no child touches it); the cloud's action tool name (#31515) | `(package, name)` | D3 resolution; D6 face spelling |
94+
| **3 — joined by the addendum of 2026-11-25** ([#37180](https://github.com/objectstack-ai/objectstack/issues/37180)) | `ai_context` (ADR-0160 D1) | `(package, name)` | D3 resolution; D6 spelling where its name crosses the AI face ([addendum](#addendum-2026-11-25-ai_context-joins-bucket-3)) |
9495
| **4 — environment-authored rows** | mostly `datasource`, and every customer-authored item whose name no package holds for that type (a package-less row bearing a package-held name is that holder's customization, D4) | `(environment, name)`: package null, the implicit environment package | unique in the environment; no rename, no migration |
9596
| **position (ruled separately)** | `position` | one slot per name in the environment | D7 |
9697

@@ -102,6 +103,46 @@ On 2026-11-08 the maintainer redirected it: 「你不能只考虑现状,还要
102103

103104
ADR-0028 D2 proposed deriving physical names from `(namespace, short)` to hide that prefix. The ruling keeps objects literal, because a derived table name is a second spelling that every external reader of the database sees and the authoring layer does not. Behavioural metadata has no such reader: every consumer of a flow, an action or a page is platform code that can carry the package coordinate. So the tier that leaves the platform keeps the name that leaves it, and the tier the platform resolves is resolved by the platform.
104105

106+
#### Addendum (2026-11-25): `ai_context` joins bucket 3
107+
108+
Proposed on card [#37180](https://github.com/objectstack-ai/objectstack/issues/37180), from finding R15 of the contract review of PR #37173 (record [`7150240017`](https://github.com/objectstack-ai/objectstack/pull/37173#issuecomment-7150240017); the review's own numbering, not D8's row R15). `docs/adr/` is Tier H, and this addendum is the maintainer's alone to rule: by the maintainer's own merge of the PR that carries it, or by the maintainer's word on it. Two of its points are no other approver's to decide (points 1 and 3 under "Past the card's words"). It is in force from that merge. It declares and implements nothing. No ruled sentence is rewritten; the table above gains one row, marked with this date.
109+
110+
**The type.** A context pack, `ai_context` ([ADR-0160](./0160-record-scoped-ai-inquiry.md) D1), is identified by `(package, name)` and joins bucket 3 beside `skill`. Two packages may each ship a pack of one name, and each reader reaches the one it means. What this record says of a bucket-3 type holds for it as for `skill`:
111+
112+
- **D2.** A pack name has one package holder inside a namespace. A second is refused at install and `os validate` by child N's predicate. Its list (`packages/objectql/src/namespace-co-owner-names.ts#NAMESPACE_UNIQUE_TYPES`) reserves any further type to the maintainer, so admitting this one is the maintainer's decision (point 3).
113+
- **D3.** A bare pack name resolves by the one rule. It gains no exception.
114+
- **D6.** A pack is listed on no server, so no face is registered for it. Where its name crosses the AI face, in the `context` argument of `get_record_context` and in the candidates a refusal lists, a package's pack is spelled `NS-NAME` by the one derivation (`packages/spec/src/ai/face-name.ts#deriveAiFaceName`), and an environment pack keeps its bare `NAME`. A pack name holds no `-` (`packages/spec/src/kernel/address-grammar.ts#ROUTER_ADDRESSABLE_NAME_PATTERN`), so a face is never also a bare pack name. A face two packs derive is refused at the call, naming each holder. D6 was ruled for names a server lists. A face as the value of an argument widens it, and that is the maintainer's decision (point 1).
115+
- **D8** gains no row: no column stores a pack name. A skill's `context` is a reference inside a `sys_metadata` body (row R17), resolved by D3.
116+
117+
**The tree today** (measured on `main` at `0a1b69c0`). ADR-0160 is Accepted, and its row 5 has landed (#37140): the type (`packages/spec/src/ai/ai-context.zod.ts#AiContextSchema`) and the tool with its pack selection (`packages/services/service-record-context/src/read-set.ts#selectContextPack`). The skill key `context` has not (row 8, #37141). `ai_context` is in none of the lists named here, so the type meets this:
118+
119+
- The registry keeps each package's item (`PACKAGE:NAME`, TL;DR 2). **The metadata service keeps one copy per name**, the one registered last, for every type outside `packages/spec/src/api/protocol.zod.ts#PACKAGE_SLOTTED_METADATA_TYPES` (the rule is `packages/metadata/src/package-slotted-store.ts#storeWriteKey`). `skill` is in that list.
120+
- The one rule resolves no type outside `packages/core/src/package-scoped-resolution.ts#PACKAGE_SCOPED_TYPES` (it throws for one), and a by-name read consults `(package, name)` only for a type in `packages/objectql/src/package-scoped-read.ts#PACKAGE_SCOPED_READ_TYPES`. `skill` is in both.
121+
- Pack selection holds no package and asks no rule. It keeps the parsed packs rooted on `objectName` and matches `context` to a pack's bare `name`.
122+
123+
**What changes with the bucket.**
124+
125+
- **The service's copy** becomes one slot per `(package, name)` (D4), so one package's pack no longer replaces another's before any reader sees it.
126+
- **Overlays.** No channel opens: a pack takes no environment overlay (ADR-0160 D1, on [ADR-0005](./0005-metadata-customization-overlay.md)'s ai row) and joins no declared-override list ([ADR-0146](./0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md) D2; ADR-0160 D1, "Later work"). So a package-less row under a name a package ships is not served, today and after: the type opens no overlay channel, so the package's definition is sealed (ADR-0131 D6), and the type is not in `packages/metadata-protocol/src/protocol-package-bindings.ts#SEALED_ROW_SERVED_OVERRIDE_TYPES`, the types whose declared override is served from its row. That is D4 as for `skill`: the row is that holder's customization and never a second pack. It is read at `(type, name)`, whatever the row's root, so an environment pack stops being a pack when a package that holds its name installs, even when the two root on different objects. The follow-up card states this and measures it. What the bucket changes is the item such a row is read against. Today it is whichever package's item a by-name lookup finds. By D4 it is the one holder's item. Under a name two packages hold, the row is bound to neither and reported (row R15), ⛔ never bound on a guess. Under a name no package holds, it is the environment's own pack (bucket 4).
127+
- **Owner stamps** do not change. The registration stamps every item with the package that registers it, and the one judge refuses a body that names another owner (`packages/spec/src/kernel/collection-item-owner-stamp.ts#judgeCollectionItemOwnerStamp`). The pack's collection, `aiContexts`, is among the collections it judges. The stamp is the holder the moved readers read.
128+
- **Uninstall.** The registry already withdraws by package (`packages/objectql/src/registry.ts#uninstallPackage`). The service's half changes with the slot (`packages/metadata/src/metadata-manager.ts#unregisterPackage`). Today it removes the name's one copy when that copy is the uninstalled package's, though another package still ships the name, and removes nothing when it is not. With a slot per package it drops that package's pack and keeps the other's.
129+
130+
**The readers that move.** ⛔ This addendum moves none.
131+
132+
1. **Pack selection behind `get_record_context`** (ADR-0160 D4, step 3; `selectContextPack`, above). The candidates stay the packs rooted on `objectName`, so a pack on another root is still answered as no pack. Among them `context` is read as a skill prompt's name is (`packages/mcp/src/skill-prompts.ts#lookupSkillPrompt`): a face answers its one pack; otherwise a bare name resolves as for a caller with no package (D3), to the environment's own pack, else the one package holder, else a refusal that names each candidate by its face (`409`, D5). With `context` omitted, D4's "several" answer spells each pack's name as its face; what else that answer carries is D4's.
133+
2. **The skill key `context`** (ADR-0160 D8; row 8, #37141, not yet on `main`). It is a reference between items: a bare name, resolved by D3 from the skill's package, and as a caller with no package for an environment skill. ⛔ The key gains no qualified spelling (D3). The author surfaces that validate a skill judge it by the same rule. Each reader hands on the pack the reference resolved to, by its face: the MCP skill prompt, in the `context` of the arguments it carries, and the in-app runtime in cloud (row 9; carrier: cloud).
134+
3. **The `/meta` doors and the service's store** follow the lists: the by-name read, its `?package=` exact qualifier, and the slot.
135+
136+
**Follow-up: [#37216](https://github.com/objectstack-ai/objectstack/issues/37216), after the merge.** It adds `ai_context` to the four lists named above and moves reader 1. It lands before row 8 (#37141): row 8 wires the key by this rule from its first day, and the one rule throws for a type outside `PACKAGE_SCOPED_TYPES`. Its narrowings are declared on that card, each with a count measured on the tree it lands on: D2's install refusal; the `/meta` by-name read, where a bare name two packages hold is refused and `getItem` serves the first today; and the package-less row under a held name (Overlays, above). Reader 1 narrows nothing: the interim rule already refuses a bare name two packs share on a root, and the face then reaches each. Nothing first-party is refused. On `main` at `0a1b69c0` the one declarer is `examples/app-showcase`: one package, with two packs of different names on different roots (`examples/app-showcase/src/ai/record-context.ai-context.ts`). `objectstack-ai/hotcrm` at `b1ea6fcc` declares none.
137+
138+
**Interim rule, until reader 1 moves.** Two parsed packs that share a name and a root are never chosen between (`selectContextPack`, on `main`). A `context` that names them is refused (`409`). So is an omitted `context` when theirs is the only name on the root. Where the root has another name too, an omitted `context` gets D4's "several" answer, which lists the shared name once. ⛔ The first match is taken in none of these: that is the silent first match this record retires (D5) and ADR-0160 D4's "No silent fallback". Declining this addendum leaves that rule as the only one, and no list changes.
139+
140+
**Past the card's words.** The card says "beside `skill`". Points 1 and 3 go past that, and each is the maintainer's decision alone: the merge accepts it, or the maintainer strikes it. Point 2 is no new decision.
141+
142+
1. **Bucket 3, not 2 (the maintainer's decision).** A pack's name is typed by a model, so it needs a spelling on the AI face though no face is listed. This widens D6 from the names a server lists to the value of an argument, and `context` in ADR-0160 D4 and D8 then holds a face or a bare name, where it held a pack's `name`. Not taken: bucket 2 with an optional `namespace` input on the tool (D5's `run_action` form), which adds a member to ADR-0160 D4's input and to D8's argument object. The face adds none.
143+
2. **The root narrows before D3 picks (no new decision).** It follows from ADR-0160 D4. Step 3 selects among the packs whose `object` is `objectName`, and gives one answer for a name no pack has and for a pack rooted on another object. Its naming bound lets no refusal name a pack beyond those rooted on an object the caller is served. So the holders D3 judges are those whose pack of that name is rooted on `objectName`.
144+
3. **Child N's predicate carries D2's refusal (the maintainer's decision).** The type never had a phase-1 one-holder rule, so D9 has nothing to narrow for it, and child N's list is the carrier. That list's header reserves a further type to the maintainer.
145+
105146
### D2 — The package coordinate: identity is the package id, the address is the namespace
106147

107148
- **Identity** is `(package id, type, name)`: the registry's composite key, ADR-0048 §3.1's globally unique package id, and every new stored package column (D8) holds the package id.

‎docs/adr/0160-record-scoped-ai-inquiry.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ ADR-0088's three clauses:
9292
2. **Declarative governability.** It ships from a package as a standalone file and is authored at runtime through the metadata API and Studio (row 7).
9393
3. **A real consumer.** The render service behind `get_record_context` reads it and lands in the same PR as the type (row 5). Row 8 and row 9 add readers.
9494

95+
> **Cross-reference (2026-11-25, objectstack#37180).** Which package's pack a name means, in [D4](#d4)'s pack selection and in [D8](#d8)'s `context` key, is ADR-0150's question: its [addendum of 2026-11-25](./0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md#addendum-2026-11-25-ai_context-joins-bucket-3) puts `ai_context` in bucket 3 beside `skill` and carries the interim rule for two packs that share a name and a root. Its follow-up, objectstack#37216, lands before row 8 (objectstack#37141). No sentence of this record is changed.
96+
9597
**v1 keys.** The schema is strict: an unknown key is refused at parse. Every key is read by the render service in row 5 (ADR-0049). The schema also bounds a pack's size — how many lookups its `fields` lists and how many `related` entries it holds — so a pack over a bound is refused at parse and nothing is cut silently at call time. Row 5 fixes the numbers and says how they stand against the record tools' per-call caps.
9698

9799
| Key | Meaning | Reader (row 5) |

0 commit comments

Comments
 (0)