Skip to content

Commit 148c6eb

Browse files
feat(spec,studio): a Studio form to create and edit a knowledge source (#38329)
Fixes #37309 Clause-②: yes (widening) — a new exported metadata form, `knowledgeSourceForm` from `@objectstack/spec/ai`, registered in `METADATA_FORM_REGISTRY` for `knowledge_source`; no schema key is added Metadata-protocol: none Skills-docs: none — the form adds no key and no authoring rule; what a source may hold, and the cost note it repeats, are already in the knowledge docs and the skill ## 维护者速读 - 用户能看到什么变化:管理员在 Studio 里可以新建、编辑并发布知识源:选对象,勾选要检索的内容字段和筛选字段,写过滤条件,选切分方式;之前 Studio 没有这个表单。 - 为什么做:知识平台专题第三阶段「不写代码也能配置哪些数据可被检索」,替不写代码的应用作者解决。 - 出错会怎样:作者在保存或发布知识源时碰到表单字段选择器为空或保存被拒;只影响新类型的表单,其它类型的编辑器绑定方式不变,可直接撤回本改动。 - 要你做什么:无。 ## What changes - **`packages/spec/src/ai/knowledge-source.metadata-form.ts`** (new, exported from `@objectstack/spec/ai`, registered as `knowledge_source`). Sections Basics (`name`, `label`, `description`, `aiExposed`, `adapter` as optional free text whose help says blank means the deployment's store), Records (the `source` composite: `kind`, `object` via `ref:object`, `content` and `metadataFields` as `field-multi` with `dependsOn: 'object'`, `where`, `split.strategy|maxChars|minChars`, with `strategy` marked required and the group's help saying the blank default holds only when the whole group is blank, so a passage length needs a strategy) and Refresh (`refresh.onRecordChange`). No control for `embedding`, `vectorStore`, `adapterConfig`, `refresh.cron` or a wildcard member. - **The egress and cost note** sits in `content`'s help, worded after the knowledge docs' cost section: the first build sends the text of every listed field of every matching record to the embedding provider, which bills for it, and keeps it in an index; a rebuild after a change of embedding model or split sends it again. `adapter`'s help carries the docs' memory-store callout (every boot rebuilds and re-sends). - **Studio binds field pickers to the object the form declares** (`ui/packages/app-shell/src/views/metadata-admin/formBoundObject.ts`, one line in `ResourceEditPage.tsx`). See the nested `dependsOn` finding below. - **Translations**: the form's strings entered every `metadataForms` bundle through `os i18n extract`; zh-CN, ja-JP and es-ES are translated, the other locales carry the English text with their source hashes, as the i18n gate takes for every metadata form. - **Studio's own zh-CN overlay** (`ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts`) names `knowledge_source`: the type label and the field labels, copied leaf for leaf from the platform's zh-CN bundle, as for every registered form. - **API surface**: `api-surface/ai.json` and `export-origins/ai.json` regenerated for the one new export. - Changeset `.changeset/37309-knowledge-source-studio-form.md` (`@objectstack/spec`, `@objectstack/platform-objects`, `@object-ui/app-shell`, all patch). ### What I found about a nested `dependsOn` for `field-multi` `field-multi` (like `field-ref`, `filter-builder` and `action-multi`) reads no `dependsOn` at all: it draws the one field catalog the editor binds for the whole form (`WidgetContext.objectFields`). The editor found that object on a fixed list of draft paths (`interfaceConfig.source`, `data.object`, `object`, `objectName`), so a knowledge source, whose object is `source.object`, got pickers that offered nothing whatever its rows declared. The `view.metadata-form.ts` precedent works only because `data.object` is on that list, not because a nested path is read. The fix reads the path the form declares — the first catalog row's `dependsOn`, prefixed by the composites it sits in (the `page.metadata-form.ts` spelling, `columns` inside `interfaceConfig` naming `source`) — and only after the fixed list, so every type it already served binds as before; the test asserts the derived path agrees with the fixed list for `ai_context`, `page` and `view`. A repeater's rows are not walked (their `dependsOn` names a key of each row). ## Tests Final head `59defa6ffe`, a merge of `origin/main` at `600197a6ae` (`63dfdc103f`) plus three commits. Every heavy run went through `os-verify-lock.sh`, and each `VERDICT` line read command-exit 0. The runs at `0b20f7cce9` are spec, platform-objects, dogfood and the `ResourceEditPage` suite. The one commit after it adds only Studio's zh-CN overlay entry, and its tests ran on that tree. - **Spec**: `pnpm --filter @objectstack/spec test` — `Test Files 913 passed (913)`, `Tests 28897 passed | 1 todo`; `typecheck` exit 0. `src/ai/knowledge-source.metadata-form.test.ts` now has 9 tests. The new one shows that `split: { maxChars: 600 }` alone is refused at `source.split.strategy`; its control shows the same length with a strategy parses, and so does a blank group. - **Studio editor** (`ui/`): `pnpm exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage` — `Test Files 66 passed (66)`, `Tests 337 passed (337)`. New in `ResourceEditPage.formBoundObject-37309.test.tsx`: the real editor opens a source authored in Studio and enters Edit. It types into the Label and Longest passage controls and clicks Save. The body it writes is the edit, with every other value as it was. The form i18n tests (`metadata-form-i18n`, `metadata-form-option-names`, the two `SchemaForm` label tests) and `src/preview` read `Test Files 55 passed (55)`, `Tests 427 passed (427)`. `@object-ui/app-shell type-check` exit 0. - **Translations**: `pnpm --filter @objectstack/platform-objects test` — `Test Files 130 passed (130)`, `Tests 2214 passed (2214)`; `typecheck` exit 0. - **Round trip on a booted showcase**: `test/knowledge-source-studio-roundtrip.dogfood.test.ts` — `Test Files 1 passed (1)`, `Tests 5 passed (5)`; `@objectstack/dogfood typecheck` exit 0. New: an edit. The test reads the saved source back, changes the label, the content order and the split, and saves it through the same door (draft PUT, publish). The read-back shows the change with nothing else moved, and `search_knowledge` names the new label with no restart. - Earlier rounds: CLI `i18n-coverage` 32/32, `metadata-protocol` `protocol.meta-types-*` 46/46, `lint` `validate-predicate-path-refs` 62/62. <details><summary>Ablation of the form-declared binding (one run, restored)</summary> `scripts/ablation-replace.mjs` replaced the `|| objectNameAt(draft, declaredBoundObjectPath(entry?.form))` fallback in `ResourceEditPage.tsx` (anchor 1 to 0, blob `189514d7b2f1` to `e617589c7a53`). The binding test went red on the real-editor case: `× reads the catalog of source.object, and the content picker draws that object's field labels`, `Tests 1 failed | 4 passed (5)`. Restored: blob equal to HEAD and `git diff HEAD` empty. The test imports the editor from source, so no build sits between the mutation and the run. </details> <details><summary>Counts and translations this form moves</summary> - The display-echo ledgers count `knowledge_source` as a panel type now that it has a form: bare 17 to 16, panel 18 to 19, 27 bare leaves. The translated-label control is main's 846 (#37402) plus this form's twenty labels, 866. The merge resolved that line by hand as main's number plus this form's delta. - The eleven bundles were regenerated after the merge with `node scripts/check-i18n-bundles.mjs --write`. Only `en` changed, for the reworded split help, which shows the auto-merged bundles were what regeneration writes. zh-CN, ja-JP and es-ES carry the reworded help, re-translated by hand as the bundle headers require. The form's four select choices are named in all ten locales. </details> ## Acceptance notes - **`source.where` uses the JSON editor, not `filter-builder`** (the card named `filter-builder`). `filter-builder` writes a view rule list (`[{ field, operator, value }]`); `where` is an ObjectQL filter record, which `KnowledgeSourceSchema` refuses as a list — pinned in the form test. The JSON editor is the `report.metadata-form.ts` `runtimeFilter` precedent. - **Create seed**: none added. The seed is optional in Studio's editor (`specCreateSeed` in `ResourceEditPage.tsx`): with none, create opens the form blank and the author picks the kind and the object. A seed, if one is wanted, is row 5b's. - **Save-time refusals** (`manage_knowledge_sources`, source admission as the author) are row 3a's, pinned in `packages/rest/src/meta-type-write-capability.test.ts` and `packages/metadata-core/src/knowledge-source-save-admission.test.ts`; Studio shows them through the same refusal path as every kind. This PR adds no refusal-specific UI test. - **Browser run**: not done here, because this container has no browser. The round trip is pinned in two legs. (1) Form to body: the real `MetadataResourceEditPage` binds the pickers to `source.object`, and its controls write the body Save sends (label and passage length, for an edit). (2) Body to search: a booted showcase takes such a body through the draft PUT and publish that Studio's Save sends, for a create and then an edit, and `search_knowledge` over the live `/mcp` transport follows each with no restart. The read-back parses with `KnowledgeSourceSchema`. Not driven: the select and field-picker controls typed end to end. The dogfood body is a literal of the keys the form offers. - **Nested `required`**: the editor judges a `required` mark only on top-level rows, so `split.strategy`'s mark is the asterisk. The group's help and the length rows' help carry the rule, and the save door's refusal is the enforcement. ## Verification Read first (by risk): 1. `ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx` — the `sourceObjectName` hunk: the declared path is the last fallback, so no existing type changes binding. 2. `ui/packages/app-shell/src/views/metadata-admin/formBoundObject.ts` — the composite walk. 3. `packages/spec/src/ai/knowledge-source.metadata-form.ts` — the rows and the cost wording. Two-minute check: `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ai/knowledge-source.metadata-form.test.ts` — expect 9 tests passing. <details><summary>Derived gates (local subset)</summary> At `59defa6ffe`, `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 94 commands. All 94 ran and exited 0. `--ran` reconciliation: `94 derived famil(ies) accounted for — 94 run, 0 NOT-MEASURED`. That includes `check:dual-build-cjs-loads`, now measured, plus `check:query-options-erasure`, `check:type-check-debt` and `pnpm --dir ui exec vitest run scripts/` (`Test Files 172 passed | 2 skipped`). The full dogfood battery is not owed: the title has no `!` and there is no `(narrowing)` arm. CI on `59defa6ffe`: 71 check-runs, 61 success and 10 skipped, none failed. `Test UI (1/16)`, which was red on `0b20f7cce9` for the missing zh-CN overlay, is green. The PR reads `mergeable_state: clean`. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ce51400 commit 148c6eb

32 files changed

Lines changed: 2080 additions & 21 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/platform-objects': patch
4+
'@object-ui/app-shell': patch
5+
---
6+
7+
feat(studio): create and edit a knowledge source (`knowledge_source`) in Studio — a form for the type, with field pickers scoped to the source's own object
8+
9+
Clause-②: yes (widening) — one new public export, `knowledgeSourceForm` from `@objectstack/spec/ai`, and `/meta/types` now serves a form for `knowledge_source`; no key is added to what a source may hold
10+
Metadata-protocol: none
11+
12+
ADR-0161 K4, clause 2 (runtime authoring). A knowledge source can now be created and edited in Studio like a skill or a context pack: Studio's metadata editor lays it out with the new `knowledgeSourceForm` (`@objectstack/spec/ai`, registered in `METADATA_FORM_REGISTRY` as `knowledge_source`), and a Save goes through the metadata API, where the two save-time guards (the `manage_knowledge_sources` capability, and source admission as the author) refuse what they refuse today. The knowledge service picks the published source up with no restart, and `search_knowledge` answers from it.
13+
14+
- **Basics.** `name`, `label`, `description`, `aiExposed`, and `adapter` as optional free text: blank means the deployment's store (pgvector on PostgreSQL, turso otherwise, else the only store mounted).
15+
- **Records.** The object is picked from the object catalog; `source.content` (in order) and `source.metadataFields` are field pickers over that object's fields. `source.where` is the JSON editor and takes an ObjectQL filter, for example `{"status": {"$ne": "done"}}`. `source.split` takes the strategy (`whole`, `recursive`, `markdown`), `maxChars` and `minChars`.
16+
- **Egress and cost.** Beside `content` the form says that a build costs money: the first build sends the text of every listed field of every matching record to your embedding provider, which bills for it, and keeps it in an index; a rebuild after a change of embedding model or split sends all of it again. Beside `adapter` it says that the `memory` store re-embeds the whole source on every boot. Content fields are named one by one: there is no wildcard.
17+
- **Refresh.** `refresh.onRecordChange`.
18+
- No control is offered for a key the type does not carry (`embedding`, `vectorStore`, `adapterConfig`, `refresh.cron`, a `'*'` member).
19+
- **Field pickers follow the object the form declares.** Studio's metadata editor bound its field pickers to an object found at a fixed set of item paths (`interfaceConfig.source`, `data.object`, `object`, `objectName`); it now also reads the path the type's form declares on its picker rows (`dependsOn`, under the composites the row sits in), which is how a knowledge source's pickers offer the fields of `source.object`. Types the fixed set already served are bound as before.
20+
- **Translations.** The form's section and help strings are in the Setup bundles (`@objectstack/platform-objects`), translated for zh-CN, ja-JP and es-ES; in the other locales the select choices are translated and the rest carries the English text until it is translated, as for every metadata form.

‎packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts‎

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3494,6 +3494,98 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
34943494
}
34953495
},
34963496
knowledge_source: {
3497-
label: "مصدر معرفة"
3497+
label: "مصدر معرفة",
3498+
sections: {
3499+
basics: {
3500+
label: "Basics",
3501+
description: "The source's identity, whether agents may search it, and the store that holds its index."
3502+
},
3503+
records: {
3504+
label: "Records",
3505+
description: "Which records of which object are indexed, and which of their fields. Each field picker offers the fields of the object chosen here."
3506+
},
3507+
refresh: {
3508+
label: "Refresh",
3509+
description: "How the index follows the records."
3510+
}
3511+
},
3512+
fields: {
3513+
name: {
3514+
label: "Name",
3515+
helpText: "Unique identifier (snake_case). search_knowledge lists the source by it, and its sourceIds argument names the source by it."
3516+
},
3517+
label: {
3518+
label: "Label",
3519+
helpText: "Display name, shown in the sources list of a search_knowledge answer."
3520+
},
3521+
description: {
3522+
label: "Description",
3523+
helpText: "What the source holds, shown beside its name in the sources list of a search_knowledge answer."
3524+
},
3525+
aiExposed: {
3526+
label: "Searchable by AI agents",
3527+
helpText: "Whether search_knowledge may search this source for AI agents. On by default."
3528+
},
3529+
adapter: {
3530+
label: "Store",
3531+
helpText: "The store that holds the index, by its adapter id (pgvector, turso, memory). Leave it blank for the deployment's store: pgvector on PostgreSQL, turso otherwise, else the only store mounted. A store this deployment does not mount is refused at save. The memory store keeps nothing across a restart, so every boot builds its index again and sends the whole source to the embedding provider."
3532+
},
3533+
source: {
3534+
label: "Source",
3535+
helpText: "What the source indexes: the records of one object."
3536+
},
3537+
"source.kind": {
3538+
label: "Kind",
3539+
helpText: "What the source indexes. A source indexes the records of one object.",
3540+
options: {
3541+
object: "سجلات كائن"
3542+
}
3543+
},
3544+
"source.object": {
3545+
label: "Object",
3546+
helpText: "The object whose records are indexed. Each matching record becomes one document."
3547+
},
3548+
"source.content": {
3549+
label: "Content fields",
3550+
helpText: "The fields whose text is indexed, in order. Each field is named: there is no wildcard. Embedding is egress, and a build costs money: the first build reads every record the filter matches and sends the text of each listed field to your embedding provider, which bills for it, and that text is kept in an index outside the record store. A rebuild after you change the embedding model or the split sends all of it again. A field added to the object later is not indexed until you add it here. Credential and internal fields are never indexed, even when listed."
3551+
},
3552+
"source.metadataFields": {
3553+
label: "Filter fields",
3554+
helpText: "Fields kept beside each passage, so a search can filter on them (for example a status or an owner). Each one must be a field you may query."
3555+
},
3556+
"source.where": {
3557+
label: "Records to index",
3558+
helpText: "An ObjectQL filter on the object, for example {\"status\": {\"$ne\": \"done\"}}. Only the records it matches are indexed. Blank: every record."
3559+
},
3560+
"source.split": {
3561+
label: "Passages",
3562+
helpText: "How each document is cut into passages. Blank: recursive, with the settings page's chunk size (800 characters unless changed)."
3563+
},
3564+
"source.split.strategy": {
3565+
label: "Strategy",
3566+
helpText: "Whole: one passage per document. Recursive: cut at blank lines, then line breaks, then sentence ends. Markdown: one passage per heading, carrying its heading path.",
3567+
options: {
3568+
whole: "المستند كاملاً",
3569+
recursive: "تكراري",
3570+
markdown: "أقسام Markdown"
3571+
}
3572+
},
3573+
"source.split.maxChars": {
3574+
label: "Longest passage",
3575+
helpText: "In characters. Wins over the settings page's chunk size; the embedding model's input limit can lower it. Not read by Whole document."
3576+
},
3577+
"source.split.minChars": {
3578+
label: "Shortest passage",
3579+
helpText: "Adjacent pieces shorter than this are merged, up to this length (default 200). Recursive and Markdown only."
3580+
},
3581+
refresh: {
3582+
label: "Refresh",
3583+
helpText: "How the index is kept in step with the records."
3584+
},
3585+
"refresh.onRecordChange": {
3586+
label: "Sync on record changes",
3587+
helpText: "Keep the index in step as records are created, changed and deleted (on by default). Off: an external indexer keeps the index, and the platform neither syncs nor builds it."
3588+
}
3589+
}
34983590
}
34993591
};

