Skip to content

Commit 8aecfb8

Browse files
committed
feat(devx): a docs gate binds each CLI transcript in content/docs to the registry it quotes, so a derived count cannot drift silently (#15373)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
1 parent d30ccb9 commit 8aecfb8

7 files changed

Lines changed: 842 additions & 4 deletions

File tree

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4684,6 +4684,39 @@ jobs:
46844684
- name: Build workspace packages
46854685
run: pnpm exec turbo run build --filter='./packages/*' --filter='./examples/*^...'
46864686

4687+
# CLI transcripts in content/docs are bound to the registries they quote
4688+
# (#15373). `content/docs` teaches with pasted CLI output, and some of those
4689+
# lines quote a number the CLI derives from a live registry at runtime —
4690+
# `Running author-time rules (42)...` is `authoringRulesFor(<command>).length`.
4691+
# The page wrote it as a literal; nothing derived it and nothing compared it,
4692+
# so it drifted on every rule added. Four published pages carried 41 against a
4693+
# registry holding 42, and what surfaced it was a customer-simulation upgrade
4694+
# run noticing the CLI printed something else. PR #15369 fixed the four
4695+
# numbers; this is the mechanism.
4696+
#
4697+
# ⚠ ORDER / PLACEMENT — this step is HERE, and not with the other docs gates
4698+
# in the `Lint & Repo Gates` job, for a measured reason. It derives the number
4699+
# the way the CLI does, by importing the BUILT @objectstack/lint, so it needs
4700+
# a dist/:
4701+
#
4702+
# · `Lint & Repo Gates` runs `pnpm install` and NEVER builds. Placed there
4703+
# the gate would exit 3 (PREREQUISITE NOT MET) on every CI run forever —
4704+
# a gate that never measures, which is the shape #4642 named.
4705+
# · ci.yml's `Build Core` builds, and hosts `check:dual-build-cjs-loads` for
4706+
# exactly this reason, but it is gated on the `core` paths filter, which
4707+
# does not include `content/**` — so it would skip the docs-only PRs that
4708+
# ADD a stale transcript, the direction this gate exists for.
4709+
# · This lane has NO paths filter, sits behind the required `TypeScript Type
4710+
# Check` context, and the step above already built packages/lint.
4711+
#
4712+
# So it must stay AFTER `Build workspace packages`. It adds no build and no CI
4713+
# minutes; the scan is ~405 pages plus one dynamic import, ~0.4s. The gate's
4714+
# own header is the authority on the declaration syntax (fence meta, measured
4715+
# against the real fumadocs/MDX pipeline) and on why this is a COMPARE rather
4716+
# than a stamp. Runs its own --self-test first, through the alias.
4717+
- name: CLI transcripts in content/docs match the registry they quote
4718+
run: pnpm check:docs-transcript-drift
4719+
46874720
# The per-package `typecheck` scripts the coverage gate above requires
46884721
# (#4311). tsc resolves workspace imports through each dependency's built
46894722
# dist/*.d.ts, so the task carries `dependsOn: ^build` in turbo.json —

content/docs/deployment/cli.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ os compile --json # JSON output for CI pipelines
444444
- `--json` — Output compile result as JSON (for CI)
445445

446446
**Output example:**
447-
```
447+
```text transcript=os-build
448448
◆ Compile
449449
────────────────────────────────────────
450450
→ Loading configuration...

content/docs/deployment/validating-metadata.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ runs the other two.
548548

549549
A clean run walks the registry and reports timing:
550550

551-
```
551+
```text transcript=os-validate
552552
◆ Validate
553553
────────────────────────────────────────
554554
→ Loading configuration...

content/docs/getting-started/build-with-claude-code.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ visible: 'status != "resolved"'
259259

260260
`npm run validate` (which `AGENTS.md` tells the agent to run) refuses it:
261261

262-
```
262+
```text transcript=os-validate
263263
◆ Validate
264264
────────────────────────────────────────
265265
→ Validating against ObjectStack Protocol...

content/docs/ui/react-pages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ too:
372372
objectstack validate
373373
```
374374

375-
```
375+
```text transcript=os-validate
376376
◆ Validate
377377
────────────────────────────────────────
378378
→ Loading configuration...

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"check:docs-single-h1": "node scripts/check-docs-single-h1.mjs --self-test && node scripts/check-docs-single-h1.mjs",
4949
"check:docs-audit-scope": "node scripts/docs-audit/affected-docs.mjs --self-test && node scripts/docs-audit/check-audit-scope.mjs --self-test && node scripts/docs-audit/check-audit-scope.mjs",
5050
"check:docs-redirects": "node scripts/check-docs-redirects.mjs --self-test && node scripts/check-docs-redirects.mjs",
51+
"check:docs-transcript-drift": "node scripts/docs-audit/check-docs-transcript-drift.mjs --self-test && node scripts/docs-audit/check-docs-transcript-drift.mjs",
5152
"check:docs-locale-catch-all": "node scripts/check-docs-locale-catch-all.mjs --self-test && node scripts/check-docs-locale-catch-all.mjs",
5253
"check:docs-image-tag": "node scripts/check-docs-image-tag.mjs --self-test && node scripts/check-docs-image-tag.mjs",
5354
"check:docs-image-tag-sync": "node scripts/sync-docs-image-tags.mjs --self-test",

0 commit comments

Comments
 (0)