Repository navigation
Keep Untracked Files Out of the Pre-Commit Snippet's Prose Gate - #3444
Conversation
The pre-commit snippet ran the prose gate over `.`, and pre-commit sets aside unstaged changes to tracked files only, so an untracked file with a violation failed a commit that did not carry it. The hook now takes the staged paths pre-commit passes, after a `--` so a dash-led name stays a path, and excludes `reports/` at any depth to mirror the gate's default generated trees, which a named path would otherwise bypass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`require_serial` keeps pre-commit from splitting the staged paths into parallel batches, each of which would fetch the gate again. The docs now say the hook passes the paths pre-commit names, the conflicted ones during a merge, and that a repo adding generated trees adds them to the exclude. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟢 Approval recommended
All reviewed files have no unresolved findings, and the assessments unanimously indicate approval readiness.
No open issues 🎉
What changed in this PR
This pull request updates the canonical pre-commit snippet so its prose gate checks only paths supplied by pre-commit, preventing unrelated untracked files from affecting commits while preserving staged-file validation.
Changes:
- Passes staged or conflicted paths to the prose gate with a terminating
--. - Serializes prose-gate execution and excludes generated
reports/paths. - Documents the updated path scope and generated-tree behavior.
| File | Description |
|---|---|
GOVERNANCE.md |
Documents that the pre-commit hook checks runner-supplied paths rather than scanning the working tree. |
catalog/snippets/pre-commit/README.md |
Explains staged-path handling, serialization, and generated-tree exclusions. |
catalog/snippets/pre-commit/.pre-commit-config.yaml |
Updates the prose-gate command and configures serialization and report-path exclusion. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3444 +/- ##
========================================
Coverage 80.76% 80.76%
========================================
Files 23 23
Lines 8839 8839
========================================
Hits 7139 7139
Misses 1700 1700
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…nd Nine Fixes to Main (#3472) ## Summary Promotes the pull requests merged into develop since release 2.0.1166. - [#3444](#3444): keeps untracked files out of the pre-commit snippet's prose gate. - [#3446](#3446): exempts the BuildKit `check=` parser directive in the prose gate. - [#3448](#3448): compares intent staleness against the hub's own copy and names the moved canonical. - [#3450](#3450): says only the prose gate is diff-scoped in the commit hook. - [#3453](#3453): reclassifies HolidayLights as an operational config repository in the registry. - [#3455](#3455): classifies the remaining subprocess failures by status rather than by prose. - [#3464](#3464): splits the semicolon series in WORKFLOW.md's filesystem output-seam bullet. - [#3466](#3466): audits a caller's `workflow-model` input against the registry. - [#3469](#3469): emits one snapshot shape from the skills report's cannot-read paths. - [#3462](#3462): splits `pr_review.py`'s pure check and round readers into the leaf modules `pr_review_checks.py` and `pr_review_rounds.py`. - [#3470](#3470): holds a covered held `wait` while any workflow run on the head has not completed. - [#3473](#3473): answers this promotion's review. The `wait` help and `scripts/README.md` now say what a held head's exit `0` does not prove: a `CHECKS UNREADABLE` payload, the conditions the unregistered-required-check hold reads, and the reach of the completed-run read. The exit code itself stays for #3471. Closes #3370 Closes #3372 Closes #3371 Closes #3369 Closes #3378 Closes #3454 Closes #3332 Closes #1759 Closes #3451 ## Constituent coverage Each change this promotion carries had coverage on its own pull request into develop, at its merged head: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3444](#3444) | `a61d1e2a` | attested local pass at the merged head, base `develop` | | [#3446](#3446) | `0a0efea1` | attested local pass at the merged head, base `develop` | | [#3448](#3448) | `c2c71ea7` | attested local pass at the merged head, base `develop` | | [#3450](#3450) | `4ec37c34` | attested local pass at the merged head, base `develop` | | [#3453](#3453) | `f20a543c` | a Copilot round on the merged head, its one changed file, no open findings | | [#3455](#3455) | `85f0ce60` | attested local pass at the merged head, base `develop` | | [#3464](#3464) | `fcd48e2d` | attested local pass at the merged head, base `develop` | | [#3466](#3466) | `3426a19c` | attested local pass at the merged head, base `develop` | | [#3469](#3469) | `ea4b0bb7` | attested local pass at the merged head, base `develop` | | [#3462](#3462) | `236eceab` | attested local pass at the merged head, base `develop` | | [#3470](#3470) | `3545ba46` | attested local pass at the merged head, base `develop` | | [#3473](#3473) | `46010530` | attested local pass at the merged head, base `develop`, and a Copilot table on an earlier head naming exactly the changed files | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
The
pre-commitsnippet ran the prose gate over.withpass_filenames: false.pre-commitsets aside unstaged changes to tracked files before a hook runs, but it leaves untracked files in place, and the gate's discovery of.reads them. So an untracked file holding a violation failed a commit that did not carry it.catalog/snippets/pre-commit/.pre-commit-config.yaml: theprose-gatehook now takes the pathspre-commitpasses (the staged ones, or the conflicted ones during a merge), ending its entry with--diff HEAD --so a dash-led name stays a path.require_serial: truestops parallel batches, each of which would fetch the gate again.exclude: (^|/)reports/mirrors the gate's defaultgenerated_trees, since the gate judges a named file even inside a generated tree where a.scan skips it.catalog/snippets/pre-commit/README.mdandGOVERNANCE.md"Running the Linters Locally" now say what the hook passes the gate..husky/pre-commitare unchanged, since the issue names them a separate question.Verification
Constructed scratch repositories, each with the hook config committed, run with
pre-commit run prose-gate(pre-commit 4.6.2), both with a local copy of the gate and with the real snippet fetching the gate frommainthroughhub_fetch_run.py. Each scenario matched:.pyfile staged, with an untracked violation present: passes (the old shape fails)reports/and underdocs/reports/: passes (without theexclude, it fails)-dash.md: failsLocal review
Three recorded
local-strict-reviewpasses. Round 1 found the missingrequire_serial, two wording gaps, and three over-length sentences, all fixed. Round 2 found one overstatedrequire_serialsentence, fixed. Round 3 found nothing.Deferred: the
excludeis a hand-kept copy ofgenerated_trees. The fix at the source is a gate-side switch inprose_lint.py, which sits at its line ceiling (#3441), so it is filed as #3443.Closes on promotion: #3370
🤖 Generated with Claude Code