Skip to content

feat(plugin-audit,spec,client): one read returns the comment threads on the records a list filter selects, as the caller - #39135

Merged
objectstack-fleet[bot] merged 14 commits into
mainfrom
claude/project-thread-nfg4vp
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 14 commits into
mainfrom
claude/project-thread-nfg4vp

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

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: strict CommentThreadsQueryRequestSchema (object, filter in the GET /data/{object} syntax, showResolved, onlyMine, limit 1..COMMENT_THREADS_MAX_LIMIT, opaque keyset cursor) and CommentThreadsQueryResponseSchema (threads[] of { comment, record: { id, name }, replyCount, repliers[≤3] }, nextCursor), limits as exported constants. Generated artifacts regenerated (see Verification).
  • @objectstack/plugin-audit — new comment-threads-query.ts serves POST /api/v1/comments/threads/query from registerCommentDoorsRoutes, steps 1–6 of the epic's §5, every read as the caller:
    1. caller resolution; anonymous 401; held sign-in 403;
    2. no query parameter, strict body, a cursor this read issued, a filter parseFilterAST takes — else 400 VALIDATION_ERROR before the engine is asked anything;
    3. object registered, served by the data door for get, not sys_comment, enable.feeds !== false (else 403 FEEDS_DISABLED);
    4. 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_FILTER on MongoDB/OData);
    5. ONE find on sys_comment: object, scope, top-level, unresolved unless showResolved, participants $contains caller when onlyMine, keyset after the cursor, newest first by (created_at, id), limit + 1; the comment read gate ANDs its condition as on any read;
    6. the page's replies (author columns and parent pointer only, keyset-paged, as the caller) for reply count at any depth and the latest three distinct repliers, and one read of the object for the page's record display names (ADR-0079).
  • Ledger row 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 (so turbo.json and scripts/cross-package-test-inputs.mjs declare it as a client test input).
  • @objectstack/objectql — exports the PlanReadScopeOptions and ReadScopeComparand types (N3 of 7341533575).
  • Docs: a section in content/docs/api/data-api.mdx; packages/spec/llms.txt counts; a changeset: minor on @objectstack/spec (Metadata-protocol: added, because the new schemas enter the api authorable-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), patch on objectql, plugin-audit and client. The claim said none; 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.ts and the dogfood file's engine cells):

  • 3 of 5 records selected → only their top-level open threads, newest first, record id + name, reply count, ≤3 latest repliers: HTTP test 1, engine.
  • A member who cannot read one of the 3 → its threads omitted; no read on the object → that read's own refusal: HTTP test 2, engine cells on SQLite and PostgreSQL.
  • showResolved / onlyMine: HTTP tests 3 and 4, engine.
  • limit + cursor walk every thread once while a comment is posted between pages: HTTP test 5, plus an engine test with a created_at tie.
  • Unknown key, any query parameter, limit out of range → 400 VALIDATION_ERROR and 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.
  • A view larger than the id cap answered in full with ONE threads statement carrying the planned read: HTTP test 9 on SQLite (1,005 records, driver statement log), and engine cells on SQLite and PostgreSQL.
  • No new error code: ERROR_CODE_LEDGER diff is empty.
  • Two-user per-request pin (7343013270): unit test "two users through one door" and the engine cells (planReadScope call order BOB, ALICE, BOB, ALICE). Ablation: caching the planned scope in a module-level ??= turns the unit test red.

Deviations and notes:

  • Self-hosted only. The read is mounted where the comment registrar mounts (http.server); the hosted dispatcher's /comments domain 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.ts is untouched.
  • HTTP fixture: the dogfood file uses its own inline stack rather than the showcase, because the acceptance needs a row-scoped persona, a persona with an unreadable field and one with no read on the object, which the showcase's fallback permission set makes impossible.
  • Reply counts come from the page's replies read as the caller (keyset-paged, author columns only), not a grouped count by parent_id: a count "at any depth" needs each reply's thread root, which a grouped count over parent_id does not give for nested replies.
  • Not measured: whether sys_comment wants an index leading with (object_name, created_at) for this read — no plan was read on PostgreSQL or SQLite, and sys-comment.object.ts is outside this card's claim.
  • PostgreSQL (N5 of 7341533575): the PG cells run where OS_TEST_POSTGRES_URL is 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.
  • Claim 7343360143, amendment 7346184382 (llms.txt, the two test-input declarations, generator outputs).

