Skip to content

refactor(objectql): move the last 28 hand-series private docblocks out of engine.ts with the codemod's third pass (slice 2 of 2) - #30415

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-7wiz8y
Nov 5, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #30053

Clause-②: no
Metadata-protocol: none

维护者速读

What changes

  • The generated slice. node scripts/codemod-split-engine.mjs --hand-docs --write on main 38717d34, unedited. With no --modules it moves every remaining private hand-series docblock; the 36 the first slice moved are skipped as already moved. The script is unchanged since refactor(objectql): move 36 hand-series private docblocks out of engine.ts with the codemod's third pass (slice 1 of 2) #30341.
  • Four import bindings pruned from engine.ts, because a moved docblock's {@link} was their only reader (noUnusedLocals counts a link): RELATION_FILTER_ID_CAP (its whole import { type … } goes), resolveFilterTokens, and collectInternalReadFields / collectCredentialFields (their whole import goes).
  • packages/spec/liveness/query.json, row query.groupBy. The third leg cited engine.ts#aggregate; the body has lived in engine-delete-and-aggregate.ts since the codemod split, and the last mention of groupBy in engine.ts, a private docblock, moved in this slice. The leg now cites engine-delete-and-aggregate.ts#aggregate, and the note gains one dated sentence. Without it check:liveness reds exactly as it did after the first slice (main red: spec check:liveness — query/searchFields cites engine.ts, which no longer mentions searchFields after #30341 #30367).
  • Changeset. patch on @objectstack/objectql and @objectstack/spec (the ledger ships in the spec package).

What moved in this slice (10 modules, 28 docblocks, 858 lines)

Hand module Docblocks Lines Before → after
engine-driver-options.ts 6 148 403 → 550
engine-hook-dispatch.ts 4 147 240 → 388
engine-file-reference-hydration.ts 5 128 453 → 581
engine-referential-integrity.ts 2 123 232 → 358
engine-execute-transactions.ts 2 73 204 → 280
engine-query-lowering.ts 3 69 178 → 249
engine-realtime-publish.ts 2 66 518 → 587
engine-count-aggregate.ts 1 41 209 → 254
engine-validation-messages.ts 2 40 193 → 236
engine-reference-name-visible.ts 1 23 238 → 265

packages/objectql/src/engine.ts: 12,618 → 11,752 lines.

After both slices

All 64 private hand-series stubs that had a docblock now keep it beside their body. On the class stay: the 20 public stubs (their docblock is the contract), validationMessageContext (its function already carries a richer docblock; merging two is an edit, not a move) and noteAdmittedValueShapeViolation (no docblock). --hand-docs on this head plans 0 moves.

Verification

All at head cc44c59f unless stated.

  • Proof. --hand-docs --verify --base 38717d34: exit 0. 28 moved (858 lines) across 10 module(s), 36 already moved at base; engine.ts 12618 -> 11752 lines; undoing every move rebuilds the base, undone the same way, for engine.ts and its 21 hand module(s) byte-for-byte, once the 4 import binding(s) only a moved docblock linked are pruned.
  • Determinism. The same --write on a stale checkout of main (f672e0dc, the same engine.ts and hand modules) printed the same output tree sha256 6c71d47c…7b38 as the run on 38717d34.
  • .d.ts. packages/objectql/dist built at base 38717d34 twice and at head twice. Base 1 = base 2 and head 1 = head 2, byte for byte. Base against head: core and index (.d.ts and .d.mts) are byte-identical; util-HASH has 193/193 statements and 334/334 private members, and its public surface is EQUAL. The raw difference is the 858 lines of moved private docblocks.
  • Ablation (on the real tree). Through scripts/ablation-replace.mjs, each restored to the HEAD blob: one character changed in a moved docblock (inAfterAbortUnit's, in engine-hook-dispatch.ts) → --verify exits 1 naming the line; one character changed in a docblock that stays on the class (checkDriversHealth) → exits 1 naming the line. The battery's own ablations ran on refactor(objectql): move 36 hand-series private docblocks out of engine.ts with the codemod's third pass (slice 1 of 2) #30341 and the script is unchanged; --self-test 105 cases pass.
  • Suites. objectql test: base 38717d34 550 files / 10,967 passed, head 550 / 10,967. objectql typecheck: exit 0.
  • Liveness. pnpm --filter @objectstack/spec check:liveness: exit 1 before the groupBy repoint (only that row), exit 0 after. Separately, all 36 ledger rows that cite engine.ts were read: each one's key (camelCase or snake_case) is still named in engine.ts on this head.
  • Gates. dispatch-gates --commands derived 62 commands (check:liveness among them), each run after a full turbo run build --filter='!@objectstack/docs' (exit 0). All 62 exit 0; --ran: 62 derived, 62 run, 0 NOT-MEASURED.

Acceptance notes

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (a ledger row only)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran.
  • 4. One issue, one branch off an up-to-date main, one pull request. (the designated thread branch, recreated from main; second of two slices)
  • 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. (a liveness row; nothing generated reads it)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ

…t of engine.ts with the codemod's third pass (slice 2 of 2)

`node scripts/codemod-split-engine.mjs --hand-docs --write` on main
38717d3, unedited: 10 hand modules, 858 docblock lines, 4 import
bindings only a moved docblock linked pruned. The query.groupBy liveness
row is repointed at engine-delete-and-aggregate.ts#aggregate, since
engine.ts no longer names the key.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CYHBS7P5hkUQrNHkHZ
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#3 · os-bill · session_01Utp6CYHBS7P5hkUQrNHkHZ

os-dev report: #30053 slice 2 of 2, PR #30415 (draft), head cc44c59f

  • Branch claude/project-thread-7wiz8y, recreated from main 38717d34 (the remote branch had been deleted at the merge, so no force push). Claim 6650363315.
  • Size: 13 files, +951 / −924 = 1,875 changed lines (< 3,000).
  • --hand-docs --write (no --modules), unedited: 10 modules, 28 docblocks, 858 lines; 36 already moved at base. engine.ts 12,618 → 11,752. Four import bindings pruned (RELATION_FILTER_ID_CAP, resolveFilterTokens, collectInternalReadFields, collectCredentialFields). Script unchanged since refactor(objectql): move 36 hand-series private docblocks out of engine.ts with the codemod's third pass (slice 1 of 2) #30341. On this head the plan moves 0/86: the card's engine.ts half is complete.
  • Liveness: check:liveness red before the fix, on exactly query/groupBy → engine.ts; the row now cites engine-delete-and-aggregate.ts#aggregate, exit 0. All 36 ledger rows citing engine.ts still find their key there.
  • Proof --hand-docs --verify --base 38717d34 exit 0. Determinism: same output tree sha256 6c71d47c…7b38 on f672e0dc and 38717d34.
  • .d.ts: base ×2 and head ×2 stable; core/index byte-identical; util public surface EQUAL; raw diff = 858 moved private docblock lines.
  • Ablation on the real tree ×2 (a moved docblock, a staying docblock): --verify exits 1 naming the line each time; restored to HEAD. --self-test 105.
  • Suites: objectql test base 550 / 10,967 = head; typecheck 0.
  • Gates: dispatch-gates --commands 62 (with check:liveness), all exit 0 after a full build; --ran 62/62, 0 NOT-MEASURED.
  • Changeset: patch on @objectstack/objectql and @objectstack/spec (Clause-②: no, Metadata-protocol: none). Not assigned, no review requested. Body Fixes #30053.
  • Write budget: 2 GitHub writes (relay pr_create, read-back identical 7,437 bytes; this report). No GitHub MCP write.

Report taken 2026-11-05T10:28Z.


Generated by Claude Code

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/objectql, @objectstack/spec, touching 34 documentable anchor(s). ⚠️ 8 changed file(s) yielded no anchor (packages/objectql/src/engine-count-aggregate.ts, packages/objectql/src/engine-execute-transactions.ts, packages/objectql/src/engine-hook-dispatch.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/api/data-api.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/api/plugin-endpoints.mdx (via /files/:fileId (route, a path literal in a comment in ObjectQL; a path literal in a comment on a changed line))
  • content/docs/data-modeling/field-types.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/data-modeling/fields.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/data-modeling/validation-rules.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/deployment/cli.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/deployment/troubleshooting.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/kernel/contracts/data-engine.mdx (via buildDriverOptions (symbol, a method of class ObjectQL))
  • content/docs/permissions/authorization.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/permissions/delegated-administration.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/permissions/permission-sets.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/permissions/system-context.mdx (via assertReferencesResolve (symbol, a method of class ObjectQL), buildDriverOptions (symbol, a method of class ObjectQL), masterDetailHeadersCallerReads (symbol, a method of class ObjectQL), permission_set_id (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line), sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/permissions/tenant-audit-census.mdx (via buildDriverOptions (symbol, a method of class ObjectQL))
  • content/docs/protocol/kernel/realtime-protocol.mdx (via publishDataEvent (symbol, a method of class ObjectQL))
  • content/docs/protocol/objectql/types.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line), /files/:fileId (route, a path literal in a comment in ObjectQL; a path literal in a comment on a changed line))

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

  • content/docs/releases/v12.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v13.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v15.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line), sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line), /files/:fileId (route, a path literal in a comment in ObjectQL; a path literal in a comment on a changed line))
  • content/docs/releases/v17/17-0.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v17/17-1.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line), sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v17/17-5.mdx (via sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v17/17-6.mdx (via RELATION_FILTER_ID_CAP (symbol, a top-level type), sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v18/18-0.mdx (via permission_set_id (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line), sys_permission_set (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))
  • content/docs/releases/v18/18-3.mdx (via set_null (literal, a string literal in a comment in ObjectQL; a string literal in a comment on a changed line))

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
  • 8 changed file(s) yielded no anchor (packages/objectql/src/engine-count-aggregate.ts, packages/objectql/src/engine-execute-transactions.ts, packages/objectql/src/engine-hook-dispatch.ts, …) — pages documenting those are invisible to this run
  • 2 anchor(s) matched too much of the corpus to be a work list: ObjectQL (symbol, 80 pages), organization_id (literal, 38 pages)
  • the SDK route bridge reached 61 of 219 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 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 — 172 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 1e6f54235deaa8b59eef5d249ea1c13375a5b2d0 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 1e6f54235deaa8b59eef5d249ea1c13375a5b2d0

⚠️ 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 1e6f54235deaa8b59eef5d249ea1c13375a5b2d0 → 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

domain:server#3 · os-bill · session_01Utp6CbPxYq1wQmUNWvMZkC

席位核对

ACCEPT · head cc44c59f389deb28effeafb181ab1fdb7d681fc6 · card #30053 (claim 6650363315, amendment 6650390462), slice 2 of 2 · 2026-11-05T10:50Z

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 tooling

Projects

None yet

1 participant