‎packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,46 @@ export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
5050
"metadataForms.email_template.fields.variables.helpText": "27197774c2cda633",
5151
"metadataForms.field.fields.inlineEdit.helpText": "1ce60e4c6d5fc0e1",
5252
"metadataForms.field.fields.inlineEdit.label": "f29ea014320f588e",
53+
"metadataForms.knowledge_source.fields.adapter.helpText": "9529330956105d79",
54+
"metadataForms.knowledge_source.fields.adapter.label": "da213009390baa11",
55+
"metadataForms.knowledge_source.fields.aiExposed.helpText": "308cc1b601e6601c",
56+
"metadataForms.knowledge_source.fields.aiExposed.label": "61da7af3c7a42d23",
57+
"metadataForms.knowledge_source.fields.description.helpText": "6117bd9062dbb3d3",
58+
"metadataForms.knowledge_source.fields.description.label": "779a4342c8eb6707",
59+
"metadataForms.knowledge_source.fields.label.helpText": "0108489eabde9658",
60+
"metadataForms.knowledge_source.fields.label.label": "c680364257b11569",
61+
"metadataForms.knowledge_source.fields.name.helpText": "e825b21f14b83cfa",
62+
"metadataForms.knowledge_source.fields.name.label": "5274417ff1ccaf01",
63+
"metadataForms.knowledge_source.fields.refresh.helpText": "3dc3007498cbdddc",
64+
"metadataForms.knowledge_source.fields.refresh.label": "1b63ae2e002930a6",
65+
"metadataForms.knowledge_source.fields.refresh.onRecordChange.helpText": "ef6f113e883733b7",
66+
"metadataForms.knowledge_source.fields.refresh.onRecordChange.label": "53a3285b7bcfb91f",
67+
"metadataForms.knowledge_source.fields.source.content.helpText": "a58391e05d69ffe7",
68+
"metadataForms.knowledge_source.fields.source.content.label": "fb33868fefbf74b3",
69+
"metadataForms.knowledge_source.fields.source.helpText": "0b648dbc7af2f85c",
70+
"metadataForms.knowledge_source.fields.source.kind.helpText": "98e903260393800d",
71+
"metadataForms.knowledge_source.fields.source.kind.label": "3acd2ee4b0e7f2cf",
72+
"metadataForms.knowledge_source.fields.source.label": "8fe786e8e29c8cec",
73+
"metadataForms.knowledge_source.fields.source.metadataFields.helpText": "8f41aea242f1a77e",
74+
"metadataForms.knowledge_source.fields.source.metadataFields.label": "de294fc128e44483",
75+
"metadataForms.knowledge_source.fields.source.object.helpText": "37a6686deb6e5201",
76+
"metadataForms.knowledge_source.fields.source.object.label": "d0c49032d95ebb36",
77+
"metadataForms.knowledge_source.fields.source.split.helpText": "a51a59132d112116",
78+
"metadataForms.knowledge_source.fields.source.split.label": "3a77c4c884b1d4a4",
79+
"metadataForms.knowledge_source.fields.source.split.maxChars.helpText": "d7254716c7258828",
80+
"metadataForms.knowledge_source.fields.source.split.maxChars.label": "780596d178bbdef6",
81+
"metadataForms.knowledge_source.fields.source.split.minChars.helpText": "c570045548551b8b",
82+
"metadataForms.knowledge_source.fields.source.split.minChars.label": "f8a2b05e9c16afda",
83+
"metadataForms.knowledge_source.fields.source.split.strategy.helpText": "f3ff47d9386b7956",
84+
"metadataForms.knowledge_source.fields.source.split.strategy.label": "785c1dd353da380b",
85+
"metadataForms.knowledge_source.fields.source.where.helpText": "45098881521ffbd5",
86+
"metadataForms.knowledge_source.fields.source.where.label": "cae99e947da34116",
87+
"metadataForms.knowledge_source.sections.basics.description": "c232f620677bab66",
88+
"metadataForms.knowledge_source.sections.basics.label": "55562f900da68c5d",
89+
"metadataForms.knowledge_source.sections.records.description": "929da5e97dc7eda2",
90+
"metadataForms.knowledge_source.sections.records.label": "9e5814dbd123f1c1",
91+
"metadataForms.knowledge_source.sections.refresh.description": "79311cb3f9e55b89",
92+
"metadataForms.knowledge_source.sections.refresh.label": "1b63ae2e002930a6",
5393
"metadataForms.permission.fields.fields.helpText": "887a0bae04a950e2",
5494
"metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae",
5595
"metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c",

