Repository navigation
Add a CI guard against colliding artifact paths patterns - #1947
Merged
Merged
Conversation
This was referenced Aug 13, 2026
Two patterns in one `paths` tuple that differ only in case are two patterns on macOS and Linux and one pattern on Windows, because `os.path.normcase` folds case there. The entry point extends `files_found` once per declared pattern with no dedup, and an artifact that calls `seeker.search()` once per spelling gets the same first match back from both calls, so one file is reported twice. The worse outcome is that the second file, the one the duplicate pattern was added for, is never read at all. That shipped in `messageRetention` until #1946: both spellings of com.apple.MobileSMS.plist exist as different files on 6 of the 20 local corpora carrying it, iOS 14.3 through 26.5.2, and on Windows the artifact read the 630-byte wrong one twice and reported "No value" for a device whose Keep Messages setting was "Forever". Nothing errored, rows were produced, and macOS output was correct, so no sweep flagged it. `check_artifact_paths.py` parses each module's `__artifacts_v2__` literal, groups every `paths` entry by its Windows-folded form, and fails on any group holding more than one spelling. It also fails on a pattern repeated verbatim, which double-counts on every platform. Discovery is recursive over `scripts/` rather than a `scripts/artifacts/*.py` glob. Artifact modules also live in `scripts/alternate_artifacts/`, which `--custom_artifacts_path` loads, and in `scripts/test_artifacts/`; a directory-pinned glob misses those today and would silently stop covering any directory added later. Recursive discovery finds 843 tuples across 380 modules where the pinned glob found 841 across 375. Modules whose block is not a static literal are reported NOT CHECKED so the coverage hole stays visible, matching check_claim_language.py. `--self-test` runs the check against six known-bad and known-good tuples, including the two real shapes this came from, so a checker that silently stops matching cannot pass as a clean repo. Verified in both directions against real code: restoring the pre-#1946 messageRetention exits 1 and names both patterns; current main exits 0. Wired into the existing lint workflow beside the other artifact guards, and the rule is written into admin/docs/artifact_info_block.md next to the normcase paragraph that already describes the mechanism. Co-Authored-By: Claude Opus 5 <[email protected]>
abrignoni
force-pushed
the
chore/check-artifact-paths
branch
from
August 13, 2026 20:56
95b71e7 to
5d44d7b
Compare
…aths # Conflicts: # .github/workflows/python_lint.yml
--list documented "print every paths tuple checked" and printed only a count line that duplicated the summary. It now prints each module, artifact key and its patterns. The count is derived from that same list, so the number reported and the tuples printed cannot disagree. Violations rendered an absolute path while the NOT CHECKED block used os.path.relpath, so CI output carried the runner's directory. Both are relative now. Verified no verdict changed: the checker was run against iLEAPP and all four sibling cores before and after, and the only difference in the output is the DLEAPP violation path becoming relative. The self-test still passes, and restoring the pre-#1946 messageRetention.py still exits 1. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a CI guard that fails when one artifact's
pathstuple holds two patterns differing only in case.os.path.normcasefolds case on Windows, so those are one pattern there: the artifact reads one file twice and never opens the other. That shipped inmessageRetentionuntil #1946.admin/scripts/check_artifact_paths.py, discovery recursive overscripts/soalternate_artifactsandtest_artifactsare covered too--self-testproves the check still fires,--listprints every tuple checkedadmin/docs/artifact_info_block.mdThe fix it asks for is always a single bracket class, never a second pattern. Current main is clean: 884 tuples across 389 modules, none unchecked. iLEAPP only for now, since DLEAPP's
setupapiSectionsdeclares both spellings of the setupapi path and has to be fixed before the guard can go there.