Skip to content

feat(runtime,plugin-audit): a hosted kernel serves the comment threads read through the dispatcher /comments domain - #39174

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-g3jayi
Dec 3, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-g3jayi

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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 /comments domain claims a fourth shape, POST /comments/threads/query, beside the three comment doors (COMMENTS_DOMAIN_METHODS gains POST; COMMENT_DOOR_PATHS gains 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, 501 when the slot or member is absent. forwarded-door-fallback.ts reuses matchCommentDoorPath, so the objectstack serve / objectstack dev host shape follows with no code change there.
  • @objectstack/plugin-audit, comment-doors-member.ts: COMMENT_DOOR_ROUTES gains POST /api/v1/comments/threads/query. The member's private table already registered the read (it runs registerCommentDoorsRoutes, 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 the comments service and no longer says it is not served; docblocks follow. The handler comment-threads-query.ts is untouched.
  • Route ledger (packages/runtime/src/route-ledger.ts): one row, POST /comments/threads/query on domain /comments, disposition sdk, client comments.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 the comments slot serves. No type or schema changes.
  • Live-mount parity (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).
  • Docs: content/docs/api/data-api.mdx says the read is served on both shapes and drops the paragraph that said a hosted kernel does not serve it.
  • Changeset: patch on runtime, plugin-audit and spec, with both declaration lines.

Tests

  • packages/runtime/src/domains/comments.test.ts (real HttpDispatcher, stub member): the read is in the forwarded set, so it goes through the forwarding, 501 and 501-language cases; its query string reaches the member on both spellings (the read refuses any query parameter itself, so a dropped ?limit= would turn its 400 into a 200); a consumed body is a 500; a non-member of the environment is refused 403 before the member runs, and a member reaches it. The miss list adds every other method on the path and neighbouring paths under POST.
  • packages/qa/http-conformance/src/hono-comment-doors.conformance.test.ts (real AuditPlugin, real SQLite):
    • hosted shape (createHonoApp, no http.server): a member reads the seeded thread, and it is the same thread the self-hosted mount answers;
    • 11 refusals are byte-identical (status, headers, body) at the mount and at the hosted door. They cover anonymous, a non-JSON body, an unknown key, a limit out of range, any query parameter, a foreign cursor, a filter the list read cannot lower, sys_comment, an unregistered object, comments off, and a member whose read of the object is refused. The test asserts that 400 INVALID_REQUEST, 400 VALIDATION_ERROR, 400 INVALID_FILTER, 401 UNAUTHENTICATED, 403 FEEDS_DISABLED, 403 PERMISSION_DENIED and 404 OBJECT_NOT_FOUND are each reached;
    • a hosted kernel without plugin-audit answers 501 NOT_IMPLEMENTED;
    • the objectstack serve-shaped host (HonoServerPlugin + DispatcherPlugin, no catch-all) answers the thread and the same 11 refusals with the mount's bytes.
  • Ablation: with COMMENTS_DOMAIN_METHODS mutated to drop POST (scripts/ablation-replace.mjs, runtime rebuilt, ablation-dist-preflight confirmed the marker in dist/), the 5 new conformance tests fail and the 9 existing ones pass. The restore leg ran (blob equals HEAD, git diff HEAD empty), the runtime package was rebuilt, and --absent confirmed the marker gone from dist/ with a clean tree.

Acceptance notes

Verification

  • Final head 498dd24d. @objectstack/runtime: comments.test.ts, route-ledger.conformance.test.ts and dispatcher-plugin.comment-doors-multi-tenant.test.ts pass, 41 of 41 (with own-door-bridge.test.ts earlier, 118 of 118). @objectstack/http-conformance hono-comment-doors.conformance.test.ts: 14 of 14. @objectstack/plugin-audit: 118 files / 1946 tests. @objectstack/spec contract tests: 12 of 12. Dogfood route-ledger-live-mount-parity.dogfood.test.ts: 8 of 8.
  • Typecheck passes for runtime, plugin-audit, http-conformance and dogfood. ESLint --max-warnings=0 over the changed sources passes.
  • NOT MEASURED locally: the full @objectstack/runtime suite. It did not finish inside the container's 10-minute foreground limit. Test Core runs it in CI.
  • node scripts/pm/dispatch-gates.mjs --ran: 124 derived families, 122 run, 2 NOT MEASURED. check:skill-examples and check:dual-build-cjs-loads exit 3 for missing builds, a prerequisite and not a verdict, so CI runs them. check:route-ledger-census (the new row) and check: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 with check-doc-route-spelling, check:issue-citations, check:nul-bytes and the runtime suites above.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (Only a contract docblock changes.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (eslint on changed files).
  • 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: a docblock in contracts/ only; no generated artifact derives from it (check:docs, check:api-surface and check:export-origins pass).
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the allowed Chinese channel).
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 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/main merged (cfb766b1).

  • packages/client/src/index.ts: the comments JSDoc names both shapes (the self-hosted mount and the hosted dispatcher /comments domain, 501 without plugin-audit). The changeset gains '@objectstack/client': patch.
  • Changeset and 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 a 403 with 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.ts says four method and path shapes. The comment-threads-query.ts docblock says where the read is served (docblock only; the handler is unchanged).
  • packages/qa/dogfood/test/authz-conformance.matrix.ts: the comment-doors-session row names the threads read, where it is enforced (comment-threads-query.ts, planReadScope as 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/main merged (c8f6acd7).

  • The comment threads read (POST /comments/threads/query) moves out of comment-doors-session into its own authorization-ledger row, comment-threads-read-session. Its enforcement is plugin-audit comment-threads-query.ts, where every read runs as the caller. Its proof is comment-threads-query.dogfood.test.ts. The row is on the HIGH_RISK list.
  • The row carries no covers. The ratchet mints keys per route family and per dispatcher domain, and each key belongs to exactly one row. The /comments domain key stays on comment-doors-session.
  • The proof file claims the row and adds a [hosted] group. It drives the read through a runtime HttpDispatcher alone, over the same real org-bound stack with the real SecurityPlugin and AuditPlugin:
    • A full reader and a row-scoped member each get exactly the threads on records they can read.
    • A member with no read gets 403 PERMISSION_DENIED. Anonymous gets 401 UNAUTHENTICATED.
    • Behind a host whose kernel resolver places the request in an environment, a signed-in non-member gets 403 PROJECT_MEMBERSHIP_REQUIRED and the read is never planned. A member is answered. This case uses a fixture sys_environment_member in place of the cloud-provided store; the judgment is the dispatcher's own.
  • Ablation: dropping POST from COMMENTS_DOMAIN_METHODS (runtime rebuilt, marker proven in dist/) turns all three hosted cases red with 404 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.

…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>
…ledger note carries no tracker id

Claude-Session: https://claude.ai/code/session_01WGufzeqywuHW6vj4DU7Rgp
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 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/client, @objectstack/plugin-audit, @objectstack/runtime, @objectstack/spec, touching 14 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/plugins/plugin-audit/src/comment-threads-query.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/api/client-sdk.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/api/data-api.mdx (via comments.queryThreads (sdk, the route ledger binds it to POST /api/v1/comments/threads/query), queryThreads (sdk, the bare tail of client method comments.queryThreads, bound to POST /api/v1/comments/threads/query))
  • content/docs/api/environment-routing.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/api/wire-format.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/data-modeling/objects.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/frontend/plugins/plugin-detail.mdx (via /api/v1/comments/threads/query (route, a path literal in a comment on a changed line))
  • content/docs/kernel/runtime-services/data-service.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/kernel/runtime-services/storage-service.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/permissions/authentication.mdx (via ObjectStackClient (symbol, a top-level class))
  • 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), ObjectStackClient (symbol, a top-level class))
  • content/docs/protocol/kernel/index.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/protocol/kernel/realtime-protocol.mdx (via ObjectStackClient (symbol, a top-level class))

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

  • content/docs/releases/v17/17-0.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/releases/v17/17-1.mdx (via AuditPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-2.mdx (via ObjectStackClient (symbol, a top-level class))
  • content/docs/releases/v18/18-2.mdx (via ObjectStackClient (symbol, a top-level class))
  • 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
  • 1 changed file(s) yielded no anchor (packages/plugins/plugin-audit/src/comment-threads-query.ts) — pages documenting those are invisible to this run
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 256 client-bound route-ledger rows — the other 185 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 185: 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; 125 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 — 195 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 440331f1dd40ae99bc59412c026c52035a8f2e78 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1b25169132ce2f22c9fdbe8d13f502b35f8c7c2a — the merge of head df819c4e7e534ba48e06849b6901feff24b55ed9 into base 440331f1dd40ae99bc59412c026c52035a8f2e78, 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 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

⚠️ 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 440331f1dd40ae99bc59412c026c52035a8f2e78 → 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:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 498dd24da446c7c2c17757d47370ae23b8ddc6dd
Local-runs: none
Scope: packages/spec/src/contracts/comment-doors-service.ts + packages/runtime/src/domains/comments.ts, packages/plugins/plugin-audit/src/comment-doors-member.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/runtime/src/route-ledger.ts
Security-touching: yes
Rule-change-verified: none

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 main), and the check-runs on the head. Read outside the diff, not reviewed: packages/runtime/src/http-dispatcher.ts, packages/runtime/src/domain-handler-registry.ts, packages/runtime/src/forwarded-door-fallback.ts, packages/plugins/plugin-audit/src/comment-threads-query.ts, packages/client/src/index.ts, packages/qa/dogfood/test/authz-conformance.matrix.ts and authz-conformance.test.ts. The rest of the diff (the two test files, the live-mount parity row, content/docs/api/data-api.mdx, the changeset prose) is the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

  • Accept set, dispatcher: COMMENTS_DOMAIN_METHODS gains POST and COMMENT_DOOR_PATHS gains POST /comments/threads/query. Right: one more shape is admitted and nothing is taken away. Every other POST /comments/... path is now claimed by the registry and answered routeNotFound by the handler; before, the registry missed it and dispatch() fell to its last branch, which is the same routeNotFound(cleanPath). So the docblock's "exactly what it answered before this domain existed" holds for the new verb. No domain registered after /comments claims a POST /comments path, so nothing is shadowed.
  • Accept set, member: COMMENT_DOOR_ROUTES gains POST /api/v1/comments/threads/query. Right: the member's private table already registered the read (registerCommentDoors runs the mount's registration), and only matchCommentDoor kept it out. The two matchers stay pinned to the same four shapes; POST matches no :id pattern of the other three rows, so the order is immaterial for it.
  • Public surface, wire: on a kernel with no http.server, the read moves from 404 ROUTE_NOT_FOUND to the mount's answer, and to 501 NOT_IMPLEMENTED when the comments slot or member is absent. Right, and a widening as declared.
  • Public surface, objectstack serve host: forwarded-door-fallback.ts reuses matchCommentDoorPath and rebuilds the request with its body for any verb but GET and HEAD, so the fourth shape follows with no change there. Right.
  • Public surface, types: CommentDoorRoute.method widens to include 'POST', a non-breaking widening of an exported type of @objectstack/plugin-audit. ICommentDoorsService keeps its one optional member and its signature: the spec change is docblock only. Right.
  • Route ledger: one row, sdk, client comments.queryThreads, which exists in packages/client/src/index.ts and posts to the same wire path; the census sentence reads 158. Right. Lint · repo & tooling gates, Test Core 1 to 12 and Dogfood Regression Gate concluded success on the head.
  • Authorization ledger (ADR-0056 D10): the /comments dispatcher domain is covered as a whole by the comment-doors-session row of packages/qa/dogfood/test/authz-conformance.matrix.ts. The diff adds a record read to that domain and leaves the row as it was. Wrong: see S1.

