Uh oh!
There was an error while loading. Please reload this page.
feat(docs-audit): anchor a docs page on the CLI command phrase a change implements - #9290
Merged
Merged
Conversation
…ge implements Adds a fourth anchor kind, `command`, to the docs-drift derivation: when a changed file sits under an oclif package's `src/commands/**`, the phrase `os <topic> <name>` is derived from its path and matched against the hand-written corpus. The registry this needs already exists as the oclif filesystem convention (topic = directory, command = filename), so the derivation reads the path — no curated table beside it to drift. The lowercase shape guard is untouched for bare tokens. `resync` alone is exactly the shape it exists to drop; `os meta resync` is a multi-word phrase that is distinctive by construction, so the new kind is admitted beside the guard via PHRASE_ANCHOR_KINDS rather than through it. Command phrases still face the corpus-share guard. Measured: 07ad424 goes from 0 matched pages to the page naming the command. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. |
Contributor
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 32031729217 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
github-merge-queueBot
removed this pull request from the merge queue due to failed status checks
Aug 17, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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#9230
Adds a fourth anchor kind —
command— toscripts/docs-audit/affected-docs.mjs, so achange to a CLI command file anchors on the command phrase it implements
(
packages/cli/src/commands/meta/resync.ts⇒ the phraseos meta resync) instead of onsymbol spellings no page uses.
⛔ Not urgent, and the PR body should say so
The card measures this at 1 of 10 PRs in the #9192 sample and states plainly:
"Not claimed: that this class matters often." This is a bounded precision
improvement, not a defect fix. It is worth landing because the miss is silent from the
reader's side, not because it is frequent.
The registry already existed — it is the filesystem
The card's own first question was "whether that registry exists in a machine-readable
form is not checked." It does: the CLI is oclif, and oclif resolves command ids from
paths — topic = directory, command = filename. So the derivation reads the path. No
curated table is added; a hand-kept ledger beside the convention would be a second
source of truth with nothing keeping the two honest.
Gated on the package declaring
oclifin its manifest rather than on a hardcodedpackages/clipath, so a second CLI package would be covered on the day it lands, and asrc/commands/directory in a package that is not a CLI is correctly ignored. Binarynames come from what the package declares (
oclif.binplus eachbinkey), soos meta resync,objectstack meta resyncandnpx objectstack meta resyncall matchbehind one anchor token.
⭐ The shape guard is untouched for bare tokens
The existing lowercase shape guard is load-bearing — neutralising it takes one measured
PR from 19 pages to 49, and
label/objectmatch 82 / 113 of the 178 hand-writtenpages.
resyncon its own is exactly that shape and stays dropped.os meta resyncis not that shape. The new kind is admitted beside the guard througha named
PHRASE_ANCHOR_KINDSset (routewas already exempt for the same reason: amulti-segment token distinctive by construction), never by loosening
isCodeShaped.Command phrases still face the corpus-share guard unchanged.
Two self-test pins hold that pair together:
isCodeShaped('resync')must stayfalse,and
symbol/literal/sdkmust stay outsidePHRASE_ANCHOR_KINDS. If they everdisagree, recall was bought by neutralising the guard — the one fix this card rules out.
Measured
Reverse verification, both legs predicted red in advance, run from a detached worktree
at each commit against both the
origin/mainscript and this one.Leg 1 — a CLI-command change reaches the page documenting it (
07ad42463,fix(cli): explain os meta resync's skip count):MetaResync,resyncSkipExplanationLineos meta resync(command)content/docs/data-modeling/drivers.mdx, viaos meta resync (command)Leg 2 — the bare-token guard still drops lowercase single words. On
445ae4deb(the auth-email change whose locals are the calibration specimen), both scripts produce
byte-identical output: 3 docs, 35 anchors, and
weakAnchorsDropped = ["label (symbol)","locale (symbol)","start (symbol)","subject (symbol)"].Recall was bought without buying back the false positives.
No-regression sweep — 20 consecutive commits touching
packages/, none of them touchinga command file: every one byte-identical between the two scripts.
Corpus precision of the new kind, over all 58 command files and 178 hand-written pages
(hub limit = 26 pages):
os meta resync)os serve)os validate, dropped and published inoverbroadAnchorsSummed over all 58 commands, the phrase matches 290 page-hits where the bare filename
token would match 2365 — 8.2x more selective, and every hit is a literal command
mention rather than prose.
are the broad end. On
ba2e3c172— a comment-only edit toserve.ts— the list goesfrom 2 pages to 19, all of which literally write
os serve. They are true positives bythis tool's own definition ("a doc is affected when it NAMES SOMETHING THE CHANGE
TOUCHED"), and the corpus-share guard already catches the extreme case. No second
tunable was added for this; if a reviewer wants top-level commands held to a tighter cap
than the repo's one calibrated line, that is a deliberate follow-up, not something this
PR should decide silently.
A correction to the card's worked example
The card records the
07ad42463change as documented oncontent/docs/deployment/cli.mdx.Re-derived at that exact commit and on current
origin/main: that page never namesos metaorresyncat all. The page that documents the command iscontent/docs/data-modeling/drivers.mdx(line 619). The class the card records isreal and reproduced exactly — 2 anchors, 0 pages, only the coarse 22-page package-mention
set — only the page attribution was wrong.
Shapes the derivation declines, reported rather than guessed
Handled mechanically: top-level commands, topic + command, hyphenated ids, a topic
index.ts(which is the topic itself, notmigrate index), and arbitrarily deepernesting — depth is read off the path, so a deeper topic tree needs no change here.
Measured on this tree: 45 commands at the root, 43 under 11 topics, one level deep.
Declined paths are collected in a new
unmappedCommandFilesJSON field and named in thesummary line, in the same spirit as
anchorlessChanges— the derivation declining ashape must be readable, never inferred from a gap. Measured: all 58 real command files
derive a phrase, and the 30 declined paths are all test files (already excluded upstream).
One shape is knowingly out of reach and documented rather than detected: a command that
overrides its id in code (
static id/static topic) can disagree with its path.Measured on this tree — zero commands declare
static topic, and the singlestatic id(
init.ts) agrees with its path. The failure direction if that ever changes is a phrasematching no page, which the published anchor list makes visible; not a false positive.
Gates
Re-derived from the actual changed path with
node scripts/pm/dispatch-gates.mjs scripts/docs-audit/affected-docs.mjs— it named thesame two families the dispatch did, no additions.
All run at
19cd67b84(the final commit):pnpm check:docs-audit-scope— green;affected-docs --self-test155 cases pass(115 on
origin/main; 40 new pins), scope in sync with 178 hand-written docsnode scripts/docs-audit/check-affected-docs.mjs— green, 155 casespnpm check:nul-bytes— green, 6066 files; plus a direct control-byte grep over thechanged file
No changeset: the diff is one root
scripts/file and publishes nothing —skip-changeset.Out of scope: #9282 targets this same file (docs-drift being blind to anchorless files)
and is deliberately held back so there is one writer at a time; it is untouched here.
Generated by Claude Code