Repository navigation
Drop Malformed Keep Rows and Decode Tracked Paths as the Audit Does - #4275
Conversation
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]>
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 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
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
## 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)

Summary
Three findings Copilot raised on the develop -> main promotion #4274, fixed on develop since the promotion's head is develop.
gap_rows. Arepos-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.pyrefuses such a row in CI.hub_tracked_paths. Paths decode withsurrogateescape, asaudit.hub_trackeddoes, so a tracked path that is not valid UTF-8 no longer ends the gate on a traceback.carried.hubonly.absent. The assertion states the retire-outright and per-repository keep cases AUDIT.md "carried-scope" already states.Verification
spec/validate.pyOK.ruff,mypy,prose_lint.py --diff origin/developandbuild_dist.py --checkare clean.test_spec_validate,test_audit,test_audit_helpers,test_fidelity_honestyandtest_audit_sizepass.Filed
Two edges the second pass found are added to #4273: the dispositions filter in
render_reportadmitting non-stringreposentries, and aretirerow under a repo-owned tree entering the hub-only set.🤖 Generated with Claude Code