Skip to content

Promote Develop to Main: Pin Dropped Carries and Scope Keep Rows - #4274

Merged
ptr727 merged 2 commits into
mainfrom
develop
Nov 19, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Promotes develop to main. It carries these changes:

  • #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: Report Downstream Copies When a Whole Tree Declaration Is Dropped #4272 and Close Latent Edges in the Retired-Path Checks #4273.
  • #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

…ad (#4271)

## Summary

The retired-path lane: #4251, #4253 and #4254 together, since all three
edit the hub-only check or its helpers.

- **#4251.** 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` row in `spec/divergences.json` `gaps`. The audit sees a
tracked regular file outside every tree source and repo-owned tree.
`spec/validate.py` reads that set from `git ls-files -s` and pins every
path the baseline has ever declared (`CARRIED_PATH_PINS`, 39, checked
against the full history of `spec/files.json`), since the validate job
runs on a shallow clone. A new baseline path must be pinned. A file
moved into a tree takes an `accepted` row, with no exemption, since
every exemption tried leaked copies. `codecov.yml` takes an `accepted`
row, per the no-stale-name-guard decision on its rename in #4077.
- **#4253.** A `gaps` row may carry `repos`, accepted only and cataloged
repositories only, recording that they keep their own copy.
`audit.gap_rows` splits fleet-wide from scoped rows once.
`check_hubonly_carried` and the divergence report honor a keep, and the
report shows it live, unverified, now resolved, or resolved. The gate
and a schema conditional (`scopedGapAccepts`) hold the shape, and a path
holds at most one fleet-wide row.
- **#4254.** An unreadable retired copy is reported through `run.unread`
rather than as one matching no past hub version. One helper,
`history_keys`, serves `matches_hub_history`, `classify_verbatim` and
`fidelity_pass`, each keeping its own normalization. The deletion check
normalizes line endings only, on purpose.

The maintainer chose the pinned table, the `accepted` row for
`codecov.yml`, scoped `accepted` rows, and the stop rule below.
`spec/audit.py` is 2983 lines, under its 3000-line ceiling.

#4251, #4253 and #4254 stay open until the promotion carries their
closing lines.

## Verification

- Full suite: 4500+ tests OK, 12 skipped, on the push-5 head. The
affected modules pass on the final head.
- `spec/validate.py` OK on the shipped ledger. Before the `codecov.yml`
row it failed on exactly that path.
- `ruff format --check`, `ruff check`, `mypy` (109 files),
`prose_lint.py --diff origin/develop` and `build_dist.py --check` are
clean.
- Local strict review: twelve recorded passes across six pushes, with
findings per pass of 9, 4, 5, 3, 2, 2, 2, 4, 2, 3, 4, then 0 real in
each of the last two. From pass 4 on, most findings were edges in the
previous fix. The maintainer's stop rule after pass 11: fix the cheap
real ones, file the rest. The last pass found no real defect.

## Filed

- #4272: dropping a whole `trees` declaration leaves its target's copies
unreported.
- #4273: two latent edges in the drop check (the `retire` remedy for a
moved file, strict UTF-8 decoding). The third, a missing ledger skipping
the check, was CodeRabbit's finding and is fixed here.

## Open Edge, Not Filed

- **tests/test_fidelity_honesty.py (edge, test layout).** The two new
test classes sit above
`test_main_spec_carries_the_ledger_retired_paths`, so that method now
belongs to `ScopedKeepReportCase`. It runs and passes. Listed per the
stop rule.

## Declined

- **spec/audit.py `gap_rows` isinstance guards (over-hardening).** They
follow the degrade pattern `load_ledger` documents, and live once.
`spec/validate.py` and the schema refuse a malformed scoped row in CI.
- **`hub_tracked_paths` returning None rather than raising
(over-hardening).** A fixture test runs `validate.py` in a scratch tree
outside git and asserts no traceback, so the gate reports that case.

## Dropped Findings

