Repository navigation
Match a Retired Copy on Line Endings Alone - #4256
Conversation
content_hash masks action pins and job needs: lists as well as line endings, so a retired workflow copy changed only in one of those read as a past hub version and drew the automatic delete finding. matches_hub_history now normalizes line endings only, so such a copy goes to the maintainer. The line-ending step is one helper, normalize_line_endings, which normalize and strip_sections now share. Answers a Copilot finding on promotion #4255. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The docstring said such a copy was changed by the repository, though Dependabot bumps those pins. It now says the two cannot be told apart, which is why the copy goes to the maintainer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟡 Changes recommended
The regression test uses short action-SHA placeholders, so it passes before the fix and fails to verify the intended action-pin behavior.
1 open issue
What changed in this PR
This pull request makes retired-file history matching ignore only line-ending differences, preventing action-pin and needs: changes from being treated as historical matches. Changes:
- Adds and reuses
normalize_line_endingsacross fidelity helpers. - Updates retired-copy matching to compare line-ending-normalized text only.
- Adds regression coverage for exact matches, CRLF copies, changed pins, and unreadable files.
- The changed-pin regression fixture should use a real 40-character hexadecimal action SHA to exercise the previous masking behavior.
| File | Description |
|---|---|
| tests/test_audit_helpers.py | Adds regression coverage for retired-copy history matching, including exact, line-ending-only, changed-pin, and unreadable-copy cases. |
| spec/fidelity_text.py | Adds the shared normalize_line_endings helper and reuses it across fidelity normalization paths. |
| spec/audit.py | Uses line-ending-only comparisons when matching retired files against historical hub revisions. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4256 +/- ##
========================================
Coverage 78.19% 78.20%
========================================
Files 42 42
Lines 15410 15415 +5
========================================
+ Hits 12050 12055 +5
Misses 3360 3360
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:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
The pin-changed case used "@aaaa" and "@bbbb", which the action-pin pattern does not match, so the old content_hash comparison already told the copies apart and the case tested nothing. It now uses 40-hex SHAs, and asserts content_hash treats the two copies as equal, so the case exercises the line-endings-only match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
…trap Secret Restore (#4255) ## Summary Promotes `develop` to `main`. It carries nine changes: - [#4247](#4247): retires the `CLAUDE.md` pointer file, the second half of #4074. The hub's copy and its `spec/files.json` entry are gone, and a `retire` gap records why. The audit now reports a retired path the hub no longer tracks. A copy matching a past hub revision is reported for deletion, and any other copy is reported for the maintainer. It merged on the maintainer's go-ahead after reading its diff, which touches `host-setup/agent-safety/README.md`. - [#4256](#4256): that match compares line endings alone, so a retired copy differing in an action pin or a `needs:` list goes to the maintainer. It answers a Copilot finding on this promotion. - [#4260](#4260): the audit run stamp names the commits it read. HEAD carries `-dirty` where the read paths differ from it, and `main <sha>` is added where the fetched `main` differs. - [#4259](#4259): `pr-review-conduct` states the `pr_review.py` spelling rule once for every call a fleet skill prints. Under a restricted uv cache, a merge or a branch delete is reported to the maintainer as a blocked write. - [#4261](#4261): `validate-task.yml` takes a `test-matrix-file` input, read through the same validation as `test-matrix`. - [#4257](#4257): the pre-commit snippet says to exclude `hub_fetch_run.py` from a repository's own ruff with `force-exclude = true`. The short-form `AUDIT.md` snippet drops its two hub-audit authority sentences. - [#4246](#4246): `bootstrap.sh --secrets` and `bootstrap.ps1 -Secrets` restore named secret buckets, on their own or as a step of a `--host` or `--dev` stand-up. - [#4250](#4250): `host-*` buckets in `scripts/secrets_sync.py` may each hold the same home-relative title. - [#4258](#4258): a dry run with no 1Password account is refused rather than enrolling one, and the root-refused secrets tests skip on a root runner. It answers two CodeRabbit findings on this promotion. Hosts already carry the load-both setting the retirement relies on, from the 2.0.1483 kit. Closes #4074 Closes #4236 Closes #4238 Closes #4239 Closes #4242 Closes #4243 Closes #4248 Closes #4249 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Answers Copilot's
spec/audit.py:1568finding on promotion #4255. Part of #4074.What Changes
matches_hub_historyusedcontent_hash, which goes throughfidelity_text.normalizeand masks action pins and jobneeds:lists as well as line endings. So a copy of a path retired outright, changed only in one of those, read as a past hub version and drew the automatic delete finding. It now compares line-ending-normalized text only, so such a copy goes to the maintainer. A Dependabot pin bump and a repository edit look alike there, and both go to the maintainer.normalize_line_endingsinspec/fidelity_text.pyreplaces the two inline copies innormalizeandstrip_sections, whose output is unchanged.Dropped findings
scripts/canonical_review.pynormalize, consolidation: it does whatnormalize_line_endingsdoes, in a file this change does not touch.Verification
tests/test_audit.py,test_audit_helpers.py,test_fidelity_honesty.py,test_fidelity_text.py: 187 tests OK.prose_lint.py --diffagainstdevelopare clean, with--allow-commentsfor the docstrings.frontiertier. The first raised a docstring error, fixed in2e168411, and the consolidation dropped above. The second found nothing.🤖 Generated with Claude Code