Repository navigation
Release 0.4.0, and cut releases from a gated workflow - #55
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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__.pyandCITATION.cffnow say 0.4.0.[Unreleased]notes become the[0.4.0] — 2026-10-08section, with a fresh empty[Unreleased]above it.cohaera:0.3, because every change to the verdict is an added field or an added reason code..github/workflows/release.ymlworkflow_dispatchonmainwith a version input. It never runs on a tag push, because it creates the tag itself.buildjob runstools/release_gate.py --tag vX.Y.Zand refuses if the tag already exists. It builds withSOURCE_DATE_EPOCH, writesSHA256SUMS, and installs the wheel into a clean venv to check the version, that there are no dependencies, and thatcohaera --helpruns.github-releasejob hascontents: writeonly. 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 andSHA256SUMSattached.pypijob hasid-token: writeonly and runs in apypienvironment. It publishes by trusted publishing, so no PyPI token exists anywhere.download-artifactis pinned at v7.0.0 to match the existingupload-artifactv7.pypa/gh-action-pypi-publishis pinned at v1.14.2. Both SHAs were resolved bygit ls-remote.Why dispatch:
docs/OUTSTANDING.mdrecords 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
tests/test_ci_config.pypin the release workflow:pypienvironment, and it runs only after the GitHub release.python -m pytest tests/ -qpasses: 1556 passed, 18 skipped.python tests/test_evasion.pypasses: 29 constructed evasions, 14 working, 13 half closed, 2 closed.ruff check src tests eval tools lab demopasses.mypypasses.python tools/readme_facts.py --checkpasses.python tools/release_gate.py --tag v0.4.0passes.The build and wheel-verification steps were dry-run locally. They produce
cohaera-0.4.0-py3-none-any.whlandcohaera-0.4.0.tar.gz, the installed version reads 0.4.0, the wheel pulls in no dependencies, andcohaera --helpruns. 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.pyre-run and the card regenerated. The only change isdetector version0.3.0 → 0.4.0. The local and CH06 labs were regenerated; the changed fields aredetector_version,analysis_run_idandverdict_id, all of which derive from the version.If this changes an evasion
Not applicable.
Anything a reviewer should push back on
One-time setup needed before the first run:
cohaerawith owner404SecNotFound, repositoryCohaera, workflowrelease.ymland environmentpypi. The name is free on PyPI; the JSON API returns 404 for it.pypi. Adding yourself as a required reviewer is recommended, because the upload is the step that cannot be undone.Until both are done, the
pypijob 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_exactlynow counts only workflows triggered bypull_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