Verification

  • @objectstack/plugin-audit 118 files / 1944 tests passed; @objectstack/client 60 / 841; @objectstack/objectql 646 / 14685; @objectstack/spec 922 / 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).
  • L2 rounds (records on this PR): r1 FAIL on fb20c06 (M1: a filter array the list read cannot lower was dropped, answering every readable record; S1: a decodable cursor with no instant reached the engine). r2 PASS on 7b0b230 with S1 open for placeholders. r3 PASS on 809a6e1, no must-fix and no should-fix. The fixes: lowerThreadsFilter refuses such a filter INVALID_FILTER / 400 as GET /data/{object} does, and the cursor decoder accepts only what the encoder writes. After them, comment-threads-query.test.ts has 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 export CommentThread collides with @object-ui/collaboration's published React component CommentThread. The two are different layers, so the fix is one ALLOW entry with its reason, as EmptyState has; 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.
  • Typecheck passes for spec, plugin-audit, client, objectql and dogfood; ESLint --max-warnings=0 over the changed sources passes.
  • node scripts/pm/dispatch-gates.mjs --ran: 127 of 127 derived families run. check:llms-txt and check:cross-package-test-inputs were 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 named content/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

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (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: its generated artifacts are regenerated and committed.
  • 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_01WGufzfHCzQWh6PeQnvToFz

claude added 10 commits December 2, 2026 11:12
…omment registrar

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
…as a client test input

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfHCzQWh6PeQnvToFz
@github-actions github-actions Bot added size/xl 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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz
Contract-review-claim: session_01WGufzfHCzQWh6PeQnvToFz · head cb3695e · 2026-12-02T13:04Z

@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/objectql, @objectstack/plugin-audit, @objectstack/spec, touching 76 documentable anchor(s). ⚠️ 10 changed file(s) yielded no anchor (packages/objectql/src/index.ts, packages/spec/api-surface/api.json, packages/spec/authorable-surface/api.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

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

What this run could not see
  • 10 changed file(s) yielded no anchor (packages/objectql/src/index.ts, packages/spec/api-surface/api.json, packages/spec/authorable-surface/api.json, …) — pages documenting those are invisible to this run
  • 3 anchor(s) matched too much of the corpus to be a work list: VALIDATION_ERROR (literal, 40 pages), created_at (literal, 49 pages), /data/{object} (route, 81 pages)
  • 4 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 — 193 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 ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8d2743f5b1e6fa48c0a59e903f1fe9cf24a656af — the merge of head 750a1ead4730fd5154efafc8b2fb98575714fbd6 into base ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2, 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 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

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

…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz
Contract-review-claim: session_01WGufzfHCzQWh6PeQnvToFz · head fb20c06 · 2026-12-02T13:08Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: fb20c06f843a35546e671fa1460060a59c4b0fb1
Local-runs: none
Scope: packages/spec/src/api/comment-threads.zod.ts, packages/spec/src/api/index.ts + packages/plugins/plugin-audit/src/comment-threads-query.ts, packages/plugins/plugin-audit/src/comment-routes.ts, packages/plugins/plugin-audit/src/comment-route-ledger.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/index.ts, packages/client/src/index.ts, packages/objectql/src/index.ts
Security-touching: yes
Rule-change-verified: none

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 main. The review started on cb3695e7 and moved to fb20c06f when the head moved; git diff cb3695e7 fb20c06f is the changeset file alone (3 lines), so everything read at cb3695e7 outside that file is the tree at this head. Read, not reviewed: packages/objectql/src/engine-query-lowering.ts (planReadScope), engine-top-level.ts (the where lowering seam), temporal-comparand-door.ts, packages/spec/src/data/filter.zod.ts (parseFilterAST, lowerFilterAST), sys-comment.object.ts, comment-doors-member.ts, the driver's NOW() default code, AGENTS.md Finish-work item 3.

Check-runs on fb20c06f at read time (not waited for): success: Governed Surface Queue Guard, Check PR Size, Check Documentation Links. In progress: Check Changeset, Spec property liveness, Flag docs affected by code changes, PR-body guards, filter, Auto Label, every Lint and Type Check job. Skipped: the opt-in dogfood, tarball and upgrade jobs, Queue verdict, Borrowed queue verdict, Schedule gate. One earlier PR-body guards run reads cancelled (superseded by the run in progress). No gate verdict on the code jobs exists yet on this head; on cb3695e7 the same jobs were also still running. This record does not stand in for them.

① Derived judgments

  • New public route POST /api/v1/comments/threads/query, owner plugin-audit, family comments, ledger row sdk naming comments.queryThreads: right. No method or path collision with the three existing comment doors (PUT and DELETE only).
  • Closed query-parameter set (empty) refused on the day the route lands: right (AGENTS.md route rule 5).
  • New spec exports: CommentThreadsQueryRequestSchema, CommentThreadRecordSchema, CommentThreadReplierSchema, CommentThreadSchema, CommentThreadsQueryResponseSchema, their input and parsed types, and four limit constants; re-exported from packages/spec/src/api/index.ts. All strict, limits as constants as the card asks: right. The 17 keys entering authorable-surface/api.json follow from them.
  • Accept-set of the request: object (non-empty string), filter (z.unknown()), two booleans, limit 1..50 integer, cursor 1..512 chars. Right for the schema; the handler does NOT hold the accept-set the schema header and its own header state for filter and cursor: wrong, see M1 and S1 in ④.
  • New SDK member client.comments.queryThreads and two re-exported types: right, and matches the ledger row.
  • New @objectstack/objectql type exports PlanReadScopeOptions, ReadScopeComparand (N3 of 7341533575): right; types only, no wire spelling, the planning symbol stays private.
  • New @objectstack/plugin-audit exports COMMENT_THREADS_QUERY_ROUTE, queryCommentThreads, CommentThreadsEngine, CommentThreadsQueryDeps: a public in-process entry the card did not ask for. Accepted as widening only; note that queryCommentThreads is exported with M1 in it.
  • Hosted kernel: not mounted and not advertised there (comment-doors-member.ts matches three routes only; packages/runtime/src/domains/comments.ts untouched), boot line says so, follow-up Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134: right against "advertised nowhere it is not mounted". The SDK method answers the transport's 404 on a hosted kernel until Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134.
  • No new error code: right; every code thrown exists.

② Semver level

Clause-②: yes (widening): right, on the PR body and the changeset. Nothing is narrowed or removed.

Metadata-protocol: added, @objectstack/spec minor, @objectstack/objectql, @objectstack/plugin-audit, @objectstack/client patch (the correction at fb20c06f): right. AGENTS.md Finish-work item 3: a kind takes at least minor on a package the diff moves, a non-protocol widening ships patch. The new schemas add keys to packages/spec/authorable-surface/api.json, which is what the level axis reads; the merged precedent #38999 (record page payload, same shard) declared the same pair. The PR body and the changeset agree with each other and the changeset states why. The three other packages carry no authorable key and stay patch: right. Check Changeset was still running on this head at read time; its conclusion is the gate verdict.

③ Boundary flags

  • open_questions: empty. security_findings: none reported; M1 below is a correctness finding on the read's scope, inside the caller's own read authority.
  • Dev deviation, self-hosted mount only: answered by the seat ruling in amendment 7346184382 and Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134. Accepted.
  • Dev deviation, inline dogfood stack instead of the showcase: accepted; the acceptance needs a no-read persona the showcase fallback set cannot give. Lane seat's ACCEPT.
  • N5, PostgreSQL not measured in CI: recorded by the dev with the local run named, as 7341533575 allows. Accepted as recorded; it stays not measured in CI.
  • 7343013270, plan per request, never cached: holds in the tree. queryCommentThreads calls planReadScope inside the request and places the comparand under the same context; the module holds no state. Two-user pin present.
  • Index on (object_name, created_at) not measured: epic section 8 asked the backend card to read the plan. Carried as the dev's out-of-scope note; sys-comment.object.ts is outside the claim. Follow-up, not a finding on this diff.
  • SQL push-down. The threads statement is one statement carrying the planned leaf: right. Record names: one bounded id $in read of at most 50 ids: right. Replies: readReplies materialises every reply on the page's records (all threads on those records, resolved or not, on the page or not) in pages of 1,000 and counts in the application, where the epic's step 6 named one grouped count by parent_id plus one bounded read. A reason is given (a count at any depth needs each reply's top-level ancestor, and no stored root pointer exists; thread_id is per record, checked in sys-comment.object.ts), and it holds, so this is not graded above a nit. See N1.

④ Design judgment

packages/spec/src/api/comment-threads.zod.ts against ruling 7338398195 (items 1 to 3), epic section 5 "Shape of A" and its first consumer comment-threads-query.ts.

The shape is the ruled one: strict body, object, filter, showResolved, onlyMine, limit 1..50 default 25, opaque keyset cursor; answer threads[] of comment, record id and name, replyCount, at most three repliers, nextCursor. Search is not a key, as ruling item 3 says. The header's "as the caller, every step" holds in the handler: no system read anywhere, every find carries the caller's context, the comparand is placed under the context it was planned under. Two sentences of the header do not hold in the code that serves it:

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. queryCommentThreads (lines 238 to 250) calls parseFilterAST and treats undefined as "no filter" (lines 275 to 278 then omit where). lowerFilterAST in packages/spec/src/data/filter.zod.ts returns undefined not only for an absent or empty filter but for any array that is none of its shapes (its last line): [5], [{"status":"open"}], the infix join [condA, "or", condB], ["or", [5]]; and it drops a malformed child of an and/or node, so ["and", [5], ["status","=","open"]] runs as the second condition alone. The engine's own seam exists to refuse exactly this (engine-top-level.ts, the isFilterAST check: "This value cannot be lowered, and an unapplied filter would have returned the UNFILTERED result set", INVALID_FILTER / 400), and GET /data/{object} refuses the same arrays. Here the pre-parse swallows the value before the engine ever sees it. That breaks the schema's "filter ... can only narrow the records", the header's "the records that filter selects", and the handler header's step 2 ("the filter must be one the list read's own lowering takes"). The answer stays inside the caller's read scope, so nothing unreadable leaks; it is a wrong, wider answer given with a 200, on a published route, for an input class the repo refuses at every other door. The existing test covers only a throwing comparison ([['status','between']]), not the undefined path. Fix shape: refuse when a present, non-empty filter lowers to nothing or fails isFilterAST (both exported from @objectstack/spec/data), or hand the raw filter to planReadScope and let the engine's seam refuse; pin [5], the infix join and a dropped child.

S1 (should-fix) — "a cursor the server did not issue is VALIDATION_ERROR / 400", listed under "Refusals, before anything is read" (schema header; restated in the changeset and the handler header), is true only for a string that fails to decode. decodeThreadsCursor accepts any base64url of a two-string JSON array. A decodable cursor whose first member is not an instant (the unit test's own encodeThreadsCursor({ createdAt: 'x', id: 'y' }) before it is corrupted) passes, the object is resolved, the scope is planned (an id read of the object in the fallback classes), and the threads find is then refused by the engine's temporal comparand door with INVALID_FILTER / 400 and a message about a created_at condition the client never wrote. Wrong code, wrong moment, misleading message, against a sentence of the published contract. A well-formed forged cursor with a real instant is only a keyset position inside the caller's own scope and is harmless; the header's "did not issue" overstates what is checked. Fix shape: validate the decoded creation time as an instant in decodeThreadsCursor (and say "not a cursor of this read" rather than "issued"), pin the decodable-but-invalid case.

N1 (nit) — readReplies is unbounded in the number of replies on the page's records (one statement per 1,000 replies, all held in memory), where epic section 8 budgets four statements per page. Reason given and sound (see ③). Follow-up card: a stored thread-root pointer makes the count a grouped aggregate; until then a noisy record costs every panel page that shows it.

N2 (nit) — the keyset compares at millisecond precision (instantText goes through a Date), and a PostgreSQL timestamptz holds microseconds. Rows the engine or driver writes are stamped in the application at millisecond precision, so the walk is exact for them; a row written by the column's database default (raw SQL, an import outside the driver) can sit between two millisecond values and be skipped at a page edge. Not reachable through the platform's own writes; left as stated.

N3 (nit) — the card body and claim still read Metadata-protocol: none; the PR body and changeset now read added. The PR is right (②); the card line is stale prose.

N4 (nit) — handler header step 2 says anything else is VALIDATION_ERROR; a filter the lowering refuses answers the lowering's own code (INVALID_FILTER). The code is the better answer; the sentence is loose. Fold into the M1 fix.

Probed and held: is_resolved: { $ne: true } matches rows with no value (stated in sys-comment.object.ts); participants $contains is element membership on the stored list (S2); a title field the caller cannot read is masked by the read, not refused, so the "Record # and the id" floor in CommentThreadRecordSchema is what happens; sys_comment as object is refused before any registry read; the feeds and data-door checks run before planReadScope; replies whose chain leaves the rows read count in no thread; a thread on the page whose record name is not read falls to the floor, never to another record's name.

packages/spec/src/api/index.ts — one export * line beside record-page.zod, no name collision in the generated api-surface and export-origins shards. Holds.

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 291 to 308), same order.

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 — comments.queryThreads posts the request as the body to the ledger's URL and unwraps data; its jsdoc matches the schema. Holds. packages/objectql/src/index.ts — two type exports, comment accurate. Holds.

Outside ④ (lane seat's ACCEPT at TIER_DEFAULT): the three test files, the dogfood file, the generated shards and reference pages, content/docs/api/data-api.mdx, llms.txt, turbo.json, scripts/cross-package-test-inputs.mjs, the changeset prose.

M1 is a FAIL. M1 and S1 each earn a delta review of their fix.

Implemented-by: claude/project-thread-nfg4vp
Reviewed-by: session_01WGufzfHCzQWh6PeQnvToFz

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz

Contract review brief — PR #39135 @ cb3695e7f430db4e95d734e073c3f57e24e8ae69 (card #39084)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/api/comment-threads.zod.ts packages/spec/src/api/index.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #39084: its body and EVERY comment (rulings and earlier records included)
· PR #39135: its body, its file list, and the net diff against main at cb3695e7f430db4e95d734e073c3f57e24e8ae69
· the check-runs on cb3695e7f430db4e95d734e073c3f57e24e8ae69: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/api/comment-threads.zod.ts, packages/spec/src/api/index.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-claude/75226fe0-d8c4-5af3-a5a6-e16efa869b7e/scratchpad/pr-39135/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz
Contract-review-claim: session_01WGufzfHCzQWh6PeQnvToFz · head 7b0b230 · 2026-12-02T13:14Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7b0b23007a43d5bb5b53db88fa12cee68128049d
Local-runs: none
Scope: packages/spec/src/api/comment-threads.zod.ts, packages/spec/src/api/index.ts + packages/plugins/plugin-audit/src/comment-threads-query.ts, packages/plugins/plugin-audit/src/comment-routes.ts, packages/plugins/plugin-audit/src/comment-route-ledger.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/index.ts, packages/client/src/index.ts, packages/objectql/src/index.ts
Security-touching: yes
Rule-change-verified: none

Delta review, round 2, of the round-1 record on fb20c06f (FAIL: M1, S1). The head was confirmed on the PR. git diff fb20c06f 7b0b2300 is one commit over four files: comment-threads-query.ts (+80/-19 with its test), content/docs/api/data-api.mdx, the changeset body. The two hits files, the client, the objectql export, the ledger, the registrar and audit-plugin.ts are byte-identical to the head round 1 judged, so round 1's ①, ② and ④ stand for them and are not repeated. Read, not reviewed, for this round: isFilterAST and lowerFilterAST in packages/spec/src/data/filter.zod.ts, isUninterpretableTemporalComparand and its placeholder table in packages/core/src/utils/temporal-comparand.ts, packages/objectql/src/temporal-comparand-door.ts.

Check-runs on 7b0b2300 at read time (not waited for): success: Governed Surface Queue Guard, Check PR Size, Check Documentation Links, PR-body guards. In progress: Check Changeset, Spec property liveness, Flag docs affected by code changes, filter, Auto Label, all eight Lint jobs and all four Type Check jobs. Skipped: the opt-in jobs, Queue verdict, Borrowed queue verdict, Schedule gate. No code-gate verdict exists yet on this head; this record does not stand in for one. The dev's local runs (28 of 28, ablation, typecheck, eslint) are the dev's statement and were not re-run here.

① Derived judgments

  • Accept-set of filter at the handler, narrowed by the fix to what the list read takes: absent, null and [] are no filter; a filter object passes to the engine's own doors; an array must satisfy isFilterAST and lower to a condition; any other value is INVALID_FILTER / 400 before the engine is asked. Right, and now equal to the schema's "can only narrow". Nothing that was correctly answered before is refused now: every array isFilterAST takes lowers every child, so the last lowers to no condition arm is a backstop, not a new refusal class.
  • Accept-set of cursor: additionally refuses a creation time the datetime rule cannot read. Right as far as it goes; it does not yet reach every decodable non-instant, see S1.
  • New export lowerThreadsFilter from the module (not re-exported from the package index): module-internal test seam. Right.
  • No change to the published schema, the route, the ledger, the SDK or any error code. INVALID_FILTER exists. Right.

② Semver level

Unchanged and right: Clause-②: yes (widening), Metadata-protocol: added, @objectstack/spec minor, the other three patch (round 1, ②). The fix narrows nothing published: the route has not shipped, and the refused values were never a declared capability. The changeset body gains the filter refusal sentence, accurate against the code. Check Changeset still running at read time.

③ Boundary flags

  • Round-1 findings: M1 and S1 answered below. N4 fixed in prose (handler header step 2 now names INVALID_FILTER). N1, N2 unchanged, left as follow-up candidates by the dev: accepted as nits. N3 (card body still reads Metadata-protocol: none) goes to the seat: accepted.
  • Dev note, dogfood file not re-run after the fix: it posts only array filters isFilterAST takes and no forged cursor, so the fix cannot change its answers by reading; the CI dogfood job is the verdict. Lane seat's ACCEPT.
  • SQL push-down: the fix adds no read and no materialisation; both refusals run before getSchema. Nothing new.
  • open_questions: none carried.

④ Design judgment

packages/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 data-api.mdx now state; the header is not wrong, it is silent, and filter's own description covers the intent. Nit, N5.

packages/plugins/plugin-audit/src/comment-threads-query.ts

M1: closed. lowerThreadsFilter was read against each shape round 1 named and against isFilterAST: [5], [{"status":"open"}], the infix join, ["or", [5]] and ["and", cond, [5]] all fail isFilterAST (a non-array child fails the recursive test, so no child can be dropped) and are refused INVALID_FILTER / 400 before any engine call; a scalar is refused by the typeof arm; an unknown operator by isFilterAST; undefined, null and [] plan with no where, the engine's own reading of them. The object form still goes through parseFilterAST's comparand doors and then the engine's. The refusal message echoes only the caller's own filter. Pins present for every case, including the positive control that the prefix or lowers to $or. The header's step 2 agrees with the code sentence by sentence.

S1 (should-fix) — closed for the two cases round 1 named, still open for the class. decodeThreadsCursor now asks isUninterpretableTemporalComparand('datetime', createdAt), which refuses x and 2026-13-45T99:00:00Z. But that function deliberately answers false for a placeholder string: its table marks date-macro, unknown and record-context tokens as stepped around, because the token resolver has the last word on them. So a decodable cursor whose creation time is {not_a_token} still passes the decoder, the object is resolved and the scope planned, and the threads read is then refused by the engine's token resolver with FILTER_TOKEN_UNKNOWN / 400 (or FILTER_TOKEN_UNRESOLVED for a record-context token), naming a placeholder in a filter the client never wrote. A date macro such as {30_days_ago} is accepted and resolved to a position. The same holds for the cursor's id member, which is not checked at all and is a string comparand the field-agnostic resolver also reads (present in round 1 too; not named there). A whitespace-only creation time also passes (the function leaves the empty cell unjudged). So "a cursor the read did not issue is VALIDATION_ERROR / 400, before anything is read" (schema header, changeset, data-api.mdx, handler header) is still false for a nameable input, with a more misleading code than before. Harmless to data: every such cursor is at most a keyset position inside the caller's own scope. Fix shape: make the decoder accept only what the encoder writes — a creation time that round-trips as the canonical instant text (for example equal to its own new Date(...).toISOString(), which admits no brace and no blank) and an id that is not a placeholder (classifyFilterToken answers null) — and pin {not_a_token}, {30_days_ago} and a blank in both members.

N5 (nit) — the schema header's refusal list does not mention the INVALID_FILTER filter refusal; prose face, fix with S1 or leave.

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: claude/project-thread-nfg4vp
Reviewed-by: session_01WGufzfHCzQWh6PeQnvToFz

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz
Contract-review-claim: session_01WGufzfHCzQWh6PeQnvToFz · head 809a6e1 · 2026-12-02T13:19Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 809a6e17affe77757e2c72ef1a0b5c41d536c650
Local-runs: none
Scope: packages/spec/src/api/comment-threads.zod.ts, packages/spec/src/api/index.ts + packages/plugins/plugin-audit/src/comment-threads-query.ts, packages/plugins/plugin-audit/src/comment-routes.ts, packages/plugins/plugin-audit/src/comment-route-ledger.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/index.ts, packages/client/src/index.ts, packages/objectql/src/index.ts
Security-touching: yes
Rule-change-verified: none

Delta review, round 3, of the round-2 record on 7b0b2300 (PASS with S1 open). The head was confirmed on the PR. git diff 7b0b2300 809a6e17 is one commit over four files: comment-threads-query.ts (+15/-5) and its test (+8), the header of packages/spec/src/api/comment-threads.zod.ts (+3/-1, prose only), and the regenerated reference page packages/spec/docs/references/api/comment-threads.md. packages/spec/src/api/index.ts, the client, the objectql export, the ledger, the registrar, audit-plugin.ts and the plugin index are byte-identical to the heads rounds 1 and 2 judged; their judgments stand and are not repeated. Read, not reviewed, for this round: classifyFilterToken in packages/spec/src/data/context-tokens.zod.ts; readsAsInstant, ISO_DATETIME_WRITE_FORM and isUninterpretableTemporalComparand in packages/core/src/utils/temporal-comparand.ts.

Check-runs on 809a6e17 at read time (not waited for): success: Governed Surface Queue Guard, Check PR Size, Check Documentation Links, PR-body guards, filter. In progress: Check Changeset, Spec property liveness, Flag docs affected by code changes, Auto Label, Dogfood Regression Gate, Build Core, Build Docs, Build UI Deps, the two Plan Test jobs, all eight Lint jobs and all four Type Check jobs. Queued: Live E2E UI. Skipped: the opt-in jobs, Queue verdict, Borrowed queue verdict, Schedule gate, Temporal Conformance, Dogfood Verify CLI, UI Published Artifacts. No code-gate verdict exists yet on this head; this record does not stand in for one. The dev's local runs (28 of 28, ablation, typecheck, eslint) are the dev's statement and were not re-run here.

① Derived judgments

  • Accept-set of cursor at the handler, narrowed by the fix: the decoded creation time must match the instant spelling (CURSOR_INSTANT_RE) and be read by the datetime rule, and the decoded id must be non-empty, carry no surrounding whitespace and not be a filter placeholder. Right: it is what the encoder writes, and nothing the read issues is refused (see ④).
  • No change to the schema's shape, the route, the ledger, the SDK, the exports or any error code in this delta. The spec change is a jsdoc sentence; the schema's keys, types and describe texts are untouched, so no authorable-surface, api-surface or json-schema shard moves, and only the generated reference page follows. Right.

② Semver level

Unchanged and right: Clause-②: yes (widening), Metadata-protocol: added, @objectstack/spec minor, @objectstack/objectql, @objectstack/plugin-audit and @objectstack/client patch (round 1, ②). This delta publishes no new surface and narrows nothing published: the route has not shipped. The changeset is untouched by this commit and still accurate. Check Changeset still running at read time.

③ Boundary flags

  • Round-2 findings: S1 answered below; N5 fixed on the prose face (the schema header names the filter refusal). N1 and N2 stay nits for follow-up cards; N3 (the card body still reads Metadata-protocol: none) is with the seat. All accepted.
  • Dev flag, the pattern chosen over strict toISOString equality: judged in ④; accepted.
  • SQL push-down: the delta adds no read and no materialisation; the decoder runs before any engine call. Nothing new.
  • open_questions: none carried.

④ Design judgment

packages/spec/src/api/comment-threads.zod.ts — the header's refusal paragraph now says a filter the list read cannot lower is INVALID_FILTER / 400, the answer GET /data/{object} gives the same value, and that null or [] is no filter. Each clause was read against lowerThreadsFilter on this head and agrees. The cursor sentence ("a cursor the server did not issue is VALIDATION_ERROR / 400", under "Refusals, before anything is read") now holds for every input the server can tell apart from its own cursors: see S1. N5: closed. The rest of the file is as round 1 judged it.

packages/spec/src/api/index.ts — unchanged. Holds.

packages/plugins/plugin-audit/src/comment-threads-query.ts

S1: closed. decodeThreadsCursor was read against each input round 2 named and against the code it leans on:

  • {not_a_token}, {30_days_ago} and a blank creation time fail CURSOR_INSTANT_RE (anchored at both ends, digits-first, no brace, no leading or trailing space) before the core rule is asked, so the rule's stepped-around placeholders no longer matter.
  • {not_a_token} and {current_user_id} as the id are refused by classifyFilterToken (it answers non-null for any brace-wrapped token, known or unknown); a blank or space-padded id by the trim test. A token needs braces, so no id the platform stores is refused: the resolver would have rewritten such an id in a filter anyway.
  • Nothing the read issues is refused. instantText writes toISOString text for a Date or a number, which matches the pattern and the rule; stored text passed through verbatim in the canonical YYYY-MM-DDTHH:MM:SS.sssZ form or the zone-naive space form matches both the pattern and ISO_DATETIME_WRITE_FORM. The pattern is slightly wider than the core rule on the zone (+HH alone) and narrower on the fraction (nine digits); the core rule, still asked second, has the last word on the first, and no stored instant carries more than nine fractional digits. The dev's reason for not requiring toISOString equality holds: equality would refuse the zone-naive stored spelling the core rule reads.
  • Every decodable cursor that now passes is an instant and a plain id, which the engine's temporal door and token resolver both take as written: it is a keyset position inside the caller's own scope and nothing else. A well-formed position the server never issued cannot be told from one it did without a signature, and the contract does not promise one; the handler header says "its creation time an instant the datetime rule reads", which is what is checked.
  • Pins present for all six named cases, beside round 2's.

M1: closed (round 2); lowerThreadsFilter is untouched by this commit.

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: claude/project-thread-nfg4vp
Reviewed-by: session_01WGufzfHCzQWh6PeQnvToFz

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz
Contract-review-claim: session_01WGufzfHCzQWh6PeQnvToFz · head 750a1ea · 2026-12-02T13:30Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 750a1ead4730fd5154efafc8b2fb98575714fbd6
Local-runs: none
Scope: packages/spec/src/api/comment-threads.zod.ts, packages/spec/src/api/index.ts + packages/plugins/plugin-audit/src/comment-threads-query.ts, packages/plugins/plugin-audit/src/comment-routes.ts, packages/plugins/plugin-audit/src/comment-route-ledger.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/index.ts, packages/client/src/index.ts, packages/objectql/src/index.ts, ui/scripts/check-spec-symbol-derivation.mjs
Security-touching: yes
Rule-change-verified: none

Delta review, round 4, of the round-3 record on 809a6e17 (PASS, no open finding). The head was confirmed on the PR. git diff 809a6e17 750a1ead is one commit, one file, eleven added lines: an ALLOW entry @object-ui/collaboration:CommentThread in ui/scripts/check-spec-symbol-derivation.mjs. Every other file in scope is byte-identical to the head round 3 judged; rounds 1 to 3 stand for them and are not repeated. Read, not reviewed, for this round: the guard's header and its EmptyState and FormSchema entries, ui/packages/collaboration/src/CommentThread.tsx (the component at line 397) and the package index that exports it.

Check-runs. On 809a6e17, read after the fact: Type Check UI concluded failure, which is the run this commit answers; TypeScript Type Check and Test UI also read failure there with their shard jobs cancelled, and this review did not read their logs, so whether they failed for the same guard alone is not established here. On 750a1ead at read time (not waited for): success: Governed Surface Queue Guard, Check PR Size, Check Documentation Links, PR-body guards. In progress: Check Changeset, Spec property liveness, Flag docs affected by code changes, Auto Label, all eight Lint jobs and all four Type Check jobs. Skipped: the opt-in jobs and Schedule gate. Type Check UI, TypeScript Type Check and Test UI had not yet appeared on this head. No code-gate verdict exists yet on this head; in particular the guard's own verdict (check:spec-symbols inside Type Check UI) and the two other jobs that failed on the prior head are still owed, and this record does not stand in for them. The dev's local runs (guard at 0 untriaged collisions, 195 of 195) are the dev's statement and were not re-run here; Rule-change-verified: none says so.

① Derived judgments

  • One accept-set change: the spec-symbol guard now accepts the name CommentThread declared in @object-ui/collaboration beside the spec export of the same name. Right: the collision is real (the spec type entered @objectstack/spec/api in this PR; the component is a published export of the package), and the entry is keyed to one package and one symbol, so it admits no other declaration under that name.
  • No public-surface change in this delta: no spec, route, SDK, schema or generated shard moves. The component keeps its published name. Right.

② Semver level

Unchanged and right: Clause-②: yes (widening), Metadata-protocol: added, @objectstack/spec minor, @objectstack/objectql, @objectstack/plugin-audit and @objectstack/client patch. A guard allow-list entry under ui/scripts/ publishes nothing from any released package, so the changeset needs no line for it. Check Changeset still running at read time.

③ Boundary flags

  • Dev flag, ALLOW rather than renaming the spec type: judged in ④; accepted.
  • Dev flag, the file is outside claim 7343360143: true, and the dev says the seat will be told. The edit is forced by this PR's own spec export (the guard reds the PR that adds the name), it is one entry, and no other open claim was shown to hold the file. A claim amendment naming the file is the seat's to record; escalated to the seat, not a finding on the diff.
  • Round-3 carry: N1 and N2 stay nits for follow-up cards; N3 is with the seat. Unchanged.
  • SQL push-down: nothing in this delta reads data.
  • open_questions: none carried.

④ Design judgment

packages/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 CommentThread (one entry of the read's answer) be renamed to clear the collision instead? No. The name is the plain one for the thing, it sits beside CommentThreadRecord, CommentThreadReplier and CommentThreadsQuery* and would break that family if it alone were renamed, and a rename would move the authorable-surface, api-surface, export-origins, declaration-map and json-schema shards and the reference page a second time for a collision that involves no shared meaning. The first consumer (the list-page panel) can import the type under an alias at no cost.

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. @object-ui/collaboration's CommentThread is a React function component taking threadId, comments, currentUser and callbacks; the spec's is a wire object of comment, record, replyCount, repliers. Neither can be derived from the other, so the failure class the guard hunts is absent, and the two sanctioned forms (re-export, derivation) do not apply. This is the EmptyState case exactly (a published component against a spec shape, objectui#11438) and the entry follows its wording and its disposition: allow, with the reason and the issue number, and leave a rename of a published component to its own card. Each sentence of the reason was read against the tree and holds, with one exception noted as N6. The entry sits in key order by package after @object-ui/types:FormSchema, which is not alphabetical; the map is not sorted elsewhere either, so nothing depends on it.

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: claude/project-thread-nfg4vp
Reviewed-by: session_01WGufzfHCzQWh6PeQnvToFz

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review — ACCEPT on 750a1ead4730fd5154efafc8b2fb98575714fbd6

The contract L2 at CONTRACT_REVIEW_TIER is record 7347045361 on this head: PASS, no must-fix, no should-fix. M1 and S1 from r1 were closed over r2–r4. Check-runs, including the re-runs of the PR-body checks after the body edit: 67 success, 15 expected-skip, 0 failed, 0 pending. Not governed, 2,592 lines, under the 3,000 line.

Verified on the tree:

  • Mount. registerCommentDoorsRoutes mounts POST /api/v1/comments/threads/query beside the two doors, with the doors' own resolveCaller and the engine read per request (503 when it lacks planReadScope / getSchema). The hosted comments member matches only the three doors, so it does not serve this route. The no-HTTP-server log line says so, and Comments: the comment threads read is served on a hosted kernel too, through the dispatcher /comments domain #39134 carries the hosted dispatcher. That fits the card's "nowhere it is not mounted".
  • As the caller. The record read is the engine's planReadScope of the caller's read with the list filter, placed in the comment read. Its refusals are the answer. A filter the list read cannot lower gets INVALID_FILTER / 400, the same as GET /data/{object}. The cursor decoder accepts only what the encoder writes.
  • Ledger and SDK. The ledger row is sdk → client.comments.queryThreads, and the client URL conformance test resolves it. Both the cross-package input list and turbo.json name the ledger file. @objectstack/objectql exports the two option types feat(objectql): planReadScope scopes a pointer column by a caller-run read of its target object #39100's L1 named as owed (N3).
  • Spec. comment-threads.zod.ts defines a strict body, with limits as constants. The generated artifacts are committed (api-surface, authorable-surface, declaration-map, export-origins, json-schema manifest, reference page).
  • The one ui file. The ALLOW entry for @object-ui/collaboration:CommentThread is a component name versus a wire-shape name, ruled over a rename in amendment 7347081374.
  • Declarations. Clause-②: yes (widening), Metadata-protocol: added (the api shard, precedent 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) with @objectstack/spec: minor. Skills-docs: none — … is true: the keys are one built-in read's request and response, which no authoring skill teaches. The changeset and data-api.mdx are true sentence by sentence.

Relation. Fixes #39084: the card's scope is spec, door, ledger row, SDK method and docs, all in the diff. Follow-ups #39134 (hosted dispatcher) and #39142 (stored thread root, PG microsecond keyset) are filed.

Carried to the seat (not owed): the card's acceptance names PostgreSQL for the case of more than 1,000 ids. No check-run provisions PG, so a CI witness needs a carrier, as with #39100 N5. The HTTP dogfood file runs in the merge queue, since dogfood shards skip on PRs.

The PR is still a draft. Not Tier H: the seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

席位核对

ACCEPT — PR #39135 @ 750a1ead47 (Fixes #39084, S3 of epic #39077; card thread of seat os-support-ai, claim 7343360143 with amendments 7346184382 and 7347081374).

落地

reading value
check-governed-merges.mjs --pr 39135 NOT governed; 2,592 changed lines ≤ 3000
pr-state.mjs on 750a1ead 67 success · 15 expected skip · 0 failed · 0 pending; mergeable_state clean
landing-k.mjs --pr 39135 K = 5 < 15
l1-face.mjs --pr 39135 CLEAN, 13 items read

State change: ready for review + auto-merge, by the owning seat; on merge it closes #39084.

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/xl 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: one read returns the threads on the records a list filter selects, as the caller

2 participants