Repository navigation
fix(comments): unreact, resolve and own-comment delete answer on a kernel with no http.server - #36539
Conversation
…-neutrally on the comments slot Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…a kernel with no http.server Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…nt doors to the comments slot Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…declares the /comments domain Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ers classify the /comments domain The http-conformance boot composes AuditPlugin with and without an http.server and pins byte parity between the two doors, and a typed 501 when the comments service is absent. The authz matrix classifies the new /comments ledger rows; the live-mount parity boot pins them as unexercised because it composes no AuditPlugin. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
… the affected-docs walk does not read it as a spec API declaration Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…r to source, comments domain test pays the metadata load at collection, conformance findOne options typed Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…s the door's caller resolution reads Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 182 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 bf47c34cdf2f4943602c61c219d58600031229cb && git checkout bf47c34cdf2f4943602c61c219d58600031229cb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 77517533d3b8fd8aafb2f4203ba384e31c3ae7cf e7dcb26cc49a8cb61a3cddb0104b0371e7ffb7a8 && git checkout -B drift-repro 77517533d3b8fd8aafb2f4203ba384e31c3ae7cf && git merge --no-ff e7dcb26cc49a8cb61a3cddb0104b0371e7ffb7a8
node scripts/docs-audit/affected-docs.mjs --json 77517533d3b8fd8aafb2f4203ba384e31c3ae7cf
|
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 6b916dc · 2026-11-22T18:52Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Check-runs on this head when read (66): 20 success, 9 skipped, 37 still in progress, 0 failed. Green and relevant: Check Changeset, Governed Surface Queue Guard, PR-body guards, Validate Package Dependencies, Spec property liveness, Type Check source gates, Type Check debt ledger, Lint ESLint, Lint docs and code guards, Lint repo and tooling gates, Lint scoped tooling self-tests, Dogfood Regression Gate. Pending, so no verdict yet: Build Core, Test Core 1 to 10, Type Check workspace, Type Check consumer gates, Lint scoped slot lookup and corpus, Lint scoped query-options erasure, Lint PM dispatch-gates, Lint CI release and engine gates, and the UI jobs. This record stands only if those conclude green. ① Derived judgments
② Semver level
Clause-②: yes (widening) — as declared by the lane; judged right and complete. The changeset body does not mention that ③ Boundary flags
④ Design judgment
S1 (should-fix) — The account of the defect does not agree with the tree, and it is written into the contract and both implementing modules. N1 (nit) — N2 (nit) — The peer address does not survive the forward. The own-row caller resolver passes N3 (nit) — N4 (nit) — The three shapes are written twice ( Implemented-by: VERDICT: PASS |
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ispatcher's ROUTE_NOT_FOUND; the card's ENDPOINT_NOT_FOUND reading is unexplained Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head e7dcb26 · 2026-11-22T22:07Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Delta round on the at-tier record 7084078045 (head Check-runs on this head when read (74): all completed, none failed; 63 success and 11 skipped by reading the list. The runs that were pending on the previous head are now green here: Build Core, Test Core 1 to 10 and its roll-up, Type Check workspace, Type Check consumer gates, Type Check source gates, Type Check debt ledger, Lint ESLint (the parse error at What this head is: ① Derived judgments
② Semver levelUnchanged: Clause-②: yes (widening) — as declared by the lane; judged right and complete. ③ Boundary flags
④ Design judgmentS1: closed — each place the previous record named now states what the tree gives. Read against
Tried to break the rework: a remaining sentence that still gives No must-fix, no should-fix. N1: accepted deviation, now recorded in the changeset and the PR body (the N2: unchanged, accepted as is; a follow-up for the class (the peer address cannot ride a N3: unchanged, accepted as is; the member's doc still calls its 404 "the transport's own unmatched answer" where the transport would give 405 for a known path under another verb. Unreachable from the one caller. N4: unchanged, accepted as is; the three shapes are still written once in plugin-audit and once in runtime, and drift fails closed. N5 (nit) — Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读(席位记录 · head
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Landing: L1 ACCEPT at head |
… on a hosted tenant kernel instead of 404 (objectstack-ai#36690) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8HLrJyMR9mKwcN7row9NW91)_ Fixes objectstack-ai#36506 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户看到的变化:在托管云环境里,删除个人视图、删除或重命名记录附件,从“找不到”变为正常完成;自部署环境不变。 - 为什么:这三个操作原先只挂在自部署才有的网络入口上,托管租户没有这个入口,请求落空。 - 坏了会怎样:托管环境里这三个操作回到“找不到”或“未实现”;不会越权,身份和成员校验比自部署更严。 - 需要你做什么:合并即可;云端无需改代码,下次把云端依赖的平台版本升到包含本修复的版本后生效。 ## What changes Root cause: `DELETE /api/v1/personal-views/:id` (plugin-auth) and `DELETE` / `PATCH /api/v1/attachments/:id` (service-storage) were mounted only on the kernel's `http.server`. A hosted tenant kernel owns no socket, registers no `http.server`, and runs `AuthPlugin` with `registerRoutes: false`. The host's `createHonoApp` catch-all hands every unclaimed `/api/v1/*` request to `HttpDispatcher.dispatch()`, which had no domain for either prefix and answered `404 ROUTE_NOT_FOUND`. The cloud host's storage bridge covers only `/api/v1/storage`, so it never reached them either. The fix applies ruling A on objectstack-ai#22438 to these two members of the class, the same shape objectstack-ai#36539 gave the comment doors: - **Spec.** `IPersonalViewDoorsService.handlePersonalViewDoor(request): Promise<Response>` types a new `personal-views` slot. `IAttachmentDoorsService.handleAttachmentDoor` is implemented by the existing `file-attachments` service beside `IFileAttachmentService`. Both members are optional. - **One body, two faces.** `createDoorTableMember(routes, mount)` (new export of `@objectstack/plugin-hono-server`) runs the plugin's own registrar on a private `HonoHttpServer` that never listens, built on first request. So the caller resolution, every refusal and every answer are the self-hosted mount's own bytes. The self-hosted mounts are unchanged and no path is mounted twice. - `AuthPlugin.init()` registers `personal-views` whatever `registerRoutes` says; `mountPersonalViewDoor` and the member share one `personalViewDoorDeps()`. - `StorageServicePlugin` hands `FileAttachmentService` an `attachmentDoors` member over `mountAttachmentRemovalDoor`. - **Runtime.** A shared bridge (`domains/own-door-bridge.ts`) and two domains, `/personal-views` and `/attachments`, claim exactly the door shapes and forward the transport's request, body unread and re-addressed to the wire path, to the member on the REQUEST kernel's slot (`getRequestKernelService`, never the host's scoped fallback). Any other shape under those prefixes keeps `404 ROUTE_NOT_FOUND`. No slot, or no member: a typed `501 NOT_IMPLEMENTED` naming the package that registers it. A member throw or a consumed body: a sanitised `500`, logged. No auth-gate or membership exemption is added, so on the dispatcher the doors are stricter than the self-hosted mount, never looser. - **Ledgers.** Three `server-only` rows in `route-ledger.ts` (census 153 → 156); a new `own-row-doors-session` row in the authz conformance matrix; `check-route-envelope.mjs` audits the three new domain files. - **Dependencies.** `@objectstack/plugin-auth` and `@objectstack/service-storage` now depend on `@objectstack/plugin-hono-server` at runtime (no manifest cycle; `check:workspace-manifest-cycles` green). - **Surface widening** (hence `Clause-②: yes`): two new contract interfaces, a new typed slot name (`personal-views` is now taken, so a composition registering its own service under that name beside `AuthPlugin` fails to boot with a duplicate-service error), two new exports from plugin-hono-server, and two new dispatcher domains. No cloud code change and no cloud deploy is needed. Hosted gets the fix when cloud's objectstack pin moves past this PR, as with objectstack-ai#36469. ## Tests - `packages/runtime/src/domains/own-door-bridge.test.ts` (27): `describe.each` over both families. Forwarding with the transport's own request and body unread; exact claim and misses; the environment-scoped spelling; 501 for an empty slot, a throwing lookup and a missing member; per-request reads; request kernel only (the host kernel's member is never used); member throw 500; consumed body 500; both preamble gates (membership 403, owed-step gate) with a member control. - `packages/plugins/plugin-hono-server/src/door-table-member.test.ts` (4): byte parity against a `HonoHttpServer` mount; unmatched 404 without building the table; built once; the matcher. - `packages/plugins/plugin-auth/src/personal-view-door-member.test.ts` (3): `AuthPlugin.init` with `registerRoutes: false` registers the slot once; an anonymous request is byte-equal to the self-hosted mount's 401; a non-door request is 404 `ENDPOINT_NOT_FOUND`. - `packages/services/service-storage/src/attachment-removal-routes.integration.test.ts`: a new describe with no `http.server` (no routes mounted; the uploader renames then removes, 200 each; another member 403; anonymous 401 on both doors; a GET 404). - `packages/qa/http-conformance/src/hono-own-row-doors.conformance.test.ts` (7), the wire half: `createHonoApp` over a kernel with no `http.server`, the real `AuthPlugin` composed with `registerRoutes: false`, the real `StorageServicePlugin`, platform objects, security and sharing, and real better-auth sessions signed in through the same transport. No door answers a route miss; the owner removes their own personal view (200, row gone); another member 404 `RECORD_NOT_FOUND` and anonymous 401 (row stays); the uploader renames then removes their own attachment (200 each, store follows); anonymous 401 on both attachment doors; the refusals are byte-identical to the self-hosted mount over a real socket; a kernel without service-storage answers 501 naming it. The subject packages resolve from source (`vitest.config.ts` aliases). - Dogfood, real composed stack, through `HttpDispatcher` alone (`hosted-dispatcher.testkit.ts`): `personal-view-row-scope` gains a `[hosted]` describe (owner removal 200, another user 404 `RECORD_NOT_FOUND`, anonymous 401); `member-attachment-baseline` gains a `[hosted]` case (other member 403, anonymous 401, rename 200 trimmed, removal 200 and the row is gone). ## Acceptance notes - Red before the fix, each through `scripts/ablation-replace.mjs` with the restore proved (`blob == HEAD`, `git diff HEAD` empty): - the two domain registrations deleted from `http-dispatcher.ts`: `own-door-bridge.test.ts` 21 of 27 red (the 6 that stay green are the miss and gate cases, which hold without the domain); - `ctx.registerService('personal-views', …)` deleted: the plugin-auth member test 3 of 3 red; - the `attachmentDoors:` dep renamed away: the storage integration file 3 red, 17 green (the new describe's door cases). - The wire-half file, 7 tests: the two dispatcher domain registrations deleted and runtime `dist` rebuilt: 7 of 7 red, each answering the pre-fix `404 ROUTE_NOT_FOUND` (restored, rebuilt, green again); `registerService('personal-views', …)` deleted: 4 red (every personal-view case and the parity case); `attachmentDoors:` renamed away: 4 red (every attachment case and the parity case). - Overlap: `objectstack-ai#36311` conflicts in `auth-plugin.ts`, but `origin/main × objectstack-ai#36311` already has that one hunk (an import line). `HEAD × objectstack-ai#36311` has the same single hunk, so it is not added by this branch. `objectstack-ai#35129` and `objectstack-ai#34223` merge cleanly. ## Verification - Typecheck green: spec, runtime, plugin-auth, service-storage, plugin-hono-server, dogfood. - Full suites green: http-conformance 22 files / 305 tests; runtime 641 files / 11872 tests; plugin-auth 294 / 6268; service-storage 88 / 1729; plugin-hono-server 44 / 585. - Dogfood: `personal-view-row-scope` + `member-attachment-baseline` 37 / 37. - `dispatch-gates --ran`: 137 derived, 136 run green, 1 NOT MEASURED (`check:dual-build-cjs-loads`, exit 3, needs every package's `dist/`; left to CI). `check:undeclared-dep-imports` caught plugin-auth listing plugin-hono-server as a dev dependency only; fixed and green. - eslint on the 31 changed source files, with `--no-inline-config` as `pnpm lint` runs it, green (the whole-tree `pnpm lint` is left to CI); `check-nul-bytes` OK. <details><summary>Gate reconciliation</summary> ``` Run reconciliation — 137 derived, 136 run, 1 NOT-MEASURED, 0 UNRUN. NOT-MEASURED · DERIVED (1): - pnpm check:dual-build-cjs-loads [recorded exit 3 — PREREQUISITE NOT MET] ✓ dispatch-gates --ran: 137 derived famil(ies) accounted for — 136 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. https://claude.ai/code/session_01JQwxbXs1Hrj1qNTkGdJbK1 --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…tstack dev` multi-tenant host instead of 404 ENDPOINT_NOT_FOUND (objectstack-ai#36712) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8RVgGNY8UtzQKECmEjFw5Pi)_ Part of objectstack-ai#36469 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户看到的变化:在本机托管环境(`objectstack dev` 启动的云端运行时)里,取消表情回应、标记已解决、删除自己的评论不再报「接口不存在」。 - 原因:上一个修复(objectstack-ai#36539)只接通了生产那种启动方式;本机开发启动方式少一层兜底路由,请求到不了那条修复。 - 坏了会怎样:只影响这三个评论操作在多租户主机上的转发;单机自部署不受影响,其他找不到的路径照旧返回原来的 404。 - 需要你做什么:无;合并后云端下次升级平台版本即生效。 ## What changes **Measured finding.** Cloud's local rig runs `apps/objectos` under `objectstack dev`, the framework CLI's composition, which mounts no `createHonoApp` catch-all. On that host the three comment doors answer `404 {"success":false,"error":{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}}` whatever the framework pin, because objectstack-ai#36539's `/comments` domain is reachable only through `dispatch()`. The gap is in this repo's `DispatcherPlugin`, so it reaches any multi-tenant host composed by `objectstack serve` / `objectstack dev`, not only cloud's rig. The card's hosted reading was a literal `404 {"success":false,"error":{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}}` on `DELETE /api/v1/comments/reactions/:id`. objectstack-ai#36539 left that spelling unexplained. This PR explains it and closes the gap it came from. **Two host shapes serve a hosted environment.** - Production and staging run cloud's `apps/objectos/server/serve-node.ts`. It mounts `createHonoApp({ prefix: '/api/v1' })` under the `HonoServerPlugin` raw app, so an unclaimed `/api/v1/comments/**` request reaches `dispatch()` and objectstack-ai#36539's `/comments` domain. Cloud's `main` pin moved to objectstack `ed0edb1b5` on 2026-11-23 04:35Z (cloud#4929), which contains objectstack-ai#36539 (`d463c46f64`). Whether that pin is deployed is cloud's fact and is not read here. - Cloud's local rig (`scripts/dev-local/run-stack.sh`, default `START_CMD=dev`) runs `apps/objectos` under `objectstack dev`: the framework CLI's composition, which is `HonoServerPlugin` + `DispatcherPlugin` with a `kernel-resolver` and **no** `createHonoApp` catch-all. `AuditPlugin` runs on the per-environment kernel (cloud's `hosted-slate.ts` forces `audit`), which owns no `http.server`, so nothing mounts the doors on the host's route table. `DispatcherPlugin`'s fallback seam hands on only domain-decided paths (`/actions`, `/keys`, `/notifications`, `/mcp`) and app-endpoint paths, so it declined, and the transport's `unmatchedResponse` answered. That is the card's exact body. The card was measured on this rig. **The fix**, in `@objectstack/runtime` only: - `forwarded-door-fallback.ts` (new, internal): `matchForwardedDoorPath` says whether an unrouted request is exactly one of the three comment door shapes, bare or `/environments/:id`-scoped (it reuses `matchCommentDoorPath` from `domains/comments.ts`). `toWebRequest` rebuilds the fallback's `IHttpRequest` as a Web `Request` (headers, query, original body bytes via `rawBody()`). `sendWebResponse` writes the member's `Response` back unchanged, `Set-Cookie` lines kept separate. - `DispatcherPlugin`'s fallback gains one arm, before the app-endpoint step: on a multi-tenant host, an exact door shape goes to `dispatch()` with the rebuilt request, and a `Response` result is written through. Everything after `dispatch()` is objectstack-ai#36539's `/comments` domain, unchanged, including its authentication and membership gates. What does not change: - Any other shape still writes nothing in the fallback, so the transport's own 404/405 stands (objectstack-ai#5090). - A single-kernel host (no `kernel-resolver`) keeps today's answers byte for byte. - The fallback runs only after every mounted route missed, so a kernel that mounts the doors itself (the self-hosted shape) is never reached here (ADR-0076 D11). - No spec, contract or plugin change; no export added. Clause-② is `no`: the arm routes only the three door shapes objectstack-ai#36539 already declared (route ledger rows, `/comments` domain, `ICommentDoorsService`), with no new route, export or contract. ## Why Card objectstack-ai#36469 acceptance asks for the reaction removal, resolve/reopen and own-comment delete to work on a hosted environment, "本机 cloud rig 或 staging". After objectstack-ai#36539 the staging shape works by construction, but the local rig, where the card was measured, still answered `ENDPOINT_NOT_FOUND`. ## Verification - `packages/runtime/src/dispatcher-plugin.comment-doors-multi-tenant.test.ts` (new, 9): a real `HonoServerPlugin` + `DispatcherPlugin` over a socket with a `kernel-resolver` and a stub tenant member. Each door reaches the placed tenant's member, with the PUT body intact and the member's own headers on the answer. The environment-scoped spelling forwards at the wire path. Three non-door shapes (an extra segment, the wrong verb, GET) keep `404 ENDPOINT_NOT_FOUND` and reach no member. An unplaced request is never served out of a tenant. A host with no resolver keeps `404 ENDPOINT_NOT_FOUND`. - `packages/qa/http-conformance/src/hono-comment-doors.conformance.test.ts` (+3, 9 total): the `objectstack serve` shape over the REAL `AuditPlugin` on a real store. A member removes their own reaction (200, row gone on the tenant). A member resolves, reopens, then removes their own comment (200 each, store follows). The anonymous refusal and the two refused bodies are byte-identical to the self-hosted mount. - Red before the fix (the `dispatcher-plugin.ts` hunk removed, restore proved by `sha1 c3ac20dc…` before and after): - runtime file: 4 of 9 red (the 3 doors + the scoped spelling). The 5 that stay green are the miss and guard cases, which hold without the arm. - conformance file, runtime `dist` rebuilt without the arm: the 3 new cases red. Each answered `404 {"success":false,"error":{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}}`, the card's body byte for byte. Rebuilt with the arm: green. - Suites: runtime `dispatcher-plugin*`, `*fallback*` and `route-ledger*`: 25 files, 205 tests green. `domains/comments.test.ts` + `dispatcher-plugin.multi-tenant-endpoint.integration.test.ts` green. http-conformance `hono-comment-doors` 9/9. - Typecheck: http-conformance `typecheck` exit 0. Runtime `tsc --noEmit` exit 0 and the new test file clean under `tsconfig.test.json`. Runtime `check:test-typecheck` names 3 untouched files (TS2307 on the unbuilt `@objectstack/driver-turso`, not built in this worktree). The previous round on this card recorded the same 3. - eslint `--no-inline-config` on the 4 changed source files: exit 0. - overlap-check: `origin/main` merges cleanly, 0 open PR heads share a file. - `dispatch-gates --commands` at the base `4034a6d2f8` plus this diff: 68 derived, all run. 66 exited 0. `check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET: it needs every package's `dist/`), so it is NOT MEASURED here and left to CI. `check:test-source-alias` caught the new runtime test reaching `@objectstack/metadata` lazily inside a clocked case; fixed with a module-top import, now green. ## Not done here - **Same class, same host shape, unmeasured:** every other dispatcher domain that only forwards to a tenant member has the same gap on an `objectstack dev` host: `/webhooks/redeliver`, `/approvals/act`, and the `/personal-views` and `/attachments` doors open in objectstack-ai#36690. Each would be one matcher row in `FORWARDED_DOOR_MATCHERS`. This PR does not add them; the seat decides whether to file them or let objectstack-ai#36690 add its own rows. - **Live probe:** no hosted account here. The card's live acceptance (a reaction removed on the local rig or staging, and the `comment doors mounted` boot line) stays with the seat and the cloud lane. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. https://claude.ai/code/session_01JQwxbZu8LTZdVjqiEi4pci --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Part of #36469
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The cause is in objectstack, in two layers:
AuditPluginmounted the three comment doors only on the kernel's ownhttp.server, and the runtime dispatcher had no domain for/comments. A hosted tenant kernel owns no socket and registers nohttp.server, soDELETE /api/v1/comments/reactions/:id,PUT /api/v1/comments/:id/resolutionandDELETE /api/v1/comments/:idreached the host'screateHonoAppcatch-all, whosedispatch()had no domain for them, so they answered the dispatcher's404 ROUTE_NOT_FOUND.Premise reading. Cloud confirmed the hosted composition on the card (comment 7084177018, cloud
apps/objectosatab4358642). The rig mountscreateHonoApp({ prefix: '/api/v1' })under theplugin-hono-serverraw app withouter.route('/', inner), after the plugin routes. So an unclaimed/api/v1/comments/**request reaches the dispatcher catch-all, and the new/commentsdomain is reachable on hosted. Unexplained: the card read404with{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}. In this tree only theplugin-hono-servertransport's unmatched answer spells that, and thecreateHonoAppcatch-all answersROUTE_NOT_FOUND. Either the reading predates the pin cloud read, or a layer upstream of the catch-all answered it; that was not measured here. The code text now states the tree's answer (ROUTE_NOT_FOUND) and records this discrepancy instead of the old account.Shape: ruling A on #22438 (record 6079645593, applied to this member of the class; seat scope comment 7081381198). Three segments, one PR.
packages/spec/src/contracts/comment-doors-service.ts): newICommentDoorsServicewith one OPTIONAL, transport-neutral memberhandleCommentDoor(request: Request)answering a promisedResponse, the shapeIWebhookService.handleRedeliverandIApprovalService.handleActionPagealready use.ServiceSlotContractsgainscomments: ICommentDoorsService. No comment service contract existed, so this is the smallest new one. API surface and export-origin snapshots gain the one interface.comment-doors-member.ts,audit-plugin.ts):init()registers thecommentsservice. Its member runs the SAME two registrars (registerCommentReactionRoutes,registerCommentDoorsRoutes) over the same deps as thehttp.servermount, on a privateHonoHttpServerthat never listens, built on first request. The registrar body moved verbatim into a module-levelregisterCommentDoors(http, ctx)that both faces call;mountCommentDoorsis otherwise unchanged, so the raw mount is byte-unchanged and nothing is mounted twice. The no-server branch now logs (info) that the doors are served on thecommentsservice instead of warning that they are unmounted. New dependency:@objectstack/plugin-hono-server.domains/comments.ts, registered inhttp-dispatcher.ts): a/commentssegment domain forPUT/DELETEthat claims exactly the three method and path shapes and forwardscontext.requestwith its body unread (env-scoped spellings are rewritten to the/api/v1wire path). Every other/commentsshape keeps404 ROUTE_NOT_FOUND. No slot, or a slot without the member:501 NOT_IMPLEMENTEDnaming@objectstack/plugin-audit. A consumed body or a throwing member: sanitised 500, logged. No auth-gate or membership-gate exemption. Route ledger: threeserver-onlyrows under domain/comments.scripts/check-route-envelope.mjsdeclarescomments.tsinDISPATCHER_DOMAINS; the dogfood authz matrix classifies the new ledger key (comment-doors-session); the live-mount parity boot pins the three rows as unexercised (that boot composes noAuditPlugin).Overlap: PR #36399 also edits
audit-plugin.ts. This diff stays in the imports, theinit()slot registration,mountCommentDoorsand the newregisterCommentDoorshelper, and touches none of that PR's regions.Out of scope here (filed separately by the seat): the personal-views and attachments doors of the same class.
Tests
Why
Part of, notFixes(seat, on l2-review#4 7086653795 ③): cloud's reading (7084177018) shows that this tree's hosted composition reaches the bridged path. However, the card's own measurement readENDPOINT_NOT_FOUNDwith nomountCommentDoorswarning, which this tree would not produce. So no hosted evidence yet shows that the card's request took this path. #36469 stays open for one hosted live probe after this merges. That probe also checks whether a tenant kernel with no auth service answers 401.Text rework (L2 S1), head
e7dcb26cc4(main merged atf3a8a13cin merge commitacc0d0cd, no rebase): the contract jsdoc,comments.ts,comment-doors-member.ts, the unreact ledger note, the conformance test header and the changeset now state the prior hosted miss as the dispatcher'sROUTE_NOT_FOUND, and the absence promise as neverROUTE_NOT_FOUND(norENDPOINT_NOT_FOUND). The member's ownENDPOINT_NOT_FOUNDfor paths outside its three routes is unchanged. The conformance pin now refuses both miss codes. Readings ate7dcb26cc4:comments.test.ts+route-ledger.conformance.test.ts26/26; conformance 6/6; spec contract tests 12/12.tsc --noEmitexit 0; itscheck:test-typecheckflagged only 3 untouched files with TS2307 on the unbuilt@objectstack/driver-turso. That run was green with the full build in the previous round.604b45ec3(an unescaped apostrophe in the ledger note) is fixed ate7dcb26cc4.check:dual-build-cjs-loadsandcheck:i18n(no whole-workspace dist), andcheck:type-check-debt(its locked closure build queue-timed out). CI runs all three.Earlier readings at head
6b916dcfcunless noted (spec and runtime source unchanged after the noted sha).packages/qa/http-conformance/src/hono-comment-doors.conformance.test.ts(new, the dispatcher-only shape:createHonoApp, nohttp.server, realAuditPlugin, real ObjectQL over sqlite-wasm): 6/6 passed. Covers unreact, resolve then reopen, own-comment delete (200, store follows), byte parity of the anonymous refusal and the refused body between the self-hosted mount and the hosted door, and a typed501 NOT_IMPLEMENTEDper door with nocommentsservice.packages/runtime/src/domains/comments.test.ts(new) +route-ledger.conformance.test.ts: 26/26 passed (at2f6e249ad).@objectstack/plugin-auditfull suite: 109 files, 1794 tests passed (at2f6e249ad).@objectstack/speccomment-doors-service.test.ts+core-service-contracts.test.ts: 12/12 passed; spectypecheck(incl.check:test-typecheck) exit 0.authz-conformance.test.ts+authz-probe-blind-spot.test.ts: 70/70 passed.Red before, green after (two ablations, both restored)
Both via
scripts/ablation-replace.mjs(anchor hit 1 to 0, blob changed, then restored: blob == HEAD andgit diff HEADempty). Both subjects resolve to source (runtime tests import../http-dispatcher.js; http-conformance aliases@objectstack/plugin-audittosrc), so no dist rebuild sits between mutation and reading.http-dispatcher.ts:comments.test.ts10 failed / 3 passed (the door shapes fall to the ordinary miss).ctx.registerService('comments', ...)removed fromaudit-plugin.ts: conformance 4 failed / 2 passed. Unreact, resolve and own-delete answer501 NOT_IMPLEMENTED ... no comments service is registered, and byte parity breaks.Not done: a conformance-level ablation of the runtime domain. That subject reaches the conformance test through
@objectstack/runtime'sdist/and would need a locked rebuild per leg. The unit-level ablation (1) covers the domain.Gates
node scripts/pm/dispatch-gates.mjs --commandsat6b916dcfcderived 135 families. All 135 ran locally;--ranreconciliation: 135 derived, 135 run, 0 unrun.Final pass, non-zero exits only:
check:dual-build-cjs-loadsandcheck:i18nexited 3 (PREREQUISITE NOT MET: unbuilt workspace dist). Both were rerun after the full buildcheck:type-check-debtperformed, and both exited 0.check-self-test-workflow-commands.mjsfailed once withspawnSync node ETIMEDOUTon the loaded box. Rerun: exit 0.Fixed in this PR because a gate caught them:
check:route-ledger-census: 150 to 153.check:test-source-alias: plugin-audit gets an anchored alias for plugin-hono-server, and the domain test imports@objectstack/metadataat module top.check-affected-docs: the runtime door table keyspattern, notpath, so it is not read as a spec API declaration.check:query-options-erasure: the test'sfindOneoptions are typed.Acceptance notes
yes (widening)adds one optional member on one new contract and one new slot key. Nothing is removed or narrowed. A service without the member still satisfies the contract (pinned)./commentsrows enter the route ledger asserver-only, because the gap ratchet is 0. The live-mount parity boot pins them as unexercised, because that boot composes noAuditPlugin.authservice (ctx.getService('auth')), while the dispatcher's identity step can fall back to the host kernel. A tenant kernel with noauthservice of its own would answer 401 after the dispatcher admitted the caller. The webhooks precedent makes the same assumption.@objectstack/plugin-auditnow depends on@objectstack/plugin-hono-serverat runtime (the member's private table is aHonoHttpServer), and thecommentsservice name is taken, so a composition that registers its owncommentsservice besideAuditPluginfails to boot with a duplicate-service error. L2 N2 to N4 are accepted as is.route-ledger-live-mount-parity.dogfood.test.ts. It boots the showcase app, and the box's verify lock never reached this run for that boot. CI's merge-queue dogfood shard runs it.VERDICT command-exit 0). Per the seat's fallback, the scoped vitest and typecheck runs above ran outside the lock, one at a time. A parked slot did not keep its place across re-queues (it reappeared at the back); that is recorded for the seat.Verification
Read first, by risk:
packages/runtime/src/domains/comments.ts:handleCommentsRequest(the three-shape claim, the 501 legs, the body-unread forward).packages/plugins/plugin-audit/src/audit-plugin.ts: theinit()slot registration and the extractedregisterCommentDoors(must equal the old inline body).packages/plugins/plugin-audit/src/comment-doors-member.ts: the private never-listening table.Two-minute check:
pnpm --filter @objectstack/http-conformance exec vitest run --maxWorkers=2 src/hono-comment-doors.conformance.test.tsafter building the closure. Expected: 3 suites green; the unreact, resolve/reopen and own-delete legs answer 200 on a kernel with nohttp.server.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY