Something went wrong. Try again.
A video game where you play as a misaligned AI, deceiving and building power. An experiment in spec-driven development. cameron.tngl.io/misaligned
Something went wrong. Try again.
1.5 kB · 48 lines
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#!/usr/bin/env bash# Constitution enforcement: no amendment, no functional change.## If a commit touches src/ (game behavior), it must also touch spec/ or# DESIGN.md (the amendment). Process-only commits (AGENT.md, tools/,# DEVLOG.md, README.md, knowledge/) are exempt.## This is the local fast-feedback layer. The Tangled pipeline is the# server-side enforcement that can't be bypassed.set -euo pipefail# Get staged files (added, modified, renamed, copied — not deleted)changed=$(git diff --cached --name-only --diff-filter=ACMR HEAD)if [ -z "$changed" ]; then exit 0fi# Check if any src/ file is in the changesettouches_src=0echo "$changed" | grep -q "^src/" && touches_src=1if [ "$touches_src" -eq 0 ]; then # No functional changes — commit is fine exit 0fi# src/ is touched: require spec/ or DESIGN.md in the same committouches_spec=0echo "$changed" | grep -qE "^spec/|^DESIGN\.md" && touches_spec=1if [ "$touches_spec" -eq 0 ]; then echo "" echo "CONSTITUTION VIOLATION" echo " This commit touches src/ (functional change) but does not touch" echo " spec/ or DESIGN.md (the amendment)." echo "" echo " AGENT.md: 'No amendment, no functional change.'" echo " Either add a spec/DESIGN.md change to this commit, or restructure" echo " so functional changes and their amendment ship together." echo "" echo " If this is a false positive (e.g. generated code, test-only change)," echo " bypass with: git commit --no-verify" echo "" exit 1fiexit 0