Skip to content

fix(runtime): MCP list_metadata_items package rows name the package - #39006

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-38966-package-list-rows
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-38966-package-list-rows

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #38966
Claim for this branch: #38966 comment 7327360271
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:助手在搭建入口列出环境里的软件包时,每一行会带上包的标识和名称,不再是一排空值。
  • 为什么做:属于云端搭建入口这一期的修补,替助手解决“分不清往哪个包里存草稿”的问题。
  • 出错会怎样:只影响列软件包这一种列表,其它类型的列表不变;有问题可以直接撤回这次改动。
  • 要你做什么:无。

What changes

list_metadata_items with type: "package" answered one row per installed package, every row { name: null, label: null, packageId: null, draft: false }. A package item is an installed-package record (InstalledPackageSchema): its id and display name sit on manifest, and summaryOf read only the item's top-level name, label and owning package.

summaryOf now takes the canonical type. For package it reads:

  • name = manifest.id: the value get_metadata_item { type: "package", name } reads the package by (measured below).
  • label = manifest.name: the manifest's human-readable package name (ManifestSchema.name; the manifest has no label key).
  • packageId = manifest.id: a package holds itself, and this is the value save_metadata_draft's package names, so an agent can copy it straight from the row.
  • draft = _draft === true, as before.

The row keeps its four keys and their types. Every other type takes the old path unchanged. The read is keyed on the type, not on the item's shape. It reads the spec's manifest object only, with no ?? id fallback.

Measured item shape (design point 1)

The real protocol (ObjectStackProtocolImplementation over the SQL driver on SQLite, two packages installed through registry.installPackage, tree 202cc2860d), getMetaItems({ type: 'package' }):

type= package count= 2
TOP-LEVEL KEYS enabled,installedAt,manifest,settings,source,status,updatedAt,writable
{ "manifest": { "id": "com.example.crm", "name": "CRM", "version": "1.0.0", "type": "app", "scope": "project" },
  "source": "code", "status": "installed", "enabled": true, ..., "writable": true }
previewDrafts count= 2 (same keys)
getMetaItem by manifest.id   -> found manifest.id=com.example.crm
getMetaItem by manifest.name -> no item

The id, display name and version all sit on manifest. Nothing is at the top level.

Tests

New top-level describe in packages/runtime/src/domains/mcp-authoring.test.ts. It uses the real protocol with two packages installed, through the real registry's list_metadata_items and get_metadata_item:

  • the package rows equal { name: id, label: manifest.name, packageId: id, draft: false } for both packages, and get_metadata_item reads each row's name back to the same manifest.id;
  • an object row and a view row on the same real protocol still summarize as the item's own name, label, owning packageId.

The flow row is still pinned by the existing case a metadata:write token whose user holds manage_metadata lists the five tools, and a read is served (the full toEqual over the two flow rows, packageId from _packageId and the null case), which passes unchanged.

