Pre Commit Gate Guard

loom-buildersourcepython
Path: loom-builder/.githooks/pre_commit_gate_guard.pyRelative: .githooks/pre_commit_gate_guard.pySubproject: loom-builderCategory: other
Lines: 126Bytes: 4,956Imports: 5Exports: 5

Content Preview

  1. #!/usr/bin/env python3
  2. """pre_commit_gate_guard.py — git pre-commit enforcement of N15 (layer 3).
  3. Rules:
  4. 1. Any staged Modify/Delete/Rename of a gates/v*/ file that appears in
  5. HEAD's MANIFEST.json => reject. Additions are always allowed.
  6. 2. If gates/MANIFEST.json is staged, it must be append-only relative to
  7. HEAD: every existing entry byte-identical (delegates to
  8. gate_manifest.py append-check).
  9. 3. If any gates/ path is staged, the STAGED tree must be self-consistent:
  10. e