Clear Bash's Hash and Test the Shim After It Exists in the Shim Rule - #1964
Conversation
type -P prints a hashed path without checking the file still exists, and -ef is false against a shim not yet written, so a shim deleted and rebuilt at a hashed path passed both checks and called itself. The rule now runs hash -r before the capture and the identity test only once the shim file exists. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A test made only after the write leaves a self-calling shim on disk when the inherited PATH already held it, so the rule keeps the pre-write test and repeats it once the shim exists. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1964 +/- ##
==========================================
Coverage ? 55.41%
==========================================
Files ? 16
Lines ? 7247
Branches ? 0
==========================================
Hits ? 4016
Misses ? 3231
Partials ? 0
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:
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The updated rule closes the documented Bash hashing failure mode and the regenerated copies are consistent with the canonical source.
Review effort: Lite
Findings: None
What changed in this PR
Updates the shell-codestyle shim guidance to avoid self-recursive shims caused by Bash command hashing, and regenerates the distributed skill copies so the clarified rule is consistent across agent/runtime consumers.
Changes:
- Update the shim rule to clear Bash’s command hash (
hash -r) beforetype -Pcapture to avoid stale hashed paths. - Require re-checking shim/real identity after the shim is written, removing the shim if it resolves to itself.
- Regenerate the distributed skill copies and update the associated source digest.
| File | Description |
|---|---|
| .agents/skills/shell-codestyle/SKILL.md | Clarifies shim resolution steps to avoid hashed-path self-recursion and adds a post-write identity check. |
| .github/skills/shell-codestyle/SKILL.md | Regenerated distribution copy reflecting the updated shim rule. |
| .claude-plugin/fleet-skills/skills/shell-codestyle/SKILL.md | Regenerated Claude plugin copy reflecting the updated shim rule. |
| .claude-plugin/fleet-skills/.source-digests/shell-codestyle | Updates the digest to match the regenerated source. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… and Setup Tooling (#2000) ## Summary Promotes develop to main, carrying the 16 pull requests merged to develop since #1943. - **Wait-loop guard (requirement 7):** [#1999](#1999) credits a comparison bound only inside a `[`, `[[`, or `test` invocation, and [#1996](#1996) reconciles the requirement's README count and diagram with its hook. - **Registry:** [#1994](#1994) and [#1976](#1976) record Vantage-Config's line endings and description. - **Scripts and tooling:** - [#1988](#1988) and [#1972](#1972) harden `ruleset_id()`. - [#1974](#1974) and [#1949](#1949) fix `pr_review.py` `reply --match` and `wait`. - [#1969](#1969), [#1964](#1964), [#1954](#1954) and [#1951](#1951) fix host-setup tool shadowing, shims, hook ownership and dpkg ownership checks. - **Gates and audit:** - [#1980](#1980) triages a path collision. - [#1967](#1967) and [#1962](#1962) tighten sha-pin and version-literal checks. - [#1956](#1956) keeps a folded `if:` visible to the interface audit. Closes #1636 Closes #1639 Closes #1948 Closes #1971 Closes #1718 Closes #1934 Closes #1877 Closes #1880 Closes #1865 Closes #1889 Closes #1966 Closes #1906 Closes #1935 Closes #1901 Closes #1905 Closes #1866 Closes #1897 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
The
shell-codestyleself-recursive shim rule could be followed literally and still build a shim that calls itself.type -Pprints a path bash has already hashed without checking that the file still exists, and-efis false while the shim is not yet written, so a shim deleted and rebuilt at a hashed path passed a test made only before the write.The rule now says to run
hash -rbefore capturing the real path withtype -P, keeps the identity test before the write, and repeats it once the shim is written, removing the shim where that repeat test fails. The generated.github/skills/and.claude-plugin/copies are regenerated withscripts/build_dist.py.Closes on promotion: #1906
🤖 Generated with Claude Code