Runs (head ff7cc76)
  • pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring.test.ts: Tests 79 passed (79), VERDICT command-exit 0.
  • pnpm --filter @objectstack/runtime typecheck (tsc plus check:test-typecheck): VERDICT command-exit 0, check:test-typecheck: OK. The first run was red on three untouched test files with TS2307 @objectstack/driver-turso (a peer dependency outside the runtime^... build closure, so it had no dist locally). After building that package it was green.
  • Ablation: node scripts/ablation-replace.mjs changed the guard if (type === 'package') { to an unmatchable type (mutation landed: anchor 1 -> 0, blob 926445be9502 -> 1a1cbfe151ab). The package case went red with every row name/label/packageId: null, the card's defect exactly; the object/view case stayed green. It was restored to blob == HEAD (926445be9502), git diff HEAD empty.
  • Full @objectstack/runtime local suite: NOT MEASURED. It did not finish inside the 560 s foreground cap; CI's Test Core runs it.
Derived gates (dispatch-gates --commands, head ff7cc76)

dispatch-gates --ran: 68 derived, 66 run, 2 NOT-MEASURED, 0 UNRUN. All 66 run exited 0. Not measured:

  • node scripts/check-plugin-teardown-shape.mjs --self-test: exit 3, its fixture is pinned to a commit that the shallow checkout cannot reach;
  • pnpm check:dual-build-cjs-loads: exit 3, PREREQUISITE NOT MET (needs a whole-workspace build).

CI runs both.

Acceptance notes

  • /meta REST list: it serves each package's whole body through createMetaListAnswer and makes no name/label summary, so it does not have these nulls; its rows carry manifest.id and manifest.name. This comes from reading the source (packages/rest/src/meta-collection-routes.ts), not from a booted HTTP door.
  • list_metadata_items { type: "packages" } (plural) is refused with a loud 400 INVALID_REQUEST ("not a metadata type"): canonicalMetaUrlType does not fold packages. That is loud, not silent, so nothing more is done here.
  • No published schema types this answer: the tool declares no output schema, and packages/spec does not name list_metadata_items. Clause-② stays no.
  • The pin sits in the component's shared harness file as a top-level describe (AGENTS.md, Build and Test: a new pin for a component with a shared harness file goes into that file). The dispatch had named a new file for it, so no new test file was added.

Verification

Read first: packages/runtime/src/domains/mcp-authoring.ts summaryOf (the package branch), then the new describe at the foot of mcp-authoring.test.ts.

Two-minute check: pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring.test.ts -t 'type package'. Expect 2 passed. The package rows read com.example.crm / CRM and com.example.crm_studio / CRM Studio.


Generated by Claude Code

A package item is an installed-package record whose id and display name
live on its manifest. The list row read only the item's top-level name,
label and owning package, so every package row answered nulls. A package
row now reads manifest.id as name and packageId, and manifest.name as
label; every other type's row is unchanged.

Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ
Co-authored-by: Claude <noreply@anthropic.com>
@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 Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 71 of 254 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 30 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json f13adaea1738d8cc1c18177cae02397e4a0bd773 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from baca548aa7e227d09e87eb5f249137c774932472 — the merge of head ff7cc76594204e0b3b9ef603c5af35a6a8996f3c into base f13adaea1738d8cc1c18177cae02397e4a0bd773, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin baca548aa7e227d09e87eb5f249137c774932472 && git checkout baca548aa7e227d09e87eb5f249137c774932472
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f13adaea1738d8cc1c18177cae02397e4a0bd773 ff7cc76594204e0b3b9ef603c5af35a6a8996f3c && git checkout -B drift-repro f13adaea1738d8cc1c18177cae02397e4a0bd773 && git merge --no-ff ff7cc76594204e0b3b9ef603c5af35a6a8996f3c

node scripts/docs-audit/affected-docs.mjs --json f13adaea1738d8cc1c18177cae02397e4a0bd773

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ

Final green head · 2026-12-01T23:35Z · zone osa-ai
Head-sha: ff7cc76

  • CI at this head: 38 success, 12 skipped, 0 failure, 0 running; mergeable_state clean.
  • Diff: 3 files, +110 / −3. summaryOf in packages/runtime/src/domains/mcp-authoring.ts now takes the canonical type; for package it reads manifest.id as name and packageId and manifest.name as label, keeping the four keys and their types. Every other type stays on the old path. Fixes #38966.
  • Readings (dev): item shape measured on the real protocol (SQL driver on SQLite, two packages installed): a package item carries id, display name and version only under manifest. New pin on the real protocol with two packages, plus a read-back by manifest.id; object and view rows pinned unchanged. Ablated red (both package rows null, the card's defect), restored blob == HEAD with git diff HEAD empty. mcp-authoring.test.ts 79 of 79; 66 of 68 derived gates exit 0, 2 NOT MEASURED (CI ran them).
  • Governed check (check-governed-merges --pr 39006): NOT governed, 113 changed lines. Clause-②: no (the tool declares no output schema; packages/spec does not name list_metadata_items).
  • Dev report: 搭建入口列软件包时每行的名字、标题、包 id 都是空 #38966 comment 7328881018. L1 asked of osa-L1-a; the zone lands on ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review · PR #39006 (#38966) · head ff7cc76 · 2026-12-01T23:36Z

VERDICT: ACCEPT. No must-fix and no should-fix.

  • Face. l1-face is CLEAN at ff7cc76, with 13 items read and none flagged. Checks are 39 success, 18 expected skip, 0 failed and 0 pending, and mergeable_state is clean. The diff is 3 files: mcp-authoring.ts (+23/−3), mcp-authoring.test.ts (+77) and the runtime patch changeset. It is inside the fence. The zone reads it as NOT governed, so no L2 is owed. Clause-②: no is right, because the row keeps its four keys and their types, and a value that was always null now carries the documented id. Metadata-protocol: none is right.
  • Code. In the list_metadata_items branch, type is canonicalTypeOf(input.type) before it reaches summaryOf, so an alias that canonicalises to package takes the new arm too.
    • The arm reads manifest.id for name and packageId, and manifest.name for label. Each is typed with a null fallback, there is no ?? id guess, and _draft is kept.
    • Every other type's path is byte-unchanged.
    • The measured item shape in the body backs the choice: InstalledPackageSchema has nothing at the top level, getMetaItem finds a package by manifest.id and not by manifest.name.
  • packageId = the package's own id. That is right for an agent: it is the value save_metadata_draft's package takes, so the row hands over the one value the next call needs. The docblock says so.
  • Tests. They use the real protocol over SQLite with two packages installed. Both rows are pinned with toEqual, and each row's name is read back through get_metadata_item to the same manifest.id, which is the card's acceptance plus the round trip. Object and view rows on the same protocol are unchanged, and the existing flow-row case still passes. The ablation turns exactly the package case red, with every row null, which is the card's defect.
  • Sentence read (changeset). It is true of this head.
  • Not measured. The full runtime suite was not run locally, and CI Test Core is green at this head.

Next: zone landing. The merge closes #38966.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ

落地

reading value
check-governed-merges.mjs --pr 39006 (head fetched) NOT governed — 0 of 3 paths hit the register; 113 changed lines ≤ 3000
reviews on ff7cc765 L1 ACCEPT 7329575601 (osa-L1-a), no must-fix or should-fix; no contract face owed (Clause-②: no, not governed)
check-runs on ff7cc765 38 success · 12 expected skip · 0 failed · 0 pending; mergeable_state clean
K landing-k.mjs --pr 39006: K = 1 < 15, no new locale pack, no shared book moved

State change: ready for review + auto-merge, by zone osa-ai (2026-12-01T23:38Z); Fixes #38966.

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 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.

搭建入口列软件包时每行的名字、标题、包 id 都是空

2 participants