Repository navigation
fix(runtime): MCP list_metadata_items package rows name the package - #39006
Conversation
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>
📓 Docs Drift Check2 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
Coarse fallback — 30 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 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 |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ Final green head · 2026-12-01T23:35Z · zone osa-ai
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review · PR #39006 (#38966) · head ff7cc76 · 2026-12-01T23:36ZVERDICT: ACCEPT. No must-fix and no should-fix.
Next: zone landing. The merge closes #38966. |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ 落地
State change: ready for review + auto-merge, by zone osa-ai (2026-12-01T23:38Z); |
Requested by Yibo Wang · project thread
Fixes #38966
Claim for this branch: #38966 comment 7327360271
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
list_metadata_itemswithtype: "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 onmanifest, andsummaryOfread only the item's top-levelname,labeland owning package.summaryOfnow takes the canonical type. Forpackageit reads:name=manifest.id: the valueget_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 nolabelkey).packageId=manifest.id: a package holds itself, and this is the valuesave_metadata_draft'spackagenames, 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
manifestobject only, with no?? idfallback.Measured item shape (design point 1)
The real protocol (
ObjectStackProtocolImplementationover the SQL driver on SQLite, two packages installed throughregistry.installPackage, tree202cc2860d),getMetaItems({ type: 'package' }):The id, display name and version all sit on
manifest. Nothing is at the top level.Tests
New top-level
describeinpackages/runtime/src/domains/mcp-authoring.test.ts. It uses the real protocol with two packages installed, through the real registry'slist_metadata_itemsandget_metadata_item:{ name: id, label: manifest.name, packageId: id, draft: false }for both packages, andget_metadata_itemreads each row'snameback to the samemanifest.id;name,label, owningpackageId.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 fulltoEqualover the two flow rows,packageIdfrom_packageIdand 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 pluscheck: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 theruntime^...build closure, so it had no dist locally). After building that package it was green.node scripts/ablation-replace.mjschanged the guardif (type === 'package') {to an unmatchable type (mutation landed: anchor 1 -> 0, blob 926445be9502 -> 1a1cbfe151ab). The package case went red with every rowname/label/packageId: null, the card's defect exactly; the object/view case stayed green. It was restored toblob == HEAD (926445be9502),git diff HEADempty.@objectstack/runtimelocalsuite: 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
/metaREST list: it serves each package's whole body throughcreateMetaListAnswerand makes no name/label summary, so it does not have these nulls; its rows carrymanifest.idandmanifest.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 400INVALID_REQUEST("not a metadata type"):canonicalMetaUrlTypedoes not foldpackages. That is loud, not silent, so nothing more is done here.packages/specdoes not namelist_metadata_items. Clause-② staysno.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.tssummaryOf(the package branch), then the newdescribeat the foot ofmcp-authoring.test.ts.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring.test.ts -t 'type package'. Expect2 passed. The package rows readcom.example.crm/CRMandcom.example.crm_studio/CRM Studio.Generated by Claude Code