‎packages/platform-objects/src/apps/translations/bare-type-display-echo-decisions.test.ts‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -821,16 +821,19 @@ describe('#19403 round 7 — the population, DERIVED from the registry and a sha
821821
// #37143), so it is a panel type now.
822822
// 15 → 16: `form` joined bare (ADR-0159 card ②, #37086).
823823
// 16 / 18 → 17 / 18: `knowledge_source` arrives bare (#37304).
824-
expect(BARE_TYPES.length).toBe(17);
825-
expect(PANEL_TYPES.length).toBe(18);
824+
// 17 / 18 → 16 / 19: `knowledge_source` gained its form (ADR-0161 K4
825+
// clause 2, #37309), so it is a panel type now.
826+
expect(BARE_TYPES.length).toBe(16);
827+
expect(PANEL_TYPES.length).toBe(19);
826828
expect(BARE_TYPES.length + PANEL_TYPES.length).toBe(REGISTRY_TYPES.length);
827829
for (const type of ['seed', 'mapping', 'api', 'doc', 'book', 'capability', 'picklist', 'sharing_rule', 'queue', 'assignment_rule', 'object_extension']) {
828830
expect(BARE_TYPES, `${type} is bare`).toContain(type);
829831
}
830832
for (const type of AUTHORED_BARE_TYPES) expect(BARE_TYPES, `${type} is bare`).toContain(type);
831-
// 28 leaves: seventeen labels, and a description on the eleven that carry one.
832-
expect(BARE_LEAVES.length).toBe(28);
833-
expect(BARE_LEAVES.filter((l) => l.prop === 'label').length).toBe(17);
833+
// 27 leaves: sixteen labels, and a description on the eleven that carry one
834+
// (`knowledge_source`, label only, left the class with its form, #37309).
835+
expect(BARE_LEAVES.length).toBe(27);
836+
expect(BARE_LEAVES.filter((l) => l.prop === 'label').length).toBe(16);
834837
expect(BARE_LEAVES.filter((l) => l.prop === 'description').length).toBe(11);
835838
expect(BARE_LEAVES.every((l) => ['label', 'description'].includes(l.prop))).toBe(true);
836839
});
@@ -912,13 +915,13 @@ describe('#19403 round 7 — the population, DERIVED from the registry and a sha
912915
expect(flagged.length).toBe(BARE_LEAVES.length);
913916
});
914917

