Skip to content

Commit e70b0af

Browse files
committed
docs(ui): treat the generated component reference as generated in the audit scope and the merge driver
The docs-accuracy audit's hand-written scope now excludes content/docs/ui/components/** beside references/, and the directory is routed to the os-regen merge driver with gen:sdui-reference as its regeneration. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwMyAnTNeas3ANYhyi
1 parent c698211 commit e70b0af

5 files changed

Lines changed: 36 additions & 10 deletions

File tree

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ content/docs/references/** merge=os-regen
158158
skills/*/references/_index.md merge=os-regen
159159
skills/objectstack-ui/references/react-blocks.md merge=os-regen
160160
scripts/platform-object-tenancy-census.json merge=os-regen
161+
content/docs/ui/components/** merge=os-regen

‎scripts/docs-audit/affected-docs.mjs‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
// node scripts/docs-audit/affected-docs.mjs --bridge-coverage [--json] # how much of the DECLARED client-bound route surface the `sdk` bridge can reach (diff-free)
1212
//
1313
// Scope: hand-written docs only = content/docs/**/*.mdx MINUS content/docs/references/**
14-
// (references are generated from packages/spec and handled by a separate regenerate pass).
14+
// and content/docs/ui/components/** (references are generated from packages/spec and
15+
// handled by a separate regenerate pass; the component reference is generated from
16+
// sdui.manifest.json by scripts/gen-sdui-reference.mjs, whose --check holds it).
1517
//
1618
// THE ABOVE SCOPE IS THE RECALL DENOMINATOR (#13306, maintainer ruling 2026-08-31). Any
1719
// recall figure for this tool — "of the docs pages that should have been listed, how many
@@ -198,7 +200,7 @@
198200

199201
import { execSync } from 'node:child_process';
200202
import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';
201-
import { join, relative } from 'node:path';
203+
import { join, relative, sep } from 'node:path';
202204
// The one answer to "is this span a comment, or code?" (#9367). Dependency-free and
203205
// side-effect-free on import, so the no-install contract this script runs under holds.
204206
// `codeOnly` IS the tree's one comments+literals projection (#15776), imported
@@ -1074,9 +1076,11 @@ function walk(dir, out = []) {
10741076
return out;
10751077
}
10761078
const docsRoot = join(repoRoot, 'content/docs');
1077-
const refsRoot = join(repoRoot, 'content/docs/references');
1079+
// The generated trees, each wholly written by its generator: `references/` by
1080+
// packages/spec's build-docs.ts, `ui/components/` by scripts/gen-sdui-reference.mjs.
1081+
const generatedRoots = ['content/docs/references', 'content/docs/ui/components'].map((r) => join(repoRoot, r) + sep);
10781082
const handwritten = walk(docsRoot)
1079-
.filter((p) => !p.startsWith(refsRoot))
1083+
.filter((p) => !generatedRoots.some((root) => p.startsWith(root)))
10801084
.map((p) => relative(repoRoot, p))
10811085
.sort();
10821086

‎scripts/docs-audit/check-audit-scope.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,10 @@ export function renderArtifact(docs) {
251251
{
252252
readme: [
253253
'GENERATED — do not hand-edit. `node scripts/docs-audit/check-audit-scope.mjs --write`',
254-
'derives this from the filesystem (every content/docs/**/*.mdx except references/,',
255-
'via `affected-docs.mjs --all`); the same script without --write is a CI gate that',
256-
'fails when this file and content/docs/ disagree in EITHER direction.',
254+
'derives this from the filesystem (every content/docs/**/*.mdx except the generated',
255+
'references/ and ui/components/, via `affected-docs.mjs --all`); the same script',
256+
'without --write is a CI gate that fails when this file and content/docs/ disagree',
257+
'in EITHER direction.',
257258
'',
258259
'THIS FILE IS THE SINGLE SOURCE for "which docs are hand-written". Two consumers:',
259260
' 1. .claude/workflows/docs-accuracy-audit.js — its body runs in a sandbox with no',

‎scripts/docs-audit/handwritten-docs.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"readme": [
33
"GENERATED — do not hand-edit. `node scripts/docs-audit/check-audit-scope.mjs --write`",
4-
"derives this from the filesystem (every content/docs/**/*.mdx except references/,",
5-
"via `affected-docs.mjs --all`); the same script without --write is a CI gate that",
6-
"fails when this file and content/docs/ disagree in EITHER direction.",
4+
"derives this from the filesystem (every content/docs/**/*.mdx except the generated",
5+
"references/ and ui/components/, via `affected-docs.mjs --all`); the same script",
6+
"without --write is a CI gate that fails when this file and content/docs/ disagree",
7+
"in EITHER direction.",
78
"",
89
"THIS FILE IS THE SINGLE SOURCE for \"which docs are hand-written\". Two consumers:",
910
" 1. .claude/workflows/docs-accuracy-audit.js — its body runs in a sandbox with no",

‎scripts/regen-artifacts.mjs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,25 @@ export const REGEN_ARTIFACTS = Object.freeze([
323323
check: 'check:platform-object-tenancy-census',
324324
owner: ROOT_OWNER,
325325
},
326+
// The component reference: every file under the directory is rendered whole
327+
// from the repo-root `sdui.manifest.json` by scripts/gen-sdui-reference.mjs, and
328+
// a write removes anything else there, so no hand-written region exists for a
329+
// deferral to launder. Two branches that each change the manifest produce pages
330+
// describing neither side once merged; only regenerating from the merged
331+
// manifest reaches the answer. The manifest itself is not routed — it is built
332+
// from the registry under `ui/` — so a merge resolves it first and this row's
333+
// regeneration reads the result.
334+
//
335+
// Same LOCAL-facility caveat as its neighbours: `check:sdui-reference` runs in
336+
// `lint.yml` on `pull_request` and `merge_group` with no `paths:` filter and
337+
// re-renders from the manifest rather than reading the pages back. No
338+
// `readsDist`: the generator reads the tracked manifest and nothing built.
339+
{
340+
path: 'content/docs/ui/components/**',
341+
gen: 'gen:sdui-reference',
342+
check: 'check:sdui-reference',
343+
owner: ROOT_OWNER,
344+
},
326345
]);
327346

328347
/**

0 commit comments

Comments
 (0)