From 1446df507cef4048b0aa76cc7698902e30ecefbc Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:33:47 +0200 Subject: [PATCH 01/16] security(ci): suppress automatic Docker build records in base-image.yml --- .github/workflows/base-image.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/base-image.yml b/.github/workflows/base-image.yml index 6928ee81..2e209c02 100644 --- a/.github/workflows/base-image.yml +++ b/.github/workflows/base-image.yml @@ -17,6 +17,11 @@ permissions: packages: write id-token: write +# Public-source security hold: BuildKit history may contain unreviewed build diagnostics. +# Retain normal job logs/explicit artifacts; suppress automatic .dockerbuild upload. +env: + DOCKER_BUILD_RECORD_UPLOAD: 'false' + defaults: run: shell: bash -euo pipefail {0} From 6d3ffa1af381a6bbe4670965227965fd4030a33a Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:33:51 +0200 Subject: [PATCH 02/16] security(ci): suppress automatic Docker build records in nightly-soak.yml --- .github/workflows/nightly-soak.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nightly-soak.yml b/.github/workflows/nightly-soak.yml index e5924da7..2c1bc465 100644 --- a/.github/workflows/nightly-soak.yml +++ b/.github/workflows/nightly-soak.yml @@ -8,6 +8,11 @@ on: permissions: contents: read +# Public-source security hold: BuildKit history may contain unreviewed build diagnostics. +# Retain normal job logs/explicit artifacts; suppress automatic .dockerbuild upload. +env: + DOCKER_BUILD_RECORD_UPLOAD: 'false' + defaults: run: shell: bash -euo pipefail {0} From 8542d5899a47d2eb177b3b909e6d5d3a0a31ec7c Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:33:54 +0200 Subject: [PATCH 03/16] security(ci): suppress automatic Docker build records in release.yml --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f71529d..68d2df0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,11 @@ on: permissions: contents: read +# Public-source security hold: BuildKit history may contain unreviewed build diagnostics. +# Retain normal job logs/explicit artifacts; suppress automatic .dockerbuild upload. +env: + DOCKER_BUILD_RECORD_UPLOAD: 'false' + defaults: run: shell: bash -euo pipefail {0} From dba93041abf61a6bc2e8d61ff5e72242a160ffe7 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:33:57 +0200 Subject: [PATCH 04/16] security(ci): suppress automatic Docker build records in reusable-build-smoke-gate.yml --- .github/workflows/reusable-build-smoke-gate.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/reusable-build-smoke-gate.yml b/.github/workflows/reusable-build-smoke-gate.yml index 82c6604c..d2f802b6 100755 --- a/.github/workflows/reusable-build-smoke-gate.yml +++ b/.github/workflows/reusable-build-smoke-gate.yml @@ -60,6 +60,11 @@ on: permissions: contents: read +# Public-source security hold: BuildKit history may contain unreviewed build diagnostics. +# Retain normal job logs/explicit artifacts; suppress automatic .dockerbuild upload. +env: + DOCKER_BUILD_RECORD_UPLOAD: 'false' + defaults: run: shell: bash -euo pipefail {0} From 879a3c08b9044f6a559799672cbc8a217ae6eef5 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:34:41 +0200 Subject: [PATCH 05/16] test(ci): fail closed on future Docker build-record uploads --- tests/test_ci_dockerbuild_artifact_policy.py | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/test_ci_dockerbuild_artifact_policy.py diff --git a/tests/test_ci_dockerbuild_artifact_policy.py b/tests/test_ci_dockerbuild_artifact_policy.py new file mode 100644 index 00000000..803907e4 --- /dev/null +++ b/tests/test_ci_dockerbuild_artifact_policy.py @@ -0,0 +1,51 @@ +"""Fail closed on automatic Docker BuildKit record publication from public CI.""" + +from __future__ import annotations + +import re +from pathlib import Path + + +WORKFLOW_DIR = Path(__file__).resolve().parents[1] / ".github" / "workflows" +BUILD_ACTION = "uses: docker/build-push-action@" +WORKFLOW_GUARD = "\nenv:\n DOCKER_BUILD_RECORD_UPLOAD: 'false'\n" +DECLARATION = re.compile(r"(?m)^\s*DOCKER_BUILD_RECORD_UPLOAD:\s*(.*?)\s*$") + + +def _has_fail_closed_record_policy(source: str) -> bool: + header, boundary, _ = source.partition("\njobs:\n") + if not boundary: + return False + return WORKFLOW_GUARD in header and DECLARATION.findall(source) == ["'false'"] + + +def test_public_build_workflows_disable_automatic_build_record_upload() -> None: + workflows = sorted(WORKFLOW_DIR.glob("*.yml")) + build_workflows = [p for p in workflows if BUILD_ACTION in p.read_text(encoding="utf-8")] + assert build_workflows, "No Docker build workflows found; re-evaluate policy scope" + missing = [ + p.name + for p in build_workflows + if not _has_fail_closed_record_policy(p.read_text(encoding="utf-8")) + ] + assert not missing, f"Automatic unreviewed .dockerbuild publication enabled: {missing}" + + +def test_record_policy_fails_closed_on_missing_or_overridden_guard() -> None: + protected = ( + "name: Build\n" + "env:\n" + " DOCKER_BUILD_RECORD_UPLOAD: 'false'\n" + "jobs:\n" + " build:\n" + " steps:\n" + " - uses: docker/build-push-action@v6\n" + ) + assert _has_fail_closed_record_policy(protected) + assert not _has_fail_closed_record_policy(protected.replace("env:\n", "not-env:\n")) + assert not _has_fail_closed_record_policy( + protected.replace("'false'\n", "'true'\n") + ) + assert not _has_fail_closed_record_policy( + protected + " - env:\n DOCKER_BUILD_RECORD_UPLOAD: 'true'\n" + ) From 37b321a80cc32f816178a0f9cc4165329e809918 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:39:04 +0200 Subject: [PATCH 06/16] style(ci): normalize import-block spacing in artifact guard test --- tests/test_ci_dockerbuild_artifact_policy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_ci_dockerbuild_artifact_policy.py b/tests/test_ci_dockerbuild_artifact_policy.py index 803907e4..623ea98a 100644 --- a/tests/test_ci_dockerbuild_artifact_policy.py +++ b/tests/test_ci_dockerbuild_artifact_policy.py @@ -5,7 +5,6 @@ import re from pathlib import Path - WORKFLOW_DIR = Path(__file__).resolve().parents[1] / ".github" / "workflows" BUILD_ACTION = "uses: docker/build-push-action@" WORKFLOW_GUARD = "\nenv:\n DOCKER_BUILD_RECORD_UPLOAD: 'false'\n" From 4ac9b17dad98ff9e684e35d8615638e49553e0b3 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:39:53 +0200 Subject: [PATCH 07/16] test(ci): support early no-dependency artifact policy gate --- tests/test_ci_dockerbuild_artifact_policy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_ci_dockerbuild_artifact_policy.py b/tests/test_ci_dockerbuild_artifact_policy.py index 623ea98a..59e4a1c5 100644 --- a/tests/test_ci_dockerbuild_artifact_policy.py +++ b/tests/test_ci_dockerbuild_artifact_policy.py @@ -48,3 +48,7 @@ def test_record_policy_fails_closed_on_missing_or_overridden_guard() -> None: assert not _has_fail_closed_record_policy( protected + " - env:\n DOCKER_BUILD_RECORD_UPLOAD: 'true'\n" ) + +if __name__ == "__main__": + test_public_build_workflows_disable_automatic_build_record_upload() + test_record_policy_fails_closed_on_missing_or_overridden_guard() From 0b10059f5f3d2ac8e0101cfe8246346fee7c5d9b Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:40:04 +0200 Subject: [PATCH 08/16] security(ci): enforce artifact publication policy in preflight lint --- scripts/ci/lint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/lint.sh b/scripts/ci/lint.sh index 4ede1cbf..51f8560f 100755 --- a/scripts/ci/lint.sh +++ b/scripts/ci/lint.sh @@ -18,6 +18,8 @@ else echo "Warning: shellcheck not found, skipping shell script linting." fi +# Independent, dependency-free check before any Dockerfile-dependent unit-image build. +python3 tests/test_ci_dockerbuild_artifact_policy.py python3 scripts/ci/verify-capability-matrix.py python3 scripts/ci/generate-python-sbom.py --output artifacts/ci/python-sbom.cdx.json python3 scripts/ci/validate-sbom.py --input artifacts/ci/python-sbom.cdx.json From d690e77a039a1f7dbf0bc3aaa220fdd4b40005b9 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:42:31 +0200 Subject: [PATCH 09/16] fix(test): permit guarded workflow header ending at jobs boundary --- tests/test_ci_dockerbuild_artifact_policy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ci_dockerbuild_artifact_policy.py b/tests/test_ci_dockerbuild_artifact_policy.py index 59e4a1c5..9a683120 100644 --- a/tests/test_ci_dockerbuild_artifact_policy.py +++ b/tests/test_ci_dockerbuild_artifact_policy.py @@ -15,7 +15,7 @@ def _has_fail_closed_record_policy(source: str) -> bool: header, boundary, _ = source.partition("\njobs:\n") if not boundary: return False - return WORKFLOW_GUARD in header and DECLARATION.findall(source) == ["'false'"] + return WORKFLOW_GUARD in (header + "\n") and DECLARATION.findall(source) == ["'false'"] def test_public_build_workflows_disable_automatic_build_record_upload() -> None: From cae00f90741c768a6cc59395f81e735c9960e2b7 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 08:45:13 +0200 Subject: [PATCH 10/16] qualification: combine exact asset repair with guarded CI artifacts --- docker/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f23f878b..a7b84085 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,11 +33,11 @@ RUN bash /download_tool.sh "Python" \ && find /opt/winebot/windows-tools -name "*.txt" -delete FROM tool-base AS builder-winspy -# WinInspect v0.4.0 - UIA-enabled window inspection tool -# Replaces original strobejb/winspy v1.8.4 (no UIA support, 2022 vintage) +# WinInspect v0.4.4 - immutable portable release fixture (release asset SHA-256). +# Preserve checksum verification fail-closed; package promotion is independent. RUN bash /download_tool.sh "WinInspect" \ - "https://github.com/SemperSupra/WinInspect/releases/download/v0.4.0/WinInspectPortable-v0.4.0.zip" \ - "83b64999fef9ab01d749ab94193899e3915774d217900ac80c3c34021ff3e416" \ + "https://github.com/SemperSupra/WinInspect/releases/download/v0.4.4/WinInspectPortable-v0.4.4.zip" \ + "6ac0a65f774ffe69672f1c459254931ebfddb1e52c9fbec14b5db1348ccaad04" \ "/opt/winebot/windows-tools/WinSpy" \ && find /opt/winebot/windows-tools -name "*.txt" -delete From 4101c6726f83ab60b1841b8a25966b52db340bea Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:37:54 +0200 Subject: [PATCH 11/16] qualification: carry exact security reporter scripts/ci/sanitize-conformance-results.py --- scripts/ci/sanitize-conformance-results.py | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 scripts/ci/sanitize-conformance-results.py diff --git a/scripts/ci/sanitize-conformance-results.py b/scripts/ci/sanitize-conformance-results.py new file mode 100644 index 00000000..11715c21 --- /dev/null +++ b/scripts/ci/sanitize-conformance-results.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""Project raw conformance results into a minimal public evidence artifact. + +The underlying report may contain runtime responses, host identity, credentials, +or user-facing window titles. Never copy its free-form fields to a public artifact. +""" + +from __future__ import annotations + +import argparse +import json +import re +from pathlib import Path + +MAX_RAW_BYTES = 1_048_576 +COUNT_FIELDS = ("total", "passed", "failed", "skipped", "xfailed", "xpassed", "errors") +SAFE_TEST_ID = re.compile( + r"(?:contracts/)?tests/conformance/test_[A-Za-z0-9_]+\.py" + r"(?:::\w+)*::test_[A-Za-z0-9_]+" +) + + +def project_public_result(raw: object) -> dict: + """Build output solely from validated, bounded, allowlisted fields.""" + if not isinstance(raw, dict) or not isinstance(raw.get("summary"), dict): + raise ValueError("missing or invalid conformance summary") + + summary = raw["summary"] + counts = {} + for key in COUNT_FIELDS: + value = summary.get(key) + if type(value) is not int or value < 0: + raise ValueError("invalid conformance count") + counts[key] = value + if sum(counts[k] for k in COUNT_FIELDS if k != "total") != counts["total"]: + raise ValueError("inconsistent conformance counts") + + failures = raw.get("failures") + if not isinstance(failures, list) or len(failures) != counts["failed"]: + raise ValueError("inconsistent failure inventory") + + tests = [] + for item in failures: + if not isinstance(item, dict): + raise ValueError("invalid failure entry") + name = item.get("test") + safe_name = ( + name + if isinstance(name, str) and len(name) <= 200 and SAFE_TEST_ID.fullmatch(name) + else "redacted" + ) + tests.append({"test_id": safe_name}) + + return { + "schema": "winebot.public-conformance.v1", + "summary": counts, + "failed_tests": tests, + "note": "Raw failure payloads and environment details remain job-local.", + } + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--input", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + + if not args.input.is_file() or args.input.stat().st_size > MAX_RAW_BYTES: + raise SystemExit("Conformance source unavailable or exceeds the public projection limit") + try: + original = json.loads(args.input.read_text(encoding="utf-8")) + public = project_public_result(original) + except (ValueError, UnicodeError, OSError): + raise SystemExit("Conformance report cannot be safely projected") from None + + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(public, indent=2, sort_keys=True) + "\n", encoding="utf-8") + print("Public conformance report projected without raw failure/environment fields") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) From 5822a7cc0bb834ee3b4d37272e97964a361c6df5 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:37:58 +0200 Subject: [PATCH 12/16] qualification: carry exact security reporter tests/test_ci_public_conformance_summary.py --- tests/test_ci_public_conformance_summary.py | 91 +++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tests/test_ci_public_conformance_summary.py diff --git a/tests/test_ci_public_conformance_summary.py b/tests/test_ci_public_conformance_summary.py new file mode 100644 index 00000000..2d2bfd48 --- /dev/null +++ b/tests/test_ci_public_conformance_summary.py @@ -0,0 +1,91 @@ +"""Regression checks for minimizing public conformance evidence.""" + +from __future__ import annotations + +import json +import runpy +import subprocess +import sys +from pathlib import Path + +import pytest + +PROJECT = runpy.run_path("scripts/ci/sanitize-conformance-results.py")["project_public_result"] +SCRIPT = Path("scripts/ci/sanitize-conformance-results.py") + + +def sample_report() -> dict: + return { + "summary": { + "total": 3, + "passed": 1, + "failed": 1, + "skipped": 1, + "xfailed": 0, + "xpassed": 0, + "errors": 0, + }, + "environment": { + "hostname": "sensitive-host-alias", + "api_token": "SENSITIVE-TOKEN-VALUE", + }, + "failures": [ + { + "test": "contracts/tests/conformance/test_health.py::TestHealth::test_health", + "message": "secret SENSITIVE-TOKEN-VALUE; actual host sensitive-host-alias", + } + ], + "other_untrusted": "SENSITIVE-TOKEN-VALUE", + } + + +def test_projection_preserves_counts_and_only_static_test_identifiers() -> None: + report = PROJECT(sample_report()) + assert report["summary"]["total"] == 3 + assert report["summary"]["failed"] == 1 + assert report["failed_tests"] == [ + {"test_id": "contracts/tests/conformance/test_health.py::TestHealth::test_health"} + ] + rendered = json.dumps(report) + assert "sensitive-host-alias" not in rendered + assert "SENSITIVE-TOKEN-VALUE" not in rendered + assert "message" not in rendered + assert "environment" not in rendered + + +def test_untrusted_test_id_is_redacted_instead_of_republished() -> None: + raw = sample_report() + raw["failures"][0]["test"] = "tests/conformance/test_health.py::test_a[param=private-token]" + assert PROJECT(raw)["failed_tests"] == [{"test_id": "redacted"}] + + +@pytest.mark.parametrize( + "change", + [ + lambda raw: raw["summary"].update({"failed": True}), + lambda raw: raw["summary"].update({"total": 7}), + lambda raw: raw.update({"failures": []}), + lambda raw: raw.update({"summary": "bad"}), + ], +) +def test_invalid_reports_fail_closed(change) -> None: + raw = sample_report() + change(raw) + with pytest.raises(ValueError): + PROJECT(raw) + + +def test_command_does_not_write_artifact_if_input_invalid(tmp_path: Path) -> None: + raw = sample_report() + raw["summary"]["total"] = 9 + input_path = tmp_path / "raw.json" + out = tmp_path / "public.json" + input_path.write_text(json.dumps(raw), encoding="utf-8") + process = subprocess.run( + [sys.executable, str(SCRIPT), "--input", str(input_path), "--output", str(out)], + capture_output=True, + text=True, + check=False, + ) + assert process.returncode != 0 + assert not out.exists() From 1f79ace0e612a41ac330f6ab37107f574baccf16 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:38:13 +0200 Subject: [PATCH 13/16] qualification: use exact sanitized conformance upload workflow --- .github/workflows/ci.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0383b5c7..3c1bf2c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,8 +97,12 @@ jobs: if [ -z "$TOKEN" ]; then TOKEN=$(docker compose -f compose/docker-compose.yml exec -T winebot cat /winebot-shared/winebot_api_token 2>/dev/null || true) fi + if [ -z "$TOKEN" ]; then + echo "Conformance token unavailable" >&2 + exit 1 + fi + echo "::add-mask::$TOKEN" echo "token=$TOKEN" >> "$GITHUB_OUTPUT" - echo "API token read: ${TOKEN:0:8}..." >> "$GITHUB_STEP_SUMMARY" - name: Run conformance tests env: @@ -111,12 +115,21 @@ jobs: --results-file conformance-results.json \ -v --tb=short - - name: Upload conformance results + - name: Project safe public conformance evidence + id: public-conformance-summary if: always() + run: | + python3 winebot/scripts/ci/sanitize-conformance-results.py \ + --input conformance-results.json \ + --output conformance-summary-public.json + + - name: Upload conformance results + if: ${{ always() && steps.public-conformance-summary.outcome == 'success' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: name: conformance-results - path: conformance-results.json + path: conformance-summary-public.json + if-no-files-found: error - name: Stop services if: always() From cfa2fc821b8b2f3431e551a1a6c454a1ce687c83 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:38:30 +0200 Subject: [PATCH 14/16] qualification: compose BuildKit upload control with sanitized release results --- .github/workflows/release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68d2df0f..a0ccc446 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,6 +145,11 @@ jobs: if [ -z "$TOKEN" ]; then TOKEN=$(docker compose -f compose/docker-compose.yml exec -T winebot cat /winebot-shared/winebot_api_token 2>/dev/null || true) fi + if [ -z "$TOKEN" ]; then + echo "Conformance token unavailable" >&2 + exit 1 + fi + echo "::add-mask::$TOKEN" echo "token=$TOKEN" >> "$GITHUB_OUTPUT" - name: Run conformance tests @@ -158,12 +163,21 @@ jobs: --results-file conformance-results.json \ -v --tb=short - - name: Upload conformance results + - name: Project safe public conformance evidence + id: public-conformance-summary if: always() + run: | + python3 winebot/scripts/ci/sanitize-conformance-results.py \ + --input conformance-results.json \ + --output conformance-summary-public.json + + - name: Upload conformance results + if: ${{ always() && steps.public-conformance-summary.outcome == 'success' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: name: conformance-results-release - path: conformance-results.json + path: conformance-summary-public.json + if-no-files-found: error - name: Fail on conformance failure if: failure() From 9be121a3e409fb95b676fbe8d0b91543e4553558 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:56:47 +0200 Subject: [PATCH 15/16] qualification: update public summary fixture and quiet output in one batch --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- scripts/ci/sanitize-conformance-results.py | 2 +- tests/test_ci_public_conformance_summary.py | 22 +++++++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c1bf2c0..cb046e60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: --api-url "$API_URL" \ --api-token "$API_TOKEN" \ --results-file conformance-results.json \ - -v --tb=short + -v --tb=no --show-capture=no - name: Project safe public conformance evidence id: public-conformance-summary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0ccc446..52ae3af9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -161,7 +161,7 @@ jobs: --api-url "$API_URL" \ --api-token "$API_TOKEN" \ --results-file conformance-results.json \ - -v --tb=short + -v --tb=no --show-capture=no - name: Project safe public conformance evidence id: public-conformance-summary diff --git a/scripts/ci/sanitize-conformance-results.py b/scripts/ci/sanitize-conformance-results.py index 11715c21..9fffd2e3 100644 --- a/scripts/ci/sanitize-conformance-results.py +++ b/scripts/ci/sanitize-conformance-results.py @@ -15,7 +15,7 @@ MAX_RAW_BYTES = 1_048_576 COUNT_FIELDS = ("total", "passed", "failed", "skipped", "xfailed", "xpassed", "errors") SAFE_TEST_ID = re.compile( - r"(?:contracts/)?tests/conformance/test_[A-Za-z0-9_]+\.py" + r"(?:(?:contracts/)?tests/conformance/)?test_[A-Za-z0-9_]+\.py" r"(?:::\w+)*::test_[A-Za-z0-9_]+" ) diff --git a/tests/test_ci_public_conformance_summary.py b/tests/test_ci_public_conformance_summary.py index 2d2bfd48..a0f923e5 100644 --- a/tests/test_ci_public_conformance_summary.py +++ b/tests/test_ci_public_conformance_summary.py @@ -53,6 +53,16 @@ def test_projection_preserves_counts_and_only_static_test_identifiers() -> None: assert "environment" not in rendered +def test_bare_pytest_basename_is_preserved_without_runtime_text() -> None: + raw = sample_report() + raw["failures"][0]["test"] = "test_automation.py::TestWindows::test_windows_has_count" + report = PROJECT(raw) + assert report["failed_tests"] == [ + {"test_id": "test_automation.py::TestWindows::test_windows_has_count"} + ] + assert "SENSITIVE-TOKEN-VALUE" not in json.dumps(report) + + def test_untrusted_test_id_is_redacted_instead_of_republished() -> None: raw = sample_report() raw["failures"][0]["test"] = "tests/conformance/test_health.py::test_a[param=private-token]" @@ -89,3 +99,15 @@ def test_command_does_not_write_artifact_if_input_invalid(tmp_path: Path) -> Non ) assert process.returncode != 0 assert not out.exists() + +@pytest.mark.parametrize( + "workflow_path", + [".github/workflows/ci.yml", ".github/workflows/release.yml"], +) +def test_public_workflows_do_not_publish_raw_conformance_data(workflow_path: str) -> None: + source = Path(workflow_path).read_text(encoding="utf-8") + assert "--tb=no --show-capture=no" in source + assert "path: conformance-summary-public.json" in source + assert "path: conformance-results.json" not in source + assert "steps.public-conformance-summary.outcome == 'success'" in source + assert "TOKEN:0:8" not in source From 54f9fcc5fc02216acb119e43e431912425bc1b70 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:09:53 +0200 Subject: [PATCH 16/16] qualification: suppress pytest short summary leaks with -rN --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- tests/test_ci_public_conformance_summary.py | 31 ++++++++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb046e60..7bbb8153 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: --api-url "$API_URL" \ --api-token "$API_TOKEN" \ --results-file conformance-results.json \ - -v --tb=no --show-capture=no + -v --tb=no --show-capture=no -rN - name: Project safe public conformance evidence id: public-conformance-summary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52ae3af9..739c4f8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -161,7 +161,7 @@ jobs: --api-url "$API_URL" \ --api-token "$API_TOKEN" \ --results-file conformance-results.json \ - -v --tb=no --show-capture=no + -v --tb=no --show-capture=no -rN - name: Project safe public conformance evidence id: public-conformance-summary diff --git a/tests/test_ci_public_conformance_summary.py b/tests/test_ci_public_conformance_summary.py index a0f923e5..8ea2882d 100644 --- a/tests/test_ci_public_conformance_summary.py +++ b/tests/test_ci_public_conformance_summary.py @@ -106,8 +106,37 @@ def test_command_does_not_write_artifact_if_input_invalid(tmp_path: Path) -> Non ) def test_public_workflows_do_not_publish_raw_conformance_data(workflow_path: str) -> None: source = Path(workflow_path).read_text(encoding="utf-8") - assert "--tb=no --show-capture=no" in source + assert "--tb=no --show-capture=no -rN" in source assert "path: conformance-summary-public.json" in source assert "path: conformance-results.json" not in source assert "steps.public-conformance-summary.outcome == 'success'" in source assert "TOKEN:0:8" not in source + +def test_quiet_pytest_console_does_not_echo_assertion_response(tmp_path: Path) -> None: + fixture = tmp_path / "test_probe_private_payload.py" + fixture.write_text( + 'def test_probe():\n' + ' payload = {"value": "SYNTHETIC-UNPUBLISHED-MARKER"}\n' + ' assert "count" in payload\n', + encoding="utf-8", + ) + process = subprocess.run( + [ + sys.executable, + "-m", + "pytest", + str(fixture), + "-v", + "--tb=no", + "--show-capture=no", + "-rN", + ], + capture_output=True, + text=True, + check=False, + timeout=30, + ) + assert process.returncode == 1 + assert "1 failed" in process.stdout + assert "SYNTHETIC-UNPUBLISHED-MARKER" not in process.stdout + assert "SYNTHETIC-UNPUBLISHED-MARKER" not in process.stderr