fix(warehouse): include tracked deleted files in summary + tracked-paths expansion (PER-186)#153
Conversation
The _expand_pattern helper in both summarize_changes.py and _tracked_paths.py previously used glob.glob + Path.is_file() to resolve beacon.yaml glob patterns. This silently excluded tracked-but-deleted files because is_file() returns False for paths that no longer exist on disk. Fix: supplement the glob results with git ls-files for glob patterns. git ls-files lists tracked paths regardless of working-tree existence, so deleted files matching the pattern are now included. Explicit (non-glob) patterns are left unchanged as before. Also adds tests verifying: - deleted glob match appears with D status - deleted explicit path appears with D status - is_dirty() correctly classifies ' D' and 'D ' deletion codes Closes PER-186.
OpenCode ReviewModel: I’ll check the repository review context instructions, then evaluate only the attached diff for correctness and project-rule violations. Findings
Open Questions
Notes
Token UsageInput tokens: |
Supervisor triage — bot round 1Bot reviewed commit: Findings
Notes / residual risks
Dispatching round 2 fix-up. 🤖 diligent-supervisor |
…ked files - Add _git_tracked_or_staged_deleted helper in both _expand_pattern copies to supplement git ls-files with git diff --cached --diff-filter=D, catching staged deletions that ls-files alone misses. - Fix directory-pattern branch to also use the git-backed helper, so deletions under a tracked directory are surfaced even when the working-tree directory has been removed by git rm. - Add 6 new tests covering staged-deletion glob match, directory-pattern unstaged deletion, and directory-pattern staged deletion.
OpenCode ReviewModel: I’ll check the repository review context rules, then assess only the attached diff for concrete regressions and test gaps. Findings
Open Questions
Notes
Token UsageInput tokens: |
Supervisor triage — bot round 2Bot reviewed commit: Findings
Notes / residual risks
PR is READY. CI green; bot findings verified-false. No round 3 needed. 🤖 diligent-supervisor |
Summary
summarize_changes.py:_expand_patternand_tracked_paths.py:_expand_patternfiltered glob matches byPath.is_file(), silently excluding tracked-but-deleted files from/contribute-warehousetriage.git ls-files -- <pattern>so tracked deletions are included.test_summarize_changes.py(glob+explicit deletion,is_dirtyforD/D) and 2 new tests intest_tracked_paths.py(glob+explicit deletion).Closes PER-186.
Test plan
pytest test_summarize_changes.py test_tracked_paths.py→ 37 passedruff checkon touched files → clean🤖 Generated by diligent-supervisor / delegate-to-oc (kimi-for-coding/k2p6)