← Back to Pull requests

Section 4: a fail hook refuses a path that begins with a dash (issue #2347) #2353

Merged
fametrano merged 4 files (191 lines) on Nov 17, 2026 07:37 UTC
View on GitHub
fametrano fametrano commented on Nov 17, 2026 00:08 UTC
Author

A tracked file named -h silences an argparse hook, pygrep among them, under every pre-commit run: pre-commit passes file names with no -- before them, so the hook prints its help and exits 0 with the files beside it unread. This adds section 4's leading-dash-path, a language: fail hook with files: ^- and types: [], which refuses such a path and cannot be silenced by it, since it parses no argument.

The stanza is held whole by DASH_STANZA in tests/hooks_test.py, and a BACKLOG row excuses the other trees until their ports land, so the issue stays open: Advances #2347. Upstream declined to change how it passes file names in pre-commit/pre-commit#2896.

Evidence

  • The issue's measurement, repeated. Scratch repository, pre-commit 4.7.0 (what uv.lock pins), one pygrep hook refusing a tab, a commit adding -h and a file holding a tab. Without the stanza, pre-commit run --all-files and pre-commit run --from-ref HEAD~1 --to-ref HEAD both print Passed and exit 0. With it, leading-dash-path fails naming -h, and both runs exit 1.

  • Names tried. -, --, a name holding a newline after -, and a symlink -l are refused; dir/-h, a<newline>-h and -x reach no hook as an option and are not. Without types: [] the symlink is not reached. check-hooks-apply passes over the fail hook; the same stanza as pygrep is reported as not applying, and a pygrep copy of the hook is silenced by -h.

  • Gates on the head, under the gate lock: uv run --locked --only-group lint pre-commit run --all-files exit 0; the same with markdownlint-cli2 exit 0; pre-commit validate-config .pre-commit-config.yaml exit 0; uv run --locked --no-default-groups --group test pytest exit 0. The new tests are integration-only, run by hand with BTCLIB_INTEGRATION=1 across every tree on the first head: .github passes, each other tree is a strict expected failure citing the issue.

  • Sign-off script on the branch: exit 0; its control, c1786962edc1~1..c1786962edc1, exit 1.

  • Local review. Dedicated reviewer: CLEARED on the first head. Fresh reviewer in Codex: changes requested on the first head (the reason for the hook restated outside section 4), then CLEARED on the next head after a prose-only fix. The review bot then asked for the served-hook alternative beside the rule; the fix, a new commit, was cleared by both local reviewers before its push. No rebase: the branch merges clean with main.

  • Sourcery 1.46.0 on the head: no issues. CodeRabbit CLI on the first head: a whole, fresh review, no findings.

  • Reviews on GitHub, on 57c0166. The review bot: ACK 57c0166cb49ca686fd514b84e459229c684bd0dd. Codex: no findings. CodeRabbit: absent on this head, its check skipped with no reason posted (its free reviews were reported used up on PR btclib-org/.github#2354 the same hour); on 3b6f6f5 it posted no actionable comments.
  • Decision

    The issue reserved none; the design pass put one for the maintainer. Should section 4 require this hook in every tree, and in which shape? The branch takes a local fail stanza held whole by a test, which needs no tag and lets the BACKLOG row track the ports. The alternatives set aside: serving the hook from .pre-commit-hooks.yaml, which waits for a tag and a rev: move in each tree; this tree only, which section 14 makes a defect; and -- in every hook, which a forgotten stanza undoes. The cut-back is no check, only the upstream link, which leaves the measurement exiting 0.

    🤖 Generated with Claude Code

    Diff: 191 lines (+187 / -4) across 4 files Reviewer: fametrano Review duration: 449m
    All Vouch review confidence checks passed
    Residual risk 0.08 = Change Risk (0.53) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.53 · 191 lines diff across 4 files
    0.53
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.93 · 5 substantive comment(s)
    0.93
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    84%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.315
    Self Review self_review
    0.140
    Real PR Conversation Timeline
    10 items
    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 17, 2026 00:08 UTC
    Bot

    <!-- codex-pull-request-review-summary -->
    <!-- codex-review-state:v1 {"code_review":{"commit_sha":"57c0166cb49ca686fd514b84e459229c684bd0dd","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"57c0166cb49ca686fd514b84e459229c684bd0dd","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} -->
    <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"57c0166cb49ca686fd514b84e459229c684bd0dd","mergeGateEnabled":false,"pullRequestNumber":2353,"repository":"btclib-org/.github","status":"completed"} -->
    <details>
    <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>

    This comment shows the latest Codex review activity on this pull request.

    | Review | Status | Commit | Review trigger |
    | --- | --- | --- | --- |
    | 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-17T00:35:34.264640Z">2026-11-17T00:35:34.264640Z</relative-time> | 57c0166 | New commits |
    | 🔒 Security Review | ✅ Completed <relative-time datetime="2026-11-17T00:36:51.930210Z">2026-11-17T00:36:51.930210Z</relative-time> | 57c0166 | New commits |

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    </details>

    </details>

    coderabbitai[bot] coderabbitai[bot] commented on Nov 17, 2026 00:08 UTC
    Bot

    <!-- coderabbit-ai-generated:v1 -->

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/btclib-org/.github/pull/2353?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>

    <!-- review_stack_entry_end -->
    <!-- recent_review_status_start -->

    No actionable comments were generated in the recent review.

    <!-- recent_review_status_end -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>Summary</strong></summary>
    <dl>
    <dd>
    <br>

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Added a repository check that rejects paths beginning with a dash, including symlink paths.
    Documentation
    Documented the check and its required coverage.
    Tests
    Added automated checks for missing or altered configurations and settings that narrow the check’s coverage.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->
    The change adds a local pre-commit hook that rejects paths beginning with -. It documents the hook and adds checks that repositories include its expected configuration without settings that narrow its coverage.

    Changes: Leading-dash path guard

    |Layer / File(s)|Summary|
    |:---|:---|
    |Define and document the path guard <br> .pre-commit-config.yaml, README.md|The local hook rejects paths matching ^-. The README describes its scope, configuration requirements, and why pre-commit filename passing can expose leading-dash paths to hooks as options.|
    |Check hook coverage across repositories <br> tests/hooks_test.py, tests/__init__.py|Tests detect a missing or altered hook stanza and top-level settings that narrow its coverage. The backlog adds issue 2347.|

    <!-- change_assessment_start -->

    Estimated code review effort: 2 (Simple) | ~10 minutes

    <!-- change_assessment_commit:"3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756" -->
    <!-- change_assessment_priority:{"version":1,"urgency":"p3","manual":false} -->
    Change: Bug fix · Severity of issue fixed: Low
    <!-- change_assessment_end -->

    Possibly related issues

  • Issue 2347 concerns a leading-dash filename causing an argparse-based hook to print help and exit successfully. This change adds a hook that rejects such paths, but the issue notes that other repositories still need the hook.
  • </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>3b6f6</code></summary>
    <dl>
    <dd>
    <br>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: ⚪ Minimal · up to 3b6f6
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756","coveredCommitId":"3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756","kind":"reviewed"} -->

    The change adds a pre-commit hook that rejects paths beginning with a dash, plus documentation and checks for it. It affects repository tooling only, and no concrete merge-blocking risk was found.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary>
    <dl>
    <dd>
    <br>

    | Check name | Status | Explanation |
    | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Title check | !Passed | The title names a fail hook that refuses dash-leading paths and cites issue #2347, which matches the main change (the leading-dash-path hook). It does not state the section 4 requirement, so the check… |
    | Linked Issues check | !Passed | Check skipped because no linked issues were found for this pull request. |
    | Out of Scope Changes check | !Passed | Check skipped because no linked issues were found for this pull request. |
    | Description check | !Passed | The description is specific and on-topic. It explains the bug (pre-commit passes file names without --, so a tracked file named -h silences argparse-based hooks such as pygrep). It describes the n… |

    <details>
    <summary><strong>Full details: Title check</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    The title names a fail hook that refuses dash-leading paths and cites issue #2347, which matches the main change (the leading-dash-path hook). It does not state the section 4 requirement, so the check against the organization's title standard cannot be fully confirmed from the supplied text. The title is specific and on topic, so it passes on relevance.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: Description check</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    The description is specific and on-topic. It explains the bug (pre-commit passes file names without --, so a tracked file named -h silences argparse-based hooks such as pygrep). It describes the new leading-dash-path hook (language: fail, files: ^-, types: []), the DASH_STANZA test, the BACKLOG row, and the reported verification runs. It relates directly to the changeset, so the check passes.

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- finishing_touch_checkbox_start -->

    <details>
    <summary><strong>Finishing Touches</strong></summary>
    <dl>
    <dd>
    <br>

    <details open>
    <summary><strong>Generate unit tests (beta)</strong></summary>
    <dl>
    <dd>
    <br>

  • <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit to this branch

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create a new PR
  • </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- finishing_touch_checkbox_end -->

    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    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.

    <details>
    <summary><strong>Share</strong></summary>
    <dl>
    <dd>
    <br>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </dd>
    </dl>
    </details>

    <!-- tips_end -->
    <!-- recent_review_start -->

    <h6>
    <details>
    <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
    <dl>
    <dd>
    <br>

    <!-- review_info_content -->
    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
    <dl>
    <dd>
    <br>

  • Source mode: Auto

  • Repository: [btclib-org/.github](<https://github.com/btclib-org/.github>)

  • Branch: [dash-path-2347](<https://github.com/btclib-org/.github/tree/dash-path-2347>)

  • File: [.coderabbit.yaml](<https://github.com/btclib-org/.github/blob/3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756/.coderabbit.yaml>)

  • Commit: [3b6f6f5](<https://github.com/btclib-org/.github/commit/3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756>)

  • Layers: Repository YAML

  • Review profile: ASSERTIVE

  • Plan: Advanced

  • Run ID: 2c36c246-d0fb-41fa-8e19-c57b46660676
  • </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
    <dl>
    <dd>
    <br>

    Reviewing files that changed from the base of the PR and between bfa5cb36a9d331afb44cc50824832429e9732eb2 and 3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 4</strong></summary>
    <dl>
    <dd>
    <br>

    .pre-commit-config.yaml
    README.md
    tests/__init__.py
    tests/hooks_test.py

    </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

    </dd>
    </dl>
    </details>
    </h6>

    <!-- recent_review_end -->

    fametrano fametrano commented on Nov 17, 2026 00:08 UTC
    Author

    Findings on 57c0166: 1 open, non-blocking.

    | Round | Head | Reviewer | Verdict |
    | --- | --- | --- | --- |
    | 1 | e4e7b25 | dedicated reviewer | CLEARED |
    | 2 | e4e7b25 | fresh reviewer (Codex) | CHANGES REQUESTED |
    | 3 | 3b6f6f5 | fresh reviewer (Codex) | CLEARED |
    | 4 (forge 1) | 3b6f6f5 | review bot | CHANGES REQUESTED |
    | 5 | 57c0166 | dedicated reviewer | CLEARED |
    | 6 | 57c0166 | fresh reviewer (Codex) | CLEARED |

    | # | Raised by | On | Where | Outcome | Checked on |
    | --- | --- | --- | --- | --- | --- |
    | 1 | fresh reviewer (Codex) | e4e7b25 | .pre-commit-config.yaml:47, tests/hooks_test.py:1248 | accepted, 3b6f6f5 | 57c0166 |
    | 2 | dedicated reviewer | e4e7b25 | .pre-commit-config.yaml:27 | declined: prose already false at the base, not made worse | 57c0166 |
    | 3 | dedicated reviewer | e4e7b25 | tests/hooks_test.py:1300 | declined: nit, follows the landed bare-sourcery-skip precedent | 57c0166 |
    | 4 | dedicated reviewer | e4e7b25 | tests/hooks_test.py:1254 | declined: taste, correct as written | 57c0166 |
    | 5 | review bot | 3b6f6f5 | README.md:1125 | accepted, 57c0166 | 57c0166 |
    | 6 | review bot | 3b6f6f5 | tests/hooks_test.py:1252 | declined: taste, as finding 4 | 57c0166 |
    | 7 | dedicated reviewer | 57c0166 | README.md:1141 | open, non-blocking: fixed with the next change | 57c0166 |

    <details><summary>1. The reason for the hook was restated outside section 4's bullet.</summary>

    Class: a rule stated a second time.

    .pre-commit-config.yaml from line 47 at e4e7b25:

      # a path that begins with a dash reaches a hook's command line as an
      # option, so a file named `-h` silences an argparse hook. Section 4's
    

    Accepted: the comment and the DASH_STANZA docstring point to section 4's bullet, which gains the one condition only the docstring stated (an exclude:, a stages: or a narrower types: takes paths out of reach), in 3b6f6f5.

    </details>

    <details><summary>2. The config comment calls the meta hooks the only hooks with no environment to install.</summary>

    Class: a false sentence older than the branch.

    .pre-commit-config.yaml from line 27 at dd936a3:

      # this file checking itself, and the only two hooks with no environment
      # to install: a pattern that has stopped matching is a rule that has
    

    Declined: false at the base already (pre-commit 4.7.0's pygrep declares no install), and the branch does not make it materially worse; prose is not filed.

    </details>

    <details><summary>3. test_this_trees_leading_dash_path_is_section_4s repeats the .github cell of the per-repository test.</summary>

    Class: a redundant test.

    tests/hooks_test.py from line 1300 at e4e7b25:

    def test_this_trees_leading_dash_path_is_section_4s() -> None:
    

    Declined: the landed test_this_trees_bare_sourcery_skip_is_section_4s is the same pattern.

    </details>

    <details><summary>4. DASH_REACHING writes out names it could derive from TOP_LEVEL.</summary>

    Class: taste.

    tests/hooks_test.py from line 1254 at e4e7b25:

    DASH_REACHING = ("files", "exclude", "default_stages")
    

    Declined: correct as written.

    </details>

    <details><summary>5. The bullet did not say why each tree carries a local stanza instead of a served hook.</summary>

    Class: a setting with no alternative beside it (README's How to use this file).

    The review bot's thread on README.md line 1125 at 3b6f6f5, on the bullet's first line:

    - **`leading-dash-path`** — a `fail` hook refusing a path that begins
    

    Accepted: the bullet names the served hook as an alternative set aside, and why (a tag and a rev: move before a tree runs it), in 57c0166.

    </details>

    <details><summary>7. "them all" in the -- clause has no plural noun to refer to.</summary>

    Class: wording.

    README.md line 1141 at 57c0166: "lost again by a stanza that forgets it, where this hook guards them all".

    Open, non-blocking: fixed with the next change to the branch.

    </details>

    <!-- btclib-findings-record -->

    claude[bot] claude[bot] commented on code on Nov 17, 2026 00:10 UTC
    Code Review
    README.md:1
    @@ -1120,6 +1120,31 @@ No `autoupdate_branch`: the default branch is the only branch.
       off every rule of the tag. `suggestion` and `comment`, the other tags
       `rule_types:` names, are refused with them. A colon with no rule name after
       it, before any `#` or `;`, names no rule, and is refused too.
    +- **`leading-dash-path`** — a `fail` hook refusing a path that begins
    +  with `-`, in every repository of the organization, this one included,
    +  its stanza `DASH_STANZA` in `tests/hooks_test.py` whole, and no

    blocking: the bullet does not say why each tree carries a local stanza instead of a hook served from this repository's .pre-commit-hooks.yaml.

    check-changelog is a few lines below, and this repository serves it that way. local-link-prefix explains why it is local: a served language: python hook makes pre-commit pip-install a repository that builds no distribution. That reason does not hold for a fail hook, which installs nothing. So a reader comparing the two bullets has nothing in the README that answers "why not serve it?"

    The PR body has the answer, under Decision: a served hook waits for a tag and a rev: move in each tree. But the body does not land. REVIEWING.md's last section asks for the rule to come with the reason that chose it, the rejected alternative included, and the standard's How to use this file asks for that argument beside the rule. The -- alternative already gets a paragraph here. The served-hook alternative needs one too, or the maintainer's answer to the body's Decision.

    claude[bot] claude[bot] commented on code on Nov 17, 2026 00:10 UTC
    Code Review
    tests/hooks_test.py:1
    @@ -1229,6 +1231,128 @@ def test_a_gate_off_section_4s_guard_would_be_reported() -> None:
             ]
     
     
    +DASH = "leading-dash-path"
    +"""The local hook section 4 puts in every tree, refusing a path led by `-`."""
    +
    +DASH_STANZA: dict[str, Any] = {
    +    "repo": "local",
    +    "id": DASH,
    +    "name": "a path does not begin with a dash",
    +    "language": "fail",
    +    "entry": "a hook reads a path beginning with - as its own option: rename it",
    +    "files": "^-",
    +    "types": [],
    +}
    +"""Section 4's `leading-dash-path`, whole: a tree's has these keys alone.
    +
    +Why the stanza is held whole, and why each key is what it is, is section
    +4's bullet.
    +"""
    +
    +DASH_REACHING = ("files", "exclude", "default_stages")

    non-blocking: this tuple copies three of TOP_LEVEL's four keys. The docstring then states how the two relate ("TOP_LEVEL less default_language_version"), and nothing checks that. If a key is added to TOP_LEVEL, this copy will not follow, and the docstring will go wrong without anyone noticing. Deriving it, for example tuple(key for key in TOP_LEVEL if key != "default_language_version"), keeps one list and makes the docstring true by construction.

    claude[bot] claude[bot] commented on Nov 17, 2026 00:11 UTC
    Reviewer

    CHANGES REQUESTED 3b6f6f541cfb8df8fa54641fd3d6ebfb371b5756

  • blocking, README.md:1125: the leading-dash-path bullet does not say why each tree carries a local stanza instead of a hook served from .pre-commit-hooks.yaml. check-changelog is served that way, a few lines below. local-link-prefix's reason for staying local (pip installs the serving repository) does not apply to a fail hook. The reason exists only in the PR body's Decision, which does not land. REVIEWING.md's last section, and the standard's How to use this file, ask for the rejected alternative beside the rule.

  • non-blocking, tests/hooks_test.py:1252: DASH_REACHING copies three of TOP_LEVEL's keys, and its docstring states how the two relate, which nothing checks. Deriving it from TOP_LEVEL keeps one list.
  • Not checked: the scratch-repository pre-commit run measurement in the PR body, and the new tests, were not run (no interpreter). The new files: ^- pattern matches no tracked path here (git ls-files | grep -c '^-' prints 0). The backlog row was tried against btclib's gate: it has no leading-dash-path.

    fametrano fametrano commented on code on Nov 17, 2026 00:33 UTC
    Code Review
    README.md:1
    @@ -1120,6 +1120,31 @@ No `autoupdate_branch`: the default branch is the only branch.
       off every rule of the tag. `suggestion` and `comment`, the other tags
       `rule_types:` names, are refused with them. A colon with no rule name after
       it, before any `#` or `;`, names no rule, and is refused too.
    +- **`leading-dash-path`** — a `fail` hook refusing a path that begins
    +  with `-`, in every repository of the organization, this one included,
    +  its stanza `DASH_STANZA` in `tests/hooks_test.py` whole, and no

    Fixed in 57c0166: the bullet now names the hook served from .pre-commit-hooks.yaml as an alternative set aside, in one clause beside the -- one.

    A served hook reaches a tree only once this repository tags and the tree's rev: moves to that tag, which section 4 already requires to be a frozen tag. btclib's gate pins check-changelog at f88870c9… # frozen: v2026.11.14, the newest tag here. A local stanza needs neither. The bullet pays for the sentence by cutting a clause from its opening sentence, so README grows by the stanza's bullet alone.

    fametrano fametrano commented on code on Nov 17, 2026 00:33 UTC
    Code Review
    tests/hooks_test.py:1
    @@ -1229,6 +1231,128 @@ def test_a_gate_off_section_4s_guard_would_be_reported() -> None:
             ]
     
     
    +DASH = "leading-dash-path"
    +"""The local hook section 4 puts in every tree, refusing a path led by `-`."""
    +
    +DASH_STANZA: dict[str, Any] = {
    +    "repo": "local",
    +    "id": DASH,
    +    "name": "a path does not begin with a dash",
    +    "language": "fail",
    +    "entry": "a hook reads a path beginning with - as its own option: rename it",
    +    "files": "^-",
    +    "types": [],
    +}
    +"""Section 4's `leading-dash-path`, whole: a tree's has these keys alone.
    +
    +Why the stanza is held whole, and why each key is what it is, is section
    +4's bullet.
    +"""
    +
    +DASH_REACHING = ("files", "exclude", "default_stages")

    Declined as taste: the tuple is correct as written, and the docstring says why it leaves out default_language_version, which a derived tuple would have to say as well.

    Both local reviewers read it and found it correct; deriving it is one of two defensible spellings, so the author's stands.

    claude[bot] claude[bot] commented on Nov 17, 2026 00:35 UTC
    Reviewer

    ACK 57c0166cb49ca686fd514b84e459229c684bd0dd

    The blocking finding from 3b6f6f5 is closed: the leading-dash-path bullet now names the served hook it sets aside, with the reason (a tag, then a rev: move in each tree), beside the rule. The non-blocking point on DASH_REACHING was declined as taste, and it stays with the author.

    Not checked: the scratch-repository pre-commit run --all-files and --from-ref/--to-ref measurement in the PR body, and the new integration tests under BTCLIB_INTEGRATION=1, were not run (no interpreter).

    Reviewers
    Assignees
    fametrano fametrano
    Labels
    risk: low confidence: 84.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.8% (MEDIUM) · Higher = larger blast radius
    52.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84.8% · Lower = rushed or shallow review
    84.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8% · Safe to merge
    8%