Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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. 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. · **Amended** (2026-11-25, [#37325](https://github.com/objectstack-ai/objectstack/issues/37325)): an [addendum under D1](#addendum-2026-11-25-knowledge_source-joins-bucket-3) puts the knowledge source `knowledge_source` (ADR-0161 K4) in bucket 3 beside `skill` and `ai_context`, with one dated row added to the D1 table, on the maintainer's ruling of that day: decision card tapped **B 「按应用+名字区分,都保留」** (seat record [`7168239918`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7168239918) on #37304). It says what the bucket changes for the metadata service's copy, the readers of a source name and the keys of a source's index, and lists the points that go past the ruling's words: the one that is the maintainer's is accepted by the maintainer's merge of the PR that carries it, or struck first. 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. · **Amended** (2026-11-25, [#37325](https://github.com/objectstack-ai/objectstack/issues/37325)): an [addendum under D1](#addendum-2026-11-25-knowledge_source-joins-bucket-3) puts the knowledge source `knowledge_source` (ADR-0161 K4) in bucket 3 beside `skill` and `ai_context`, with one dated row added to the D1 table, on the maintainer's ruling of that day: decision card tapped **B 「按应用+名字区分,都保留」** (seat record [`7168239918`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7168239918) on #37304). It says what the bucket changes for the metadata service's copy, the readers of a source name and the keys of a source's index, and lists the points that go past the ruling's words: the one that is the maintainer's is accepted by the maintainer's merge of the PR that carries it, or struck first. No ruled sentence is rewritten. · **Amended** (2026-11-26, [#37545](https://github.com/objectstack-ai/objectstack/issues/37545)): two dated notes under "Past the ruling's words" in the [`knowledge_source` addendum](#addendum-2026-11-25-knowledge_source-joins-bucket-3) record the maintainer's ruling of that day on its point 6 and on the last part of its point 4: 「两处都选 A」 (seat record [`7192063608`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7192063608) on #37304). A knowledge source registered in code belongs to no package, and code names one of two packages' same-named sources by the face. 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)
Expand Down Expand Up @@ -194,8 +194,10 @@ Ruled by the maintainer on card [#37304](https://github.com/objectstack-ai/objec
2. **The name grammar (no new decision).** D5 refuses a `_`-led name for every bucket 2/3 type, and today's `id` pattern admits one (`packages/spec/src/ai/knowledge-source.zod.ts#KnowledgeSourceSchema`). 3a's `name` takes the bucket's pattern, and that narrowing is declared beside ADR-0161 K6's.
3. **The candidates of a `409` (no new decision).** ADR-0161 K9 has the tool refuse an unexposed source `NOT_FOUND`, in the sentence an unknown id gets. So D3 judges the sources the tool may search, and a `409` names none beyond them.
4. **What each shape carries (open).** The ruled option puts `NS-NAME` in `sources`. ADR-0161 K6, item 5, keeps the spellings `sourceIds`, `sources[].id` and `sourceId` and says they carry the source's name. Not in the ruling's words: what a hit's `sourceId` and `documentId` carry on the tool's answer, what `sourceId` carries on a stored document and on an adapter's hit, and what the by-name members of `IKnowledgeService` take from a caller in code.
> **Amendment note (2026-11-26, [#37545](https://github.com/objectstack-ai/objectstack/issues/37545)).** The last part is ruled: **A**. The maintainer ruled on the decision card 「#37304 两个分叉(代码注册源归属、同名源寻址)怎么定?」 at 12:26Z, verbatim 「两处都选 A」 (seat record [`7192063608`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7192063608) on #37304). The option read 「代码注册的源不归包、按 (包,名) 判重;代码用 包-名字 寻址,接口签名不变。」, and the record states it for this point as: "Code names one of two packages' same-named sources by the face (`NS-NAME`), read by the tool's one rule. A face answers its one source, else a bare name resolves by D3, else a coded `409` names the candidates by face. `search` returns hits whose `sourceId` is the face. No `IKnowledgeService` signature changes." Not taken, as the Step 0 record put them ([`7191722341`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7191722341) on #37304): B, a `packageId` option beside the name, and C, the index key. Only that part is ruled; the rest of this point stays 3a's to state.
5. **Which coordinate a key carries, and what rebuilds (open).** The ruling says "keyed by package". D2 has two coordinates: the package id, which is identity and what every stored package column holds (D8), and the namespace, which is the address. Only the first tells every two packages apart, because the shareable namespaces admit two holders of one name. 3a states the key, how a document id and a table name spell it inside their length limits, and what removes an index left under the old key. ADR-0161 K7 starts a rebuild on a changed fingerprint or recipe hash, and a key is in neither; it builds a source an adapter holds nothing for, which a new key is.
6. **A registration in code (open).** `KnowledgeServicePlugin({ sources })` and `registerSource` carry no package, and ADR-0161's point 3 keeps that door. The ruling does not say which holder such a source is: the environment's, the platform's (as D4 reads an owner-less engine function), or the package of the plugin that registers it. Nor does it say whether point 3's refusal of a second arrival then compares names or `(package, name)`.
> **Amendment note (2026-11-26, [#37545](https://github.com/objectstack-ai/objectstack/issues/37545)).** Ruled: **A**. The maintainer ruled on the decision card 「#37304 两个分叉(代码注册源归属、同名源寻址)怎么定?」 at 12:26Z, verbatim 「两处都选 A」 (seat record [`7192063608`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7192063608) on #37304). The option read 「代码注册的源不归包、按 (包,名) 判重;代码用 包-名字 寻址,接口签名不变。」, and the record states it for this point as: "A knowledge source registered in code belongs to no package. It is read as the environment's own source and takes the one package-less slot of its name, keeping its bare key, bare face and existing index. The duplicate refusal compares `(package, name)`. A code registration and an environment-authored source of one name are the same slot, so the second arrival is refused, naming both doors. A code registration and a package's source of one name are two sources, and both are kept. A bare name answers the package-less one (D3); `NS-NAME` answers the package's." Not taken, as the Step 0 record put them ([`7191722341`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7191722341) on #37304): B, the platform's holder, and C, the package of the plugin that registers it.
7. **An environment source under a name a package later ships (open).** D4 reads its row as that holder's customization, and the type opens no channel, so the row is not served: it stops being a source, as an environment pack does, and its index is the index of no source. The ruling covers two packages, not this pair. 3a states and measures it, and says what becomes of that index.

### D2 — The package coordinate: identity is the package id, the address is the namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ The package whose README and tests carry the `http` shape, `knowledge-ragflow`,
**▲ Point 3, past the rulings' words — registration in code stays a door for the same schema.** The epic's phase 2 says sources are still registered in code, and row 3 adds the metadata door. This record reads "one strict contract" as one shape, not one door: `KnowledgeServicePlugin({ sources })` and `registerSource` remain, they take the type's schema and nothing else, and they parse with it (today `registerSource` stores what it is given without a parse). **A name is one source, whichever door it came through**: a registration from one door never replaces a source that arrived through the other. Today `registerSource` overwrites an existing id with a warning. Once a governed item and a code registration can carry one name, that is a silent override of governed metadata, so the second arrival is refused with a coded refusal that names both. A metadata item that reloads its own earlier version is not a second arrival. Row 3 writes the refusal's code and words. Whether the code door is closed once every source can be metadata is not decided here.

> **Cross-reference (2026-11-25, [#37325](https://github.com/objectstack-ai/objectstack/issues/37325)).** Which package's source a name means is ADR-0150's question, and this record does not ask it. Its [addendum of 2026-11-25](./0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md#addendum-2026-11-25-knowledge_source-joins-bucket-3) puts `knowledge_source` in bucket 3 beside `skill` and `ai_context`, on the maintainer's ruling 「按应用+名字区分,都保留」 (record [`7168239918`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7168239918) on #37304): a source is identified by `(package, name)`, two packages that ship one source name each keep their source, and the keys of a source's index carry the package. Point 3 above is read with it: "A name is one source" holds between two packages by keeping both, and which holder a registration in code is stays open there, for row 3. So is [K6](#k6--adr-0087-dispositions): item 4 stays true of the rename, and the re-keying is what moves a document id and rebuilds an index; item 5 keeps its spellings, and the value each carries for a package's source is that addendum's and row 3's to state. Row 3 ([#37304](https://github.com/objectstack-ai/objectstack/issues/37304)) follows the addendum. No sentence of this record is changed.
>
> **Cross-reference (2026-11-26, [#37545](https://github.com/objectstack-ai/objectstack/issues/37545)).** Which holder a registration in code is was ruled on 2026-11-26: **A**, by the maintainer's word 「两处都选 A」 (record [`7192063608`](https://github.com/objectstack-ai/objectstack/issues/37304#issuecomment-7192063608) on #37304). ADR-0150's addendum carries the ruling as the dated note under [point 6 of "Past the ruling's words"](./0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md#addendum-2026-11-25-knowledge_source-joins-bucket-3). The record states it as: "A knowledge source registered in code belongs to no package. It is read as the environment's own source and takes the one package-less slot of its name, keeping its bare key, bare face and existing index. The duplicate refusal compares `(package, name)`. A code registration and an environment-authored source of one name are the same slot, so the second arrival is refused, naming both doors. A code registration and a package's source of one name are two sources, and both are kept." Point 3 above is read with it. No sentence of this record is changed.

### K5 — A source lists its content fields; embedding is egress

Expand Down
Loading