From 15616e2fced8154cca508a7581fd3f6c370ac369 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 08:41:45 +0000 Subject: [PATCH 1/3] =?UTF-8?q?docs(adr):=20ADR-0161=20dated=20note=20?= =?UTF-8?q?=E2=80=94=20the=20document=20hash=20covers=20the=20organization?= =?UTF-8?q?=20of=20a=20document=20that=20has=20one=20(K8=20items=202=20and?= =?UTF-8?q?=209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit K8 rule 3 names a dated note as the form of a change to a decided shape. The note under K8's table records that item 2's hash covers the document as the service assembles it, which since item 9 includes organizationId when the document has one; a document without one hashes as before, so the version prefix is not bumped. It also carries the rule for a later optional member and the sentence an adapter author needs: an adapter that stores docHash stores organizationId from the same version on. Claude-Session: https://claude.ai/code/session_01QSeKYkXwZ3ECV8yacsjMJM Co-authored-by: Claude --- ...-record-return-knowledge-source-is-a-governed-type.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md index 44d0d128afd..f8dd8b5eb5e 100644 --- a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md +++ b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md @@ -16,6 +16,7 @@ - **Builds on**: [ADR-0005](./0005-metadata-customization-overlay.md) (one Zod source per type), [ADR-0049](./0049-no-unenforced-security-properties.md) and [ADR-0078](./0078-no-silently-inert-metadata.md) (a declared key is enforced or it is not declared; a key lands with its reader), [ADR-0087](./0087-metadata-protocol-upgrade-contract.md) (conversions, tombstones and the migration chain), [ADR-0088](./0088-metadata-kind-admission-and-retirement.md) (the kind admission test), [ADR-0090](./0090-permission-model-v2-concept-convergence.md) D10 (an agent reads as the principal it acts for), [ADR-0112](./0112-error-code-vocabulary-and-ledger.md) (coded refusals), [ADR-0149](./0149-ai-answers-business-questions-through-the-dataset-semantic-layer.md) D2 (one tool definition, one executor, every transport), [ADR-0159](./0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md) (the latest kind admission, followed for the form of K4), and [`ADR-0057-system-data-lifecycle-and-retention`](./0057-system-data-lifecycle-and-retention.md) (the reap guard the knowledge plugin registers). - **Leaves unchanged**: permission-aware retrieval (every object-source hit is re-read as the caller, and a source is searched for a caller only after the exposure and field-level admission of PR #36850); the reap guard of #4672 as landed; the signature and return type of `IKnowledgeService.search`; the settings shape of #33933 (knowledge settings only where the service is mounted), which #37102 keeps: without the capability token there is no knowledge service and no knowledge settings page; the open AI door, which stays MCP-only (cloud ADR-0119 D4). - **Inputs**: every code and docs text quoted below was read on `objectstack-ai/objectstack` `main` at `254e396a29`, the commit this record's branch starts from. Positions are in [Readings](#readings-taken-at-254e396a29). PR #36823 and PR #36850 are merged and are in that tree; PR #37075 is open and edits §6 of `content/docs/protocol/knowledge.mdx`, so the §6 quotations may move when it lands. +- **Amended** (2026-11-25, [#37097](https://github.com/objectstack-ai/objectstack/issues/37097)): a dated note under the table of [K8](#k8--the-contract-additions-decided-item-by-item) records that the document hash of item 2 covers `organizationId` when the document has one (item 9), with no version bump. The status line above is left as it is. --- @@ -317,6 +318,14 @@ The epic holds the contract shut until this record merges ("No new adapter-contr | 16 | `knowledge-turso` | Accepted as a rule | No member beyond items 1, 5, 7, 8 and 9. Its generation table and lock row stay inside the adapter (K7, rule 2). | #37107 | | 17 | (not in the input) A typed scope filter | Deferred | A typed form for what is an opaque `filter` record on `AdapterSearchOptions` today, built by the service from `scope: [{ object, ids }]`. | row 11 | +> **Note (2026-11-25, [#37097](https://github.com/objectstack-ai/objectstack/issues/37097), built by [#37256](https://github.com/objectstack-ai/objectstack/pull/37256)) — items 2 and 9: the hash covers the organization of a document that has one.** Item 2's hash covers the document as the service assembles it. The parenthesis "content, title, metadata" was the whole assembled document when item 2 was accepted. Item 9 adds `organizationId` to the assembled document when the document has one, and the hash covers it then. A document without one hashes byte for byte as it did before, so the version prefix is not bumped. +> +> - **Why.** A document that gains an organization, loses it or moves to another one gets a new hash, so a complete walk never leaves a stale organization on a stored document. The other answer kept the parenthesis and bumped the version. It leaves a later change of organization to the events alone, and missed events are the hole reconcile exists to close (K1). +> - **A later optional member** enters the hash the same way, left out when it is absent, or the version is bumped. +> - **An adapter that stores `docHash` stores `organizationId` from the same version of the adapter on.** Otherwise, once it starts to read item 9, a complete walk skips its documents, because the hashes match, and a search filtered by organization never ranks them. +> +> Item 9's first reader, #37097, is built by PR #37256, and this change to item 2 lands with it. The reasoning is contract review [`7157191417`](https://github.com/objectstack-ai/objectstack/pull/37256#issuecomment-7157191417) on that PR (its M1 and S2). The table is left as written; read items 2 and 9 with this note. + **What "capabilities" became.** #36990's rule named "capabilities" among the members that waited for this record. Two things answer it. A method that is absent is the capability signal for listing, dropping, status, and the start and end of a build: the service asks whether the method is there. One flag covers what a method cannot say, `capabilities.chunks` (item 5). No wider descriptor is added. **What counts as a member** (for rule 5 below, and for the epic's "no new adapter-contract member"). A member is anything an adapter author must read to be correct: From dd1756af23aa77d637584512556706c9a902ace4 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 08:54:17 +0000 Subject: [PATCH 2/3] =?UTF-8?q?docs(adr):=20ADR-0161=20note=20=E2=80=94=20?= =?UTF-8?q?say=20what=20the=20parenthesis=20listed,=20and=20scope=20the=20?= =?UTF-8?q?later-member=20rule=20to=20what=20assembly=20sets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three wording changes inside the dated note under K8's table: the parenthesis listed everything assembly set on a document, its identity aside; the rule for a later optional member is about a member that assembly sets; and the note says "complete reindex", the words the spec TSDoc on organizationId uses for the same walk. Claude-Session: https://claude.ai/code/session_01QSeKYkXwZ3ECV8yacsjMJM Co-authored-by: Claude --- ...t-record-return-knowledge-source-is-a-governed-type.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md index f8dd8b5eb5e..1bb70eff299 100644 --- a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md +++ b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md @@ -318,11 +318,11 @@ The epic holds the contract shut until this record merges ("No new adapter-contr | 16 | `knowledge-turso` | Accepted as a rule | No member beyond items 1, 5, 7, 8 and 9. Its generation table and lock row stay inside the adapter (K7, rule 2). | #37107 | | 17 | (not in the input) A typed scope filter | Deferred | A typed form for what is an opaque `filter` record on `AdapterSearchOptions` today, built by the service from `scope: [{ object, ids }]`. | row 11 | -> **Note (2026-11-25, [#37097](https://github.com/objectstack-ai/objectstack/issues/37097), built by [#37256](https://github.com/objectstack-ai/objectstack/pull/37256)) — items 2 and 9: the hash covers the organization of a document that has one.** Item 2's hash covers the document as the service assembles it. The parenthesis "content, title, metadata" was the whole assembled document when item 2 was accepted. Item 9 adds `organizationId` to the assembled document when the document has one, and the hash covers it then. A document without one hashes byte for byte as it did before, so the version prefix is not bumped. +> **Note (2026-11-25, [#37097](https://github.com/objectstack-ai/objectstack/issues/37097), built by [#37256](https://github.com/objectstack-ai/objectstack/pull/37256)) — items 2 and 9: the hash covers the organization of a document that has one.** Item 2's hash covers the document as the service assembles it. The parenthesis "content, title, metadata" was everything assembly set on a document, its identity aside, when item 2 was accepted. Item 9 adds `organizationId` to the assembled document when the document has one, and the hash covers it then. A document without one hashes byte for byte as it did before, so the version prefix is not bumped. > -> - **Why.** A document that gains an organization, loses it or moves to another one gets a new hash, so a complete walk never leaves a stale organization on a stored document. The other answer kept the parenthesis and bumped the version. It leaves a later change of organization to the events alone, and missed events are the hole reconcile exists to close (K1). -> - **A later optional member** enters the hash the same way, left out when it is absent, or the version is bumped. -> - **An adapter that stores `docHash` stores `organizationId` from the same version of the adapter on.** Otherwise, once it starts to read item 9, a complete walk skips its documents, because the hashes match, and a search filtered by organization never ranks them. +> - **Why.** A document that gains an organization, loses it or moves to another one gets a new hash, so a complete reindex never leaves a stale organization on a stored document. The other answer kept the parenthesis and bumped the version. It leaves a later change of organization to the events alone, and missed events are the hole reconcile exists to close (K1). +> - **A later optional member that assembly sets** enters the hash the same way, left out when it is absent, or the version is bumped. +> - **An adapter that stores `docHash` stores `organizationId` from the same version of the adapter on.** Otherwise, once it starts to read item 9, a complete reindex skips its documents, because the hashes match, and a search filtered by organization never ranks them. > > Item 9's first reader, #37097, is built by PR #37256, and this change to item 2 lands with it. The reasoning is contract review [`7157191417`](https://github.com/objectstack-ai/objectstack/pull/37256#issuecomment-7157191417) on that PR (its M1 and S2). The table is left as written; read items 2 and 9 with this note. From aec560807bc964835469e5062b5baa3dfe775a02 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 09:13:18 +0000 Subject: [PATCH 3/3] =?UTF-8?q?docs(adr):=20ADR-0161=20note=20=E2=80=94=20?= =?UTF-8?q?the=20adapter=20sentence=20in=20the=20words=20the=20spec=20TSDo?= =?UTF-8?q?c=20carries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sentence on what an adapter stores now reads word for word as the TSDoc on KnowledgeDocument.organizationId does on the branch that builds item 9, so the record and the contract say one sentence, not two. The bullet opens with a plain label and the sentence follows it unbroken. Claude-Session: https://claude.ai/code/session_01QSeKYkXwZ3ECV8yacsjMJM Co-authored-by: Claude --- ...c-split-record-return-knowledge-source-is-a-governed-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md index 1bb70eff299..971306f9089 100644 --- a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md +++ b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md @@ -322,7 +322,7 @@ The epic holds the contract shut until this record merges ("No new adapter-contr > > - **Why.** A document that gains an organization, loses it or moves to another one gets a new hash, so a complete reindex never leaves a stale organization on a stored document. The other answer kept the parenthesis and bumped the version. It leaves a later change of organization to the events alone, and missed events are the hole reconcile exists to close (K1). > - **A later optional member that assembly sets** enters the hash the same way, left out when it is absent, or the version is bumped. -> - **An adapter that stores `docHash` stores `organizationId` from the same version of the adapter on.** Otherwise, once it starts to read item 9, a complete reindex skips its documents, because the hashes match, and a search filtered by organization never ranks them. +> - **What an adapter stores.** An adapter that stores `docHash` stores `organizationId` from the same version on; otherwise, once it starts reading this field, a complete reindex skips its documents and a walled search never ranks them. > > Item 9's first reader, #37097, is built by PR #37256, and this change to item 2 lands with it. The reasoning is contract review [`7157191417`](https://github.com/objectstack-ai/objectstack/pull/37256#issuecomment-7157191417) on that PR (its M1 and S2). The table is left as written; read items 2 and 9 with this note.