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
|
… place from the sidebar (objectstack-ai#38005) repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoHaCR5qtPgmwG5g4Vd9AhVn)_ Fixes objectstack-ai#37863 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:收藏过的 AI 对话出现在侧边栏「收藏」里,点一下就在当前页面右侧的助手抽屉里打开这段对话,页面不跳走;对话已被删除时,这一行会划掉、标「该对话已不可用」,仍可从菜单里移除。对话开始后(发出第一条消息后),抽屉顶部会出现 ☆ 收藏按钮,在侧栏、全屏和手机抽屉里都有;点一下收藏或取消。 - 为什么做:「问 AI」入口改造专题的收藏会话卡,让常回看的对话能一键找回,不用翻历史。 - 出错会怎样:最坏是点收藏没有在抽屉里打开,或误把可用的对话标成不可用;收藏数据本身不会丢,直接撤回这次改动即恢复原样。 - 要你做什么:无。 ## What changes Implements card objectstack-ai#37863 as claimed (claim 7221246375), including the drawer header's ☆. C4 (objectstack-ai#37970, the header row) merged at `4af32b99`; this branch merged `origin/main` with it as a real merge (`8aa37202`, no conflict, no rebase), then added the ☆ (`33463930`) and settled its test on the header (`3141f4db`). 1. **A conversation favourite** (`FavoriteItem.type: 'conversation'`, id `conversation:ID`, new optional fields `conversationId` and `agent`). `href` is the conversation's `/ai…` address (`aiAddressOf`). It is a content favourite, so it counts against the cap of 20 (`capByBucket` unchanged). `conversationFavoriteItem` (new `layout/conversationFavorites.ts`) builds the entry the ☆ will toggle; the agent is stored as its route name (`agentRouteName`). 2. **The sidebar row opens the drawer in place.** In `UnifiedSidebar`'s Favorites rows, a conversation favourite's link click calls `useChatDockControl().open({ agent, conversationId })`, the target a history row opens (ui ADR-0057 A5, row 5), and closes the phone sidebar. The row stays a link: the address is followed with no drawer host, on the app's AI inquiry page (`askPageActive`, A4, where `open` refuses a non-handoff target; seat ruling in the claim), and for a modified click (new tab). 3. **The label follows the conversation; a gone one is marked.** `useUnavailableConversationFavorites` reads each shown conversation favourite once per mount through the new `readConversationRow` (`useConversationList.ts`, the list's own `normalize`). A label that moved (server title, else latest user message, as the history row reads) is written back with `refreshLabel`. A 404 or 403 marks the row unavailable for that mount only (never stored): struck through, `aria-disabled`, a screen-reader suffix from the new `sidebar.conversationUnavailable` key, and a click opens nothing; its ⋯ menu still removes it. Any other failure (5xx, network) marks nothing. 4. **The drawer header's ☆** (`33463930`). `ChatDockConversationActions` gains `agent` (the route name, reported by `ChatDockConversation`). Once a thread exists (after the first send) the ☆ sits before + in the rail, the full window and the phone sheet; nothing is drawn before the first send. A click toggles `conversationFavoriteItem` (label: the header title, or 「New conversation」 while it loads); while favourited it is `aria-pressed`, named by `common.addToFavorites` / `common.removeFromFavorites`. A header title that changes while favourited is written back with `refreshLabel` (through a ref, ui AGENTS objectstack-ai#10). 5. **Icon.** `CONTENT_KIND_ICON.conversation = 'message-circle'`. 6. **i18n.** `sidebar.conversationUnavailable` in all 11 packs (zh-Hant generated by `gen:zh-hant`). Not in this card (seat ruling in the claim): restoring the record focus chip from the conversation's `metadata` is C5's (objectstack-ai#37861); a favourite opens the same target a history row does. ## Tests - New `UnifiedSidebar.conversationFavorites-37863.test.tsx` (15 cases; real `FavoritesProvider`, `NavigationRenderer`, `SidebarItemMenu`; a stand-in drawer handle; stubbed `fetch`): row and glyph; click opens the drawer in place and the address does not move; a backend agent name stores the route name; modified clicks are left to the link; no host and the A4 page follow the address; other favourites keep their link; server title and latest-message labels written back; 404 and 403 drawn unavailable and inert, store untouched; removal from ⋯; 500 and network failure mark nothing; the cap of 20 rolls the oldest content favourite off when a conversation is added. - Ablation, on disk with `scripts/ablation-replace.mjs`, restored to `HEAD` each time: the row's `onClick` removed → 6 of 15 red; `readConversationRow` reading 404/403 as a failure → 3 of 15 red; the label write-back removed → 2 of 15 red. <details><summary>Readings</summary> - New file at `f095b9bd`: 15/15 passed. - Related suite at `f095b9bd`: every app-shell test file naming UnifiedSidebar, FavoritesProvider, useFavorites, contentItemTile/ContentItemTile, useConversationList, SortableFavoriteRows or SidebarItemMenu (122 files) plus all of `ui/packages/i18n/src/__tests__` (110 files): 230 files passed, 2798 tests passed, 13 skipped. - `pnpm --filter @object-ui/app-shell run type-check` (src and `tsconfig.test.json`): exit 0, after `turbo build --filter='@object-ui/app-shell^...'`. - `overlap-check.mjs` at `f095b9bd`: clean against main and open PRs objectstack-ai#37989, objectstack-ai#37970 (auto-found) and objectstack-ai#37924, objectstack-ai#37970, objectstack-ai#37968 (named). - Derived local gates (`dispatch-gates.mjs --commands`): see the report comment; CI runs the full farm. - At `3141f4db`, after the main merge and the ☆: the new header ☆ test file 8/8, green on three runs in a row; ablation (restored to `HEAD`): the ☆ removed → 6 of 8 red, the label follow removed → 2 of 8 red; the related 256 test files green; app-shell type-check exit 0; derived local gates 41/41 exit 0 (merge base `4af32b99`). Report delta: 7223592078. </details> ## Acceptance notes - **Unavailable is read once per mount.** A conversation deleted from history while the sidebar stays mounted is marked on the next mount, not at once. Clicking it before then opens the drawer on a conversation the chat cannot load. - **Reads.** Up to 8 conversation reads per sidebar mount (the shown rows), one per favourite, none repeated within the mount. - **README** (`ui/packages/app-shell/README.md`, user-scoped state section) gained one paragraph per ui `AGENTS.md` commandment objectstack-ai#2; outside the claim's first file list, reported to the seat. - `content/docs/frontend/**` has no page on favourites; nothing to update there. ## Verification Read first, by risk: 1. `ui/packages/app-shell/src/layout/UnifiedSidebar.tsx`: `openConversationFavorite` and the row's link props. 2. `ui/packages/app-shell/src/layout/conversationFavorites.ts`: `useUnavailableConversationFavorites`. 3. `ui/packages/app-shell/src/hooks/useConversationList.ts`: `readConversationRow`. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/UnifiedSidebar.conversationFavorites-37863.test.tsx`. Expected: 15 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxdwshRvTk3qXc7A6A)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
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