Skip to content

feat(release): publish signed Darwin archives - #1238

Closed
JAORMX wants to merge 15 commits into
mainfrom
fix/891-darwin-archives
Closed

JAORMX wants to merge 15 commits into
mainfrom
fix/891-darwin-archives

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • publish a signed, checksum-verified Darwin arm64 archive containing mecated and mecatui
  • stamp the archive binaries with the release tag and smoke them on macOS
  • enforce tag validation, asset immutability, narrow publishing permissions, and keyless Cosign verification

Closes #891

Verification

  • bash .github/scripts/darwin-release-workflow_test.sh
  • task test:actions
  • task lint:actions
  • task docs
  • task site:build
  • task lint
  • task test
  • task build
  • go run ./cmd/mecademo

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panel review (Spec / Standards / Test-adequacy / Domain specialists) on PR #1238. Two blockers and two important findings below; full report also posted in the review discussion.

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
@JAORMX
JAORMX force-pushed the fix/891-darwin-archives branch from e53f03e to e895d08 Compare September 8, 2026 20:14

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked after the latest push. This update is a docs-only ADR renumber (docs/adr/0310-signed-darwin-release-archives.md → docs/adr/0315-signed-darwin-release-archives.md, since main has since landed ADRs 0310-0314 from other PRs) — .github/workflows/release.yml and both .github/scripts/*.sh files are byte-identical to what was reviewed.

All four prior findings remain open and unaddressed:

  • [Blocker] needs: validate-release-tag still couples the 5 pre-existing OCI/Helm jobs, against ADR's "must not widen or couple" claim.
  • [Blocker] gh release upload still has no --clobber — a re-run for an existing tag will still fail.
  • [Important] The Cosign cert-identity regex still accepts refs/heads/main.
  • [Important] darwin-release-workflow_test.sh still doesn't assert the --version smoke-test step exists.

@JAORMX
JAORMX force-pushed the fix/891-darwin-archives branch from e895d08 to e37ef09 Compare September 9, 2026 04:54

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh panel review (Spec / Standards / Test-adequacy / Domain specialists) on the rewritten branch. Good news first: both blockers and the important finding from the previous review are now fixed — no more needs: validate-release-tag coupling to the OCI/Helm jobs (confirmed by the workflow's own contract test asserting the string doesn't exist anywhere in the file), gh release upload now has --clobber, and the Cosign identity check switched to an exact --certificate-identity pinned to the tag — independently verified by four separate reviewers to be genuinely fail-closed against a workflow_dispatch-from-main forgery attempt (a Fulcio cert's SAN reflects the actual triggering ref, not the tag input, so it can never match refs/tags/${VERSION} unless the dispatch really came from that tag).

The rewrite introduced two new, unrelated blockers — both small, mechanical fixes. Six advisory findings otherwise, none blocking.

CANDIDATE_TAG: ${{ inputs.tag || github.ref_name }}
run: |
set -euo pipefail
if [[ ! "${CANDIDATE_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Advisory] This tag-format regex (^v[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$) is duplicated verbatim in .github/scripts/package-darwin-release.sh:13. Two sites, cross-confirmed as reasonable defense-in-depth by two reviewers (the script is independently testable/usable standalone) rather than a required fix — but if the version grammar ever needs to change (e.g. to allow a +build suffix), both copies need to move together. Not blocking; worth a comment noting the duplication is intentional, or extracting to one shared source if a third consumer ever appears.

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up panel review after the latest fix commit (796df2965).

Both blockers from the previous review are fixed correctly and verified with no new regressions:

  • ${BASHPID} → $$ in .github/scripts/darwin-release-workflow_test.sh — confirmed $$ is POSIX-portable and available under set -u on bash 3.2 (macOS's stock bash), and the existing ${RANDOM} suffix plus the hard mkdir failure guard right after make any residual collision risk a loud failure, not a silent one.
  • ADR-0315 → ADR-0318 in docs/acceptance/darwin-release-archives.md — confirmed no other stale ADR reference remains anywhere in the diff's own files.

The fix commit is minimal and scoped to exactly the two reported issues — nothing else touched. Remaining advisories from the full panel (duplicated tag-format regex across two sites, CI timeout margin, latent concurrency-group overlap) are all low-severity and non-blocking.

Approving.

@JAORMX
JAORMX force-pushed the fix/891-darwin-archives branch from c076df6 to 6308c09 Compare September 9, 2026 11:02

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up panel review after the latest push (041b2172f).

A welcome addition on top of what was already approved: the top-level concurrency: group: release-${{ github.ref }} was changed to release-${{ inputs.tag || github.ref_name }}, fixing a latent gap flagged in an earlier pass (a workflow_dispatch and a push for the same tag, triggered from different refs, previously wouldn't have serialized against each other). The offline contract test correctly gained an assertion pinning the new concurrency-group string, and the ADR/acceptance-plan renumber (0318→0319, another collision from main's churn) is consistently applied everywhere this time — no stale cross-reference.

Note: this branch is currently a few commits behind main's tip, so GitHub's file list also shows unrelated content from other already-merged PRs (mecatui login/MCP-authorization changes, SDK/proto regen) that will disappear on the next rebase — not part of this PR's own intent, and not reviewed as such here.

No new issues in the Darwin-archive-specific delta. Approving.

jhrozek added a commit that referenced this pull request Sep 9, 2026
…ht ADRs

ADR 0319 was independently claimed by two other open PRs (#1238, #1278).
Renumber this ADR to 0323, the next free number after main's highest
(0322), to avoid a duplicate-number collision on merge.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the changes since my last approval. The release.yml adjustment (build context move + packages:write reuse for reading the published SDK + npm_token passed as a BuildKit secret) is sound and CI is green. LGTM.

@jhrozek

jhrozek commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Heads up — #1338 (merged 2026-09-10) also closes #891, via GoReleaser, covering all four platforms (darwin+linux × amd64+arm64) rather than just Darwin, plus signing, SBOMs, checksums, and a Homebrew tap formula.

This PR is now CONFLICTING against main (both touch release.yml, ci.yml, Taskfile.yml, docs/usage/install.md), and its target issue is already resolved by the broader solution. Given that, I think this should be closed as superseded rather than rebased — could you confirm and close it if you agree?

@rdimitrov

Copy link
Copy Markdown
Member

Superseded by #1338, which landed the same capability with a wider scope. Closing — but the reasoning matters, and some of this PR is worth keeping.

What replaced it

#1338 publishes mecated + mecatui archives for darwin and linux × amd64 and arm64 (four archives, not one), attached to the GitHub Release with checksums.txt, a cosign keyless bundle and an SBOM per archive, plus one build-provenance attestation covering all eight artifacts — and it pushes a generated formula to stacklok/homebrew-tap, so brew install stacklok/tap/mecatl is the install path.

Shipped and independently verified at v0.0.31 and v0.0.32: formula sha256 matched checksums.txt on all four platforms, downloaded bytes matched, the shipped binaries satisfied the formula's own assert_match lines, and the attestation's builder identity pinned to release.yml@refs/tags/vX.Y.Z (checked with a negative control).

Being straight about the process

This PR took the right route and #1338 did not. It carries an acceptance plan and ADR 0319; #1338 shipped under an explicit spine waiver from the directing human. That ADR never merged, so by mecatl's own rule (merging is the approval event, proved by git ancestry) it was not in force — but it was a properly-routed proposal, and it lost to work that skipped the process. Worth saying out loud rather than leaving implied.

Several of its decisions were also deliberately reversed rather than overlooked:

ADR 0319 What shipped Why
Darwin arm64 only 4 platforms Directing human widened the scope after review
Versioned top-level directory in the archive Flat archive Homebrew's generated bin.install "mecated" requires binaries at the archive root
Per-archive .sha256 file One checksums.txt GoReleaser's default, and it's the subject list feeding the provenance attestation
Built on a macOS runner Cross-compiled on ubuntu One job for all four platforms; the native --version smoke test moved to a dedicated macos-14 CI job
Assembly in one offline-testable script GoReleaser Matches stacklok/toolhive and stacklok/modelith, whose tap formulas are GoReleaser-generated

Two things not superseded

1. .github/scripts/darwin-release-workflow_test.sh is still worth having. There is no test for release.yml on main, and the workflow broke twice during the v0.0.30 attempts — once on runner disk exhaustion, once on a self-inflicted --parallelism 2 that regressed the job into a 30-minute timeout. An offline contract test pinning build inventory, naming, permissions and step order would have caught the second. That value is independent of which packaging approach won, and porting it to the GoReleaser shape looks tractable.

2. ADR 0319's number is a reserved gap. main runs …0318, 0320…. Because #1338 waived the spine, there is currently no recorded decision for how mecatl publishes release archives. Either 0319 gets used to record what actually shipped, or the number should be explicitly freed. That is a call for the maintainers, not something to settle by closing this PR.

Issue #891 was closed by #1338.

@rdimitrov

Copy link
Copy Markdown
Member

Follow-up for the record: ADR number 0319 is now used by #1405, which records the release-archive and Homebrew tap decision that actually shipped.

Reusing the number rather than leaving it vacant was a deliberate call. Nothing on main referenced 0319 — not docs/, AGENTS.md, .claude/, nor the ADR index — and TestRealADRNumberUniqueness only globs on-disk docs/adr/*.md, so the number was never claimed in any enforceable sense. The new ADR names this PR's proposal in its Context section and describes its narrower decision under Rejected alternatives, so anyone arriving here finds a document that explains what happened instead of a silent gap.

Two things from this PR are reflected there:

  • Its scope and mechanism choices are recorded as considered-and-set-aside, with reasons — not omitted.
  • Its offline contract test for .github/workflows/release.yml is explicitly called out as not rejected and still worth porting. Branch fix/891-darwin-archives is intentionally left undeleted so it stays retrievable.

rdimitrov added a commit that referenced this pull request Sep 11, 2026
The archive + Homebrew pipeline shipped under an explicit spine waiver, so no
ADR recorded it. That left no durable answer to why GoReleaser runs alongside
ko, why the existing public tap rather than a new one, why four platforms, why
the archive is flat, or why the deprecated `brews:` block is retained — all
decided with reasons that lived only in PR bodies.

Reuse ADR number 0319. It was allocated to an unmerged proposal in the closed
#1238 and is referenced nowhere on main; by this repository's own rule that
merging is the approval event, it was never an ADR. The document says so
explicitly and describes that narrower proposal under Rejected alternatives, so
the reused number is explained rather than merely vacant.

Status Accepted with a Context note stating plainly that the implementation
shipped first, so the dates do not imply a process that did not happen.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.

release: publish signed darwin/arm64 mecated and mecatui archives

5 participants