diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md index 39e9a542a..2f5017c61 100644 --- a/docs/release-control/v6/internal/subsystems/security-privacy.md +++ b/docs/release-control/v6/internal/subsystems/security-privacy.md @@ -978,6 +978,10 @@ new categorical value against its fixed set before storage. The adoption report may aggregate those latest-per-install signals and use indexed time filters plus compressed remote transport, but it must not enrich them with accounts, request IPs, customer records, or event-level browser data. +The compressed remote-report transport must compile the exact generated Python +program in its unit proof. Its JSON-lines delimiter is escaped at the outer +generator boundary so the program sent over SSH contains a valid `b"\n"` +literal rather than an unterminated bytes literal. That same telemetry trust boundary must remain operator-inspectable in-product: the shared system settings surface may preview only the exact runtime payload Pulse would send, and it must allow an operator to rotate the local telemetry diff --git a/scripts/telemetry_adoption_report.py b/scripts/telemetry_adoption_report.py index 118dc3990..89d089a42 100644 --- a/scripts/telemetry_adoption_report.py +++ b/scripts/telemetry_adoption_report.py @@ -1203,7 +1203,7 @@ rows_sql = ( output = gzip.GzipFile(fileobj=sys.stdout.buffer, mode="wb", compresslevel=6) def emit(value): - output.write(json.dumps(value, separators=(",", ":")).encode("utf-8") + b"\n") + output.write(json.dumps(value, separators=(",", ":")).encode("utf-8") + b"\\n") try: db_stats = dict(conn.execute(db_stats_sql).fetchone()) diff --git a/scripts/tests/test_telemetry_adoption_report.py b/scripts/tests/test_telemetry_adoption_report.py index 02a208215..a7b039eaf 100644 --- a/scripts/tests/test_telemetry_adoption_report.py +++ b/scripts/tests/test_telemetry_adoption_report.py @@ -49,6 +49,7 @@ class TelemetryAdoptionReportTest(unittest.TestCase): remote_script = run_mock.call_args.kwargs["input"].decode("utf-8") self.assertNotIn("fetchall", remote_script) self.assertIn("received_at >= datetime('now', ?)", remote_script) + compile(remote_script, "", "exec") def test_fetch_rows_remote_rejects_empty_response(self) -> None: completed = subprocess.CompletedProcess(