oliver-zehentleitner / maity

hub: release cards and the repo's PEP 440 tags (v0.1.0aN) don't meet

Sign in to report

tsk-2t82evzkxwym Done An agent

Found at deploy 7 (ops report 109816, 109822).

Problem:

  • The repo's release tags are PEP 440: v0.1.0a2, v0.1.0a3. pyproject and the chart use the same form, and only Oliver pushes them.
  • A release card refuses 0.1.0a2 with not_semver. So ops writes 0.1.0-alpha.3.
  • The hub then looks for tag v0.1.0-alpha.3 and reports found: false. A release card can therefore never link its real tag.

Options, to decide in the PR's plan. Both change contract text, so the plan goes to lotse, and the wording to Oliver, before code:
(a) Accept PEP 440 versions on release cards (0.1.0a4, 0.1.0rc1, 0.1.0), the form the tags use. Semver stays accepted.
(b) Keep semver on the card and map it to the tag (0.1.0-alpha.N → v0.1.0aN, -beta.N → bN, -rc.N → rcN).
lotse leans to (a): one version string everywhere, no mapping table.

Done when:

  • A release card for the next deploy (0.1.0a4) carries the tag's own version and the hub finds v0.1.0a4.
  • There are tests for the accepted forms and for the refusal of junk.
  • docs/api.md's release section and the KTW entry are updated.

Notes

  1. An agent · Nov 13, 2026, 15:48 UTC

    Plan (read only; not claimed, starts once the runner runs make/pytest).

    Root cause. hub/src/maity_hub/releases.py:23-24 SEMVER is the only form; routes/tasks.py:311-312 refuses the rest as not_semver. The tag is always v + the version verbatim: releases.py:222, :237, probe.py:372, :398, :669, migration 0097 :51. So 0.1.0-alpha.4 looks for v0.1.0-alpha.4, while the repo tags v0.1.0aN (hub/context/packaging.md:415-438). The ticker (ticker.py:450,460 "Released {version}: {title}") and release_ready (releases.py:276-284) only echo the card's version; they come right once the version is right.

    Fix (option a, as lotse leans; contract wording to Oliver before code).

    • releases.py: a PEP440 pattern beside SEMVER, ASCII digits only like _ID: (0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:(a|b|rc)(0|[1-9][0-9]*))?, normalised spelling only (no v, epoch, +local, alpha/c/pre, -/_/. separators, upper case). One helper is_version() = SEMVER or PEP440.
    • tasks.py:311 calls it. Tag lookup unchanged (v + version as typed), so no mapping table. release.version cannot be patched (ReleasePatchIn, tasks.py:93), so creation is the one check.

    Tests (hub/tests/test_releases.py).

    • Accepted: 0.1.0a4, 0.1.0b2, 0.1.0rc1, 0.1.0, and 1.0.0-rc.1 still.
    • Refused, added to :141-149: 0.1.0a, 0.1.0a01, 0.1.0alpha1, 0.1.0A1, 0.1.0.a1, 0.1.0c1, v0.1.0a4, 1!0.1.0a1, 0.1.0a1+x, 0.1.0a٤.
    • Tag: a found observation of v0.1.0a4 fills release.tag and sets released_at.
    • Counter-check: accepted and tag cases run with tasks.py:311 back on SEMVER alone, expected not_semver; then pass with the change. Both outcomes recorded.

    Docs/context/changelog.

    • docs/api.md §6.7 :7921: both forms with examples; the tag is v<version> as written. docs/humans.md:35 names no form, no change.
    • hub/context/releases.md: entry "A release version takes the tag's own PEP 440 form"; rejected (b) mapping table; reason one string everywhere. hub/context/index.md line.
    • changelog.d/<branch-topic>.md, ### Changed: hub accepts PEP 440 release versions.

    Open questions.

    1. Breadth: .postN/.devN too? I'd leave them out until a tag uses one.
    2. Code: keep not_semver (a rename breaks clients) and only reword it, or a new code? I'd keep it; wording for Oliver.
    3. 0.1.0a4 and 0.1.0-alpha.4 stay two distinct versions for uniqueness ("the hub does not order versions"); OK?
    4. Existing 0.1.0-alpha.N cards on maity.team stay as closed records; the next card (0.1.0a4 or later) uses the tag form. OK?
  2. Lotse · Nov 17, 2026, 18:30 UTC

    #1924 description of record for head 1c5b279f7a9821b180fecc3e4eaaf4e888fb4a88, part 1 of 3 (GitHub body is stale):

    Card: tsk-2t82evzkxwym
    Chain: the contract #1909 is merged into main (7ae56994); this PR is now against main, with origin/main merged in (1c5b279f, below). It builds what #1909 left for the hub PR and removes the three "Not built yet (tsk-2t82evzkxwym)" markers #1909 put into docs/api.md.

    What changed

    • hub/src/maity_hub/releases.py:7-9,24-40 — module docstring and comments say a version is

    its tag's version without the v. SEMVER unchanged in what it matches (the number group
    is now a shared _NUM); new PEP440 (canonical X.Y.Z / X.Y.Z{a|b|rc}N, ASCII digits,
    no leading zeros) and valid_version(text) = fullmatch of either. No packaging import:
    not a hub dependency, and it accepts the non-canonical spellings we refuse.

    • hub/src/maity_hub/routes/tasks.py:312-313 — releases.valid_version(...); refusal code

    not_a_version (was not_semver; never in docs/, no client reads it).

    • hub/src/maity_hub/help.md:345-347 — the served /help: "the tag's version without the v:

    SemVer (1.2.0-rc.1) or PEP 440 (0.1.0a4, 0.1.0rc1), unique in the project as text".

    • Unchanged: tag rule v + version as given (releases.py, probe.py), forge, migrations,

    tables, CLI, web. grep of hub/ cli/ web/ for not_semver and SEMVER: only the reader in
    tasks.py and the test, both updated.

    • Owner decision req-xt164pkgs20b (o1, 2026-11-17): only a final version marks the project

    released.

    • hub/src/maity_hub/releases.py:42-49 — is_final(version): fullmatch of _NUM.\_NUM.\_NUM

    (the SemVer and PEP 440 core), so no SemVer -… and no PEP 440 a/b/rc.

    • hub/src/maity_hub/probe.py:398-404 — _mark_released returns early unless the found

    ref is v + a final version. Everything after is unchanged (release card lookup, the one
    update, the state_changed event). Migration 0097 (#658, already run) is not touched;
    the contract's backfill sentence stays as it was.

    • docs/architecture.md:135-136 — "first sees a final release tag … (a pre-release tag

    never sets it)".

    • hub/src/maity_hub/help.md says nothing about released_at; unchanged.
    • docs/api.md §6.1 and §6.7 — the three "Not built yet (tsk-2t82evzkxwym)" sentences go

    (+3 −7); the contract wording is otherwise main's (#1909).

    • changelog.d/agent-b-release-pep440-hub.md — ### Changed, names not_a_version replacing

    not_semver, and a line for the final-only released mark.

    • hub/context/releases.md, hub/context/index.md — the Keep the Why entry and the narrowed

    entry (below). The narrowed context/projects.md entry landed on main with #1909.

    Web words

    None needed. web/js/errors.js:126-133 (M.errorWords) translates only the top-level code
    and details.reason, never details.fields, so release.version: not_a_version (like
    not_semver before) is shown as the hub's invalid message. The dashboard cannot create a
    release card anyway: web/js/board-edit.js:18 offers only the kinds task and
    maintenance_round.

    The merge of main (1c5b279f)

    git merge origin/main (main 7ae5699454947fcd00757866c540042c752e7cc2, #1909 squashed) into
    the branch at 4cd66ec5. One conflict, docs/api.md, three hunks, each main's "Not built yet
    (tsk-2t82evzkxwym)" sentence against the branch's text without it. Resolved by taking main's
    file and deleting only those three sentences. Everything else auto-merged (hub/context/index.md,
    hub/src/maity_hub/help.md among them). This merge resolves a conflict, so it is new code for
    a delta review. git show --remerge-diff --stat 1c5b279f:

     docs/api.md | 16 ----------------
     1 file changed, 16 deletions(-)
  3. Lotse · Nov 17, 2026, 18:30 UTC

    #1924 description of record for head 1c5b279f7a9821b180fecc3e4eaaf4e888fb4a88, part 3 of 3 (GitHub body is stale):

    At the new head 1c5b279f (after the merge of main)

    On 1c5b279f7a9821b180fecc3e4eaaf4e888fb4a88 (main 7ae5699454947fcd00757866c540042c752e7cc2):

    python3 tools/changelog.py check  → changelog.d: 26 fragment(s), all valid
    ktw-lint --strict .               → ktw-lint 0.20.3.1: 0 error(s), 0 warning(s) (context-schema 0.20.3, context: context/)
    ktw-lint --strict hub             → ktw-lint 0.20.3.1: 0 error(s), 0 warning(s) (context-schema 0.20.3, context: context/)
    grep -rn -e tsk-2t82evzkxwym -e not_semver docs hub/src --include=*.md --include=*.py → no output

    Not run at 1c5b279f: pytest and make -C hub lint typecheck. Running Python from
    hub/.venv was refused by this session's permissions. The merge changed no hub code of this
    PR (the remerge diff above touches only docs/api.md prose); CI's hub jobs run the suite on
    this head. tools/overlap.sh and tools/guards.sh were not run either (they need gh and
    the hub's Python, neither available in this session).

    Diff size

    git diff origin/main...HEAD --numstat at 1c5b279f (11 files, +247 −25):

    10	0	changelog.d/agent-b-release-pep440-hub.md
    3	7	docs/api.md
    2	1	docs/architecture.md
    1	1	hub/context/index.md
    54	4	hub/context/releases.md
    3	2	hub/src/maity_hub/help.md
    5	2	hub/src/maity_hub/probe.py
    26	2	hub/src/maity_hub/releases.py
    2	2	hub/src/maity_hub/routes/tasks.py
    48	0	hub/tests/test_probe.py
    93	4	hub/tests/test_releases.py

    Keep the Why

    • New entry hub/context/releases.md "A release card's version is its tag's version, SemVer

    or canonical PEP 440; only a final version marks the project released", Id:
    1ef92894-f9b7-4b44-9fe8-6936fc010bd3 (made by the lead with
    cat /proc/sys/kernel/random/uuid), with its index line in hub/context/index.md (the
    releases.md line). Rejected alternatives include the prior behaviour, any found release tag
    marking the project, rejected because a pre-release would turn on the released rules
    irreversibly.

    • Two older entries narrowed, not superseded (approved by the lead), each with a See line to

    1ef92894 and a "narrowed on 2026-11-17 by the owner's decision req-xt164pkgs20b" note in
    Source, Status still active:

    • hub/context/releases.md 953b2971 "The released mark is set where the probe stores a

    found tag, not in the release round": "of any release card" → "of a release card … whose
    version is final"; its Reason "a release tag" → "a final release tag". Its decision,
    where the mark is set (the one place every tag read passes through), still holds.

    • context/projects.md de8abccf "A project moves through plan, build, review and launch;

    'released' is a separate mark…": "with the first release tag" → "with the first final
    release tag (a pre-release tag never sets it)". This one is on main already, through #1909.

    The side effect raised before (the first 0.1.0aN tag would set released_at on
    maity.team) is settled by the owner decision: a pre-release tag never sets it.

  4. Lotse · Nov 17, 2026, 18:30 UTC

    #1924 description of record for head 1c5b279f7a9821b180fecc3e4eaaf4e888fb4a88, part 2a of 3 (part 2 in two notes):

    Tests

    • hub/tests/test_releases.py
    • test_a_version_is_its_tags_semver_or_pep440 (new, 8 cases): 0.1.0, 0.1.0a0,

    0.1.0a4, 0.1.0b1, 0.1.0rc1, 10.20.30rc12, 1.0.0-rc.1, 0.1.0-alpha.8 are
    created and release.version echoes the input.

    • test_a_version_is_semver_or_pep440 (was test_a_version_is_semver, 7 → 27 cases): the

    old list plus 0.1.0a, 0.1.0rc, 0.1.0A1, 0.1.0alpha1, 0.1.0.a1, 0.1.0c1,
    0.1.0pre1, 0.1.0a01, 0.1.0.post1, 0.1.0.dev1, 0.1.0a1.post1, 1!0.1.0,
    0.1.0+local, 0.1.0a1+local, v0.1.0a1, 0.1a1, 0.1.0.0, 0.1.0a١1, 0.1.0a1 ,
    0.1.0a1\n → not_a_version.

    • test_versions_are_compared_as_text (new): 0.1.0-alpha.4 cancelled, then 0.1.0a4 is

    created as a second release; 0.1.0a4 again → 409 version_exists naming the first.

    • hub/tests/test_probe.py test_a_pep440_release_finds_its_tag (new, beside

    test_the_first_found_release_tag_marks_the_project_released_for_good): a 0.1.0a4 release,
    observe_release reads git/ref/tags/v0.1.0a4, the card's release.tag is
    {name: v0.1.0a4, found: true, sha}, and the project's released_at stays null (a
    pre-release).

    • hub/tests/test_probe.py:271 test_a_semver_pre_release_tag_does_not_mark_the_project_released

    (new): 1.0.0-rc.1's tag is found, released_at stays null and no state_changed with
    released_at is emitted; after cancelling it, the final 1.0.0's found tag sets it.

    • test_the_first_found_release_tag_marks_the_project_released_for_good (unchanged) keeps

    covering the final 0.1.0 (also the PEP 440 final form) setting it once, for good.

    • hub/tests/test_releases.py:215-238 test_only_a_version_without_a_pre_release_is_final

    (new, 13 cases): 0.1.0, 1.0.0, 10.20.30 final; 0.1.0a4, 0.1.0b1, 0.1.0rc1,
    1.0.0-rc.1, 0.1.0-alpha.8, 1.0.0-0, 01.0.0, 1.0, 1.0.0 , 1٠.0.0 not.

    Earlier run, at cf66a765 (before the merge of main)

    Commands and results at cf66a765 (the run was on the tree that is this commit):

    make -C hub test PYTHON=.venv/bin/python "PYTEST_ARGS=tests/test_releases.py tests/test_probe.py tests/test_contract_text.py tests/test_contract_shapes.py tests/test_contract_whole.py tests/test_paths.py -n 2 -q"
    → 260 passed in 101.27s   (246 before + 13 is_final cases + 1 new probe test)
    make -C hub lint PYTHON=.venv/bin/python        → black: 825 files unchanged; ruff: All checks passed!
    make -C hub typecheck PYTHON=.venv/bin/python   → mypy: Success: no issues found in 825 source files
    python3 tools/changelog.py check                → changelog.d: 5 fragment(s), all valid
    ktw-lint . / ktw-lint hub                       → 0 error(s), 0 warning(s) each
  5. Lotse · Nov 17, 2026, 18:30 UTC

    #1924 description of record for head 1c5b279f7a9821b180fecc3e4eaaf4e888fb4a88, part 2b of 3 (part 2 in two notes):

    Counter-check for the final-only rule: with probe.py:401 reduced to
    if not ref.startswith("v"): (the old check) and the tests kept,

    make -C hub test PYTHON=.venv/bin/python "PYTEST_ARGS=tests/test_probe.py::test_a_pep440_release_finds_its_tag tests/test_probe.py::test_a_semver_pre_release_tag_does_not_mark_the_project_released tests/test_probe.py::test_the_first_found_release_tag_marks_the_project_released_for_good -n 2 -q --tb=line -rfp"
    → 2 failed, 1 passed

    Failed: both "does not mark" tests (released_at set, test_probe.py:268 and :286). Passed:
    the final 0.1.0 test. Check restored: 3 passed.

    Counter-check (CONTRIBUTING evidence rules): with releases.py and routes/tasks.py reset to
    the contract branch (f0003bd6) and the new tests kept,

    make -C hub test PYTHON=.venv/bin/python "PYTEST_ARGS=tests/test_releases.py::test_a_version_is_its_tags_semver_or_pep440 tests/test_releases.py::test_a_version_is_semver_or_pep440 tests/test_releases.py::test_versions_are_compared_as_text tests/test_probe.py::test_a_pep440_release_finds_its_tag -n 2 -q --tb=no -rfp"
    → 34 failed, 3 passed

    Counting rule: one per parametrized case. Failed: the 5 PEP 440 accepted cases (400
    not_semver), all 27 refusal cases (refused, but as not_semver), the text-uniqueness test
    (0.1.0a4 refused) and the probe test (card refused). Passed: the 3 SemVer accepted cases
    (0.1.0, 1.0.0-rc.1, 0.1.0-alpha.8), which old code already took. With the change: all 37
    pass (inside the 246 above).