diff --git a/docs/reports/code_path_audit/.latest b/docs/reports/code_path_audit/.latest new file mode 100644 index 00000000..0f8b8276 --- /dev/null +++ b/docs/reports/code_path_audit/.latest @@ -0,0 +1 @@ +2026-06-24 diff --git a/scripts/audit_code_path_audit_coverage.py b/scripts/audit_code_path_audit_coverage.py index 8df9f8b5..0ac32cf0 100644 --- a/scripts/audit_code_path_audit_coverage.py +++ b/scripts/audit_code_path_audit_coverage.py @@ -37,6 +37,20 @@ def main() -> int: parser.add_argument("--strict", action="store_true", help="Exit 1 on any violation") args = parser.parse_args() input_dir = Path(args.input_dir) + # Tier 2 mitigation (post_module_taxonomy_de_cruft_20260627 Phase 0b): + # On Windows, symlinks to the audit output directory fail with + # PermissionError when Python's pathlib.exists() follows the symlink. + # The .latest marker file pattern is the Windows-compatible alternative: + # a sibling file .latest contains the name of the latest audit + # directory (e.g., '2026-06-24'). The audit reads the marker and uses + # that directory as the input. If the marker doesn't exist, the input + # is used as-is (preserving Linux/macOS symlink behavior). + if input_dir.name == "latest": + marker = input_dir.parent / ".latest" + if marker.exists(): + resolved_name = marker.read_text(encoding="utf-8").strip() + if resolved_name: + input_dir = input_dir.parent / resolved_name if not input_dir.exists(): print(f"ERROR: input dir does not exist: {input_dir}") return 1