Skip to content

Commit c64a07e

Browse files
committed
test(spec): drop the react-blocks allowance row from the choke-point pin
With the react-tier contract generator projecting through projectPublishedJsonSchema, its direct-call allowance in published-projection-choke-point.test.ts no longer describes the tree: remove the row and the prose that named it, and hold the generator to the helper the way build-schemas.ts and build-openapi.ts are held (PUBLISHED_PRODUCERS). The choke point's own docblock named the generator as a direct caller outside the helper; it now lists it as the fifth producer. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QcAS3qiYYZNezaxZxaUdMV
1 parent 8a9fe89 commit c64a07e

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

‎packages/spec/scripts/lib/refinement-projection.ts‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export interface ProjectionOverrideContext {
294294

295295
/**
296296
* ⭐ The ONE call through which `z.toJSONSchema` is reached anywhere
297-
* **`packages/spec` writes a published JSON Schema artifact**. Four producers,
297+
* **`packages/spec` writes a published JSON Schema artifact**. Five producers,
298298
* named because the claim is only worth as much as its enumeration:
299299
*
300300
* 1. `build-schemas.ts` — the generator's three attempts, writing
@@ -307,11 +307,16 @@ export interface ProjectionOverrideContext {
307307
* `json-schema/openapi.json`. That file ships in the tarball (`files[]`
308308
* carries `json-schema`) and is exported as `./openapi.json`, so it is a
309309
* published projection like any other; it reached this list late, and the
310-
* shape of the gap is the point — see below.
310+
* shape of the gap is the point — see below;
311+
* 5. `build-react-blocks-contract.ts` — the react-tier contract generator,
312+
* rendering its block schemas' projection as markdown prop tables into
313+
* the published skills catalog (`skills/objectstack-ui/references/
314+
* react-blocks.md`). Not a JSON Schema file, but a published description
315+
* of the same schemas, so it projects the way (1) does.
311316
*
312317
* ## ⛔ What is NOT behind it — stated so the next reader need not re-derive it
313318
*
314-
* This helper governs the projection CALL for the four producers above. It is
319+
* This helper governs the projection CALL for the five producers above. It is
315320
* ⛔ not a repo-wide guarantee, and three populations sit deliberately outside
316321
* it. Naming them is the difference between a claim and a slogan; each was
317322
* measured, not assumed:
@@ -323,12 +328,10 @@ export interface ProjectionOverrideContext {
323328
* question.
324329
* - **Producers outside `packages/spec`'s own artifacts** — the CLI's
325330
* `os generate` writes a JSON Schema of `ObjectStackDefinitionSchema` into
326-
* an author's project, and `build-react-blocks-contract.ts` renders block
327-
* prop tables into the published skills catalog. Both call
328-
* `z.toJSONSchema` directly, and the first was measured DIVERGENT from this
329-
* projection at seven declared sites. They are a separate decision about
330-
* how wide the published-projection guarantee reaches, ⛔ not an oversight
331-
* to be silently swept in here.
331+
* an author's project. It calls `z.toJSONSchema` directly and was measured
332+
* DIVERGENT from this projection at seven declared sites. That is a
333+
* separate decision about how wide the published-projection guarantee
334+
* reaches, ⛔ not an oversight to be silently swept in here.
332335
* - **Runtime derivations** (`packages/metadata-protocol`) project schemas to
333336
* SERVE them, not to publish an artifact; they are governed by their own
334337
* contracts.

‎packages/spec/scripts/published-projection-choke-point.test.ts‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@
2727
*
2828
* ## Why an allowance table and not a flat zero
2929
*
30-
* Two files in this tree hold calls that are legitimately direct (two calls
31-
* in all), and each is a different reason rather than one exemption repeated:
30+
* Beside the choke point itself, one file in this tree holds a call that is
31+
* legitimately direct, for a reason of its own rather than an exemption:
3232
*
3333
* - `union-branch-projection.ts`'s `projectsUnderStrictMode` asks zod whether
3434
* a node is representable at all and DISCARDS the result — a yes/no
35-
* question, not a projection;
36-
* - `build-react-blocks-contract.ts` renders a markdown prop table into the
37-
* governed `skills/**` catalog — a published artifact, but not a published
38-
* JSON Schema, and rewriting it is a governed-surface decision of its own.
35+
* question, not a projection.
3936
*
40-
* Each is pinned at its exact count, so a SECOND call in any of those files
37+
* Each row is pinned at its exact count, so a SECOND call in either file
4138
* fails too, and the reason travels with the row.
4239
*
4340
* ## Why the controls are not decoration
@@ -113,15 +110,16 @@ const DECLARED_DIRECT_CALLS: ReadonlyArray<{ file: string; count: number; why: s
113110
count: 1,
114111
why: 'projectsUnderStrictMode asks zod whether a node is representable and DISCARDS the result; nothing it produces is published',
115112
},
116-
{
117-
file: 'build-react-blocks-contract.ts',
118-
count: 1,
119-
why: 'writes a markdown prop table into the governed skills catalog, not a JSON Schema artifact — measured DIVERGENT from this projection for 1 of its 3 block schemas, filed separately; routing it rewrites a skills/** file and is its own decision',
120-
},
121113
];
122114

123-
/** The producers whose output is published and must reach it through the helper. */
124-
const PUBLISHED_PRODUCERS = ['build-schemas.ts', 'build-openapi.ts'] as const;
115+
/**
116+
* The producers whose output is published and must reach it through the helper.
117+
* `build-react-blocks-contract.ts` renders its projection as markdown prop tables
118+
* into the published skills catalog rather than as a JSON Schema file, and is
119+
* held to the same projection so the two published descriptions of one schema
120+
* cannot disagree.
121+
*/
122+
const PUBLISHED_PRODUCERS = ['build-schemas.ts', 'build-openapi.ts', 'build-react-blocks-contract.ts'] as const;
125123

126124
describe('published projection choke point', () => {
127125
const sources = collectScriptSources();

0 commit comments

Comments
 (0)