Skip to content

Carry a Newly Declared Verbatim Section in carry.py Instead of Refusing - #3683

Merged
ptr727 merged 10 commits into
developfrom
feature/burndown-3614
Oct 31, 2026
Merged

ptr727 merged 10 commits into
developfrom
feature/burndown-3614

Conversation

@ptr727

@ptr727 ptr727 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

scripts/carry.py plan_unit refused a resync when a declared verbatim section was absent from the target. plan_unit now plans such a section as missing, and apply-sections inserts it.

Insertion point (the issue left it open): the hub's own canonical order. The section goes after the target's copy of the nearest preceding hub section the target holds, else before the nearest following one, else at the end of the file. A repository's local sections between two hub sections stay where they are. The target's line ending is kept, the heading sequence is re-asserted afterwards, and an exact post-insert check proves nothing outside the new region changed apart from the separator an end-of-file insertion needs. A carried file absent from the target is still refused as a standup question.

Added beyond the issue: a missing section whose unchanged text the target already holds under a heading the hub does not carry is refused as a likely rename, since inserting would duplicate it. An edited rename, or text under a heading the hub keeps as intent, is not caught.

check-sections reports a missing section in stale (exit 1) and in a new missing key. Tests use constructed documents and live in tests/test_carry.py, the existing carry test file.

Files: scripts/carry.py, tests/test_carry.py, RESYNC.md, scripts/README.md.

Pre-existing findings, filed:

Deferred to #3690 (introduced, edit budget spent):

  • The README still says every refusal is raised while planning, but insertion refusals now raise in apply_plans phase 1, so check-sections can report a file plannable that apply-sections refuses.
  • An unclosed fence in the target makes outside_sections report an inserted section as absent, never naming the fence; the test asserts only CarryError.
  • The rename scan is per file, so a section moved unchanged between AGENTS.md and GOVERNANCE.md is inserted as a second copy.

Closes on promotion: #3614

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 30, 2026 20:33
plan_unit refused a resync when a declared verbatim section was absent from
the target. It now plans the section as missing and apply-sections inserts it,
placed after the target's copy of the nearest preceding hub section, else before
the nearest following one, else appended. A carried file absent from the
target is still refused as a standup question.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eck Insertion Exactly

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 31, 2026 03:48
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • 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

@ptr727

ptr727 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

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

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 active moderate defect in duplicate detection, with two additional consistency and unreachable-guard issues still requiring changes.

3 open issues
What changed in this PR

This pull request updates carry.py to insert newly declared verbatim sections during resync while preserving canonical hub order, local content, line endings, and unchanged regions.

Changes:

  • Plans absent declared sections as missing and inserts them at the appropriate hub-relative position.
  • Adds post-insertion validation, missing-section reporting, and duplicate-content refusal.
  • Expands tests for insertion order, CRLF files, rename-shaped conflicts, and apply behavior.
  • Documents the updated resync and check-sections behavior.
File Summary Review findings
tests/​test_carry.py Adds coverage for missing sections, insertion ordering, line endings, duplicate text, and apply behavior. None recorded.
scripts/​README.md Documents carry behavior and refusal conditions. P2 nit, 1 vote: Remove incidental assertion counts and numeric ordinal references from the documentation paragraph.
scripts/​carry.py Implements missing-section planning, ordered insertion, validation, and reporting. P1 moderate, 4 votes: Restrict duplicate detection to complete section bodies rather than the entire target document. P2 nit, 4 votes: Route all section-name normalization through fold. P2 nit, 3 votes: Remove or relocate the unreachable insertion guard.
RESYNC.md Documents insertion behavior during instruction-set resync. None recorded.

Review effort: Lite

Comment thread scripts/carry.py Resolved
Comment thread scripts/carry.py Resolved
Comment thread scripts/carry.py Resolved
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.59036% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.85%. Comparing base (96475c1) to head (33a2c0f).

Files with missing lines Patch % Lines
scripts/carry.py 97.59% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3683      +/-   ##
===========================================
+ Coverage    81.74%   81.85%   +0.11%     
===========================================
  Files           27       27              
  Lines         9139     9195      +56     
===========================================
+ Hits          7471     7527      +56     
  Misses        1668     1668              
Flag Coverage Δ
python-3.13 81.85% <97.59%> (+0.11%) ⬆️

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 Oct 31, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727
ptr727 merged commit f3227c4 into develop Oct 31, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/burndown-3614 branch October 31, 2026 04:38
ptr727 added a commit that referenced this pull request Oct 31, 2026
…de, Read Compose and Renamed Paths, and Exempt a Delete-Only Push (#3693)

Promotes the changes merged into `develop` since promotion #3681 to
`main`, the first round of a backlog burndown.

- [#3683](#3683) Carries a
newly declared verbatim section in `carry.py` instead of refusing. The
missing section is inserted in hub order: after the nearest preceding
held section, else before the nearest following one, else at the end of
the file. A rename is refused only for an unchanged body under a target
H2 the hub does not carry, and the plans apply in two phases.
- [#3689](#3689) Reads a
null GraphQL node in `pr_review.py` as unread, re-reading and then
exiting 1 naming the path. Names a closed pull request's state in the
digest, and ends `wait` on a pull request that is no longer open the way
`status` does. `merge-and-release` step 2 stops on `state=MERGED`.
- [#3685](#3685) Skips the
container side of a compose volume entry in the prose gate's home-path
rule. Pins `--find-renames` in the gate's diff, and reads a renamed file
whole only when it came from a generated tree or an excluded path.
- [#3691](#3691) Exempts a
delete-only push from the write guard's primary-checkout rule: a named
remote, every refspec a delete of a branch other than `main`, `master`
or `develop`, and only the delete, dry-run, quiet and verbose options.
The branch's live protection rules still apply. Adds regression cases
for #1628.

Deferred review findings: #3694 (a YAML block scalar in a Compose file's
volume scan) and #3690 (the `scripts/README.md` apply-time refusal
sentence). #3695 records a pre-existing write-guard question raised
while verifying them.

Fixes #3614
Fixes #3392
Fixes #3677
Fixes #3220
Fixes #1586
Fixes #1642
Fixes #1628

🤖 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