Skip to content

Commit c770045

Browse files
jvalin17claude
andcommitted
Fix cross-repo gating: absolute paths for finalize_report, skip gate for non-toolkit repos
Skills used relative path for finalize_report.py which failed when CWD was a different project. Gate hook now skips enforcement when no gates.json exists, so non-toolkit repos are not blocked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 90f6666 commit c770045

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

hooks/gate_hook.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def load_gate_config(project_dir: Path) -> dict:
6868
return json.loads(candidate.read_text(encoding="utf-8"))
6969
except (json.JSONDecodeError, OSError):
7070
pass
71-
return {"enforcement": "block", "gate_mode": "legacy"}
71+
return {"enforcement": "block", "gate_mode": "legacy", "_no_config": True}
7272

7373

7474
def get_config_value(config: dict, key: str, default=None):
@@ -325,6 +325,8 @@ def run_gate(
325325
return 0, ""
326326

327327
config = load_gate_config(project_dir)
328+
if config.get("_no_config"):
329+
return 0, "" # No gates.json — not a toolkit-managed project
328330
gate_mode = config.get("gate_mode", "legacy")
329331
enforcement = resolve_enforcement(
330332
config.get("enforcement", "block"),

skills/assess/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ passes only when `fix_now` is 0 and mechanical test/lint re-runs pass.
187187
Then run:
188188

189189
```
190-
python3 hooks/finalize_report.py assess .scratch/assess_<slug>/findings.json
190+
python3 /Users/jvalin/dev/st5/agent-toolkit/hooks/finalize_report.py assess .scratch/assess_<slug>/findings.json
191191
```
192192

193193
The hook writes `reports/assess/assess_<slug>_<id>.md` and prints a JSON

skills/evaluate/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ score than your dimension scores support.
161161
Then run:
162162

163163
```
164-
python3 hooks/finalize_report.py evaluate .scratch/evaluate_<slug>/findings.json
164+
python3 /Users/jvalin/dev/st5/agent-toolkit/hooks/finalize_report.py evaluate .scratch/evaluate_<slug>/findings.json
165165
```
166166

167167
The hook re-runs `test_command` and `lint_command` from `gates.json` itself —

skills/precommit/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Findings schema (all keys required):
125125
Then run:
126126

127127
```
128-
python3 hooks/finalize_report.py precommit .scratch/precommit_<slug>/findings.json
128+
python3 /Users/jvalin/dev/st5/agent-toolkit/hooks/finalize_report.py precommit .scratch/precommit_<slug>/findings.json
129129
```
130130

131131
The hook re-runs `test_command` and `lint_command` from `gates.json` itself —

skills/reviewer/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ only when `high` is 0 and mechanical test/lint re-runs pass.
104104
Then run:
105105

106106
```
107-
python3 hooks/finalize_report.py reviewer .scratch/reviewer_<slug>/findings.json
107+
python3 /Users/jvalin/dev/st5/agent-toolkit/hooks/finalize_report.py reviewer .scratch/reviewer_<slug>/findings.json
108108
```
109109

110110
The hook writes `reports/reviewer/review_<slug>_<id>.md` and prints a JSON

0 commit comments

Comments
 (0)