Skip to content

fix(service-messaging): a host that owns the socket can mount the messaging doors for a kernel with no http-server - #39922

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-bchxqf
Dec 6, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-bchxqf

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Jack · project thread

Fixes #39917

Maintainer summary

  • On a hosted environment, Account › Notification Settings read nothing: MessagingServicePlugin mounted /api/v1/messaging/* only on its own kernel's http-server, and a hosted environment kernel has none (the host worker owns the socket), so the doors were served nowhere.
  • The plugin now also registers a messaging-http-doors service at init. A host that owns the socket calls mount(http) to register the same routes on its own route table, bound to this kernel's services. A kernel with its own http-server (self-hosted, os dev) behaves as before; a test pins that.
  • Cloud consumes it in objectstack-ai/cloud#5498 (draft, blocked on this PR and a pin).

Clause-②: no
Metadata-protocol: none

What changed

  • packages/services/service-messaging/src/messaging-service-plugin.ts: init registers MESSAGING_HTTP_DOORS_SERVICE ('messaging-http-doors') carrying { mount(http: IHttpServer): void }. The route registration that mountHttpDoors did inline moved into mountHttpDoorsOn(http, …); mountHttpDoors still resolves the kernel's own http-server at kernel:ready and calls it, and its no-server warning now names the service.
  • src/index.ts: exports MESSAGING_HTTP_DOORS_SERVICE and the MessagingHttpDoors type.
  • src/messaging-http-doors-service.test.ts (new, 4 tests): the service is registered on a kernel with no http-server; mount registers exactly the MESSAGING_ROUTE_LEDGER routes; with no server the kernel:ready warning names the service; a kernel WITH its own http-server still gets exactly the ledger routes mounted on it at kernel:ready and no warning.
  • Changeset: @objectstack/service-messaging patch.

Why a service rather than exporting the five registrars: the doors close over the plugin's own MessagingService and SlackLinkStore instances; a host rebuilding them from exports would hold a second store.

Evidence

  • Cloud hosted tenant rig, cloud 5b4c402, pin bd27ebe5: before, GET /api/v1/messaging/me/preferences with the owner's session answered 404 ENDPOINT_NOT_FOUND, and the environment kernel logged [messaging] no HTTP server is registered … is mounted. With this change applied to the pin's service-messaging and cloud#5498's door composed: /me/preferences 200 with the caller's topic rows, /me/slack-link 200, /preference-options 200, anonymous /me/preferences 401.

Local gates

  • @objectstack/service-messaging: vitest run 88 files / 1174 tests passed; tsc --noEmit -p tsconfig.json exit 0 (after turbo run build --filter='@objectstack/service-messaging^...').
  • node scripts/pm/dispatch-gates.mjs listed 126 local commands; all exit 0 except:
    • NOT-MEASURED pnpm check:dual-build-cjs-loads, pnpm check:published-readme-exports :: exit 3, need every package's dist/ (workspace not fully built in this worktree)
    • NOT-MEASURED node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 3, shallow clone cannot read its pinned positive control (checker health only; the gate itself, node scripts/check-plugin-teardown-shape.mjs, exit 0)
    • NOT-MEASURED check-closing-target-claim, check-partof-closing-keyword, check-single-claim-paths, check-governed-queue-guard :: need the PR / workflow event context; they run on this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjRQzcYiBPb6jM6qBmk

…saging doors for a kernel with no http-server

MessagingServicePlugin mounted /api/v1/messaging/* only on its own kernel's
http-server, so a hosted environment kernel (the host worker owns the
socket) served them nowhere. The plugin now registers
MESSAGING_HTTP_DOORS_SERVICE ('messaging-http-doors') at init; mount(http)
registers the same routes on a host-supplied server, bound to this kernel's
services. A kernel with its own http-server mounts them as before.

Fixes #39917

Claude-Session: https://claude.ai/code/session_01Q4EjjRQzcYiBPb6jM6qBmk
Co-authored-by: Claude <noreply@anthropic.com>
@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 Dec 6, 2026
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-messaging, touching 6 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/services/service-messaging/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/automation/webhooks.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/data-modeling/field-types.mdx (via /api/v1/messaging/preference-options (route, a path literal in a comment on a changed line))
  • content/docs/plugins/packages.mdx (via MessagingServicePlugin (symbol, a top-level class))

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

  • content/docs/releases/v14.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via MessagingServicePlugin (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
  • 1 changed file(s) yielded no anchor (packages/services/service-messaging/src/index.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 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 — 6 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 b8b7727792ead2ef1651b7c85b665c17673c6feb → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 b8b7727792ead2ef1651b7c85b665c17673c6feb → 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

repo:cloud@hotlong · hotlong · session_01Q4EjjQzFqHGjUAXt8kBQhV

L1: ACCEPT at head 8f675152 · reviewer of record repo:cloud@hotlong · read 2026-12-06T13:21Z.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 6, 2026 13:21
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge December 6, 2026 13:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 6, 2026
Merged via the queue into main with commit 0dafdd8 Dec 6, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-bchxqf branch December 6, 2026 14:13
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.

service-messaging: let a host that owns the socket mount the messaging doors for a kernel with no http-server (hosted 通知设置 reads nothing)

2 participants