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).