Skip to content

Publish the maple-proxy crate with Maple releases - #1673

Merged
AnthonyRonning merged 2 commits into
masterfrom
codex-proxy-pub-maple
Nov 21, 2026
Merged

AnthonyRonning merged 2 commits into
masterfrom
codex-proxy-pub-maple

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The maple-proxy crate has no publisher: crates.io stopped at 0.3.2 (August, a hand upload), which is Transport V1 and can no longer connect. This gives the crate the SDK's publisher and makes each Maple release queue it.

Why the Rust SDK's workflow

crates.io ties a crate's trusted publisher to a repository, a workflow file name and an environment. maple-sdk already trusts sdk-publish-rust.yml under sdk-crates, and a token issued to that identity covers every crate that lists it. Keeping the proxy crate in the same file means its crates.io entry is the same three values, and the same reviewer gate and hardened upload path apply.

Changes

  • sdk-publish-rust.yml takes a package choice: maple-sdk (default, so existing dispatches and just publish-cargo behave as before) or maple-proxy. The choice is mapped to two fixed values in env; it never reaches a script as text. Each crate has its own concurrency group.
  • scripts/ci/sdk_publish.py learns a proxy kind: proxy/Cargo.toml, archive prefix maple-proxy-X.Y.Z, path_in_vcs proxy, its own registry inventory. It must run from the Rust workflow, like the SDK.
  • scripts/ci/sdk_crates_upload.py takes --package (two allowed names, SDK by default).
  • scripts/ci/build-sdk-publish.sh proxy runs the proxy lane's checks in the proxy's own Nix shell, then cargo package, which verifies the packed crate against maple-sdk from crates.io.
  • proxy-publish.yml gets a crate job after finalize. It starts the publisher for the release's proxy version when crates.io answers 404 for that version and the code the crate is packed from (proxy/src, examples, tests, manifest, lockfile) is the same on master as in the release. It has actions: write and nothing else: no environment, no registry credential. crates.io refuses its token exchange to a workflow_run event, which is why this job dispatches instead of publishing.
  • Tests cover the new kind, the crate choice, and crate mix-ups in both directions down to archives and inventories that differ only in the name. test_proxy_crate_handoff.py runs the crate job's script with stand-ins for curl, git and gh in every registry and source state; test-release-gates.sh pins the job's shape. Docs: docs/sdk-publishing.md (new "Proxy crate" section), the release and proxy skills, and one sentence in proxy/README.md.

Decisions for review

  • The crate is built from master, not from the release tag. The SDK workflow only runs on master, and sdk-crates only deploys from it. The crate job closes most of the gap by refusing to start the publisher when the crate's source on master differs from the release; a merge that changes it in the seconds between that check and the dispatched run's checkout would slip through and would be visible at the approval. The in-tree SDK and the Dockerfile are left out of the comparison on purpose: the crate takes maple-sdk from crates.io and has no container.
  • A red crate job after a green container. If master has moved past the release, the job fails and names the release, so someone chooses the next proxy version.
  • The approval stays. Every crates.io upload still waits for sdk-crates. A proxy run left waiting does not block SDK publication, because the two crates serialize separately. While a version is missing from crates.io, each release starts another run for it.
  • No CI lane packs the proxy crate. A lane would fail on any PR that raises the proxy's maple-sdk requirement before that SDK version is published (as Prepare maple-sdk 5.0.0 and maple-proxy 0.5.1 for crates.io #1671 did), so cargo package for the proxy first runs in the publisher. A dry_run=true dispatch covers it without publishing.

One setting outside the repository

maple-proxy's Trusted Publishing settings on crates.io must list MaplePrivacyLabs/Maple, workflow sdk-publish-rust.yml, environment sdk-crates (the same entry maple-sdk has). crates.io shows those settings only to the crate's owner, so I could not check whether the entry exists. Without it the upload is refused and nothing is published.

Checks

  • nix flake check (the repo lane): the CI script tests, workflow policy, contracts and release gates pass.
  • The new handoff tests fail when the job is broken four ways (a dry-run dispatch, a 500 read as absent, a source difference ignored, a dispatch despite an existing version).
  • An independent review found no defect in the publish path; its three design points and test gaps are addressed in the second commit.
  • ./scripts/ci/build-sdk-publish.sh proxy locally at 58bca759: format, clippy, 41 tests, docs and cargo package pass. The crate is byte-identical to the one packed by hand for 0.5.1 (SHA-256 dc9a47d0…d2807).
  • The upload encoder (--validate-only) and the archive and registry checks accept that real crate; the registry check ran read-only against crates.io.

Not run: either workflow (they run only from master). A dry_run=true dispatch for maple-proxy after merge exercises the build half. The crate job first runs for real at the next release.

🤖 Generated with Claude Code

AnthonyRonning and others added 2 commits November 21, 2026 08:36
The proxy crate had no publisher and stopped at 0.3.2 on crates.io. It
now goes through the Rust SDK's publish workflow, because crates.io ties
a crate's trusted publisher to a workflow file and environment and the
SDK's is already registered: sdk-publish-rust.yml takes a `package`
choice (maple-sdk by default, maple-proxy), and the publish scripts and
builder accept the proxy crate.

After a stable release, proxy-publish.yml's new `crate` job starts that
publisher for the release's proxy version when crates.io lacks it and
master's proxy inputs still match the release. The run still waits for
sdk-crates approval, and the job itself holds no registry credential.

Co-Authored-By: Claude <noreply@anthropic.com>
The handoff now compares the files the crate is packed from instead of
the container inputs, so an in-tree SDK or Dockerfile change after a
release no longer blocks a crate it cannot affect. Each crate gets its
own concurrency group, so a proxy run waiting for approval does not hold
back an SDK publication. The job script is tested case by case with
stand-in tools, and the name checks are tested with archives and
inventories that differ only in the crate name.

Co-Authored-By: Claude <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning merged commit 02c120c into master Nov 21, 2026
24 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-proxy-pub-maple branch November 21, 2026 18:55
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