Uh oh!
There was an error while loading. Please reload this page.
fix(spec): give data/query.zod.ts a module header so its pointer rows name the query AST - #14737
Draft
os-sam wants to merge 2 commits into
Draft
fix(spec): give data/query.zod.ts a module header so its pointer rows name the query AST#14737os-sam wants to merge 2 commits into
data/query.zod.ts a module header so its pointer rows name the query AST#14737os-sam wants to merge 2 commits into
Conversation
…ws name the query AST The skill reference indexes and the generated `data/query` reference page described the file carrying the whole `QueryAST` as "Sort Node": the generators publish the module's own doc block, this file had none, and `SortNodeSchema`'s block qualified because the file's rationale comments separate it from its schema. Adds one short file-level block reusing the sentence `QueryAST`'s type block already carried, regenerates the four published indexes and the reference page, and pins the row. `SortNode`'s block is untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RbbUMnxkUnWhE4j94v8FE
… warning The warning comment beside `SortNode`'s block said the generator publishes "the FIRST doc block that documents no symbol". That is the condition this card's defect turned on, but it is only two of the selector's three: a block documenting no symbol is published only while it is still in the HEADER ZONE, which the first declaration closes (`scripts/lib/file-description.ts`). Left as it was, the next author could put a block documenting nothing below a declaration and expect it on the page. Comment-only: no doc block changes, so no generated artifact moves. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RbbUMnxkUnWhE4j94v8FE
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 128 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#14441
What was wrong
packages/spec/src/data/query.zod.tscarries the wholeQueryAST, but every publishedpointer row for it read "Sort Node" — the description of a single
{ field, order }pair. The public reference page
content/docs/references/data/query.mdxopened on it too.The generators publish the module's OWN doc block: top-level, in the header zone,
documenting no symbol (
packages/spec/scripts/lib/file-description.tsselects it).query.zod.tshad no block of its own, andSortNodeSchema's block qualified — thefile's long rationale comments sit between that block and its schema, so nothing attached
it to a symbol.
The mechanism was understood when the file was written: a warning comment sits directly
under that block saying the first block becomes the page description. What was not
noticed is the ordering — the first block belonged to a symbol, and a comment warning
about a rule is not the same as satisfying it.
Cost, in the skills' own terms: the skill tells an agent to Read the source for exact
field shapes, so a pointer labelled "Sort Node" makes it skip the one file that carries
the AST.
What this PR does
data/query.zod.ts, reusing the sentenceQueryAST's own type block already carried further down the file.objectstack-query,-data,-api,-ui) and the reference page now name the query AST. The_index.mdfiles aregenerated and were not hand-edited —
check:skill-refsandcheck:docsbothgreen prove the checked-in bytes are exactly the generators' output.
SortNode's block is untouched and still documents the schema it belongs to.conditions, omitting the header zone — the one this defect turned on. A block
documenting no symbol is published only while no declaration precedes it.
packages/spec/scripts/query-pointer-row.test.ts, a two-leg pin.Why a pin, when two gates already cover these artifacts
check:skill-refsandcheck:docscompare the artifact against the generator, and thegenerator reproduced the wrong block faithfully — the same blind spot #5059 and #12201
found one layer up. So the pin asserts the fact the artifact must state, not the pipeline
that states it. Its two legs fail differently and both were measured:
this card actually found: an index regenerated from a file with no header of its own.
Landing shape — GOVERNED
node scripts/pm/check-governed-merges.mjs --teston this PR's 8 paths, verdict line:Draft PR, no ready flip, no auto-merge, not enqueued. Note the generated-surface
exception (#11705) did not lift the four
skills/**paths: the predicate sees aco-edited file under the generator's own directory (the new pin test lives in
packages/spec/scripts/), so it declines to certify a regeneration produced by the treeunder test. Governed either way here.
Published skills bundle — the two readings
Line counts are net zero; the change is 4 generated rows getting a longer, correct
description.
Per changed file, whole-file lines (before to after):
skills/objectstack-api/references/_index.mdskills/objectstack-data/references/_index.mdskills/objectstack-query/references/_index.mdskills/objectstack-ui/references/_index.mdWhole published bundle: all
skills/**/SKILL.md8801 to 8801 lines (+0); every fileunder
skills/14334 to 14334 lines (+0).Tokens, in the ratchet's own convention
ceil(utf8 bytes / 4): the four indexes go888/1483/518/1205 to 899/1494/529/1215, and the whole published bundle 159648 to 159691
(+43).
check-skills-token-ratchetclassifiesreferences/_index.mdasgenerator-owned — measured, not ratcheted, so no ceiling is in play; the ratcheted
(authored) bucket is unchanged at 141214 / 165532.
Verification
All readings below are on head
01a03f98e, worktree clean, exit codes captured beforeany pipe.
pnpm --filter @objectstack/spec exec vitest run(whole package)Test Files 458 passed (458)·Tests 12279 passed (12279)pnpm --filter @objectstack/spec run typechecktsc --noEmit+check:scripts-typecheck+check:test-typecheckpnpm --filter @objectstack/spec run check:skill-refs9 generated files in sync with packages/specpnpm --filter @objectstack/spec run check:docs229 generated files in sync with packages/specpnpm --filter @objectstack/spec run check:generatedpnpm --filter @objectstack/spec build)pnpm --filter @objectstack/spec run check:skill-examples256 prose examples type-check across 3 surface(s)node scripts/check-skills-token-ratchet.mjs31 authored bundle file(s) within their ceilings; 11 generator-owned file(s) measured, not ratchetedpnpm check:pm-skill-ratchetpnpm check:nul-bytesscanned 8044 text file(s) ... no raw ASCII control bytespnpm check:doc-authoringpnpm check:cross-package-test-inputs25 package(s) read outside themselves, all declared, and turbo.json hashes every declared globThe new pin reads
skills/from insidepackages/spec; that escape is already covered —$TURBO_ROOT$/skills/**is a declared input of@objectstack/spec#test, and the gateabove confirms turbo.json hashes it. The test file is compiled by
packages/spec/tsconfig.scripts.json(confirmed with--listFilesOnly), socheck:scripts-typecheckreally did type-check it.The full derived family —
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack,75 commands — was run. 68 green. The other 7 measured nothing and are declared, not green:
six are the same precondition (the workspace is not fully built in this container —
66 of 67 packages have no
dist/), and one is structural:check:dual-build-cjs-loads,check:type-check-debt,@objectstack/lint'scheck:doc-formula-expressionsandcheck:doc-security-posture(needs
@objectstack/formulabuilt).check-dev-prereqs("The workspace is not built").check-test-completenessgrades a savedturbo run testlog and the familynames it with no argument — its own text says this branch is NOT MEASURED and is not a
red.
None of the seven reads a path this diff touches. CI runs the farm regardless.
Reverse verification (measured, not asserted)
Header block deleted on disk, then restored. Mutation proven on disk before any reading —
header-sentence
grep -c0 (want 0),SortNodeblock still 1, and the blob hash moved341bb947toa8c9c601. The script carried atrap ... EXIT INT TERMwith absolutepaths throughout.
opens on the QueryAST sentence, not on SortNodegen:skill-refs, exit 0)data/query.zod.ts— Sort Node — the exact defect reproducedfile-description.test.ts, 97 passedRestore proven, not assumed:
git checkout HEAD -- REPO_ROOT, then both blob hashesequal to their HEAD blobs (
341bb947...,0287454b...),git diff HEAD0 files, 0untracked.
Note for the reviewer
This branch was taken over. Two earlier sessions died in container restarts leaving the
worktree with one unverified commit and no PR. Every reading in this PR was produced
after the takeover, on the final head; the inherited commit was reviewed hunk by hunk and
kept, with one correction (the warning comment's missing header-zone condition, its own
commit).
Changeset:
@objectstack/spec: patch.🤖 Generated with Claude Code
https://claude.ai/code/session_017RbbUMnxkUnWhE4j94v8FE
Generated by Claude Code