Repository navigation
feat(core,objectql,spec,service-record-context,mcp,runtime)!: a context pack is identified by its package and its name; get_record_context selects a pack by its face on both MCP doors - #37291
Conversation
… four package-scoped lists; pack selection reads faces ADR-0150 addendum 2026-11-25: ai_context joins PACKAGE_SCOPED_TYPES, PACKAGE_SCOPED_READ_TYPES, PACKAGE_SLOTTED_METADATA_TYPES and NAMESPACE_UNIQUE_TYPES. get_record_context reads context as a skill prompt's name is read: a face answers its one pack, a bare name resolves by D3 for a caller with no package; the several answer lists each pack by its face with its label. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…s, D3 for a bare name, the several answer with labels Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…name is not served, whatever its root; changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…-context-package-scope
…he keyed plural-read pin's slotted set gains ai_context Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
…'s registry pattern, so ai_context's hyphenated suffix is read as slotted Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
…-context-package-scope
…so get_record_context reaches each package's pack by its face Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
…y its face; the door's member pin lists packageNamespace Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 7 package(s): 57 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 19 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 197 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 64e40c65818e290efb011da8369d1eacf87cb2cb && git checkout 64e40c65818e290efb011da8369d1eacf87cb2cb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52 7408543965b4dbbc8e51cf8033e51106d2e2f79d && git checkout -B drift-repro 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52 && git merge --no-ff 7408543965b4dbbc8e51cf8033e51106d2e2f79d
node scripts/docs-audit/affected-docs.mjs --json 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52
|
Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
…mespace is 422 NAMESPACE_CONFLICT, in the semantic entry and the changeset Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr Contract reviewServed-tier: What this record is. A delta over my full review of head ① Derived judgmentsCarried from
② Semver level
③ Boundary flags
④ Design judgmentThe delta, S1: closed Carried from
Nits, accepted as they stand (no effect on correctness or the contract). N1: in No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 维护者速读
Approval request at 2026-11-25T17:46Z. Seat opinion: approve. Seat L1 is ACCEPT (7169974561) and the CONTRACT_REVIEW_TIER review is PASS (7168612536), both on this head. The full dogfood battery passed on this head (os-dev-report 7169906867), and the landing gate reads it at 0 hops. Each of the three narrowings measures 0 on first-party trees. K = 9 and merge-tree is clean. Four nits remain as follow-ups; none needs a head change. |
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37216
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37177
维护者速读
7408543965b4dbbc8e51cf8033e51106d2e2f79d。What changes
ADR-0150's addendum (PR #37209, merged by the maintainer) puts the context pack in bucket 3 beside
skill: a pack is identified by its package and its name.ai_contextjoinsPACKAGE_SCOPED_TYPES(packages/core/src/package-scoped-resolution.ts, the one ADR-0150 D3 rule),PACKAGE_SCOPED_READ_TYPES(packages/objectql/src/package-scoped-read.ts, the/metaby-name read and its?package=qualifier),PACKAGE_SLOTTED_METADATA_TYPES(packages/spec/src/api/protocol.zod.ts, the metadata service's per-(package, name)slot; uninstall drops one package's pack and keeps another's) andNAMESPACE_UNIQUE_TYPES(packages/objectql/src/namespace-co-owner-names.ts, D2's refusal of a second holder inside one namespace, at install and inos validate).packages/services/service-record-context/src/read-set.ts). Candidates are still the packs rooted onobjectName.contextis read as a skill prompt's name is: a face (NS-NAME,deriveAiFaceName) answers its one pack; a bare name resolves by D3 as a caller with no package (the environment's pack, else the one package holder, else409 RESOURCE_CONFLICTnaming each candidate by its face).RecordContextDoorgains an optionalpackageNamespace(packageId); the tool description teachesNAMESPACE-NAME./mcproute (packages/runtime/src/domains/mcp.ts) implementspackageNamespacethroughpackageNamespaceOf, on the engine resolved beside thelistContextPacksread, aslistSkillsdoes. The stdio bridge (packages/mcp/src/stdio-data-bridge.ts) implements it from itsengine's registry (theobjectqlservice, the same recordinstalledPackageNamespacereads for skill prompts). Both sit on top of fix(mcp,runtime): get_record_context reads a package's context packs on both MCP doors #37255'sstripReadDecorationslisting, unchanged.skill): a package-lessai_contextrow under a name a package ships is that holder's customization and is not served, read at(type, name)whatever the row's root. Measured by a §5 pin with a control inpackages/metadata-protocol/src/protocol.reads-environment-only.test.ts.packages/spec/src/migrations/entries/semantic/18.ai-context-package-scoped-name.ts, registered by the changeset'sregistered ai-context-package-scoped-namemarker.Narrowings, each measured on first-party trees (objectstack at
d7f299c0, re-read at this head; hotcrm at9b735103): the one declarer of packs,examples/app-showcase(src/ai/record-context.ai-context.ts), ships two packs of different names (showcase_project_brief,showcase_task_notes) in one package; hotcrm declares none.422 NAMESPACE_CONFLICT) and byos validateGET /api/v1/meta/ai_context/NAMEwith no package, for a name two packages hold: first match becomes409 RESOURCE_CONFLICTTests
packages/mcp/src/mcp-record-context-tools.test.ts: a new top-leveldescribeon the stdio bridge whose engine's registry places two packages: each same-name pack reached by its face, alike over MCP-over-HTTP and stdio; the bare name refused409naming both faces; a control engine with no registry spells each pack bare, so no face reaches one (404).packages/runtime/src/mcp-record-context-tools-bridge.test.ts: in the real-protocol/mcpharness, two packages of two namespaces shiprcd_briefon one root: each is reached by its face, and the bare name is refused409naming both. The door's member pin listspackageNamespace.packages/services/service-record-context/src/__tests__/record-context-tools.test.ts: a new top-leveldescribefor selection by(package, name): each of two packages' same-name packs reached by its face; the bare name refused409naming both faces with nothing read; uninstalling one holder keeps the other; environment pack first under D3; the root narrows before D3 picks; the several answer by face and label in en and zh-Hans, with the blank-label fallback; a door withoutpackageNamespace.packages/metadata/src/metadata-manager-keyed-plural-read.test.ts: the pinned slotted set gainsai_context, so every plural-read case runs for it.packages/metadata/src/loaders/database-loader.test.ts(metadata: the boot priming pass primes one holder per name for unbundled slotted types, so a bare read of a two-holder name answers the last row saved instead of 409 (epic red line 2) #32521 priming): the two host-file cases spelt the host's filehelper.TYPE.yml, which the pass never reads forai_context(the registry declares**/*.ai-context.yml). They now spell the file from the type's registry pattern. Every assertion is unchanged, and theai_contextcases assert the slotted behaviour every other type already had.registry-namespace-co-owner-names,package-scoped-exact-qualifier,package-scoped-e8-readers,manifest-service-residual-namespace-name, the CLI'snamespace-co-owner-names) listai_contextwhere it moved.Acceptance notes
packageNamespace(packages/runtime/src/domains/mcp.ts,packages/mcp/src/stdio-data-bridge.ts) waited for PR fix(mcp,runtime): get_record_context reads a package's context packs on both MCP doors #37255 (get_record_context finds no context pack a real protocol serves: getMetaItems adds _diagnostics, the strict AiContextSchema parse drops every pack #37243), which edits the samelistContextPacksregions. It landed after fix(mcp,runtime): get_record_context reads a package's context packs on both MCP doors #37255 merged:mainwas merged in at057cedfa(no rebase), and the doors were built on itsstripReadDecorationslisting (commit1deea31f).record-context-tools.zod.ts'scontextdescribe still says "by name"; the addendum makes it a face or a bare name. Noted for 记录 AI 问询 8:技能键 context,MCP 技能提示词可带记录参数 #37141, which owns that key.packages/spec/src/api/protocol.zod.ts) is run by the zone, not here.Verification
Local readings
Each run under
scripts/pm/os-verify-lock.sh, exit taken from itsVERDICT command-exitline. Readings taken at6cb32813(main merged at057cedfa, which carries #37255). The head is now74085439: the two commits since change only the changeset'sClause-②line and the semantic entry'sreasonplus the first BREAKING bullet (422 NAMESPACE_CONFLICT). The dogfood battery was re-run on74085439(see below). The suites the door commits touch were re-run there; the rest were read atc61fb9f7, and the merge brought no change to their packages (packages/spec,core,objectql,metadata,metadata-protocoluntouched by it).pnpm --filter @objectstack/mcp test6cb32813pnpm --filter @objectstack/runtime test6cb32813pnpm --filter @objectstack/service-record-context test6cb32813typecheckmcp, runtime6cb32813pnpm --filter @objectstack/core testc61fb9f7pnpm --filter @objectstack/objectql testc61fb9f7pnpm --filter @objectstack/metadata testc61fb9f7pnpm --filter @objectstack/metadata-protocol testc61fb9f7pnpm --filter @objectstack/spec exec vitest run src/migrations src/apic61fb9f7pnpm --filter @objectstack/cli exec vitest run --project unit src/utils/namespace-co-owner-names.test.tsc61fb9f7typecheckservice-record-context, metadata, core, objectql, metadata-protocol, spec, clic61fb9f7The #32521 host-file pins before the fixture fix: 2 failed / 539 passed (the two
ai_contexthost-file cases; the pass read no file). After: 541 passed, 23 of themai_contextcases.Ablations (once each, after committing; restore proven by blob equal to HEAD): deleting the stdio bridge's
packageNamespacemember turns both face cases of the new mcpdescribered (2 failed, the control passes). Deleting the/mcpdoor's member turns the runtime face case and the member pin red (2 failed).The CLI
integrationlayer andtest:repowere not run locally; CI runs them.Gate sweep (dispatch-gates --commands)
node scripts/pm/dispatch-gates.mjs --commandsat6cb32813: 105 derived commands, each run with its exit code recorded.--ran: 105 derived, 105 run, 0 NOT MEASURED (a derived zero: every line carries its exit code).pnpm check:type-check-debt: exit 3 on the first run (lock queue-timeout behind the dogfood run, nothing measured). Re-run under the lock: exit 0.check:adr-0087-registration:registered ai-context-package-scoped-name (new here: ai-context-package-scoped-name).Dogfood battery
Head
74085439(the current head; the os-dev-report is #37216 comment 7169906867): the full battery under the lock gaveVERDICT command-exit 0· Test Files 487 passed, 3 skipped (490) · Tests 4128 passed, 68 skipped (4196) · no failures. Earlier reading, head6cb32813,pnpm turbo run build --filter='@objectstack/dogfood^...'(exit 0), thenpnpm --filter @objectstack/dogfood testunder the lock:VERDICT command-exit 0· Test Files 487 passed, 3 skipped (490) · Tests 4128 passed, 68 skipped (4196) · no failures. (Also run atc61fb9f7, before the door commits: the same counts.)Read first:
packages/services/service-record-context/src/read-set.ts(selectContextPack, the face / D3 order),packages/spec/src/api/protocol.zod.ts(the slot list, a contract surface),packages/mcp/src/stdio-data-bridge.ts(installedPackageNamespaceOf, the stdio door's new member).Two-minute check:
pnpm --filter @objectstack/service-record-context exec vitest run src/__tests__/record-context-tools.test.ts→ 65 passed, including "the bare name two packages hold is refused 409, naming both faces".Provenance
Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37216 开 PR 放行」). The dev session's (
session_01QSeKYohZLmQ1Ug9FKcQtVu, zone a4-A) own relaypr_createwas refused by its permission check and not retried; the dev sent the prepared body. The seat changed the dev'sClause-②: no (narrowing)toClause-②: yes (narrowing). A narrowing arm is legal with either value;yesis right here because the diff also widens published surface:?package=on the history and rollback doors forai_context, a face inget_record_context'scontext, and newservice-record-contextexports. Branchclaude/issue-37216-ai-context-package-scope@74085439.🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