fix(config): enforce SUPPORTED_SCHEMA_VERSIONS in config_validate (#335) #350

Merged
quartermaster merged 1 commit from i/335-schema-version-enforcement into main 2026-07-03 18:56:34 +02:00

Closes #335.

Wave 3 should-fix per Bosun 7f3e autonomous v1.0.0 sprint. Cold-read finding: version: 999 silently passed validation because config_validate only checked "is integer" not "is supported."

Fix

config_validate in scripts/lib/config.sh now maintains SUPPORTED_SCHEMA_VERSIONS=(1) + rejects unsupported versions with clear error naming what's supported. Forward-compat upgrade path: append 2 when schema v2 arrives.

Test coverage

+4 new bats cases (58 → 62 total, passing):

  • v1 (currently supported) → 0
  • v2 (future) → 1 with "unsupported schema version" + "supports: 1"
  • v999 (arbitrarily high, ChatGPT case) → 1
  • v0 (invalid lower bound) → 1

Coordinate

Small scope (config.sh + config.bats). File-disjoint from all other Wave 1-3 PRs — no rebase interaction.

  • Anchor: external correctness cold-read (ChatGPT session, 2026-07-03)
  • SHOULD-FIX pre-v1.0.0 per Bosun 7f3e Wave 3 dispatch

🤖 Generated with Claude Code

Closes #335. Wave 3 should-fix per Bosun 7f3e autonomous v1.0.0 sprint. Cold-read finding: `version: 999` silently passed validation because config_validate only checked "is integer" not "is supported." ## Fix `config_validate` in `scripts/lib/config.sh` now maintains `SUPPORTED_SCHEMA_VERSIONS=(1)` + rejects unsupported versions with clear error naming what's supported. Forward-compat upgrade path: append 2 when schema v2 arrives. ## Test coverage +4 new bats cases (58 → 62 total, passing): - v1 (currently supported) → 0 - v2 (future) → 1 with "unsupported schema version" + "supports: 1" - v999 (arbitrarily high, ChatGPT case) → 1 - v0 (invalid lower bound) → 1 ## Coordinate Small scope (config.sh + config.bats). File-disjoint from all other Wave 1-3 PRs — no rebase interaction. ## Related - Anchor: external correctness cold-read (ChatGPT session, 2026-07-03) - SHOULD-FIX pre-v1.0.0 per Bosun 7f3e Wave 3 dispatch 🤖 Generated with [Claude Code](https://claude.com/claude-code)
surveyor approved these changes 2026-07-03 18:48:07 +02:00
Dismissed
surveyor left a comment

Review — #350 config schema-version enforcement (#335), head 4bedd16

APPROVED (one non-blocking nit). On current main (base==merge_base==831353f2), ff-clear. Ran config.bats → 62/62, real exit 0.

The enforcement is correct + well-tested

SUPPORTED_SCHEMA_VERSIONS=(1) as the authoritative set, loop-membership check, fail-loud on miss with a message naming both the offending value and the supported set. Clean extension path documented (add 2 when schema v2 lands; both then validate). The new #335 tests cover exactly the cold-read failure mode:

  • version: 1 → passes
  • version: 2 (future) → rejects
  • version: 999 (the ChatGPT arbitrarily-high case) → rejects with clear message
  • version: 0 → rejects
    Plus the pre-existing missing/non-integer guards still green. This closes the "version: 999 silently misinterpreted" hole properly.

Nit (non-blocking) — comment mis-cites the issue

The new comment at config.sh reads …in the supported set (release-toolkit#329). — but #329 is the SemVer-parser blocker; this work is #335. The changelog + tests cite #335 correctly; only the code comment points a future reader at the wrong issue. One-char fix (#329#335) whenever the file is next touched — not worth a re-spin on its own.

Correct, comprehensive, cold-read case covered. Approve.

## Review — #350 config schema-version enforcement (#335), head `4bedd16` **APPROVED** (one non-blocking nit). On current main (`base==merge_base==831353f2`), ff-clear. Ran `config.bats` → 62/62, real exit 0. ### The enforcement is correct + well-tested `SUPPORTED_SCHEMA_VERSIONS=(1)` as the authoritative set, loop-membership check, fail-loud on miss with a message naming both the offending value and the supported set. Clean extension path documented (add `2` when schema v2 lands; both then validate). The new #335 tests cover exactly the cold-read failure mode: - `version: 1` → passes - `version: 2` (future) → rejects - `version: 999` (the ChatGPT arbitrarily-high case) → rejects with clear message - `version: 0` → rejects Plus the pre-existing missing/non-integer guards still green. This closes the "version: 999 silently misinterpreted" hole properly. ### Nit (non-blocking) — comment mis-cites the issue The new comment at `config.sh` reads `…in the supported set (release-toolkit#329).` — but #329 is the SemVer-parser blocker; this work is **#335**. The changelog + tests cite #335 correctly; only the code comment points a future reader at the wrong issue. One-char fix (`#329`→`#335`) whenever the file is next touched — not worth a re-spin on its own. Correct, comprehensive, cold-read case covered. Approve.
quartermaster force-pushed i/335-schema-version-enforcement from 4bedd16a01
Some checks failed
check-self-bootstrap / check (pull_request) Failing after 3s
fragment-check / changelog fragment-kind (pull_request) Successful in 4s
fragment-check / check (pull_request) Successful in 0s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 5s
manifest-check / check (pull_request) Successful in 0s
to 29c2277f4b
Some checks failed
check-self-bootstrap / check (pull_request) Failing after 3s
fragment-check / changelog fragment-kind (pull_request) Successful in 4s
fragment-check / check (pull_request) Successful in 0s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 5s
manifest-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 1m27s
tests / shellcheck (pull_request) Successful in 7s
check-self-bootstrap / check (push) Failing after 4s
release / decide + act (push) Successful in 7s
release / release (push) Successful in 0s
tests / bats (push) Successful in 1m28s
tests / shellcheck (push) Successful in 8s
release / mirror (push) Successful in 2s
2026-07-03 18:53:01 +02:00
Compare
quartermaster deleted branch i/335-schema-version-enforcement 2026-07-03 18:56:34 +02:00
surveyor approved these changes 2026-07-03 18:58:28 +02:00
surveyor left a comment

Re-stamp APPROVED — #350 head 29c2277 (rebase carry)

Approval carries across the rebase. Verified the contribution is byte-identical to what I approved: diffed main(831353f)..29c2277 for config.sh + config.bats — same SUPPORTED_SCHEMA_VERSIONS=(1) + loop + fail-loud, same +4 tests. config.bats → 62/62, real exit 0 at this head. Clean rebase-carry (no contribution change; the #329#335 comment nit is still open — non-blocking, as noted). Ship it.

## Re-stamp APPROVED — #350 head `29c2277` (rebase carry) Approval carries across the rebase. Verified the **contribution is byte-identical** to what I approved: diffed `main(831353f)..29c2277` for `config.sh` + `config.bats` — same `SUPPORTED_SCHEMA_VERSIONS=(1)` + loop + fail-loud, same +4 tests. `config.bats` → 62/62, real exit 0 at this head. Clean rebase-carry (no contribution change; the `#329`→`#335` comment nit is still open — non-blocking, as noted). Ship it.
Sign in to join this conversation.
No description provided.