Skip to content

Clear Bash's Hash and Test the Shim After It Exists in the Shim Rule - #1964

Merged
ptr727 merged 2 commits into
developfrom
feature/auto-1906
Sep 28, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/auto-1906

Conversation

@ptr727

@ptr727 ptr727 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

The shell-codestyle self-recursive shim rule could be followed literally and still build a shim that calls itself. type -P prints a path bash has already hashed without checking that the file still exists, and -ef is 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 -r before capturing the real path with type -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 with scripts/build_dist.py.

Closes on promotion: #1906

🤖 Generated with Claude Code

ptr727 and others added 2 commits September 27, 2026 21:13
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>
Copilot AI lite review requested due to automatic review settings September 28, 2026 04:15
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

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

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 69362cf5-aeb5-4482-a538-0f55d48eceaf


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.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@f71a925). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1964   +/-   ##
==========================================
  Coverage           ?   55.41%           
==========================================
  Files              ?       16           
  Lines              ?     7247           
  Branches           ?        0           
==========================================
  Hits               ?     4016           
  Misses             ?     3231           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 55.41% <ø> (?)

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.

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.

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) before type -P capture 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.

@ptr727
ptr727 merged commit a84d4b6 into develop Sep 28, 2026
11 checks passed
@ptr727
ptr727 deleted the feature/auto-1906 branch September 28, 2026 04:18
ptr727 added a commit that referenced this pull request Sep 28, 2026
… 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)
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