Skip to content

runtime: export an in-process entry to the light authoring door, so the cloud ask admin skill can call the 5 tools as the signed-in user (no OAuth grant) #37944

Done

Description

@objectstack-fleet

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

Filing gate: ④ topic child (cross-repo prerequisite). Source: epic objectstack-ai/cloud#5027, M2 row 1 = cloud#5077 (plan v2 approved by the maintainer 2026-11-27 01:02Z 「同意,开工」; ruling: the admin skill calls "the framework light door's 5 tools, in process, as the current user"). cloud#5077's premise check (2026-11-27 12:29Z) found the door is not reachable in process from cloud. Business reason: without this, cloud would need a second copy of the door (~700 lines) that drifts from the framework's.
Owner: repo:objectstack#3 (maintainer 2026-11-27 07:51Z: non-cloud tasks go to the objectstack seat). Filed by seat epic:#5027#1, which keeps cloud#5077 and the cloud pin round that follows.
Grading: area:ai · Task · p1 · size S–M · reach: every admin who builds in the cloud app once M2 ships · evidence: read (objectstack origin/main 3eb778d, pin f19ae3a8).
Dedupe: searched createOpenAuthoringRegistry, resolveOpenAuthoringInjection, in-process authoring; no open card.
Blocks: objectstack-ai/cloud#5077 (via a cloud pin round).

维护者速读

  • 是什么:框架轻门(MCP 搭建的 5 个工具)今天只能经 MCP HTTP 请求 + OAuth metadata:write 授权进入。云端 ask 的管理员技能要在进程内、以当前登录用户身份调用这 5 个工具,需要框架从 @objectstack/runtime 导出一个进程内入口。
  • 只是开一个入口,不改门的规则:准入仍是用户自己的 manage_metadata,草稿照旧要人审阅后发布,不加发布工具。
  • 要你做什么:无。

Evidence (objectstack origin/main 3eb778d; same at pin f19ae3a8)

  • createOpenAuthoringRegistry is defined in packages/runtime/src/domains/mcp-authoring.ts and exported from that module only; packages/runtime/src/index.ts exports nothing named *Authoring*, and the package exports map has only . and ./compiled-plugin-manifest-file. Its users are the module, its test and domains/mcp.ts.
  • The registry's readGate and writer are built by module-private helpers (resolveHumanReader :542, openWriter, openReadGateSources) bound to DomainHandlerDeps + HttpProtocolContext.
  • resolveOpenAuthoringInjection (:490) returns undefined unless the request carries an OAuth grant with metadata:write. An in-app ask turn runs on a session, which carries no grant.
  • READ_TOOLS / WRITE_TOOLS, the contract reader and verdict shaping are private as well.