② Semver level

patch on @objectstack/runtime, @objectstack/plugin-audit and @objectstack/spec, with Clause-②: yes (widening) and Metadata-protocol: none on both the PR body and the changeset. It matches what the diff publishes: a non-protocol widening takes patch (AGENTS.md, the changeset rule), no authorable metadata key moves, and the spec package ships a docblock change only. Check Changeset concluded success. Clause-②: yes (widening), and the declaration is correct.

③ Boundary flags

  • open_questions: none in the dev report.
  • security_findings: the report says none. The diff adds no credential path of its own: the handler resolves the caller, and the two dispatcher preamble gates apply unexempted. See S1 for the ledger that records this.
  • out_of_scope_findings, stale "three method and path shapes" prose in http-dispatcher.ts and in the comment-doors-session matrix row: answered in ④. The dispatcher comment is N2; the matrix row is S1, and it is more than prose.
  • Held sign-in not byte-compared (PR body): accepted. The contract and the domain docblock both state that the dispatcher door is stricter than the mount on that shape, never looser.
  • PERMISSION_DENIED reached through a beforeFind hook in the conformance file: accepted for this card. It refuses through the read's own path, and the real SecurityPlugin refusal stays pinned by comment-threads-query.dogfood.test.ts.
  • Full @objectstack/runtime suite not measured locally, and two gate families exit 3 locally: answered by the head's check-runs, all success or skipped by design.
  • SQL push-down: the diff adds no read, no id materialisation and no in-app join. The handler comment-threads-query.ts is untouched; its planned-scope subquery is unchanged.

