Repository navigation
feat(plugin-audit,spec,client): one read returns the comment threads on the records a list filter selects, as the caller - #39135
Conversation
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
…omment registrar Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
…QLite Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
…reads read Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
…stgreSQL with the security service Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
…rt from the gate's own probe Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
…as a client test input Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz |
📓 Docs Drift CheckThis PR changes 4 package(s): 42 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 16 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 193 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 8d2743f5b1e6fa48c0a59e903f1fe9cf24a656af && git checkout 8d2743f5b1e6fa48c0a59e903f1fe9cf24a656af
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2 750a1ead4730fd5154efafc8b2fb98575714fbd6 && git checkout -B drift-repro ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2 && git merge --no-ff 750a1ead4730fd5154efafc8b2fb98575714fbd6
node scripts/docs-audit/affected-docs.mjs --json ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2
|
…pec minor The request and response schemas enter the api authorable-surface shard, which the changeset level axis reads as added keys. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz Contract reviewServed-tier: Inputs read: card #39084 body and all seven comments (ruling-ref 7338433362, carried notes 7341533575 and 7343013270, claim 7343360143, amendment 7346184382, dev report 7346297898); epic #39077 sections 2 to 5, 7, 8, 11, 13 (S3), 14 and ruling 7338398195; the PR body, its 31-file list and the net diff against Check-runs on ① Derived judgments
② Semver levelClause-②: yes (widening): right, on the PR body and the changeset. Nothing is narrowed or removed.
③ Boundary flags
④ Design judgmentpackages/spec/src/api/comment-threads.zod.ts against ruling 7338398195 (items 1 to 3), epic section 5 "Shape of A" and its first consumer The shape is the ruled one: strict body, M1 (must-fix) — a filter array the list read refuses is silently NOT applied, and the read answers the threads of every record the caller can read. S1 (should-fix) — "a N1 (nit) — N2 (nit) — the keyset compares at millisecond precision ( N3 (nit) — the card body and claim still read N4 (nit) — handler header step 2 says anything else is Probed and held: packages/spec/src/api/index.ts — one packages/plugins/plugin-audit/src/comment-threads-query.ts — sentence by sentence against the schema header: steps 1, 3, 4, 5, 6 agree. Step 2 disagrees twice: M1 (filter) and S1 (cursor). Caller resolution, anonymous denial and the held sign-in gate are the resolution door's own lines ( comment-routes.ts, comment-route-ledger.ts, audit-plugin.ts, plugin-audit index.ts — the registrar mounts the read with the same engine and caller resolver, per request; the ledger row and its header agree with the client; the boot lines say where the read is and is not served. Hold. packages/client/src/index.ts — Outside ④ (lane seat's ACCEPT at TIER_DEFAULT): the three test files, the dogfood file, the generated shards and reference pages, M1 is a FAIL. M1 and S1 each earn a delta review of their fix. Implemented-by: VERDICT: FAIL |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz Contract review brief — PR #39135 @
|
…t lower and a cursor with no instant L2 round 1 on #39135 (M1, S1, N4). A filter array the list read cannot lower ([5], an infix join, a malformed child of an and/or node) used to lower to nothing and answer every record the caller reads; it is now INVALID_FILTER / 400, as GET /data/{object} answers it. A well-formed cursor whose creation time is no instant is VALIDATION_ERROR / 400 in the decoder instead of reaching the engine's temporal door. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz Contract reviewServed-tier: Delta review, round 2, of the round-1 record on Check-runs on ① Derived judgments
② Semver levelUnchanged and right: ③ Boundary flags
④ Design judgmentpackages/spec/src/api/comment-threads.zod.ts and packages/spec/src/api/index.ts — unchanged in this delta. The schema header's refusal list ("Refusals, before anything is read") still does not name the filter refusal that the changeset and packages/plugins/plugin-audit/src/comment-threads-query.ts M1: closed. S1 (should-fix) — closed for the two cases round 1 named, still open for the class. N5 (nit) — the schema header's refusal list does not mention the N1, N2 (nits) — unchanged from round 1: the unbounded reply read with its stated reason, and millisecond keyset precision against rows written by the database default. Follow-up cards, not this PR. No must-fix. One should-fix, S1, open on this head; it earns a delta review of its fix. Implemented-by: VERDICT: PASS |
…at the encoder writes L2 round 2 on #39135 (S1, N5). A decodable cursor carrying a filter placeholder ({not_a_token}, {30_days_ago}) or blank text in its creation time or id reached the engine's token resolver as a filter the client never wrote; it is now VALIDATION_ERROR / 400 in the decoder. The schema header names the INVALID_FILTER filter refusal. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz Contract reviewServed-tier: Delta review, round 3, of the round-2 record on Check-runs on ① Derived judgments
② Semver levelUnchanged and right: ③ Boundary flags
④ Design judgmentpackages/spec/src/api/comment-threads.zod.ts — the header's refusal paragraph now says a packages/spec/src/api/index.ts — unchanged. Holds. packages/plugins/plugin-audit/src/comment-threads-query.ts S1: closed.
M1: closed (round 2); N1, N2 (nits) — unchanged: the unbounded reply read with its stated reason, and millisecond keyset precision against rows written by a database default outside the driver. Follow-up cards, not this PR. The other implementing files are unchanged and hold as judged in round 1. Outside ④ (lane seat's ACCEPT at TIER_DEFAULT): the test file, the regenerated reference page. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
…ad component beside the spec's CommentThread entry #39084 adds CommentThread to @objectstack/spec/api (one entry of the comment threads read's answer). @object-ui/collaboration publishes a React component of the same name; two layers, so an ALLOW entry with the reason, as EmptyState's. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz Contract reviewServed-tier: Delta review, round 4, of the round-3 record on Check-runs. On ① Derived judgments
② Semver levelUnchanged and right: ③ Boundary flags
④ Design judgmentpackages/spec/src/api/comment-threads.zod.ts and packages/spec/src/api/index.ts — unchanged in this delta; hold as judged in rounds 1 to 3. The question this round puts to them is the name: should ui/scripts/check-spec-symbol-derivation.mjs — the entry against the guard's own rule and its precedents. The guard exists to stop a local type or const that hand-copies a spec symbol under the spec's name. N6 (nit) — the reason's last clause, "the list-page comments card that consumes the read imports the spec type under an alias", states as fact what a later card (U3) has not yet written. It is an intent, not something this tree shows. Reword to "can import" when the file is next touched, or leave; no effect on the guard. The other implementing files are unchanged and hold as judged in rounds 1 to 3. M1, S1 and N5 remain closed. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review — ACCEPT on
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS 席位核对ACCEPT — PR #39135 @
落地
State change: ready for review + auto-merge, by the owning seat; on merge it closes #39084. |
Requested by Yibo Wang · project thread
Fixes #39084
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — the added keys are the request and response shape of one built-in REST read on the api shard, not anything a metadata author writes in an object, view or app, so no authoring skill teaches them; the read is documented in content/docs/api/data-api.mdx and the generated reference page, and the list-page UI card (U3) is its consumer
维护者速读
What changes
@objectstack/spec—packages/spec/src/api/comment-threads.zod.ts: strictCommentThreadsQueryRequestSchema(object,filterin theGET /data/{object}syntax,showResolved,onlyMine,limit1..COMMENT_THREADS_MAX_LIMIT, opaque keysetcursor) andCommentThreadsQueryResponseSchema(threads[]of{ comment, record: { id, name }, replyCount, repliers[≤3] },nextCursor), limits as exported constants. Generated artifacts regenerated (see Verification).@objectstack/plugin-audit— newcomment-threads-query.tsservesPOST /api/v1/comments/threads/queryfromregisterCommentDoorsRoutes, steps 1–6 of the epic's §5, every read as the caller:parseFilterASTtakes — else400 VALIDATION_ERRORbefore the engine is asked anything;get, notsys_comment,enable.feeds !== false(else403 FEEDS_DISABLED);ObjectQL#planReadScope(sys_comment, object, { where: filter, context }), planned per request and never cached (two-user pin), its refusals are the answer (PERMISSION_DENIED,INVALID_FILTERon MongoDB/OData);findonsys_comment: object, scope, top-level, unresolved unlessshowResolved,participants $contains callerwhenonlyMine, keyset after the cursor, newest first by(created_at, id),limit + 1; the comment read gate ANDs its condition as on any read;POST /api/v1/comments/threads/query→sdk,comments.queryThreads; conformance test updated.@objectstack/client—client.comments.queryThreads; the URL-conformance sweep now reads the comment route ledger (soturbo.jsonandscripts/cross-package-test-inputs.mjsdeclare it as a client test input).@objectstack/objectql— exports thePlanReadScopeOptionsandReadScopeComparandtypes (N3 of 7341533575).content/docs/api/data-api.mdx;packages/spec/llms.txtcounts; a changeset:minoron@objectstack/spec(Metadata-protocol: added, because the new schemas enter theapiauthorable-surface shard, the precedent of feat(spec,rest): the record page payload answers the data lock read, so a record page learns a closed record in its one request #38999),patchon objectql, plugin-audit and client. The claim saidnone; the Check Changeset gate on cb3695e read the shard as added keys, and commit fb20c06 corrects the declaration.Why
Epic #39077 S3 (rulings 7338398195: a dedicated read; "current view" = saved filter + temporary filters, the search box not counted). The list page's comment panel (U3) needs the threads of the view's records in one request, correct on a view of any size, with the same refusals a list read gives and no new read authority.
Acceptance notes
Where each card bullet is pinned (HTTP =
packages/qa/dogfood/test/comment-threads-query.dogfood.test.ts, booted stack with the real SecurityPlugin; engine =comment-threads-query.integration.test.tsand the dogfood file's engine cells):showResolved/onlyMine: HTTP tests 3 and 4, engine.limit+cursorwalk every thread once while a comment is posted between pages: HTTP test 5, plus an engine test with acreated_attie.limitout of range →400 VALIDATION_ERRORand the engine never called (spy): HTTP test 6. Filter on an unreadable field →PERMISSION_DENIED: HTTP test 7. Feeds off → 403; anonymous → 401: HTTP test 8.ERROR_CODE_LEDGERdiff is empty.planReadScopecall order BOB, ALICE, BOB, ALICE). Ablation: caching the planned scope in a module-level??=turns the unit test red.Deviations and notes:
http.server); the hosted dispatcher's/commentsdomain does not claim it, and the boot log says so. Seat ruling on hand-back; follow-up Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134 serves it on the hosted kernel. "Advertised wherever the comment doors are advertised and nowhere it is not mounted" holds:packages/runtime/src/domains/comments.tsis untouched.parent_id: a count "at any depth" needs each reply's thread root, which a grouped count overparent_iddoes not give for nested replies.sys_commentwants an index leading with(object_name, created_at)for this read — no plan was read on PostgreSQL or SQLite, andsys-comment.object.tsis outside this card's claim.OS_TEST_POSTGRES_URLis set; no CI job provisions it, so they are not measured in CI. Local run on PostgreSQL 16.15 (/usr/lib/postgresql/16/bin, throwaway server on 127.0.0.1:54391) at head c4d4266:OS_TEST_POSTGRES_URL=… pnpm --filter @objectstack/dogfood exec vitest run test/comment-threads-query.dogfood.test.ts→ 17 passed (17), including 4 live-postgres tests.Verification
@objectstack/plugin-audit118 files / 1944 tests passed;@objectstack/client60 / 841;@objectstack/objectql646 / 14685;@objectstack/spec922 / 29119 (1 todo); the dogfood file 17 / 17 with PG. New suites:comment-threads-query.test.ts(19),comment-threads-query.integration.test.ts(7),comment-threads.test.ts(9), ledger conformance (+1), client URL conformance (+2).lowerThreadsFilterrefuses such a filterINVALID_FILTER/ 400 asGET /data/{object}does, and the cursor decoder accepts only what the encoder writes. After them,comment-threads-query.test.tshas 21 tests and the integration file 7, 28 of 28 passing. Ablation against the previous source fails the new cases. Typecheck and eslint are clean. Nits N1 (a stored thread root, so reply counts need no in-app walk) and N2 (the microsecond keyset edge on PostgreSQL) are filed as follow-up Comments: the comment threads read counts replies without reading every reply, and its keyset holds at PostgreSQL microsecond precision #39142 (Part of 专题:列表页右上角的评论入口——看当前视图里各条记录的评论串,可回复、可解决,不能写新评论 #39077, p2, area:data), per seat amendment 7347081374. r4 PASS on 750a1ea accepts the one ui file below.ui/scripts/check-spec-symbol-derivation.mjs(seat amendment 7347081374): the new spec exportCommentThreadcollides with@object-ui/collaboration's published React componentCommentThread. The two are different layers, so the fix is one ALLOW entry with its reason, asEmptyStatehas; the seat ruled ALLOW over a rename. The guard passes, and its 8 test files pass 195 of 195. A UI consumer (U3) imports the spec type under an alias.--max-warnings=0over the changed sources passes.node scripts/pm/dispatch-gates.mjs --ran: 127 of 127 derived families run.check:llms-txtandcheck:cross-package-test-inputswere red until the amendment commit and pass on this head.Generated outputs (written by the generators, never by hand)
packages/spec/authorable-surface/api.json,declaration-map/api.json,api-surface/api.json,export-origins/api.json,json-schema.manifest/api.json,packages/spec/docs/references/api/comment-threads.md(the generator's path; the claim namedcontent/docs/references/api/),packages/spec/docs/references/README.md,packages/spec/docs/references/api/README.md,content/docs/references/index.mdx,docs/audits/2026-07-unknown-key-strictness-ledger.counts/api.md.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (eslint on changed files).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz