Skip to content

Release 0.4.0, and cut releases from a gated workflow - #55

Merged
404SecNotFound merged 1 commit into
mainfrom
claude/compassionate-meitner-nzp6tq
Oct 8, 2026
Merged

404SecNotFound merged 1 commit into
mainfrom
claude/compassionate-meitner-nzp6tq

Conversation

@404SecNotFound

Copy link
Copy Markdown
Owner

What this changes, and why

This PR prepares release 0.4.0 and adds the workflow that will cut it.

The release

  • pyproject.toml, src/cohaera/__init__.py and CITATION.cff now say 0.4.0.
  • The [Unreleased] notes become the [0.4.0] — 2026-10-08 section, with a fresh empty [Unreleased] above it.
  • The new section opens with what the release measures. False positives are 420.4 per 1,000 benign sessions and precision at 0.1% prevalence is 0.238%, both unchanged from 0.3.0. There are 29 catalogued evasions, of which 27 still work (14 open, 13 half closed). The external result is 375 StepShield attack sessions with zero detections.
  • It states the schema this release emits: still cohaera:0.3, because every change to the verdict is an added field or an added reason code.
  • It carries upgrade notes for the three behaviour changes an operator will notice.

.github/workflows/release.yml

  • It is started by workflow_dispatch on main with a version input. It never runs on a tag push, because it creates the tag itself.
  • The build job runs tools/release_gate.py --tag vX.Y.Z and refuses if the tag already exists. It builds with SOURCE_DATE_EPOCH, writes SHA256SUMS, and installs the wheel into a clean venv to check the version, that there are no dependencies, and that cohaera --help runs.
  • The github-release job has contents: write only. It creates the tag at the gated commit and a pre-release whose notes are that version's CHANGELOG section verbatim, with the wheel, the sdist and SHA256SUMS attached.
  • The pypi job has id-token: write only and runs in a pypi environment. It publishes by trusted publishing, so no PyPI token exists anywhere.
  • All actions are pinned to commit SHAs with version comments. download-artifact is pinned at v7.0.0 to match the existing upload-artifact v7. pypa/gh-action-pypi-publish is pinned at v1.14.2. Both SHAs were resolved by git ls-remote.

Why dispatch: docs/OUTSTANDING.md records that v0.3.0 was never tagged, because tag pushes from automation are refused by the egress proxy. A workflow that gates first and then tags also cannot leave a published tag that the gate later refuses.

Evidence

  • The defect was reproduced first, and the test that reproduces it is in this change. Not applicable as a defect; this is a release. New tests in tests/test_ci_config.py pin the release workflow:
    • it triggers on dispatch only, and only from main;
    • it runs the gate against the tag it is about to create, and builds reproducibly;
    • write permissions are per job and minimal, the PyPI job runs in the pypi environment, and it runs only after the GitHub release.
  • I mutated the fix and the test failed. Not applicable; the shape tests above are assertions on a static file.
  • python -m pytest tests/ -q passes: 1556 passed, 18 skipped.
  • python tests/test_evasion.py passes: 29 constructed evasions, 14 working, 13 half closed, 2 closed.
  • ruff check src tests eval tools lab demo passes. mypy passes.
  • python tools/readme_facts.py --check passes. python tools/release_gate.py --tag v0.4.0 passes.

The build and wheel-verification steps were dry-run locally. They produce cohaera-0.4.0-py3-none-any.whl and cohaera-0.4.0.tar.gz, the installed version reads 0.4.0, the wheel pulls in no dependencies, and cohaera --help runs. The awk notes extraction was run against this CHANGELOG and returns the 0.4.0 section. The workflow itself cannot run until this merges.

If this changes detection

  • python eval/run_eval.py re-run and the card regenerated. The only change is detector version 0.3.0 → 0.4.0. The local and CH06 labs were regenerated; the changed fields are detector_version, analysis_run_id and verdict_id, all of which derive from the version.
  • Recall and false-positive rate, before → after: unchanged.

If this changes an evasion

Not applicable.

Anything a reviewer should push back on

  • One-time setup needed before the first run:

    1. On pypi.org, add a pending trusted publisher for cohaera with owner 404SecNotFound, repository Cohaera, workflow release.yml and environment pypi. The name is free on PyPI; the JSON API returns 404 for it.
    2. In this repository's settings, create an environment named pypi. Adding yourself as a required reviewer is recommended, because the upload is the step that cannot be undone.

    Until both are done, the pypi job fails. The tag and the GitHub release are still created.

  • The GitHub release is marked as a pre-release, matching the project's own "pre-alpha" label.

  • test_required_checks_match_the_ci_jobs_exactly now counts only workflows triggered by pull_request, because a dispatched workflow reports nothing on a PR and cannot be a required check.

  • v0.3.0 stays untagged. Its CHANGELOG link definition still points at a release that does not exist, as it already did.

🤖 Generated with Claude Code

https://claude.ai/code/session_01As5wcUhETPg1K3ceCVrWew


Generated by Claude Code

Version 0.4.0 in pyproject, the package and CITATION.cff; the Unreleased
notes become the 0.4.0 section with the measured numbers stated first (420.4
false positives per 1,000 benign sessions, unchanged), the schema the
release emits (still cohaera:0.3; every verdict change is additive) and the
upgrade notes. The labs and the evaluation card are regenerated for the
version, which changes detector_version and the ids derived from it and
nothing else.

.github/workflows/release.yml cuts a release by dispatch on main: it runs
the release gate against the tag it is about to create, refuses an existing
tag, builds reproducibly, verifies the wheel installs with no dependencies,
then creates the tag and a GitHub release carrying the wheel, sdist and
SHA256SUMS, and publishes to PyPI by trusted publishing behind a `pypi`
environment. Write permissions are per job. v0.3.0 was never tagged because
tag pushes from automation are refused, which is why the tag is now created
by the run that gated it.

The required-check test now counts only workflows that run on pull
requests, since a dispatched workflow cannot gate one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01As5wcUhETPg1K3ceCVrWew
@404SecNotFound
404SecNotFound merged commit 8e61845 into main Oct 8, 2026
11 checks passed
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.

2 participants