- spec/fidelity_honesty.py `fidelity_pass`: its match/stale/differs
classification restates `classify_verbatim` (pre-existing,
consolidation, untouched text).
- spec/validate.py `tree_carrying`: its include test repeats
`scripts/carry.py` `included` and `audit.tree_path_included`
(consolidation, dropped by the maintainer's stop rule).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 19, 2026 01:53
@coderabbitai

coderabbitai Bot commented Nov 19, 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

Approval is blocked by an undocumented audit assertion gap and two moderate robustness issues: malformed scoped rows can crash report rendering, and invalid UTF-8 tracked paths can crash validation.

3 open issues
What changed in this PR

This PR promotes retired-path handling from develop to main, strengthening validation, auditing, divergence reporting, and documentation for dropped carries and repository-scoped keeps.

Changes:

  • Pins historically carried paths and requires appropriate gap decisions when they are dropped.
  • Supports repository-scoped accepted keeps for cataloged repositories.
  • Reports unreadable retired copies and consolidates shared history matching.
  • Review findings identify remaining validation issues for malformed scoped rows, invalid UTF-8 paths, and dropped tree declarations.
File Description
tests/​test_spec_validate.py Tests dropped-carry validation, scoped gap rows, tracked-path handling, and validator wiring.
tests/​test_fidelity_honesty.py Tests repository-scoped keeps, resolved states, and divergence report output.
tests/​test_audit.py Tests unreadable retired copies and repository-scoped keeps during audits.
tests/​test_audit_helpers.py Tests scoped disposition parsing and shared history-key behavior.
spec/​validate.py Adds carried-path pins, dropped-carry checks, scoped gap validation, and Git-tracked path discovery.
spec/​fidelity_honesty.py Incorporates repository-scoped keeps into live gap and divergence reporting.
spec/​divergences.schema.json Defines scoped gap rows and restricts them to accepted dispositions.
spec/​divergences.json Records the accepted retirement decision for the legacy codecov.yml path.
spec/​audit.py Adds scoped keep handling, unreadable retired-copy reporting, and shared history matching.
RESYNC.md Documents dropped baseline paths, unreadable copies, and repository-scoped keep decisions.
AUDIT.md Documents the updated carried-scope audit behavior.

Review effort: Lite

Comment thread spec/audit.py Resolved
Comment thread spec/validate.py Resolved
Comment thread AUDIT.md Resolved
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.72650% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.21%. Comparing base (c76e275) to head (349b4e6).
⚠️ Report is 509 commits behind head on main.

Files with missing lines Patch % Lines
spec/validate.py 95.38% 3 Missing ⚠️
spec/audit.py 96.66% 1 Missing ⚠️
spec/fidelity_honesty.py 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4274      +/-   ##
==========================================
+ Coverage   78.46%   79.21%   +0.75%     
==========================================
  Files          42       42              
  Lines       15434    15502      +68     
==========================================
+ Hits        12110    12280     +170     
+ Misses       3324     3222     -102     
Flag Coverage Δ
python-3.13 79.21% <95.72%> (+0.75%) ⬆️

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

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.

…4275)

## 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](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

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

Approval is blocked by active correctness issues where malformed scoped rows and dropped tree targets or scoped keeps can be silently treated as resolved, and one regression fixture does not exercise the dropped-carry validation path.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Reject empty repository lists in scoped rows

spec/​audit.py:175

[P1] Drop empty scoped rows before rendering. spec/validate.py rejects repos: [], but this branch admits it as a scoped row. render_report then sees no live or unreadable repositories and marks the malformed row resolved, hiding the ledger defect instead of leaving it visible for repair. Require a non-empty list here, matching the gate's shape check.

Medium severity Ensure the fixture reaches the dropped-carry check

tests/​test_spec_validate.py:2917

[P2] Make this fixture reach the dropped-carry call. Because root is outside a Git worktree, hub_tracked_paths(root) returns None, so validate.main() takes the error branch at lines 2243-2247 and skips dropped_carry_errors entirely. A regression that removes the missing-ledger call site would therefore still pass this test. Initialize a temporary Git tree or stub hub_tracked_paths with tracked files, then assert the dropped-carry result.

3 resolved since last review

Review effort: Lite

Comment thread spec/validate.py Resolved
Comment thread spec/validate.py Resolved
@ptr727

ptr727 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Answering the two findings with no thread on this head: "Reject empty repository lists in scoped rows" (spec/audit.py:175) and "Ensure the fixture reaches the dropped-carry check" (tests/test_spec_validate.py:2917). Both are filed in #4273. No current input reaches the first, since spec/validate.py refuses an empty repos list in CI. The second is a test that proves the check runs outside the ledger guard but not the call itself. #4273 asks for a git-initialized fixture.

@ptr727
ptr727 merged commit b15d814 into main Nov 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants