Files
proxmox/scripts/verify/check-gru-reference-primacy-integration.sh
defiQUG 0d29343941 chore: update .env.master.example with new deployment scripts and treasury manager parameters; enhance AGENTS.md with GRU reference primacy details
- Added new deployment script references for Aave quote-push and treasury manager in .env.master.example.
- Updated AGENTS.md to include information on GRU reference primacy versus public PMM mesh execution model.
- Minor updates to various documentation files to reflect changes in policy and operational guidelines.

Made-with: Cursor
2026-04-12 18:20:41 -07:00

101 lines
3.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Verify GRU reference-primacy doc exists, peg-bands.json carries the machine hook
# (when cross-chain-pmm-lps is present), and canonical consumers still link the doc.
# Usage: bash scripts/verify/check-gru-reference-primacy-integration.sh
# Exit: 0 ok, 1 failure
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
DOC_REL="docs/04-configuration/GRU_REFERENCE_PRIMACY_AND_MESH_EXECUTION_MODEL.md"
DOC="$PROJECT_ROOT/$DOC_REL"
MARKER="GRU_REFERENCE_PRIMACY_AND_MESH_EXECUTION_MODEL.md"
err() { printf '[ERROR] %s\n' "$*" >&2; }
ok() { printf '[OK] %s\n' "$*"; }
ERRORS=0
if [[ ! -f "$DOC" ]]; then
err "Missing $DOC_REL"
exit 1
fi
if ! grep -qi 'reference primacy' "$DOC"; then
err "$DOC_REL: expected 'reference primacy' wording"
ERRORS=$((ERRORS + 1))
fi
ok "Found and scanned $DOC_REL"
# Parent-repo files that must keep a pointer to the canonical doc (integration, not orphan).
REQUIRED_LINK_FILES=(
"$PROJECT_ROOT/docs/04-configuration/GRU_C_STAR_V2_STANDARDS_MATRIX_AND_IMPLEMENTATION_PLAN.md"
"$PROJECT_ROOT/docs/MASTER_INDEX.md"
"$PROJECT_ROOT/AGENTS.md"
"$PROJECT_ROOT/docs/04-configuration/README.md"
"$PROJECT_ROOT/docs/11-references/PMM_DEX_ROUTING_STATUS.md"
"$PROJECT_ROOT/docs/11-references/LIQUIDITY_POOLS_MASTER_MAP.md"
"$PROJECT_ROOT/docs/11-references/CHAIN138_GRID_6534_WALLET_FUNDING_PLAN.md"
"$PROJECT_ROOT/docs/11-references/GRU_V2_PUBLIC_PROTOCOL_DEPLOYMENT_STATUS.md"
"$PROJECT_ROOT/docs/03-deployment/PHASE_C_CW_AND_EDGE_POOLS_RUNBOOK.md"
"$PROJECT_ROOT/.cursor/rules/project-doc-and-deployment-refs.mdc"
)
for f in "${REQUIRED_LINK_FILES[@]}"; do
rel="${f#"$PROJECT_ROOT"/}"
if [[ ! -f "$f" ]]; then
err "Missing expected file: $rel"
ERRORS=$((ERRORS + 1))
continue
fi
if ! grep -qF "$MARKER" "$f"; then
err "$rel: must reference $MARKER"
ERRORS=$((ERRORS + 1))
else
ok "Link present: $rel"
fi
done
CC_README="$PROJECT_ROOT/cross-chain-pmm-lps/README.md"
if [[ -f "$CC_README" ]]; then
if ! grep -qF "$MARKER" "$CC_README"; then
err "cross-chain-pmm-lps/README.md must reference $MARKER"
ERRORS=$((ERRORS + 1))
else
ok "Link present: cross-chain-pmm-lps/README.md"
fi
else
ok "Submodule cross-chain-pmm-lps absent — skipped README check"
fi
PEGB="$PROJECT_ROOT/cross-chain-pmm-lps/config/peg-bands.json"
if [[ -f "$PEGB" ]]; then
if command -v jq &>/dev/null; then
if jq -e \
'(.gruPolicyIntegration | type == "object")
and (.gruPolicyIntegration.referencePrimacyDoc | type == "string")
and (.gruPolicyIntegration.referencePrimacyDoc | test("GRU_REFERENCE_PRIMACY_AND_MESH_EXECUTION_MODEL"))
and (.gruPolicyIntegration.meshExecutionRole | type == "string")
and (.gruPolicyIntegration.meshExecutionRole | length > 0)' \
"$PEGB" &>/dev/null; then
ok "peg-bands.json: gruPolicyIntegration hook present"
else
err "peg-bands.json: missing or invalid .gruPolicyIntegration (referencePrimacyDoc + meshExecutionRole)"
ERRORS=$((ERRORS + 1))
fi
else
err "jq not installed — cannot validate peg-bands.json gruPolicyIntegration"
ERRORS=$((ERRORS + 1))
fi
else
ok "peg-bands.json absent (submodule not checked out) — skipped peg-bands hook check"
fi
if [[ "$ERRORS" -gt 0 ]]; then
err "GRU reference primacy integration: $ERRORS error(s)"
exit 1
fi
ok "GRU reference primacy integration checks passed."
exit 0