Repository navigation
feat(runtime): createInProcessAuthoringRegistry, the light authoring door in process as the signed-in user - #37968
Conversation
…door in process The MCP draft door's five tools for a host's in-process AI assistant, as the signed-in person: built by the door's own assembly over a request the dispatcher places as dispatchAction places a host call; admission is the person's own manage_metadata; saves state surface 'copilot'; no publish tool. Claude-Session: https://claude.ai/code/session_01L9qibyo6pEabiVD1KUoeEJ Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibyo6pEabiVD1KUoeEJ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 3 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 d8e3522aa3f08bbbdf487b1c04fc30a1ce09d39f && git checkout d8e3522aa3f08bbbdf487b1c04fc30a1ce09d39f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9a274e6725822124948fb54a3b3cebccf1c84e44 9b83607ea5f6824e65cddf831e7974ba9247fa33 && git checkout -B drift-repro 9a274e6725822124948fb54a3b3cebccf1c84e44 && git merge --no-ff 9b83607ea5f6824e65cddf831e7974ba9247fa33
node scripts/docs-audit/affected-docs.mjs --json 9a274e6725822124948fb54a3b3cebccf1c84e44
|
…-dispatch It is a host door like dispatchAction, not a dispatcher domain: under domains/ the route-envelope gate reads it as an undeclared domain. Claude-Session: https://claude.ai/code/session_01L9qibyo6pEabiVD1KUoeEJ Co-authored-by: Claude <noreply@anthropic.com>
…ntext refusal (#37944) Row 61c: createInProcessAuthoringRegistry admits a system envelope nothing, so its isSystem read has an owning row; register regenerated. Claude-Session: https://claude.ai/code/session_01L9qibyo6pEabiVD1KUoeEJ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T15:22Z 席位核对 — L1 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T15:23Z · zone
|
Requested by Tesla · project thread
Fixes #37944
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/runtime/README.mdgains an In-process authoring tools section under API Reference (the package's published record of its API).content/docs/permissions/system-context.mdxgains row 61c (the entry admits a system context nothing) with its regenerated register line, because the entry's fail-closed guard readsisSystem.createInProcessAuthoringRegistry(kernel, { executionContext, environmentId })from@objectstack/runtime(packages/runtime/src/in-process-authoring.ts, besideaction-dispatch.ts). It returns{ admitted, getAll(), execute(toolCall) }: the five tools of the MCP draft door (list_metadata_items,get_metadata_item,list_drafts,save_metadata_draft,delete_metadata_draft), bound to one signed-in person for one turn. Exported types:InProcessAuthoringRequest,InProcessAuthoringRegistry,OpenAuthoringToolCall,OpenAuthoringToolResult.buildOpenAuthoringRegistry(deps, context, principal)inmcp-authoring.ts;resolveOpenAuthoringInjection(the MCP door) and the new entry both call it. The private builders (resolveHumanReader,openWriter,openReadGateSources) are unchanged in body and still takeDomainHandlerDeps+HttpProtocolContext; no second copy exists.dispatchAction. The entry takes the host kernel and runs on the same shared per-kernelHttpDispatcherasdispatchAction(hostDispatcherFor(kernel), extracted inaction-dispatch.ts;dispatchActionanddispatchActionResumebodies untouched).HttpDispatcher.hostAuthoringRegistry(request)places the request with the sameplaceHostActionRequeststep a host action call uses, so the tools read the environment's services exactly as the MCP door reads them, including the classifiedtenancyand knowledge lookups. A resolver that refuses to place the request rejects the call.manage_metadata, decided byresolveHumanReaderexactly as for the MCP door. A person without it is listed no tool and every call is refused403 PERMISSION_DENIED(the MCP door's shape; the sentence drops themetadata:writehalf, which does not exist here). Fail closed: an envelope with nouserId, anisSystemenvelope, or a grant read that throws admits nothing.surface: 'copilot'and noclient. The MCP door keepssurface: 'mcp'with the token's client.Why
copilot, not the card's examplein_app(seat ruling, claim amendment 7219051191)The card asks for a value "other than
'mcp'" so Studio and the host's caps can tell the in-app path from MCP.MetadataAuthoringSurfaceSchemaalready has that value:copilot, whose published meaning is "an AI assistant's tool writing on a person's behalf", which only an in-process caller may state (every HTTP door refuses?surface=copilot). Studio already renders it as an AI draft mark. Addingin_appwould widen a published accept set (Clause-② yes) and touchpackages/specand Studio's rendering for no new distinction, so this PR adds no enum member and does not touchpackages/spec.Tests
New top-level group in the door's shared harness
packages/runtime/src/domains/mcp-authoring.test.ts, through the real entry on a host kernel (thedispatchActionpins' kernel shape):getAll()), with no publish tool, and a read is served;manage_metadatais listed nothing, and every one of the five tools is refused with the MCP door'scode/status, before any protocol read;surface: 'copilot', noclient,actor= the person, and answers the publish verdict and Studio routes; the MCP door's save in the same test still stampsmcp+client;403before any write;isSystem, a throwing grant read;kernel-resolverrejects with no grant read.Ablations (on the committed tree, restored with
git checkout HEAD --): hard-coding the save's surface to'mcp'reds the provenance test; dropping theisSystemguard reds the fail-closed test.Acceptance notes
http-dispatcher.ts,action-dispatch.ts, the newin-process-authoring.ts) was confirmed by the seat before push (claim amendment 7219051191). The entry file sits insrc/, notsrc/domains/: every file underdomains/must declare an HTTP route envelope (check:route-envelope), and this one serves no route; the seat recorded the move in claim amendment 2 (7219506629), andcheck-route-envelope.mjsis unchanged.content/docs/permissions/system-context.mdx(row 61c) is the census pagecheck:system-context-censusrequires for the newisSystemread.overlap-check.mjs --pr=37896(the open PR that also editsaction-dispatch.ts):VERDICT clean exit 0, both merge cleanly.1c78bfc0, a WIP push) carries no trailer pair; the second carries the model-free pair.api-surface/ispackages/speconly); the export is recorded insrc/index.tswith its comment and in the changeset.Verification
Local runs and CI (head 7fea375, merge base bc17334)
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring.test.ts src/action-dispatch.test.ts src/action-confirmation-handoff-33690.test.ts(underos-verify-lock.sh, head 7fea375): Test Files 3 passed, Tests 172 passed,VERDICT command-exit 0.pnpm --filter @objectstack/runtime typecheck:tsc --noEmitclean;check:test-typecheckreports 3 files that import@objectstack/driver-turso, which this container did not build (TS2307, none touched here). CI'sType Check · workspaceandTypeScript Type Checkare green.dispatch-gates.mjs --commands, 73 commands): 70 exit 0.check:plugin-teardown-shape --self-testandcheck:dual-build-cjs-loadsexit 3 (prerequisite dist not built here; CI green).check:query-options-erasureexited 1 only because the file moved mid-run (ENOENT on the old path) and exits 0 when re-run on the final tree.check:route-envelope,check:system-context-censusandcheck:doc-anchorsexit 0.check:published-readme-exportsanswers NOT MEASURED (exit 3) locally; CI is its verdict.Lint & Repo Gates,TypeScript Type Check,Test Core(10/10 shards),Build Core,Build Docs,Check Changeset,PR-body guards.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run src/domains/mcp-authoring.test.ts -t 37944shows 7 passing cases.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibyo6pEabiVD1KUoeEJ
Generated by Claude Code