Repository navigation
feat(runtime,plugin-audit): a hosted kernel serves the comment threads read through the dispatcher /comments domain - #39174
Conversation
…mment threads read The member's private table already registered POST /api/v1/comments/threads/query; the member and the dispatcher's /comments domain now admit it as a fourth shape, so a hosted tenant kernel answers the list page's comment panel as a self-hosted one does. Claude-Session: https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp Co-authored-by: Claude <noreply@anthropic.com>
…ledger note carries no tracker id Claude-Session: https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 195 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1b25169132ce2f22c9fdbe8d13f502b35f8c7c2a && git checkout 1b25169132ce2f22c9fdbe8d13f502b35f8c7c2a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 440331f1dd40ae99bc59412c026c52035a8f2e78 df819c4e7e534ba48e06849b6901feff24b55ed9 && git checkout -B drift-repro 440331f1dd40ae99bc59412c026c52035a8f2e78 && git merge --no-ff df819c4e7e534ba48e06849b6901feff24b55ed9
node scripts/docs-audit/affected-docs.mjs --json 440331f1dd40ae99bc59412c026c52035a8f2e78
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK Contract reviewServed-tier: Inputs: card 39134 (body and its four comments: first touch 7346314736, claim 7357087993, dev report 7359008239, takeover 7360042192), PR 39174 (body, 10-file list, net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implementing files: S1 (should-fix) — N1 (nit) — N2 (nit) — N3 (nit) — S1 is open on this head and earns a delta review of its fix. Nothing found fails the round. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK 席位核对 — L1 REWORK · PR #39174 @
|
…eads read is served on, and the hosted shape's stricter gates The client JSDoc, the changeset and data-api.mdx said or implied one shape or identical refusals on both; the hosted dispatcher's preamble gates refuse a non-member of the environment and answer a held sign-in before the read runs. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK
…s read and its enforcement site The /comments domain claims a fourth shape, an object-data read through a sibling HTTP entry point. The row now names it, its enforcement site and the proofs that exist, and the comment records that its HIGH_RISK classification is an open decision rather than reusing the doors' write-only reason. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK
…ven on the hosted dispatcher too Ruling B on the card (comment 7363771779): split comment-threads-read-session out of comment-doors-session, list it in HIGH_RISK, and have comment-threads-query.dogfood.test.ts claim it with a [hosted] group that drives the read through a dispatcher alone over the real stack. Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK Contract reviewServed-tier: Delta review of record 7360247446 (head ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentS1: closed How each closes, read in the tree at this head:
New hunks, each tried against the code it cites:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK 2026-12-03T01:38Z · PR-side red, judged a flake · head
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK 席位核对 — delta L1 ACCEPT · PR #39174 @
|
Requested by Yibo Wang · project thread
Fixes #39134
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
@objectstack/runtime,packages/runtime/src/domains/comments.ts: the dispatcher's/commentsdomain claims a fourth shape,POST /comments/threads/query, beside the three comment doors (COMMENTS_DOMAIN_METHODSgainsPOST;COMMENT_DOOR_PATHSgains the row). It forwards the transport's request as it already does for the doors: body unread, query string kept, URL rewritten to the wire path for the environment-scoped spelling, slot read per request,501when the slot or member is absent.forwarded-door-fallback.tsreusesmatchCommentDoorPath, so theobjectstack serve/objectstack devhost shape follows with no code change there.@objectstack/plugin-audit,comment-doors-member.ts:COMMENT_DOOR_ROUTESgainsPOST /api/v1/comments/threads/query. The member's private table already registered the read (it runsregisterCommentDoorsRoutes, which mounts it), so the member now serves it with the mount's bytes.audit-plugin.ts: the hosted boot-log line names the read as served on thecommentsservice and no longer says it is not served; docblocks follow. The handlercomment-threads-query.tsis untouched.packages/runtime/src/route-ledger.ts): one row,POST /comments/threads/queryon domain/comments, dispositionsdk, clientcomments.queryThreads(the method the mount's own ledger row names); the census sentence counts it.@objectstack/spec,contracts/comment-doors-service.ts: the contract's docblock names the read as the fourth route thecommentsslot serves. No type or schema changes.route-ledger-live-mount-parity.dogfood.test.ts): one exception row for the new ledger row, worded like the three door rows (self-hosted, plugin-audit mounts the path; that boot composes no AuditPlugin).content/docs/api/data-api.mdxsays the read is served on both shapes and drops the paragraph that said a hosted kernel does not serve it.patchon runtime, plugin-audit and spec, with both declaration lines.Tests
packages/runtime/src/domains/comments.test.ts(realHttpDispatcher, stub member): the read is in the forwarded set, so it goes through the forwarding,501and501-language cases; its query string reaches the member on both spellings (the read refuses any query parameter itself, so a dropped?limit=would turn its400into a200); a consumed body is a500; a non-member of the environment is refused403before the member runs, and a member reaches it. The miss list adds every other method on the path and neighbouring paths underPOST.packages/qa/http-conformance/src/hono-comment-doors.conformance.test.ts(real AuditPlugin, real SQLite):createHonoApp, nohttp.server): a member reads the seeded thread, and it is the same thread the self-hosted mount answers;sys_comment, an unregistered object, comments off, and a member whose read of the object is refused. The test asserts that400 INVALID_REQUEST,400 VALIDATION_ERROR,400 INVALID_FILTER,401 UNAUTHENTICATED,403 FEEDS_DISABLED,403 PERMISSION_DENIEDand404 OBJECT_NOT_FOUNDare each reached;501 NOT_IMPLEMENTED;objectstack serve-shaped host (HonoServerPlugin + DispatcherPlugin, no catch-all) answers the thread and the same 11 refusals with the mount's bytes.COMMENTS_DOMAIN_METHODSmutated to dropPOST(scripts/ablation-replace.mjs, runtime rebuilt,ablation-dist-preflightconfirmed the marker indist/), the 5 new conformance tests fail and the 9 existing ones pass. The restore leg ran (blob equals HEAD,git diff HEADempty), the runtime package was rebuilt, and--absentconfirmed the marker gone fromdist/with a clean tree.Acceptance notes
PERMISSION_DENIEDin the conformance file comes from abeforeFindhook on the board that refuses one member's read. That is the light stack's stand-in for a permission set without read on the object. It still refuses through the read's own path (planReadScoperuns the object read as the caller). The real SecurityPlugin refusal is pinned at the handler level bypackages/qa/dogfood/test/comment-threads-query.dogfood.test.ts(S3), which this PR does not touch, since perf(plugin-audit): count comment thread replies by a stored thread root, and page threads at PostgreSQL microsecond precision #39169 is open on it.403) is not byte-compared, and that is by design: on the hosted shape the dispatcher's ADR-0069 gate stops it before the member runs, which is stricter than the mount. The domain docblock already states this for the three doors.createCommentsDomain's registration inpackages/runtime/src/http-dispatcher.tsstill says "three method and path shapes", and thecomment-doors-sessionrow inpackages/qa/dogfood/test/authz-conformance.matrix.tssays the domain "claims exactly the three method and path shapes". Both are prose only, with no assertion. If the seat amends the claim, they are a two-line fix in this PR. Otherwise they go to a follow-up.content/docs/api/data-api.mdxis shared with perf(plugin-audit): count comment thread replies by a stored thread root, and page threads at PostgreSQL microsecond precision #39169 and cli:os migrate meta --from 18says addingviewAllFields: truekeeps a permission set's field reads, but a set with Modify All and its own row hiding a field still loses that field (read and edit) on 19 — the tool should name such entries #38924 in other hunks; whichever lands later merges main.Verification
498dd24d.@objectstack/runtime:comments.test.ts,route-ledger.conformance.test.tsanddispatcher-plugin.comment-doors-multi-tenant.test.tspass, 41 of 41 (withown-door-bridge.test.tsearlier, 118 of 118).@objectstack/http-conformancehono-comment-doors.conformance.test.ts: 14 of 14.@objectstack/plugin-audit: 118 files / 1946 tests.@objectstack/speccontract tests: 12 of 12. Dogfoodroute-ledger-live-mount-parity.dogfood.test.ts: 8 of 8.--max-warnings=0over the changed sources passes.@objectstack/runtimesuite. It did not finish inside the container's 10-minute foreground limit.Test Coreruns it in CI.node scripts/pm/dispatch-gates.mjs --ran: 124 derived families, 122 run, 2 NOT MEASURED.check:skill-examplesandcheck:dual-build-cjs-loadsexit 3 for missing builds, a prerequisite and not a verdict, so CI runs them.check:route-ledger-census(the new row) andcheck:doc-authoring(a tracker id in the ledger note) were red on the first pass. Both were fixed and pass on the final head, along withcheck-doc-route-spelling,check:issue-citations,check:nul-bytesand the runtime suites above.Human Minimum
packages/specholds no runtime logic. (Only a contract docblock changes.)pnpm lintpasses (eslint on changed files).main, one pull request.packages/spectouched: a docblock incontracts/only; no generated artifact derives from it (check:docs,check:api-surfaceandcheck:export-originspass).content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp
Patch round (L1 REWORK 7360301182; contract review 7360247446 S1 and N1–N3)
Head
51929dc7. Claim amendment 7360285715.origin/mainmerged (cfb766b1).packages/client/src/index.ts: thecommentsJSDoc names both shapes (the self-hosted mount and the hosted dispatcher/commentsdomain,501without plugin-audit). The changeset gains'@objectstack/client': patch.content/docs/api/data-api.mdx: "same bytes" now covers only the read's own refusals. On a hosted kernel the dispatcher's preamble gates also refuse a non-member of the environment (403 PROJECT_MEMBERSHIP_REQUIRED, hosted only). A held sign-in is a403with the policy's code on both shapes; on hosted the dispatcher's gate answers it first. The Refusals list names both.packages/runtime/src/http-dispatcher.tssays four method and path shapes. Thecomment-threads-query.tsdocblock says where the read is served (docblock only; the handler is unchanged).packages/qa/dogfood/test/authz-conformance.matrix.ts: thecomment-doors-sessionrow names the threads read, where it is enforced (comment-threads-query.ts,planReadScopeas the caller) and which proofs exist. Whether the read belongs on the HIGH_RISK list is open and goes to the maintainer as a decision on Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134. The maintainer ruled B on 2026-12-03 (card comment 7363771779); round 2 below.Patch round 2 (ruling B, card comment 7363771779)
Head
df819c4e.origin/mainmerged (c8f6acd7).POST /comments/threads/query) moves out ofcomment-doors-sessioninto its own authorization-ledger row,comment-threads-read-session. Its enforcement is plugin-auditcomment-threads-query.ts, where every read runs as the caller. Its proof iscomment-threads-query.dogfood.test.ts. The row is on the HIGH_RISK list.covers. The ratchet mints keys per route family and per dispatcher domain, and each key belongs to exactly one row. The/commentsdomain key stays oncomment-doors-session.[hosted]group. It drives the read through a runtime HttpDispatcher alone, over the same real org-bound stack with the real SecurityPlugin and AuditPlugin:403 PERMISSION_DENIED. Anonymous gets401 UNAUTHENTICATED.403 PROJECT_MEMBERSHIP_REQUIREDand the read is never planned. A member is answered. This case uses a fixturesys_environment_memberin place of the cloud-provided store; the judgment is the dispatcher's own.POSTfromCOMMENTS_DOMAIN_METHODS(runtime rebuilt, marker proven indist/) turns all three hosted cases red with404 ROUTE_NOT_FOUND. In the environment case the non-member refusal still answers 403, because the preamble runs before route matching, so the member control is what turns it red. All green on restore.