Skip to content

fix(code-metrics): label Files with clones vs scope when registry excludes all (#3843) - #4706

Merged
cursor[bot] merged 6 commits into
mainfrom
cursor/3843-code-metrics-file-counts-37e9
Sep 27, 2026
Merged

cursor[bot] merged 6 commits into
mainfrom
cursor/3843-code-metrics-file-counts-37e9

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Closes #3843

Summary

Keeps separate populations; when exclusions leave files with only excluded groups, the report labels that Files with clones counts surviving groups only. Schema docs state the resolution.

code-metrics → 0.3.18.

Test plan

  • Python + duplication suites; new tests fail on main (per implementer)
Open in Web Open in Cursor 

…exclusion (#3843)

When a sanctioned-replication registry excluded every clone group, the
duplication report read Files with clones: 0 beside a scope header counting
every scanned file, with nothing saying why. The counts measure different
populations and stay apart: the exclusion line now names how many files hold
nothing but excluded groups, and the report schema states which population
summary.files and scope.files each describe.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body does not yet satisfy the issue-linkage contract:

  • Missing a "## Fix" section. State the concrete change and how it addresses the problem.
  • Missing a "## Verification" section. Record concrete evidence the change works (commands, gates, output).
  • Missing a "## Related" section. List related PRs, ADRs, or decision-log entries this PR does not close.

Edit the body and this comment updates itself on the next run.

@cursor
cursor Bot marked this pull request as ready for review September 27, 2026 22:55
cursoragent and others added 5 commits September 27, 2026 23:08
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
The DLSS selftest's user-only Set-Acl deny still lets an elevated runner
list the folder, and Windows often leaves the error TargetObject empty, so
the four unreadable-folder assertions never match.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
DirectoryInfo.SetAccessControl is absent in PowerShell 7, so the Windows
selftest threw before the deny cases ran. Write the same user,
Administrators, and Everyone list deny through FileSystemAclExtensions.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
A Deny ACE, including one for Everyone, still lets the elevated Windows
runner list the folder. Hold the directory open with no sharing so the
next Get-ChildItem fails with a sharing violation, and recover a quoted
path from the error message when TargetObject is empty.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
The runner's pwsh has no FileOptions.BackupSemantics, so the selftest
threw before the sharing lock was taken. Open the directory with
CreateFileW and FILE_FLAG_BACKUP_SEMANTICS instead.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
@cursor
cursor Bot merged commit 2479cda into main Sep 27, 2026
15 checks passed
@cursor
cursor Bot deleted the cursor/3843-code-metrics-file-counts-37e9 branch September 27, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

code-metrics: count the files of fully-excluded replication instances in the summary, or say why the scope header and summary disagree

2 participants