From f9ecb7e006a4454411b54f52c2ab4d4b3f149a73 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 19:53:52 +0000 Subject: [PATCH 1/9] Add bounded endpoint identity fuzzing and mutation probes Exercise the public URL identity boundary with replay seeds, independent oracles and a narrow mutation target. Keep trusted maintenance reporting separate from read-only probes. Signed-off-by: zlareb1 --- .clusterfuzzlite/Dockerfile | 11 + .clusterfuzzlite/build.sh | 18 + .clusterfuzzlite/project.yaml | 1 + .clusterfuzzlite/requirements.txt | 2 + .github/workflows/identity-testing.yml | 217 +++++++++ tests/fuzz/README.md | 46 ++ tests/fuzz/__init__.py | 1 + .../corpus/embedding_identity/credentials | 1 + .../corpus/embedding_identity/duplicate-query | 1 + tests/fuzz/corpus/embedding_identity/empty | 0 tests/fuzz/corpus/embedding_identity/ipv6 | 1 + .../fuzz/corpus/embedding_identity/malformed | 1 + tests/fuzz/corpus/embedding_identity/unicode | 1 + tests/fuzz/embedding_identity_fuzzer.py | 31 ++ tests/fuzz/embedding_identity_oracle.py | 55 +++ tests/fuzz/test_probe_publisher.py | 160 +++++++ tests/mutation/pyproject.toml | 12 + tests/mutation/requirements.in | 2 + tests/mutation/requirements.txt | 436 ++++++++++++++++++ tests/mutation/run_identity.py | 107 +++++ tests/mutation/test_embedding_identity.py | 56 +++ 21 files changed, 1160 insertions(+) create mode 100644 .clusterfuzzlite/Dockerfile create mode 100755 .clusterfuzzlite/build.sh create mode 100644 .clusterfuzzlite/project.yaml create mode 100644 .clusterfuzzlite/requirements.txt create mode 100644 .github/workflows/identity-testing.yml create mode 100644 tests/fuzz/README.md create mode 100644 tests/fuzz/__init__.py create mode 100644 tests/fuzz/corpus/embedding_identity/credentials create mode 100644 tests/fuzz/corpus/embedding_identity/duplicate-query create mode 100644 tests/fuzz/corpus/embedding_identity/empty create mode 100644 tests/fuzz/corpus/embedding_identity/ipv6 create mode 100644 tests/fuzz/corpus/embedding_identity/malformed create mode 100644 tests/fuzz/corpus/embedding_identity/unicode create mode 100644 tests/fuzz/embedding_identity_fuzzer.py create mode 100644 tests/fuzz/embedding_identity_oracle.py create mode 100644 tests/fuzz/test_probe_publisher.py create mode 100644 tests/mutation/pyproject.toml create mode 100644 tests/mutation/requirements.in create mode 100644 tests/mutation/requirements.txt create mode 100644 tests/mutation/run_identity.py create mode 100644 tests/mutation/test_embedding_identity.py diff --git a/.clusterfuzzlite/Dockerfile b/.clusterfuzzlite/Dockerfile new file mode 100644 index 00000000000..b6ada5ea924 --- /dev/null +++ b/.clusterfuzzlite/Dockerfile @@ -0,0 +1,11 @@ +FROM gcr.io/oss-fuzz-base/base-builder-python@sha256:21f6fab17ace4dc76e1c56de91ee95d3d03da021df94b41056ba036f6c6f55e9 + +COPY .clusterfuzzlite/requirements.txt /src/loom-fuzz-requirements.txt +RUN python3 -m pip install --no-cache-dir --only-binary=:all: --require-hashes --no-deps -r /src/loom-fuzz-requirements.txt + +COPY server/__init__.py /src/loom/server/__init__.py +COPY server/core/__init__.py server/core/embedding_space.py /src/loom/server/core/ +COPY tests/__init__.py /src/loom/tests/__init__.py +COPY tests/fuzz/ /src/loom/tests/fuzz/ +COPY .clusterfuzzlite/build.sh /src/build.sh +WORKDIR /src/loom diff --git a/.clusterfuzzlite/build.sh b/.clusterfuzzlite/build.sh new file mode 100755 index 00000000000..78d87563920 --- /dev/null +++ b/.clusterfuzzlite/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail + +# Only this unmodified standard-library module and the maintained oracle are packaged. +python3 -m tests.fuzz.embedding_identity_fuzzer --replay tests/fuzz/corpus/embedding_identity +pyinstaller --distpath "$OUT" --onefile --paths /src/loom \ + --hidden-import server.core.embedding_space \ + --hidden-import tests.fuzz.embedding_identity_oracle \ + --name embedding_identity.pkg tests/fuzz/embedding_identity_fuzzer.py +cat >"$OUT/embedding_identity" <<'WRAPPER' +#!/bin/sh +# LLVMFuzzerTestOneInput +this_dir=$(dirname "$0") +exec "$this_dir/embedding_identity.pkg" "$@" +WRAPPER +chmod +x "$OUT/embedding_identity" +zip -j "$OUT/embedding_identity_seed_corpus.zip" tests/fuzz/corpus/embedding_identity/* +printf '[libfuzzer]\nmax_len = 4096\ntimeout = 5\nrss_limit_mb = 512\n' >"$OUT/embedding_identity.options" diff --git a/.clusterfuzzlite/project.yaml b/.clusterfuzzlite/project.yaml new file mode 100644 index 00000000000..d1ad0ae50f5 --- /dev/null +++ b/.clusterfuzzlite/project.yaml @@ -0,0 +1 @@ +language: python diff --git a/.clusterfuzzlite/requirements.txt b/.clusterfuzzlite/requirements.txt new file mode 100644 index 00000000000..fe4958a1e3d --- /dev/null +++ b/.clusterfuzzlite/requirements.txt @@ -0,0 +1,2 @@ +atheris==3.0.0 \ + --hash=sha256:8a5c8a781467c187da40fd29139784193e2647058831f837f675d0bb8cbd8746 diff --git a/.github/workflows/identity-testing.yml b/.github/workflows/identity-testing.yml new file mode 100644 index 00000000000..26166a5c7af --- /dev/null +++ b/.github/workflows/identity-testing.yml @@ -0,0 +1,217 @@ +name: endpoint identity probes + +on: + pull_request: + branches: [main, "release/**"] + paths: + - server/core/embedding_space.py + - tests/fuzz/** + - tests/mutation/** + - .clusterfuzzlite/** + - .github/workflows/identity-testing.yml + push: + branches: [main] + paths: + - server/core/embedding_space.py + - tests/fuzz/** + - tests/mutation/** + - .clusterfuzzlite/** + - .github/workflows/identity-testing.yml + schedule: + - cron: "17 4 * * 3" + workflow_dispatch: + +permissions: + contents: read + +defaults: + run: + shell: bash + +concurrency: + group: endpoint-identity-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + replay_and_mutation: + name: Endpoint identity corpus and mutation pilot + runs-on: ubuntu-24.04 + timeout-minutes: 8 + outputs: + review_count: ${{ steps.mutation.outputs.review_count }} + steps: + - name: Check out the maintained target and its probes + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + sparse-checkout-cone-mode: false + sparse-checkout: | + /server/__init__.py + /server/core/__init__.py + /server/core/embedding_space.py + /tests/__init__.py + /tests/fuzz/ + /tests/mutation/ + - name: Install the selected Python + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: "3.12" + cache: false + - name: Create a disposable test environment + run: | + python3 -m venv "$RUNNER_TEMP/identity-venv" + "$RUNNER_TEMP/identity-venv/bin/python" -m pip install --require-hashes --only-binary=:all: -r tests/mutation/requirements.txt + - name: Replay the corpus and deterministic public-identity cases + run: | + "$RUNNER_TEMP/identity-venv/bin/python" -m tests.fuzz.embedding_identity_fuzzer --replay tests/fuzz/corpus/embedding_identity + "$RUNNER_TEMP/identity-venv/bin/python" -m unittest tests.mutation.test_embedding_identity tests.fuzz.test_probe_publisher + - name: Mutate only the public-identity function + id: mutation + env: + IDENTITY_MUTATION_REPORT: ${{ runner.temp }}/identity-mutation.json + run: '"$RUNNER_TEMP/identity-venv/bin/python" tests/mutation/run_identity.py' + + coverage_guided: + name: Endpoint identity coverage-guided fuzzing + runs-on: ubuntu-24.04 + timeout-minutes: 15 + permissions: + contents: read + actions: read # The fuzzing runner reads its own build and crash metadata. + steps: + - name: Check out only the parser and fuzz build inputs + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + sparse-checkout-cone-mode: false + sparse-checkout: | + /server/__init__.py + /server/core/__init__.py + /server/core/embedding_space.py + /tests/__init__.py + /tests/fuzz/ + /.clusterfuzzlite/ + - name: Build the one parser fuzzer + uses: docker://gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers@sha256:c531ed554dbd3ed24e2bd11570a0e2dfb042146806236cdfd2d7d0d648b6c473 + env: + LANGUAGE: python + SANITIZER: address + GITHUB_TOKEN: ${{ github.token }} + PROJECT_SRC_PATH: ${{ github.workspace }} + KEEP_UNAFFECTED_FUZZ_TARGETS: "true" + UPLOAD_BUILD: "false" + BAD_BUILD_CHECK: "true" + ALLOWED_BROKEN_TARGETS_PERCENTAGE: "0" + DRY_RUN: "false" + CFL_PLATFORM: github + LOW_DISK_SPACE: "True" + - name: Fuzz the parser within the selected time budget + uses: docker://gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers@sha256:ec2a38a69babe087df3025a6babcb2a5a3675811a5cf4bfba23cece85c10e8d1 + env: + LANGUAGE: python + SANITIZER: address + GITHUB_TOKEN: ${{ github.token }} + FUZZ_SECONDS: ${{ github.event_name == 'pull_request' && 30 || 180 }} + MODE: code-change + PARALLEL_FUZZING: "false" + OUTPUT_SARIF: "true" + REPORT_TIMEOUTS: "true" + REPORT_OOMS: "true" + REPORT_UNREPRODUCIBLE_CRASHES: "false" + MINIMIZE_CRASHES: "false" + DRY_RUN: "false" + CFL_PLATFORM: github + LOW_DISK_SPACE: "True" + + maintenance: + name: Record trusted probe maintenance + needs: [replay_and_mutation, coverage_guided] + if: >- + always() && github.repository == 'ClickHouse/loom' && + github.ref == 'refs/heads/main' && + (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') + runs-on: ubuntu-24.04 + timeout-minutes: 5 + permissions: + contents: read + issues: write # Record bounded probe maintenance on trusted main runs only. + steps: + - name: Reconcile failure tasks without executing project code + env: + GH_TOKEN: ${{ github.token }} + PROBE_RESULTS: ${{ toJSON(needs) }} + run: | + python3 - <<'PY' + import json, os, re, subprocess + from urllib.parse import urlencode + repo = "repos/ClickHouse/loom/issues" + bot = "github-actions[bot]" + marker = re.compile(r"") + state = re.compile(r"") + titles = {"replay_and_mutation": "[endpoint-identity-ci] Review the bounded mutation pilot", "coverage_guided": "[endpoint-identity-ci] Diagnose the bounded fuzzer check"} + calls = 0 + def api(method, endpoint, payload=None): + global calls + calls += 1 + assert calls <= 40, "Probe issue API budget exhausted" + command = ["gh", "api", "--method", method, endpoint, "--hostname", "github.com"] + if payload is not None: + command += ["--input", "-"] + result = subprocess.run(command, input=None if payload is None else json.dumps(payload), text=True, capture_output=True, timeout=20, check=True) + assert len(result.stdout) <= 2 * 1024 * 1024, "Probe issue response exceeds budget" + return json.loads(result.stdout) + managed = {} + for page in range(1, 11): + issues = api("GET", repo + "?" + urlencode({"state": "all", "creator": bot, "per_page": 100, "page": page})) + assert isinstance(issues, list) + for issue in issues: + if "pull_request" in issue or issue.get("user", {}).get("login") != bot: + continue + keys = marker.findall(issue.get("body") or "") + keys += [key for key, title in titles.items() if issue.get("title") == title] + keys = set(keys) + assert len(keys) <= 1, "Conflicting Probe issue markers" + if keys: + key = keys.pop() + assert key not in managed, "Duplicate Probe maintenance task" + managed[key] = issue + if len(issues) < 100: + break + else: + raise RuntimeError("Probe issue pagination budget exhausted") + results = json.loads(os.environ["PROBE_RESULTS"]) + assert set(results) == set(titles) + run_id = os.environ["GITHUB_RUN_ID"] + assert run_id.isdecimal() + url = "https://github.com/ClickHouse/loom/actions/runs/" + run_id + changed = 0 + for key in titles: + result = results[key]["result"] + if key == "replay_and_mutation" and result == "success": + count = results[key]["outputs"]["review_count"] + assert count.isdecimal() and 0 <= int(count) <= 10000 + if int(count): + result = "review" + assert result in {"success", "failure", "review", "cancelled", "skipped"} + issue = managed.get(key) + if result not in {"success", "failure", "review"} or (issue and issue["state"] == "closed"): + continue + text = f"\n\n\nThe bounded {key} probe reports **{result}** on trusted main. [Read the bounded probe logs and mutation summary]({url}).\n\nReproduce the named workflow job. A mutation survivor needs review for a missing assertion or equivalent mutation; it is not a vulnerability claim. No crash input or source excerpt is published here. Keep security-sensitive reports in the private route in SECURITY.md. Automation preserves edited bodies and closed decisions." + if issue is None: + if result in {"failure", "review"}: + api("POST", repo, {"title": titles[key], "body": text}) + changed += 1 + continue + number = issue["number"] + assert isinstance(number, int) and number > 0 + comments = api("GET", f"{repo}/{number}/comments?per_page=100") + assert isinstance(comments, list) and len(comments) < 100, "Probe comment history budget exhausted" + candidates = [issue] + sorted(comments, key=lambda row: (row["created_at"], row["id"])) + states = [state.findall(row.get("body") or "") for row in candidates if row.get("user", {}).get("login") == bot] + states = [value[-1] for value in states if value] + if not states or states[-1] != result: + api("POST", f"{repo}/{number}/comments", {"body": text}) + changed += 1 + with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as output: + output.write(f"Probe task reconciliation: {changed} task or status writes; closed decisions preserved.\n") + PY diff --git a/tests/fuzz/README.md b/tests/fuzz/README.md new file mode 100644 index 00000000000..d37bb2cd2c8 --- /dev/null +++ b/tests/fuzz/README.md @@ -0,0 +1,46 @@ +# Endpoint identity probes + +The target is `server/core/embedding_space.py` (`public_identity`). It converts an +external endpoint configuration into the public identity used by deployment checks +and calibration. The probes check URL userinfo, allowed query names, fragments, +case normalization, preserved endpoint differences and unchanged non-URL identity +fields. This is a URL-identity boundary, not a general secret scrubber, network +allowlist or proof of API authorization. + +Replay the checked-in synthetic corpus without installing a fuzzing engine: + +```bash +python3 -m tests.fuzz.embedding_identity_fuzzer --replay tests/fuzz/corpus/embedding_identity +python3 -m unittest tests.mutation.test_embedding_identity +python3 tests/fuzz/test_probe_publisher.py +``` + +Inputs are at most 4096 bytes. Malformed raw URLs may raise the parser's documented +validation error; unexpected exceptions and accepted identities that break the +public contract fail. Every input also exercises a structured accepted URL with +synthetic credentials. This keeps malformed input from starving the useful branch. +Never add real credentials, deployment data or a third-party target to this corpus. + +The hosted workflow replays the corpus and runs the fixed cases. Its coverage-guided +job uses the Python engine through the continuous-fuzzing runner, one target, one +worker and explicit time, input, memory and per-input limits. The image, engine and +executor references are pinned; engine selection matches the image's Python ABI. +Crashes fail the job and retain the runner's replay evidence. Review any real +security finding through the private route in [SECURITY.md](../../SECURITY.md), +without pasting inputs into public issues. The build packages only the named +standard-library module and these probes; no Loom service or provider is started. + +The mutation pilot stages an unchanged copy of the same module and tests. It selects +only `public_identity` mutants, uses two workers with a two-minute process budget, +and kills its own process group on completion or failure. Empty test or mutation +results fail. Reported survivors need inspection: add an independent assertion for a +meaningful behavior difference, or record why the mutant is equivalent. The report +is not a whole-module score, a security result or permission to suppress a case. + +A trusted-main publisher automatically creates a maintenance task for a broken +probe or a mutation result needing review. It posts static status and a log link, +without raw source or crash input, and appends a comment only when status changes. +It preserves edited bodies and closed decisions; keep an identity marker in the +title or body. API, history and pagination limits fail explicitly. Pull requests +retain read-only tokens. Standard public runners are used without a provider, +account, storage repository, new token or paid service. diff --git a/tests/fuzz/__init__.py b/tests/fuzz/__init__.py new file mode 100644 index 00000000000..b746708fe2c --- /dev/null +++ b/tests/fuzz/__init__.py @@ -0,0 +1 @@ +"""Bounded parser probes shared by replay and coverage-guided runs.""" diff --git a/tests/fuzz/corpus/embedding_identity/credentials b/tests/fuzz/corpus/embedding_identity/credentials new file mode 100644 index 00000000000..08a4e6e9f03 --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/credentials @@ -0,0 +1 @@ +https://person:synthetic@example.invalid/v1?api-version=v1&token=synthetic#fragment \ No newline at end of file diff --git a/tests/fuzz/corpus/embedding_identity/duplicate-query b/tests/fuzz/corpus/embedding_identity/duplicate-query new file mode 100644 index 00000000000..e3eac11da52 --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/duplicate-query @@ -0,0 +1 @@ +HTTPS://EXAMPLE.INVALID/v1/?MODEL=a&model=b&api_version=v \ No newline at end of file diff --git a/tests/fuzz/corpus/embedding_identity/empty b/tests/fuzz/corpus/embedding_identity/empty new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/fuzz/corpus/embedding_identity/ipv6 b/tests/fuzz/corpus/embedding_identity/ipv6 new file mode 100644 index 00000000000..68c2209db77 --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/ipv6 @@ -0,0 +1 @@ +https://user:synthetic@[2001:db8::1]:443/v1/ \ No newline at end of file diff --git a/tests/fuzz/corpus/embedding_identity/malformed b/tests/fuzz/corpus/embedding_identity/malformed new file mode 100644 index 00000000000..32fbafe5086 --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/malformed @@ -0,0 +1 @@ +https://[invalid/ \ No newline at end of file diff --git a/tests/fuzz/corpus/embedding_identity/unicode b/tests/fuzz/corpus/embedding_identity/unicode new file mode 100644 index 00000000000..cd96f6f2b29 --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/unicode @@ -0,0 +1 @@ +https://example.invalid/é?token=ÿ \ No newline at end of file diff --git a/tests/fuzz/embedding_identity_fuzzer.py b/tests/fuzz/embedding_identity_fuzzer.py new file mode 100644 index 00000000000..26cc7f8396c --- /dev/null +++ b/tests/fuzz/embedding_identity_fuzzer.py @@ -0,0 +1,31 @@ +"""One maintained endpoint-identity target with deterministic corpus replay.""" + +from __future__ import annotations + +import sys +from pathlib import Path + + +def main() -> None: + if len(sys.argv) == 3 and sys.argv[1] == "--replay": + from tests.fuzz.embedding_identity_oracle import check_input + + paths = sorted(Path(sys.argv[2]).iterdir()) + if not paths or not all(path.is_file() for path in paths): + raise ValueError("Replay requires a nonempty directory of seed files") + for path in paths: + check_input(path.read_bytes()) + print(f"Replayed {len(paths)} endpoint-identity seeds") + return + + import atheris + + with atheris.instrument_imports(): + from tests.fuzz.embedding_identity_oracle import check_input + + atheris.Setup(sys.argv, check_input) + atheris.Fuzz() + + +if __name__ == "__main__": + main() diff --git a/tests/fuzz/embedding_identity_oracle.py b/tests/fuzz/embedding_identity_oracle.py new file mode 100644 index 00000000000..09bf8402f8f --- /dev/null +++ b/tests/fuzz/embedding_identity_oracle.py @@ -0,0 +1,55 @@ +"""Check public endpoint identities without a provider, server or database.""" + +from __future__ import annotations + +from urllib.parse import parse_qsl, urlsplit + +from server.core import embedding_space + + +def configuration(url: str) -> dict[str, object]: + return { + "embedding_provider": "custom", + "embedding_model": "synthetic-model", + "embedding_dim": 16, + "embedding_base_url": url, + "embedding_send_dimensions": True, + } + + +def check_input(data: bytes) -> None: + """Malformed URLs may refuse; accepted identities must retain no URL credentials.""" + if len(data) > 4096: + raise ValueError("The replay input exceeds the fuzzing input budget") + try: + result = embedding_space.public_identity(configuration(data.decode("utf-8", "replace"))) + except ValueError: + # The URL parser explicitly rejects malformed brackets and netloc normalization. + result = None + if result is not None: + assert result[:3] == ("custom", "synthetic-model", 16) and result[4] is True + parts = urlsplit(result[3]) + assert parts.username is None and parts.password is None and not parts.fragment + allowed = {"api-version", "api_version", "deployment", "model", "dimensions"} + assert all(key.lower() in allowed for key, _ in parse_qsl(parts.query)) + assert embedding_space.public_identity(configuration(result[3])) == result + + # A structured branch guarantees useful accepted cases even with malformed raw bytes. + credential = data.hex() + url = ( + f"HTTPS://user{credential}:pass{credential}@EXAMPLE.INVALID:443/v1///" + f"?api-version=v1&credential={credential}&MODEL=m#fragment{credential}" + ) + public = embedding_space.public_identity(configuration(url)) + expected = ( + "custom", + "synthetic-model", + 16, + "https://example.invalid:443/v1?api-version=v1&MODEL=m", + True, + ) + assert public == expected + rotated = url.replace(f"user{credential}:pass{credential}@", "rotated:replacement@") + assert embedding_space.public_identity(configuration(rotated)) == public + changed_space = url.replace("MODEL=m#", "MODEL=n#") + assert embedding_space.public_identity(configuration(changed_space)) != public diff --git a/tests/fuzz/test_probe_publisher.py b/tests/fuzz/test_probe_publisher.py new file mode 100644 index 00000000000..141fee8c16c --- /dev/null +++ b/tests/fuzz/test_probe_publisher.py @@ -0,0 +1,160 @@ +"""Exercise the probe publisher without network access or a fuzzing engine.""" + +from __future__ import annotations + +import json +import os +import subprocess +import tempfile +import unittest +from pathlib import Path +from types import SimpleNamespace +from unittest.mock import patch + +_WORKFLOW = Path(__file__).resolve().parents[2] / ".github/workflows/identity-testing.yml" +_BOT = {"login": "github-actions[bot]"} + + +class _API: + def __init__(self) -> None: + self.issues: list[dict] = [] + self.comments: dict[int, list[dict]] = {} + self.requests: list[tuple[str, str]] = [] + + def run(self, command, **kwargs): + method, endpoint = command[3:5] + assert command[:3] == ["gh", "api", "--method"] + assert endpoint.startswith("repos/ClickHouse/loom/issues") + self.requests.append((method, endpoint)) + data = json.loads(kwargs["input"]) if kwargs.get("input") else None + if method == "GET": + rows = ( + self.comments[int(endpoint.split("/")[-2])] + if "/comments?" in endpoint + else self.issues + ) + return SimpleNamespace(stdout=json.dumps(rows)) + assert method == "POST" and data is not None + if endpoint.endswith("/comments"): + number = int(endpoint.split("/")[-2]) + row = {"id": len(self.comments[number]) + 1, "created_at": "fixed", "user": _BOT} + row.update(data) + self.comments[number].append(row) + else: + number = len(self.issues) + 1 + row = {"number": number, "user": _BOT, "state": "open", **data} + self.issues.append(row) + self.comments[number] = [] + return SimpleNamespace(stdout=json.dumps(row)) + + +class ProbePublisher(unittest.TestCase): + def setUp(self) -> None: + self.api = _API() + self.results = { + key: {"result": "success", "outputs": {"review_count": "0"}} + for key in ("replay_and_mutation", "coverage_guided") + } + text = _WORKFLOW.read_text().rsplit(" python3 - <<'PY'\n", 1)[1] + self.source = "\n".join(line[10:] for line in text.splitlines() if line != " PY") + + def publish(self) -> None: + with tempfile.TemporaryDirectory() as directory: + env = { + "PROBE_RESULTS": json.dumps(self.results), + "GITHUB_RUN_ID": "1234", + "GITHUB_STEP_SUMMARY": str(Path(directory) / "summary"), + } + with patch.dict(os.environ, env, clear=True), patch("subprocess.run", self.api.run): + exec(compile(self.source, str(_WORKFLOW), "exec"), {}) + + def test_success_does_not_create_a_task(self) -> None: + self.publish() + self.assertEqual(self.api.issues, []) + self.assertEqual(len(self.api.requests), 1) + + def test_repeated_failure_has_one_task_without_comments(self) -> None: + self.results["coverage_guided"]["result"] = "failure" + self.publish() + self.publish() + self.assertEqual(len(self.api.issues), 1) + self.assertEqual(self.api.comments[1], []) + + def test_success_and_reappearance_each_append_one_status(self) -> None: + self.results["replay_and_mutation"]["result"] = "failure" + self.publish() + self.results["replay_and_mutation"]["result"] = "success" + self.publish() + self.publish() + self.results["replay_and_mutation"]["result"] = "failure" + self.publish() + self.assertEqual(len(self.api.issues), 1) + self.assertEqual(len(self.api.comments[1]), 2) + + def test_human_body_replacement_gets_one_recovery_status(self) -> None: + self.results["coverage_guided"]["result"] = "failure" + self.publish() + self.api.issues[0]["body"] = "Human diagnosis" + self.publish() + self.publish() + self.assertEqual(self.api.issues[0]["body"], "Human diagnosis") + self.assertEqual(len(self.api.issues), 1) + self.assertEqual(len(self.api.comments[1]), 1) + + def test_closed_decision_is_preserved(self) -> None: + self.results["replay_and_mutation"]["result"] = "failure" + self.publish() + self.api.issues[0]["state"] = "closed" + self.publish() + self.assertEqual(self.api.issues[0]["state"], "closed") + self.assertEqual(self.api.comments[1], []) + + def test_cancelled_and_skipped_jobs_create_no_task(self) -> None: + self.results["coverage_guided"]["result"] = "cancelled" + self.results["replay_and_mutation"]["result"] = "skipped" + self.publish() + self.assertEqual(self.api.issues, []) + + def test_full_comment_window_refuses_without_another_write(self) -> None: + self.results["coverage_guided"]["result"] = "failure" + self.publish() + self.api.comments[1] = [{}] * 100 + with self.assertRaisesRegex(AssertionError, "history budget"): + self.publish() + self.assertEqual(len(self.api.issues), 1) + self.assertEqual(len(self.api.comments[1]), 100) + + def test_api_refusal_propagates_without_retry(self) -> None: + def refuse(command, **kwargs): + self.api.requests.append(("GET", "refused")) + raise subprocess.CalledProcessError(1, command) + + self.api.run = refuse + with self.assertRaises(subprocess.CalledProcessError): + self.publish() + self.assertEqual(len(self.api.requests), 1) + self.assertEqual(self.api.issues, []) + + def test_duplicate_identity_refuses_before_a_write(self) -> None: + self.results["coverage_guided"]["result"] = "failure" + self.publish() + self.api.issues.append(dict(self.api.issues[0])) + writes = sum(method == "POST" for method, _ in self.api.requests) + with self.assertRaisesRegex(AssertionError, "Duplicate Probe"): + self.publish() + self.assertEqual(sum(method == "POST" for method, _ in self.api.requests), writes) + + def test_surviving_mutants_request_review_without_a_vulnerability_claim(self) -> None: + self.results["replay_and_mutation"]["outputs"]["review_count"] = "2" + self.publish() + self.assertEqual(len(self.api.issues), 1) + self.assertIn("**review**", self.api.issues[0]["body"]) + self.assertIn("not a vulnerability claim", self.api.issues[0]["body"]) + self.results["replay_and_mutation"]["outputs"]["review_count"] = "0" + self.publish() + self.publish() + self.assertEqual(len(self.api.comments[1]), 1) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/mutation/pyproject.toml b/tests/mutation/pyproject.toml new file mode 100644 index 00000000000..5eb0ee3c3a5 --- /dev/null +++ b/tests/mutation/pyproject.toml @@ -0,0 +1,12 @@ +[tool.mutmut] +source_paths = ["server/core/"] +pytest_add_cli_args_test_selection = [ + "tests/mutation/test_embedding_identity.py", +] +also_copy = [ + "server/__init__.py", + "tests/__init__.py", + "tests/fuzz/", + "tests/mutation/", +] +max_stack_depth = 8 diff --git a/tests/mutation/requirements.in b/tests/mutation/requirements.in new file mode 100644 index 00000000000..fc54b793839 --- /dev/null +++ b/tests/mutation/requirements.in @@ -0,0 +1,2 @@ +mutmut==3.8.1 +pytest==9.0.1 diff --git a/tests/mutation/requirements.txt b/tests/mutation/requirements.txt new file mode 100644 index 00000000000..41bf1bcf6b0 --- /dev/null +++ b/tests/mutation/requirements.txt @@ -0,0 +1,436 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version 3.12 --generate-hashes --output-file tests/mutation/requirements.txt tests/mutation/requirements.in +click==8.5.1 \ + --hash=sha256:8bb5376d2006950386f8c6427613334a2acadc5f559cb80e638d00b4df957e37 \ + --hash=sha256:9bbfada76703fd1d784b83eea012e3e8c6a001a876543ef104fa56aaaeb072b4 + # via mutmut +coverage==7.17.4 \ + --hash=sha256:00e8634dd02f8ab60423e6adc8650ed1aeafe610d01538c96d711ec5d496d6e5 \ + --hash=sha256:018d8c91d66712b86cc81ec3d8eafa3b6db6fbdd7839e4ddced40887170a11a5 \ + --hash=sha256:061aa359141894f87a5571ea45d17a1069aae88f342e4ae186e245430ffa62dd \ + --hash=sha256:0c5ce163d256640aeaa7049a9be0a026e1405f931052b00cf474641155090288 \ + --hash=sha256:0f9547c30aeef70904ede391f4cb43d2ddd0a0d2d8fb4a96c75cc422f64afaac \ + --hash=sha256:130313b9a3d1b503795c71e9b7443d94aa0b5bfdf592418faa3653f7faa8fd9b \ + --hash=sha256:139bc6276ffcd09f7b78842a0abc64d3fc345b4760ed43a9cce3f80ade932018 \ + --hash=sha256:1453e1bf87c266baef40e6300b5030411e133a468855a9332346144a82d9bf2c \ + --hash=sha256:1800419137becb9986eaac1c48c0da515f98506c1c1fdc06f3c9fa738fc6c9ec \ + --hash=sha256:190d47507166d16b3c588312fb837aaa7df6f3858787935553e475222e1aaa97 \ + --hash=sha256:1abf6cb6c33de847b69cc76f77051fbdd82dae1304d6fec208549aa0df6ba200 \ + --hash=sha256:20d3666ce784cd6dc05489c8ddc3acb60992d0c5e4c6895590c8c4ad686d393c \ + --hash=sha256:213ae674d282a76563784e9279e5273365858a42ad74ad7c6c5fb9d302e9c668 \ + --hash=sha256:218733560e239ae84ca3a6a0c4943a00c843c7263c84f1d4987f6d554321e550 \ + --hash=sha256:230726fa5e64866c8f36606735c301744a7fc7fde85d89474d1ec16aabd45be3 \ + --hash=sha256:23d432dcc82301f6b1314cff60240deed33d3d754dad40360b1b120d22da134d \ + --hash=sha256:25ed180a4fb75b487509a4568acead1de41aefab8bedb06ac1ed5c14223fef97 \ + --hash=sha256:26b16d3c57670d93a9f8ca6182325f51a10acdd79b96446950e179c7e14806c9 \ + --hash=sha256:277a095161b40c8b173779134f3957860afadcc1544b35c4a5f7862a22165948 \ + --hash=sha256:288899bfe00b261413aa5fd88dc6c0207b39d3c8bcb6ac685920a8cbf4d3d10a \ + --hash=sha256:2cb7b4d75742dd55521ebe51d34e6108d74d36c5a5e04ab098b9f842564f6185 \ + --hash=sha256:3260172e9dafc05411163a6a78786842d24dde5223c450504b065fc14f58722f \ + --hash=sha256:36632c8156201cf253c9af6d69fc8c04b5ef0124cce7ae6bf989af22ed8373fe \ + --hash=sha256:3a92798791a50650ee87fda3ad1384140b8544d5744b7e28bec24156a2f95b97 \ + --hash=sha256:3cbe3d90cc8926d74f3149a318bbe88a4c0376db3e4208aaccf10f5b4d4d4172 \ + --hash=sha256:3de487ce00a787ff38bcb5cb6e3a2a5e0b290e1d1d11641fdf268ca9044eb860 \ + --hash=sha256:41b5f9ca1cec1dccfb4266022118bd587faf10774cb7223b5fd4b88e74cc90ce \ + --hash=sha256:434e8a7a91fa2bb2819ac4da53697d4805bb1b25d00a9046403651e59c2cc857 \ + --hash=sha256:4573742222483b921a0b9fe8be49688dfd999cfaa64fe361d73c48ff29b29194 \ + --hash=sha256:45baab3103ec596c38a409cbe758adf35fce67ebc8ac6f6a60a176242f6bf421 \ + --hash=sha256:47ead0fa826c37a6fc9149d4b7e0548032bdf5bc0c5b9a03fd61f611e5d9dc73 \ + --hash=sha256:48086a827cd97aa870094163b0965a777c1a8faba95db6817f6be7abd01f36b5 \ + --hash=sha256:48756fccdb86f09aadbe59da47de0c921da10ffb88377572b66797e20837f274 \ + --hash=sha256:49e5269bb9194b83ec2767ba72a2f0e326e63244a4432b65e04e48ed6edd5283 \ + --hash=sha256:4be54daddba880b49872d5032d8a652cc0d5167ef812522cd37d643ffabad6b8 \ + --hash=sha256:4cb2740fc626b8b1746d450a7d6647efee5fe1f717842cf030381c0244ff926b \ + --hash=sha256:4f6d37e0acfbb6eb12e35ab7a5b3a33dea08efd9a749c72adb53a3442e013e17 \ + --hash=sha256:504c08b3b9a1266098cc7e25e4a9bc03cc7b4dbbe01c8114a0f67580cf89c931 \ + --hash=sha256:518b5cac4d2a4ee073f8c52cc48b036fc9412ee3a02cb4930ce6a5bc7178c9ed \ + --hash=sha256:545dbbd06ecbd2294f074e1196bfe8414e60dff18c012bb1869581e9f7b518a8 \ + --hash=sha256:56c3ecc382d84aa17d8bf75d2921bdb74b65283259a9b0b207fc920fedd46352 \ + --hash=sha256:5917eaed4ae45da815e480a03540c2039bbf36ff48ba762d6395887c97bc4f9f \ + --hash=sha256:59f38f9eaec5626b26f7eae1ccbe31b81c335fd50d90add59b5fb66460b5de30 \ + --hash=sha256:5c0cce1af77a7853eb886ef2266cfdbd8ee677b548e4dd6ac2bcdb4dba380eff \ + --hash=sha256:5f706d22666950f8aa51bbba843ba58855bf69eaa108882d6ab3289d8dc67e83 \ + --hash=sha256:5f95725a39d7d0947099874e158a4153480291dcabe474e1d6e79f64befe3fdd \ + --hash=sha256:60d56aa6ff74d6bfe0fbac3e5f30b25b59fa8c05dbe72b37cf5798c0b197a3ac \ + --hash=sha256:64774e1ba6c380cdb7827d7fa04bd545de94f308ef0ebee183e99a5e9561f5a2 \ + --hash=sha256:64e0bc7be78a889223d710cbbbddb9f73c629c0c715808a3ea61af5c12b8bae5 \ + --hash=sha256:6d197e8a287308a6169f99a61e196ab7027c942fbd25a8bc19bd2e344c7dfd2c \ + --hash=sha256:6ffe168378624d51787df97cccde58453210d5e3061fd7f926d16c35d5e33eb2 \ + --hash=sha256:7720afcf240957c785051e5ebee44b46ffb594938e2072c9f880487f7ea43023 \ + --hash=sha256:78e89a6c3018a9792792d8f6644c4a0db273a3c06569bbc8a510325eb6e02015 \ + --hash=sha256:79c64dcd95d432c81fdcedb95a19f03062f67d1e2d324081b12d1c9f2f9f911f \ + --hash=sha256:7fb7a1e6ec64d9e87bc344555eb221875e162c62615e23dfbfc5bad66cded8dc \ + --hash=sha256:804915e71518ad2006c79a9ada50c60f141a004d493ebeb3fcfc6bf8b7ea7ec2 \ + --hash=sha256:88088b4978d493454c6a6a48c4d0249c020371f0f0ec63aa1bea2228bb2cd919 \ + --hash=sha256:88e1447156dd052d04a2d67b492ae75e7b07286b609ebed7addffc99e1d7f7f3 \ + --hash=sha256:8b2bb2ab2a124e8464e255d4e637c054365cdc419d973dccf4f4555f1a596bae \ + --hash=sha256:8bc88aefc1022f18814b7b21366d5480b8d218384b79d07c9de0216d12ad8b47 \ + --hash=sha256:8c94a57d153ffcac3a51756aa9b622b918935745933b4914097e97c4fbe2c18b \ + --hash=sha256:8ec3c9bd52e6ee5ab9c1f5b2663bd3541327f670465f52e21fa5d93fea97e20a \ + --hash=sha256:910fda910d8d8fedb8a7d6a1d2c061b4d33c7ee0222a4e51f90a62d485db9666 \ + --hash=sha256:91993237a770a9f04e696d77ae0339e1fe6a4cc2018e07e3ca032a6e6f040bbe \ + --hash=sha256:939eff4f096e0a6a1b8c586392d8f1999fcced17b41df9431d7cebce61743edc \ + --hash=sha256:93b150ee437bdcceeed0646f912d5c26f21ec99c3cc3d2717ae74f3488e30251 \ + --hash=sha256:95a28464c9a65609c3522d21e3dec2428aaa000bfb4e746684044722ba4bcc89 \ + --hash=sha256:97e60c1726f58eb28673a33af00e4d0f96cac1442795c9c1d35c4991d7b89024 \ + --hash=sha256:9917e379c4c3e5dc4f4bbf4f911a529a9cd5b7da6f6b7e93f6f51e26ed8f8af0 \ + --hash=sha256:993fa424a6959e66e003d09d3a0810b230b00010a7c71d2e89bf1548abfb9627 \ + --hash=sha256:99c1d5c0932b59ff80a0db3434fafbf0aa20862b55667400e361bbe7e11dc3cf \ + --hash=sha256:99e41e2c90da68ea451c6b1ceac2b8b571aaa11eab25390ee6f6f374d3d84387 \ + --hash=sha256:9b443dbfc8ba7bed47a27be96986e407bfdc269d29bd45b5c885192c99f9e37e \ + --hash=sha256:9f0185657f4181ce2505948c782af4cd7286c6b36d64da9f3f85c36c08cdaec9 \ + --hash=sha256:a0e2e478b3a3bb2da24cbee4a50b4946ae63eec8617da064e9c2c904b60ee2d7 \ + --hash=sha256:a2977d0a150c855c460a2c5086c4a160b5b0a42474ec55c9050679a2cd80989a \ + --hash=sha256:a3e91ad99091799815d1843cea5a88f565e79a2e0af0d6eebb02d275e32debe9 \ + --hash=sha256:a485eb4032dc8c595d771087506044b6fdf8a905d833a9f10fc6910aa4eabfb6 \ + --hash=sha256:a51c345704ac578736c1a7ea636e83be82752240811decc5e53c03e138b5a3e1 \ + --hash=sha256:a5d52b6384e0f26d1fa44192bf14af5ee09f3f162cbe5d72691f17530463bd7d \ + --hash=sha256:a85240086a2b2698cecfdfdbabbb763f806dd819e2131673c77ab4113b6203e5 \ + --hash=sha256:ab91648a15fe5ab82771f8bea4010e9e78868fd7ab072afabc36760e5ef85dd9 \ + --hash=sha256:ab93548f3c5d7b833a647aea57def99c99313a82349e80cfade4945dd7c66d7b \ + --hash=sha256:abd3e1493d75ed2e851c88a91c91c755bb1eefeacf93bf94ce930dff309df537 \ + --hash=sha256:acf01793b1b1fb48116cf9fcc2b291099d00f1401e481dbec19fbe764b51618a \ + --hash=sha256:afda936c4b8275475106783a099b216956caf7ba7a546aa9e438ad3bad9e7947 \ + --hash=sha256:b437e34e6bc70d7069cdd1b5573fa07b64cbe27749862f6ec9cfcd43695a791c \ + --hash=sha256:bd8756e4053ff53955fa8dd94e8d5eca499fb7f1ba21eb71b6b70847e5f846d4 \ + --hash=sha256:bd9a8ce0fde0ab37509a37ec78febae205646385a760df3e77d515f683d76175 \ + --hash=sha256:bf1628a3e7e8bd1be37f7af91cdf19381d198f01a5ceaa3d2c6a25c4bd215dd6 \ + --hash=sha256:c07948d36bffa179c4ec3e41364c4b9c391541d92dcc0bc9272e8a66bc6a563a \ + --hash=sha256:c1fa76f9c2f47b31cd4b5b24920c6102ac254bbb0351dc22811fe2519a521807 \ + --hash=sha256:c2e95837db6552875bab31ae6ba1caf279461801c77b2d85b801284aca30b301 \ + --hash=sha256:c4a4088a5f3cf328edd05290c2553c130d179c378a99d22520578ec47b2f11e5 \ + --hash=sha256:c4b1738f29fd18ddfeb037174a992108f257d14b8d0379562814c198dbc0225a \ + --hash=sha256:c50715260ac94dc9083d2434aa213791a709acb235a43e1c3dd695edbfdf4d0c \ + --hash=sha256:c58053555bd51e5819133cd13f7492dff1a26ed8137c478cf7decb38d0a94b55 \ + --hash=sha256:c7455bd6eb8387044e8fd099e8055916df0e51e62b7c0c2c43e64446558d8cea \ + --hash=sha256:c93d510d7d16a13b66e50e41b63ceef877f61c1b02834fb18c624970ffea0c44 \ + --hash=sha256:d122cc899e91720a19003a7b0ab3c6937993518d136659d4185baefca0a8423f \ + --hash=sha256:d1d744ba0008562ed1d1c9cc22fabf6c36eefe204491bef1f0569066fc2bf591 \ + --hash=sha256:d6a0948f99a7db9a612a0d82ccac7cea13ca5083782c4dd52f0bc5c00bca0e12 \ + --hash=sha256:d7802ed833e315852d318e998c36afd49a44966767a1777f85d0eb6e5c370be4 \ + --hash=sha256:dd0c8d9efcccb0b1d50767f42f4f46ed4640dfefc192157df901ce046bd763c2 \ + --hash=sha256:deaf390d99d61685d290a2ecc916a3801e4b7b0acf2daeccd9539f8f4afe7410 \ + --hash=sha256:e26061e2848d96f29e80efb304be5890189ff67d2eed3b4ccbce29f1adde7f38 \ + --hash=sha256:e2a7786b1531a1295001a88c0a194488353577e1b8e9b2a0fe4555eb8bc34102 \ + --hash=sha256:e7d27f42b74efed52f49a0e688c191c07757208e89d2f0c9efcb69b2a255cbb4 \ + --hash=sha256:e8e5b52a60f7d30066f2a80f983f4acef871a487eb634dbd5c399663ebd0a00c \ + --hash=sha256:e98a2382f5c26b8e17628ae832aab59ed642490b37514525f9983b312e98819e \ + --hash=sha256:eba49a6148798f3d95bf8c642fc2c6645c008b32014fb68c71538b211b1bd53a \ + --hash=sha256:eca0b6cd7d4e69d41f63cb3a5d4a8e437c469e93db5d330aa8378d7c44c7ac14 \ + --hash=sha256:ecf66cf8e3b1abf6b3d3febea3afbb780caba2ee0667dc3e2adb597b636ea677 \ + --hash=sha256:ed2a212081b6960c9e6df63d4b56800606984f256ce4d514bf3e7cd44fbfe496 \ + --hash=sha256:ed557f712e52022a8175de69dbe34906e6860679f1281b3270059126aa6acbe8 \ + --hash=sha256:f017f753e089cf3bcca963317d265b9c6b00711ea6156cbf75254c5a4b470df6 \ + --hash=sha256:f18308e805bb72ad54c0f59553072fa62242ecac4b7bab5894433be273a6fb99 \ + --hash=sha256:f4a24adfff26121274362da90f88402fd335629f39cfe4066a58ba4cab075583 \ + --hash=sha256:fce18eccf5dd137290341d64bbfdb8002db2c76f6c69f3e38fc1391dbb6b975d + # via mutmut +iniconfig==2.3.1 \ + --hash=sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960 \ + --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 + # via pytest +libcst==1.9.0 \ + --hash=sha256:02ee2dbdb5c218116f16a021350fc267a14be205b50d81c33f5d73857ab6fbf7 \ + --hash=sha256:03165a264653bb77f6a11b412ae09c08bdb0c25864f3b8d42b816ac64b9d4b9e \ + --hash=sha256:087b58a9afe076bb08e2d726478e1f16cb928d67ffa9092817e033c335de522a \ + --hash=sha256:0c7b548512db25af9c2997a95fa731bd6b6928ecbad6c0915d7482d8bb42d34f \ + --hash=sha256:0ef45740663d0e6d8159b9eb6db436c4eb8dd0808c30812501542d65cd44c030 \ + --hash=sha256:107593af46945593e7825821793393262bc4fa1d3ea24c3ed487b61269bbbdf8 \ + --hash=sha256:1260b5d070a3324447a53a00387225a55472a62077ce01922d30a2a78cc4b138 \ + --hash=sha256:1879e5bd97f124acc787ae73cf52975cea46ac0282db5e8d9296173fbe87fa21 \ + --hash=sha256:2b150c4f298fe54eb0fe73abf71f57db74d070796140a8c206c9615b6861f01e \ + --hash=sha256:32395244edfe6538e0ea2bf82051d60103d3f54861274805c4fb3745efb70a85 \ + --hash=sha256:329ffda6b0ef708ff22876f982ec886a509c8f73ac1ccb0190693d35cb09aa0f \ + --hash=sha256:3cdbafbc992b38ea005ef37e20243c4177879020c82d414789fbb7fa22d6d3a9 \ + --hash=sha256:3e5b684191a0462b2d40a73261ea7f4da6a49e7a030b7e0fceca46bebb51dfe5 \ + --hash=sha256:3f735e3acb3afc75d50803fde1598b467bf05d12d6854025df4398aebd75a14c \ + --hash=sha256:4090105fa4ad114766d0f8b34418d9a3b359bc8645da860a447e19770b5705d1 \ + --hash=sha256:444e84c76cd035cd2fe136838c1a524d34b08216521f6f5093df8a6f6cfa5799 \ + --hash=sha256:45808c03528b3ad40b14095348a918e08d98c47b4a125d631cb78e817c0a5b16 \ + --hash=sha256:496c24e0d3240bc7da45dae543aff3f5b6509978c39262d6b84ed2fb999dded2 \ + --hash=sha256:497d5329345f1f5df84e41b0bbd00204b64a2fd30dfe3cfaeaebca633a31e877 \ + --hash=sha256:4adf97bb1aff8039b0bd4991e2f838be6e4fad552821b26b71a5d1a653c2582f \ + --hash=sha256:4d382fba04077eb556a1ea4295a4482e192aa93639c5a07ba0885841965ea0c0 \ + --hash=sha256:4fb016ad6ec8485991770dcff3fe072b0296eff6fefe7b3b4e28fb919dea3def \ + --hash=sha256:50ab94bb2524b419056d4003032b8c67102ac800f8d85b3c4260a01746d94dbb \ + --hash=sha256:50b913e37187f00a6fb88962009364e1cf1b1284aa1762304f34b52b972f2218 \ + --hash=sha256:5302fc698ef863e1a2fb540e95793b3d5a96abc89aa6423ee9c389d7d7ec5eab \ + --hash=sha256:568288cdbfe3b4ca3ae4852cb0a439ff053dd54c841bc4995bf2b71238b5de40 \ + --hash=sha256:5705f664266742b8d9323db714f58cf06a6cde739eb09fd9ca31cd233f9806e5 \ + --hash=sha256:5891ce9cff815077614f509e3a23888c5ddb8081d6188e8ba1172c0ccc369022 \ + --hash=sha256:611cebd3bbc2014576f4dcc7b845b3c594c96ddc287a3db9b78f22eff156a7d3 \ + --hash=sha256:6e50576bad7d56459d9792cd0b0dfe5469dad13646e9a9c0a8b1ba20b269f332 \ + --hash=sha256:77d9303572cf0fbd0a2eb71aff167a4246541f43bf58b781b35b9d0bbab80ddc \ + --hash=sha256:7acfd18adcdd32dcf41ce676cf121002afcbe9ad2c72dc0c18d78465beedc228 \ + --hash=sha256:7dcddfb4905c5ef90a6fdc58dccbc049faf0056b68161042fc1e0526b20cba05 \ + --hash=sha256:8504b422c95676a8c27b517e1ac01413ece91bf356865c587ca9bdcd5708a2f7 \ + --hash=sha256:86361e2b426bd1b403e52375703c8b764e226e571adcb30442510710681edbf0 \ + --hash=sha256:8930971d2299b7006bb5d10c10038f44efb6da89d5bca2823595e31a9cdb96af \ + --hash=sha256:8bc5351d92ca6ac1cc32e097700e1161ad1ceaa4d9b2cca5abadb1e94576b325 \ + --hash=sha256:8c14abe844bec8b021111b3985474e49f5af799c020e8e40dedcac87c97a40c5 \ + --hash=sha256:8d731abe1307720ea1a52d447555e8443a6d130e0e520243c0634a58f6edbc9d \ + --hash=sha256:8f0dd08a5773d7051e105250b2a2c73d8065ea9b2d68e7e1bdc5244660e75f93 \ + --hash=sha256:951f13c193e590fc88c9582a5341a130fe53ecece51043cff4bd54e25a5e022d \ + --hash=sha256:9f92c75283030fd58fb7d6e560168a00381e0e3368ec8a026a3ec8a828a05f93 \ + --hash=sha256:a2faaf92500d0226358125630f5aab4758e8aad3f2d70a10892ec3c700781a54 \ + --hash=sha256:a5068bf6114f6f4d79af7a6c80a28d1deb50441150ea1db13b5458ab34bec159 \ + --hash=sha256:a621e261990148c1cfbe26c1798bd2375c131cf358a44a7a4659fc41c1a336e1 \ + --hash=sha256:a6615b036694f6906e30dc018b5b34898cff7ff760ab549f9dea1ada4f53495b \ + --hash=sha256:ae8b2abe4d5f52bfcad749350e4483976b7b5142f765ebab69959f2b4f99641c \ + --hash=sha256:b18c9d7316f96ab255a9a127289af0b9b7d1ebf8929e81eefdeccd951f4ba58e \ + --hash=sha256:b4fa00cb71ffbda877dc4010ae8f3330ca605af859ddc6444bea96c4f294d648 \ + --hash=sha256:b755ed4a4bc2faee849b54820023137d60d4c199e0a0822f0ff0c1bc49e49b48 \ + --hash=sha256:b8b9df30f524317b097dc53065b25dda33d6a4cc3c7c8bf4fc83ca7559c58cc0 \ + --hash=sha256:bb5d0946f2b4c6711b5d69fe4f833b364f9e7a1a2b08f88b98619dc18975099a \ + --hash=sha256:bc6aa3e7f21315dbe9868c0d13ffaac309514e8c816320c5f91230fa5b21df92 \ + --hash=sha256:bcb9f9d4fcfe2ec7a40d2c26e03a538d5d9dc189c38551eb3f94ab661afee7c0 \ + --hash=sha256:cc84aee3c293a012db722aa2d6ea87be524646852684a5a4e54c1fb98ea9072f \ + --hash=sha256:cd1a3500c41784075c4946a995d5ad89f68fa0d226b63ff3c4d78f6ea6dd23e5 \ + --hash=sha256:dacc583bcd8db56e457ae559b910673c6b5df66f694d1f1154ce0b3982158d17 \ + --hash=sha256:e465a7bc9c2b9533eb9e06d2391f8819f811b5112919d4064c9fb8565aaafa08 \ + --hash=sha256:e8d671c39a431c309476099b8ec811e412503ec0f4465f6fc907cb51c70e8e6b \ + --hash=sha256:ea490fa8540503db5f321f0268becab46eb50f710e8cec8041e241fd66f6874f \ + --hash=sha256:eccf4c57d273cdd3fe1c67b72cf9bb1bbd4547aa011824e96ccf5b7136057aa4 \ + --hash=sha256:f101e0bf8638eba80694ecc3c3abb5309eb488f5271427536cb379c5c1e0ba9e \ + --hash=sha256:f6248cb07444ab9a6733a855737a9febed8b9adca51347019348b09a3ac7dfe9 \ + --hash=sha256:fceeaf1a1fd186557973904cfd2bb3c05ad835b01d7d04e9ec1df463c0add966 + # via mutmut +linkify-it-py==2.2.0 \ + --hash=sha256:3adc40eb5af300b2605fcfdb968c24e1d780a90f1f2221af7c15e5111e94d443 \ + --hash=sha256:907acd2d17ac1fbb9ddb62c8957ccbd6158cac602231a15c3b0cd1e215f03cee + # via markdown-it-py +markdown-it-py==4.3.0 \ + --hash=sha256:7aa1511a46c39138de78d9eba92ce47e63124d8003fc98b3a351909e04239efa \ + --hash=sha256:91a58fa5b72c71a40cf7177250fd767480d7a2bb3ac426ccfb76fb90305fdaaa + # via + # mdit-py-plugins + # rich + # textual +mdit-py-plugins==0.7.0 \ + --hash=sha256:26d2179227aaf4d1dc7acffe7a738cbd15cade6b5a61cff0a2cbf9fed93efede \ + --hash=sha256:7f8e30403f3dd8bfe3afcdcbc6e61066d3f2e714167507b9c26eb385ec399353 + # via textual +mdurl==0.1.2 \ + --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ + --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba + # via markdown-it-py +mutmut==3.8.1 \ + --hash=sha256:9fb7cfc23caabff22a938e33b8d34317f5fa79b1deab82642cd5e014f3f400aa \ + --hash=sha256:e424d72c0557b6a52a721d9b71e2d18eb9590af746db0bbad50b71e8d4d8ed78 + # via -r tests/mutation/requirements.in +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + # via pytest +platformdirs==4.14.8 \ + --hash=sha256:1e34af590de4d978631b751eb2202f2fee4497537a17c1720b12fcf57b331392 \ + --hash=sha256:96893d686e84e9e6f358a9ea41a8de544df66dbf2ba6cda250e7dc73acf85b9b + # via textual +pluggy==1.7.0 \ + --hash=sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec \ + --hash=sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8 + # via pytest +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c + # via + # pytest + # rich + # textual +pytest==9.0.1 \ + --hash=sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8 \ + --hash=sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad + # via + # -r tests/mutation/requirements.in + # mutmut +pyyaml==6.0.4 \ + --hash=sha256:070c22b6f490d6cc30912be9fb9ab1af9c752769b39b53616f6510c3f038ee6a \ + --hash=sha256:0a3a351f04dc124f9357512bdb80ac37cd1750cf1371da33e7cbb96d80ac865f \ + --hash=sha256:0db75f402e99c25239003a499c214a61947b4ef5312af34711d4c63e5c179318 \ + --hash=sha256:1088ad740f50c13178dad16fbc2fa1f634c791d42c7009fdb390e38e5b90b788 \ + --hash=sha256:12a155bc41509d71a2eb73e2191d9e400c1345ea99ac3d9946c31f40a4c840f8 \ + --hash=sha256:131d11bd9b60d705a6388366d77ed67850995a4d2be85fe149785a257c17e531 \ + --hash=sha256:132c3c7c37a8e6f334921b05cfea5d26e241d792dcbb4db0462129d25ca53b43 \ + --hash=sha256:15c52bb238a15bb4fd7e6342a5ac71d594507667c7fe0e5a5abbc0f6875d1e91 \ + --hash=sha256:1631d566655f3af7d6c4a4485267830f6b680d3dc9704b659b3c3f4541b5a3fe \ + --hash=sha256:180ac792c958c2173f6e4467c55ae5f73ab1a9a624ee29fc7095c56d5e3a4055 \ + --hash=sha256:18ea9bda247857fc0de05181675dc116b54c1b04ca3db71de5d2108c882823b7 \ + --hash=sha256:1d2f08c122727c86f8303bb1dd45159ca1de1f2d68798e671ec46974e321008e \ + --hash=sha256:1db4d51d3c2c9545dd44c614febc4594240754f74b30d8e501415b118347f0d1 \ + --hash=sha256:2018fda285d1289527a389e1b4ace1e2d3af410930f949136b55ecb0747744d1 \ + --hash=sha256:2c11be5ab4d9f603a598b5ce93a2064ae38087bdf1b384c5397170054cda4e36 \ + --hash=sha256:33506a2620f0e7c49858f09cb44e99f144878d03af3d9c10aa136e9a1d103bcd \ + --hash=sha256:34edca7ab64b705ee7c80bf3f9ac609240677db11e83d9317191f483a4b5a433 \ + --hash=sha256:3c7129bcee5c88c1450802cc6a95b690ee7c51bfcc7a9b60bbd9549a7a4fcbe6 \ + --hash=sha256:41b4669c3a8fd5750e594dff59d3e62d40e321fec467b50449603710ed0a68f3 \ + --hash=sha256:45e37dd647db9d67b757444c74060c064ace5fdaa08f42bf4fda3812275d423e \ + --hash=sha256:49e38a95e24738908ea852e61df0abc58d1e4d4f974ccdb2386eaee412bedc67 \ + --hash=sha256:4a2a8f27d24d4cdc05aa11df5f4c08e13f30d9e6674809b6a5ddcfcba49a653a \ + --hash=sha256:4a329472db6c8858ebd94f2214a54c8bff8f035a6cc7af1ab39cc1b33a5f0e56 \ + --hash=sha256:4d1e8d6e345b4b4424a05a11e699e999e65a88f422f73636f8a0b354bf219ffa \ + --hash=sha256:4d30c2f186612bd2f9f07c08a4c96721af59cfc8da3ec7cb27dfa2834e8bb019 \ + --hash=sha256:4d3bbc5e8a84a5a6775adecac786f489510a7159b1c343d6f31426d888cfdd6e \ + --hash=sha256:50588147ab2c6a59b5f990a4905db80899a6c2bd197e046a6201f1e67587e794 \ + --hash=sha256:52460c6dd874b22d49fda228fac59da74d7a7b06175ffcc80bfa3ba5389d7f73 \ + --hash=sha256:5246a0feaaac497b09c9462aa926280ae02fc8791b0099c0a925ebd7c7f249a6 \ + --hash=sha256:54c23934cf166bb2090d73d82b1388aadb1cead5e73885223dcfa4a459a22d43 \ + --hash=sha256:573debb9fe3075423d4f823795a678580e597218c25baef178d532b124a25a25 \ + --hash=sha256:609e8efaffa5662da16b7d53eef76fc4eedbbe56fce5829b67ba808a6e35d399 \ + --hash=sha256:60e9da2772e259307650e03c24f50e3bc2d9fa5ed1ba44c47582e13b0e7708d1 \ + --hash=sha256:61eef2f08e977b725f37a8d1663f5a222c6f09207ac0794030d5fca062e7c96e \ + --hash=sha256:622aa875fa6533f25fedcffe23079357d65a690d462200afed5d8e9d0e01ebee \ + --hash=sha256:62c5b5669b05dabf991a705f3a3601f57b65e95121a1d3e3a4ae4446c8632865 \ + --hash=sha256:67da066ca12eb60114ea87f2ecbcca622fff0c205c743cc900437127564fabf6 \ + --hash=sha256:69380d4bae12aab2a2c9532deff6a2841bc9fda47c333691bd2368b696301768 \ + --hash=sha256:6ac167ebebc0c387290406a337b9b5c8c343fa5f7928d5941e45a94b8ba3aa39 \ + --hash=sha256:71bb5b87465d88d1dfc577115af6d435bff9b26f2512936f610c26aa55966028 \ + --hash=sha256:730788375056c43d3ac15bd894c9cd2fb7a931a38b302f408620c64b3ef176ed \ + --hash=sha256:7335809813ec838d9cd334b1744cda33deb141c9ef23a9c0df371c37980d3851 \ + --hash=sha256:78be5a1b05a5d1fd46d0290393e5deeb581fa617585462c1b84f7c6b0cb1e489 \ + --hash=sha256:84e97378010f3da8daf673b82d39ed638098d236a1b760d61c0c1348a642bd70 \ + --hash=sha256:8708f6ab9c2581ffa05f66dae3206bb0385949650537d7295fc7ab0d6454dd70 \ + --hash=sha256:872d2a592289061c1b987e335b3568a2616b474be02bd0608d8f551a385441cd \ + --hash=sha256:88a089e6424a8a256321270620d5a4328ad5227fb2061b07d33f596894336914 \ + --hash=sha256:8e0cd755ce5e9009fd95f9c553e5942478feb8f7dffa19435641fcdc3c20e8ca \ + --hash=sha256:914b19e17814315fbcca52031bf79b68237f3d87a948c584a667b18b468e4df7 \ + --hash=sha256:93bfb2459195406a518e2f487a9bbf01df240175f31e06f5a252ac6734c7bbf0 \ + --hash=sha256:93da48af92c84c4236578e330a514ca324362c0bb62894d8d2343363ed57ff03 \ + --hash=sha256:9d4211f080920629a90c9e31c51e326fb70cfae38f18d4128b9913c23642bace \ + --hash=sha256:9e7ec9dc75cadd392fd687cc9b8ccf7dd59ada0a991e0d14ae0fad9ecdba00c3 \ + --hash=sha256:a266cf55ee5cf63c1803432a61c6386e750e0012ca49d12d26ccb0ffd80b343a \ + --hash=sha256:a3cc63af3d639d1609143711837b926183418260aae89ed95193c07b25b99d33 \ + --hash=sha256:a56491babf0d976625807953bd192dd9de973fccb3270e77b1a795b152a26175 \ + --hash=sha256:a65339c24f2fb8d4419e06ceec1bda98bdcff727b3b533a81d5af6bb2dd34520 \ + --hash=sha256:ab874ebcc5c12c31c859a9e9fe159d688df1f7a099818ef8a35906264a8f5d6b \ + --hash=sha256:b525488d5addf5d59ff4610cd8b1deab9dc97fe0fb3fb74533d7f65e9792bd92 \ + --hash=sha256:b9fe0b8c65a1611053eb7fcaa7c022f655b7eebeb0ea034572615453cae6b843 \ + --hash=sha256:c0d68d972f6f6417b4e85e9522f3d57bb4fbc924379766ccd87254a31009c1cd \ + --hash=sha256:c24097c0462f66358c99dc83d3e1850e005f6293cfa1df1edb243428da1668bf \ + --hash=sha256:c57e40928738c4a202852759f9e1ee2c7063429a9469ee1ac15651bbf7d69963 \ + --hash=sha256:c604dc2613c417130479cdd6e55c2faa691b6365aa82b3dafddfcecc2eaf1ac7 \ + --hash=sha256:c680622f85979f2ff59b4ae44c1ecb5566b2f0f0ffe5d0dc8b4bb6a0e916dabb \ + --hash=sha256:d276f23e2371deb5ee68dd252cc9c2402b806b54d8d2cc7efbb6c34c3a78d886 \ + --hash=sha256:d58fe9fa2056fed24f055b74d5dc808fa1f5d084c22e4118f0a08253fe677ffd \ + --hash=sha256:e24bf71af8a432d7808fabff134d38dfe16d3cbb41f2873bb4b1e42422de0a1a \ + --hash=sha256:e39017e1cef43d03b2ba427f60213e4b36dbc6fb092235fa3de3a510ce064d3c \ + --hash=sha256:e956541cc7a3fff2bb5b17aeb6c5bb42c86c8e6dafb5ebdd41a05e72e702076b \ + --hash=sha256:ed9b957abb12f6ffcd92d5db32fa3ffd4e4a8423d80ddd51b4efa63b42f6a76b \ + --hash=sha256:efe68ed09903cca9ab4117c2b9ea6ee8d369818808945bb5a7fa8009b5630b45 \ + --hash=sha256:f1a4a85b419f5cb6470dd4be5f766bc59532f11b9c22c076b58a0348f05dca5f \ + --hash=sha256:f5c410f9e2ffc9286279a46f2e8c107edaf3b1123510af59c828a9c15b23c9db \ + --hash=sha256:f617e4e5c619fef5284335b24e3af3a77ce08dc5c389ff4b25033bb2749032b7 + # via libcst +rich==15.0.0 \ + --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \ + --hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36 + # via textual +setproctitle==1.3.8 \ + --hash=sha256:09cb645c6ae440286391e256203fc03522b3b0f55fda8219f698abb5c447cce7 \ + --hash=sha256:0a582308ba43afa7233d28243d9d1212e11c81d3c187a43929ec0cb70c4781c5 \ + --hash=sha256:0b15200dc328020f498b196eb59a3b3e35cb08f17bfe05b2e63e5ed47110d254 \ + --hash=sha256:0d2f756ede847e05e7759af4f2d87dedf3ed34004092216be85acd8301b1d385 \ + --hash=sha256:0e85b55eac9abfa3166ab00dac21e718ac2624a1df7d0b75559a2d3e3781cb33 \ + --hash=sha256:15aaec002066f6dd7d920c46d3bffc3e529cb4a9fac961f2dd878aad64b0e29e \ + --hash=sha256:191888bdf7c223c8b00eaa935947de0904165dee5e84d2055aecbb473d9c3f51 \ + --hash=sha256:199c2c674af749003596d3a5ccf35112d28a7cfe95a363eae5fd042c33e0253e \ + --hash=sha256:1a6f6a3b2920f4362e8d924f9e5b084f0b2692a2c140e348abd2e3a07a1def73 \ + --hash=sha256:23a193a32a9cca10c4062e2efa3377e804d0209903c734940cc6626d6dfd018a \ + --hash=sha256:26997a85aa70bb088e86f0b7899fb0c909be824d22fc025e87b0005afbe59261 \ + --hash=sha256:26da5ad9883d825b9d732fd1dcb99268a4ee545b1edd0aaa5c56f16009cccaf8 \ + --hash=sha256:322b4643f98c824b17dbf2ddb07ea7a37def8cc9e18adee320befce4bdffa271 \ + --hash=sha256:349499c0b21a940c3cb93d938013d40313711911e2fbaecd4700e2b7c236ca57 \ + --hash=sha256:35fc5e10fcba6df25d676ef908b44a36c17e7f167738ed016561185e24f4d274 \ + --hash=sha256:37a91697c3b96bac58b6936b3bf0366af96a2a6cef963fdd9aaf0593a4bd1ff2 \ + --hash=sha256:38310d9cf94959e39d22fdc0154c66c8bdbadfa790c524b04cb36da6333c7507 \ + --hash=sha256:394aca04e9f11c469f4f29d25a40a79eb4b8c9a72f438ba6390b776590f89757 \ + --hash=sha256:3a6337e7c0f50a702106e6652764117c442a0468292afb8a7406ff7c483bfc8a \ + --hash=sha256:3b256ac72a3855b434506a85cf5ca6e25441657d5dc56eb73df6e279193cb35b \ + --hash=sha256:3d2ced815b940c88097e07182c57cbfe1a0156839d1edc9be2bc0e4c74ab4eed \ + --hash=sha256:4151e5b53f7fb6a39fac2e3db35d70761bac27c0f6b924aeb4a6f67e92ad56e3 \ + --hash=sha256:4756a96435917494ec2f27f0da46bc05eecaa1a7e072d57220ecb2d46ea8a3d3 \ + --hash=sha256:4a765e0c80a2453480be27c4fc22ba1c0771867040c5f91e4221940d78a4abfb \ + --hash=sha256:4d6a0245679b74e0fda974edb672cd1f2351b0d762279b6776ca3a065c9322a4 \ + --hash=sha256:50beee618377ce6fd35767a9327f2da594b36778eb10b503ee2dc9b7c801f433 \ + --hash=sha256:50f9bce172b6f9ead1c8fe813d85b1dde57ab503a445f982026ac3a16c719e1e \ + --hash=sha256:53c92b933a47fdc9bcf5033834ebd640bdba8ddc8437e1ab2310682806c31c0e \ + --hash=sha256:59239b6e5007b1bec79ef444a390b3bcd59cbcb2686c9910da5a42f1e99f738c \ + --hash=sha256:5b6372be8ff8afc56e0d50036ff618a29bfef72f52946f316e3a65fe25266800 \ + --hash=sha256:5c05aff52e6eb9c4d2ea86cf0d0a60b1487ed570263a1b13bb30d9f96aa8ba97 \ + --hash=sha256:5cff3bdbe6be556cc19bd072ff1ed9b5a8f4cbf356cd19b1ca94506b3e2b29f6 \ + --hash=sha256:61aac898128dade36438da9387fea570f00cd519ad5231d3b268913afc2fc329 \ + --hash=sha256:63348d86ae60b071a898e4241b41da1346d8c36f1a60bf3b698ae5eb35b79865 \ + --hash=sha256:65279b2df2951b64878da5382363e730d242486179c440c8653fe39aa3cc9e62 \ + --hash=sha256:656ffe282ec0ca18308eebb100898c79b4f5698a93228d50d2f2a4a09474d7e0 \ + --hash=sha256:6579e2a6fd0bf3128c06141a87a49423e145a3ad1631fa9cd43886668ce4ea8c \ + --hash=sha256:66656b71c3eb1f7f57feb4579822bebc750c2a71e6090bc0aa7ec161cdecd30b \ + --hash=sha256:66aad6ca59e4197d8e49de384474d8b9ecc6e10989523ca7339cecf7ef2a34bf \ + --hash=sha256:6a740a6de2675da29594612eca3c962ceefc063fb62f43fc5a8f84d547ce0d7a \ + --hash=sha256:741b1ae7e1cd68745b8b677daba73685dab2d1b8bb12500e6537f3482a91150f \ + --hash=sha256:7855290194637a3c5a2e37c423efbf5813fde97a6b63ab99feade5e05d73dc6c \ + --hash=sha256:78cbc62de67dad0a1dbadb1b2bed1bb4b283d73b460ba5fdce16727d27396dd6 \ + --hash=sha256:7b77c8671974288cf192e481ed63e928f1086762e97e8845d09d65ba121f8aaa \ + --hash=sha256:7c8a2beab229c818ae36ca3f7d769db95dd748c76b857851e0a883d947419ba5 \ + --hash=sha256:7cdd3d6e5e8abcee233157615d88dbb80527a5a4eccb95a93fbf92e6d2c8f9dd \ + --hash=sha256:8086259943fc75eb07e11c1d08600709b9ce4fb2ec9bbd2490556c47d3ead135 \ + --hash=sha256:823d7d8790a4f8484c7fa65468fcd9d009f13ffe5f0bc89ec0e0d2c165ac0335 \ + --hash=sha256:84003eeaf2d7460390bbff1dbd7bee5b1213e7ae47a489f0fb7aad6acd2b045c \ + --hash=sha256:84320e61f3906cc550b900ab1ba02ec53edd2d2e1e917f0873cba16592801c89 \ + --hash=sha256:861380b2244983d12b6fe00e4a49f16f9946932245a252dd16c1f5ef7d1be632 \ + --hash=sha256:8879d303d4e3559efdba033ff198c6869010f7958412ec2047674881859fdd7f \ + --hash=sha256:8bb543b4b58ad839f7f0d335a7f4b40cef6989952e7239de3532de0b7771607e \ + --hash=sha256:8c0a7753f5ddaf0ecd1fc8df3e2106611d4290f0508e643e723cb5000b7d6c2f \ + --hash=sha256:8e286e4c4e90063072a6e088a8d6526a7ffceb47429db88ba50ba58eeebcc758 \ + --hash=sha256:97b35b15f81363a314baca76674c19027dce19eed1590abd51c2d285830efd50 \ + --hash=sha256:9c7b9b6ba3d0f6e504be5978854966168fb95b17ce126eab9a6132fe15f3e540 \ + --hash=sha256:9e36ee7300584a53fd7ac5f3853323411bde1cf6c081921bd3754a73b4071245 \ + --hash=sha256:a279b136ed97407209d2dc9c30d1e65405d1a4a06ab162cedd9c4159b51f8f20 \ + --hash=sha256:a4a782f9ab26e662a890c1a7d865c452c83ed554de44aa83da35fa5bdcc79921 \ + --hash=sha256:ac4e037d276ce27069cad0083c4611b45232278bd2fbac33f06ef9438c171a1e \ + --hash=sha256:ae87e7b3e6414b3dd887adb72d2c4ea9f210c5f48efafd295ade4a58c760d29d \ + --hash=sha256:b0e70a5d294e4c8cf7dc94e015fca6d4913779a424937e66b429fba82d8eb5e2 \ + --hash=sha256:b705f01a531dba8fbbab90e30d432af4cc70a79c0a33b238e2c061816140cad0 \ + --hash=sha256:b8954fc72fdd49588c8b8d615eabc27dfd8eb6d0cffe987fc5df02934816fb19 \ + --hash=sha256:ba59516fcab4b621b80966a32f1195770696c113a948d00845f35b762e335db7 \ + --hash=sha256:bbe67d7ac416087996e39494325d94ef9f4ac1ed33823f90de83c73925665cd2 \ + --hash=sha256:bcdf74fe8a6e3b31bed1bc7d3e2a38cfbda3263d2750492ea0725dbc2db5aacf \ + --hash=sha256:bef8c5f8820c70e8761171409052056ffd247023b001a6254287a0694c3d8b1c \ + --hash=sha256:c09f15930910dd895ac113b16c0b3ac2051dcbd44b0f017f94cb51349ba11583 \ + --hash=sha256:c284642b229ba7b7b927fb044aba03694b880ab572db3f07a10adc786db1ff7b \ + --hash=sha256:c3cb92b3239e8094c2454a2160e45417490d4fce69cd09ac846a0c3e43360fb4 \ + --hash=sha256:c667cc9c4cd949814b4ba8be70632a6454637647f3feea2724e02d3d3e35c66d \ + --hash=sha256:c85ff5b000eef8a280333ca158483a76f86bd374816add5c016a9f4294471289 \ + --hash=sha256:cafe209d064a6efb88cb45a03e97981ff8832802b2b5d009dde0197a3b7b41c8 \ + --hash=sha256:cc711e639a3e978978ab3bbb01f8f106715f5c23bbd99ced5af2404528bbaa6c \ + --hash=sha256:ce48dbf74e8ec618d74cbaffe1159a4c32a4428de598f0ccdb0782bae618a72a \ + --hash=sha256:d4289e209e805d7d276a534f062092974fbe6814889d4c132c247205ebb49a65 \ + --hash=sha256:d63adfa4be8f9dbac4be6b359e2a8eb15a733545ef613d02a12ae27a4d40e975 \ + --hash=sha256:dd3a8fcee7d8a23e44781144830dee97b53ca4e0380bdd2a0e05b13913ce5725 \ + --hash=sha256:df807e7f036c19235320b6b5137291891d660f10ccb0b50dc46bc8385be18379 \ + --hash=sha256:e03a3bdd844e20a611518f7532e951c63d25bb27ccae7d7eb02100542540c14f \ + --hash=sha256:e5e6208cd0ce0562887925850d22bffd85aa6d5709f6890d3cdac8668e5aefb9 \ + --hash=sha256:e9f643bd97374aeb7e4274e5c361277bf1428e8e55246cee6823fa3525dc2c04 \ + --hash=sha256:eadfb2ec0948a791846f7cc411c18ff5bd8359e8102cf78d39b8a28bd98b7c6a \ + --hash=sha256:ecb5101325e0254694e55d46ff936926296626bf81c902b60328ead152170bfd \ + --hash=sha256:ecf44731e351c6100885120cecf53a0f43a1bb975a92480de1f9e022ab542bc1 \ + --hash=sha256:f215ec9237d5f8e96d0205be6e2141292c20b133343c2153b6d4934f523ef422 \ + --hash=sha256:f523d34ad72b811be61e5027a046ad4670b54fc3c6384056f06b59f77d671af0 \ + --hash=sha256:f5916010de8b6045d7c63d98bb3f7a1e13f8c9c1046e859f2fd8de79c4e2d865 \ + --hash=sha256:f599401675bdcac21176ca385ea3139fc04c1f8e26724dc59f4fc9df1d1528ef \ + --hash=sha256:f5df0503093ec8c3c7e1da53920e79c62ab653b51b136c4736caa252552a8732 \ + --hash=sha256:f5f1d7e0d57cd75febd70c6fc26c2ea06024ab2006011abb3094b9fea54801ee \ + --hash=sha256:f61345393548bc72844d837d62fcf63444b0f5dac418544beb6d4f628a1c5df3 \ + --hash=sha256:f7bd9f7a369a2914102c375d98998c97d669306372732c850dd8319d5a92f515 \ + --hash=sha256:f7de4da27fa4481e8a7a4ef58c908ffd2b996847c3d7fbf27b5c53ce0984c408 \ + --hash=sha256:f85b4d87273e0ec63568433bbb8ccf160b548c49b53576fe010bad9f698b8586 \ + --hash=sha256:f92f6ded50c0ae7b0fed612be77c5345ed4a4578f99b98c7f8258d0e599eff16 \ + --hash=sha256:f9a49d8103df362272c625641a4f7b104ae584db21d0f1eec3b7a5d0d7750ed8 \ + --hash=sha256:fbd9ceb8c091c125e5892757e4d16af06674dc96edd7b5bf1e627b1ae7650c66 + # via mutmut +textual==8.2.8 \ + --hash=sha256:267375fd402dc8d981457212efa71f0e3365fd17bba144ba9bb3ed7563cb374a \ + --hash=sha256:3f106a9fbc73e39dd266c9712432087de78a6d644084c7c241d6a25c3169115b + # via mutmut +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via textual diff --git a/tests/mutation/run_identity.py b/tests/mutation/run_identity.py new file mode 100644 index 00000000000..5de1e231a89 --- /dev/null +++ b/tests/mutation/run_identity.py @@ -0,0 +1,107 @@ +"""Stage one unchanged module and report the bounded mutation pilot.""" + +from __future__ import annotations + +import hashlib +import json +import os +import shutil +import signal +import subprocess +import sys +import tempfile +from pathlib import Path + + +def _run_mutations(command: list[str], stage: Path) -> int: + process = subprocess.Popen(command, cwd=stage, start_new_session=True) + try: + return process.wait(timeout=120) + finally: + # The private group contains only this pilot and its forked workers. + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait(timeout=10) + + +def main() -> None: + root = Path(__file__).resolve().parents[2] + source_paths = [ + "server/__init__.py", + "server/core/__init__.py", + "server/core/embedding_space.py", + "tests/__init__.py", + "tests/fuzz/__init__.py", + "tests/fuzz/embedding_identity_oracle.py", + "tests/mutation/test_embedding_identity.py", + ] + with tempfile.TemporaryDirectory(prefix="loom-identity-mutation-") as directory: + stage = Path(directory) + for name in source_paths: + target = stage / name + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(root / name, target) + assert ( + hashlib.sha256(target.read_bytes()).digest() + == hashlib.sha256((root / name).read_bytes()).digest() + ) + shutil.copyfile(root / "tests/mutation/pyproject.toml", stage / "pyproject.toml") + command = [ + sys.executable, + "-m", + "mutmut", + "run", + "*public_identity*", + "--max-children", + "2", + ] + result = _run_mutations(command, stage) + if result: + raise SystemExit(result) + report = subprocess.run( + [sys.executable, "-m", "mutmut", "results", "--all", "true"], + cwd=stage, + text=True, + stdout=subprocess.PIPE, + check=True, + timeout=20, + ) + selected = [] + for line in report.stdout.splitlines(): + if "public_identity" not in line: + continue + name, status = line.strip().rsplit(": ", 1) + if status != "not checked": + selected.append({"name": name, "status": status}) + assert selected and any(row["status"] == "killed" for row in selected), ( + "No tested public-identity mutants" + ) + output = {"target": "server.core.embedding_space.public_identity", "mutants": selected} + actionable = sum(row["status"] not in {"killed", "skipped"} for row in selected) + if os.environ.get("GITHUB_OUTPUT"): + with open(os.environ["GITHUB_OUTPUT"], "a") as stream: + stream.write(f"review_count={actionable}\n") + destination = Path(os.environ["IDENTITY_MUTATION_REPORT"]) + destination.write_text(json.dumps(output, indent=2) + "\n") + summary = os.environ.get("GITHUB_STEP_SUMMARY") + if summary: + counts = { + status: sum(row["status"] == status for row in selected) + for status in sorted({row["status"] for row in selected}) + } + with open(summary, "a") as stream: + stream.write( + "Endpoint-identity mutation pilot: " + + json.dumps(counts, sort_keys=True) + + ".\n" + ) + stream.write( + "Survivors require review for a missing assertion or an equivalent mutation; this is not a vulnerability or whole-module coverage claim.\n" + ) + print(json.dumps(output, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/tests/mutation/test_embedding_identity.py b/tests/mutation/test_embedding_identity.py new file mode 100644 index 00000000000..1ea67e3f5a6 --- /dev/null +++ b/tests/mutation/test_embedding_identity.py @@ -0,0 +1,56 @@ +"""Independent endpoint-identity cases used by the narrow mutation pilot.""" + +from __future__ import annotations + +from unittest import TestCase +from urllib.parse import parse_qsl + +from server.core import embedding_space +from tests.fuzz.embedding_identity_oracle import check_input, configuration + + +class PublicEndpointIdentity(TestCase): + def test_generated_byte_cases_obey_the_public_contract(self) -> None: + for value in range(256): + check_input(bytes([value])) + + def test_empty_endpoint_keeps_the_other_identity_fields(self) -> None: + self.assertEqual( + embedding_space.public_identity(configuration("")), + ("custom", "synthetic-model", 16, "", True), + ) + + def test_credentials_unknown_query_and_fragment_are_removed(self) -> None: + url = "HTTPS://person:secret@EXAMPLE.INVALID:443/v1///?MODEL=x&api-version=1&password=private#secret" + expected = "https://example.invalid:443/v1?MODEL=x&api-version=1" + self.assertEqual(embedding_space.public_identity(configuration(url))[3], expected) + + def test_allowed_query_names_and_duplicate_values_remain_distinct(self) -> None: + url = "https://example.invalid/?model=a&model=b&api_version=v&deployment=d&dimensions=16" + public = embedding_space.public_identity(configuration(url))[3] + self.assertEqual( + parse_qsl(public.split("?", 1)[1]), + [ + ("model", "a"), + ("model", "b"), + ("api_version", "v"), + ("deployment", "d"), + ("dimensions", "16"), + ], + ) + + def test_ipv6_authority_retains_brackets_and_port(self) -> None: + url = "https://user:secret@[2001:db8::1]:443/v1/#fragment" + self.assertEqual( + embedding_space.public_identity(configuration(url))[3], "https://[2001:db8::1]:443/v1" + ) + + def test_malformed_bracket_refuses_instead_of_publishing(self) -> None: + with self.assertRaises(ValueError): + embedding_space.public_identity(configuration("https://[invalid/")) + + +if __name__ == "__main__": + import unittest + + unittest.main() From a5db6c20b073c22ddd87d696e36e87e0753f01d7 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 19:58:53 +0000 Subject: [PATCH 2/9] Fuzzing uses standalone execution without remote artifact storage Signed-off-by: zlareb1 --- .github/workflows/identity-testing.yml | 45 ++++++++++++++++++++------ tests/fuzz/README.md | 5 ++- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/identity-testing.yml b/.github/workflows/identity-testing.yml index 26166a5c7af..82408dcd8ba 100644 --- a/.github/workflows/identity-testing.yml +++ b/.github/workflows/identity-testing.yml @@ -75,9 +75,6 @@ jobs: name: Endpoint identity coverage-guided fuzzing runs-on: ubuntu-24.04 timeout-minutes: 15 - permissions: - contents: read - actions: read # The fuzzing runner reads its own build and crash metadata. steps: - name: Check out only the parser and fuzz build inputs uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -92,27 +89,36 @@ jobs: /tests/fuzz/ /.clusterfuzzlite/ - name: Build the one parser fuzzer + id: build uses: docker://gcr.io/oss-fuzz-base/clusterfuzzlite-build-fuzzers@sha256:c531ed554dbd3ed24e2bd11570a0e2dfb042146806236cdfd2d7d0d648b6c473 env: LANGUAGE: python SANITIZER: address - GITHUB_TOKEN: ${{ github.token }} - PROJECT_SRC_PATH: ${{ github.workspace }} + PROJECT_SRC_PATH: /github/workspace KEEP_UNAFFECTED_FUZZ_TARGETS: "true" UPLOAD_BUILD: "false" BAD_BUILD_CHECK: "true" ALLOWED_BROKEN_TARGETS_PERCENTAGE: "0" DRY_RUN: "false" - CFL_PLATFORM: github + CFL_PLATFORM: standalone + WORKSPACE: /github/workspace + FILESTORE: no_filestore + FILESTORE_ROOT_DIR: /github/workspace/out/ephemeral + NO_CLUSTERFUZZ_DEPLOYMENT: "true" + REPOSITORY: loom LOW_DISK_SPACE: "True" + - name: Require the one built target + run: | + test -x build-out/embedding_identity + test -s build-out/embedding_identity.pkg - name: Fuzz the parser within the selected time budget + id: fuzz uses: docker://gcr.io/oss-fuzz-base/clusterfuzzlite-run-fuzzers@sha256:ec2a38a69babe087df3025a6babcb2a5a3675811a5cf4bfba23cece85c10e8d1 env: LANGUAGE: python SANITIZER: address - GITHUB_TOKEN: ${{ github.token }} FUZZ_SECONDS: ${{ github.event_name == 'pull_request' && 30 || 180 }} - MODE: code-change + MODE: batch PARALLEL_FUZZING: "false" OUTPUT_SARIF: "true" REPORT_TIMEOUTS: "true" @@ -120,8 +126,29 @@ jobs: REPORT_UNREPRODUCIBLE_CRASHES: "false" MINIMIZE_CRASHES: "false" DRY_RUN: "false" - CFL_PLATFORM: github + CFL_PLATFORM: standalone + WORKSPACE: /github/workspace + FILESTORE: no_filestore + FILESTORE_ROOT_DIR: /github/workspace/out/ephemeral + NO_CLUSTERFUZZ_DEPLOYMENT: "true" + REPOSITORY: loom LOW_DISK_SPACE: "True" + - name: Report the bounded native probe outcome + if: always() + env: + BUILD_OUTCOME: ${{ steps.build.outcome }} + FUZZ_OUTCOME: ${{ steps.fuzz.outcome }} + run: | + python3 - <<'PY' + import os + allowed = {"success", "failure", "cancelled", "skipped"} + build, fuzz = os.environ["BUILD_OUTCOME"], os.environ["FUZZ_OUTCOME"] + assert build in allowed and fuzz in allowed + text = f"Endpoint identity target: build={build}, bounded fuzzing={fuzz}. Inspect the native log for executed inputs and replay records." + print("::notice title=Endpoint identity probe::" + text) + with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as output: + output.write(text + "\n") + PY maintenance: name: Record trusted probe maintenance diff --git a/tests/fuzz/README.md b/tests/fuzz/README.md index d37bb2cd2c8..7fc3a935acd 100644 --- a/tests/fuzz/README.md +++ b/tests/fuzz/README.md @@ -25,7 +25,10 @@ The hosted workflow replays the corpus and runs the fixed cases. Its coverage-gu job uses the Python engine through the continuous-fuzzing runner, one target, one worker and explicit time, input, memory and per-input limits. The image, engine and executor references are pinned; engine selection matches the image's Python ABI. -Crashes fail the job and retain the runner's replay evidence. Review any real +Crashes fail the job and leave the runner's replay record in the job log. The supported +standalone/no-filestore mode makes no artifact, corpus, build or cloud upload. +Stateless batch runs start from the checked-in seeds without a differential-build +claim or persistent corpus that needs pruning. Review any real security finding through the private route in [SECURITY.md](../../SECURITY.md), without pasting inputs into public issues. The build packages only the named standard-library module and these probes; no Loom service or provider is started. From e402fc2bb58f869ad20a0f8abb0e102466b6da46 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 20:06:47 +0000 Subject: [PATCH 3/9] The parser pilot installs Python without a cache backend Signed-off-by: zlareb1 --- .github/workflows/identity-testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/identity-testing.yml b/.github/workflows/identity-testing.yml index 82408dcd8ba..12c49c5b938 100644 --- a/.github/workflows/identity-testing.yml +++ b/.github/workflows/identity-testing.yml @@ -56,7 +56,6 @@ jobs: uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: "3.12" - cache: false - name: Create a disposable test environment run: | python3 -m venv "$RUNNER_TEMP/identity-venv" From 4e732e3580c23f4590ab7159e7a702ddc32497e1 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 20:10:10 +0000 Subject: [PATCH 4/9] The parser pilot checks out its own publisher input Include the workflow read by the report controls in the explicit native input set. Signed-off-by: zlareb1 --- .github/workflows/identity-testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/identity-testing.yml b/.github/workflows/identity-testing.yml index 12c49c5b938..4c2138a2ef4 100644 --- a/.github/workflows/identity-testing.yml +++ b/.github/workflows/identity-testing.yml @@ -52,6 +52,7 @@ jobs: /tests/__init__.py /tests/fuzz/ /tests/mutation/ + /.github/workflows/identity-testing.yml - name: Install the selected Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: From 26936a2abf99d8cad1ce85b9403a7c810e7ffee1 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 20:14:33 +0000 Subject: [PATCH 5/9] The mutation pilot copies its staged test directory as a unit Create the destination parents through the existing directory-copy helper before collecting the tests. Signed-off-by: zlareb1 --- tests/mutation/pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/mutation/pyproject.toml b/tests/mutation/pyproject.toml index 5eb0ee3c3a5..2d152c239c0 100644 --- a/tests/mutation/pyproject.toml +++ b/tests/mutation/pyproject.toml @@ -5,8 +5,6 @@ pytest_add_cli_args_test_selection = [ ] also_copy = [ "server/__init__.py", - "tests/__init__.py", - "tests/fuzz/", - "tests/mutation/", + "tests/", ] max_stack_depth = 8 From 2ef3f213e4af856cda130e9f35b4c697aa7c9da2 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 20:31:20 +0000 Subject: [PATCH 6/9] The mutation pilot reports bounded survivor diffs for review Signed-off-by: zlareb1 --- tests/mutation/run_identity.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/mutation/run_identity.py b/tests/mutation/run_identity.py index 5de1e231a89..03281e61718 100644 --- a/tests/mutation/run_identity.py +++ b/tests/mutation/run_identity.py @@ -78,6 +78,18 @@ def main() -> None: assert selected and any(row["status"] == "killed" for row in selected), ( "No tested public-identity mutants" ) + for row in selected: + if row["status"] == "survived": + diff = subprocess.run( + [sys.executable, "-m", "mutmut", "show", row["name"]], + cwd=stage, + text=True, + stdout=subprocess.PIPE, + check=True, + timeout=10, + ).stdout + assert len(diff.encode()) <= 32768, "Survivor diff exceeds report budget" + row["diff"] = diff output = {"target": "server.core.embedding_space.public_identity", "mutants": selected} actionable = sum(row["status"] not in {"killed", "skipped"} for row in selected) if os.environ.get("GITHUB_OUTPUT"): From 22e8478d0c24c4ad491cd939d63b10a85ff3acac Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 20:43:06 +0000 Subject: [PATCH 7/9] Check ambiguous authorities and meaningful path suffixes Keep raw mutation outcomes and require exact source, tool and diff evidence for reviewed output equivalence. Signed-off-by: zlareb1 --- .github/workflows/identity-testing.yml | 2 +- .../embedding_identity/multiple-userinfo | 1 + .../corpus/embedding_identity/uppercase-path | 1 + tests/fuzz/embedding_identity_oracle.py | 6 +- tests/mutation/equivalents.json | 16 ++++ tests/mutation/run_identity.py | 85 ++++++++++++++----- tests/mutation/test_embedding_identity.py | 14 +++ tests/mutation/test_equivalence.py | 51 +++++++++++ 8 files changed, 150 insertions(+), 26 deletions(-) create mode 100644 tests/fuzz/corpus/embedding_identity/multiple-userinfo create mode 100644 tests/fuzz/corpus/embedding_identity/uppercase-path create mode 100644 tests/mutation/equivalents.json create mode 100644 tests/mutation/test_equivalence.py diff --git a/.github/workflows/identity-testing.yml b/.github/workflows/identity-testing.yml index 4c2138a2ef4..9f31cc0de08 100644 --- a/.github/workflows/identity-testing.yml +++ b/.github/workflows/identity-testing.yml @@ -64,7 +64,7 @@ jobs: - name: Replay the corpus and deterministic public-identity cases run: | "$RUNNER_TEMP/identity-venv/bin/python" -m tests.fuzz.embedding_identity_fuzzer --replay tests/fuzz/corpus/embedding_identity - "$RUNNER_TEMP/identity-venv/bin/python" -m unittest tests.mutation.test_embedding_identity tests.fuzz.test_probe_publisher + "$RUNNER_TEMP/identity-venv/bin/python" -m unittest tests.mutation.test_embedding_identity tests.mutation.test_equivalence tests.fuzz.test_probe_publisher - name: Mutate only the public-identity function id: mutation env: diff --git a/tests/fuzz/corpus/embedding_identity/multiple-userinfo b/tests/fuzz/corpus/embedding_identity/multiple-userinfo new file mode 100644 index 00000000000..7e79e01f55b --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/multiple-userinfo @@ -0,0 +1 @@ +https://first:synthetic@alias@example.invalid/v1/?model=m \ No newline at end of file diff --git a/tests/fuzz/corpus/embedding_identity/uppercase-path b/tests/fuzz/corpus/embedding_identity/uppercase-path new file mode 100644 index 00000000000..286150209ce --- /dev/null +++ b/tests/fuzz/corpus/embedding_identity/uppercase-path @@ -0,0 +1 @@ +https://example.invalid/pathX///?model=m \ No newline at end of file diff --git a/tests/fuzz/embedding_identity_oracle.py b/tests/fuzz/embedding_identity_oracle.py index 09bf8402f8f..3826e686c31 100644 --- a/tests/fuzz/embedding_identity_oracle.py +++ b/tests/fuzz/embedding_identity_oracle.py @@ -37,7 +37,7 @@ def check_input(data: bytes) -> None: # A structured branch guarantees useful accepted cases even with malformed raw bytes. credential = data.hex() url = ( - f"HTTPS://user{credential}:pass{credential}@EXAMPLE.INVALID:443/v1///" + f"HTTPS://user{credential}:pass{credential}@EXAMPLE.INVALID:443/v1X///" f"?api-version=v1&credential={credential}&MODEL=m#fragment{credential}" ) public = embedding_space.public_identity(configuration(url)) @@ -45,11 +45,13 @@ def check_input(data: bytes) -> None: "custom", "synthetic-model", 16, - "https://example.invalid:443/v1?api-version=v1&MODEL=m", + "https://example.invalid:443/v1X?api-version=v1&MODEL=m", True, ) assert public == expected rotated = url.replace(f"user{credential}:pass{credential}@", "rotated:replacement@") assert embedding_space.public_identity(configuration(rotated)) == public + ambiguous = url.replace(f"user{credential}:pass{credential}@", "first:synthetic@alias@") + assert embedding_space.public_identity(configuration(ambiguous)) == public changed_space = url.replace("MODEL=m#", "MODEL=n#") assert embedding_space.public_identity(configuration(changed_space)) != public diff --git a/tests/mutation/equivalents.json b/tests/mutation/equivalents.json new file mode 100644 index 00000000000..41e550e5767 --- /dev/null +++ b/tests/mutation/equivalents.json @@ -0,0 +1,16 @@ +{ + "source_sha256": "ba3279c2f9b0505d2249c6ee56b70e9731377aead1d049d6742b3b16c1e52f43", + "mutmut_version": "3.8.1", + "equivalents": [ + { + "name": "server.core.embedding_space.x_public_identity__mutmut_10", + "diff_sha256": "546944d80ac61aa7505607a1d51563b8cb2dee96565772c842d76adbad670318", + "reason": "For any string, the final chunk of rsplit at an at-sign is the suffix after the final at-sign whenever the split bound is positive or omitted. The returned identity is therefore unchanged for this target's bounded generated inputs. This does not classify unbounded allocation behavior." + }, + { + "name": "server.core.embedding_space.x_public_identity__mutmut_13", + "diff_sha256": "6afa6ccd42e763e7c6ed8159e1ee6fcb456b2971ed296ee92d0109bad1dc2e29", + "reason": "For any string, the final chunk of rsplit at an at-sign is the suffix after the final at-sign whenever the split bound is positive or omitted. The returned identity is therefore unchanged for this target's bounded generated inputs. This does not classify unbounded allocation behavior." + } + ] +} diff --git a/tests/mutation/run_identity.py b/tests/mutation/run_identity.py index 03281e61718..2e5f06b18d0 100644 --- a/tests/mutation/run_identity.py +++ b/tests/mutation/run_identity.py @@ -10,6 +10,7 @@ import subprocess import sys import tempfile +from importlib.metadata import version from pathlib import Path @@ -26,6 +27,22 @@ def _run_mutations(command: list[str], stage: Path) -> int: process.wait(timeout=10) +def _mark_reviewed_equivalents(rows, source_sha: str, tool_version: str, evidence) -> None: + if evidence["source_sha256"] != source_sha or evidence["mutmut_version"] != tool_version: + return + reviewed = {row["name"]: row for row in evidence["equivalents"]} + for row in rows: + if row["status"] != "survived" or row["name"] not in reviewed: + continue + entry = reviewed[row["name"]] + if hashlib.sha256(row["diff"].encode()).hexdigest() != entry["diff_sha256"]: + continue + if not isinstance(entry["reason"], str) or not entry["reason"].strip(): + raise ValueError("An equivalent outcome requires its reviewed reason") + row["disposition"] = "reviewed-output-equivalent" + row["reason"] = entry["reason"] + + def main() -> None: root = Path(__file__).resolve().parents[2] source_paths = [ @@ -90,29 +107,51 @@ def main() -> None: ).stdout assert len(diff.encode()) <= 32768, "Survivor diff exceeds report budget" row["diff"] = diff - output = {"target": "server.core.embedding_space.public_identity", "mutants": selected} - actionable = sum(row["status"] not in {"killed", "skipped"} for row in selected) - if os.environ.get("GITHUB_OUTPUT"): - with open(os.environ["GITHUB_OUTPUT"], "a") as stream: - stream.write(f"review_count={actionable}\n") - destination = Path(os.environ["IDENTITY_MUTATION_REPORT"]) - destination.write_text(json.dumps(output, indent=2) + "\n") - summary = os.environ.get("GITHUB_STEP_SUMMARY") - if summary: - counts = { - status: sum(row["status"] == status for row in selected) - for status in sorted({row["status"] for row in selected}) - } - with open(summary, "a") as stream: - stream.write( - "Endpoint-identity mutation pilot: " - + json.dumps(counts, sort_keys=True) - + ".\n" - ) - stream.write( - "Survivors require review for a missing assertion or an equivalent mutation; this is not a vulnerability or whole-module coverage claim.\n" - ) - print(json.dumps(output, indent=2)) + source_sha = hashlib.sha256( + (root / "server/core/embedding_space.py").read_bytes() + ).hexdigest() + evidence = json.loads((root / "tests/mutation/equivalents.json").read_text()) + _mark_reviewed_equivalents(selected, source_sha, version("mutmut"), evidence) + _publish_report(selected, source_sha) + + +def _publish_report(selected, source_sha: str) -> None: + equivalent_count = sum( + row.get("disposition") == "reviewed-output-equivalent" for row in selected + ) + output = { + "target": "server.core.embedding_space.public_identity", + "source_sha256": source_sha, + "reviewed_output_equivalents": equivalent_count, + "mutants": selected, + } + actionable = sum( + row["status"] not in {"killed", "skipped"} + and row.get("disposition") != "reviewed-output-equivalent" + for row in selected + ) + if os.environ.get("GITHUB_OUTPUT"): + with open(os.environ["GITHUB_OUTPUT"], "a") as stream: + stream.write(f"review_count={actionable}\n") + destination = Path(os.environ["IDENTITY_MUTATION_REPORT"]) + destination.write_text(json.dumps(output, indent=2) + "\n") + summary = os.environ.get("GITHUB_STEP_SUMMARY") + if summary: + counts = { + status: sum(row["status"] == status for row in selected) + for status in sorted({row["status"] for row in selected}) + } + with open(summary, "a") as stream: + stream.write( + "Endpoint-identity mutation pilot: " + json.dumps(counts, sort_keys=True) + ".\n" + ) + stream.write( + f"Reviewed output-equivalent outcomes: {equivalent_count}; outcomes needing review: {actionable}. Raw statuses remain in the report.\n" + ) + stream.write( + "Survivors require review for a missing assertion or an equivalent mutation; this is not a vulnerability or whole-module coverage claim.\n" + ) + print(json.dumps(output, indent=2)) if __name__ == "__main__": diff --git a/tests/mutation/test_embedding_identity.py b/tests/mutation/test_embedding_identity.py index 1ea67e3f5a6..739b4912dd3 100644 --- a/tests/mutation/test_embedding_identity.py +++ b/tests/mutation/test_embedding_identity.py @@ -49,6 +49,20 @@ def test_malformed_bracket_refuses_instead_of_publishing(self) -> None: with self.assertRaises(ValueError): embedding_space.public_identity(configuration("https://[invalid/")) + def test_every_userinfo_separator_before_the_final_host_is_removed(self) -> None: + url = "https://first:synthetic@alias@example.invalid/v1/?model=m" + self.assertEqual( + embedding_space.public_identity(configuration(url))[3], + "https://example.invalid/v1?model=m", + ) + + def test_a_meaningful_uppercase_path_suffix_is_preserved(self) -> None: + url = "https://example.invalid/pathX///?model=m" + self.assertEqual( + embedding_space.public_identity(configuration(url))[3], + "https://example.invalid/pathX?model=m", + ) + if __name__ == "__main__": import unittest diff --git a/tests/mutation/test_equivalence.py b/tests/mutation/test_equivalence.py new file mode 100644 index 00000000000..165c52b1d97 --- /dev/null +++ b/tests/mutation/test_equivalence.py @@ -0,0 +1,51 @@ +"""A reviewed output-equivalence claim requires exact current evidence.""" + +import hashlib +import unittest + +from tests.mutation.run_identity import _mark_reviewed_equivalents + + +class ReviewedEquivalence(unittest.TestCase): + def setUp(self) -> None: + self.source = hashlib.sha256(b"fixed source").hexdigest() + self.rows = [{"name": "fixed", "status": "survived", "diff": "exact diff"}] + self.evidence = { + "source_sha256": self.source, + "mutmut_version": "pinned", + "equivalents": [ + { + "name": "fixed", + "diff_sha256": hashlib.sha256(b"exact diff").hexdigest(), + "reason": "The changed split bound retains the same final suffix.", + } + ], + } + + def test_exact_evidence_retains_the_raw_survivor_and_adds_its_reason(self) -> None: + _mark_reviewed_equivalents(self.rows, self.source, "pinned", self.evidence) + self.assertEqual(self.rows[0]["status"], "survived") + self.assertEqual(self.rows[0]["disposition"], "reviewed-output-equivalent") + self.assertTrue(self.rows[0]["reason"]) + + def test_changed_source_or_tool_has_no_reviewed_classification(self) -> None: + for source, tool in [("changed", "pinned"), (self.source, "changed")]: + with self.subTest(source=source, tool=tool): + _mark_reviewed_equivalents(self.rows, source, tool, self.evidence) + self.assertNotIn("disposition", self.rows[0]) + + def test_changed_diff_and_unknown_name_remain_unreviewed(self) -> None: + for name, diff in [("fixed", "changed"), ("unknown", "exact diff")]: + with self.subTest(name=name, diff=diff): + rows = [{"name": name, "status": "survived", "diff": diff}] + _mark_reviewed_equivalents(rows, self.source, "pinned", self.evidence) + self.assertNotIn("disposition", rows[0]) + + def test_an_empty_reason_refuses_instead_of_hiding_the_outcome(self) -> None: + self.evidence["equivalents"][0]["reason"] = "" + with self.assertRaisesRegex(ValueError, "reviewed reason"): + _mark_reviewed_equivalents(self.rows, self.source, "pinned", self.evidence) + + +if __name__ == "__main__": + unittest.main() From 395cbd2986092b9e702ff287d1e4cc20feb5a502 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 20:53:57 +0000 Subject: [PATCH 8/9] Register identity probes in the test inventory Signed-off-by: zlareb1 --- tests/inventory/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/inventory/build.py b/tests/inventory/build.py index ddf4b13e436..2d41547a9d7 100644 --- a/tests/inventory/build.py +++ b/tests/inventory/build.py @@ -103,6 +103,8 @@ ) _WORKFLOW_PREFIXES: tuple[tuple[str, str], ...] = ( ("tests/inventory/", "suite"), + ("tests/fuzz/", "identity-testing"), + ("tests/mutation/", "identity-testing"), ("tests/analyzer/cases/", "analyzer-cases"), ("tests/analyzer/", "analyzer"), ("tests/code_lanes/", "code-lanes"), From a868639813e174002c50b7e522140189adb5e0e9 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Sun, 22 Nov 2026 22:19:47 +0000 Subject: [PATCH 9/9] Name the project in generated maintenance issues Signed-off-by: zlareb1 --- .github/workflows/identity-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/identity-testing.yml b/.github/workflows/identity-testing.yml index 9f31cc0de08..39d62384c24 100644 --- a/.github/workflows/identity-testing.yml +++ b/.github/workflows/identity-testing.yml @@ -223,7 +223,7 @@ jobs: issue = managed.get(key) if result not in {"success", "failure", "review"} or (issue and issue["state"] == "closed"): continue - text = f"\n\n\nThe bounded {key} probe reports **{result}** on trusted main. [Read the bounded probe logs and mutation summary]({url}).\n\nReproduce the named workflow job. A mutation survivor needs review for a missing assertion or equivalent mutation; it is not a vulnerability claim. No crash input or source excerpt is published here. Keep security-sensitive reports in the private route in SECURITY.md. Automation preserves edited bodies and closed decisions." + text = f"\n\n\n### Company or project name\n\nClickHouse\n\nThe bounded {key} probe reports **{result}** on trusted main. [Read the bounded probe logs and mutation summary]({url}).\n\nReproduce the named workflow job. A mutation survivor needs review for a missing assertion or equivalent mutation; it is not a vulnerability claim. No crash input or source excerpt is published here. Keep security-sensitive reports in the private route in SECURITY.md. Automation preserves edited bodies and closed decisions." if issue is None: if result in {"failure", "review"}: api("POST", repo, {"title": titles[key], "body": text})