Problem
Agent pushes without passing local checks → CI fails on PR.
3 recurring failures on every PR:
check-now-freshness — docs/NOW.md not updated
seal-coverage — new .t27 specs missing seals in .trinity/seals/
build-and-test — cargo build or tri test not run locally before push
Solution: pre-commit gate (Zero Shell / L7 compliance)
Implement scripts/pre-commit as a t27c-invoked gate that runs before every commit.
Gate checks (in order):
- NOW freshness —
docs/NOW.md must contain Last updated: <today UTC>
- Seal coverage — every
specs/**/*.t27 in staged files must have corresponding .trinity/seals/<name>.json
- Cargo check —
cargo check in bootstrap/ must pass
- No .sh files — L7 UNITY: staged files must not include new
.sh files
Install hook
# .claude/skills/tri/skill.md must document this
ln -sf ../../scripts/pre-commit .git/hooks/pre-commit
chmod +x scripts/pre-commit
Or via lefthook config (.lefthook.yml).
Files to create
scripts/pre-commit — main gate script (invokes t27c)
specs/tools/pre-commit-gate.t27 — gate spec with TDD
.lefthook.yml — optional: declarative hook runner
docs/PRE-COMMIT.md — setup instructions
Acceptance Criteria
Law
L7 UNITY: pre-commit script invokes t27c — no raw shell logic for checks.
φ² + 1/φ² = 3 | TRINITY
Problem
Agent pushes without passing local checks → CI fails on PR.
3 recurring failures on every PR:
check-now-freshness—docs/NOW.mdnot updatedseal-coverage— new.t27specs missing seals in.trinity/seals/build-and-test—cargo buildortri testnot run locally before pushSolution: pre-commit gate (Zero Shell / L7 compliance)
Implement
scripts/pre-commitas at27c-invoked gate that runs before every commit.Gate checks (in order):
docs/NOW.mdmust containLast updated: <today UTC>specs/**/*.t27in staged files must have corresponding.trinity/seals/<name>.jsoncargo checkinbootstrap/must pass.shfilesInstall hook
# .claude/skills/tri/skill.md must document this ln -sf ../../scripts/pre-commit .git/hooks/pre-commit chmod +x scripts/pre-commitOr via
lefthookconfig (.lefthook.yml).Files to create
scripts/pre-commit— main gate script (invokest27c)specs/tools/pre-commit-gate.t27— gate spec with TDD.lefthook.yml— optional: declarative hook runnerdocs/PRE-COMMIT.md— setup instructionsAcceptance Criteria
git commitblocked ifdocs/NOW.mdis stalegit commitblocked if staged.t27spec has no sealgit commitblocked ifcargo checkfailsgit commitblocked if staged.shfile detecteddocs/PRE-COMMIT.mdLaw
L7 UNITY: pre-commit script invokes
t27c— no raw shell logic for checks.φ² + 1/φ² = 3 | TRINITY