From 2a23e3d3de6746f193c0009fb96538fa856860b1 Mon Sep 17 00:00:00 2001 From: Ugur Cekmez Date: Sat, 27 Jun 2026 17:30:28 +0300 Subject: [PATCH] fix(ci): pin prettier in the schema-types drift gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The drift gate installed json-schema-to-typescript@^15 with --no-package-lock. jstt formats its output with prettier (dependency range "^3.2.5"), so the unpinned install silently adopted prettier 3.9.0 (published 2026-06-27 10:26 UTC), which collapses short union types onto a single line. That reformatted the generated types with no schema change, failing the gate on main for the #54 and #55 dependabot merges (the last green run, #53 on 06-25, predated the prettier release). The committed tests/types/eep-schemas.d.ts was unchanged throughout โ€” the toolchain moved under it. Pin json-schema-to-typescript@15.0.4 and prettier@3.9.0 exactly in the gate, document the pins in scripts/codegen-schema-types.mjs, and regenerate tests/types/eep-schemas.d.ts against them so CI and the committed file agree deterministically. Signed-off-by: Ugur Cekmez Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/test.yml | 9 ++++++++- scripts/codegen-schema-types.mjs | 10 ++++++++-- tests/types/eep-schemas.d.ts | 18 ++---------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cc8ae7..e552fac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -417,7 +417,14 @@ jobs: node-version: '22' - name: Install codegen dependency - run: npm install --no-save --no-package-lock json-schema-to-typescript@^15 + # Pin BOTH json-schema-to-typescript and prettier to exact versions. + # jstt formats its output with prettier (dep range "^3.2.5"), so an + # unpinned install silently adopts new prettier releases and reformats + # the generated types โ€” drift with no schema change. prettier 3.9.0 + # (2026-06-27) collapsed short union types onto one line and broke this + # gate on main. The committed tests/types/eep-schemas.d.ts is generated + # against exactly these versions; bump them here and regenerate together. + run: npm install --no-save --no-package-lock json-schema-to-typescript@15.0.4 prettier@3.9.0 - name: Check generated schema types are up to date # The script's --check mode generates the output to memory and diff --git a/scripts/codegen-schema-types.mjs b/scripts/codegen-schema-types.mjs index 564b593..0cc7342 100644 --- a/scripts/codegen-schema-types.mjs +++ b/scripts/codegen-schema-types.mjs @@ -14,10 +14,16 @@ * node scripts/codegen-schema-types.mjs # generate * node scripts/codegen-schema-types.mjs --check # generate to a temp dir and compare * - * Dependencies (devDependencies of the repo root): - * - json-schema-to-typescript + * Dependencies (pin these EXACTLY โ€” json-schema-to-typescript formats its + * output with prettier, so an unpinned prettier silently reformats the + * generated types and breaks the drift gate with no schema change): + * - json-schema-to-typescript@15.0.4 + * - prettier@3.9.0 * - datamodel-code-generator (Python, run via pipx in CI) * + * Install locally before regenerating: + * npm install --no-save --no-package-lock json-schema-to-typescript@15.0.4 prettier@3.9.0 + * * This script is intentionally modest: it does not aim to replace the * hand-maintained TypeScript surfaces in @eep-dev/* packages. Its job * is to be a *drift sentinel*: if a schema changes, the generated file diff --git a/tests/types/eep-schemas.d.ts b/tests/types/eep-schemas.d.ts index 45daf50..0601263 100644 --- a/tests/types/eep-schemas.d.ts +++ b/tests/types/eep-schemas.d.ts @@ -224,14 +224,7 @@ export interface AuditEntry { * For gate events: the type of gate requirement (credential, payment, agreement, data_request, identity, combined). */ gate_type?: - | 'credential' - | 'payment' - | 'agreement' - | 'data_request' - | 'identity' - | 'allowlist' - | 'reciprocal' - | 'combined'; + 'credential' | 'payment' | 'agreement' | 'data_request' | 'identity' | 'allowlist' | 'reciprocal' | 'combined'; /** * Short machine-readable reason code for failures. Not surfaced to requesting agents (logged internally only per EEP ยง10.8). */ @@ -2122,14 +2115,7 @@ export interface RegistryEntry { * Gate requirement types supported by this publisher. Agents filter by gate type when selecting interaction partners (e.g., ?gate=payment). */ gate_types?: ( - | 'credential' - | 'identity' - | 'agreement' - | 'data_request' - | 'payment' - | 'combined' - | 'proof_of_intent' - | 'public' + 'credential' | 'identity' | 'agreement' | 'data_request' | 'payment' | 'combined' | 'proof_of_intent' | 'public' )[]; /** * Protocol layers supported. Agents filter by layer capability (e.g., ?supports=sse).