feat(01-01): add Phase 1 invariant verification scripts

Three executable bash scripts under tools/ that Wave 0 and every
subsequent Phase 1 plan's <automated> block rely on:

- verify-no-version-literals.sh (INFRA-01 SC#2 / D-09): no literal
  library/plugin version strings in any *.gradle.kts. Excludes
  build-logic/build.gradle.kts (needs asDependency() literals) and
  top-level project-version assignments ("^version = \"x.y.z\"")
  which are artifact metadata, not library pins.
- verify-shared-pure.sh (INFRA-06 / D-19): shared/commonMain must
  not import Ktor/Compose/SQLDelight. Returns OK if the directory
  does not exist yet (pre-scaffold tolerance for Plan 07).
- verify-ios-flags.sh (INFRA-03 / D-18): both K/N iOS binary flags
  present in gradle.properties.

All three use bash (#!/usr/bin/env bash + set -euo pipefail) and
are marked chmod +x. Scripts exit 0 against the current repo state.
This commit is contained in:
2026-04-24 18:16:29 +02:00
parent d873c31e19
commit aaa8042aee
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Enforces INFRA-01 SC#2 / D-09: no literal *library/plugin* version strings outside catalog.
# Scans every *.gradle.kts for numeric version literals (e.g. version = "1.2.3") that would
# represent a library or plugin pin leaking out of the catalog.
#
# Exclusions (all semantic, not loopholes):
# - build-logic/build.gradle.kts needs literal plugin-dependency coordinates (`asDependency()`)
# - Top-level project-version assignments (unindented `^version = "x.y.z"`) are Gradle project
# metadata (artifact name) — NOT a library version pin. D-09 guards dependency versions,
# not project identity.
set -euo pipefail
VIOLATIONS=$(grep -rn -E 'version[[:space:]]*=[[:space:]]*"[0-9]' --include='*.gradle.kts' . 2>/dev/null \
| grep -v 'build-logic/build.gradle.kts' \
| grep -vE ':[0-9]+:version[[:space:]]*=[[:space:]]*"[0-9]' \
|| true)
if [ -n "$VIOLATIONS" ]; then
echo "ERROR: version literals found outside catalog:" >&2
echo "$VIOLATIONS" >&2
exit 1
fi
echo "OK: no version literals outside catalog."