Skip to content

Commit 0636ba2

Browse files
committed
test(spec): the automation contract registry counts cloneFlow; the dropped-refinements header counts its new entry
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pRVPsxnFxPBAQLUMh
1 parent 89a3277 commit 0636ba2

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/spec/dropped-refinements.baseline.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"description": "Shrink-only ledger of every PUBLISHED JSON Schema that is STILL WIDER than the Zod type it was generated from, because a rule written as `.refine()` reaches the runtime and not the file (#18670). `z.toJSONSchema()` has no arm for a `custom` check: a plain record, the same record with a `.refine()`, and the same record with an ABORTING `.refine()` all project byte-identically (measured on zod 4.4.3, the version packages/spec resolves). So a document one of these files ACCEPTS can still be refused at parse time, and an author -- or an AI -- validating against packages/spec/json-schema/** finds out a release later. Each `sites` path is a position under that schema at which a refinement is dropped; the same paths are written onto the artifact itself as `x-dropped-refinements`. Item 2 closed the first patterns: a refinement DECLARED through the closed list in src/shared/refinement-projection.ts is emitted into the published file, reads `projected` rather than `dropped`, and its row LEAVES this ledger in the same PR -- which is why the ledger shrinks and never grows on a repair. Every refinement outside that closed list stays here, and adding an arm to the list is a public-contract decision, not a refactor. Hand-edited on purpose and with no `gen:` script: a generator would let a new gap be admitted by running a command instead of by a decision, which is the silence this ledger exists to end. Adding, removing or moving a site fails packages/spec/scripts/build-schemas.ts until the line moves with it, and the failure prints the corrected entry in full. ⛔ Do not delete or weaken a refinement to shorten this file -- the runtime rule is correct; it is the projection that is silent, and the remedy is to teach the closed list a NAMED pattern, never to drop the rule.",
33
"measured": {
44
"zod": "4.4.3",
5-
"publishedSchemasWithDroppedRefinements": 246,
6-
"droppedRefinementSites": 948,
5+
"publishedSchemasWithDroppedRefinements": 247,
6+
"droppedRefinementSites": 951,
77
"refinementSitesThatDidProject": 369,
88
"refinementSitesWithNoJsonFormToCompare": 0
99
},

‎packages/spec/src/api/automation-api.zod.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,13 @@ describe('AutomationApiErrorCode', () => {
893893
// ==========================================
894894

895895
describe('AutomationApiContracts', () => {
896-
it('should define all 8 contract endpoints', () => {
896+
it('should define all 9 contract endpoints', () => {
897897
// 9 -> 8: `listFlows` (`GET /api/v1/automation`) retired with its route
898898
// (#19543) — flows are listed through `GET /api/v1/meta/flow`.
899-
expect(Object.keys(AutomationApiContracts)).toHaveLength(8);
899+
// 8 -> 9: `cloneFlow` (`POST /api/v1/automation/:name/clone`) gained its
900+
// request/response schemas (#28149, ADR-0146 D4 "new similar").
901+
expect(Object.keys(AutomationApiContracts)).toHaveLength(9);
902+
expect(AutomationApiContracts).toHaveProperty('cloneFlow');
900903
});
901904

902905
it('declares no flow-list entry and no GET at the bare /api/v1/automation path', () => {

0 commit comments

Comments
 (0)