-
Notifications
You must be signed in to change notification settings - Fork 0
feat: enforce pre-commit hooks in worker worktrees #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hadamrd
merged 9 commits into
trunk
from
loop/158-feat-quality-enforce-pre-commit-at-worke
Jun 3, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b421c1a
feat: enforce pre-commit hooks in worker worktrees
22eb2af
fix: close pre-commit enforcement gaps
f500b7a
test: pin precommit context helper boundaries
bae1a18
fix: detect actionable no-verify body claims
7c79df5
test: exercise concurrent hook installation
c8f2383
fix: harden no-verify command parsing
e681e27
fix: scan worker transcripts for no-verify
664e7db
fix: validate precommit events and transcript scans
3c45005
test: type-check precommit critic bridge tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """Test fakes for the pre-commit adapter.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| from forge_loop.precommit import git_hook_path | ||
|
|
||
|
|
||
| class FakePreCommitRunner: | ||
| def __init__(self, *, available: bool = True, returncode: int = 0) -> None: | ||
| self.available = available | ||
| self.returncode = returncode | ||
| self.installs: list[Path] = [] | ||
|
|
||
| def is_available(self) -> bool: | ||
| return self.available | ||
|
|
||
| def install(self, repo: Path) -> int: | ||
| self.installs.append(repo) | ||
| if self.returncode == 0: | ||
| hook = git_hook_path(repo) | ||
| hook.parent.mkdir(parents=True, exist_ok=True) | ||
| hook.write_text("#!/bin/sh\necho fake pre-commit\nexit 0\n") | ||
| hook.chmod(0o755) | ||
| return self.returncode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[sev1/correctness] detect_precommit_bypass is only tested directly and is never called from review_pr or either critic execution path. That means the deterministic sev1 rule for unjustified git commit --no-verify is not actually enforced by the runtime critic; wire the detector into the critic flow using the PR body/commit text, or add an integration-level enforcement path that the tests exercise.