Skip to content

Commit aa121e7

Browse files
committed
docs(spec): #6000 引入的活文档同步到分片路径 (#5837)
merge 带进来的 #4723/#6000 新增了几处描述「check:docs 曾重写两个 tracked 投影」的散文, 它们指的是当前机制而不是历史叙述,所以路径随分片一起更新:build-docs.ts、AGENTS.md、 check-regen-pending.mjs、check-generated-ledger.test.ts、schema-tree-freshness.test.ts。 另外 build-schemas.ts 里把 api-surface 说成「另一个见证者」的两处、以及 migrations/spec-changes.ts 的 Release 工作流描述,同属活文档。 ⛔ 有意不动的:所有 `src/**` 与测试里追述「当年这个 key 怎么出账」的历史叙述 (http-server.zod.ts / theme.zod.ts / data-engine.zod.ts / retry-policy.* / …), 以及 ADR 正文 —— 后者按 AGENTS.md #13 用顶部 Amended 行声明路径迁移,不改写决策记录。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011M7UwH25Unfi73UHim7ajY
1 parent d50cf19 commit aa121e7

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ regenerate those.
417417

418418
**No `check:` script regenerates anything — that is the point of the split, not an
419419
oversight.** `check:docs` used to begin with `pnpm gen:schema`, which rewrites two
420-
*tracked* files (`json-schema.manifest.json`, `authorable-surface.json`) whenever they
420+
*tracked* files (`json-schema.manifest/`, `authorable-surface/`) whenever they
421421
are behind: running the gate edited your working tree and reported nothing, so a
422422
`check:generated` run on a stale manifest printed a red `check:authorable-surface`
423423
over a file the gate two lines below had already quietly fixed (#4711, #4723). The

packages/spec/scripts/build-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const UPDATE_IMPORT_BASELINE = process.argv.includes('--update-import-baseline')
7373
// Until #4723 the question could not come up: `check:docs` was
7474
// `pnpm gen:schema && tsx scripts/build-docs.ts --check`, so the tree was rebuilt
7575
// on every run. That first step is what made a script called `check:` WRITE two
76-
// TRACKED files — `json-schema.manifest.json` and `authorable-surface.json` are
76+
// TRACKED files — `json-schema.manifest/` and `authorable-surface/` are
7777
// projections `gen:schema` repairs whenever they are behind — so running the gate
7878
// silently edited the tree of whoever ran it and left the staleness unreported.
7979
// #4711 removed exactly that from `--check`; this was the same defect at a

packages/spec/scripts/build-schemas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,12 @@ if (manifestChanged && !CHECK) {
614614
// inside them — and for a metadata-driven platform those keys ARE the
615615
// third-party API: what an author (very often an AI, ADR-0033) may write.
616616
//
617-
// Both existing witnesses look elsewhere. `api-surface.json` records exported
617+
// Both existing witnesses look elsewhere. `api-surface/` records exported
618618
// `name (kind)`, and `api-surface-signatures.json` hashes each `defineX`
619619
// factory's type as TypeScript PRINTS it — a reference (`z.input<typeof
620620
// ActionSchema>`), never structurally expanded, so member-level narrowing does
621621
// not reach the hash. `spec-changes.json` inherits the same blind spot: its
622-
// added/removed arrays are a diff of `api-surface.json`. So #3883 removed three
622+
// added/removed arrays are a diff of `api-surface/`. So #3883 removed three
623623
// authorable keys with all three witnesses green, and #3733 did the same by
624624
// ACCIDENT — `dataQuality` / `cached` outlived their keys and were silently
625625
// stripped. ADR-0059 §5 deferred this gate "until a narrowing actually slips

packages/spec/scripts/check-generated-ledger.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ describe('check:generated --reconcile-only', () => {
123123
// `turbo run test` leaves this package in — see root-index.test.ts).
124124
//
125125
// `check:docs` was `pnpm gen:schema && tsx scripts/build-docs.ts --check`. The
126-
// first half is a GENERATOR: on a stale tree it rewrites `json-schema.manifest.json`
127-
// and `authorable-surface.json`, both TRACKED. So running the gate edited the
126+
// first half is a GENERATOR: on a stale tree it rewrites `json-schema.manifest/`
127+
// and `authorable-surface/`, both TRACKED. So running the gate edited the
128128
// working tree of whoever ran it, and — because `check:generated` runs
129129
// `check:authorable-surface` first and does not stop on failure — a single
130130
// aggregate run produced a red report about a manifest that the gate two lines

packages/spec/scripts/schema-tree-freshness.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// `check:docs` used to be `pnpm gen:schema && tsx scripts/build-docs.ts --check`.
88
// That first step is a GENERATOR, and on a stale tree it rewrites two TRACKED
9-
// files (`json-schema.manifest.json`, `authorable-surface.json`), so a script
9+
// files (`json-schema.manifest/`, `authorable-surface/`), so a script
1010
// called `check:` edited the working tree of whoever ran it and left the
1111
// staleness unreported — #4711's defect at a different entry point.
1212
//

packages/spec/src/migrations/spec-changes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* The machine-readable-first change manifest, `spec-changes.json` (ADR-0087 D4).
55
*
6-
* The Release workflow diffs the current `api-surface.json` against the
6+
* The Release workflow diffs the current api-surface snapshot against the
77
* previously published one (reusing the ADR-0059 §3 gate artifact instead of
88
* discarding it), then joins the conversion table (D2) and the migration set
99
* (D3) into a single `{ from, to, added, converted, migrated, removed }` record.

scripts/check-regen-pending.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export function distIsStale(specDir = SPEC_DIR) {
7474
* rendered from — and the tree is gitignored, so nothing in a checkout carries
7575
* it. Until #4723 the question could not arise: `check:docs` ran `gen:schema` as
7676
* its first step, so the tree was regenerated on every run. That is also what
77-
* made `check:docs` a "check" that WROTE two tracked files (json-schema.manifest.json
78-
* and authorable-surface.json, whenever they were behind), which is the defect
77+
* made `check:docs` a "check" that WROTE two tracked artifacts (json-schema.manifest/
78+
* and authorable-surface/, whenever they were behind), which is the defect
7979
* #4711 removed from `--check` and #4723 removed from this composition. With the
8080
* generation gone, the freshness it silently guaranteed has to be ASSERTED, or
8181
* `check:docs` reports a verdict about a tree that predates the edit under test —

0 commit comments

Comments
 (0)