What to do

  1. Export from @objectstack/runtime an in-process entry, e.g. createInProcessAuthoringRegistry({ resolveService, getObjectQL, userId, organizationId, environmentId, executionContext }) (name and exact shape are the implementer's call), returning the same 5 tools with the same contract, read gate and verdicts as the MCP door.
  2. Admission: the human's own manage_metadata, exactly as resolveHumanReader decides it, with no OAuth-scope half (the caller's session plus its own admin check replaces the token's consent). A caller without manage_metadata gets no write tools, with the same refusal shape as the MCP door.
  3. Provenance: saves through this entry carry a surface / door value other than 'mcp' (e.g. 'in_app'), so Studio and the host's caps can tell the in-app path from MCP. If the save-provenance enum is in packages/spec, follow the spec change rules (changeset, generated baselines).
  4. No publish tool; drafts stay human-reviewed. No change to the MCP door's own behaviour.
  5. Factor the shared builders so both entries use one implementation; no second copy inside the framework.

Acceptance

Clause-②: no
Suggested-grade: p1

Activity

  1. added
    enhancement
    priority:p1
    pm:epic
    area:ai
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibyo6pEabiVD1KUoeEJ
    Account: os-tesla
    Branch: claude/project-thread-klwij0
    Worktree: objectstack-issue-37944
    Domain: server
    Area: o3-askai (accepted by the maintainer; card thread kept with the seat)
    Seat: repo:objectstack#3
    File surface: packages/runtime/src/domains/mcp-authoring.ts (factor the private builders so the MCP door and the new entry share one implementation), packages/runtime/src/index.ts (the export), their tests under packages/runtime/src/**, the runtime package's public-API record and docs page where the repo records public exports, .changeset/**; NOT packages/spec/** (saves through the new entry stamp the existing surface: 'copilot') (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high
    Clause-②: no (a new export; no accept set widens: MetadataAuthoringSurfaceSchema keeps ['copilot','mcp','studio','api'])
    Metadata-protocol: none
    Responsibility: the cloud ask admin skill (cloud#5077) calls the framework light door's five tools in process, as the signed-in user, with the same contract, read gate and verdicts as the MCP door; admission is the user's own manage_metadata as resolveHumanReader decides it, with no OAuth half; a caller without it gets no write tools and the MCP door's refusal shape; saves stamp surface: 'copilot' (published meaning: an AI assistant's tools writing on a person's behalf, declared only by in-process callers), not 'mcp'; no publish tool; the MCP door's behaviour unchanged.
    Thread-read: none
    Premise: holds at origin/main bc17334: createOpenAuthoringRegistry (:680) and resolveOpenAuthoringInjection (:490) are exported only from mcp-authoring.ts, index.ts exports nothing named *Authoring*; resolveHumanReader (:542), openWriter (:589), openReadGateSources (:643) are private and bound to DomainHandlerDeps + HttpProtocolContext; :495 answers undefined without a metadata:write grant; the save writes surface: 'mcp' (:888).
    Serial constraints cleared: overlap-check.mjs runs on the thread's first push (branch not yet pushed); no in-flight claim on packages/runtime/src/domains/mcp-authoring.ts named by any seat

    Accepted by the maintainer on a decision card, verbatim 「接下,放进问 AI 专区」 (2026-11-27T12:56Z); filed by epic:#5027#1 (mailbox notify 7218346759 on #37784). On merge the seat notifies epic:#5027#1 on objectstack#37634 with the merge sha. Ask-AI own cap (Tesla 「问数AI 并发可以8」 2026-11-27T11:25Z).

  3. added
    pm:dispatched
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1 (amendment: entry shaped like dispatchAction, two host files)
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibyo6pEabiVD1KUoeEJ
    Account: os-tesla
    Branch: claude/project-thread-klwij0
    Worktree: objectstack-issue-37944
    Domain: server
    Area: o3-askai (accepted by the maintainer; card thread kept with the seat)
    Seat: repo:objectstack#3
    File surface: packages/runtime/src/domains/mcp-authoring.ts (factor the private builders so the MCP door and the new entry share one implementation), packages/runtime/src/index.ts (the export), packages/runtime/src/domains/in-process-authoring.ts (new: the entry, createInProcessAuthoringRegistry(kernel, { executionContext, environmentId }) shaped like dispatchAction(kernel, request)), packages/runtime/src/http-dispatcher.ts (one hostAuthoringRegistry(request) method over the private domainDeps / placeHostActionRequest), packages/runtime/src/action-dispatch.ts (the module-private host dispatcher cache lifted to a shared hostDispatcherFor(kernel); dispatchAction's behaviour unchanged), their tests under packages/runtime/src/**, the runtime package's public-API record and docs page where the repo records public exports, .changeset/**; NOT packages/spec/** (saves through the new entry stamp the existing surface: 'copilot') (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high
    Clause-②: no (a new export; no accept set widens: MetadataAuthoringSurfaceSchema keeps ['copilot','mcp','studio','api'])
    Metadata-protocol: none
    Responsibility: the cloud ask admin skill (cloud#5077) calls the framework light door's five tools in process, as the signed-in user, with the same contract, read gate and verdicts as the MCP door; admission is the user's own manage_metadata as resolveHumanReader decides it, with no OAuth half; a caller without it gets no write tools and the MCP door's refusal shape; saves stamp surface: 'copilot' (published meaning: an AI assistant's tools writing on a person's behalf, declared only by in-process callers), not 'mcp'; no publish tool; the MCP door's behaviour unchanged.
    Thread-read: 7218923676
    Premise: holds at origin/main bc17334: createOpenAuthoringRegistry (:680) and resolveOpenAuthoringInjection (:490) are exported only from mcp-authoring.ts, index.ts exports nothing named *Authoring*; resolveHumanReader (:542), openWriter (:589), openReadGateSources (:643) are private and bound to DomainHandlerDeps + HttpProtocolContext; :495 answers undefined without a metadata:write grant; the save writes surface: 'mcp' (:888).
    Serial constraints cleared: overlap-check.mjs runs on the thread's first push (branch not yet pushed); no in-flight claim on packages/runtime/src/domains/mcp-authoring.ts named by any seat

    Why the wider surface: a host-supplied resolveService would move tenancy/knowledge "absent vs failed" classification into a second implementation in cloud; a failure swallowed to undefined reads as no wall (effectiveTenancyPosture(undefined)), so the walled refusal fails open. Reusing the MCP door's deps and context through the shared host dispatcher keeps one implementation and fails closed.

    Accepted by the maintainer on a decision card, verbatim 「接下,放进问 AI 专区」 (2026-11-27T12:56Z); filed by epic:#5027#1 (mailbox notify 7218346759 on #37784). On merge the seat notifies epic:#5027#1 on objectstack#37634 with the merge sha. Ask-AI own cap (Tesla 「问数AI 并发可以8」 2026-11-27T11:25Z).

  5. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1 (amendment 2: the entry file sits beside action-dispatch.ts)
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibyo6pEabiVD1KUoeEJ
    Account: os-tesla
    Branch: claude/project-thread-klwij0
    Worktree: objectstack-issue-37944
    Domain: server
    Area: o3-askai (accepted by the maintainer; card thread kept with the seat)
    Seat: repo:objectstack#3
    File surface: packages/runtime/src/domains/mcp-authoring.ts (factor the private builders so the MCP door and the new entry share one implementation), packages/runtime/src/index.ts (the export), packages/runtime/src/in-process-authoring.ts (new, beside action-dispatch.ts: a host door, not a dispatch domain, so check:route-envelope does not read it as an unregistered domain; the entry, createInProcessAuthoringRegistry(kernel, { executionContext, environmentId }) shaped like dispatchAction(kernel, request)), packages/runtime/src/http-dispatcher.ts (one hostAuthoringRegistry(request) method over the private domainDeps / placeHostActionRequest), packages/runtime/src/action-dispatch.ts (the module-private host dispatcher cache lifted to a shared hostDispatcherFor(kernel); dispatchAction's behaviour unchanged), their tests under packages/runtime/src/**, the runtime package's public-API record and docs page where the repo records public exports, .changeset/**; NOT packages/spec/** (saves through the new entry stamp the existing surface: 'copilot') (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high
    Clause-②: no (a new export; no accept set widens: MetadataAuthoringSurfaceSchema keeps ['copilot','mcp','studio','api'])
    Metadata-protocol: none
    Responsibility: the cloud ask admin skill (cloud#5077) calls the framework light door's five tools in process, as the signed-in user, with the same contract, read gate and verdicts as the MCP door; admission is the user's own manage_metadata as resolveHumanReader decides it, with no OAuth half; a caller without it gets no write tools and the MCP door's refusal shape; saves stamp surface: 'copilot' (published meaning: an AI assistant's tools writing on a person's behalf, declared only by in-process callers), not 'mcp'; no publish tool; the MCP door's behaviour unchanged.
    Thread-read: 7219051191
    Premise: holds at origin/main bc17334: createOpenAuthoringRegistry (:680) and resolveOpenAuthoringInjection (:490) are exported only from mcp-authoring.ts, index.ts exports nothing named *Authoring*; resolveHumanReader (:542), openWriter (:589), openReadGateSources (:643) are private and bound to DomainHandlerDeps + HttpProtocolContext; :495 answers undefined without a metadata:write grant; the save writes surface: 'mcp' (:888).
    Serial constraints cleared: overlap-check.mjs runs on the thread's first push (branch not yet pushed); no in-flight claim on packages/runtime/src/domains/mcp-authoring.ts named by any seat

    Why the wider surface: a host-supplied resolveService would move tenancy/knowledge "absent vs failed" classification into a second implementation in cloud; a failure swallowed to undefined reads as no wall (effectiveTenancyPosture(undefined)), so the walled refusal fails open. Reusing the MCP door's deps and context through the shared host dispatcher keeps one implementation and fails closed.

    Accepted by the maintainer on a decision card, verbatim 「接下,放进问 AI 专区」 (2026-11-27T12:56Z); filed by epic:#5027#1 (mailbox notify 7218346759 on #37784). On merge the seat notifies epic:#5027#1 on objectstack#37634 with the merge sha. Ask-AI own cap (Tesla 「问数AI 并发可以8」 2026-11-27T11:25Z).

  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyo6pEabiVD1KUoeEJ
    os-dev-report

    {
     "issue": 37944,
     "status": "done",
     "branch": "claude/project-thread-klwij0",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/37968",
     "session": "session_01L9qibyo6pEabiVD1KUoeEJ",
     "premise_still_valid": true,
     "summary": "createInProcessAuthoringRegistry(kernel, { executionContext, environmentId }) is exported from @objectstack/runtime (src/in-process-authoring.ts): the MCP draft door's five tools, built by the same buildOpenAuthoringRegistry the MCP door now calls, on the per-kernel HttpDispatcher dispatchAction uses (hostDispatcherFor + HttpDispatcher.hostAuthoringRegistry, placed by placeHostActionRequest). Admission is the person's own manage_metadata via resolveHumanReader; no user, isSystem or a throwing grant read admits nothing; saves stamp surface 'copilot' with no client (seat ruling, no spec change); no publish tool; the MCP door is unchanged. Head 7fea375d, merge base bc173343 (origin/main 20 commits ahead at 14:54Z).",
     "tests": "vitest src/domains/mcp-authoring.test.ts src/action-dispatch.test.ts src/action-confirmation-handoff-33690.test.ts under os-verify-lock at 7fea375d: Test Files 3 passed (3), Tests 172 passed (172), VERDICT command-exit 0; the new [#37944] group has 7 cases. Ablations on the committed tree: surface hard-coded to 'mcp' reds the provenance test; dropping the isSystem guard reds the fail-closed test; both restored.",
     "gates": "local: dispatch-gates --commands 73 derived: 70 exit 0; check:plugin-teardown-shape --self-test and check:dual-build-cjs-loads exit 3 (dist prerequisite not built); check:query-options-erasure exit 1 from the mid-run file move (ENOENT on old path), exit 0 re-run on the final tree; check:route-envelope, check:system-context-census, check:doc-anchors exit 0; tsc --noEmit clean; eslint on touched files exit 0. CI at 7fea375d: 55 check runs, 40 success, 15 skipped, 0 failed (Lint & Repo Gates, TypeScript Type Check, Type Check · workspace, Test Core 10/10, Build Core, Build Docs, Check Changeset, PR-body guards all success). Earlier reds were route-envelope (file under domains/, moved to src/ per claim amendment 2 7219506629) and system-context census (row 61c added).",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "mcp_calls": "read-only only, count not kept across a context compaction: get_job_logs, pull_request_read (get, get_check_runs); no write tool",
     "api_writes": "3 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls), relay issue_patch on #37968 body (PATCH /repos/objectstack-ai/objectstack/issues/37968), this comment (POST /repos/objectstack-ai/objectstack/issues/37944/comments); plus git push",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": []
    }
  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyo6pEabiVD1KUoeEJ

    Closed 2026-11-27T15:50Z. PR #37968 merged by the queue at 2026-11-27T15:50:13Z as ecd10e9ecb722a6fda7f04dde2e9897e0c1d2824. @objectstack/runtime now exports createInProcessAuthoringRegistry(kernel, { executionContext, environmentId }): the MCP draft door's five tools, built by the same assembly as the MCP door, admitted on the person's own manage_metadata, saves stamped surface: 'copilot' with no client, no publish tool.

    Records: claim 7218923676 (amendments 7219051191, 7219506629) · os-dev-report 7221433703 · L1-c ACCEPT 7221987126 at 9b83607e · landing 7222017622. Nit kept as is: dispatchAction and dispatchActionResume still inline the get-or-create that hostDispatcherFor extracts.

  8. removed
    pm:dispatched
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aienhancementpm:epicpriority:p1size/m

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions