Skip to content

Match a Retired Copy on Line Endings Alone - #4256

Merged
ptr727 merged 3 commits into
developfrom
feature/retired-match-eol-only
Nov 17, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/retired-match-eol-only

Conversation

@ptr727

@ptr727 ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Answers Copilot's spec/audit.py:1568 finding on promotion #4255. Part of #4074.

What Changes

  • A retired copy matches a past hub version on line endings alone. matches_hub_history used content_hash, which goes through fidelity_text.normalize and masks action pins and job needs: 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.
  • One line-ending helper. normalize_line_endings in spec/fidelity_text.py replaces the two inline copies in normalize and strip_sections, whose output is unchanged.
  • A test covers the revision itself, a CRLF copy, a pin-changed copy, and an unreadable copy.

Dropped findings

  • scripts/canonical_review.py normalize, consolidation: it does what normalize_line_endings does, 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.
  • ruff, mypy, and prose_lint.py --diff against develop are clean, with --allow-comments for the docstrings.
  • Two recorded local strict review passes at the frontier tier. The first raised a docstring error, fixed in 2e168411, and the consolidation dropped above. The second found nothing.

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 17, 2026 07:15
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]>
Copilot AI lite review requested due to automatic review settings November 17, 2026 15:20
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 17, 2026
@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

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.

🟡 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_endings across 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

Comment thread tests/test_audit_helpers.py Resolved
@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.20%. Comparing base (d5750fa) to head (f681343).

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           
Flag Coverage Δ
python-3.13 78.20% <100.00%> (+<0.01%) ⬆️

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 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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]>
@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727
ptr727 merged commit 7c082a0 into develop Nov 17, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/retired-match-eol-only branch November 17, 2026 15:55
ptr727 added a commit that referenced this pull request Nov 17, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants