system-prompts-and-models-o.../.githooks
Sami Assiri b4531f0a4c feat(tier1): docs-governance CI, evidence gate, closure artifacts, trust/execution docs
- Replace repo-preflight with docs-governance workflow and check_docs_links.py
- Class B bundle: require correlation_id for external_*; AuditMetadata trace fields
- Root-safe TIER1 §2; optional .githooks pre-push for main
- Add RELEASE_READINESS_MATRIX_AR, SOURCE_OF_TRUTH_INDEX, operational severity, external index
- ExecWeeklyGovernanceContract; expand trust-fabric, execution-fabric, ADR-0001, ws5, Saudi overlays
- Wire MASTER TOC, enterprise-readiness, completion-program, architecture_brief paths

Made-with: Cursor
2026-04-16 16:46:36 +03:00
..
pre-push feat(tier1): docs-governance CI, evidence gate, closure artifacts, trust/execution docs 2026-04-16 16:46:36 +03:00
README.md feat(tier1): docs-governance CI, evidence gate, closure artifacts, trust/execution docs 2026-04-16 16:46:36 +03:00

Git hooks (اختياري — Root-safe)

مصدر الحقيقة للامتثال: CI في .github/workflows/docs-governance.yml (وليس هذا المجلد).

الهدف

تذكير محلي بأن أوامر الحوكمة تُشغَّل من جذر الريبو (cwd = المجلد الذي يحتوي scripts/ وdocs/).

تفعيل pre-push (فرع main فقط)

من جذر الريبو:

git config core.hooksPath .githooks

انسخ أو أنشئ ملف .githooks/pre-push (تنفيذي) بالمحتوى التالي:

#!/usr/bin/env bash
set -euo pipefail

protected_branch="refs/heads/main"
while read local_ref local_sha remote_ref remote_sha; do
  if [[ "$remote_ref" != "$protected_branch" ]]; then
    continue
  fi
  repo_root="$(git rev-parse --show-toplevel)"
  cd "$repo_root"
  if command -v python3 >/dev/null 2>&1; then
    python3 scripts/architecture_brief.py
  elif command -v py >/dev/null 2>&1; then
    py -3 scripts/architecture_brief.py
  else
    echo "pre-push: لا يوجد python3/py — تخطي architecture_brief"
  fi
done

ثم (على Unix): chmod +x .githooks/pre-push.

على Windows يمكن استخدام Git Bash أو WSL لتشغيل نفس السكربت.