Repository navigation
feat(spec,studio): a Studio form to create and edit a knowledge source - #38329
Conversation
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
…ourceForm Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
…wledge source round-trip pins (WIP) Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
…e cost docs; its strings in every Setup bundle Labels for aiExposed and adapter, the docs' cost wording beside content and the memory-store note beside adapter; the metadataForms bundles regenerated through os i18n extract, zh-CN, ja-JP and es-ES translated. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…, read decorations stripped Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
… locale; registry counts follow the new form The four choices of the knowledge source form's selects (`source.kind`, `source.split.strategy`) are translated in de, fr, ko, ar, pt-BR, ru and zh-Hant, as the served-form option test requires of every select. 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) and its labels in the translated catalog (845 to 865). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · 613670c · 2026-11-28T13:43Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Read: card #37309 (body and all four comments, dev report 7240091860 included), PR #38329 (body, 31 files, net diff of the head against merge base ① Derived judgments
② Semver levelClause-②: yes (widening). Correct: a new named export from a published entry point and a new served form, with nothing taken away.
③ Boundary flags
④ Design judgment
Top level: the schema's live keys are Required marks: What the controls write, read in Help text against the code it cites: the S1 (should-fix) — Nit N1:
Nit N2: the prefix rule and the "root path as written" rule only agree while a dotted Translations (lane remainder, read because the area asked). Eleven Dogfood round trip (lane remainder, read because the area asked). The file drives a real create through the save door on a booted showcase: draft PUT, publish, Nit N3: the dogfood header should say the body is a literal of the keys the form offers, and that an edit is not exercised. Open on this head: S1. N1 to N3 are nits and may stand as accepted deviations. Implemented-by: VERDICT: PASS |
The translated-label control in object-lifecycle-panel-echo-decisions reads main's 846 (#37402) plus this form's twenty labels: 866. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): REWORK at head Contract record 7240223524 passes the design, with its tier verified. It leaves one graded finding open on this head, and the head has to move anyway, so this is a rework round. What to fix
What stands
Next: a new head, then a delta contract review and a delta L1. Please announce the new head with all its check-runs green. |
…roup is used; the edit round trip is pinned
The form marks `source.split.strategy` required and its help says the blank
default holds only when the whole group is blank: a passage length without a
strategy is refused at save (`KnowledgeSplitSchema`), and a nested mark is the
asterisk only. Pinned: `split: { maxChars }` alone is refused at
`source.split.strategy`, with a strategy it parses.
The dogfood round trip now edits too: the read-back source, changed and saved
through the same door, reads back with the change and the search follows it
with no restart. Its header says the body is a literal of the keys the form
offers. A Studio editor test types into the label and passage-length controls
and asserts the body the Save writes. zh-CN, ja-JP and es-ES carry the
reworded help; en regenerated.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
📓 Docs Drift CheckThis PR changes 2 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3268d68b594c105bfbd27bdf87b56f176206af48 && git checkout 3268d68b594c105bfbd27bdf87b56f176206af48
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f38a3ca8469368dcdcca177f4b8a94ba9ac5bf1d 59defa6ffe5278e25f8489e778535365bea55bff && git checkout -B drift-repro f38a3ca8469368dcdcca177f4b8a94ba9ac5bf1d && git merge --no-ff 59defa6ffe5278e25f8489e778535365bea55bff
node scripts/docs-audit/affected-docs.mjs --json f38a3ca8469368dcdcca177f4b8a94ba9ac5bf1d
|
Studio's own zh-CN overlay for the spec forms names every METADATA_FORM_REGISTRY type; `knowledge_source` gets its type label and field labels, copied leaf for leaf from the platform's zh-CN bundle. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver levelClause-②: yes (widening). Unchanged, and still right: the delta adds a ③ Boundary flags
④ Design judgmentS1: closed. In Bundles and source hashes against the reworded strings.
Nit N4: the seven echo bundles now hold three superseded English help strings on disk. Served text is correct; the next The zh-CN overlay (
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT (delta) at head Review summary
Notes, not blocking. N4: the seven echo bundles hold three superseded English help strings on disk until the next extract. The served text is correct. N1 and N2 stand as accepted deviations. Next: no governed path, at 2,101 changed lines, so it is Tier S. The area marks it ready and lands it. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing · area o1-C · head
State: ready + auto-merge; #37309 closes on merge via |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46159703452 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Re-queue · area o1-C · head Queue build 46159703452 ejected this PR only as a stack-mate: its failing case ( |
Fixes #37309
Clause-②: yes (widening) — a new exported metadata form,
knowledgeSourceFormfrom@objectstack/spec/ai, registered inMETADATA_FORM_REGISTRYforknowledge_source; no schema key is addedMetadata-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
维护者速读
What changes
packages/spec/src/ai/knowledge-source.metadata-form.ts(new, exported from@objectstack/spec/ai, registered asknowledge_source). Sections Basics (name,label,description,aiExposed,adapteras optional free text whose help says blank means the deployment's store), Records (thesourcecomposite:kind,objectviaref:object,contentandmetadataFieldsasfield-multiwithdependsOn: 'object',where,split.strategy|maxChars|minChars, withstrategymarked 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 forembedding,vectorStore,adapterConfig,refresh.cronor a wildcard member.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).ui/packages/app-shell/src/views/metadata-admin/formBoundObject.ts, one line inResourceEditPage.tsx). See the nesteddependsOnfinding below.metadataFormsbundle throughos 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.ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts) namesknowledge_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/ai.jsonandexport-origins/ai.jsonregenerated for the one new export..changeset/37309-knowledge-source-studio-form.md(@objectstack/spec,@objectstack/platform-objects,@object-ui/app-shell, all patch).What I found about a nested
dependsOnforfield-multifield-multi(likefield-ref,filter-builderandaction-multi) reads nodependsOnat 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 issource.object, got pickers that offered nothing whatever its rows declared. Theview.metadata-form.tsprecedent works only becausedata.objectis on that list, not because a nested path is read. The fix reads the path the form declares — the first catalog row'sdependsOn, prefixed by the composites it sits in (thepage.metadata-form.tsspelling,columnsinsideinterfaceConfignamingsource) — 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 forai_context,pageandview. A repeater's rows are not walked (theirdependsOnnames a key of each row).Tests
Final head
59defa6ffe, a merge oforigin/mainat600197a6ae(63dfdc103f) plus three commits. Every heavy run went throughos-verify-lock.sh, and eachVERDICTline read command-exit 0. The runs at0b20f7cce9are spec, platform-objects, dogfood and theResourceEditPagesuite. The one commit after it adds only Studio's zh-CN overlay entry, and its tests ran on that tree.pnpm --filter @objectstack/spec test—Test Files 913 passed (913),Tests 28897 passed | 1 todo;typecheckexit 0.src/ai/knowledge-source.metadata-form.test.tsnow has 9 tests. The new one shows thatsplit: { maxChars: 600 }alone is refused atsource.split.strategy; its control shows the same length with a strategy parses, and so does a blank group.ui/):pnpm exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage—Test Files 66 passed (66),Tests 337 passed (337). New inResourceEditPage.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 twoSchemaFormlabel tests) andsrc/previewreadTest Files 55 passed (55),Tests 427 passed (427).@object-ui/app-shell type-checkexit 0.pnpm --filter @objectstack/platform-objects test—Test Files 130 passed (130),Tests 2214 passed (2214);typecheckexit 0.test/knowledge-source-studio-roundtrip.dogfood.test.ts—Test Files 1 passed (1),Tests 5 passed (5);@objectstack/dogfood typecheckexit 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, andsearch_knowledgenames the new label with no restart.i18n-coverage32/32,metadata-protocolprotocol.meta-types-*46/46,lintvalidate-predicate-path-refs62/62.Ablation of the form-declared binding (one run, restored)
scripts/ablation-replace.mjsreplaced the|| objectNameAt(draft, declaredBoundObjectPath(entry?.form))fallback inResourceEditPage.tsx(anchor 1 to 0, blob189514d7b2f1toe617589c7a53). 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 andgit diff HEADempty. The test imports the editor from source, so no build sits between the mutation and the run.Counts and translations this form moves
knowledge_sourceas 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 (spec: an object declares when a whole record is read-only by hand (object-level uiReadonlyWhen), fields override it, and duplicating a record takes the locked fields' defaults #37402) plus this form's twenty labels, 866. The merge resolved that line by hand as main's number plus this form's delta.node scripts/check-i18n-bundles.mjs --write. Onlyenchanged, 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.Acceptance notes
source.whereuses the JSON editor, notfilter-builder(the card namedfilter-builder).filter-builderwrites a view rule list ([{ field, operator, value }]);whereis an ObjectQL filter record, whichKnowledgeSourceSchemarefuses as a list — pinned in the form test. The JSON editor is thereport.metadata-form.tsruntimeFilterprecedent.specCreateSeedinResourceEditPage.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.manage_knowledge_sources, source admission as the author) are row 3a's, pinned inpackages/rest/src/meta-type-write-capability.test.tsandpackages/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.MetadataResourceEditPagebinds the pickers tosource.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, andsearch_knowledgeover the live/mcptransport follows each with no restart. The read-back parses withKnowledgeSourceSchema. Not driven: the select and field-picker controls typed end to end. The dogfood body is a literal of the keys the form offers.required: the editor judges arequiredmark only on top-level rows, sosplit.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):
ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx— thesourceObjectNamehunk: the declared path is the last fallback, so no existing type changes binding.ui/packages/app-shell/src/views/metadata-admin/formBoundObject.ts— the composite walk.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.Derived gates (local subset)
At
59defa6ffe,node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 94 commands. All 94 ran and exited 0.--ranreconciliation:94 derived famil(ies) accounted for — 94 run, 0 NOT-MEASURED. That includescheck:dual-build-cjs-loads, now measured, pluscheck:query-options-erasure,check:type-check-debtandpnpm --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 on0b20f7cce9for the missing zh-CN overlay, is green. The PR readsmergeable_state: clean.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP