Skip to content

fix(cli): recover npm publication verification - #256

Merged
kl3inIT merged 3 commits into
mainfrom
fix/cli-publish-verification
Aug 1, 2026
Merged

fix(cli): recover npm publication verification#256
kl3inIT merged 3 commits into
mainfrom
fix/cli-publish-verification

Conversation

@kl3inIT

@kl3inIT kl3inIT commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • make the CLI publish workflow retry-safe when an immutable version already exists with matching tarball integrity
  • wait for the complete registry integrity + provenance predicate instead of stopping at the first visible manifest
  • record the verified @orgmemory/cli@0.1.0 publication and observed one-time bootstrap boundary

Verification

  • node --test scripts/npm-publish-workflow-policy.test.mjs
  • corepack pnpm check:cli
  • corepack pnpm release:check
  • registry proof: @orgmemory/cli@0.1.0 integrity, SLSA provenance URL, and executable version 0.1.0

Merge

Use a merge commit and preserve both reviewed commits. Do not squash.

Summary by CodeRabbit

  • New Features

    • Improved CLI publication verification by checking package integrity and provenance before considering a release complete.
    • Added safe handling for already-published versions and delayed provenance availability.
  • Documentation

    • Documented verified CLI version 0.1.0 and updated installation and release guidance.
  • Tests

    • Expanded publication workflow checks for integrity matching, existing versions, provenance verification, and longer verification timeouts.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kl3inIT, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cb252dae-870d-44fc-8eec-3f7afc9ce654

📥 Commits

Reviewing files that changed from the base of the PR and between 549cfe5 and 97ea445.

📒 Files selected for processing (2)
  • .github/workflows/publish-cli.yml
  • scripts/npm-publish-workflow-policy.test.mjs
📝 Walkthrough

Walkthrough

The CLI publishing workflow now checks existing package integrity, publishes with provenance when required, and waits for registry integrity and attestation verification. Tests and release documentation describe the verified 0.1.0 publication and recovery behavior.

Changes

CLI publication verification

Layer / File(s) Summary
Integrity-aware publication and registry verification
.github/workflows/publish-cli.yml, scripts/npm-publish-workflow-policy.test.mjs, .tegami/cli-publish-verification-recovery.md
The workflow compares existing package integrity with the reviewed tarball, publishes with provenance when needed, and polls for matching integrity and provenance for up to 180 seconds. Policy tests and recovery documentation reflect this behavior.
Verified release documentation
ARCHITECTURE.md, apps/cli/README.md
The documentation identifies CLI version 0.1.0 as publicly verified and uses the exact version in the installation command.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant ReviewedTarball
  participant NpmRegistry
  participant Provenance
  GitHubActions->>ReviewedTarball: compute reviewed tarball integrity
  GitHubActions->>NpmRegistry: query requested version
  NpmRegistry-->>GitHubActions: return package version and integrity
  GitHubActions->>NpmRegistry: publish with provenance when required
  GitHubActions->>NpmRegistry: poll for matching integrity
  NpmRegistry->>Provenance: expose attestation
  Provenance-->>GitHubActions: return provenance URL
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CLI npm publication verification recovery, which matches the primary change.
Description check ✅ Passed The description covers the summary and verification evidence, but omits the template's Documentation impact section and checkbox format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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 fix/cli-publish-verification

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Tegami

This repository uses Tegami to manage releases. When your changes affect published packages, add a changelog file under .tegami/ before merging.

Create a changelog → · Changelog format

Release preview

Package Bump Version
orgmemory minor 0.1.10.2.0

Changelogs in this PR

Changelog Title
cli-publish-verification-recovery.md Fixes

Run pnpm run tegami locally to create a changelog interactively.

Managed by Tegami.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/publish-cli.yml (1)

161-183: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Run npm audit signatures before executing the published CLI.

Checking dist.attestations.url only confirms attestation metadata; provenance and registry signatures must be verified with npm audit signatures against an isolated installation before running orgmemory. Add the isolated install audit step to .github/workflows/publish-cli.yml and a matching assertion to scripts/npm-publish-workflow-policy.test.mjs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish-cli.yml around lines 161 - 183, Before the
published CLI execution in .github/workflows/publish-cli.yml lines 161-183, add
an isolated installation of the exact package version and run npm audit
signatures against that installation, failing before npm exec if signature
verification fails. Update the corresponding workflow assertions in
scripts/npm-publish-workflow-policy.test.mjs lines 44-48 to require the isolated
install audit step and its placement before CLI execution.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/publish-cli.yml:
- Around line 161-183: Before the published CLI execution in
.github/workflows/publish-cli.yml lines 161-183, add an isolated installation of
the exact package version and run npm audit signatures against that
installation, failing before npm exec if signature verification fails. Update
the corresponding workflow assertions in
scripts/npm-publish-workflow-policy.test.mjs lines 44-48 to require the isolated
install audit step and its placement before CLI execution.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 06180107-c206-4c1b-b320-40036a34c295

📥 Commits

Reviewing files that changed from the base of the PR and between d309890 and 549cfe5.

⛔ Files ignored due to path filters (5)
  • docs/guidelines/cli-publication.md is excluded by !docs/**
  • docs/increments/active/2026-08-01-skill-cli-distribution-lifecycle/design.md is excluded by !docs/**
  • docs/increments/active/2026-08-01-skill-cli-distribution-lifecycle/plan.md is excluded by !docs/**
  • docs/specs/domains/asset-registry.md is excluded by !docs/**
  • docs/tests/domains/asset-registry.md is excluded by !docs/**
📒 Files selected for processing (5)
  • .github/workflows/publish-cli.yml
  • .tegami/cli-publish-verification-recovery.md
  • ARCHITECTURE.md
  • apps/cli/README.md
  • scripts/npm-publish-workflow-policy.test.mjs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Treat the repository and runtime evidence as the engineering system of record; do not treat chat or Northstar as authoritative.
Before changing a domain, read its specification, test-coverage document, and applicable decision filenames.
Material decisions about domain boundaries, authorization, persistence, publication, concurrency, cache isolation, parity scope, or deployment require an independent architecture challenge and documented alternatives before implementation.
Do not use completed increment documents as the source for current behavior; use them only for history or archaeology.
Before using unfamiliar Spring Boot, Spring Modulith, Spring AI, Gradle, React, Vite, Tailwind, TypeScript, Next.js, or Fumadocs APIs, consult current official documentation, Context7, and the relevant verification skill.
Read docs/guidelines/agent-safety.md before retrieval, AI, MCP, permission, upload, graph, or export work; never commit secrets or customer data.
Keep ddl-auto=validate and pair every persisted-model change with a Flyway migration.
Use the testing harness; a terminating clean test is the JVM context gate, and bootRun is not verification.

Files:

  • apps/cli/README.md
  • scripts/npm-publish-workflow-policy.test.mjs
  • ARCHITECTURE.md
.github/**/*.{yml,yaml}

⚙️ CodeRabbit configuration file

.github/**/*.{yml,yaml}: Require least-privilege permissions, explicit release tags for actions,
bounded job timeouts, concurrency cancellation, frozen lockfiles, and no
secrets in pull-request workflows. GitHub Actions are intentionally not
pinned to commit SHAs; Dependabot owns their scheduled version updates.

Files:

  • .github/workflows/publish-cli.yml
🧠 Learnings (1)
📚 Learning: 2026-07-24T22:52:57.466Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 40
File: .github/workflows/ci.yml:126-126
Timestamp: 2026-07-24T22:52:57.466Z
Learning: In this repository’s GitHub Actions workflows, the `uses:` field may intentionally reference GitHub Actions by explicit release tags (not immutable commit SHAs) per the project’s OrgMemory policy. Do not flag tag-based `uses:` references as “unpinned” if they are release-tag-based (e.g., `owner/repovX.Y.Z`) and follow the repo’s Dependabot-owned scheduled updates approach.

Applied to files:

  • .github/workflows/publish-cli.yml
🪛 markdownlint-cli2 (0.23.1)
.tegami/cli-publish-verification-recovery.md

[warning] 7-7: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🔇 Additional comments (4)
.github/workflows/publish-cli.yml (1)

113-139: LGTM!

.tegami/cli-publish-verification-recovery.md (1)

1-11: LGTM!

ARCHITECTURE.md (1)

47-50: LGTM!

apps/cli/README.md (1)

70-76: LGTM!

@kl3inIT

kl3inIT commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit finding verified and fixed in 97ea445. The workflow now installs the exact registry package in an isolated directory with lifecycle scripts disabled, runs npm audit signatures, and only then executes the published CLI. The policy test enforces both presence and ordering. Local proof: 97 packages with verified registry signatures, 10 with verified attestations; release:check and focused policy tests pass.

@kl3inIT
kl3inIT merged commit 39281c3 into main Aug 1, 2026
18 checks passed
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