Skip to content

fix(comments): unreact, resolve and own-comment delete answer on a kernel with no http.server - #36539

Merged
objectstack-fleet[bot] merged 13 commits into
mainfrom
claude/issue-36469-comment-doors-hosted
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 13 commits into
mainfrom
claude/issue-36469-comment-doors-hosted

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #36469

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 托管环境里的成员现在可以撤回自己的表情回应、标记评论已解决或重新打开、删除自己的评论;以前这三个操作在托管环境一律报“找不到接口”,自托管环境不变。
  • 修的是评论协作这块的托管缺口,与之前已裁定的“托管环境缺少服务端入口”一类问题同一种修法。
  • 出错时只影响这三个评论操作:没装审计插件的环境会明确提示缺什么,而不是“找不到”;改动可以直接撤回。
  • 无。

What changes

The cause is in objectstack, in two layers: AuditPlugin mounted the three comment doors only on the kernel's own http.server, and the runtime dispatcher had no domain for /comments. A hosted tenant kernel owns no socket and registers no http.server, so DELETE /api/v1/comments/reactions/:id, PUT /api/v1/comments/:id/resolution and DELETE /api/v1/comments/:id reached the host's createHonoApp catch-all, whose dispatch() had no domain for them, so they answered the dispatcher's 404 ROUTE_NOT_FOUND.

