docs(spec): cite engine symbols, not line numbers, in functional-completeness - #17283
Merged
os-bill merged 2 commits intoSep 10, 2026
Merged
Conversation
…leteness The three `objectql/engine.ts:NNNN` citations in this module's doc block pointed 575 to 5,787 lines away from the text they quote. Re-measured on origin/main 7ddf13d (engine.ts is now 15,309 lines, not the 15,020 the card recorded): the summary snippet is at 8630 (cited 3001), the `referenceObject` snippet at 8978 (cited 3191), and the formula-plan snippet at 921 (cited 346). Each quoted text occurs exactly once in engine.ts (`grep -cF` = 1/1/1), so "the text is at line N" is a reading. A reader following the stale citations lands on a blank line, on prose inside an unrelated comment block, and — the dangerous one — on a line of plausible-looking `dispatch:` code, so the citation reads as answered when it is not. Repoint each to the enclosing symbol, written in the repo-root `path#symbol` anchor form `packages/spec/liveness/field.json` already uses, plus the verbatim snippet. A line number rots on the next refactor; a symbol plus a unique snippet is greppable and survives movement. The anchor form is load-bearing beyond readability: it moves these three out of `check-spec-docblock-symbol-anchors`' not-judged bucket (the relative `objectql/engine.ts` named no tracked file) and into resolution. That gate now reports `3 symbol (3 declaration)` where it reported 0, so a rename of any of the three methods reddens CI instead of rotting silently. The section heading is corrected in the same breath: it instructed the next author to cite "the runtime line", which is the instruction that produced this drift and now describes none of the block's citations. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com>
…ation repair Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 134 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-bill
marked this pull request as ready for review
September 10, 2026 03:24
os-bill
deleted the
claude/issue-16960-functional-completeness-anchors
branch
September 10, 2026 03:51
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 free
to 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 #16960
The module doc block of
packages/spec/src/kernel/functional-completeness.tscited the runtime that justifies each rule by line number. All threeobjectql/engine.ts:NNNNcitations had rotted. Each now names the enclosing symbol plus the verbatim snippet.Re-measured on current
origin/main⛔ Not transcribed from the card. Ref:
origin/main7ddf13dca(branch point).packages/objectql/src/engine.tsis 15,309 lines — it moved since the card's97adce2fareading of 15,020, and every drift figure moved with it.grep -cFengine.ts:3001if (d?.type !== 'summary' || !d.summaryOperations) continue;engine.ts:3191if (!referenceObject) continue;engine.ts:346def?.type === 'formula' && def.expressionUniqueness holds at 1 / 1 / 1, so "the text is at line N" is a reading and not an artefact. No snippet needed lengthening and none had vanished — the card's premise stands, only its arithmetic aged.
What a reader following each stale citation lands on today
:3191is still the dangerous one, and it has drifted onto different plausible code than the card recorded: adispatch:property in a per-row hook-context build rather than theforloop the card saw. A reader lands on something that reads like a real answer and never learns they were sent to the wrong place.Before / after
summary`objectql/engine.ts:3001``packages/objectql/src/engine.ts#buildSummaryIndex`+ verbatim snippetformula`objectql/engine.ts:346` builds the formula plan…`packages/objectql/src/engine.ts#planFormulaProjection`+ verbatim snippetlookup/master_detail`objectql/engine.ts:3191``packages/objectql/src/engine.ts#expandRelatedRecords`+ verbatim snippetBoth
buildSummaryIndexandexpandRelatedRecordsare private methods ofexport class ObjectQL(declared atengine.tsline 2573, closing at 14757);planFormulaProjectionis module-level.The anchor form is load-bearing, not cosmetic
The repo-root
path#symbolform is the onepackages/spec/liveness/field.jsonalready uses (packages/objectql/src/engine.ts#expandRelatedRecords), and it does more than read well:scripts/check-spec-docblock-symbol-anchors.mjs(registered by #17065 on 2026-09-09, after this card was filed) judgespackages/spec/src/**doc-block anchors. It declaresjudgeUntrackedLineAnchors: false, and the old citations spelled a relativeobjectql/engine.ts, which names no tracked file — so all three sat in its not-judged bucket. Measured both ways on this tree:The delta is exactly 3 — these citations were precisely the difference. In anchor form the gate resolves them (
3 symbol (3 declaration)where it reported0), so renaming any of the three methods now reddens CI instead of rotting silently. That is a stronger outcome than the card's criterion asked for, at no cost to it.One extra word, declared
The section heading read "every rule here cites the runtime line that makes it true". That sentence is the instruction that produced this drift, and after this change it describes none of the block's citations. Corrected to "the runtime site" — one word, same doc block, same write surface. Called out here so it is reviewed rather than absorbed.
Scope
packages/spec/src/kernel/functional-completeness.ts+ one changeset.packages/objectql/src/engine.tswas read-only — it is where the truth was measured, not where the fix lands.record-validator.ts-only by design; its dev measured these three, left them and reported them. The fence held.Changeset — derived, not inherited
packages/spec'sfiles[]carriesdist, andsrc/kernel/index.ts:142re-exports this module (export * from './functional-completeness'). Measured afterpnpm --filter @objectstack/spec build: the edited prose reachesdist/kernel/index.d.ts(and.d.mts) at line 5186, verbatim anchors included, with two positive controls from the same file also landing. Published text moves ⇒ apatchchangeset is owed andskip-changesetwould have been wrong.Verification
Derived with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, then re-derived once the changeset existed (it added 5 commands) and those run too. All exit 0:check-spec-docblock-symbol-anchors+--self-test;check:nul-bytes; control-byte scan of the touched file (no hits)pnpm --filter @objectstack/spec check:generated— all 15 generated artifacts up to datecheck:api-surface·check:docs·check:authorable-surface·check:liveness·check:exported-any·check:dual-source-exports·check:llms-txt·check:empty-state·check:skill-refs·check:variant-docs·check:objectui-pin-citationscheck-changeset-no-major(+self-test) ·check-adr-0087-registration·check-changeset-fixed·check:changeset-gate-self-tests·check-empty-changeset(+self-test) ·check:objectui-changeset·check:pm-changeset-deadline-census·release-rehearsal-clone --self-testcheck:doc-authoring·check:published-files·check:cross-package-test-inputs·check:test-source-alias·check:dts-closure·check-closing-keyword-parity·check-comment-mask-adoption·check-system-context-census·check-keyed-text-bounds·check-undeclared-dep-imports·docs-audit/check-affected-docspnpm --filter @objectstack/spec test— 470 files / 13,218 tests passedpnpm --filter @objectstack/spec typecheck— exit 0pnpm lintrepo-wide (eslint . --no-inline-config) at973daafe2— 6,466 files, 0 errors, 0 warnings. Run in full, so no narrowing argument is claimed.Heavy runs went through
scripts/pm/os-verify-lock.sh; exit codes were landed to disk before reading, never through a pipe.Generated by Claude Code