④ Design judgment

packages/spec/src/contracts/comment-doors-service.ts (hits). The docblock holds against the code it cites.

  • "One member for the four routes ... matches the request's method and path against the four routes": matchCommentDoor over the four-row COMMENT_DOOR_ROUTES.
  • "With no signed-in caller it answers 401; a sign-in that still owes an authentication step answers 403": the handler's step 1 resolves the caller as the doors do. On the dispatcher shape the ADR-0069 gate answers the held sign-in first, which the "Its one caller" paragraph already states.
  • "the threads read CommentThreadsQueryResponse (@objectstack/spec/api), its body refused as strictly as the mount refuses it": the type is exported there, and the member runs the mount's own registration, so there is one body and one refusal set.
  • "claims exactly the four method and path shapes and forwards the request with its body unread": matchCommentDoorPath, and handleCommentsRequest reads neither req.body nor the request stream and answers a consumed body 500.
  • "An empty comments slot or an absent member answers a typed 501": catalogNotImplemented on both arms, before the request is touched.
  • Tried to break it: a query string (kept by atWirePath, since only pathname is rewritten); the environment-scoped spelling (rewritten to the wire path, body stream handed on with duplex: 'half'); a POST to a neighbouring path (the ordinary miss, member not run); a non-member of the environment (stopped by enforceProjectMembership before the member). None breaks the contract.

Implementing files: domains/comments.ts, comment-doors-member.ts, audit-plugin.ts (boot line and docblocks) and the route-ledger.ts row agree with the contract sentence by sentence. The boot line no longer says the read is unserved, which is the card's third acceptance bullet.

S1 (should-fix) — packages/qa/dogfood/test/authz-conformance.matrix.ts, row comment-doors-session, is the authorization classification of record for the whole /comments dispatcher domain (covers: ['dispatcher-domain:route-ledger.ts:/comments']), and this PR makes it false without touching it. Its summary lists three write doors; its enforcement says the domain "claims exactly the three method and path shapes" and names no enforcement site for the read (comment-threads-query.ts, the caller-context planReadScope read); its note says "the three shapes forwarded unread". Its stated reason for staying out of HIGH_RISK is that "each door writes one row the caller owns or may resolve ... so it is no sibling read path around a data gate". The fourth shape is a record read through a sibling HTTP entry point: threads and record names on the records of any object a list filter selects. The matrix ratchet keys on domains, so it stays green and cannot see this; the row has to be kept by hand, as the file header says. Fix in this PR, with the claim amended to name the file: extend the row or add a row for the read, name its enforcement site and proofs, and write down the HIGH_RISK decision for a session-gated read of object data on this door, either way. The dev report grades this "prose only, no assertion"; the strings are the ledger, so it is not a nit. Runtime behaviour is correct as built, so it does not fail the round.

N1 (nit) — packages/plugins/plugin-audit/src/comment-threads-query.ts, section "What is not served here", still says the dispatcher domain "does not claim this route, so this read is served by the self-hosted mount only; AuditPlugin says so in its boot line". Both halves are false on this head, and the PR removed the same statement from three docblocks in audit-plugin.ts. Docblock only; it can ride the S1 fix.

N2 (nit) — packages/runtime/src/http-dispatcher.ts, the comment above createCommentsDomain's registration, still says "The three comment doors ... exactly their three method and path shapes". Comment only; it can ride the S1 fix.

N3 (nit) — packages/client/src/index.ts, the comments group docblock, says "Served by plugin-audit's comment registrar on a kernel with an HTTP server". Not false, but it no longer says where the method reaches. Follow-up or ride along.

S1 is open on this head and earns a delta review of its fix. Nothing found fails the round.

Implemented-by: claude/project-thread-g3jayi
Reviewed-by: session_01Utp6Ca2yTZZiHWkyVgD2oK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK

席位核对 — L1 REWORK · PR #39174 @ 498dd24da446c7c2c17757d47370ae23b8ddc6dd · card #39134 · claim 7357087993 (takeover 7360042192)

Verdict: REWORK (patch round to the original dev). Three items. Each is a sentence or JSDoc fix. Code and tests stand as they are.

REWORK items

  1. A published sentence this round makes false. The JSDoc on comments at packages/client/src/index.ts:7476-7477 reads "Served by plugin-audit's comment registrar on a kernel with an HTTP server." It ships in @objectstack/client dist/index.d.ts (private unset, files: [dist], and tsup keeps JSDoc). This PR rewrote the same scoping sentence in data-api.mdx:687, and its own changeset:19 says queryThreads "now reaches both shapes". Fix: name both shapes (self-hosted mount and hosted dispatcher /comments domain). Amend the claim's file surface with packages/client/src/index.ts, and add '@objectstack/client': patch to the changeset.
  2. .changeset/39134-hosted-comment-threads-read.md:15 overclaims. It says "the caller … and every refusal (400, 401, 403, 404, PERMISSION_DENIED) are the same bytes on both shapes". That is false on the hosted shape. The dispatcher's two preamble gates stop a signed-in non-member of the environment with 403 PROJECT_MEMBERSHIP_REQUIRED before the member runs, and this PR's own comments.test.ts ("[Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134] the threads read too: a non-member is refused 403") pins that. They also stop a session that still owes a sign-in step. The PR body says the held-sign-in 403 "is not byte-compared … stricter than the mount". Fix: limit "same bytes" to the read's own refusals, and add the stricter-on-hosted clause that domains/comments.ts already states.
  3. content/docs/api/data-api.mdx:690 overclaims the same way. It says "with the same caller rule, body and refusals". Fix: as in item 2, and add the hosted-only 403 (non-member of the environment, a sign-in step still owed) to the Refusals list (L738-757).

Checklist areas

  • PR shape / card: open, draft, base main, first line Fixes #39134. I read the body by eye: no closing keyword sits next to any other number (Comments: one read returns the threads on the records a list filter selects, as the caller #39084, perf(plugin-audit): count comment thread replies by a stored thread root, and page threads at PostgreSQL microsecond precision #39169, cli: os migrate meta --from 18 says adding viewAllFields: true keeps 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, 评论的表情回应取消不了:再点一次提示「表情回应未保存,请重试」,取消请求返回「接口不存在」(托管环境) #36469 are prose only). Fixes delivers the whole card. Acceptance (1): hosted parity with every refusal, byte-compared over 11 cases in hono-comment-doors.conformance.test.ts for both hosted and serve-shaped hosts. Acceptance (2): the ledger row and parity row agree. Acceptance (3): the "not served" boot-log clause is gone. One accepted deviation: on hosted, the held-sign-in 403 is stricter than the mount (ADR-0069 gate, the same doctrine as the three doors, stated in the PR body). pm:dispatched is cleared by the close, so landing rule B does not apply.
  • Scope / file surface: all 10 diff files are inside claim 7357087993's surface. forwarded-door-fallback.ts is named in the claim (docblock only) but untouched; that is fine, because it reuses matchCommentDoorPath and follows with no change. The handler comment-threads-query.ts is untouched (verified). There is no content/docs/releases/ path, no codegen, and no move. Size: +315/-61. audit-plugin.ts 1318 lines, route-ledger.ts 895, both under 2000. Skills-docs: not owed.
  • Changeset / published packages: runtime, plugin-audit and spec are published (private unset), so patch on each is right. Spec's touched file contracts/comment-doors-service.ts ships through dist .d.ts and is docblock only. Client is missing (item 1).
  • Sentence read, .changeset/39134-hosted-comment-threads-read.md:
    • L7 title: true.
    • L9-10 declarations: match the PR body.
    • L12 "now answers on a kernel with no HTTP server … as it already did on a self-hosted one": true.
    • L14 "claims it beside the three comment doors and forwards the request, body and query string unread": true. The diff is COMMENTS_DOMAIN_METHODS + COMMENT_DOOR_PATHS; the query string is pinned by the new comments.test.ts case.
    • L15: the first clause, "runs the same registration", is true (createCommentDoorMember((http) => registerCommentDoors(http, ctx))). The second clause is false (item 2).
    • L16 serve/dev fallback: true. forwarded-door-fallback.ts:32-36 uses matchCommentDoorPath, and the serve-shaped conformance tests cover it.
    • L17 "501 NOT_IMPLEMENTED, never a route miss": true, pinned.
    • L19 "answered 404 ROUTE_NOT_FOUND": true per the domain docblock. "That line is gone": true only of the "not served" clause, since the log line itself remains, reworded. Accepted, but say "that clause" when the round edits L15. "queryThreads … now reaches both shapes": true; its JSDoc is the problem (item 1).
  • Sentence read, content/docs/api/data-api.mdx:
    • L687-689 "Served by @objectstack/plugin-audit, on a self-hosted kernel from its own HTTP mount and on a hosted tenant kernel through the dispatcher's /comments domain": true.
    • L690 "with the same caller rule, body and refusals": false (item 3).
    • L691 "the SDK method is client.comments.queryThreads": true.
    • The removed paragraph (old L757-759, "does not claim this read, so it is not served there") was false after this diff, so removing it is right.
    • The unchanged Refusals list was re-read against the conformance set. It is accurate for the read's own refusals, but the hosted gate is missing (item 3).
  • Behaviour of the three existing doors: unchanged. The forwarding code is untouched, and only the constant tables gain a row. POST is a new claim on the /comments/** registry prefix, but no other POST /comments… route exists in packages/** (grep at head). The new miss list pins POST /comments, POST /comments/c_1/resolution and POST /comments/reactions/rx_1 to the ordinary miss, so a mis-routed POST answers exactly what it did before. Member match order: the read is appended last, with a distinct method.
  • Refusal assertions (ADR-0112 envelope):
    • The conformance file asserts a full {status, headers, body} snapshot equality mount-vs-hosted per case. It also asserts the status code set, including 400 INVALID_REQUEST, 400 VALIDATION_ERROR, 400 INVALID_FILTER, 401 UNAUTHENTICATED, 403 FEEDS_DISABLED, 403 PERMISSION_DENIED and 404 OBJECT_NOT_FOUND.
    • The 501 case asserts status and error.code.
    • comments.test.ts asserts envelope() {status, code} for 500 INTERNAL_ERROR and 403 PROJECT_MEMBERSHIP_REQUIRED.
    • Pass. The PERMISSION_DENIED stand-in is a beforeFind hook (disclosed). The real SecurityPlugin refusal stays pinned by S3's dogfood test, which is out of reach while perf(plugin-audit): count comment thread replies by a stored thread root, and page threads at PostgreSQL microsecond precision #39169 is open. Accepted.
  • Route ledger ↔ live-mount parity: they agree. The runtime ROUTE_LEDGER row POST /comments/threads/query has domain /comments, sdk, and comments.queryThreads, the same client as plugin-audit comment-route-ledger.ts:43. The census is 157→158. Parity UNEXERCISED_BY_THIS_BOOT['POST /api/v1/comments/threads/query'] is worded as the three door rows are, and its cited proof file exists and drives the read.
  • Boot log (audit-plugin.ts:1189-1193): only the hosted branch changes. The line now lists the read as served on the comments service, and the "is not served on this kernel" clause is gone. No test asserted the old text (grep). The self-hosted branch is untouched.
  • Benefit past the boundary: tested end to end through createHonoApp and the serve-shaped HonoServerPlugin+DispatcherPlugin host against a real AuditPlugin and real SQLite. Ablation with positive control: dropping POST from COMMENTS_DOMAIN_METHODS turns the 5 new tests red, and the restore leg is clean.
  • Gates / evidence: check-runs at 498dd24d are 62 success, 12 expected skip, 0 failed. Lint & Repo Gates and TypeScript Type Check both succeed (the head sha matches). The dev's test evidence gives per-file counts, not verbatim commands; the CI Test Core 12/12 shards are the seat's reading. The dogfood route-ledger-live-mount-parity 8/8 run is local only, because the Dogfood Regression Gate shards skip on PR and run in the queue. The dev reports 0 API reads. Local re-runs by the seat: NOT MEASURED (no dist/ in the review tree, and building the runtime/plugin-audit dependency closure costs too much for this pass).
  • Premise / stop conditions / deletions: the premise holds at head. The member table already registered the read, and only matchCommentDoor and matchCommentDoorPath gated it. No stop condition was raised, and nothing was deleted.

Out of scope, with disposition

  • packages/runtime/src/http-dispatcher.ts:1017-1018 (// comment, "three method and path shapes") is prose only. No assertion reads it, and it is not published surface, because esbuild drops non-legal comments from dist and sourcesContent does not count. A follow-up card is allowed, and no L1 rule forbids it. Since this round moves the head anyway, it may be folded in with a claim amendment (the four conditions hold: same defect class, mechanical, unclaimed, same gate family).
  • packages/qa/dogfood/test/authz-conformance.matrix.ts:437-440 (comment-doors-session): the package is private: true, the text is unpublished, and nothing asserts on it (covers is keyed on the /comments domain). A follow-up is allowed. ⚠️ It is not just a word swap. The row's "Not HIGH_RISK" rationale (L432-436: "each door writes one row … no sibling read path around a data gate") is now false for a domain that serves an object-data read through a sibling entry point, which is the matrix's own HIGH_RISK definition. The follow-up card must re-decide that classification for the threads read: a separate row, or a re-justification with its proof. That decision is the seat's to file, not this round's.

Seat note: the round also closes the contract review's S1 (7360247446, the comment-doors-session matrix row) and its nits N1–N3. Claim amendment 7360285715. Delta L1 and delta L2 read the new head.

…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>
@github-actions github-actions Bot added size/l and removed size/m labels Dec 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: df819c4e7e534ba48e06849b6901feff24b55ed9
Local-runs: none
Scope: packages/spec/src/contracts/comment-doors-service.ts + packages/runtime/src/domains/comments.ts, packages/plugins/plugin-audit/src/comment-doors-member.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/comment-threads-query.ts, packages/runtime/src/route-ledger.ts, packages/runtime/src/http-dispatcher.ts, packages/client/src/index.ts, packages/qa/dogfood/test/authz-conformance.matrix.ts, packages/qa/dogfood/test/authz-conformance.test.ts, packages/qa/dogfood/test/comment-threads-query.dogfood.test.ts
Security-touching: yes
Rule-change-verified: none

Delta review of record 7360247446 (head 498dd24d). Inputs: card 39134 and every comment since that record (claim amendment 7360285715, dev report 7361262275, decision analysis 7361405247, waiting note 7362830617, ruling 7363771779, dev report 7364382214), PR 39174 (body with both patch-round sections, 16-file list, net diff against main), the delta from 498dd24d to this head, and the check-runs on this head. The files the first record judged clean (comment-doors-service.ts, domains/comments.ts, comment-doors-member.ts, audit-plugin.ts, the route-ledger.ts row, the http-conformance and runtime tests, the parity row) are byte-identical on this head apart from what main merged; their judgment stands. Read outside the diff, not reviewed: packages/core/src/security/environment-membership.ts, packages/verify/src/conformance.ts, packages/qa/dogfood/test/hosted-dispatcher.testkit.ts, enforceProjectMembership in http-dispatcher.ts, .github/workflows/ci.yml.

① Derived judgments

  • Accept set and wire surface: unchanged since 498dd24d. The two rounds add no route, method, code or type.
  • Published surface, @objectstack/client: the comments group JSDoc changes, and it ships in the package's declarations. Right, and the changeset now carries the package.
  • Authorization ledger: a new enforced row comment-threads-read-session, on HIGH_RISK, citing comment-threads-query.dogfood.test.ts; comment-doors-session keeps the /comments domain key and points at it. Right, and it is the maintainer's ruling B (7363771779) as written. Read against checkLedger in packages/verify/src/conformance.ts: the row has a summary, an enforcement site and a proof; the proof file exists; it claims the row on a line the claim reader takes (// authz-row: comment-threads-read-session; the prose line above it puts a backtick before the marker and is not read as a second claim); no other row cites that file, so attribution is mutual; the new row has no covers, so no surface is classified twice and no population count moves.
  • Gates on this head, read at about 2026-12-03T01:50Z: 58 success, 14 skipped, Test Core (8/12) red, Test Core (1/12) and one Check Changeset run not concluded. The red shard is one timeout in @objectstack/knowledge-turso src/__tests__/acceptance.test.ts (337 of 338 passed); no path of that package is in this diff or reviewed here. It is not a finding on this diff, but the head is not green: the shard needs a green re-run before landing.
  • ⚠️ Not answered by any check-run on this head: authz-conformance.test.ts and comment-threads-query.dogfood.test.ts. The dogfood shards carry github.event_name != 'pull_request' in ci.yml, so Dogfood Regression Gate reads success on a pull request without running them. Their only run on this head is the dev's local one (report 7364382214: 78 passed, 6 skipped for PostgreSQL; ablation of the POST claim turned the three hosted cases red). CI first runs them in the merge queue. The same held for the first record's reading of that gate, which I correct here.

② Semver level

patch on @objectstack/runtime, @objectstack/plugin-audit, @objectstack/spec and now @objectstack/client, with Clause-②: yes (widening) and Metadata-protocol: none on the PR body and the changeset. Right: the client change is JSDoc in published declarations, a non-protocol change, and the three dogfood files are in a private package. The changeset prose now limits "same bytes" to the read's own refusals and states the two hosted-only gate answers, which matches the code. One Check Changeset run concluded success; a second was still running at read time. Clause-②: yes (widening), and the declaration is correct.

③ Boundary flags

  • Report 7361262275, question 1 (is the read HIGH_RISK): answered by the maintainer, ruling B, and implemented.
  • Report 7361262275, question 2, and report 7364382214, open_questions[0] (PR body text): answered. The PR body carries both patch-round sections.
  • Report 7361262275's correction to the first record: accepted. A held sign-in is refused 403 by the read itself on the self-hosted mount (handler step 1) and by the dispatcher's gate on the hosted shape, so only who answers differs. data-api.mdx, the changeset and the handler docblock now say so.
  • Report 7364382214, the red Test Core (8/12): see ①. Carrier is the seat.
  • Report 7364382214, the testkit builds its dispatcher with no options, so the proof file builds its own host kernel: accepted. The testkit is outside the claim and untouched; an environment argument on it is a follow-up at the seat's choice.
  • Report 7364382214, no open-source real-stack test reaches 403 PROJECT_MEMBERSHIP_REQUIRED except this one, over a fixture store: accepted, and the row's note says so in its own words.
  • security_findings: none reported, none found.
  • SQL push-down: the two rounds add no product read, id materialisation or in-app join. The handler's code is untouched; its docblock alone changed.

④ Design judgment

S1: closed
N1: closed
N2: closed
N3: closed

How each closes, read in the tree at this head:

  • S1. comment-doors-session is true again about the three doors, says the domain claims four shapes, and names the row that classifies the fourth. comment-threads-read-session names the read's enforcement site sentence by sentence against comment-threads-query.ts (caller resolution, strict body before any read, planReadScope as the caller, the sys_comment read under the comment read gate, the display-name read) and both faces. The HIGH_RISK decision is written down, ruled, and carried by a list entry with its reason.
  • N1. The handler docblock's section is now "Where it is served" and agrees with the contract and with audit-plugin.ts.
  • N2. The http-dispatcher.ts comment says four shapes and names the read.
  • N3. The client JSDoc names both shapes and the 501 without plugin-audit.

New hunks, each tried against the code it cites:

  • No covers on the new row. Holds. checkLedger refuses a surface classified by two rows, and discovery mints one key per dispatcher domain, so the row cannot share /comments and has no other key to take. The comment states what binds the row instead (the list plus mutual attribution), which is what the checker enforces. Rows without covers already exist in the ledger.
  • The HIGH_RISK entry. Holds against the list's own stated reason (object data through a sibling HTTP entry point) and the ruling. Its comment says "proven e2e ... on the hosted dispatcher"; that is true of the proof file as written, with the CI caveat in ①.
  • The fixture sys_environment_member. Holds. judgeEnvironmentMembership in packages/core applies only when the request's engine registers that object, reads it by environment_id and user_id, and the fixture declares exactly those two columns on the tenant kernel the resolver returns. The gate, its ordering before route matching and its refusal are the real dispatcher's. Registering the object on the shared boot cannot change the other cases: the dispatcher door built without a resolver carries no environment, and step 1 of the judgment returns before the registry is asked.
  • Status and code assertions. Each hosted refusal asserts both (403 PERMISSION_DENIED, 401 UNAUTHENTICATED, 403 PROJECT_MEMBERSHIP_REQUIRED). The row-scope case asserts the exact thread ids and record ids for the scoped member beside a full reader. The membership case is discriminating: the refused caller reads every deal, the engine spy records no planReadScope or find during the refusal, and a member of the environment is answered all three threads through the same host as the control.
  • Not driven on the hosted door: a filter on an unreadable field, and a held sign-in. The row's note claims the first for the self-hosted mount only and makes no proof claim for the second, so the ledger does not overstate.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-g3jayi
Reviewed-by: session_01Utp6Ca2yTZZiHWkyVgD2oK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK

2026-12-03T01:38Z · PR-side red, judged a flake · head df819c4e · run 47008151723

  • Failing job: Test Core (8/12). Signature: @objectstack/knowledge-turso src/__tests__/acceptance.test.ts:1585 "Test timed out in 5000ms" (the case ran 15540 ms). The other 337 tests in that file passed.
  • Why a flake:
    • (1) The failing file's package is not in this PR's diff (16 files under runtime, plugin-audit, spec, client, qa/http-conformance, qa/dogfood and docs), and none of them is in its import closure.
    • (2) The first error is a timeout, not an assertion.
    • (3) The signature is absent from Test Core on the 15 latest main commits and from the 40 most recent failed ci.yml runs (delta L1 reading).
  • Action: one re-run of the failed jobs via rerun-failed.mjs. A second failure is real and gets a card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK

席位核对 — delta L1 ACCEPT · PR #39174 @ df819c4e7e534ba48e06849b6901feff24b55ed9 (from REWORK 7360301182 @ 498dd24d)

Verdict: ACCEPT. The code and docs are accepted. Landing waits on CI: Test Core (8/12) is red and is not caused by this PR (see CI).

Delta read. These are the PR's own commits since 498dd24d, net of the two main merges (cfb766b1, c8f6acd7, both clean, no conflict hunks in PR files): c88729f4 (docs/JSDoc), 51929dc7 (matrix row), df819c4e (ruling B). Net PR diff vs origin/main: 16 files, +521/-83. domains/comments.ts is byte-unchanged since 498dd24d (blob 323bf300). The two os-dev reports are 7361262275 (needs_decision) and 7364382214 (done). Ruling B is recorded in 7363771779 (2026-12-03T00:55Z).

REWORK items, all closed. I re-read each changed sentence against the tree.

  1. Client JSDoc, packages/client/src/index.ts:7476-7481. I checked "Served by @objectstack/plugin-audit on both server shapes: … self-hosted kernel from its own HTTP mount, and on a hosted tenant kernel … through the runtime dispatcher's /comments domain, which forwards the request to the same registration" and "A hosted kernel composed without plugin-audit answers 501 NOT_IMPLEMENTED". Both are true: the 501 is pinned in the conformance file. Changeset L5 has '@objectstack/client': patch. Closed.
  2. Changeset .changeset/39134-hosted-comment-threads-read.md:
    • L16 "the read's own refusals (400, 401 UNAUTHENTICATED, 403 FEEDS_DISABLED, 403 PERMISSION_DENIED, 404 OBJECT_NOT_FOUND) are the same bytes on both shapes": true. This is the 11-case byte-parity set.
    • L17 "a signed-in caller who is not a member … 403 PROJECT_MEMBERSHIP_REQUIRED, which the self-hosted mount does not answer": true, pinned in comments.test.ts and the new dogfood [hosted] case.
    • L17 "a session that still owes a sign-in step is refused 403 with the authentication policy's own code by the dispatcher's gate instead of by the read": true. This is the accepted deviation, not byte-compared.
    • L17 "Stricter … never looser": true.
    • L21 "that clause is gone" and "its JSDoc names both": true.
    • L8-15 and L18-19 are unchanged; they were checked at 498dd24d and still hold.
    • Closed.
  3. content/docs/api/data-api.mdx:
    • L689-693 "Both shapes run the same caller rule, body and the read's own refusals; on the hosted shape the dispatcher's gates run first and stop a held sign-in and a non-member of the environment before the read runs (the last two refusals below)": true.
    • L770-773, the held-sign-in bullet: "403 with the authentication policy's own code. On a hosted tenant kernel the dispatcher's sign-in gate answers it before the read runs". True: the read's own step 1 is evaluateAuthGate at comment-threads-query.ts:765.
    • L774-776, the hosted-only bullet: "a signed-in caller who is not a member of the request's environment, 403 PROJECT_MEMBERSHIP_REQUIRED; a kernel composed without @objectstack/plugin-audit, 501 NOT_IMPLEMENTED". True; self-hosted without plugin-audit mounts nothing.
    • Closed.
    • Correction I accept from the dev (7361262275): my item 3 called the held-sign-in 403 hosted-only. It is not. The read itself refuses it on both shapes (step 1, comment-threads-query.ts:765), and only who answers it differs. The doc now says so correctly.

Out-of-scope items from my L1, closed in-PR under the claim amendments.

  • http-dispatcher.ts:1017-1021 now says "four method and path shapes".
  • The authz-conformance.matrix.ts row is split per ruling B. comment-doors-session goes back to the three doors and keeps the /comments domain key. The new comment-threads-read-session is enforced, with proof comment-threads-query.dogfood.test.ts. That file carries authz-row: comment-threads-read-session, and the row is on HIGH_RISK (authz-conformance.test.ts:907-911).
  • Not having covers is reasoned in the row comment: one domain key belongs to one row. I accept that.

File surface. All 16 changed files are inside the claim as amended. Base claim 7357087993 had 10 files. Amendment 7360285715 adds four: client/src/index.ts, authz-conformance.matrix.ts, http-dispatcher.ts, and the comment-threads-query.ts docblock. Amendment 7363771779 adds two: authz-conformance.test.ts and comment-threads-query.dogfood.test.ts. The comment-threads-query.ts change is docblock-only (the "Where it is served" section, L144-157, whose {@link registerCommentThreadsQueryRoute} resolves to L203), so the handler code is untouched. The dogfood file's fixture plugin (environmentMembersPlugin, a stand-in for cloud-provided sys_environment_member) is added to the shared boot's extraPlugins. The [hosted] membership case needs it, so I accept it. The existing self-hosted cases in that file stay green in the dev's run (18 passed, 6 PG skipped).

[hosted] cases assert status and code (ADR-0112).

  • carol → 403 + error.code === 'PERMISSION_DENIED'.
  • Anonymous → 401 + 'UNAUTHENTICATED'.
  • erin (non-member) → 403 + 'PROJECT_MEMBERSHIP_REQUIRED', plus engineCallsDuring → [] (the read is never planned).
  • The 200 cases assert status plus exact thread ids: admin [d2,d3,d1], row-scoped bob [d2,d1] with record ids, and the member control dee [d2,d3,d1].
  • Pass.

Round-2 ablation is pinned to this head. The mutated file is packages/runtime/src/domains/comments.ts. Its ablation anchor blob 323bf300 equals df819c4e:packages/runtime/src/domains/comments.ts (git rev-parse), and the report names head df819c4e for every run.

  • Positive control: the marker was proven in dist/index.js and .cjs, and three [hosted] cases went red with 404 ROUTE_NOT_FOUND.
  • The non-member assertion stays green under ablation, because the preamble runs before route matching. The member control is what turns that case red. This is stated honestly in the report and the PR body.
  • Restore: blob equals HEAD, rebuilt, --absent clean, 3/3 green.

Gates at df819c4e. Lint & Repo Gates success, TypeScript Type Check success, Type Check · workspace success. Totals: 59 success, 14 skipped, 1 failure, 3 in progress (Test Core 1/12 and 5/12, Check Changeset).

  • The dogfood shards skip on pull_request, so the [hosted] cases and authz-conformance.test.ts first run in CI in the merge queue. Locally they are the dev's reading only: 78 passed and 6 skipped at df819c4e. My own local re-run: NOT MEASURED.
  • CI: the Test Core (8/12) failure is not caused by this PR.
    • Signature: job 143920237180, @objectstack/knowledge-turso src/__tests__/acceptance.test.ts:1585, "Test timed out in 5000ms" (2026-12-03T01:09Z). The package is not in this PR's diff.
    • The signature appears nowhere else I looked:
      • It is not on main. Test Core is success on all 15 latest origin/main commits (1e26342d…724b3695), including 712b1027, the last commit that changed knowledge-turso.
      • The 40 most recent failed ci.yml runs, all branches and merge_group (2026-11-30T10:24Z to 2026-12-02T15:38Z), have 0 failed Test Core jobs whose annotations name knowledge-turso.
    • It reads as a load-timing flake, and one re-run of the shard is justified. Do not enqueue until Test Core 1/12, 5/12, 8/12 and Check Changeset are green on this head.

Body and keywords. Fixes #39134 is still the first line. I scanned the body by eye: no other card number sits next to a closing keyword. Patch-round sections 1 and 2 are appended and the first two lines are kept, which answers the dev's open question 0 with option A. The PR is still draft.

Notes, no action. Both dev reports carry git-answerable reads (card comments, check-runs), which is fine; they include no list_issues. Round 2's local gate run was narrowed to the 43 families mapped to its 3 files, and the narrowing is declared. CI carries the rest.

Seat landing note (2026-12-03T02:02Z)

  • Gates at df819c4e: 64 success, 14 expected skip, 0 failed, 0 pending (l1-face CLEAN; Lint & Repo Gates and TypeScript Type Check success). Test Core (8/12) re-run once on the flake note 7364575773 (knowledge-turso timeout, package outside the diff): green on attempt 2. mergeable_state clean.
  • Contract review: delta record 7364470514 (CONTRACT_REVIEW_TIER, PASS; S1 and N1–N3 closed) on this head.
  • Ruling: B, recorded 7363771779. check-governed-merges --pr 39174: NOT governed, +521/-83 ≤ 3000. landing-k: K = 6 < 15.
  • The [hosted] dogfood cases and authz-conformance.test.ts run first in the merge queue (dogfood shards skip on pull_request); the dev's local run at this head is 78 passed, 6 skipped (PostgreSQL cell).
  • Landing: zone lands (non-governed); ready + auto-merge in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 3, 2026 02:03
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 93a189f Dec 3, 2026
124 of 126 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-g3jayi branch December 3, 2026 02:35
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/l 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.

Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain

2 participants