Skip to content

Commit 97dfca8

Browse files
committed
fix: keep the renderer's own log out of the portability audit
Second false-positive class, found on loglens in the wave2 re-baseline: the only file the audit flagged was codeplain.log, which records broker activity and module names and so contains codeplain-tty by construction. The directory exemption added in 3127595 does not cover it — it is a file, not a tree. Against the real artifacts the audit now reports nothing for either loglens or cli-password-manager, where it previously flagged one and four files.
1 parent b025eee commit 97dfca8

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

render_machine/platform_test_audit.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131

3232
MAX_AUDITED_FILE_BYTES = 4 * 1024 * 1024 # a delivered source file larger than this is not source
3333

34+
# Suffixes that are never delivered source. Logs matter most: the renderer's own
35+
# codeplain.log records broker activity and module names, so auditing it reports the
36+
# render's diagnostics as if the application had referenced the helper.
37+
SKIPPED_FILE_SUFFIXES = (".log",)
38+
3439

3540
class PlatformBoundaryViolation(Exception):
3641
"""A delivered build references Codeplain's private test tooling."""
@@ -44,6 +49,8 @@ def find_platform_references(build_folder: str) -> List[str]:
4449
name for name in directories if name not in SKIPPED_DIRECTORIES and name not in INTERNAL_TEST_DIRECTORIES
4550
]
4651
for file_name in file_names:
52+
if file_name.endswith(SKIPPED_FILE_SUFFIXES):
53+
continue
4754
path = os.path.join(root, file_name)
4855
relative = os.path.relpath(path, build_folder)
4956
if any(marker in file_name for marker in HELPER_REFERENCE_MARKERS):

tests/test_platform_test_audit.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,13 @@ def test_delivered_code_is_still_audited_alongside_them(tmp_path):
6868
(tmp_path / "vault.py").write_text("os.environ['CODEPLAIN_TTY_ENDPOINT']\n")
6969

7070
assert find_platform_references(str(tmp_path)) == ["vault.py"]
71+
72+
73+
def test_the_renderers_own_log_is_not_audited(tmp_path):
74+
"""codeplain.log records broker activity and module names, so auditing it reports the
75+
render's own diagnostics as if the application had referenced the helper. Seen on
76+
loglens, where the log was the single flagged file."""
77+
(tmp_path / "codeplain.log").write_text("DEBUG codeplain: the codeplain-tty broker thread started\n")
78+
(tmp_path / "cli.js").write_text("console.log('hi')\n")
79+
80+
assert find_platform_references(str(tmp_path)) == []

0 commit comments

Comments
 (0)