Premise reading. Cloud confirmed the hosted composition on the card (comment 7084177018, cloud apps/objectos at ab4358642). The rig mounts createHonoApp({ prefix: '/api/v1' }) under the plugin-hono-server raw app with outer.route('/', inner), after the plugin routes. So an unclaimed /api/v1/comments/** request reaches the dispatcher catch-all, and the new /comments domain is reachable on hosted. Unexplained: the card read 404 with {"code":"ENDPOINT_NOT_FOUND","message":"Not found"}. In this tree only the plugin-hono-server transport's unmatched answer spells that, and the createHonoApp catch-all answers ROUTE_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.

  • spec (packages/spec/src/contracts/comment-doors-service.ts): new ICommentDoorsService with one OPTIONAL, transport-neutral member handleCommentDoor(request: Request) answering a promised Response, the shape IWebhookService.handleRedeliver and IApprovalService.handleActionPage already use. ServiceSlotContracts gains comments: ICommentDoorsService. No comment service contract existed, so this is the smallest new one. API surface and export-origin snapshots gain the one interface.
  • plugin-audit (comment-doors-member.ts, audit-plugin.ts): init() registers the comments service. Its member runs the SAME two registrars (registerCommentReactionRoutes, registerCommentDoorsRoutes) over the same deps as the http.server mount, on a private HonoHttpServer that never listens, built on first request. The registrar body moved verbatim into a module-level registerCommentDoors(http, ctx) that both faces call; mountCommentDoors is 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 the comments service instead of warning that they are unmounted. New dependency: @objectstack/plugin-hono-server.
  • runtime (domains/comments.ts, registered in http-dispatcher.ts): a /comments segment domain for PUT/DELETE that claims exactly the three method and path shapes and forwards context.request with its body unread (env-scoped spellings are rewritten to the /api/v1 wire path). Every other /comments shape keeps 404 ROUTE_NOT_FOUND. No slot, or a slot without the member: 501 NOT_IMPLEMENTED naming @objectstack/plugin-audit. A consumed body or a throwing member: sanitised 500, logged. No auth-gate or membership-gate exemption. Route ledger: three server-only rows under domain /comments.
  • guards: scripts/check-route-envelope.mjs declares comments.ts in DISPATCHER_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 no AuditPlugin).

Overlap: PR #36399 also edits audit-plugin.ts. This diff stays in the imports, the init() slot registration, mountCommentDoors and the new registerCommentDoors helper, 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, not Fixes (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 read ENDPOINT_NOT_FOUND with no mountCommentDoors warning, 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 at f3a8a13c in merge commit acc0d0cd, 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's ROUTE_NOT_FOUND, and the absence promise as never ROUTE_NOT_FOUND (nor ENDPOINT_NOT_FOUND). The member's own ENDPOINT_NOT_FOUND for paths outside its three routes is unchanged. The conformance pin now refuses both miss codes. Readings at e7dcb26cc4:

  • runtime comments.test.ts + route-ledger.conformance.test.ts 26/26; conformance 6/6; spec contract tests 12/12.
  • typecheck exit 0 for plugin-audit and http-conformance. runtime tsc --noEmit exit 0; its check:test-typecheck flagged only 3 untouched files with TS2307 on the unbuilt @objectstack/driver-turso. That run was green with the full build in the previous round.
  • eslint on the five edited source files: exit 0. The CI ESLint parse error at 604b45ec3 (an unescaped apostrophe in the ledger note) is fixed at e7dcb26cc4.
  • dispatch-gates derived for this round's six paths: 98 families, 95 exit 0. NOT MEASURED: check:dual-build-cjs-loads and check:i18n (no whole-workspace dist), and check:type-check-debt (its locked closure build queue-timed out). CI runs all three.

Earlier readings at head 6b916dcfc unless 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, no http.server, real AuditPlugin, 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 typed 501 NOT_IMPLEMENTED per door with no comments service.
  • packages/runtime/src/domains/comments.test.ts (new) + route-ledger.conformance.test.ts: 26/26 passed (at 2f6e249ad).
  • @objectstack/plugin-audit full suite: 109 files, 1794 tests passed (at 2f6e249ad).
  • @objectstack/spec comment-doors-service.test.ts + core-service-contracts.test.ts: 12/12 passed; spec typecheck (incl. check:test-typecheck) exit 0.
  • dogfood authz-conformance.test.ts + authz-probe-blind-spot.test.ts: 70/70 passed.
  • typecheck exit 0: plugin-audit, runtime, http-conformance, dogfood.
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 and git diff HEAD empty). Both subjects resolve to source (runtime tests import ../http-dispatcher.js; http-conformance aliases @objectstack/plugin-audit to src), so no dist rebuild sits between mutation and reading.

  1. Runtime domain registration removed from http-dispatcher.ts: comments.test.ts 10 failed / 3 passed (the door shapes fall to the ordinary miss).
  2. ctx.registerService('comments', ...) removed from audit-plugin.ts: conformance 4 failed / 2 passed. Unreact, resolve and own-delete answer 501 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's dist/ and would need a locked rebuild per leg. The unit-level ablation (1) covers the domain.

Gates

node scripts/pm/dispatch-gates.mjs --commands at 6b916dcfc derived 135 families. All 135 ran locally; --ran reconciliation: 135 derived, 135 run, 0 unrun.

Final pass, non-zero exits only:

  • check:dual-build-cjs-loads and check:i18n exited 3 (PREREQUISITE NOT MET: unbuilt workspace dist). Both were rerun after the full build check:type-check-debt performed, and both exited 0.
  • check-self-test-workflow-commands.mjs failed once with spawnSync node ETIMEDOUT on 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/metadata at module top.
  • check-affected-docs: the runtime door table keys pattern, not path, so it is not read as a spec API declaration.
  • check:query-options-erasure: the test's findOne options are typed.

Acceptance notes

  • The cause is in objectstack: the plugin-audit mount and the runtime dispatcher layer. Ruling A on plugin-approvals mounts its ADR-0043 action pages (/api/v1/approvals/act) only through http.server getRawApp, so a hosted tenant kernel, which has none, answers 404 ROUTE_NOT_FOUND to every approval e-mail link #22438 is applied to this member of the class. The personal-views and attachments doors of the same class are not touched here; the seat files them separately.
  • Clause-② 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).
  • The /comments rows enter the route ledger as server-only, because the gap ratchet is 0. The live-mount parity boot pins them as unexercised, because that boot composes no AuditPlugin.
  • Unmeasured on hosted: the member resolves the caller with the tenant kernel's own auth service (ctx.getService('auth')), while the dispatcher's identity step can fall back to the host kernel. A tenant kernel with no auth service of its own would answer 401 after the dispatcher admitted the caller. The webhooks precedent makes the same assumption.
  • L2 N1, accepted deviation (also in the changeset): @objectstack/plugin-audit now depends on @objectstack/plugin-hono-server at runtime (the member's private table is a HonoHttpServer), and the comments service name is taken, so a composition that registers its own comments service beside AuditPlugin fails to boot with a duplicate-service error. L2 N2 to N4 are accepted as is.
  • NOT MEASURED: 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.
  • Deviation: the shared verify lock answered queue-timeout (exit 99) on every attempt in about 2.5 hours, under holders that each ran 10 to 80 minutes. One build closure did acquire the lock (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:

  1. packages/runtime/src/domains/comments.ts: handleCommentsRequest (the three-shape claim, the 501 legs, the body-unread forward).
  2. packages/plugins/plugin-audit/src/audit-plugin.ts: the init() slot registration and the extracted registerCommentDoors (must equal the old inline body).
  3. 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.ts after building the closure. Expected: 3 suites green; the unreact, resolve/reopen and own-delete legs answer 200 on a kernel with no http.server.


🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY

…-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>
… 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>
@github-actions github-actions Bot added size/xl dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/plugin-audit, @objectstack/http-conformance, @objectstack/runtime, @objectstack/spec, touching 33 documentable anchor(s). ⚠️ 6 changed file(s) yielded no anchor (packages/plugins/plugin-audit/package.json, packages/plugins/plugin-audit/vitest.config.ts, packages/qa/http-conformance/vitest.config.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/error-catalog.mdx (via ENDPOINT_NOT_FOUND (literal, a string literal in unmatched))
  • content/docs/data-modeling/objects.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/deployment/cli.mdx (via /api/v1/* (route, a path literal in a comment on a changed line))
  • content/docs/frontend/plugins/plugin-detail.mdx (via /api/v1/comments (route, a path literal in a comment in ICommentDoorsService; a path literal in a comment on a changed line), /api/v1/comments/:id (route, a path literal in a comment on a changed line), /api/v1/comments/:id/resolution (route, a path literal in a comment on a changed line), /api/v1/comments/reactions/:id (route, a path literal in a comment on a changed line), /comments/:id (route, a path literal in COMMENT_DOOR_PATHS; a path literal in ROUTE_LEDGER; a path literal in a comment on a changed line), /comments/:id/resolution (route, a path literal in COMMENT_DOOR_PATHS; a path literal in ROUTE_LEDGER; a path literal in a comment on a changed line), /comments/reactions/:id (route, a path literal in COMMENT_DOOR_PATHS; a path literal in ROUTE_LEDGER; a path literal in a comment on a changed line))
  • content/docs/permissions/record-view-auditing.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/protocol/kernel/index.mdx (via AuditPlugin (symbol, a top-level class))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-1.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via ENDPOINT_NOT_FOUND (literal, a string literal in unmatched))
  • content/docs/releases/v18/18-2.mdx (via /api/v1/comments (route, a path literal in a comment in ICommentDoorsService; a path literal in a comment on a changed line), /api/v1/comments/reactions/:id (route, a path literal in a comment on a changed line), /comments/reactions/:id (route, a path literal in COMMENT_DOOR_PATHS; a path literal in ROUTE_LEDGER; a path literal in a comment on a changed line))
  • content/docs/releases/v18/18-5.mdx (via AuditPlugin (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 6 changed file(s) yielded no anchor (packages/plugins/plugin-audit/package.json, packages/plugins/plugin-audit/vitest.config.ts, packages/qa/http-conformance/vitest.config.ts, …) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: /api/v1 (route, 128 pages)
  • 5 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 77517533d3b8fd8aafb2f4203ba384e31c3ae7cf → packageMentionDocs.

Which tree this was computed on

This run read content/docs from bf47c34cdf2f4943602c61c219d58600031229cb — the merge of head e7dcb26cc49a8cb61a3cddb0104b0371e7ffb7a8 into base 77517533d3b8fd8aafb2f4203ba384e31c3ae7cf, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 77517533d3b8fd8aafb2f4203ba384e31c3ae7cf → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih

Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 6b916dc · 2026-11-22T18:52Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6b916dcfcb9f31150b539ef9cc22497516689f28
Local-runs: none
Scope: packages/spec/src/contracts/comment-doors-service.ts, packages/spec/src/contracts/core-service-contracts.ts, packages/spec/src/contracts/index.ts + packages/plugins/plugin-audit/src/comment-doors-member.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/runtime/src/domains/comments.ts, packages/runtime/src/http-dispatcher.ts, packages/runtime/src/route-ledger.ts

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

  • New export ICommentDoorsService from @objectstack/spec/contracts, one optional member handleCommentDoor(request: Request) answering a promised Response. Right. index.ts re-exports the one module, and api-surface/contracts.json and export-origins/contracts.json each gain exactly that one row. Nothing else is published.
  • New key comments on ServiceSlotContracts. Right. The typed lookup for comments moves from unknown to the contract. No reader on main resolves a comments service, and none registers one (searched registerService / getService / resolveService over packages on origin/main: 0 hits). The discovery flag comments: { enabled } in http-dispatcher.ts is derived from the sys_comment object, not from a service slot, so it does not collide.
  • Derived and unstated: the slot name is now taken at runtime. AuditPlugin.init() registers comments unconditionally, and plugin-loader.ts throws Service 'comments' already registered on a second registration. A third-party composition that already owns a comments service would fail to boot with AuditPlugin. Nothing in this repo does; acceptable, and worth one line in the changeset.
  • Accept-set on the wire: three method and path shapes that answered a 404 through the dispatcher now answer through the member, on both the plain and the environment-scoped spelling. Every other PUT / DELETE under /comments still answers deps.routeNotFound, which is bound to the dispatcher's own fallback this.routeNotFound, so nothing that answered before answers differently. GET, POST, PATCH are not claimed. Right.
  • "Nothing narrows" holds. No export, key, accepted value or route is removed, and the auth-gate allow-list and the membership skip list are untouched (packages/core has no hunk; enforceProjectMembership has no hunk).
  • Shape against the precedents on main: same signature, same optionality, same per-request slot read, same 501 pair, same body-unread forward and same sanitised 500 as IWebhookService.handleRedeliver and domains/webhooks.ts. Two deliberate differences, both right: one member for three routes (so the claim is a segment claim narrowed in the handler instead of an exact one), and a URL rewrite to the wire path, which the single-route precedent did not need.

② Semver level

patch on @objectstack/spec, @objectstack/runtime and @objectstack/plugin-audit, with Clause-②: yes (widening) and Metadata-protocol: none in both the PR body and the changeset. This matches AGENTS.md: a service contract is not something a metadata author writes, so the kind is none, and a non-protocol widening ships patch. Check Changeset is green. The declaration is the lane's; the widening it names is right and complete as far as the diff publishes.

Clause-②: yes (widening) — as declared by the lane; judged right and complete.

The changeset body does not mention that @objectstack/plugin-audit gains a production dependency on @objectstack/plugin-hono-server (see N1). Not a level question.

③ Boundary flags

  • Dev open_questions (report 7083912355): one entry, the verify-lock slot behaviour, recommendation A (seat notes it, no action on this PR). Answered: it is tooling, outside this contract, and nothing in the diff depends on it.
  • Ruling fit, escalated for the maintainer's information, not blocking. Ruling 6079645593 rules A plus the sweep: each member of the class "is bridged the same way", and the sweep report "names any further member". This PR is that shape. But the same ruling records the class as three producers, "not a wide one", from a census of getRawApp() mounts. The comment doors are a fourth producer, mounted through IHttpServer verbs, and the dev names two more families (personal-views, attachments). The seat applied A by extension (7081381198) without a new word from the maintainer. The shape is sound; the maintainer should know the class is now measured wider, because the ruling parked the conformance pin A-3 "until the sweep report re-raises it with the measured class".
  • Hosted acceptance is not evidenced, escalated to the seat. The card's acceptance is a hosted environment (local cloud rig or staging). The PR's proof is createHonoApp over one kernel with no http.server. The card's measured body does not match the path this PR bridges (S1 below). Fixes #36469 will close the card at merge, before any hosted reading and before a cloud pin carries this head. The card should stay open, or its acceptance move to the cloud pin card, as plugin-approvals mounts its ADR-0043 action pages (/api/v1/approvals/act) only through http.server getRawApp, so a hosted tenant kernel, which has none, answers 404 ROUTE_NOT_FOUND to every approval e-mail link #22438 did with cloud#2549.
  • Identity on the hosted path, flagged. The member resolves the caller with the tenant kernel's own auth service (ctx.getService('auth')), while the dispatcher's own identity step falls back to the host kernel (resolveService chain). If a hosted tenant kernel carries no auth service of its own, every door answers 401 after the dispatcher admitted the caller. The webhooks precedent makes the same assumption, and cloud is not readable from here, so this is unmeasured, not a finding.
  • Who can do what (brief item e): no hunk changes it. registerCommentDoors is the old inline body moved verbatim: the same optional helper, the same getEngine, the same platformCallerResolver sources, the same two registrars with the same deps. The member runs those registrars, so the unreact door (own row by created_by), the resolution door (read as the caller, then the posting gate) and the own-comment delete door (own row by author_id, refused under replies) decide exactly as the mount does. The member cannot be reached around its own caller resolution: any caller of handleCommentDoor still passes steps 1 to 3 of each door. Through the dispatcher the ADR-0069 gate and the membership gate run first, so the hosted door is stricter, never looser.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join; the engine calls are the unchanged registrars'.

④ Design judgment

packages/spec/src/contracts/comment-doors-service.ts. Read sentence by sentence against the registrars on main (comment-reaction-routes.ts, comment-routes.ts, core/src/security/own-row-delete-routes.ts) and the member. True: caller from the request's credentials through the kernel's auth service; 401 with no caller; 403 for a held sign-in; the envelope; { id, deleted: true } and { id, is_resolved, resolved_by, resolved_at }; 404 ENDPOINT_NOT_FOUND for a request outside the three routes (the member pre-matches and answers it itself); the wire path requirement (the domain rewrites to it); no ExecutionContext; one caller; not allow-listed and not skipped; 501 for an empty slot or absent member. The contract holds against ruling A and against its first consumer. One sentence names the wrong miss code (S1).

packages/spec/src/contracts/core-service-contracts.ts. The comments entry states the registration and the probe correctly. Holds.

packages/spec/src/contracts/index.ts. One export * of a module with one export. Holds.

packages/plugins/plugin-audit/src/audit-plugin.ts. The extraction is equivalent to the old body, and the mount on http.server calls it once; the member builds its own table, so nothing is mounted twice on a socket. The no-server branch moves from warn to info and still contains the words comment doors mounted, which the card's log acceptance reads. Holds.

packages/plugins/plugin-audit/src/comment-doors-member.ts. The private HonoHttpServer never listens; its constructor installs only the error envelope, compression, session-read isolation, body limit and noindex seams, and the route wrapper opens a fresh session-read scope, so a request served in process does not reach the outer request's session reads. The lazy build is synchronous, so two first requests cannot build two tables. Tried: a path the pre-match admits but Hono does not route (none found; both treat :id as one non-empty segment), an empty id, a doubled slash, reactions as an id (same answer as the mount). Holds, with N1 to N4.

packages/runtime/src/domains/comments.ts. Exactly three shapes are claimed. The trailing-slash spelling and the scoped spelling are both rewritten to the wire path, with headers, signal, query string and the unread body stream carried over; the request is handed on as it is when the path already matches. The handler never reads req.body, so the adapter's refusal-on-read never pre-empts the door. The slot is read per request on the request kernel first. Both 501 legs and both 500 legs are as documented. No header or credential is dropped in the forward. Holds, with S1.

packages/runtime/src/http-dispatcher.ts. One import and one registration, after the webhooks domain; no later domain claims /comments, and both preamble gates run before the registry lookup. Holds.

packages/runtime/src/route-ledger.ts. Three server-only rows; the notes agree with the domain. The census number is the tool's. Holds, with S1 on the miss code it names.

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. comments.ts says that on the hosted shape the three doors "answered the host's unmatched 404 ENDPOINT_NOT_FOUND"; comment-doors-member.ts says "the host's catch-all answered ... with the unmatched 404 ENDPOINT_NOT_FOUND"; the spec jsdoc and the ledger rows promise the absence answer is "never ENDPOINT_NOT_FOUND". On origin/main, createHonoApp's ${prefix}/* catch-all is terminal and always calls dispatch() (packages/adapters/hono/src/index.ts), and dispatch() answers an unclaimed path with routeNotFound, that is 404 ROUTE_NOT_FOUND carrying route. Neither the adapter nor the dispatcher can produce ENDPOINT_NOT_FOUND: its only producer on this path is HonoHttpServer.unmatchedResponse, the answer of a host that listens through plugin-hono-server with DispatcherPlugin's explicit mounts, which has no catch-all (dispatcher-plugin.ts: "there is no catch-all"). The same module contradicts itself: it says the other /comments shapes keep 404 ROUTE_NOT_FOUND, "exactly what it answered before this domain existed", which was equally true of the three doors. The PR's own red state confirms it: with the domain removed the unit test reads ROUTE_NOT_FOUND, and the conformance assertion not.toContain('ENDPOINT_NOT_FOUND') was already true before the change on that shape. Why it matters beyond wording: the card measured ENDPOINT_NOT_FOUND "Not found" on the hosted rig, so the request it measured was answered by a layer this diff does not touch, or the rig is not the createHonoApp shape. A host composed without the catch-all does not reach the new domain at all, and this diff adds no mount in dispatcher-plugin.ts. The dev's first report called the body "exactly the card's body" from reading, with the runtime leg NOT MEASURED. Fix: state the prior answer as the tree gives it (the dispatcher's ROUTE_NOT_FOUND), make the absence promise "never ROUTE_NOT_FOUND" as both precedents do (or name both codes), and say in the PR which host layer produced the card's body, or that it is unexplained. The hosted reading itself is the acceptance flag in ③.

N1 (nit) — @objectstack/plugin-audit takes a production dependency on @objectstack/plugin-hono-server and imports HonoHttpServer statically. On main no domain plugin does: plugin-auth, service-datasource, runtime and rest carry it as a dev dependency only, and the precedent members (plugin-webhooks) serve their door without a transport. Every kernel that composes AuditPlugin now loads hono, @hono/node-server and node:https at import. The private table also has its own body limit (the default or OS_HTTP_MAX_BODY_BYTES, not the host's setMaxRequestBodyBytes) and its own logger. The trade is deliberate (one request builder, so the two faces cannot drift) and no gate objects; record it as an accepted deviation, because the personal-views and attachments members will copy it.

N2 (nit) — The peer address does not survive the forward. The own-row caller resolver passes transport.remoteAddress for the credential_use row an admitted API key writes; in the private table fetch(request) carries no socket, so the hosted door writes that row without an address. No verdict reads it (request-execution-context.ts: "Never read for any verdict"), and a Request-only member cannot carry it. Follow-up for the class, not this PR.

N3 (nit) — comment-doors-member.ts calls its 404 "the transport's own unmatched answer". For a door path with another verb the transport answers 405 METHOD_NOT_ALLOWED with Allow; the member answers 404, as the contract says. The dispatcher never forwards such a request, so it is unreachable from the one caller.

N4 (nit) — The three shapes are written twice (COMMENT_DOOR_ROUTES in plugin-audit, COMMENT_DOOR_PATHS in runtime). The member's doc says matchCommentDoor is exported "so the runtime's claim and this member can be pinned to the same three shapes", and nothing at this head references either list outside its own file. Drift fails closed (a 404 on either side), and the conformance suite drives all three doors end to end.

Implemented-by: claude/issue-36469-comment-doors-hosted
Reviewed-by: session_01ADHkmT4eA4YqtxfiPyLPih

VERDICT: PASS

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih

Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head e7dcb26 · 2026-11-22T22:07Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e7dcb26cc49a8cb61a3cddb0104b0371e7ffb7a8
Local-runs: none
Scope: packages/spec/src/contracts/comment-doors-service.ts, packages/spec/src/contracts/core-service-contracts.ts, packages/spec/src/contracts/index.ts + packages/plugins/plugin-audit/src/comment-doors-member.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/runtime/src/domains/comments.ts, packages/runtime/src/http-dispatcher.ts, packages/runtime/src/route-ledger.ts

Delta round on the at-tier record 7084078045 (head 6b916dcfcb9f31150b539ef9cc22497516689f28). Everything that record judged and this round does not name stands as written there.

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 604b45ec is gone), Lint scoped slot lookup and corpus, Lint scoped query-options erasure, Lint PM dispatch-gates, Lint CI release and engine gates, Lint docs and code guards, Check Changeset, Governed Surface Queue Guard, PR-body guards, Validate Package Dependencies, Spec property liveness, Dogfood Regression Gate, and the UI jobs. The skipped ones are opt-in or queue-only jobs (merge-queue dogfood shards, Temporal Conformance, packed-tarball smoke, 18.x upgrade harness, queue verdicts).

What this head is: acc0d0cd is a merge of the previous head 6b916dcf with main at f3a8a13c (its two parents), followed by two commits, 604b45ec and e7dcb26c. git diff acc0d0cd e7dcb26c is the rework alone: six files, text plus one added test assertion (the changeset, comment-doors-member.ts, the conformance test, comments.ts, route-ledger.ts, comment-doors-service.ts). Main's carry-over touches one Scope file, audit-plugin.ts, in one hunk: the order of installActivitySummaryLocale and installActivityFieldRedaction (#36290). It is not a comment-door hunk, and the net diff of that file against f3a8a13c still shows only the door hunks, so no judgment changes. Main has no change between f3a8a13c and the local origin/main under packages/spec/src/contracts, packages/plugins/plugin-audit, packages/runtime/src, packages/adapters/hono/src or packages/plugins/plugin-hono-server/src. The dev report and the PR body say main was merged "at c57ade2f5a"; no such object exists in this checkout, and the merge's main-side parent is f3a8a13c. That is a claim I could not match, not a tree fact.

① Derived judgments

  • The rework publishes nothing new. ICommentDoorsService, its one optional member and the comments key on ServiceSlotContracts are byte-identical to the previous head except three jsdoc lines on the absence promise. Right.
  • The absence promise changed wording, not behaviour: an empty slot or an absent member still answers 501 NOT_IMPLEMENTED on both legs of handleCommentsRequest. The jsdoc now names the code the dispatcher would otherwise give (404 ROUTE_NOT_FOUND) and keeps the transport's (404 ENDPOINT_NOT_FOUND) beside it. Right, and it now matches the two precedents on main.
  • Accept-set on the wire: unchanged from the previous head. No route, verb, export or slot key is added or removed by the rework.
  • The conformance pin gained not.toContain('ROUTE_NOT_FOUND') beside the existing ENDPOINT_NOT_FOUND and status-not-404 assertions. That is the assertion that was red before the domain existed on this shape; the previous record noted the old one was already true before the change. A test file, so the lane's, but it is what makes the first pin mean what its title says.

② Semver level

Unchanged: patch on @objectstack/spec, @objectstack/runtime and @objectstack/plugin-audit; the rework edits the changeset's prose below the front matter only. Check Changeset is green on this head. The changeset now also states the @objectstack/plugin-hono-server runtime dependency and that the comments service name is taken (a second registration fails boot with a duplicate-service error), which is what ① of the previous record asked to be said.

Clause-②: yes (widening) — as declared by the lane; judged right and complete.

③ Boundary flags

  • Dev open_questions (report 7086556445): none. Its one out-of-scope entry, "which layer answered the card's literal 404 ENDPOINT_NOT_FOUND on the rig stays unmeasured (needs a live probe)", is the flag below.
  • The composition cloud describes (card comment 7084177018), read against plugin-hono-server and adapters/hono on main: consistent with "the dispatcher is reached". HonoHttpServer.unmatchedResponse has one call site, inside the app.notFound hook that installNotFoundSeam mounts; the adapter's own doc says it is never a /* route, and Hono runs that hook only when no route matched. createHonoApp registers app.all(prefix + '/*') as a terminal catch-all: every arm of toResponse returns a response, the catch arm returns thrownJson, and it never calls next(). outer.route('/', inner) puts that route on the outer table, so for any method under /api/v1/ a route always matches and the outer's notFound hook, its fallback handler and unmatchedResponse cannot answer. dispatch() ends in routeNotFound(cleanPath), so an unclaimed path answers 404 ROUTE_NOT_FOUND from inside the catch-all. What can answer first is only a route registered on the outer app before the inner mount whose pattern matches. On main the only registrations of /api/v1/comments/... patterns are plugin-audit's three door routes, which need an AuditPlugin on the kernel that owns that http.server (the host kernel); cloud's raw routes are not readable here. So on the composition as described, the new /comments domain is reachable.
  • Hosted acceptance is still not evidenced; a live hosted probe is still owed. Escalated to the seat. Cloud's answer is a reading of apps/objectos at cloud ab4358642, and it says itself that which layer produced the card's body was not measured. The card measured at objectstack 6a35635a33 (cloud e9da58ce77). At that objectstack commit the three facts above are the same as on main (same terminal catch-all, same routeNotFound fallback, same single unmatchedResponse call site), and mountCommentDoors already logged a warning on a kernel with no http.server. So on the composition cloud describes, the card's rig would have answered ROUTE_NOT_FOUND and logged that warning. The card read ENDPOINT_NOT_FOUND "Not found" and neither log line. Two independent observations on the only live measurement disagree with the reading, and nothing since explains either. The reading therefore does not show that the request the card measured travels the path this PR bridges. Fixes #36469 closes the card at merge, before a cloud pin carries this head and before anyone has seen the three doors answer on a hosted environment, which is the card's acceptance in so many words. The diff is sound as the createHonoApp bridge; whether it fixes the card is unmeasured. The seat decides between Part of #36469 and keeping the card open by hand until the probe is in; I would not let the merge close it.
  • Identity on the hosted path: unchanged and still unmeasured. The member resolves the caller with the tenant kernel's own auth service; a tenant kernel without one answers 401 after the dispatcher admitted the caller. The PR body now states this under Acceptance notes. The same live probe answers it.
  • Ruling-class widening (ruling 6079645593 applied by extension to a fourth producer): unchanged; the previous record raised it for the maintainer's information and the brief says he was informed. Nothing further.
  • SQL push-down: no finding. The rework adds no query, no id materialisation and no in-app join.

④ Design judgment

S1: closed — each place the previous record named now states what the tree gives. Read against adapters/hono/src/index.ts, http-dispatcher.ts and plugin-hono-server/src/adapter.ts on main:

packages/spec/src/contracts/comment-doors-service.ts. "An empty comments slot or an absent member answers a typed 501, never the dispatcher's 404 ROUTE_NOT_FOUND (nor a transport's 404 ENDPOINT_NOT_FOUND)". True: both absence legs in handleCommentsRequest answer deps.error(..., 501) before any forward, and routeNotFound is reached only for a shape outside the three. Item 3 of the list, "a request whose method and path match none of the three routes answers 404 ENDPOINT_NOT_FOUND", is the member's own answer and is untouched; it was judged right last round and does not contradict the new sentence, because the two speak of different callers (the member called directly, and the dispatcher door). Holds.

packages/spec/src/contracts/core-service-contracts.ts, packages/spec/src/contracts/index.ts. No change in the rework or the carry-over. Hold as before.

packages/runtime/src/domains/comments.ts. "Its host mounts createHonoApp's /api/v1/* catch-all, which hands every request no other route claims to dispatch(), and no domain claimed these paths, so ... answered the dispatcher's 404 ROUTE_NOT_FOUND". True of the tree: the catch-all is terminal, the discovery, well-known and auth mounts ahead of it do not match /comments, and no domain on main claims the prefix. The module no longer contradicts itself: the three doors and the other /comments shapes are now both said to have answered ROUTE_NOT_FOUND before. The absence paragraph matches the contract's sentence word for word in substance. No code line changed. Holds, with N5.

packages/plugins/plugin-audit/src/comment-doors-member.ts. "Its host's createHonoApp catch-all handed each unreact, resolve and own-comment delete to the runtime dispatcher, where no domain claimed it, and the answer was the dispatcher's 404 ROUTE_NOT_FOUND. (The card's hosted reading of 404 ENDPOINT_NOT_FOUND is not explained by this tree.)" True, and the second sentence is the honest one. The member's own unmatched() and its doc are untouched. No code line changed. Holds.

packages/plugins/plugin-audit/src/audit-plugin.ts. The rework does not touch it. The carry-over hunk reorders two unrelated installers; registerCommentDoors, the init() registration and both branches of mountCommentDoors are as reviewed. Holds.

packages/runtime/src/http-dispatcher.ts. Unchanged since the previous head. Holds.

packages/runtime/src/route-ledger.ts. The unreact row now reads "An absent slot or member answers 501 NOT_IMPLEMENTED, never the dispatcher's 404 ROUTE_NOT_FOUND". True. The apostrophe is escaped inside the single-quoted note; Lint ESLint and Type Check workspace are green on this head. The other two rows defer to "the unreact row" for the absence note, so they follow. Holds.

Tried to break the rework: a remaining sentence that still gives ENDPOINT_NOT_FOUND as the prior hosted answer or as the only code the absence answer avoids (searched every added line of the net diff for both codes: none left; the remaining ENDPOINT_NOT_FOUND mentions are the member's own unmatched answer, the "unexplained" notes, and the test's refusal of it); a path on which the outer app's unmatchedResponse pre-empts the inner catch-all for /api/v1/comments/** (none, see ③); a way dispatch() hands the adapter handled: false for an unclaimed path, which toResponse would answer with its own 404 (the fallback at the foot of dispatch() is handled: true with routeNotFound).

No must-fix, no should-fix.

N1: accepted deviation, now recorded in the changeset and the PR body (the @objectstack/plugin-hono-server runtime dependency; the taken comments service name). Closed as such.

N2: unchanged, accepted as is; a follow-up for the class (the peer address cannot ride a Request-only member).

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) — comments.ts offers two explanations for the card's ENDPOINT_NOT_FOUND: "it predates this domain, or a layer upstream of the catch-all answered it". The first explains nothing: before this domain the tree answered ROUTE_NOT_FOUND, as the sentence just before it says, so predating the domain cannot account for the other code. The PR body has the meaning that was intended ("the reading predates the pin cloud read"), and comment-doors-member.ts and the test header say only "not explained by this tree", which is accurate. A comment in an implementing file, with no effect on behaviour or on the contract; leave it as an accepted deviation or fold it into the follow-up that records the live probe's answer, since a fix here moves the head.

Implemented-by: claude/issue-36469-comment-doors-hosted
Reviewed-by: session_01ADHkmT4eA4YqtxfiPyLPih

VERDICT: PASS

@objectstack-fleet

objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

维护者速读(席位记录 · head e7dcb26cc4)

席位核对

ACCEPT at head e7dcb26cc4 (seat repo:objectstack#2, reviewer of record).

  • Shape: draft → main. Part of #36469 (changed by the seat from Fixes, per L2 ③: the card closes on one hosted live probe). Clause-②: yes (widening), Metadata-protocol: none. +1176 / −30, 25 files. Spec contract widening: a new optional ICommentDoorsService slot. check-governed-merges --pr reads the pull as not governed (tier none, size clear, no narrowing).
  • Contract review: CONTRACT_REVIEW_TIER. The first record, 7084078045 at 6b916dcfc, raised S1 (the premise text) and N1–N4. The delta, 7086653795 at this head, is PASS: S1 closed, N1 recorded in the changeset, N2–N4 accepted. N5 is a wording nit.
  • Premise: the seat first corrected the premise (card comment 7084157796): the domain is reachable only through dispatch(). cloud#5 then answered (7084177018): the hosted rig mounts createHonoApp({prefix:'/api/v1'}) under the plugin-hono-server app, so the domain is reachable on the hosted host. The card's literal ENDPOINT_NOT_FOUND stays unexplained and is recorded as such; settling it would take a live probe.
  • Test evidence (dev report 7086556445):
    • runtime comments and route-ledger conformance: 26 passed.
    • http-conformance comment-doors: 6 passed. Its first pin now also refuses ROUTE_NOT_FOUND.
    • spec contracts: 12 passed.
    • The first round's ablations stand; this round changed text only, plus one assertion.
  • Gates: check-runs at e7dcb26cc4: 61 success, 9 expected skips (merge-queue dogfood shards, opt-in jobs), 0 failed, 0 pending. mergeable_state clean. K = 3. Locally, 98 were derived (narrowed to this round's six paths, declared) and 95 exited 0. Three are NOT MEASURED (exit 3 prerequisite, and a lock timeout); CI hosts them green.
  • Changeset read: patch on spec, runtime and plugin-audit. It now states N1 (the plugin-hono-server runtime dependency and the taken comments service name).
  • Accepted deviations: one pushed head, 604b45ec3, carried an unescaped apostrophe (ESLint parse error). It was fixed at this head. The dev report's "merged at c57ade2f5a" does not match the tree; the merge's main-side parent is f3a8a13c (L2 read). That is a report error, not a tree error.
  • Out of scope: which layer answered the card's literal ENDPOINT_NOT_FOUND on the rig is cloud's to probe; it is not filed. L2's N2 (the peer address cannot ride a Request-only member) is a class-level observation, not filed now.
  • Landing: not governed, so the seat lands it with pr_ready + auto-merge. 评论的表情回应取消不了:再点一次提示「表情回应未保存,请重试」,取消请求返回「接口不存在」(托管环境) #36469 stays open, and the seat asks cloud for the hosted probe after the merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

Landing: L1 ACCEPT at head e7dcb26cc49a8cb61a3cddb0104b0371e7ffb7a8 (seat record 7086670921). Same-head contract review PASS 7086653795. All checks are green, and the pull is not governed. The seat sets it ready and turns on auto-merge. The PR is Part of #36469; the card stays open for a hosted live probe.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 22:17
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit d463c46 Nov 22, 2026
79 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36469-comment-doors-hosted branch November 22, 2026 22:55
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… 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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants