Skip to content

ci(release): add protected npm staged publishing - #3192

Merged
M4n5ter merged 3 commits into
mainfrom
ci/cli-trusted-release
Aug 18, 2026
Merged

ci(release): add protected npm staged publishing#3192
M4n5ter merged 3 commits into
mainfrom
ci/cli-trusted-release

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 18, 2026

Copy link
Copy Markdown
Member
English

Summary

Adds a two-phase CLI release path: GitHub Actions may only stage the exact validated tarball through npm OIDC, while a maintainer must approve it on npm with 2FA before a separate workflow verifies the public bytes, dist-tag, signatures, and provenance and creates the GitHub Release.

Release records bind the source commit, workflow run, and explicit rerun attempt. Artifact consumers use the immutable ID emitted by their producer, so partial reruns cannot select or reconstruct a different candidate.

Refs #3166

Verification

  • 26 release policy/publication/workflow tests passed.
  • Full workspace typecheck, build, Biome, and actionlint v1.7.7 passed.
  • npm 11.19 built the clean immutable tarball successfully: 14.3 MiB compressed, 74.1 MiB unpacked, 7,511 files, SHA-256 d78236b2bef4b9adcf71cc32954b93099e410d5db75b809b1ea992d51a864655.
  • The installed-tarball smoke passed for bins, Eval assets/preflight, native PTY and locks, TUI setup, Runtime Host lifecycle, and the controlled model turn.
  • The npm 11.19 signature-audit probe confirmed that the isolated audit tree no longer traverses bundled dependencies.
  • npm run check:release remains blocked before its affected suites by pre-existing UI/Desktop stale dist timestamps; its notice checks and all release tests were run separately and passed.
  • A real npm stage publish was intentionally not run before merge and Trusted Publisher setup.

Release setup

After merge, create the protected npm-release GitHub Environment, then configure the npm Trusted Publisher as maka-agent/maka-agent, workflow release-cli-stage.yml, environment npm-release, with only Allow npm stage publish enabled.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented and tested the release workflows and publication validation under human direction. The commits include the required Generated-by trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
中文

概要

新增两阶段 CLI 发布流程:GitHub Actions 只能通过 npm OIDC 提交经过完整验证的精确 tarball;维护者必须在 npm 使用 2FA 人工批准。包公开后,独立 workflow 会核对 registry 字节、dist-tag、签名和 provenance,再创建 GitHub Release。

Release record 绑定 source commit、workflow run 与明确的 rerun attempt;artifact consumer 直接使用 producer 输出的 immutable ID,partial rerun 不再重算或选择其它候选。

关联 #3166

验证

  • 26 个 release policy/publication/workflow 测试、全仓 typecheck、build、Biome 和 actionlint 通过。
  • npm 11.19 从 clean commit 成功生成 immutable tarball:压缩后 14.3 MiB,解压后 74.1 MiB,共 7,511 个文件;SHA-256 为 d78236b2bef4b9adcf71cc32954b93099e410d5db75b809b1ea992d51a864655
  • 安装态完整 smoke 通过,覆盖 bin、Eval 资源与 preflight、原生 PTY/锁、TUI、Runtime Host 和受控模型回合。
  • npm 11.19 signature-audit probe 确认隔离 audit tree 不再遍历 bundled dependencies。
  • npm run check:release 仍在执行相关测试前被本地既有 UI/Desktop stale dist 时间戳阻断;其中的 notice checks 和全部 release tests 已分别运行并通过。
  • 合并并配置 Trusted Publisher 前没有实际执行 npm stage publish

发布配置

合并后先创建受保护的 npm-release GitHub Environment,再将 npm Trusted Publisher 配置为 maka-agent/maka-agent、workflow release-cli-stage.yml、environment npm-release,并且只启用 Allow npm stage publish

AI 使用

OpenAI Codex 在人工指导下实现并测试发布 workflow 与 publication validation;commit 已包含要求的 Generated-by trailer。

Split CLI publication into an OIDC stage operation and a separately verified finalization. Bind release artifacts to the exact workflow attempt, then require registry byte, tag, signature, and provenance checks before creating the GitHub release.

Generated-by: OpenAI Codex
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cd59e089-e23b-450a-a08c-49c42bf66eea

📥 Commits

Reviewing files that changed from the base of the PR and between 18826ba and aef0074.

📒 Files selected for processing (5)
  • .github/workflows/release-cli-finalize.yml
  • .github/workflows/release-cli-stage.yml
  • scripts/release-cli-publication.mjs
  • scripts/release-cli-publication.test.mjs
  • scripts/release-cli-workflow-policy.test.mjs
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/release-cli-stage.yml
  • .github/workflows/release-cli-finalize.yml
  • scripts/release-cli-publication.mjs

Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Problem solved

This PR adds a protected, two-phase npm release process for the CLI package.

  • The validation workflow produces one immutable release-candidate artifact.
  • The staging workflow binds the artifact to the source commit, workflow run, and rerun attempt.
  • npm staging uses OIDC and the protected npm-release environment.
  • A maintainer approves publication with npm 2FA.
  • The finalization workflow verifies the public tarball, dist-tag, checksums, integrity, signatures, and provenance.
  • GitHub creates the exact Git tag and release only after verification.
  • Immutable producer-emitted artifact IDs preserve partial-rerun recovery.
  • Finalization preserves Desktop as the repository’s Latest release.

Source of truth

The PR extends the existing CLI validation and packaging path. It does not create a parallel package or release source.

The validation workflow remains the source of the candidate tarball. The new workflows add controlled staging and finalization around that candidate.

Solution size and complexity

The two-phase design is the smallest coherent solution shown by the diff for the required controls.

Separate workflows are necessary because candidate validation, npm staging with human approval, registry verification, and GitHub Release creation require different permissions and release states.

The added checks are necessary to prevent artifact substitution, ambiguous reruns, premature releases, and unverifiable npm publications.

Simplification opportunities

No safe deletion is evident.

The publication module validates release identity, source provenance, candidate checksums, file inventory, registry bytes, integrity, signatures, provenance, bounded responses, and GitHub Actions outputs. Removing these checks would weaken release protection or regression coverage.

Validation performed

The PR adds tests for:

  • Version and channel parsing.
  • Staged metadata and checksums.
  • Exact workflow identity and rerun handling.
  • Registry metadata, tarball integrity, and response-size limits.
  • Signature and provenance checks.
  • Artifact propagation across workflows.
  • Tag ownership and release ordering.
  • packageManager authority.
  • CLI output wiring.

The check:release script runs the publication tests. The workflows use npm 11.19.0 and include installed-tarball smoke testing.

No real npm stage publish ran before merge. The protected npm-release environment and npm Trusted Publisher require post-merge configuration.

Successful test execution and final required-check status are unverified from the supplied evidence.

Complexity delta

  • Authorities: Adds maintainer approval, npm registry verification, and signature/provenance verification.
  • States: Adds staged, approved, inspected, and finalized release states.
  • Branches: Adds separate staging and finalization workflows.
  • Configuration: Adds the protected npm-release environment and npm Trusted Publisher.
  • Public surface: Adds workflow inputs and outputs, plus exported publication functions.
  • Test maintenance: Adds publication and workflow-policy tests with release fixtures.
  • Ambiguity: Reduces ambiguity through immutable artifact IDs, attempt-specific names, and release records.
  • Integrity: Adds source, checksum, registry, signature, and provenance authorities.

Total maintenance complexity increases. The increase is justified by the required release protection and supply-chain verification.

Review-relevant risks

  • The PR changes npm publication and GitHub Release creation. This affects releases, security, and governance. Material changes in these areas require independent human review under repository policy.
  • The PR grants id-token: write to the staging job and depends on npm Trusted Publisher configuration. This affects supply-chain security. Material changes in this area require independent human review under repository policy.
  • The PR adds protected-environment approval and npm 2FA instructions. This changes release governance. Material changes in this area require independent human review under repository policy.
  • The PR changes workflow inputs, outputs, artifact selection, Git tags, and release sequencing. This affects release automation contracts. Material changes in these areas require independent human review under repository policy.
  • Required-check status is unverified from the supplied evidence.

The person performing the merge reviews the final diff. A maintainer makes the final determination.

Walkthrough

Added a validated two-step CLI npm release process. The stage workflow prepares and publishes a staged package. The finalize workflow verifies the exact staged run, registry tarball, signatures, and provenance before creating the Git tag and GitHub Release.

Changes

CLI npm release lifecycle

Layer / File(s) Summary
Publication validation and test coverage
scripts/release-cli-publication.mjs, scripts/release-cli-publication.test.mjs
Added semantic-version parsing, release-record creation, artifact and registry verification, bounded downloads, signature auditing, command dispatch, and tests for success and failure cases.
Release toolchain alignment
package.json, CONTRIBUTING*.md, .github/workflows/cli-package-validation.yml, scripts/release-cli-workflow-policy.test.mjs
Updated npm to 11.19.0, added publication tests to check:release, and changed validation jobs to use the package-defined toolchain and immutable artifact IDs.
CLI release staging workflow
.github/workflows/release-cli-stage.yml
Added manual main-branch staging with candidate validation, workflow-run binding, version and tag availability checks, artifact preservation, npm staging, and approval instructions.
CLI release finalization workflow
.github/workflows/release-cli-finalize.yml
Added manual finalization that verifies the exact stage run, registry contents, signatures, provenance, and verified release artifact before creating the Git tag and GitHub Release.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: 🔵 Low · up to aef00

The PR adds a protected two-phase npm publishing flow. It is mergeable with owner awareness of a bounded risk that brittle workflow-policy assertions may provide false confidence or require updates after harmless workflow changes.

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseOperator
  participant StageWorkflow
  participant PublicationModule
  participant NpmRegistry
  participant FinalizeWorkflow
  participant GitHubRelease

  ReleaseOperator->>StageWorkflow: Dispatch release version
  StageWorkflow->>PublicationModule: Prepare and bind candidate
  PublicationModule->>NpmRegistry: Check version and dist-tag availability
  StageWorkflow->>NpmRegistry: Publish staged package with provenance
  ReleaseOperator->>FinalizeWorkflow: Dispatch stage run, attempt, and version
  FinalizeWorkflow->>PublicationModule: Validate exact successful stage run
  FinalizeWorkflow->>NpmRegistry: Verify tarball, checksums, signatures, and provenance
  FinalizeWorkflow->>GitHubRelease: Create verified Git tag and release assets
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Ai Use Disclosure ✅ Passed The PR selects generative use, names OpenAI Codex and its scope, and all three introduced commits contain a matching standalone Generated-by: OpenAI Codex trailer.
Title check ✅ Passed The title clearly summarizes the main change: adding a protected, staged npm release process.
Description check ✅ Passed The description covers the required summary, verification, AI use, checklist, behavior change, issue reference, and release setup.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/cli-trusted-release

Comment @coderabbitai help to get the list of available commands.

@M4n5ter
M4n5ter marked this pull request as ready for review August 18, 2026 06:56
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Protect CLI releases with staged npm publishing

✨ Enhancement ⚙️ Configuration changes 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Split CLI releases into OIDC staging and separately authorized finalization.
• Bind artifacts to exact commits, workflow runs, and rerun attempts.
• Verify public bytes, tags, signatures, and provenance before creating GitHub releases.
Diagram

sequenceDiagram
  actor Maintainer
  participant Stage as Stage Workflow
  participant Validator as Package Validation
  participant Npm as npm Registry
  participant Finalize as Finalize Workflow
  participant GitHub as GitHub Releases
  Maintainer->>Stage: Dispatch version
  Stage->>Validator: Build and validate
  Validator-->>Stage: Exact candidate
  Stage->>Npm: OIDC stage publish
  Npm-->>Maintainer: Await 2FA approval
  Maintainer->>Npm: Approve package
  Maintainer->>Finalize: Dispatch run and version
  Finalize->>Stage: Retrieve bound artifact
  Finalize->>Npm: Verify public release
  Npm-->>Finalize: Bytes and attestations
  Finalize->>GitHub: Create tag and release
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Direct trusted publish
  • ➕ Uses a single workflow and fewer intermediate artifacts.
  • ➕ Reduces maintainer release steps and operational latency.
  • ➖ Removes npm-side 2FA approval before public availability.
  • ➖ Provides less separation between publication and independent verification.
  • ➖ Increases the impact of a compromised release workflow.
2. Automated finalization polling
  • ➕ Creates the GitHub release automatically after npm approval.
  • ➕ Avoids manually supplying the stage run ID and version twice.
  • ➖ Requires persistent polling, scheduling, or additional state management.
  • ➖ Could make source-run selection and failure recovery less explicit.
  • ➖ Expands automation permissions and operational complexity.

Recommendation: Retain the proposed two-phase design. Its explicit npm 2FA checkpoint and independent finalization provide stronger separation of duties, while commit/run/attempt binding prevents ambiguous artifact selection; the additional manual dispatch is appropriate for a security-critical release operation.

Files changed (8) +1072 / -10

Enhancement (1) +452 / -0
release-cli-publication.mjsImplement staged publication integrity checks +452/-0

Implement staged publication integrity checks

• Introduces release identity and record generation, exact workflow-run validation, npm version vacancy checks, bounded registry downloads, byte and integrity verification, dist-tag enforcement, and signature/provenance validation. It also exposes command-line operations consumed by the staging and finalization workflows.

scripts/release-cli-publication.mjs

Tests (1) +306 / -0
release-cli-publication.test.mjsTest staged release trust boundaries +306/-0

Test staged release trust boundaries

• Covers semantic version mapping, source-run binding, checksum drift, version vacancy, exact finalization identity, registry byte and tag verification, bounded downloads, and required npm provenance. Fixtures exercise both accepted releases and fail-closed conditions.

scripts/release-cli-publication.test.mjs

Documentation (2) +2 / -2
CONTRIBUTING.mdDocument npm 11.19 release tooling +1/-1

Document npm 11.19 release tooling

• Updates the English contributor requirements to identify npm 11.19.0 as the repository package manager.

CONTRIBUTING.md

CONTRIBUTING.zh-CN.mdSynchronize Chinese npm tooling guidance +1/-1

Synchronize Chinese npm tooling guidance

• Updates the Chinese contributor requirements to identify npm 11.19.0 as the repository package manager.

CONTRIBUTING.zh-CN.md

Other (4) +312 / -8
cli-package-validation.ymlBind validation artifacts to workflow attempts +8/-6

Bind validation artifacts to workflow attempts

• Triggers package validation when either release workflow changes, upgrades release jobs to npm 11.19.0, and includes the run attempt in candidate artifact names. This prevents reruns from selecting an ambiguous tarball.

.github/workflows/cli-package-validation.yml

release-cli-finalize.ymlAdd verified CLI release finalization workflow +167/-0

Add verified CLI release finalization workflow

• Adds a main-only workflow that loads the exact staging run and artifact, verifies registry bytes, dist-tags, installed behavior, signatures, and provenance, then creates the Git tag and GitHub Release. Publication metadata remains bound to the original source SHA and workflow attempt.

.github/workflows/release-cli-finalize.yml

release-cli-stage.ymlAdd protected npm staging workflow +135/-0

Add protected npm staging workflow

• Adds a main-only release workflow that reuses package validation, records source and run identity, checks version and tag vacancy, and stages the immutable tarball through npm OIDC. It preserves the exact candidate and directs maintainers to approve publication with npm 2FA.

.github/workflows/release-cli-stage.yml

package.jsonUpgrade npm and include publication policy tests +2/-2

Upgrade npm and include publication policy tests

• Pins npm 11.19.0, which supplies staged publishing support, and adds the publication test suite to the release checks.

package.json

@qodo-code-review

qodo-code-review Bot commented Aug 18, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Prereleases become regular releases ✓ Resolved 🐞 Bug ≡ Correctness
Description
Although prerelease package versions are deliberately assigned npm's next channel, finalization
never passes --prerelease to gh release create. The current 0.1.0-beta.1 release will
therefore be classified as a normal GitHub Release and may be selected as the latest release.
Code

.github/workflows/release-cli-finalize.yml[R164-167]

+            --repo "$GITHUB_REPOSITORY" \
+            --target "$RELEASE_SHA" \
+            --title "Maka CLI $RELEASE_VERSION" \
+            --notes-file "$RELEASE_DIRECTORY/release-notes.md"
Relevance

●●● Strong

Parser and package version explicitly identify prereleases, so omitting GitHub prerelease
classification is an obvious correctness bug.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The release parser explicitly distinguishes prereleases by assigning them to next, and the
checked-in CLI version is a beta. GitHub CLI exposes --prerelease for this classification, but the
final release command does not use it.

scripts/release-cli-publication.mjs[24-46]
packages/cli/package.json[1-5]
.github/workflows/release-cli-finalize.yml[149-167]
🌐 The gh release create command provides --prerelease to mark a release as a prerelease and otherwise uses normal release classification.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Semver prereleases are mapped to npm's `next` channel but are always created as ordinary GitHub Releases because the command omits `--prerelease`.

## Issue Context
Reuse the already validated version identity to conditionally supply `--prerelease` for versions containing a prerelease component. Deletion or consolidation cannot preserve both stable and prerelease behavior; the smallest additive change is one derived boolean/argument, introducing no independent release state.

## Fix Focus Areas
- scripts/release-cli-publication.mjs[24-46]
- scripts/release-cli-publication.mjs[405-414]
- .github/workflows/release-cli-finalize.yml[149-167]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Existing tag bypasses target ✓ Resolved 🐞 Bug ≡ Correctness
Description
A tag can be created or moved after staging's vacancy check but before finalization, and `gh release
create --target` only applies the target when automatically creating a missing tag. Finalization can
therefore create the GitHub Release on a tag pointing somewhere other than the verified source SHA.
Code

.github/workflows/release-cli-finalize.yml[R159-162]

+          gh release create "$RELEASE_TAG" \
+            "$RELEASE_DIRECTORY/$tarball_name" \
+            "$RELEASE_DIRECTORY/$tarball_name.sha256" \
+            "$RELEASE_DIRECTORY/$tarball_name.files.json" \
Relevance

●●● Strong

Finalization must revalidate tag identity; this is a concrete race undermining the release source
guarantee.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The only tag vacancy check occurs during staging, potentially long before manual npm approval and
finalization. GitHub CLI documents that --target controls automatic tag creation when the tag does
not exist, so it does not validate the commit of an existing tag.

.github/workflows/release-cli-stage.yml[88-101]
.github/workflows/release-cli-finalize.yml[149-166]
scripts/release-cli-publication.mjs[111-126]
🌐 The manual states that --target selects the branch or commit for automatic tag creation when a matching tag does not yet exist.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Finalization assumes `--target` guarantees the release tag points to the validated source SHA. If the tag already exists, GitHub uses that existing ref and does not retarget it.

## Issue Context
Consolidate tag authority in finalization: create the Git ref for the verified SHA through the GitHub API, require creation to fail if the ref already exists, and then create the release with `--verify-tag`. Rechecking vacancy alone is insufficient because it preserves the time-of-check/time-of-use race; no new persistent state beyond the intended release tag is needed.

## Fix Focus Areas
- .github/workflows/release-cli-finalize.yml[149-166]
- .github/workflows/release-cli-stage.yml[88-101]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Finalize reruns lose artifact ✓ Resolved 🐞 Bug ☼ Reliability
Description
When only failed jobs are rerun after a transient staging, GitHub release, or environment failure,
github.run_attempt increments while the successful inspect/validation job is not rerun, so
publish/stage requests a newly named attempt-2 artifact even though only the attempt-1 artifact
exists. This mismatch makes finalization unrecoverable through GitHub’s “re-run failed jobs”
operation.
Code

.github/workflows/release-cli-finalize.yml[R144-148]

+      - name: Download the verified public release
+        uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+        with:
+          name: cli-public-release-${{ github.run_attempt }}
+          path: ${{ runner.temp }}/registry-release
Relevance

●●● Strong

Explicit rerun artifact-binding intent makes this deterministic reliability fix highly likely
accepted.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The inspect/reusable validation job uploads the verified candidate under an artifact name derived
from its execution attempt, while the later publish/stage job independently reconstructs the
download name using its current github.run_attempt. Because GitHub supports rerunning only failed
jobs, successful upstream jobs retain their artifacts under the earlier attempt, proving that the
rerun consumer can request an artifact name that was never uploaded.

.github/workflows/release-cli-finalize.yml[120-127]
.github/workflows/release-cli-finalize.yml[129-148]
.github/workflows/cli-package-validation.yml[87-96]
.github/workflows/release-cli-stage.yml[38-64]
🌐 GitHub permits rerunning failed jobs independently of successful jobs from the prior attempt.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A partial finalization rerun increments `github.run_attempt` without rerunning the successful inspect/validation job, so its verified artifact remains under the previous attempt’s name. The publish/stage job then reconstructs a name for the new attempt and tries to download an artifact that was never uploaded.

## Issue Context
Expose the verified artifact name or ID as an output of the inspect/validation producer and have publish/stage consume that exact identity instead of independently deriving it from the consumer’s current attempt. This consolidates artifact authority in the producing job and reuses the existing validation seam; rebuilding, re-inspecting, or adding fallback artifact-selection logic would add unnecessary work, duplicate candidate authority, and create another verification path.

## Fix Focus Areas
- .github/workflows/release-cli-finalize.yml[43-47]
- .github/workflows/release-cli-finalize.yml[120-127]
- .github/workflows/release-cli-finalize.yml[144-148]
- .github/workflows/cli-package-validation.yml[87-96]
- .github/workflows/release-cli-stage.yml[60-64]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context
✅ Web pages:
  +12 more
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 15/18, lines 1082/200; both must reach the floor). Router rationale: This security-sensitive release path adds substantial workflow and publication-validation logic across multiple independent code paths, where redundant review can catch subtle staging, artifact-binding, registry, provenance, or authorization defects.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/release-cli-finalize.yml
Comment thread .github/workflows/release-cli-finalize.yml Outdated
Comment thread .github/workflows/release-cli-finalize.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
.github/workflows/release-cli-finalize.yml (1)

72-78: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove registry-url from the inspect job.

This job reads public npm data and does not publish packages. The setting adds unnecessary authentication configuration.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 329f8731-3da5-4239-a0bb-04000b33d5dd

📥 Commits

Reviewing files that changed from the base of the PR and between 19ccf0b and cd30bdf.

📒 Files selected for processing (8)
  • .github/workflows/cli-package-validation.yml
  • .github/workflows/release-cli-finalize.yml
  • .github/workflows/release-cli-stage.yml
  • CONTRIBUTING.md
  • CONTRIBUTING.zh-CN.md
  • package.json
  • scripts/release-cli-publication.mjs
  • scripts/release-cli-publication.test.mjs

Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review.

Comment thread .github/workflows/release-cli-finalize.yml Outdated
Comment thread .github/workflows/release-cli-finalize.yml
Comment thread scripts/release-cli-publication.mjs
Comment thread scripts/release-cli-publication.test.mjs
Make artifact producers authoritative across partial reruns, bind finalization to an explicit workflow attempt, and validate the stage source before executing it. Finalization now audits only the public package edge, owns exact tag creation, and preserves Desktop as the repository Latest release.

Generated-by: OpenAI Codex

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
scripts/release-cli-workflow-policy.test.mjs (1)

18-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Three assertions do not protect observable behavior.

Line 30 forbids the strings assert-vacant and git ls-remote. It records a removed implementation, not a release invariant. Line 80 passes on any occurrence of packageManager in the file, including a comment, so it does not prove that the npm toolchain comes from the root authority. Line 19 pins the consumer count to 2 for an exact string with exact spacing, so a third legitimate consumer of release_candidate_artifact_id fails a green test with no behavior change.

Tighten each to the contract you want to hold: assert that every Select the release npm toolchain step reads packageManager from package.json, assert that each download-artifact step uses artifact-ids instead of a fixed total, and delete Line 30.

Disposition: optional.

Also applies to: 30-31, 72-82

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bd4b639d-bf17-4de6-bc36-b7ebd4d25a51

📥 Commits

Reviewing files that changed from the base of the PR and between cd30bdf and 18826ba.

📒 Files selected for processing (7)
  • .github/workflows/cli-package-validation.yml
  • .github/workflows/release-cli-finalize.yml
  • .github/workflows/release-cli-stage.yml
  • package.json
  • scripts/release-cli-publication.mjs
  • scripts/release-cli-publication.test.mjs
  • scripts/release-cli-workflow-policy.test.mjs
🚧 Files skipped from review as they are similar to previous changes (2)
  • package.json
  • scripts/release-cli-publication.test.mjs

Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review.

Require provenance before npm accepts the staged version, keep staging as the final business step, and run finalization with the current verifier while treating the staged SHA only as release data. Pass canonical artifact identity across jobs and test the observable workflow contracts instead of deleted implementation details.

Generated-by: OpenAI Codex
@M4n5ter

M4n5ter commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

I have manually reviewed this and take responsibility for the result.

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