Skip to content

fix: opentelemetry-api 1.45.2, mutation run past its stats phase, README badges, changelog and exception texts - #86

Merged
maksimtech merged 4 commits into
mainfrom
chore/stabilize
Nov 17, 2026
Merged

maksimtech merged 4 commits into
mainfrom
chore/stabilize

Conversation

@maksimtech

Copy link
Copy Markdown
Owner

Why

An audit on 2026-11-16 found five things wrong on main, none of them in src/patchradar or the Dockerfile:

  1. uv.lock pins opentelemetry-api 1.45.1, affected by CVE-2026-126360 / GHSA-mf5v-w3w3-f6cg (medium: quadratic-time traceparent parsing). It is transitive, through fastapi. 1.45.2 has been on PyPI since 2026-10-29. Dependabot alert feat: complete security hardening and test suite #2 was raised on 2026-11-14, and no pull request followed.
  2. Mutation testing (mutation.yml) has been red for four Saturdays (2026-10-24, 10-31, 11-07, 11-14). Each time it stopped in mutmut's stats phase on tests/test_sql_is_not_formatted.py::test_no_select_insert_update_or_delete_is_a_formatted_string, with assert [13226] == [].
  3. README, which is also the PyPI long description: a static calver-2026.8.2 badge, two months out of date, and a PyPI badge pasted into its own URL.
  4. CHANGELOG: ## [2026.40] has ### Changed twice; ## [2026.48] - 2026-10-23 uses a hyphen, and the tag is dated 2026-10-24.
  5. SECURITY-EXCEPTIONS.toml: the two CodeQL entries name stale lines in where.

What

  • fix(deps): uv lock --upgrade-package opentelemetry-api (uv 0.12.18). The lock diff is that one package entry: version, sdist and wheel. Nothing else moves.
  • fix(ci): under mutmut the package is imported from mutants/. There, database.py holds every mutant beside the code. Mutant x_get_cves__mutmut_6 drops the statement from db.execute(sql, params) and leaves the parameters first, (software.lower(),) * 4 + (limit,), which is a BinOp to the check: that is line 13226. The stats phase runs with -x, so the run stopped there. The next test in the same file would have failed too, with assert 44 == 2, because the listings' ORDER BY appears in every mutant of get_cves. Skipping the one test would only have moved the failure. All three checks now read the file the copy stands for, which is the same path without the mutants component. They are claims about what is written, and a mutant does not change that, so under mutmut they hold or fail exactly as in the ordinary run. This follows the repo's existing "mutants" in path.parts detection (test_collector_wiring.py, test_nis2_evidence.py); the difference is that these checks read the real file rather than skipping.
  • docs (README): one valid PyPI badge, pypi/v/patchradar?style=flat-square&label=pypi. The CalVer badge is now versioning-CalVer, with no number in it. The new tests/test_readme_badges.py checks both: no image URL that contains another image, and no static shields.io badge that carries a CalVer number.
  • docs (CHANGELOG, exceptions): the two ### Changed sections of 2026.40 are merged. 2026.48 now reads — 2026-10-24. The CodeQL where texts now say api/main.py:145 and ui_harness.js:73, which are the lines of open alerts chore(deps): bump actions/checkout from 5 to 7 #20 and chore(deps): bump aquasecurity/trivy-action from a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 to ed142fd0673e97e23eac54620cfb913e5ce36c25 #23. review_by is untouched.
  • A CHANGELOG.md entry under [Unreleased] for each change: Security for the lock, Fixed for the rest.

No version bump: nothing here touches src/patchradar or the Dockerfile, so tests/test_version_contract.py forbids one.

Dependabot: why no pull request for the alert

.github/dependabot.yml has no ignore. The 14-day cooldown does not apply to security updates. What it lacks is a uv entry. It declares pip at /, while the alert's manifest is uv.lock, and Dependabot handles uv.lock through its separate uv ecosystem, not through pip. Two observations support this:

  • The pip version-update job of 2026-11-12 ran with "package-manager":"pip" and "allowed-updates":[{"dependency-type":"direct"}], and its log never mentions uv.lock.
  • The Dependabot Updates workflow has no run after 2026-11-12, so no security-update job was ever started for opentelemetry-api after the alert of 2026-11-14.

So the likely cause is the missing uv ecosystem; a declared package-ecosystem: "uv" would let Dependabot open such pull requests. Neither dependabot.yml nor any repository setting is changed here; that is the owner's call. If it is added, tests/test_dependabot_config.py already requires the 14-day cooldown on every entry.

No lockfile-floor test was added: the repository has none to extend, and the brief was not to build new machinery for it.

Verification

  • TDD, red first:
    • test_under_mutmut_the_checks_read_the_repository_not_its_copy has mutmut's own mutate_file_contents build the copy of the real database.py in a tmp_path tree laid out like mutmut's. Before the fix it failed with assert [13226] == [], the same line as the CI failure.
    • tests/test_readme_badges.py failed on both badges before the README change.
  • mutmut run locally in WSL (Ubuntu 24.04, Python 3.12, mutmut run --max-children 2, mutmut 3.8.0, which refuses to run on Windows):
    • On main, the stats phase reproduces CI exactly: assert [13226] == [], 1 failed, 1869 passed, 34 skipped, failed to collect stats. Inside that mutants/ copy, the ORDER BY test fails on its own with assert 44 == 2.
    • With this branch, the stats phase passes and mutmut moves on to the mutants: 495 of 5421 tried (326 killed, 125 survived, 44 without tests) before I stopped it. A full run takes hours; Saturday's run will give the score.
  • Full suite on Windows (uv run --frozen --all-extras --all-groups pytest -q --ignore=tests/benchmarks): 2285 passed, 4 skipped. ruff check .: clean. uv lock --check: clean.
  • Both new badge URLs return 200 image/svg+xml from img.shields.io.
  • git diff --cached --summary was empty for every commit, so no file mode changed.

AI disclosure

The audit and this change were made with Claude Code. Each claim above was checked against the repository, the CI logs of the mutation runs, the Dependabot run logs and alert, and a local mutmut run.

🤖 Generated with Claude Code

maksimtech and others added 4 commits November 17, 2026 14:13
opentelemetry-api 1.45.1 parses a traceparent header in quadratic time
(CVE-2026-126360, GHSA-mf5v-w3w3-f6cg, medium). 1.45.2, on PyPI since
2026-10-29, is the release the advisory names as fixed. It arrives through
fastapi, so `uv lock --upgrade-package opentelemetry-api` (uv 0.12.18) moved
that one entry and nothing else in the lock.

Dependabot raised the alert on 2026-11-14 and opened no pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The weekly mutation run has been red since 2026-10-24, in its stats phase,
on `assert [13226] == []` in tests/test_sql_is_not_formatted.py. mutmut
runs the suite from `mutants/`, where database.py holds every mutant beside
the code. Mutant x_get_cves__mutmut_6 drops the statement from
`db.execute(sql, params)` and leaves the parameters, a tuple built with `*`
and `+`, where the check expects the statement. The stats phase runs with
`-x`, so it stopped there; the next test of the file would have failed too,
on `assert 44 == 2`: the listings' ORDER BY is repeated in every mutant of
get_cves. Skipping the one test would have moved the failure, not removed it.

The three checks now read the file the copy stands for, the same path
without the `mutants` component. They are claims about what is written,
which a mutant does not change, so under mutmut they hold or fail exactly
as they do in the ordinary run.

The new test has mutmut's own mutate_file_contents build the copy of the
real database.py in a tmp tree laid out as mutmut lays out its own. Before
the fix it failed with `assert [13226] == []`, the line of the CI failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README is also the long description on PyPI. The flat-square PyPI badge
had been pasted into its own URL and rendered as a broken image; it is one
badge again, with label=pypi as a query parameter. The static
`calver-2026.8.2` badge named a release two months old; it now says the
project uses CalVer and leaves the number to the PyPI badges.

tests/test_readme_badges.py failed on both before the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHANGELOG: 2026.40 had two `### Changed` sections, now merged into one;
2026.48 was dated 2026-10-23 with a hyphen, and is now dated 2026-10-24,
the date of its tag, with the em dash every other release uses.

SECURITY-EXCEPTIONS.toml: the two CodeQL entries named api/main.py:69 and
ui_harness.js:45 in `where`; the open alerts are at lines 145 and 73, the
same warning and the same setter. Text only: the gate matches an exception
by rule and path, and review_by is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Nov 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 11 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 17 untouched benchmarks


Comparing chore/stabilize (b373d83) with main (13f7fd9)

Open in CodSpeed

@maksimtech
maksimtech merged commit b692117 into main Nov 17, 2026
23 checks passed
@maksimtech
maksimtech deleted the chore/stabilize branch November 17, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant