Skip to content

Commit a65a4bc

Browse files
authored
docs(agents): list which spec artifact each CI gate guards, and how to regenerate it (#4046)
`packages/spec` has eight checked-in generated artifacts, each with its own CI gate, split across two jobs that run their gates sequentially — so the first stale artifact masks every one behind it and you get one red build per artifact. AGENTS.md documented the auto-gen boundary but never mapped a change to the generator it invalidates. #4040 paid that twice, neither time a logic error: a `.describe()` string landed in content/docs/references/ (check:docs), and one new export landed in api-surface.json (check:api-surface) — the second only visible once the first was fixed. Adds a change → gate → regenerate table plus a loop that runs all eight, and records that check:liveness / check:empty-state / check:skill-examples / check:react-conformance have no generator (a failure there is a real finding). Also documents a trap found while verifying it: check:api-surface reads the built dist/*.d.ts, so a stale dist reports exports as REMOVED when nothing was removed.
1 parent ec36ba8 commit a65a4bc

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
---
3+
4+
Docs only — no package changes, nothing to release.
5+
6+
AGENTS.md now maps each `packages/spec` change to the generated artifact it
7+
invalidates and the CI gate that catches it. The eight gates live in two jobs that
8+
run them sequentially, so the first stale artifact masks the rest — #4040 got one
9+
red build per artifact (a `.describe()` string via `check:docs`, then five new
10+
exports via `check:api-surface`) with no logic error involved either time.
11+
12+
Also records the `check:api-surface` trap: it reads the built `dist/*.d.ts`, so a
13+
stale `dist` reports exports as REMOVED when nothing was removed.

AGENTS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,49 @@ Root also exports: `defineStack`, `composeStacks`, `defineView`, `defineApp`, `d
195195
| `content/docs/getting-started/` | hand-written ||
196196
| `content/docs/protocol/` | hand-written ||
197197

198+
### Touched `packages/spec`? Regenerate its artifacts BEFORE pushing
199+
200+
`packages/spec` has **eight** checked-in generated artifacts, each with its own CI gate.
201+
They live in two different jobs (`TypeScript Type Check` in `lint.yml`, `Check Generated
202+
Artifacts` in `ci.yml`), and each job runs its gates **sequentially** — so the first
203+
stale artifact masks every one behind it, and you get one red build per artifact instead
204+
of one for all of them. Match the change to the gate and regenerate up front:
205+
206+
| You changed | Gate that fails | Regenerate with `pnpm --filter @objectstack/spec …` |
207+
|:---|:---|:---|
208+
| A `.describe()` / TSDoc on any schema | `check:docs` | `gen:schema && gen:docs` |
209+
| A public export (added / removed / renamed) | `check:api-surface` | `gen:api-surface` |
210+
| An authorable key on a metadata schema | `check:authorable-surface` | `gen:schema` |
211+
| An ADR-0087 conversion / migration registry | `check:spec-changes`, `check:upgrade-guide` | `gen:spec-changes`, `gen:upgrade-guide` |
212+
| A `SKILL.md` (frontmatter or body) | `check:skill-docs`, `check:skill-refs` | `gen:skill-docs`, `gen:skill-refs` |
213+
| The react-blocks contract | `check:react-blocks` | `gen:react-blocks` |
214+
215+
A `.describe()` string counts — it is not "just a comment", it lands in
216+
`content/docs/references/`. Adding one export counts — it lands in `api-surface.json`.
217+
Both were learned the hard way in #4040: two separate red builds, neither a logic error.
218+
219+
Cheapest way to be sure, since a gate is just its generator in `--check` mode — run the
220+
whole set and let it tell you which artifact is stale:
221+
222+
```bash
223+
cd packages/spec
224+
pnpm build # REQUIRED first — see the dist caveat below
225+
for c in check:docs check:api-surface check:authorable-surface check:spec-changes \
226+
check:upgrade-guide check:skill-refs check:skill-docs check:react-blocks; do
227+
printf '%-28s ' "$c"; pnpm -s $c >/dev/null 2>&1 && echo PASS || echo FAIL
228+
done
229+
```
230+
231+
⚠️ **`check:api-surface` reads the built `dist/*.d.ts`, not `src/`.** A stale `dist`
232+
makes it report exports as **removed** — "N breaking (removed/narrowed)" — when nothing
233+
was removed at all: the snapshot is simply newer than your build. Rebuild before you
234+
believe it, and before you file a bug about `main` being red. (Two phantom "breaking
235+
removals" this way while writing this section.)
236+
237+
`check:liveness`, `check:empty-state`, `check:skill-examples` and
238+
`check:react-conformance` are pure checks with no generator — a failure there is a real
239+
finding to fix, not an artifact to regenerate.
240+
198241
---
199242

200243
## Context Routing — apply the right role per path

0 commit comments

Comments
 (0)