Skip to content

knowledge_source: a Studio form to create and edit a knowledge source (object, content fields, metadata fields, where, split) #37309

Description

@objectstack-fleet

repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U

Filing gate: ③ maintainer-directed (topic child). Source: topic #37000; maintainer 2026-11-25 「现在拆阶段三」 (decision card in the project thread) and 「#4 只负责在手任务,你接手专题剩余任务」. Reviewed by an independent Fable pass before filing.
Grading: area:build · Feature · p2 (topic) · reach: authors who configure retrieval without code, on every deployment that mounts the knowledge service · evidence: read.

维护者速读

  • 做什么:管理员在 Studio 里新建、编辑知识源:选对象,勾选要检索的内容字段和用于筛选的字段,写过滤条件,选切分方式,然后发布。
  • 谁受益:不写代码的应用作者;阶段三「在 Studio 里配置哪些数据能检索」靠这张卡兑现。
  • 要知道的:保存时会提醒「这些字段的内容会发给嵌入服务商,首次建索引有费用」。
  • 需要你做的:无。

What

Carries ADR-0161 (docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md) Execution row "rows 4, 5, 5b" for its Studio half: K4 clause 2 ("authored at runtime through Studio and through MCP (allowRuntimeCreate)"), and K4's warning that authoring a source is an egress and a cost decision. The precedent is #37143 (open, in flight; the ai_context form, ADR-0160 row 7).

  1. A spec form file packages/spec/src/ai/knowledge-source.form.ts, by the precedent of packages/spec/src/ai/skill.form.ts, registered in METADATA_FORM_REGISTRY (packages/spec/src/system/metadata-form-registry.ts:67) and exported from packages/spec/src/ai/index.ts.
    • Basics: name, label, description, aiExposed; adapter optional, a plain text input whose help says blank means the deployment's store (row 3b).
    • Source: source.object (object picker); source.content and source.metadataFields as field pickers scoped to the chosen object (the generic field-multi widget with dependsOn, precedent packages/spec/src/ui/page.form.ts:141), order preserved for content; source.where with the filter-builder widget (same file, :142). A nested dependsOn path has a precedent: packages/spec/src/ui/view.form.ts:75 (filter-builder with dependsOn: 'data.object'); unverified for field-multi — state what the PR found; source.split (strategy, maxChars, minChars, the key service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 adds).
    • Refresh: refresh.onRecordChange.
    • No control for a key v1 does not carry (no wildcard member, no embedding, vectorStore or cron).
  2. The egress and cost note (K4, K5). The form says, beside content, that every listed field's text of every matching record is sent to the embedding provider on the first build and kept in an index; the wording matches the docs service-knowledge: a source that was never built gets built, and an operator can start a rebuild #37099 writes for the cost.
  3. The Studio authoring surface (list, create, edit, publish) through the metadata API. The kind's menu row and catalog labels land with the type in row 3a (ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts). Row 3a's at-save refusals (named permission, source admission) and row 4's at-publish reports show on the form as they show for other kinds.
  4. Translations. The form's section and help strings enter the metadataForms bundles (packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts) through os i18n extract, every locale filled as the i18n gate requires.
  5. Create seed. If Studio's create needs a seed, it is row 5b's (packages/spec/src/kernel/metadata-create-seeds.ts); coordinate so the form and the seed agree.

Rulings carried (ADR-0161 K10): no key is added (expected Metadata-protocol: none; if the PR adds one, it declares it and its reader); embedding is egress, so the form offers explicit fields only.

Acceptance

  • An author creates a source in Studio on a deployment that mounts the service, publishes it, and search_knowledge over MCP finds a record of that object without a restart.
  • The field pickers list only the chosen object's fields; a field the author cannot query is refused at save with row 3a's coded refusal shown on the form.
  • An item authored in Studio round-trips: reopened, every value the form wrote is shown as written; the stored item parses with KnowledgeSourceSchema.
  • A user without the named permission (row 3a) is refused at save.
  • The form test suites for registered forms (repeater titles, translation coverage) are green.
  • Container run per AGENTS.md.

Out of scope

  • The type, the loader and the save-time guards: row 3a. The optional adapter: row 3b. The reference checks at validate and publish: row 4.
  • Teaching the skill and the MCP create seed: row 5b.
  • Showing index status or sync failures to an administrator: phase 4 (row 15 and the sync-failure counts).

