Files
0pt/scripts/check-masterplan-lock.sh
siax-bot bb4cc78145
masterplan-lock / check (pull_request) Successful in 5s
masterplan-lock / check (push) Successful in 6s
CI (SIAX Cloud) / security (pull_request) Successful in 13s
CI (SIAX Cloud) / security (push) Successful in 17s
Security Scan (SIAX Cloud) / security (push) Successful in 13s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 13s
CI (SIAX Cloud) / quality (push) Successful in 35s
CI (SIAX Cloud) / integration (push) Successful in 41s
CI (SIAX Cloud) / quality (pull_request) Successful in 46s
CI (SIAX Cloud) / integration (pull_request) Successful in 48s
chore(conformance): add masterplan-lock guard + PLAN/MASTERPLAN_INDEX.md
Per siax-standard conformance sweep: repo lacked the masterplan-lock CI guard
(.gitea/workflows/masterplan-lock.yml + scripts/check-masterplan-lock.sh) and a
repo-local PLAN/MASTERPLAN_INDEX.md. Copied from sax3l/st0re template (generic
POSIX sh check), stub PLAN index with locked architecture principles and
pointer to sax3l/siax-masterplan.

Refs: sax3l/siax-standard (conformance sweep 2026-09-10)
2026-09-10 18:17:07 +02:00

54 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env sh
# check-masterplan-lock.sh
#
# Fails the build if this repo has drifted from the canonical SIAX Non-Platform
# masterplan (sax3l/siax-masterplan). Dependency-free (POSIX sh + grep only) so
# it runs before any language toolchain is installed.
#
# What it guards against:
# 1. PLAN/MASTERPLAN_INDEX.md being deleted (silent regression to a parallel
# truth with no pointer back to the canonical docs).
# 2. The "locked architecture principles" section being stripped or edited
# away, which is the actual enforcement text (one canonical owner per
# domain/truth, no cross-service SQL, no frontend-tenant-trust, no
# production-mock-fallbacks, API-first).
# 3. The status vocabulary line (MISSING -> ... -> PRODUCTION_READY) going
# missing, which would let a repo invent its own status labels.
#
# See PLAN/MASTERPLAN_INDEX.md and sax3l/siax-masterplan for the source of
# truth. Do not weaken this check to make a red build pass -- fix the drift
# in PLAN/MASTERPLAN_INDEX.md instead (or resync it from siax-masterplan).
set -eu
PLAN_FILE="PLAN/MASTERPLAN_INDEX.md"
fail=0
if [ ! -f "$PLAN_FILE" ]; then
echo "::error::${PLAN_FILE} is missing. This repo must carry a repo-local copy of the SIAX Non-Platform masterplan index (source: sax3l/siax-masterplan). Restore it -- do not remove this check."
exit 1
fi
check_contains() {
needle="$1"
label="$2"
if ! grep -qF "$needle" "$PLAN_FILE"; then
echo "::error::${PLAN_FILE} no longer contains ${label} ('${needle}'). This looks like drift away from the canonical masterplan (sax3l/siax-masterplan). Refresh PLAN/MASTERPLAN_INDEX.md from source instead of editing this check."
fail=1
fi
}
check_contains "Låsta arkitekturprinciper" "the locked-architecture-principles heading"
check_contains "En canonical owner per domän och sanning" "the one-canonical-owner-per-domain principle"
check_contains "aldrig egen SQL" "the no-own-SQL / no-parallel-truth clause"
check_contains "ingen frontend-tenant-trust" "the no-frontend-tenant-trust clause"
check_contains "PRODUCTION_READY" "the status vocabulary"
check_contains "sax3l/siax-masterplan" "the pointer back to the canonical masterplan repo"
if [ "$fail" -ne 0 ]; then
echo "::error::masterplan lock check FAILED -- see above."
exit 1
fi
echo "masterplan lock check OK -- ${PLAN_FILE} still matches the canonical principles."