Freshness-gate completeness: url-routes + Kotlin regenerate-and-diff
Extends #456 (regenerate-and-diff freshness gates for TS/Ruby/Go) to close the two remaining gaps in the generated-artifact gating surface. Behavior-neutral hardening — no runtime change.
Part A — url-routes.json
scripts/generate-url-routes produces go/pkg/basecamp/url-routes.json (consumed via //go:embed in url.go). A non-mutating url-routes-check target already existed but was wired into neither make check nor CI, so the artifact could silently drift while every other generated artifact is gated. This adds it to the make check prerequisites (a fast, non-mutating script run) and to the test-go CI job.
Part B — Kotlin regenerate-and-diff
Root make check ran only the fast, coverage-only kt-check-drift (operationId-set compare); the authoritative regenerate-and-diff ran solely in CI as a mutating git status --porcelain. This adds:
scripts/check-kotlin-generated-drift.sh— the Kotlin sibling of the other five service-drift scripts. It regenerates the wholegenerated/tree into a temp dir anddiff -rqs, so it is non-mutating and detects both missing and extra files. The whole@generatedtree is generated (base class lives outside it) and nothing embeds a wall-clock stamp, so no exclusions or timestamp normalization are needed. Includes ajava-toolchain guard that exits 2 when the JVM is absent, mirroring the Swift sibling.kt-check-generated-driftMake target — deliberately kept out of the defaultmake check(a:generator:runis a heavy JVM/Gradle-daemon startup). The fastkt-check-driftstays inmake checkunchanged.- The
test-kotlinCI step now invokesmake kt-check-generated-drift, so CI exercises both the target and the shared non-mutating script.
Verification
make url-routes-checkandmake kt-check-generated-driftexit 0 on clean main and are non-mutating (git status --porcelainempty after each).- Negative proofs: a throwaway edit to
url-routes.jsonfailsurl-routes-check; a throwaway edit to a generated Kotlin file fails the fresh gate; both restore cleanly. java-absent → the Kotlin script exits 2 (proven).make checkgreen;shellcheckclean;lint-actionsclean.
Summary by cubic
Adds non-mutating freshness gates for url-routes.json and the Kotlin SDK to prevent drift and align with other generated artifacts. Wired into make check and CI; no runtime changes.
-
New Features
- Added
url-routes-checktomake checkand the Go CI job to gatego/pkg/basecamp/url-routes.json. - Added Kotlin regenerate-and-diff gate:
scripts/check-kotlin-generated-drift.shandkt-check-generated-drift(non-mutating; regenerates into a temp dir and diffs; catches missing and extra files). CI now runs it viamake kt-check-generated-drift; kept out of defaultmake checkto avoid JVM startup cost. UpdatedSPEC.mdto list bothurl-routes-checkand Kotlin’s standalone gate.
- Added
-
Bug Fixes
- Hardened Kotlin script: quote each Gradle
--argspath, honorJAVA_HOMEfirst (fallback to PATH), treat missing committed tree as drift, and distinguishdiffexit 1 (drift) vs ≥2 (tool error). Message now guides pruning unexpected extra files.
- Hardened Kotlin script: quote each Gradle