Skip to content

Drop Malformed Keep Rows and Decode Tracked Paths as the Audit Does - #4275

Merged
ptr727 merged 4 commits into
developfrom
feature/retired-path-promo-fixes
Nov 19, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/retired-path-promo-fixes

Conversation

@ptr727

@ptr727 ptr727 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Three findings Copilot raised on the develop -> main promotion #4274, fixed on develop since the promotion's head is develop.

  • spec/audit.py gap_rows. A repos-scoped row is admitted only where every entry is a string, so the divergence report's set of them cannot raise on a hand-malformed ledger. spec/validate.py refuses such a row in CI.
  • spec/validate.py hub_tracked_paths. Paths decode with surrogateescape, as audit.hub_tracked does, so a tracked path that is not valid UTF-8 no longer ends the gate on a traceback.
  • spec/project-types.json carried.hubonly.absent. The assertion states the retire-outright and per-repository keep cases AUDIT.md "carried-scope" already states.

Verification

  • New tests: a malformed scoped row is dropped, and a non-UTF-8 tracked path is listed.
  • spec/validate.py OK. ruff, mypy, prose_lint.py --diff origin/develop and build_dist.py --check are clean. test_spec_validate, test_audit, test_audit_helpers, test_fidelity_honesty and test_audit_size pass.
  • Local strict review: three recorded passes. The first found one sentence over 25 words, now split. The second found no real defect. The third, over Copilot's rewording fix, found a test docstring claiming the audit decodes the same listing, fixed in 0d28345. The fourth found nothing.

Filed

Two edges the second pass found are added to #4273: the dispositions filter in render_report admitting non-string repos entries, and a retire row under a repo-owned tree entering the hub-only set.

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 18, 2026 18:09
gap_rows admits a scoped row only where every repos entry is a string, so the
report's set of them cannot raise. hub_tracked_paths decodes with
surrogateescape, as audit.hub_tracked does. The carried.hubonly.absent
assertion states the retire-outright and per-repository keep cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 19, 2026 02:13
@ptr727

ptr727 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

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
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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 specification uses “in the set” for retired paths even though they are added via deletion_candidates and excluded from hub_only_paths, creating a contradictory and ambiguous edge-case description.

1 open issue
What changed in this PR

This pull request hardens audit and validation handling for malformed scoped ledger rows and non-UTF-8 tracked paths, while documenting retired-path and repository-scoped keep behavior.

Changes:

  • Filters malformed scoped rows whose repository entries are not strings.
  • Decodes tracked paths with surrogateescape.
  • Expands carried-scope documentation and adds regression tests.
File Description
tests/​test_spec_validate.py Adds coverage for listing tracked paths containing invalid UTF-8 bytes without raising.
tests/​test_audit_helpers.py Adds coverage confirming malformed scoped rows are dropped.
spec/​validate.py Decodes tracked paths with surrogateescape to preserve undecodable bytes during validation.
spec/​project-types.json Documents retired-path and repository-scoped keep behavior in the carried-scope assertion.
spec/​audit.py Filters scoped gap rows whose repository entries are not strings before audit processing.

Review effort: Lite

Comment thread spec/project-types.json Resolved
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.21%. Comparing base (f51b3f6) to head (0d28345).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4275   +/-   ##
========================================
  Coverage    79.21%   79.21%           
========================================
  Files           42       42           
  Lines        15502    15502           
========================================
  Hits         12280    12280           
  Misses        3222     3222           
Flag Coverage Δ
python-3.13 79.21% <100.00%> (ø)

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 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Action not completed

Head commit changed.

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.

@ptr727

ptr727 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727
ptr727 merged commit 349b4e6 into develop Nov 19, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/retired-path-promo-fixes branch November 19, 2026 02:45
ptr727 added a commit that referenced this pull request Nov 19, 2026
## Summary

Promotes `develop` to `main`. It carries these changes:

- [#4271](#4271) settles
the retired-path lane.
- **Dropped carries.** A carried baseline file that the manifest drops,
and that the audit's hub-only check cannot see, owes a fleet-wide
`retire` or `accepted` gaps row. `spec/validate.py` pins every path the
baseline has ever declared, and `codecov.yml` takes an `accepted` row.
- **Per-repository keeps.** A gaps row may carry `repos`, accepted only
and cataloged repositories only. The audit and the divergence report
honor it for those repositories alone.
- **Unreadable retired copies.** They are reported as unread. One
`history_keys` helper serves the three history comparisons.
  - **Filed from its review:** #4272 and #4273.
- [#4275](#4275) fixes
three findings this promotion's first Copilot round raised: a malformed
keep row is dropped before the report reads it, tracked paths decode
with `surrogateescape`, and the `carried.hubonly.absent` assertion
states the new cases. The `gap_rows` thread resolved itself when its
line moved, and this line is its outcome.

Closes #4251
Closes #4253
Closes #4254

🤖 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