[AAASM-2459] 🐛 (release): Sync pyproject.toml + __init__.py version from dispatch payload before maturin builds#75
Conversation
Rewrites pyproject.toml + agent_assembly/__init__.py to match the upstream release_tag (PEP-440 form) from a repository_dispatch payload, so maturin builds the wheel as the requested version rather than whatever is on master. Mapping: v0.0.1-alpha.4 -> 0.0.1a4, -beta. -> b, -rc. -> rc. Empty tag (workflow_dispatch dry-run) is a no-op. Refs AAASM-2459.
Inserts the composite action call before each maturin invocation in release-python.yml (1 sdist + 4 wheel jobs: linux-x86_64, linux-aarch64, macos-arm64, macos-x86_64). Without this, repository_dispatch from agent-assembly fires the workflow but maturin reads the stale version in the master pyproject.toml, producing a wheel that collides with an already-published PyPI release. Refs AAASM-2459.
Claude Code review — AAASM-2459CI state — green for merge (7 SUCCESS + 6 SKIPPED, 0 failures)
Scope vs. acceptance criteria
PEP-440 conversion coverageImplementer's local test confirms the conversion handles all 4 prerelease cases plus multi-digit numbers:
Implementation quality
Coupling with AAASM-2460This PR alone is NOT sufficient to publish alpha-4 to PyPI. The companion PR python-sdk#76 must also merge — that PR deletes the broken Plus the operator actions (PyPI 0.0.2 yank, Trusted Publisher policy verification) are still needed. VerdictReady for human approval and merge. All 3 immediate ACs delivered; 2 post-merge ACs require live verification. Implementation is the right structural choice (composite action, BSD-portable sed). Commits granular: 1 for action definition, 1 for wiring — bisectable. — Claude Code (Opus 4.7, 1M context) |
Summary
release-python.ymlis fired byrepository_dispatchfromAI-agent-assembly/agent-assemblywith
client_payload.release_tag: v0.0.1-alpha.X, but it never syncs theversion files inside this repo before maturin reads them. As a result,
maturin builds the wheel using whatever
version = "..."is currentlychecked in on
master(today:0.0.2, because the upstream Chisanan232bumper bumped past the alpha line — tracked separately as AAASM-2460).
That wheel filename collides with the already-published
0.0.2on PyPIand the publish step hard-fails.
This PR adds a tiny composite action that rewrites
pyproject.tomlandagent_assembly/__init__.pyto the PEP-440 form of the dispatch payloadbefore maturin runs, so alpha-4 actually publishes as
0.0.1a4.What changes
.github/actions/sync-version-from-dispatch/action.ymlrelease-python.yml: invokes the action in all 5 jobs (1 sdist + 4 wheels)right after
Stage aasm sidecar binary/setup-python, immediatelybefore the maturin
Build wheel/Build source distributionstep.PEP-440 conversion table
v0.0.1-alpha.40.0.1a4v0.0.1-beta.20.0.1b2(future-proofing; not used today)v0.0.1-rc.10.0.1rc1(future-proofing; not used today)v1.2.31.2.3Verified locally:
Recovery sequence (Group 1, alpha-4)
This is one of three pieces of the alpha-4 recovery; the others are
tracked independently:
0.0.2upload from PyPIjumping past the alpha line in the first place
Even with the upstream bumper still wrong, this PR alone is enough to
make the alpha-4 republish succeed end-to-end: maturin will trust the
dispatch payload, not the stale master files.
Test plan
agent_assembly-0.0.1a4-*.whlappears indist/and uploads to PyPIworkflow_dispatchdry-run path still builds (with no versionrewrite, since
release_tagis empty)🤖 Generated with Claude Code