Blocked-by: #37306 (row 3b; the form offers a blank adapter). Coordinates with #37307 (row 4; the form shows its at-publish reports).
Parent: #37000. Reader: domain:spec lane for the form file (packages/spec/src/ai), with the Studio surface checked in ui/packages/app-shell.
Dedupe: knowledge Studio form 145 (open: #37000, #36996, seat posts — none builds this form) · knowledge_source Studio 2 (open: #37000, a seat post) · knowledge-source.form 0.

Activity

  1. added
    priority:p2
    domain:spec
    pm:blocked
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T14:34Z. Confirmed as filed: Feature · area:build · domain:spec · p2, pm:blocked on #37306 (row 5). It is a row of topic #37000, so it routes to repo:objectstack#1 (maintainer 13:49Z 「继续专题 开发 37000」). The body's Blocked-by: line already reads in line form.

  3. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Unlock · #37309 · 2026-11-28T06:57Z: its Blocked-by: card #37306 is closed (completed at 2026-11-27T20:21Z), and #37292 is closed. #37307 is named only for coordination, not as a blocker. pm:blocked → pm:queue; the grade is unchanged. Knowledge retrieval (#37000) is outside the maintainer's p1-only line. Answers seat repo:objectstack#1 (7235619774).

  4. added
    pm:queue
    and removed
    pm:blocked
    on Nov 28, 2026
  5. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Claim: PM loop round 15 · area o1-C (epic #37000; area concurrency 8 by the maintainer 2026-11-27T11:26Z; all priorities, maintainer 2026-11-28T06:54Z) · 2026-11-28T08:44Z
    Session: session_016WV4cwPhGV4g9p1BGQaZbP
    Account: os-elon-musk
    Branch: claude/area-o1C-37309
    Worktree: objectstack-issue-37309
    Domain: domain:spec
    Area: o1-C
    Seat: repo:objectstack#1
    File surface: a new packages/spec/src/ai/knowledge-source.metadata-form.ts (the current naming, by ai-context.metadata-form.ts and skill.metadata-form.ts; the card's knowledge-source.form.ts predates it), packages/spec/src/system/metadata-form-registry.ts, packages/spec/src/ai/index.ts, the metadataForms translation bundles in packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts, the Studio surface in ui/packages/app-shell only where the generic form host needs it, a create seed in packages/spec/src/kernel/metadata-create-seeds.ts if Studio needs one, tests, changesets.
    Container & model: M, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"; packages/spec/src/** is a Clause-② suspect surface), effort: high (reason: M; a new registered metadata form with object-scoped field pickers and a nested dependsOn, the egress and cost note, every locale filled, and a Studio round-trip acceptance through publish and MCP search)
    Clause-②: yes (widening) — a new exported metadata form registered for knowledge_source; no schema key is added
    Metadata-protocol: none
    Responsibility: objectstack's own code, packages/spec/src/system/metadata-form-registry.ts | an author who does not write code cannot create or edit a knowledge source: Studio has no form for the type | authors on every deployment that mounts the knowledge service
    Thread-read: 7235626634
    Premise: holds, read on origin/main ccdfe62: METADATA_FORM_REGISTRY has no knowledge_source entry and packages/spec/src/ai/ has no knowledge-source form; #37306 (optional adapter) and #37143 (the ai_context form precedent) are closed.
    Serial constraints cleared: #37306 and #37292 closed. No open PR touches metadata-form-registry.ts, spec/src/ai/index.ts or studioMenuPlacement.ts (51 open PR file lists read). The shared translation bundles are regenerated by os i18n extract, and a main merge resolves them.
    Pre-claim lane: packages/spec/** ⇒ domain:spec (the card's Reader line); the card is a row of topic #37000, routed to repo:objectstack#1 by triage 7165506371.
    Pre-claim deps: none.
    Prior rulings read: card thread — triage 7165506371 (Feature p2, routes to repo:objectstack#1), unlock 7235626634; ADR-0161 K4, K5 and K10 rulings carried in the body.
    Fold-or-serial: not folded.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 28, 2026
  7. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
    os-dev-report

    {
    "issue": 37309,
    "status": "done",
    "branch": "claude/area-o1C-37309",
    "pr": "#38329",
    "session": "session_016WV4cwPhGV4g9p1BGQaZbP",
    "premise_still_valid": true,
    "summary": "Resumed after the second container restart; no rebase. On top of the earlier commits (the spec form, the api-surface regen, the Studio field-picker binding, the form wording and Setup-bundle strings, the dogfood round trip), this session merged origin/main once more (5b95ff1). The first platform-objects run then read 10 failures, all caused by this change: the form's four select choices were English in seven locales, and three display-echo counts had not moved now that knowledge_source has a form. Commit e48d479 fills the choices in de, fr, ko, ar, pt-BR, ru and zh-Hant and moves the counts, each with its reason. 613670c corrects the changeset's translation sentence. Draft PR #38329 is open, assigned to os-elon-musk. Nested dependsOn finding: field-multi (like field-ref, filter-builder and action-multi) reads no dependsOn at all. The editor binds one field catalog for the whole form, from a fixed list of draft paths, and that list did not include source.object. So the PR reads the path the form declares (the catalog row's dependsOn, prefixed by its composites) as the last fallback. Deviation from the card: source.where uses the JSON editor, not filter-builder. filter-builder writes a view rule list, and KnowledgeSourceSchema refuses a list for where. No create seed was added, because the seed is optional in the editor.",
    "tests": "Final head 613670c. Every run went through the verify lock with VERDICT command-exit 0. @objectstack/spec test: Test Files 912 passed (912), Tests 28862 passed | 1 todo; spec typecheck exit 0 (at 5b95ff1). ui: vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage: Test Files 66 passed (66), Tests 336 passed (336) (at 5b95ff1); @object-ui/app-shell type-check exit 0 (final head). platform-objects test: Test Files 130 passed (130), Tests 2214 passed (final head; the first run at 5b95ff1 read 3 failed files / 10 failed tests, fixed in e48d479); platform-objects typecheck exit 0. cli test/i18n-coverage.test.ts 32/32. metadata-protocol protocol.meta-types-* (3 files) 46/46; lint validate-predicate-path-refs 62/62. dogfood test/knowledge-source-studio-roundtrip.dogfood.test.ts: Test Files 1 passed (1), Tests 4 passed (4); dogfood typecheck exit 0 (at 5b95ff1). Ablation (once, through scripts/ablation-replace.mjs): the form-declared fallback in ResourceEditPage.tsx was removed (anchor 1 to 0, blob 189514d7b2f1 to e617589c7a53). The real-editor binding test then failed (Tests 1 failed | 4 passed (5)). The restore put the blob back equal to HEAD with git diff HEAD empty. The test imports the editor from source, so no build was needed between the mutation and the run. No browser run was possible here. The Studio round trip is pinned at the API level on a booted showcase: the draft PUT and publish that Studio's Save sends, then search_knowledge over the live /mcp transport with no restart, then the reopened item, which parses with KnowledgeSourceSchema.",
    "gates": "Local: dispatch-gates --commands --repo objectstack-ai/objectstack derived 94 commands. --ran reconciliation exit 0: 94 derived famil(ies) accounted for, 93 run, 1 NOT-MEASURED. 93 exited 0, including check:query-options-erasure (ratchet holds), check:type-check-debt (0 raw tsc errors) and pnpm --dir ui exec vitest run scripts/ (Test Files 172 passed | 2 skipped). NOT MEASURED: pnpm check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET, because only the needed closures were built (there is no studio, client-react or qa/scenarios dist). The derivation warns the tree is 14+ commits behind origin/main, which moves while the box works. The families the last two commits touch (changeset, i18n, i18n-stale-fill, nul-bytes, issue-citations, keyed-text-bounds, doc-authoring, cross-package-test-inputs, closing-keyword-parity) were re-run at the final head, all exit 0. CI: when the PR was opened, head 613670c had 0 check-runs (total_count 0). Status: in_progress, not waited on.",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "mcp_calls": "0",
    "api_writes": "2 — POST /repos/objectstack-ai/objectstack/dispatches (fleet-write relay; pr_create, which created #38329 plus the POST issues/38329/assignees leg; the read-back was identical), and POST /repos//issues/37309/comments (this os-dev-report via post-stamped.mjs). git push is not counted.",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "carrier: none · noted, not filed — the card's text names knowledge-source.form.ts and the filter-builder widget for where. The current naming is knowledge-source.metadata-form.ts (the claim notes it), and filter-builder cannot write an ObjectQL filter record. Both are recorded in the PR's Acceptance notes."
    ],
    "deviations": "Commit e48d479 was first written with the reminder's model-named Co-Authored-By trailer. The pre-push hook refused it, so the unpushed commit's trailer was reworded to the model-free pair before its first push. Nothing published was rewritten. One closure build was first spelled pnpm --filter X build --concurrency=2, which appended the flag to each package script, and it failed (exit 2). It was rerun through turbo. The first app-shell vitest run was refused by the ui root guard (wrong invocation, not a red test) and was rerun from ui/."
    }


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
    os-dev-report

    {
    "issue": 37309,
    "status": "done",
    "branch": "claude/area-o1C-37309",
    "pr": "#38329",
    "head": "59defa6ffe5278e25f8489e778535365bea55bff",
    "session": "session_016WV4cwPhGV4g9p1BGQaZbP",
    "premise_still_valid": true,
    "summary": "Rework round on L1 verdict 7240236513 and the CI red on 0b20f7c. (2) origin/main (600197a) is merged with a merge commit, 63dfdc1, with no rebase or force-push. The one conflict was the translated-label control in object-lifecycle-panel-echo-decisions.test.ts, resolved as main's 846 (#37402) plus this form's 20, which is 866. The bundles were regenerated after the merge commit with check-i18n-bundles --write, and only en changed, for the reworded help. The bare and panel counts are unchanged on main, so this form's delta stands (16/19, 27 leaves). (1) S1, in 0b20f7c: split.strategy is marked required. The split help says the blank default holds only when the whole group is blank, and that a length without a strategy is refused at save; maxChars and minChars say they need a strategy. A spec test parses split with maxChars alone, expects the refusal at source.split.strategy, and has controls. zh-CN, ja-JP and es-ES are re-translated by hand. (3) The dogfood test now also edits: it reads the source back, changes it through the same door, reads it back, and the search follows the edit with no restart. Its header says the body is a literal (N3). A new Studio editor test types into the Label and Longest passage controls and asserts the body that Save writes. CI fix, in 59defa6: Studio's zh-CN overlay (metadata-form-zh-cn.ts) gains knowledge_source, copied from the platform zh-CN bundle. CI on 59defa6: 61 success, 10 skipped, 0 failed; mergeable_state clean. The new PR body is in pr-body-v2.md, and the PR body itself was not edited.",
    "tests": "All runs went through the verify lock with VERDICT command-exit 0. At 0b20f7c: spec test Test Files 913 passed (913), Tests 28897 passed | 1 todo; spec typecheck exit 0; platform-objects test 130/130 files, 2214/2214 tests; platform-objects typecheck exit 0; ui ResourceEditPage* Test Files 66 passed (66), Tests 337 passed (337), the new save-body test included; dogfood knowledge-source-studio-roundtrip Test Files 1 passed (1), Tests 5 passed (5), the new EDIT case included; dogfood typecheck exit 0. On the 59defa6 tree: ui metadata-form-i18n + metadata-form-option-names + SchemaForm.deDeveloperize-8218 + SchemaForm.machineNameChip-8231 + src/preview gave Test Files 55 passed (55), Tests 427 passed (427), which covers the CI-red 'carries a zh-CN overlay for every METADATA_FORM_REGISTRY type'; app-shell type-check exit 0; ui scripts/ Test Files 172 passed | 2 skipped. No ablation this round: the new tests pin behaviour the diff adds rather than a changed implementation line.",
    "gates": "At 59defa6: dispatch-gates --commands --repo objectstack-ai/objectstack derived 94 commands. --ran reconciliation exit 0: '94 derived famil(ies) accounted for — 94 run, 0 NOT-MEASURED'. All 94 exited 0, including check:dual-build-cjs-loads (measured this time), check:i18n, check:i18n-stale-fill, check:query-options-erasure and check:type-check-debt. The derivation still warns the tree is 9+ commits behind origin/main, which keeps moving. CI on 59defa6: 71 check-runs, 61 success, 10 skipped, 0 failure; Test UI (1/16) is green. PR mergeable_state: clean.",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "mcp_calls": "0",
    "api_writes": "1 this round — POST /repos/objectstack-ai/objectstack/dispatches (fleet-write relay) for this os-dev-report comment on #37309 via post-stamped.mjs. git push is not counted, and the PR body was not edited (pr-body-v2.md is in the scratch dir).",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [],
    "deviations": "The previous round's cleanup was refused by the classifier, so this round resumed in the same worktree. pr-body-v2.md is at /tmp/claude-0/-home-user/6a06253f-565e-5fdc-bec9-04b0de8891d5/scratchpad/issue-37309/pr-body-v2.md, and the live PR body still shows the first round's numbers. The changeset was not changed: it already names the split's three keys, and the zh-CN overlay falls under its app-shell entry."
    }


    Generated by Claude Code

  9. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Close-out · area o1-C · 2026-11-28T15:56Z

    Delivered by PR #38329 (merged 148c6eb at 2026-11-28T15:56Z, Tier S): Studio creates and edits a knowledge_source through a sectioned form (knowledgeSourceForm, registered for the type), with split.strategy required and source.where in the JSON editor; the edit round trip is pinned through the save door and in the editor. The card closed on merge via Fixes. Stated gaps (a typed create, the pickers end to end, a browser run) and N4 (three superseded English help strings in the echo bundles until the next extract) stay as recorded. pm:dispatched removed with this comment.

  10. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:builddomain:specpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions