Skip to content

fix(runtime): comment doors answer on an objectstack serve / objectstack dev multi-tenant host instead of 404 ENDPOINT_NOT_FOUND - #36712

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-ejretx
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-ejretx

Conversation

@os-warren

@os-warren os-warren commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Warren · project thread

Part of #36469

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户看到的变化:在本机托管环境(objectstack dev 启动的云端运行时)里,取消表情回应、标记已解决、删除自己的评论不再报「接口不存在」。
  • 原因:上一个修复(fix(comments): unreact, resolve and own-comment delete answer on a kernel with no http.server #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 #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. #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 fix(comments): unreact, resolve and own-comment delete answer on a kernel with no http.server #36539's /comments domain. Cloud's main pin moved to objectstack ed0edb1b5 on 2026-11-23 04:35Z (cloud#4929), which contains fix(comments): unreact, resolve and own-comment delete answer on a kernel with no http.server #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 fix(comments): unreact, resolve and own-comment delete answer on a kernel with no http.server #36539's /comments domain, unchanged, including its authentication and membership gates.

What does not change:

Clause-② is no: the arm routes only the three door shapes #36539 already declared (route ledger rows, /comments domain, ICommentDoorsService), with no new route, export or contract.

Why

Card #36469 acceptance asks for the reaction removal, resolve/reopen and own-comment delete to work on a hosted environment, "本机 cloud rig 或 staging". After #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

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

https://claude.ai/code/session_01JQwxbZu8LTZdVjqiEi4pci


Generated by Claude Code

…tstack dev` multi-tenant host instead of 404 ENDPOINT_NOT_FOUND

Clause-②: no
Metadata-protocol: none

A multi-tenant host composed by the framework CLI (HonoServerPlugin +
DispatcherPlugin + kernel-resolver) mounts no createHonoApp catch-all, so
#36539's /comments dispatcher domain was unreachable there: AuditPlugin runs
on the tenant kernel (no http.server) and DispatcherPlugin's fallback handed
on only domain-decided and app-endpoint paths. Cloud's local rig runs
apps/objectos this way, which is where the card's literal
ENDPOINT_NOT_FOUND reading came from.

DispatcherPlugin's fallback now hands exactly the three door shapes (bare or
environment-scoped) to dispatch() on a multi-tenant host, with the request
rebuilt as a Web Request carrying its original body, and writes the door's
Response back unchanged. Other shapes and single-kernel hosts keep today's
answers.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZu8LTZdVjqiEi4pci
@os-warren os-warren self-assigned this Nov 23, 2026
@github-actions github-actions Bot added size/m 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 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/runtime, touching 14 documentable anchor(s).

19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json b617675d2887f7b88e98a397011f70cf2004ae0c.

⛔ 6 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 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 — 30 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 b617675d2887f7b88e98a397011f70cf2004ae0c → packageMentionDocs.

Which tree this was computed on

This run read content/docs from fbe7c5205abeab7dc16e6162a5659265a0b16264 — the merge of head a91378cd59b13faf8a9aa137da394b62fb2242eb into base b617675d2887f7b88e98a397011f70cf2004ae0c, 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 fbe7c5205abeab7dc16e6162a5659265a0b16264 && git checkout fbe7c5205abeab7dc16e6162a5659265a0b16264
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b617675d2887f7b88e98a397011f70cf2004ae0c a91378cd59b13faf8a9aa137da394b62fb2242eb && git checkout -B drift-repro b617675d2887f7b88e98a397011f70cf2004ae0c && git merge --no-ff a91378cd59b13faf8a9aa137da394b62fb2242eb

node scripts/docs-audit/affected-docs.mjs --json b617675d2887f7b88e98a397011f70cf2004ae0c

⚠️ 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 b617675d2887f7b88e98a397011f70cf2004ae0c → pass the list as
args.docs, on the commit named under Which tree this was computed on.

The CLI package's test-layer typecheck reaches runtime source and refuses a
Uint8Array over a possibly shared buffer as BodyInit (TS2322). Copy the raw
body bytes into a plain view.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZu8LTZdVjqiEi4pci
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

评论的「取消表情回应」「标记已解决」「删除自己的评论」这三个操作,在用 objectstack dev / serve 搭起来的多租户环境(云端的本地开发环境就是这种)里会返回「接口不存在」。这次修好了。线上预发和生产本来就走另一条路,不受影响;生产要等部署(维护者卡 #36703)。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head a91378cd · 2026-11-23T13:46Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 13:47
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit ac43336 Nov 23, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ejretx branch November 23, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m 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