# Git Hooks This repository uses Husky hooks from `.husky/`. Those files are execution surfaces; GLS-0844 (GHNQG) is the quality authority. ## Installation `pnpm install` runs the `prepare` script and binds Git's local hook path to this product's `.husky/` directory. This also works when the product is nested inside a larger Git worktree. To restore the binding without installing dependencies, run: ```bash bash scripts/install-guanghu-native-hooks.sh ``` The hook itself enters the product root before running any protocol command, so its behavior does not depend on the caller's current directory. ## Native policy - Commit on `main` or in a detached verification worktree intended for direct promotion. - Push `main -> origin/main` or detached `HEAD -> origin/main` only. - Never use `--no-verify`. - Run `bash scripts/test-guanghu-native-authority.sh` before repository checks. - Accept only `GHNQG_PASS_100` bound to the exact commit and tree. - Treat any incomplete required gate as `GHNQG_FAIL_0`. - Do not use minimum percentages, weighted scores, waivers, or external analyzers as acceptance states. - The Fifth Domain Router is a separate, explicitly authorized prototype-publication path. Its exact-SHA receipt proves repository publication only; it is not a merge, release, deployment, runtime-health, or persona-birth receipt. ## Pre-commit `.husky/pre-commit` keeps the edit loop fast: - staged TypeScript files pass repository lint; - documentation, workflow, and hook-only commits are classified without requiring application tooling. Passing pre-commit is evidence, not a publication authorization. ## Pre-push `.husky/pre-push` requires: - native-authority contract validation; - TypeScript and Vite build; - frontend tests; - Rust lint, format, and tests when Rust source changed; - the curated Playwright core smoke lane; - a GLS-0844 receipt from the repository-owned executor. The executor writes its receipt outside the source repository. On BingShuo's workstation, receipts go to JZAO when that volume is mounted. ## Troubleshooting If a hook cannot find `node` or `pnpm`, load the configured Node environment and retry. Missing tooling makes the applicable gate incomplete; it does not create a third acceptance state.