From b63e9e65eca7aab3abcc302ff9e9a6dc4b806590 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 03:23:15 +0000 Subject: [PATCH 1/3] docs(adr): ADR-0150 addendum puts ai_context in bucket 3 beside skill A dated addendum under D1 of ADR-0150 proposes that the context pack type of ADR-0160 is identified by (package, name), as skill is. It adds one dated row to the D1 table and an Amended clause to the status line, and rewrites no ruled sentence. It says what the bucket changes for the metadata service's copy, overlays, owner stamps and uninstall, names the readers that move without moving any, names the one follow-up card, and carries the interim rule: two parsed packs that share a name and a root are refused with one answer. ADR-0160 gains one cross-reference note under D1 and no changed sentence. Docs only: no schema, no code, no changeset. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK --- ...package-objects-keep-the-literal-prefix.md | 42 ++++++++++++++++++- docs/adr/0160-record-scoped-ai-inquiry.md | 2 + 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md b/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md index d5e85aac36a..e72deda5503 100644 --- a/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md +++ b/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md @@ -1,6 +1,6 @@ # ADR-0150: Behavioural metadata is addressed by (package, name) — objects keep the literal prefix; ADR-0028 re-opened for the behavioural tier -**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. +**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. An authorized approval or the maintainer's merge of the PR that carries it is the ruling. No ruled sentence is rewritten. - **Date**: 2026-11-08 - **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: 「你不能只考虑现状,还要 | **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 | | **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 | | **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 | +| **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)) | | **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 | | **position (ruled separately)** | `position` | one slot per name in the environment | D7 | @@ -102,6 +103,45 @@ On 2026-11-08 the maintainer redirected it: 「你不能只考虑现状,还要 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. +#### Addendum (2026-11-25): `ai_context` joins bucket 3 + +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: an authorized approval or the maintainer's merge of the PR that carries this addendum is the ruling, and 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. + +**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`: + +- **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, and this addendum admits this one. +- **D3.** A bare pack name resolves by the one rule. It gains no exception. +- **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 face two packs derive is refused at the call, naming each holder. +- **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. + +**The tree today** (measured on `main` at `3b4f0b98`). ADR-0160 is Proposed. Nothing outside `docs/adr/` declares the type, the tool or the skill key `context`: the first two arrive with PR #37173 (ADR-0160 row 5, #37140), the key with row 8 (#37141). What a new type meets is this: + +- 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. +- 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. + +**What changes with the bucket.** + +- **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. +- **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"). What changes is the item a package-less row is read against. Today that is the name's one copy in the service, whichever package registered it. By D4, under a name one package holds, the row is that holder's customization and never a second pack. Under a name two packages hold it 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). +- **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`); PR #37173 adds the pack's collection to the judged ones. The stamp is the holder the moved readers read. +- **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. + +**The readers that move.** ⛔ This addendum moves none. + +1. **Pack selection behind `get_record_context`** (ADR-0160 D4, step 3; the pack selection of PR #37173 (#37140), not on `main`). 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 names each pack by its face. +2. **The skill key `context`** (ADR-0160 D8; row 8, #37141; not 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). +3. **The `/meta` doors and the service's store** follow the lists: the by-name read, its `?package=` exact qualifier, and the slot. + +**Follow-up, one card, after the merge.** It adds `ai_context` to the four lists named above and moves reader 1, after PR #37173 lands. Row 8 wires the key by this rule from its first day, so it needs the type in `PACKAGE_SCOPED_TYPES` first. Its narrowings are declared on that card, each with its measured count: D2's install refusal, and what joining the lists changes on the `/meta` by-name read, where a bare name two packages hold is refused and `getItem` serves the first today. 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: no file of `main` at `3b4f0b98` or of `objectstack-ai/hotcrm` at `48082b7` declares the type. + +**Interim rule, until reader 1 moves.** Two parsed packs that share a name and a root are refused with one answer, whether `context` names them or is omitted. ⛔ The first match is never taken: that is the silent first match this record retires (D5) and ADR-0160 D4's "No silent fallback". PR #37173 carries the rule (read at its head `74e176d8`). Declining this addendum leaves that rule as the only one, and no list changes. + +**Settled here past the card's words**, for the approver to accept with the merge or strike: + +1. **Bucket 3, not 2.** The card says "beside `skill`". A pack's name is typed by a model, so it needs a spelling on the AI face though no face is listed. 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. +2. **The root narrows before D3 picks.** The holders judged are those whose pack of that name is rooted on `objectName`. Judged over every holder of the name, a refusal would name a pack on an object the caller was never shown to be served, against ADR-0160 D4's naming bound. +3. **Child N's predicate carries D2's refusal.** The type never had a phase-1 one-holder rule, so D9 has nothing to narrow for it. + ### D2 — The package coordinate: identity is the package id, the address is the namespace - **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. diff --git a/docs/adr/0160-record-scoped-ai-inquiry.md b/docs/adr/0160-record-scoped-ai-inquiry.md index 5db40ad7759..a7b45fe9fcd 100644 --- a/docs/adr/0160-record-scoped-ai-inquiry.md +++ b/docs/adr/0160-record-scoped-ai-inquiry.md @@ -86,6 +86,8 @@ ADR-0088's three clauses: 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). 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. +> **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. No sentence of this record is changed. + **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. | Key | Meaning | Reader (row 5) | From 11793695f5096ad42bd1e2a192c1d0974d630cea Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 03:36:22 +0000 Subject: [PATCH 2/3] docs(adr): ADR-0150 addendum reads ADR-0160 as merged, and leaves the rest of its several-packs answer to it Two sentences of the addendum, corrected against the tree. ADR-0160 is on main: it merged the day before, and only its status keyword still reads Proposed. And where the addendum says how the several-packs answer spells a pack, it now changes the name's spelling alone and leaves what else that answer carries to ADR-0160, so it holds whichever of the two records is amended first. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK --- ...ta-addressed-by-package-objects-keep-the-literal-prefix.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md b/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md index e72deda5503..864d6b29892 100644 --- a/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md +++ b/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md @@ -114,7 +114,7 @@ Proposed on card [#37180](https://github.com/objectstack-ai/objectstack/issues/3 - **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 face two packs derive is refused at the call, naming each holder. - **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. -**The tree today** (measured on `main` at `3b4f0b98`). ADR-0160 is Proposed. Nothing outside `docs/adr/` declares the type, the tool or the skill key `context`: the first two arrive with PR #37173 (ADR-0160 row 5, #37140), the key with row 8 (#37141). What a new type meets is this: +**The tree today** (measured on `main` at `3b4f0b98`). ADR-0160 is on `main`, merged with #37115; its status keyword still reads Proposed. Nothing outside `docs/adr/` declares the type, the tool or the skill key `context`: the first two arrive with PR #37173 (ADR-0160 row 5, #37140), the key with row 8 (#37141). What a new type meets is this: - 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. - 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. @@ -128,7 +128,7 @@ Proposed on card [#37180](https://github.com/objectstack-ai/objectstack/issues/3 **The readers that move.** ⛔ This addendum moves none. -1. **Pack selection behind `get_record_context`** (ADR-0160 D4, step 3; the pack selection of PR #37173 (#37140), not on `main`). 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 names each pack by its face. +1. **Pack selection behind `get_record_context`** (ADR-0160 D4, step 3; the pack selection of PR #37173 (#37140), not on `main`). 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. 2. **The skill key `context`** (ADR-0160 D8; row 8, #37141; not 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). 3. **The `/meta` doors and the service's store** follow the lists: the by-name read, its `?package=` exact qualifier, and the slot. From deee29af32843420324bd0fa974337161838ba5f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 05:31:03 +0000 Subject: [PATCH 3/3] docs(adr): ADR-0150 addendum re-measured on main; two of its points are the maintainer's alone The addendum's reading of the tree was taken before the context pack type, its tool and the ADR-0160 amendment landed. Every "today" sentence is re-measured on current main and reworded: the type and the pack selection are cited as merged code, the showcase app's two packs are the one first-party declarer and are not refused, and the follow-up card is named with its order before the skill key. The record now says who rules what. The face spelling in the context argument widens D6, and admitting the type to the namespace-unique list is reserved to the maintainer, so the addendum is ruled by the maintainer's own merge or word. That the root narrows the candidates is stated as following from ADR-0160 D4, not as a new decision. Review nits folded in: the interim rule no longer says "one answer" where an omitted context with a third pack gets the several-packs answer; the overlays bullet says a package-less row under a shipped name is not served; the no-hyphen premise of the face is anchored. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK --- ...package-objects-keep-the-literal-prefix.md | 31 ++++++++++--------- docs/adr/0160-record-scoped-ai-inquiry.md | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md b/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md index 864d6b29892..4c260982313 100644 --- a/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md +++ b/docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md @@ -1,6 +1,6 @@ # ADR-0150: Behavioural metadata is addressed by (package, name) — objects keep the literal prefix; ADR-0028 re-opened for the behavioural tier -**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. An authorized approval or the maintainer's merge of the PR that carries it is the ruling. No ruled sentence is rewritten. +**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. - **Date**: 2026-11-08 - **Supersedes**: [ADR-0028](./0028-metadata-naming-and-namespace-isolation.md) in part (D1 and D3, for buckets 2–4) @@ -105,42 +105,43 @@ ADR-0028 D2 proposed deriving physical names from `(namespace, short)` to hide t #### Addendum (2026-11-25): `ai_context` joins bucket 3 -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: an authorized approval or the maintainer's merge of the PR that carries this addendum is the ruling, and 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. +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. **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`: -- **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, and this addendum admits this one. +- **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). - **D3.** A bare pack name resolves by the one rule. It gains no exception. -- **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 face two packs derive is refused at the call, naming each holder. +- **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). - **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. -**The tree today** (measured on `main` at `3b4f0b98`). ADR-0160 is on `main`, merged with #37115; its status keyword still reads Proposed. Nothing outside `docs/adr/` declares the type, the tool or the skill key `context`: the first two arrive with PR #37173 (ADR-0160 row 5, #37140), the key with row 8 (#37141). What a new type meets is this: +**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: - 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. - 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. +- 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`. **What changes with the bucket.** - **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. -- **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"). What changes is the item a package-less row is read against. Today that is the name's one copy in the service, whichever package registered it. By D4, under a name one package holds, the row is that holder's customization and never a second pack. Under a name two packages hold it 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). -- **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`); PR #37173 adds the pack's collection to the judged ones. The stamp is the holder the moved readers read. +- **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). +- **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. - **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. **The readers that move.** ⛔ This addendum moves none. -1. **Pack selection behind `get_record_context`** (ADR-0160 D4, step 3; the pack selection of PR #37173 (#37140), not on `main`). 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. -2. **The skill key `context`** (ADR-0160 D8; row 8, #37141; not 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). +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. +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). 3. **The `/meta` doors and the service's store** follow the lists: the by-name read, its `?package=` exact qualifier, and the slot. -**Follow-up, one card, after the merge.** It adds `ai_context` to the four lists named above and moves reader 1, after PR #37173 lands. Row 8 wires the key by this rule from its first day, so it needs the type in `PACKAGE_SCOPED_TYPES` first. Its narrowings are declared on that card, each with its measured count: D2's install refusal, and what joining the lists changes on the `/meta` by-name read, where a bare name two packages hold is refused and `getItem` serves the first today. 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: no file of `main` at `3b4f0b98` or of `objectstack-ai/hotcrm` at `48082b7` declares the type. +**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. -**Interim rule, until reader 1 moves.** Two parsed packs that share a name and a root are refused with one answer, whether `context` names them or is omitted. ⛔ The first match is never taken: that is the silent first match this record retires (D5) and ADR-0160 D4's "No silent fallback". PR #37173 carries the rule (read at its head `74e176d8`). Declining this addendum leaves that rule as the only one, and no list changes. +**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. -**Settled here past the card's words**, for the approver to accept with the merge or strike: +**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. -1. **Bucket 3, not 2.** The card says "beside `skill`". A pack's name is typed by a model, so it needs a spelling on the AI face though no face is listed. 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. -2. **The root narrows before D3 picks.** The holders judged are those whose pack of that name is rooted on `objectName`. Judged over every holder of the name, a refusal would name a pack on an object the caller was never shown to be served, against ADR-0160 D4's naming bound. -3. **Child N's predicate carries D2's refusal.** The type never had a phase-1 one-holder rule, so D9 has nothing to narrow for it. +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. +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`. +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. ### D2 — The package coordinate: identity is the package id, the address is the namespace diff --git a/docs/adr/0160-record-scoped-ai-inquiry.md b/docs/adr/0160-record-scoped-ai-inquiry.md index 5996eabf433..ddbc3fe798d 100644 --- a/docs/adr/0160-record-scoped-ai-inquiry.md +++ b/docs/adr/0160-record-scoped-ai-inquiry.md @@ -92,7 +92,7 @@ ADR-0088's three clauses: 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). 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. -> **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. No sentence of this record is changed. +> **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. **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.