#!/usr/bin/env bash set -euo pipefail OUT_DIR="${1:?usage: collect_constitution_hash.sh }" mkdir -p "$OUT_DIR" LOCK_PATH="../vm-mcp/governance/constitution.lock" hash_file() { local file="$1" if command -v sha256sum >/dev/null 2>&1; then sha256sum "$file" | awk '{print $1}' else shasum -a 256 "$file" | awk '{print $1}' fi } if [[ -f "$LOCK_PATH" ]]; then HASH="$(hash_file "$LOCK_PATH")" cat > "$OUT_DIR/constitution_hash.json" < "$OUT_DIR/constitution_hash.json" <<'JSON' {"collected": false, "reason": "constitution.lock not found at expected path"} JSON fi