From 728cd61d7c1f67ce2f4588370bec952cd912844e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20=C5=9Eafak?= Date: Sun, 22 Nov 2026 13:38:12 +0300 Subject: [PATCH] feat: open meta.lang to a pattern and add malformed-lang case (conformance 1.11.0) --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++ CONFORMANCE_VERSION | 2 +- README.md | 20 +++++++++++++---- fixtures/malformed-lang.json | 15 +++++++++++++ manifest.json | 15 ++++++++++--- schema/message-envelope.schema.json | 4 ++-- schema/results.example.json | 2 +- 7 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 fixtures/malformed-lang.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8488937..4b2a868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,39 @@ All notable changes to the conformance suite. The version is `CONFORMANCE_VERSIO case that contradicted the contract, which a MINOR may correct and must list explicitly). The per-version prose history lives in `README.md` under "Suite version history". +## 1.11.0 + +Governing decisions: ADR-0040 (open producer-language tag). R2 plan (R2-E4), phase 02. + +### Added + +- Roundtrip case `malformed-lang` (`fixtures/malformed-lang.json`): `meta.lang: "Rust 1"` does not match the open + tag pattern `^[a-z][a-z0-9-]*$`, so the fixture is flagged `producer_schema_valid: false`. A consumer decodes it + without error and re-emits `meta.lang` unchanged (`expect_attempts` 1, `/meta/lang` = `"Rust 1"`). + +### Changed + +- `schema/message-envelope.schema.json`: `meta.lang` and `dead_letter.lang` are `{"type": "string", "pattern": + "^[a-z][a-z0-9-]*$"}` instead of the enum `php | go | python | java | dotnet | node`. The file is byte-identical to + `.ssot/contracts/message-envelope.schema.json`. + +### Corrected + +- Roundtrip case `unknown-lang`: the `producer_schema_valid: false` flag is removed. This is the one existing + expectation that changes, and it changes because it contradicted the contract: with `lang` an open pattern, + `"cobol"` matches it and the fixture passes the producer schema. Its consumer behaviour (decode without error, + re-emit `"cobol"`) is unchanged. + +### Compatibility + +- No other case or expectation changed; `fetch.sh`, `sync.sh`, `schema/results.schema.json` and the other + `fixtures/*.json` are untouched. The wire envelope is unchanged (`schema_version: 1`); only the schema's + description of `lang` was widened. A runner that ignores `producer_schema_valid` and an SDK that already + passes `unknown-lang` need no change; a runner that read `producer_schema_valid: false` on `unknown-lang` as + "must fail the schema" must drop that assumption. +- `CONFORMANCE_VERSION`, `manifest.json` `conformance_version` and `schema/results.example.json` are `1.11.0`. The + release asset is published from the `v1.11.0` tag in a later phase (R2 phase 05). + ## 1.10.0 Governing decisions: ADR-0024 (SDK payload schema validation) and K-17 (the dependency-free Draft-07 subset: diff --git a/CONFORMANCE_VERSION b/CONFORMANCE_VERSION index 81c871d..1cac385 100644 --- a/CONFORMANCE_VERSION +++ b/CONFORMANCE_VERSION @@ -1 +1 @@ -1.10.0 +1.11.0 diff --git a/README.md b/README.md index f13fc8e..a7de393 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,8 @@ so an old runner stays green but does not cover the DLQ path until it is wired. | :--- | :--- | | `unknown-meta-roundtrip` | `meta.vendor_flag` (`true`) and nested `meta.vendor_ctx` come back unchanged; `attempts` 0 → 1. | | `unknown-toplevel-roundtrip` | Top-level `extra_top` (`1`) comes back unchanged; `attempts` 1 → 2. | -| `unknown-lang` | `meta.lang: "cobol"` decodes without error and is re-emitted as `"cobol"`. | +| `unknown-lang` | `meta.lang: "cobol"` decodes without error and is re-emitted as `"cobol"`. Since 1.11.0 it matches the open tag pattern and passes the producer schema (ADR-0040). | +| `malformed-lang` | (1.11.0) `meta.lang: "Rust 1"` (does not match `^[a-z][a-z0-9-]*$`) decodes without error and is re-emitted as `"Rust 1"` (ADR-0040 consumer tolerance); `attempts` 0 → 1. | | `empty-data-roundtrip` | `data: {}` comes back as an **object** `{}`, never `[]`. | | `wrong-case-keys-roundtrip` | A valid envelope that also carries `JOB`, `Data` and `meta.Queue`: the canonical `job` / `data` / `meta.queue` are unchanged and the three wrongly cased keys come back with their own values; `attempts` 0 → 1. | | `meta-ext-vendor-roundtrip` | (1.4.0) Vendor blocks under `meta.ext.` (`acme`, `globex`) with nested objects and arrays come back unchanged (ADR-0031); `attempts` 0 → 1. | @@ -278,10 +279,12 @@ so an old runner stays green but does not cover the DLQ path until it is wired. | `urn-only-roundtrip` | (1.4.0) Only `urn`, no `job`: accepted, the URN is read from `urn`, the re-emit has `/job` = the URN and no `/urn`. No warning (the alias is the identity source). | | `blank-ascii-job-urn-fallback` | (1.4.0) `job` is two spaces, `urn` present: the blank `job` counts as absent, so the URN falls back to `urn`; re-emit has `/job` = the URN and no `/urn`. Blank means empty or only ASCII whitespace (space, `\t`, `\n`, `\v`, `\f`, `\r`). | -`producer_schema_valid: false` (on `unknown-lang` and `urn-only-roundtrip`) marks a +`producer_schema_valid: false` (on `malformed-lang` and `urn-only-roundtrip`) marks a **consumer-tolerance** fixture: like `urn-alias`, it intentionally fails the producer JSON -Schema (`meta.lang` is an enum there; `job` is required) but a consumer MUST still accept and -faithfully re-emit it. +Schema (`meta.lang` must match `^[a-z][a-z0-9-]*$` there; `job` is required) but a consumer MUST +still accept and faithfully re-emit it. Until 1.10.0 `unknown-lang` (`"cobol"`) carried the flag +too, because `meta.lang` was a closed enum; since 1.11.0 (ADR-0040) it is an open pattern, `"cobol"` +matches it, and the flag is removed from that case. ### `data_shape` — `data` is always an object @@ -670,6 +673,15 @@ the block's note). The three standalone transport repos (node-adapters, `babelqu ## Suite version history +- **1.11.0** — ADR-0040, R2-E4. + Opens the producer-language tag: `meta.lang` and `dead_letter.lang` in `schema/message-envelope.schema.json` are + now `^[a-z][a-z0-9-]*$` instead of the six-value enum (the schema is byte-identical to + `.ssot/contracts/message-envelope.schema.json`). Adds the roundtrip case `malformed-lang` (`meta.lang: "Rust 1"`, + `producer_schema_valid: false`, decoded and re-emitted unchanged). Corrects one existing expectation: `unknown-lang` + (`"cobol"`) now matches the pattern, so its `producer_schema_valid: false` flag is removed (the flag contradicted the + contract once the enum was opened). No other case changed; `fetch.sh`, `sync.sh` and `schema/results.schema.json` are + untouched. See `CHANGELOG.md`. + - **1.10.0** — ADR-0024, K-17. Adds the `core`-scoped section `payload_schema_keywords` (66 cases): union `type` arrays, numeric equality in `const` / `enum` (recursive; `1` = `1.0` = `1e0`, `true` is not `1`), the one-warning-per-unsupported-keyword diff --git a/fixtures/malformed-lang.json b/fixtures/malformed-lang.json new file mode 100644 index 0000000..790edfd --- /dev/null +++ b/fixtures/malformed-lang.json @@ -0,0 +1,15 @@ +{ + "job": "urn:babel:orders:created", + "trace_id": "7b3f9c2a-e41d-4f88-9b2a-1c0d5e6f7a8b", + "data": { + "order_id": 1042 + }, + "meta": { + "id": "f1e2d3c4-b5a6-4789-90ab-cdef01234567", + "queue": "orders", + "lang": "Rust 1", + "schema_version": 1, + "created_at": 1749132727000 + }, + "attempts": 0 +} diff --git a/manifest.json b/manifest.json index 637f8dd..a8e5b1e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "schema_version": 1, - "conformance_version": "1.10.0", + "conformance_version": "1.11.0", "sections": { "cases": { "scope": "core" @@ -626,13 +626,22 @@ { "name": "unknown-lang", "file": "fixtures/unknown-lang.json", - "description": "A meta.lang outside the known language list (a future/community SDK) is decoded without error and re-emitted unchanged — a consumer MUST NOT reject or rewrite it.", - "producer_schema_valid": false, + "description": "A meta.lang outside the built-in language list (a future/community SDK) is decoded without error and re-emitted unchanged — a consumer MUST NOT reject or rewrite it. Since 1.11.0 (ADR-0040) the tag 'cobol' matches the open pattern ^[a-z][a-z0-9-]*$, so this fixture passes the producer JSON Schema.", "expect_attempts": 1, "expect_preserved": { "/meta/lang": "cobol" } }, + { + "name": "malformed-lang", + "file": "fixtures/malformed-lang.json", + "description": "A meta.lang that does not match the open tag pattern ^[a-z][a-z0-9-]*$ (upper case and a space) is a producer-side violation, but a consumer is tolerant (ADR-0040): it is decoded without error and re-emitted unchanged — a consumer MUST NOT reject or rewrite it.", + "producer_schema_valid": false, + "expect_attempts": 1, + "expect_preserved": { + "/meta/lang": "Rust 1" + } + }, { "name": "empty-data-roundtrip", "file": "fixtures/empty-data-roundtrip.json", diff --git a/schema/message-envelope.schema.json b/schema/message-envelope.schema.json index cdfaff7..b1f1e5e 100644 --- a/schema/message-envelope.schema.json +++ b/schema/message-envelope.schema.json @@ -46,7 +46,7 @@ }, "lang": { "type": "string", - "enum": ["php", "go", "python", "java", "dotnet", "node"], + "pattern": "^[a-z][a-z0-9-]*$", "description": "Producer language tag." }, "schema_version": { @@ -101,7 +101,7 @@ }, "lang": { "type": "string", - "enum": ["php", "go", "python", "java", "dotnet", "node"], + "pattern": "^[a-z][a-z0-9-]*$", "description": "Language of the SDK that dead-lettered the message." } } diff --git a/schema/results.example.json b/schema/results.example.json index d8caff0..12fb1e1 100644 --- a/schema/results.example.json +++ b/schema/results.example.json @@ -1,7 +1,7 @@ { "sdk": "example-sdk/redis", "version": "1.9.0", - "conformance_version": "1.10.0", + "conformance_version": "1.11.0", "generated_at": "2026-10-18T09:30:00Z", "bindings": [ "redis",