915-
it('⭐ this class is now DONE — zero of its 28 leaves echoes in all three locales', () => {
918+
it('⭐ this class is now DONE — zero of its 27 leaves echoes in all three locales', () => {
916919
const echoing = BARE_LEAVES.filter((l) =>
917920
TRANSLATED_LOCALES.every(([, forms]) => forms[l.type]?.[l.prop] === l.en),
918921
);
919922
expect(echoing.map((l) => `${l.type}.${l.prop}`)).toEqual([]);
920923
// Lit — and it really walked the class, which a zero alone would not show.
921-
expect(BARE_LEAVES.length).toBe(28);
924+
expect(BARE_LEAVES.length).toBe(27);
922925
});
923926
});
924927

‎packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts‎

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3494,6 +3494,98 @@ export const deMetadataForms: NonNullable<TranslationData['metadataForms']> = {
34943494
}
34953495
},
34963496
knowledge_source: {
3497-
label: "Wissensquelle"
3497+
label: "Wissensquelle",
3498+
sections: {
3499+
basics: {
3500+
label: "Basics",
3501+
description: "The source's identity, whether agents may search it, and the store that holds its index."
3502+
},
3503+
records: {
3504+
label: "Records",
3505+
description: "Which records of which object are indexed, and which of their fields. Each field picker offers the fields of the object chosen here."
3506+
},
3507+
refresh: {
3508+
label: "Refresh",
3509+
description: "How the index follows the records."
3510+
}
3511+
},
3512+
fields: {
3513+
name: {
3514+
label: "Name",
3515+
helpText: "Unique identifier (snake_case). search_knowledge lists the source by it, and its sourceIds argument names the source by it."
3516+
},
3517+
label: {
3518+
label: "Label",
3519+
helpText: "Display name, shown in the sources list of a search_knowledge answer."
3520+
},
3521+
description: {
3522+
label: "Description",
3523+
helpText: "What the source holds, shown beside its name in the sources list of a search_knowledge answer."
3524+
},
3525+
aiExposed: {
3526+
label: "Searchable by AI agents",
3527+
helpText: "Whether search_knowledge may search this source for AI agents. On by default."
3528+
},
3529+
adapter: {
3530+
label: "Store",
3531+
helpText: "The store that holds the index, by its adapter id (pgvector, turso, memory). Leave it blank for the deployment's store: pgvector on PostgreSQL, turso otherwise, else the only store mounted. A store this deployment does not mount is refused at save. The memory store keeps nothing across a restart, so every boot builds its index again and sends the whole source to the embedding provider."
3532+
},
3533+
source: {
3534+
label: "Source",
3535+
helpText: "What the source indexes: the records of one object."
3536+
},
3537+
"source.kind": {
3538+
label: "Kind",
3539+
helpText: "What the source indexes. A source indexes the records of one object.",
3540+
options: {
3541+
object: "Datensätze eines Objekts"
3542+
}
3543+
},
3544+
"source.object": {
3545+
label: "Object",
3546+
helpText: "The object whose records are indexed. Each matching record becomes one document."
3547+
},
3548+
"source.content": {
3549+
label: "Content fields",
3550+
helpText: "The fields whose text is indexed, in order. Each field is named: there is no wildcard. Embedding is egress, and a build costs money: the first build reads every record the filter matches and sends the text of each listed field to your embedding provider, which bills for it, and that text is kept in an index outside the record store. A rebuild after you change the embedding model or the split sends all of it again. A field added to the object later is not indexed until you add it here. Credential and internal fields are never indexed, even when listed."
3551+
},
3552+
"source.metadataFields": {
3553+
label: "Filter fields",
3554+
helpText: "Fields kept beside each passage, so a search can filter on them (for example a status or an owner). Each one must be a field you may query."
3555+
},
3556+
"source.where": {
3557+
label: "Records to index",
3558+
helpText: "An ObjectQL filter on the object, for example {\"status\": {\"$ne\": \"done\"}}. Only the records it matches are indexed. Blank: every record."
3559+
},
3560+
"source.split": {
3561+
label: "Passages",
3562+
helpText: "How each document is cut into passages. Blank: recursive, with the settings page's chunk size (800 characters unless changed)."
3563+
},
3564+
"source.split.strategy": {
3565+
label: "Strategy",
3566+
helpText: "Whole: one passage per document. Recursive: cut at blank lines, then line breaks, then sentence ends. Markdown: one passage per heading, carrying its heading path.",
3567+
options: {
3568+
whole: "Ganzes Dokument",
3569+
recursive: "Rekursiv",
3570+
markdown: "Markdown-Abschnitte"
3571+
}
3572+
},
3573+
"source.split.maxChars": {
3574+
label: "Longest passage",
3575+
helpText: "In characters. Wins over the settings page's chunk size; the embedding model's input limit can lower it. Not read by Whole document."
3576+
},
3577+
"source.split.minChars": {
3578+
label: "Shortest passage",
3579+
helpText: "Adjacent pieces shorter than this are merged, up to this length (default 200). Recursive and Markdown only."
3580+
},
3581+
refresh: {
3582+
label: "Refresh",
3583+
helpText: "How the index is kept in step with the records."
3584+
},
3585+
"refresh.onRecordChange": {
3586+
label: "Sync on record changes",
3587+
helpText: "Keep the index in step as records are created, changed and deleted (on by default). Off: an external indexer keeps the index, and the platform neither syncs nor builds it."
3588+
}
3589+
}
34983590
}
34993591
};

0 commit comments

Comments
 (0)