Skip to content

Keep Untracked Files Out of the Pre-Commit Snippet's Prose Gate - #3444

Merged
ptr727 merged 3 commits into
developfrom
feature/auto-3370
Oct 25, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/auto-3370

Conversation

@ptr727

@ptr727 ptr727 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Summary

The pre-commit snippet ran the prose gate over . with pass_filenames: false. pre-commit sets 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: the prose-gate hook now takes the paths pre-commit passes (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: true stops parallel batches, each of which would fetch the gate again. exclude: (^|/)reports/ mirrors the gate's default generated_trees, since the gate judges a named file even inside a generated tree where a . scan skips it.
  • catalog/snippets/pre-commit/README.md and GOVERNANCE.md "Running the Linters Locally" now say what the hook passes the gate.
  • The Husky.Net snippet and the hub's own .husky/pre-commit are 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 from main through hub_fetch_run.py. Each scenario matched:

  • the issue's repro, an untracked violation beside a clean staged file: passes (the old shape fails)
  • a staged new file with a violation, and a staged edit adding one: fails
  • only a .py file staged, with an untracked violation present: passes (the old shape fails)
  • only a binary staged, a staged deletion, and a staged deletion beside an untracked violation: passes
  • a partially staged file whose unstaged part holds a violation: passes
  • a staged violation under reports/ and under docs/reports/: passes (without the exclude, it fails)
  • a violation in a file whose name holds a space, and in -dash.md: fails

Local review

Three recorded local-strict-review passes. Round 1 found the missing require_serial, two wording gaps, and three over-length sentences, all fixed. Round 2 found one overstated require_serial sentence, fixed. Round 3 found nothing.

Deferred: the exclude is a hand-kept copy of generated_trees. The fix at the source is a gate-side switch in prose_lint.py, which sits at its line ceiling (#3441), so it is filed as #3443.

Closes on promotion: #3370

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 24, 2026 18:29
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>
Copilot AI lite review requested due to automatic review settings October 25, 2026 01:36
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ptr727

ptr727 commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head a61d1e2a507791603480a9437a3445bd9206355b, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.76%. Comparing base (687ccd9) to head (a61d1e2).

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           
Flag Coverage Δ
python-3.13 80.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit a3ff33f into develop Oct 25, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/auto-3370 branch October 25, 2026 01:48
ptr727 added a commit that referenced this pull request Oct 25, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants