Skip to content

Read a Compose Container Path and a Renamed File in the Prose Gate - #3685

Merged
ptr727 merged 4 commits into
developfrom
feature/burndown-3220-1586
Oct 31, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/burndown-3220-1586

Conversation

@ptr727

@ptr727 ptr727 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes two prose-gate defects in .github/actions/prose-gate/prose_lint.py, each with constructed test cases.

Container side of a Compose mount (#3220)

The home-path rule flagged the container side of a Compose volume mapping as a person's home. A mount target is a path the image ships, and it names no account on any host. The rule now skips a match on the container side of a mount inside a volumes: block, in a file named compose.yml, docker-compose.yml, their .yaml forms, or an override variant such as compose.override.yml:

  • In a short-syntax entry, the part after the host part's colon. A ${...} expansion and a drive letter in the host part are kept whole, so neither colon splits the entry.
  • In a long-syntax entry, the value of target:.

The host side still reports, and so do a long-syntax source:, a ${VAR:-...} default on the host side, a C:/Users/... drive path, the same line in a file that is not a Compose file, and a colon-joined value after the volumes: block closes, whether a sibling key or a dedent closes it.

This takes the issue's recommended option, which covers every image instead of adding accounts one at a time. One correction to the issue's reasoning: service_accounts is already an override key, so a downstream .prose-gate.json could add an account with no hub release. The class-wide fix still holds, since it needs no per-repository entry for each image.

Shapes still flagged, all in the safe direction: an anonymous volume with no colon (- /home/<account>/cache), a flow-style volumes: [...] list, and a target: under secrets:, configs:, or develop.watch.

A renamed file gets no diff scope (#1586)

With rename detection on, git reports a pure move with no +++ header and no hunk, so the destination got no scope. A file moved out of a generated tree into a checked path was never read, and the run exited 0.

The issue offered two directions. This takes the second one, reading rename to:

  • DIFF_ARGS pins --find-renames, so the host's diff.renames setting (true, false, or copies) decides nothing. Copy detection stays off, since a pure copy would leave the same hole.
  • changed_lines reads each block's rename from and rename to. When the source sat under a generated tree or matched an --exclude, the destination is read in full, since no run read it there. main now passes its excludes in.
  • A move between read paths adds only the lines it changed.

The first direction, --no-renames, was tried first and dropped after the local review. It reads every rename whole, so a pure move of any commented code file would need the comments label, and every older finding in a moved file would block the move, in every carrying repository.

undiffable_paths keeps its rename handling. Its --numstat -z parse already records a renamed undiffable file at its destination.

Verification

  • Reproduced prose_lint.py Adds Nothing to Scope for a Rename, So Prose Moved Out of a Generated Tree Is Never Read #1586 before the fix: a file holding a duplicated word, committed under reports/ and git mv'd to docs/, gave scope: 0 of 1 file(s) read and exit 0. After the fix the same run reports the finding and exits 1, under diff.renames set to true, false, and copies.
  • The new Compose and rename cases fail against the unfixed gate. The dedent-closing case fails with the dedent check removed, and the rename cases fail with the --find-renames pin removed.
  • python3 tests/test_prose_lint.py passes, and so do test_repo_gate, test_cli_usage, test_pre_commit_hook, and test_tooling_encoding. Ruff format and check, and mypy, are clean. The prose gate is clean on the diff.
  • Local strict review: four recorded passes. Pass 1 found the over-wide --no-renames and two test gaps. Pass 2 found test gaps and the item filed below. Pass 3 found that no rename case failed with the --find-renames pin removed: the copy fixture left its source unedited, and copy detection searches only the files a change modifies, and the move between read paths ran only under diff.renames=true. Each was fixed in the next push. Pass 4 found nothing. Stripping the pin now fails the generated-tree case and the between-read-paths case.

Pre-existing findings, filed

Declined

  • The Compose file-name pattern stays in the script rather than prose-gate.json. It names a file format, not an exemption a repository tunes. TestVocabularyLivesInTheData does not flag it.

Closes on promotion: #3220, #1586

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 30, 2026 20:37
The home-path rule now skips the container side of a Compose volume
entry, the part after the host path's colon or a long-syntax target,
since an image ships that path and it names no account on a host. The
host side, and the same text in any other file, still report.

The diff now pins --no-renames, so a moved file reaches the scope as a
whole addition. A file renamed out of a generated tree was otherwise
never read by any run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading every rename whole put each pure move of an already-checked
file fully in scope, so a moved commented code file needed the comment
label and every older finding blocked the move. The diff now pins
rename detection on, and a rename credits its destination in full only
where it left a generated tree or an excluded path, the paths no run
reads. A move between read paths adds only what it changed.

Also covers the Compose volume block closing on a dedent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 31, 2026 03:51
@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 bfa354127204bee2a8bf1bfd02949e53b1f1c0d0, the content this pull request carries at that commit against develop, and it recorded 3 findings.

The copy case now edits its source, the only file copy detection
searches, and the move between read paths runs under each diff.renames
setting. Removing --find-renames now fails both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head ef60b5dc2f998d15d997e714c1415bc49fe38ef4, the content this pull request carries at that commit against develop, and it recorded 0 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

The test changes leave copy-detection coverage ineffective and incomplete, with a misleading fixture explanation and no read-path checks across host settings.

3 open issues
What changed in this PR

This pull request fixes two prose-gate defects: false home-path findings for Compose container mount targets and missing diff scope for renamed files.

Changes:

  • Excludes recognized Compose volume container paths from host-home checks.
  • Pins Git rename detection and scopes renamed destinations when their sources were unread.
  • Adds regression tests for Compose mounts and rename-based diff scoping.
File Description
tests/​test_prose_lint.py Adds regression coverage for Compose paths and renamed-file scope behavior.
.github/​actions/​prose-gate/​prose_lint.py Adds Compose container-path detection and rename-aware diff scoping.

Review effort: Lite

Comment thread tests/test_prose_lint.py Resolved
Comment thread tests/test_prose_lint.py Resolved
Comment thread tests/test_prose_lint.py Resolved
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.74%. Comparing base (96475c1) to head (ef60b5d).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3685   +/-   ##
========================================
  Coverage    81.74%   81.74%           
========================================
  Files           27       27           
  Lines         9139     9139           
========================================
  Hits          7471     7471           
  Misses        1668     1668           
Flag Coverage Δ
python-3.13 81.74% <ø> (ø)

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 merged commit 061b996 into develop Oct 31, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/burndown-3220-1586 branch October 31, 2026 13:59
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