Skip to content

[finding] The published skill reference index labels data/query.zod.ts — the whole QueryAST — "Sort Node", because its first JSDoc block is SortNode's #14441

Description

@os-litant

Found while implementing the skills/objectstack-query optimization flight (#14302, QRY-B-05). Out of scope there: the artifact is generator-owned and the fix is upstream in packages/spec, so it is filed rather than hand-edited.

What is wrong

skills/objectstack-query/references/_index.md is the package's ONLY pointer into the query schemas, and the row for the file carrying the entire QueryAST reads:

- `node_modules/@objectstack/spec/src/data/query.zod.ts` — Sort Node

Measured at origin/main 6aea1f5 (references/_index.md:14). The two sibling rows are accurate (date-macros.zod.ts — "Date Macro Tokens …", filter.zod.ts — "Unified Query DSL Specification"), which is what makes this one read as a fact rather than a glitch.

Why

The generator takes the FIRST JSDoc block in the file as that page's description, and packages/spec/src/data/query.zod.ts:10-13 opens with SortNode's block:

/**
 * Sort Node
 * Represents "Order By" — one `{ field, order }` pair. Unknown keys are
 * REJECTED (#4721); spell the direction `order`, never `direction`.
 */

The file states the mechanism itself, in the line comment immediately below (query.zod.ts:14-15):

Keep the block above short: build-docs.ts takes the FIRST JSDoc block in the file as this page's description, so the rationale below is line comments.

So the JSDoc is doing exactly what it was written to do; what is missing is a file-level block ahead of it. QueryAST's own module description already exists further down (query.zod.ts:571-580, "QueryAST — Abstract Syntax Tree for data queries").

Cost

The skill tells the agent to Read the source for exact field shapes. A pointer labelled "Sort Node" costs a wrong read: an agent looking for the query AST skips the one file that has it.

Fix (upstream, then regenerate)

Give query.zod.ts a short file-level JSDoc block ahead of SortNode's — the QueryAST sentence at :571 is already the right text — then regenerate; the generated _index.md must not be hand-edited. Keep the new block short for the same reason the existing comment names.

Not a duplicate of

Dedupe: one search_issues pass over the repo (query.zod.ts JSDoc ordering / skill reference index / Sort Node), 4 hits, all closed and all a different defect. Filed unassigned, no queue label.

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions