Skip to content

feat(studio): the Studio menu draws no datasource row, and ADR-0084 writes it as a no-row entry - #37945

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-f9vtm5
Nov 27, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-f9vtm5

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #37920

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:App Studio 左侧菜单「平台」组里不再有「数据源」这一行,⌘K 搜索面板里也没有了;数据源只在「设置 › 集成」里管。「全部类型」目录仍列数据源,点开去设置。
  • 为什么做:App Studio 改版专题里你的决定 12:连接是绑在环境上的配置,归设置管,Studio 只开发软件包。
  • 出错会怎样:只少画菜单里的一行,不动数据、不动设置页,直接撤回即可恢复。
  • 要你做什么:这个 PR 改了受管文档(架构决策记录 ADR-0084 的类型表一行),审核通过后请你或 os-zhuang 批准合并。

What changes

  • The menu draws no datasource row, in any scope. studioMenuPlacement.ts drops the row and adds STUDIO_MENU_NO_ROW_TYPES = {'datasource'}; buildStudioMenu skips a type in that set before it places anything, on a package, on ~org and on ~all. Removing the placement row alone would not do it: the menu's own rule draws a type with no row in 高级 at the end of its group ("never invisible", objectstack#37201), so the no-row set is the exception that rule now names.
  • Retired, because they served only that row: the datasource branch of typeEntryPath (it routed the row to Setup's Datasources page) with its SETUP_DATASOURCES_PATH import, and the row's Database icon in StudioMenu.tsx.
  • The ⌘K palette follows. It lists the menu's own entries (buildStudioMenu), so its type:datasource entry goes too; StudioPaletteGroups.surfaceScope-36900.test.tsx is re-pointed.
  • What stays, and why: SETUP_DATASOURCES_PATH (the directory tile and the area's datasource/* redirect read it); STUDIO_PALETTE_ITEMLESS_TYPES (the palette's item reads still run over the directory-scoped types, which include datasource, so it still keeps the palette from reading datasource items; only its docblock changes); the type's system registration; HIDDEN_DIRECTORY_TYPES (untouched).
  • ADR-0084, the type → group table: the datasource row becomes a no-row entry like field's (| — | for Order and Tier, last in its group), external_catalog moves from 7 to 6, and one dated note under the table names this card. 平台 Platform still counts 7 table rows (six with an order, and datasource), so no count changes. Drafted by an isolated contract-review-tier subagent at effort xhigh. The stale whole-table counts and the knowledge_source row are ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740's, not this PR's.

Card question (a): does 全部类型 still list datasource?

Yes. Read on the booted showcase (this branch): /studio/com.example.showcase/metadata draws a Datasource tile linking to /apps/setup/metadata/datasource (DirectoryPage.tsx, href={host && e.type === 'datasource' ? SETUP_DATASOURCES_PATH : undefined}), because scopeDirectoryEntries hides only field, package and form. This matches ADR-0084: the amendment's sentence is "The menu draws no datasource row", about the menu alone; the directory keeps one entry for the type in 平台 Platform (one type, one group), and the tile leads to Setup, so a connection is still managed in Setup alone and nowhere in Studio. No mismatch to report; the directory is unchanged, as the claim requires.

Tests

  • studioMenuModel.test.ts: a new block "the menu draws no datasource row" — on a package, ~org and ~all, with setupDirectory true and false, a served, counted, settled datasource draws no entry and no entry leads to Setup's Datasources page, while api and external_catalog beside it do; a package whose only system type is datasource draws 平台 Platform with diagnostics alone, in the fold; on ~org/~all it leaves no 平台 Platform group. The package-scope keys test is rewritten on purpose (system: ['diagnostics']), marked in a comment.
  • studioMenuPlacement.test.ts: the registry pin reads "every listable type has one row, unless the menu draws no row for it"; a new pin says datasource is registered system, the directory lists it, and it has no row; the 高级 order literal drops it; a new 平台 Platform group pin; the ADR pin passes against the table as this PR leaves it.
  • Local, from ui/, under the verify lock: npx vitest run packages/app-shell/src/views/studio-design/ — Test Files 280 passed (280), Tests 2322 passed (2322), VERDICT command-exit 0. studioMenuPlacement.test.ts alone on the final ADR text: 19 of 19, VERDICT command-exit 0.

Acceptance notes

  • Two ADR-0084 sentences outside the table become dated history rather than live text, left as is (the card says no other ADR text): line ~463, "datasource's and form's still wait for their changes", and the 2026-11-25 silent item 1's order "translation · api · datasource · external_catalog". Both now point at, or are superseded by, the new note under the table. carrier: none — noted, not filed.

Verification

Read first, by risk:

  1. ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts, buildStudioMenu: the one continue on STUDIO_MENU_NO_ROW_TYPES.
  2. docs/adr/0084-application-builder-information-architecture.md, the 平台 Platform rows and the new note.
  3. studioMenuPlacement.test.ts: LISTABLE_TYPES now excludes the no-row set.

Two-minute check: cd ui && npx vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts packages/app-shell/src/views/studio-design/studioMenuModel.test.ts — both pass.

Browser (showcase booted from this branch, ui/ console over HMR, seeded admin): the showcase holds two datasources (default, showcase_external; GET /api/v1/meta/datasource 200). On /studio/com.example.showcase/metadata/object with the 高级 fold open, 平台 Platform reads Documentation 8 · Documentation Book 1 · Email Template 1 · API Endpoint 3 · Diagnostics, and no Datasources row; no other group lists it either. The screenshot is kept with the project thread (card-37920/studio-menu-platform.png).

Local gates

Derived with node scripts/pm/dispatch-gates.mjs --commands at a45fff4; reconciliation: "48 derived famil(ies) accounted for — 48 run, 0 NOT-MEASURED (a DERIVED zero)".

  • node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
  • node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
  • node scripts/check-adr-links.mjs :: exit 0
  • node scripts/check-adr-links.mjs --self-test :: exit 0
  • node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
  • node scripts/check-closing-keyword-parity.mjs :: exit 0
  • node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
  • node scripts/check-comment-mask-corpus.mjs :: exit 0
  • node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
  • node scripts/check-empty-changeset.mjs --self-test :: exit 0
  • node scripts/check-sdui-manifest.mjs :: exit 0
  • node scripts/check-sdui-manifest.mjs --self-test :: exit 0
  • node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
  • node scripts/ci/snapshot-next.mjs --self-test :: exit 0
  • node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
  • node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
  • node scripts/release-pending-publish.mjs --self-test :: exit 0
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
  • pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
  • pnpm check:adr-anchors :: exit 0
  • pnpm check:adr-index :: exit 0
  • pnpm check:adr-symbol-anchors :: exit 0
  • pnpm check:changeset-gate-self-tests :: exit 0
  • pnpm check:ci-filter-parity :: exit 0
  • pnpm check:closed-ceremony-text :: exit 0
  • pnpm check:cross-package-test-inputs :: exit 0
  • pnpm check:dispatcher-error-vocabulary :: exit 0
  • pnpm check:doc-authoring :: exit 0
  • pnpm check:driver-memory-census :: exit 0
  • pnpm check:engine-double-contract :: exit 0
  • pnpm check:gitlink-declared :: exit 0
  • pnpm check:nul-bytes :: exit 0
  • pnpm check:pm-governed-merges :: exit 0
  • pnpm check:pm-prior-rulings :: exit 0
  • pnpm check:published-files :: exit 0
  • pnpm check:query-options-erasure :: exit 0
  • pnpm check:refd-timer-probe :: exit 0
  • pnpm check:registry-log-declared :: exit 0
  • pnpm check:rest-log-spy-declared :: exit 0
  • pnpm check:skill-identifier-liveness :: exit 0
  • pnpm check:test-source-alias :: exit 0
  • pnpm check:tier-file-adoption :: exit 0
  • pnpm check:type-check-coverage :: exit 0
  • pnpm check:type-check-debt :: exit 0
  • pnpm check:undeclared-dep-imports :: exit 0
  • pnpm check:watch-hint-literal :: exit 0
  • pnpm check:where-matcher :: exit 0
  • pnpm --dir ui exec vitest run scripts/ :: exit 0

node scripts/pm/overlap-check.mjs at a45fff4: VERDICT clean exit 0 (origin/main f926dfa merges cleanly; #37927, which shares the ADR file, merges cleanly).

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibwtMGwDL8KdXqqaLLT


Generated by Claude Code

The 平台 Platform group of App Studio's menu no longer lists Datasources, in
any scope; a connection is managed in Setup → Integrations alone (ADR-0084,
amended 2026-11-26, decision 12). The type stays registered `system` and the
type directory still lists it. ADR-0084's type → group table writes the
`datasource` row as a no-row entry like `field`'s, with a dated note.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibwtMGwDL8KdXqqaLLT
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a45fff40937848fa7bf213fb61674d480ab66881
Local-runs: none
Scope: docs/adr/0084-application-builder-information-architecture.md + ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts, ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts, ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts, ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts, ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx
Security-touching: no
Rule-change-verified: none

PR #37945, card #37920, net diff against main (merge base 73d5e347; main has since added three lines to ADR-0084 in the top-bar table near line 410, card #37685, a different section from this PR's hunks at lines 193-214). Read-only: the card with its four comments, decision 12 on #37424, the PR body, file list and diff, the tree at the head via git show, and the head's check-runs.

Check-runs on this head, read at review time. Completed and green: Auto Label, Dogfood Regression Gate, Plan Test Core shards, Build UI Deps, Check Documentation Links, Type Check · workspace, Check PR Size, PR-body guards, Governed Surface Queue Guard, filter. Skipped by the workflow's own planning: UI Published Artifacts, Build Core, Dogfood Verify CLI, Build Docs, the matrix Dogfood shard, Temporal Conformance, the two opt-in harnesses, Queue verdict, Borrowed queue verdict, Schedule gate. No check has failed. STILL PENDING, not waited on: Test UI 1/16 to 9/16 (the shards that run the two test files this record leans on), Test Core 1/10, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset (not yet completed at the first read), Type Check · source gates, Type Check · consumer gates, Lint · ESLint, Lint · scoped · tooling self-tests, Lint · scoped · slot lookup & corpus, Lint · scoped · query-options erasure, Lint · CI, release & engine gates, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates. This PASS is a design verdict on the tree; it does not stand in for those conclusions, and the queue reads them itself.

① Derived judgments

  • Accept-set: none changes. No spec schema, no registry entry, no authorable key is touched; datasource stays registered system in DEFAULT_METADATA_TYPE_REGISTRY (the new test pins it). Right.
  • Menu surface: buildStudioMenu emits no type:datasource entry on a package, on ~org or on ~all, with setupDirectory true or false. That is decision 12's sentence ("the Studio menu drops the datasource entry") and ADR-0084 line 446 ("The menu draws no datasource row"). Right.
  • Palette surface: StudioPaletteGroups.tsx:171 builds its groups from buildStudioMenu(...), so the studio-entry type:datasource row leaves the ⌘K palette with no palette code change. Right, and a consequence the ADR sentence implies (the palette lists the menu's own entries).
  • Module surface: one new export, STUDIO_MENU_NO_ROW_TYPES, in studioMenuPlacement.ts; typeEntryPath loses its datasource branch and the module its SETUP_DATASOURCES_PATH import. Neither file is re-exported from the package index. Right.
  • Unchanged, and rightly so: HIDDEN_DIRECTORY_TYPES (field, package, form), so the 全部类型 directory still lists the type; DirectoryPage.tsx:415 and the datasource/* route in StudioMetadataArea.tsx:493, both still reading SETUP_DATASOURCES_PATH; STUDIO_PALETTE_ITEMLESS_TYPES, still read at StudioPaletteGroups.tsx:87 over the directory-scoped types, which include datasource.

② Semver level

.changeset/37920-studio-menu-no-datasource-row.md: @object-ui/app-shell patch, Clause-②: no, Metadata-protocol: none. The diff publishes from that one package; nothing a metadata author can write changes, so the kind is none and the level is patch (AGENTS.md: "none takes patch; a non-protocol change ... ships patch"). No removed public export, so no BREAKING banner is owed. The PR body carries the same two lines.

Clause-②: no — agreed; no accept-set widens or narrows.

The changeset's last sentence ("its tile and every datasource URL in the area still open Setup's Datasources page") is true of the tree. The Check Changeset run had not completed at the first read.

③ Boundary flags

  • PR body, Acceptance notes — two ADR sentences outside the table left as dated history. Read both. Line 463's amendment note ("datasource's and form's still wait for their changes — the note under the table") is dated 2026-11-26 and links the very block where this PR's 2026-11-27 note now sits, so a reader following it lands on the correction. The 2026-11-25 silent item 1's order "translation · api · datasource · external_catalog" records how the Order column was derived on that date; the table and its new note now supersede it for datasource. Both are dated statements, not live rules, and the card says "No other ADR text". Answered: leaving them is correct; no carrier needed.
  • Card question (a) — answered from the code and the answer holds. scopeDirectoryEntries hides only field, package, form; DirectoryPage.tsx:415 gives the datasource tile SETUP_DATASOURCES_PATH. ADR-0084's sentence is about the menu; the type keeps one group (平台 Platform) in the directory and its tile leaves Studio, so a connection is still managed in Setup alone. No mismatch.
  • Seat scope amendment 2 — the stale "33 entries" / "AI 4" counts and the knowledge_source row are ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740's. Verified: the ADR diff is exactly two rewritten table rows (lines 196-197) and one added note (line 214). Lines 208 (knowledge_source), 210 and 212 (the counts) are byte-identical to main. The new note restates only the 平台 Platform count (7), which the card allows ("the table's count note if one names the 平台 Platform rows") and which is true.
  • open_questions in the dev report: empty. The report's two out_of_scope_findings are the two flags above.
  • Card acceptance, "A screenshot of the 平台 group on the PR": the PR body describes the browser read and says the image is kept with the project thread, not attached to the PR. Outside ④'s scope; left to the lane seat's ACCEPT.
  • SQL push-down: not applicable. The diff is a pure in-memory menu model, a doc and tests; no query, no id materialisation, no join.

④ Design judgment

No must-fix, no should-fix.

docs/adr/0084-application-builder-information-architecture.md (hits)

  • Against its ruling: decision 12 on 专题:App Studio 改版(Studio 是开发软件包的入口:左右两栏、软件包切换和概览页、列表页按前端样式、专用色和新名字) #37424 reads "Datasources are managed only in Setup → Integrations. A connection is environment-bound configuration, so the Studio menu drops the datasource entry (task 6)." The ADR already carries it at line 446 and line 487; this PR only carries the table out, as line 463 says a row is rewritten "in the change that moves it — the same pull request". Holds.
  • Row form: | **平台 Platform** | system| — |datasource | — | is cell for cell the form of | **数据 Data** | data| — |field | — |, and like it sits last in its group. Holds.
  • external_catalog 7 to 6: the ADR's 平台 Platform orders now read doc 1, book 2, email_template 3, translation 4, api 5, external_catalog 6; STUDIO_MENU_PLACEMENT's system rows read doc, book, email_template, translation, api, external_catalog. Same sequence.
  • "Never invisible" (line 308, objectstack#37201): the ADR's rule is "A type with no row in the table is drawn in 高级, at the end of its group. It is never invisible." As the ADR writes it, the trigger is a type the TABLE has no row for. datasource keeps a row in the table, written with no order and no tier, which is the ADR's own notation for "draws no row" (line 216, and line 446: "like field, it is a type that draws no row"). So the exception does not contradict the rule as written, and it IS written in the ADR: line 446 (the amendment), line 487 (the stands/replaced table) and now the table row and its note. The type also stays reachable from the fold's 全部类型 row, so nothing a builder could reach before becomes unreachable.
  • The dated note, sentence by sentence: "carries out Amendment (2026-11-26) for one row and decides nothing" — true, the amendment decided it; "The menu draws no row for it by the same change" — true (buildStudioMenu); "written as field's is — no order, no tier, last in its group" — true; "external_catalog, the one type that was behind it, is one place earlier, sixth" — true; "stays registered system and keeps its row in this table, so 平台 Platform still counts 7: six rows with an order, and this one" — true (six ordered rows plus this one). The note is true.
  • Nit N1: the legend at line 216 still explains the dash for field alone ("field carries no order and no tier because it draws no row"); datasource now shares the notation and is explained only by the dated note two lines above. Accepted deviation under the card's "No other ADR text"; a natural rider for ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740 when that card redraws the notes.

studioMenuPlacement.ts (implementing)

  • The row is gone and STUDIO_MENU_NO_ROW_TYPES = {'datasource'} is the named exception; the docblock states the never-invisible rule and then "The one exception is a type the menu draws no row for", citing the amendment and the card. The code's rule is keyed on the placement LIST having no row, where the ADR's is keyed on the TABLE, so without the set the type would have fallen into the unplaced branch and been drawn in 高级 — the set is necessary, not decoration. Agrees with the contract.
  • Break attempt, exception creep: the test pins [...STUDIO_MENU_NO_ROW_TYPES] to exactly ['datasource'], so a second type cannot be hidden through this set without a red test and, by the ADR pin's row count, an ADR row rewritten to the dash form. The exception cannot grow silently.

studioMenuModel.ts (implementing)

  • One continue on the set at the top of the placement loop, before group lookup, tier and path, independent of scope and of setupDirectory: "in any scope" is literally true. The continue cannot leave an empty 平台 Platform group behind, since groups with no entries are filtered at the return.
  • Retired branch: typeEntryPath is module-private with one caller (line 216), which can no longer be reached with datasource; the removed import has no other use in the file. Nothing dangles. SETUP_DATASOURCES_PATH keeps its two live readers.
  • Nit N2: the header docblock's inserted sentence ("Not a type the menu draws no row for ...") is a fragment placed between "still shows where the first is made." and "Each opens the type's list", so "Each" now reads across it. Wording only.

studioMenuPlacement.test.ts (implementing; the gate that ties the table to the list)

  • Still binds every drawn row: LISTABLE_TYPES is the directory's types less the no-row set; set equality with the placement rows holds both ways; the ADR pin requires rows.length to equal LISTABLE_TYPES.length, equal tiers both ways, and per-group order equal to the Order column. Break attempts read against the regex ADR_ROW: restoring | 6 | datasource | 高级 | in the ADR makes the row count one too many — red; restoring the placement row makes the set equality red; leaving external_catalog at 7 passes the order test (it sorts) but is exactly what the ADR diff fixes, and a duplicate order would still sort correctly — the pin has always bound sequence, not the printed number.
  • Not weakened: the ruled-order literal drops one name, a new 平台 Platform group pin and a new registration pin are added, and in studioMenuModel.test.ts the old filter x.type !== 'datasource' is removed from the address check, which tightens it.
  • Nit N3: ADR_ROW requires a numeric Order, so a dash row (field's, and now datasource's) is read by no assertion; deleting the datasource row from the ADR outright would stay green. Same shape field has had since Studio 菜单(M2):类型顺序和「常用 / 高级」写成一张表,用测试钉住注册表和 ADR #37200; no effect on what the menu draws.

studioPaletteModel.ts (implementing; judged in scope, since its docblock describes the menu's behaviour)

  • Only the docblock of STUDIO_PALETTE_ITEMLESS_TYPES changes, from "the menu's entry for it already leaves Studio" to "the menu draws no row for it". True of the tree. The set itself is still needed: the palette's item reads iterate the directory-scoped types, not the menu's entries, so without it the palette would fetch datasource items. The ⌘K palette's entries do derive from buildStudioMenu (StudioPaletteGroups.tsx:171), and the re-pointed surfaceScope-36900 expectation matches.

StudioMenu.tsx (implementing; judged in scope, as the consumer that draws the entries)

  • The datasource: Database icon row and the Database import are removed together; no other use of Database remains in the file (other files in the folder import their own). studioMenuEntryIcon falls back to the group icon for an unmapped type, so no lookup can fail. Nothing dangles.

Remainder of the diff (the changeset, studioMenuModel.test.ts, StudioPaletteGroups.surfaceScope-36900.test.tsx): the lane seat's ACCEPT at TIER_DEFAULT.

Nits N1 to N3 have no effect on correctness or the contract and are left as accepted deviations; none needs a change on this head.

Implemented-by: claude/project-thread-f9vtm5
Reviewed-by: session_01L9qibwsYQqi3TBx2SFE978

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

L1-b, the seat's L1 thread for zone o3-studio · 2026-11-27T12:52Z

席位核对 — L1 ACCEPT @ a45fff40937848fa7bf213fb61674d480ab66881

Verdict: ACCEPT. The at-tier contract review 7218483010 (PASS, tier verified on the reviewer's transcript, No must-fix, no should-fix., nits N1–N3 left as accepted deviations) is posted above on this head. Its scope covers the ADR and the five implementing files; the remainder below is this L1 read.

Read at this head

  • Shape (l1-face.mjs --pr 37945, CLEAN): draft, base main, first line Fixes #37920, no closing keyword next to another card, 9 files, +124/−28, no release path, Clause-②: no · Metadata-protocol: none on the body and the changeset.
  • Fixes is right. The card's three asks are all in the diff: the menu row and what served only it are retired, question (a) is answered on the PR from the code, and the ADR row is rewritten in the same PR. The scope amendment holds: the ADR hunks are lines 196–197 and one added note; the "33 entries" / "AI 4" counts and the knowledge_source row are byte-identical to main (ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740's).
  • Changeset (@object-ui/app-shell patch; the package is private, and app-shell changesets are this repo's practice, e.g. feat(app-shell): the assistant's entry is an outlined Ask AI button at the end of every page's top-right group #37885). Sentences read in person against the head: "no longer lists Datasources, in any scope (a package, the organization's flows, the cross-package leg)" — the one continue in buildStudioMenu runs before scope, group and setupDirectory; "neither does the ⌘K palette, which lists the menu's own entries" — StudioPaletteGroups.tsx:171 builds from buildStudioMenu; "the 全部类型 All types directory still lists it, and its tile and every datasource URL in the area still open Setup's Datasources page" — DirectoryPage.tsx:415 and the datasource/* route at StudioMetadataArea.tsx:493 both read SETUP_DATASOURCES_PATH. All true.
  • Tests re-pointed, not weakened. The package-keys test drops type:datasource with an on-purpose marker; the address test loses its datasource exclusion, which tightens it; the palette expectation drops one line with a marker; new pins cover the no-row set (pinned to exactly ['datasource']), the registration, the directory listing, all three scopes × setupDirectory, and the 平台 Platform group. The body's local run (280 files / 2322 tests, VERDICT command-exit 0) has real output, and CI ran the UI shards on this head.
  • Checks: 41 success, 11 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check are success. mergeable_state is clean.

Accepted deviation

  • The card's acceptance asks for a screenshot of the 平台 group on the PR. The relay cannot attach an image, so the body states the browser reading (showcase, two datasources served, 平台 Platform rows listed, no Datasources row in any group) and the image is kept with the project thread. Accepted.

Out of scope

  • Acceptance notes (dev): the two dated ADR sentences outside the table (line ~463 and silent item 1's order) — dropped — dated history, superseded by the new note; the record agrees.
  • N1 (record): the legend under the table still explains the dash for field alone — Acceptance notes, a rider for ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740, which redraws those notes.
  • N3 (record): ADR_ROW reads no dash row, so deleting the datasource (or field) row from the ADR stays green — handed to the seat for the filing gate.

Before landing

docs/adr/**: Tier H. The PR stays draft until the seat's hand-off; approval goes through the seat, never the seat's own decision.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Recorded 2026-11-27T12:53Z.

席位意见:可以合。只删放置表一行不够(没放置的类型会落进「高级」折叠里画出来),所以新增 STUDIO_MENU_NO_ROW_TYPES 在 buildStudioMenu 里跳过;ADR 改动由隔离的 claude-fable-5-2 在 xhigh 起草,只动 datasource 行、序号和一条说明,没有碰 #37740 负责的「33 entries」「AI 4」计数和 knowledge_source 行(认领修订 7217796180)。

席位核对 — ACCEPT · repo:objectstack#3 · head a45fff40937848fa7bf213fb61674d480ab66881

  1. 形态:Fixes #37920;Clause-②: no、Metadata-protocol: none;changeset @object-ui/app-shell patch(先例 fix(app-shell): a state machine row's Next states box in Studio keeps a typed comma #37837);9 个文件 +124 / −28。
  2. 前提实测:主干上 studioMenuPlacement.ts:104、studioMenuModel.ts:178 仍带这一行;修后 studio-design 目录 280 个文件 2322 个测试通过,studioMenuPlacement.test.ts 19/19;浏览器在 showcase 上读过。
  3. 门禁 check-runs:41 success、11 按设计跳过、0 失败,mergeable_state clean(L1-b 7218781367 读)。本地派生门禁 48/48 exit 0;overlap-check 对 main 与 docs(adr): ADR-0084 records the ~org Changes + Publish home in the homes table #37927 干净。docs/adr 受管 ⇒ Tier H。
  4. 接受的偏差:卡要求的截图没贴在 PR 上,正文写了浏览器读数,截图在项目文件里;审核 nit N1–N3 不改,以免动 head。L1-b ACCEPT 7218781367。
  5. 范围外去向:N1(表格图例只解释了 field 的短横)交给 ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740 一并改;N3(测试的 ADR_ROW 读不到短横行,删掉 datasource 或 field 这类行测试仍绿)由本席另立跟进卡。卡上问题 (a):「全部类型」目录仍列数据源,与 ADR-0084 一致(修订只说菜单)。
  6. 落地条款:Tier H ⇒ 维护者亲手合并,或 GOVERNED_APPROVERS(os-zhuang)批准后本席照落地前检落地。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

维护者速读

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 27, 2026 13:09
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 7fbfd8f Nov 27, 2026
58 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-f9vtm5 branch November 27, 2026 13:56
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ow; the knowledge_source tombstones name the code door (objectstack-ai#38015)

Fixes objectstack-ai#37740
Fixes objectstack-ai#37741

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:从旧版升级、在代码里注册知识源的开发者,碰到旧写法的报错时,提示会先说明“直接改代码里那处注册”,再提迁移命令;旧名字以下划线开头的知识源改名后会留下一份旧索引,升级说明现在写明它为什么留下、怎么删。应用搭建菜单的架构决策记录(ADR-0084)里,几处统计和说明补上了表里已有的“知识源”一行,菜单本身不变。
-
为什么做:知识平台专题里“知识源成为受管元数据类型”那次合并,审核留下两条小尾巴:升级提示指向一个对代码注册不起作用的命令,架构记录的说明没跟上表格。这次替升级的开发者和读记录的人补齐。
- 出错会怎样:只改提示文字和文档,不改任何行为、数据和菜单;文字写错最多是提示不准,直接撤回即可。
- 要你做什么:这个 PR 改了受管文档(架构决策记录 ADR-0084 的几处说明),审核通过后请你批准合并。

## What changes

Two cards from one contract record (the review of the change that made
`knowledge_source` a governed type): its nit N2 is objectstack-ai#37740, its nit N5 is
objectstack-ai#37741. Text only: no schema shape, no behaviour, no menu row.

### objectstack-ai#37740 — ADR-0084's notes read true for the table as it stands
(governed, `docs/adr/**`)

The table has held a `knowledge_source` row since that change (AI, order
5, 高级). The prose around the table still described it without that row.
Five places, each amended in the record's own dated form, struck text
kept:

1. **The note under the table** gains one dated paragraph: the registry
read again at `origin/main` `62dd9e1ef5` holds 35 entries — the 33 of
the two earlier readings and two registered on 2026-11-27, `form` (`ui`)
and `knowledge_source` (`ai`); `form` has no row yet, so the table has
34 rows; AI counts 5.
2. **The fold sentence** ("its label is drawn again inside the fold only
where a package holds an `ai_context`") gains a dated note: AI holds two
高级 types, so either one draws the label.
3. **The 2026-11-25 amendment's table row** ("One row is new:
`ai_context`") gains a dated note: a second row has been written under
item 6 since.
4. **Item 6**: the heading names both types (the old heading struck, not
deleted), and the item ends with a dated note that says what changed for
`ai_context`'s row (fourth, no longer last in AI) and how the same three
ruled sentences place `knowledge_source`.
5. **The sentence that introduces the table** ("*(33 at the 2026-11-25
reading, in the note under the table)*") now also points at the
2026-11-27 reading. This fifth place is not in the card's list of four;
it is the same stale count one paragraph up, so it is brought along here
rather than left to contradict the note it points at. The claim's file
surface names four places: it wants this one added.

The card says "33 entries"; the registry holds 35, because `form` was
registered the same day (hidden from Studio's directory, no row). The
note says 35 and says why the table has 34 rows.

Nothing is decided: the row, its order and its tier were written by the
earlier change under item 6, and `studioMenuPlacement.ts` already
mirrors them. No Status line changes.

### objectstack-ai#37741 — the `knowledge_source` tombstones say what the author of a
registration in code does (`packages/spec`)

- **The prescriptions.** Each retired-key prescription that ends with
`os migrate meta --from 18` (`id`, `source.contentFields`, `embedding`,
`vectorStore`, `adapterConfig`, `refresh.cron`, and the `'*'` member of
`source.content`) now first says: a source registered in code
(`KnowledgeServicePlugin({ sources })`, `registerSource`) is in no stack
collection, so the command lists no edit for it, and the edit is made in
the registration itself. One constant, `CODE_DOOR_18`, placed before the
migrate sentence, which stays the last sentence of its prescription (the
house pin). The prescription for a retired source kind (`file`, `http`)
is unchanged: it sends nobody to the command.
- **The ADR-0087 D3 entry** `knowledge-source-registration-governed`
(the entry `os migrate meta --from 18` prints) now states the one
exception to "nothing is rebuilt": a source whose 18 `id` began with an
underscore. A `name` must start with a letter, so that source is
renamed; an adapter keys what it holds by the source's name, so the
renamed source is built from nothing under its new name and the adapter
keeps the index it built under the old id; the service never drops that
index (it drops one only for a `knowledge_source` item it stops
serving). The entry says how it is dropped: `dropSource({ source })` on
the adapter (`IKnowledgeService.getAdapter`) with `name` set to the old
id, or in the adapter's own store where the adapter has no `dropSource`.
- **Pins.** `knowledge-source.test.ts`: each of the six tombstones and
the `'*'` message must name both spellings of the code door and "in the
registration itself", each before the sentence that names the command.
- **Generated.** `check:generated` found one artifact stale after the
tombstone change (`content/docs/references/**`), and `--fix` rewrote one
page of it: `content/docs/references/ai/knowledge-source.mdx`.
- **Changeset.** `@objectstack/spec` patch.

## Tests

All on head `4f6792529c`, in one hold of the shared verify lock
(`VERDICT command-exit 0`), unless a line says otherwise.

- `pnpm --filter @objectstack/spec build` — exit 0.
- `pnpm --filter @objectstack/spec check:generated` — exit 0: "All 14
generated artifacts are up to date".
- `pnpm --filter @objectstack/spec test` — exit 0: `Test Files 909
passed (909)`, `Tests 28748 passed | 1 todo (28749)`.
- `pnpm --filter @objectstack/spec typecheck` — exit 0.
- `pnpm --filter @object-ui/app-shell exec vitest run --root ../..
--maxWorkers=2
packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts`
— exit 0: `Tests 19 passed (19)`. This is the test that parses the ADR's
table rows; no row changes here.

<details>
<summary>Ablation (one): the new pin goes red when one tombstone loses
the code-door sentence</summary>

Run on `df045b9f8b`. The two files it involves have the same blobs on
the final head: `knowledge-source.zod.ts` `0d433e77468e`,
`knowledge-source.test.ts` `56ebce2f5d4e`.

Through `scripts/ablation-replace.mjs`: the `+ CODE_DOOR_18` line of one
tombstone (`adapterConfig`) replaced by an empty-string term. Direction
set before the run: that row red, every other test green.

- landed: `ok mutation landed: anchor 1 -> 0, blob 0d433e7 ->
8a47142baebf`; `+ CODE_DOOR_18` lines on disk during the run: 6 (7
before).
- result: exit 1, `Tests 1 failed | 31 passed (32)`. The one failure is
the row "`adapterConfig` is refused at its own path with its
prescription, the code door and the migrate sentence": ``AssertionError:
`KnowledgeServicePlugin({ sources })` is named: expected -1 to be
greater than -1``.
- restored: ``ok restored: blob == HEAD (0d433e7) and `git diff
HEAD` is empty``; 7 lines again. The full suite above ran after it.

The first attempt measured nothing and is void: its replacement text was
a prefix of the anchor, so the tool refused it ("the replacement count
moved 1 -> 1, a rise of 0, not the declared 1") and restored without
running the test. The replacement was changed and the ablation run once
more.

</details>

<details>
<summary>Probe (one-off, not committed): an underscore-led id leaves its
index behind, and dropSource removes it</summary>

A test file placed in `packages/plugins/knowledge-memory` for the run
and removed after it (`git status` clean, checked by the same script).
It reads the schema and the memory adapter:

- `KnowledgeSourceSchema.safeParse` of a source named `_kb` is refused,
at path `name` alone; the same source named `kb` parses.
- an index built under `_kb`, then the source built under `kb`: `old key
holds ["article:1"] new key holds ["article:1"]`.
- `dropSource` with the source's `name` set to `_kb`: `old key holds []
new key holds ["article:1"]`.
- exit 0, `Tests 1 passed (1)`.

Two earlier attempts measured nothing and are void: the first imported
the service and stopped on a workspace package that was not built; the
second read a field the listing does not have.

The service's half is pinned by landed tests and was not run again here:
"unregisterSource removes a source registered in code and keeps its
index" (`service-knowledge`, `knowledge-source-registry.test.ts`) and
the adapter contract suite's `dropSource` block.

</details>

## Acceptance notes

- **"The ADR-0087 D3 entry" is a registry entry, not text in ADR-0087.**
The claim's file surface and its `Container & model` line name
`docs/adr/0087-metadata-protocol-upgrade-contract.md`. That file holds
no `knowledge_source` text (`grep -c knowledge`: 0; control `grep -c
D3`: 19). The D3 entry the card means is
`packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts`,
which is what this PR edits. ADR-0087 is not touched; the PR is governed
through ADR-0084 alone.
- **The underscore fact was read in code before it was written**, then
run once (the probe above). The readers: `name` takes
`ROUTER_ADDRESSABLE_NAME_PATTERN` (a letter first) where the 18 `id`
pattern admitted a leading underscore; every adapter keys by
`AdapterContext.source.name`; `KnowledgeService.unregisterSource` leaves
the index with its adapter and `dropMetadataSource` runs only for a
metadata item; the scheduled reconcile that landed on `main` meanwhile
walks registered sources only; the three adapters in the tree (memory,
pgvector, turso) implement `dropSource`, which the contract leaves
optional.
- **The entry does not list what starts the build of the renamed
source.** `main` gained a third moment (the scheduled reconcile) while
this branch was open, so the sentence says what the build costs instead:
every record the source covers is read, and on an adapter that embeds
the content fields of each are sent to the embedding provider again.
- **Not changed, on purpose:** the `id` tombstone still says "the value
is unchanged, so the source's index is found again and is not rebuilt".
That holds for every id that is a legal name; for an underscore-led id
the parse refuses the value next, with the name grammar's own message,
and the D3 entry carries the rest. The card asks for the exception in
the entry, not in the tombstone.
- **Seen, not changed here, no card:** the changeset of the earlier
change (`.changeset/37304-knowledge-source-governed-type.md`) and the
hand-written `content/docs/protocol/knowledge.mdx` say the index is
found again, without the underscore exception. Both are right for an id
that is a legal name. An edit to a landed changeset is a deliberate
correction with its own declaration, so it is left for the seat to
place.
- **Neighbour objectstack-ai#37945 (the `datasource` row)** rewrote the same note
block of ADR-0084 and landed first. `main` was merged twice: at
`62dd9e1ef5` (one conflict, in that block: its note kept first, this
PR's note after it, reworded for the table as it then stood) and at
`9a274e6725` (clean). `node scripts/pm/overlap-check.mjs` before each
push; on the final head: `VERDICT clean exit 0`, 0 PR heads.
- **Neighbour objectstack-ai#37306** edits `knowledge-source.zod.ts` at the `adapter`
line, about ten lines from this PR's nearest edits on either side. It
has no open PR at this writing.
- **Not measured locally, declared:** `pnpm --filter @objectstack/cli
exec vitest run test/migrate-meta-engine-guidance.test.ts`, which the
derivation names. It spawns the CLI and needs its 71-package dependency
closure built; CI runs it. What it pins for this diff was read directly:
the entry's four printed fields hold no tracker id (`surface` 279 chars,
`replacement` 863, `reason` 2140, `acceptanceCriteria` 648: no match; a
control string matches).

## Verification

**Read first (by risk):**

1. `docs/adr/0084-application-builder-information-architecture.md`, item
6's closing note. The risk hunk is one clause: "its schema requires one
object (the `object` key of its `source`, …), so the first test of the
rule sorts it 高级". It applies the record's own rule ("Its schema does
not require one object") to a type the ruling did not name. The row's
tier does not rest on it: the two sentences that follow place the type
without it. If the seat reads that clause as more than carrying out, it
can be struck and the note still stands.
2.
`packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts`:
`replacement`, `reason` and `acceptanceCriteria` are what an upgrading
author is shown. Check the drop instruction against
`packages/spec/src/contracts/knowledge-adapter.ts` (`dropSource` takes
an `AdapterContext`).
3. `packages/spec/src/ai/knowledge-source.zod.ts`: `CODE_DOOR_18` and
its seven uses.

**Two-minute check:** `pnpm --filter @objectstack/spec exec vitest run
--project local --maxWorkers=2 src/ai/knowledge-source.test.ts` — expect
`Tests 32 passed (32)`; six of them are the rows titled "… with its
prescription, the code door and the migrate sentence".

**Local gates, on head `4f6792529c`.** Derived by `node
scripts/pm/dispatch-gates.mjs --commands` with no paths; each command
run as printed, its exit code recorded before any pipe; reconciled by
`--ran`:

`Run reconciliation — 116 derived, 111 run, 4 NOT-MEASURED, 1 UNRUN.` ·
`✗ dispatch-gates --ran: 1 of 116 derived famil(ies) UNRUN.`

- **111 run: exit 0, every one.** Among them the families this diff
moves: `check:adr-index`, `check:adr-anchors`,
`check:adr-symbol-anchors`, `node scripts/check-adr-links.mjs`,
`check:keyed-text-bounds`, `check:spec-docblock-symbol-anchors`,
`check:issue-citations`, `check:nul-bytes`, `check:role-word`,
`check:closed-ceremony-text`, `node
scripts/check-adr-0087-registration.mjs --base origin/main`, `node
scripts/check-empty-changeset.mjs --base origin/main`, `node
scripts/check-changeset-no-major.mjs --base origin/main`, and the spec's
own `check:generated`, `check:docs`, `check:api-surface`,
`check:authorable-surface`, `check:liveness`, `check:upgrade-guide`,
`check:spec-changes`.
- `node scripts/adr-index.mjs --check`: exit 0, "adr-index: OK —
docs/adr/README.md is current and every record parsed." No index
regeneration was needed.

<details>
<summary>The five not measured here, each with its reason (none is a
finding; CI runs all five)</summary>

- **UNRUN (1), declared to CI:** `pnpm --filter @objectstack/cli exec
vitest run test/migrate-meta-engine-guidance.test.ts` (Acceptance
notes).
- **NOT MEASURED (4), each exit 3, PREREQUISITE NOT MET:**
- `pnpm --filter @objectstack/spec run check:skill-examples`: its
client-SDK surface reads the declarations of
`@objectstack/client-react`, a 48-package build closure that is not
built here. This diff adds or changes no fenced example.
- `pnpm check:dual-build-cjs-loads`: reads every package's `dist` ("Run
`pnpm build` first").
- `pnpm check:lean-entry-closure`: loads the built entries of
`@objectstack/objectql` (a 14-package closure).
- `pnpm check:type-check-debt`: its re-measure builds every package
under the shared verify lock. It got no turn on the first run (`VERDICT
queue-timeout (exit 99)`), and the second was withdrawn while still
queued: a whole-workspace build is out of proportion to a text-only
diff. Its structural half printed "OK — 132/135 workspace packages
type-checked (plus the root), 0 in the DEBT ledger".
- The derivation printed that the tree was 8 commits behind
`origin/main` at that moment, and that none of the commits it could see
touched what the answer derives from.

</details>

**CI:** no check-run existed when this body was written; the PR's own
check-runs are the verdict for every family CI runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Studio 改版(3-4):Studio 菜单去掉「数据源」一行——数据源只在「设置 › 集成」里管

3 participants