Introducing a new way to review your PRs.

Read the announcement

kenryu42 / cc-safety-net

A pre-execution guard for AI coding agents. It blocks destructive Git and file system commands, plus common attempts to access sensitive files, before a tool call runs. Supports Amp Code, Antigravity CLI, Claude Code, Codex, Cursor, DeepSeek Harness, Devin CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, Kimi Code, OpenClaw, OpenCode, and Pi.

View on GitHub

20 documents · Updated Nov 23, 2026

docs / release-and-verification-workflows

Release and verification workflows

Release work turns one verified commit into a matching Git tag, npm package, GitHub release, and plugin distribution. The workflow keeps version files, generated assets, Git history, package identity, and downstream release signals aligned before delivery can complete. It is part of Delivery engineering and complements Build and package orchestration.

Release state

The release state is the set of facts that identifies whether a version is new, already prepared, or already published. The workflow compares the requested stable version with the package manifest, four plugin manifests, the current commit, the immutable Git tag, and the npm registry identity before it changes Git.

The state has three normal forms:

StateMeaningNext action
prepareThe requested version is not recorded and no conflicting npm version exists.Create and publish the release commit and tag.
resumeThe requested version, tag, and current commit agree, but npm does not yet identify the package as published.Continue the tag-bound publish flow from the existing release.
publishedThe requested version, immutable tag, current commit, and npm package identity all agree.Treat the release as complete and avoid new Git changes.

The package manifest, Claude plugin manifest, Codex plugin manifest, Cursor plugin manifest, and Kimi plugin manifest must agree on the version. A version or tag that exists without the matching commit is an invalid state rather than a release that the workflow repairs automatically. References: scripts/release-state.ts• L1-52, scripts/release-transaction.ts• L72-143, tests/…/release-state.test.ts• L4-131

Release preparation

Release preparation creates the exact files that the later release commit will contain. It starts from a clean main checkout, verifies the current commit, runs the normal checks and build, then applies one stable version to the package and plugin manifests.

The preparation workflow has two modes:

  • A normal run stores the verified base commit and prepared release files as short-lived workflow artifacts. A later job applies those bytes to the same base.
  • A dry run performs the same validation but proves that neither the current commit nor the tag set changed.

The version edit preserves the existing manifest formatting. This matters because the prepared bytes are linted before they become the release commit. References: .github/…/prepare-release.yml• L31-115, scripts/prepare-release-files.ts• L7-27, tests/…/release-preparation.test.ts• L7-49

Transactional Git coordination

The Git transaction protects the release boundary between preparation and publication. It requires local HEAD and origin/main to equal the recorded base before it reads release state or mutates history.

When the release is new, the transaction stages only approved release paths. It creates a release commit, adds the v<version> tag, and pushes main and the tag in one atomic operation. If the remote branch advanced or the tag points elsewhere, the transaction stops before the release can move either history.

The approved release paths cover all version manifests, the generated configuration schema, and the built distribution. A resumed release must have a clean worktree because any local change could make the tag-bound package differ from the earlier verification. References: scripts/release-transaction.ts• L8-16, scripts/release-transaction.ts• L72-143, scripts/release-git.ts• L8-44, .github/…/prepare-release.yml• L118-153, tests/…/release-git.test.ts• L180-375

Release assets

The publish workflow first validates the immutable tag and builds the exact npm tarball that will be published. It then publishes a plugin branch, publishes the verified package with npm provenance, and treats the GitHub release as a resumable asset set.

The GitHub release expects the npm tarball and its checksum file. It checks any existing assets against those exact expected names, uploads only missing files, and compares files that are already present. An existing release must not be a prerelease. Duplicate or unexpected assets are errors because they make the release contents unclear.

The release becomes public only after all expected assets pass the plan. The workflow then directly starts the landing-page, documentation, and release-notes follow-up workflows because bot-generated release events do not start those listeners. These jobs send the release tag, source repository, release URL, and release ID to their matching consumers.

Release support also handles a known external plugin-hub failure path. When a new issue title matches a DSH Plugin Hub install or package-allowlist failure, the workflow closes it as not planned and points the reporter to the supported DeepSeek Harness reinstall command. A reporter can ask for the issue to be reopened if that command also fails. References: scripts/release-assets.ts• L5-25, .github/…/publish.yml• L67-204, .github/…/notify-landing-page-release.yml• L1-79, .github/…/release-notes.yml• L1-39, .github/…/close-dsh-plugin-hub-issues.yml• L1-32, tests/…/release-assets.test.ts• L32-73

Delivery verification

Delivery verification checks the generated build, the packed npm artifact, test coverage, dependency set, and the repository plugin surface. CI checks source on Linux, macOS, and Windows. The Linux job also checks end-to-end stability and package surfaces before it uploads coverage and audits dependencies. Each platform rebuilds artifacts and rejects stale generated output. Packed-package checks run across supported runtime and operating system combinations so a passing source build does not hide a broken distribution. The Windows CI job also checks command behavior in its native shell.

The main delivery checks are:

CheckDelivery property
Dependency auditDirect and bundled build dependencies have no known audit failure at the delivery gate.
Build verificationThe generated distribution has the expected entry points, reachable shared chunks, versioned managed artifacts, and usable executable metadata.
Package verificationThe npm tarball has the intended files, size, modes, package identity, and working consumer behavior.
Coverage verificationThe LCOV report is valid and both line and function coverage meet the minimum threshold.
Repository plugin verificationThe checked-in Claude, Codex, and Cursor plugin metadata, hook targets, built CLI, schema, logo, and required files remain valid repository installations.
Cross-platform verificationThe packed package works across supported Node versions on Linux, Windows, and macOS.

Build artifact checks

Build verification confirms that source changes produce a complete distribution for the CLI and supported plugin hosts. It checks the required entry artifacts for the CLI, APIs, declarations, host integrations, managed plugin bundles, and the DeepSeek Harness bundle metadata. It rejects stale or extra files, missing shared chunks, unused chunks, unresolved runtime imports, incorrect executable metadata, and managed artifacts with the wrong version or header.

The build creates the runtime bundles, integration artifacts, type declarations, schema, and third-party license output before it runs this check. CI then compares generated paths with the checkout so a release cannot silently rely on uncommitted generated output. The verifier follows shared chunk links from every JavaScript entry and rejects chunks that cannot be reached. It also checks that managed host artifacts contain their required header, package version, and no unbundled runtime dependency. The same generated-file comparison runs on Linux, macOS, and Windows. References: scripts/build.ts• L15-83, scripts/build-runtime.ts• L99-211, scripts/verify-build.ts• L14-56, scripts/verify-build.ts• L58-150, .github/…/ci.yml• L54-57, .github/…/ci.yml• L90-93, .github/…/ci.yml• L119-122

Package checks

Package verification checks the artifact that a consumer will install rather than only the repository build. It first verifies the build, then compares the tarball file set with that verified output. It also enforces the 700,000-byte size limit, checks executable and regular-file modes on non-Windows systems, and confirms the embedded Git commit when one is supplied.

It installs the tarball in temporary consumer projects and exercises the main package entry point, CLI, API subpath, and host integrations. These journeys confirm that the public exports and type declarations work with no OpenCode peer and with each supported OpenCode peer shape. The isolated consumer checks select the OpenCode v2 fixture by package-name prefix, so a v2 peer version change does not silently re-enable the slower Windows install. The v2 peer installation and host check are skipped on Windows. They also confirm that the package does not expose its internal rule synchronization operation and that API use does not write audit data. Safe commands remain allowed while destructive commands, shell indirection, and unsafe rule verification fail closed after packaging. The over-limit checks use rule verify, which validates live rule files without a separate synchronization step. CI repeats this packed-package check for Node 22 and 24 on Linux, Node 22.12.0 and 24 on Windows, and Node 24 on macOS. References: scripts/verify-package.ts• L26-32, scripts/verify-package.ts• L84-182, scripts/verify-package.ts• L183-389, scripts/verify-package.ts• L396-447, scripts/verify-package.ts• L450-599, .github/…/ci.yml• L58-61, .github/…/ci.yml• L138-165, .github/…/publish.yml• L46-58

Coverage checks

Coverage verification turns the test run into a release gate. It parses the generated LCOV report, checks that every record has valid line and function totals, combines the records, and requires at least 90 percent coverage for both lines and functions.

The parser rejects empty reports, incomplete records, duplicate or malformed metrics, invalid hit totals, and reports with no measurable lines or functions. The regular check command produces the report and then verifies it, so a missing or below-threshold report fails delivery instead of being treated as an incomplete measurement. References: scripts/verify-coverage.ts• L5-10, scripts/verify-coverage.ts• L12-68, package.json• L67-80

Repository plugin checks

Repository plugin verification protects the checkout-based plugin paths used by Claude Code, Codex, and Cursor. It confirms that the package and all three plugin versions agree, that each plugin hook still targets the built CLI with the expected mode, that the Codex site setting remains valid, that the CLI passes a syntax check, and that the schema, plugin metadata, hook files, and configured Codex logo are tracked by Git.

This check complements package verification. The package test proves an installed tarball works, while the repository check proves that the checked-in Claude, Codex, and Cursor plugin surfaces can be discovered and can invoke their guards. References: scripts/verify-repository-plugin.ts• L13-82, hooks/hooks.json• L1-14, hooks/codex.json• L1-14, hooks/cursor.json• L1-14, .claude-plugin/plugin.json• L1-23, .codex-plugin/plugin.json• L1-23, .cursor-plugin/plugin.json• L1-23, .github/…/ci.yml• L58-61

Release sequence

The release sequence carries one verified commit through Git, npm, and GitHub without changing the bytes after verification.

flowchart TD
    A[Verify clean main and current base] --> B[Prepare matching version manifests]
    B --> C[Build and verify generated artifacts]
    C --> D[Verify repository plugin and npm package]
    D --> E[Commit and tag the prepared release]
    E --> F[Atomically push main and immutable tag]
    F --> G[Verify tag-bound package and checksum]
    G --> H[Publish the plugin branch]
    H --> I[Publish the exact npm tarball]
    I --> J[Create or complete GitHub release assets]
    J --> K[Notify landing page and documentation consumers]
    K --> L[Notify release-notes consumer]

The publish stage checks the tag before it builds and packages. It records the tarball checksum, binds the package gitHead to the tagged commit, and publishes an existing matching npm version only as a safe resume case. The package is published with npm provenance through the protected publish environment. References: .github/…/prepare-release.yml• L71-165, .github/…/publish.yml• L18-204

Change checklist

When these files or sections are changed, remember to consider these:

  • If a release manifest or version rule changes, update the preparation, state classification, tag naming, and package gitHead checks together.
  • If a generated file or build entry changes, update the approved release paths, build artifact expectations, stale-artifact comparison, and package file-set expectation together.
  • If the GitHub release asset names change, update the asset planner, upload flow, checksum creation, and any downstream consumer that reads the release payload.
  • If a plugin hook target or manifest changes, keep the repository-plugin check, plugin branch output, and packaged host journey aligned with the new contract.
  • If coverage output changes, preserve the LCOV contract used by the threshold gate or update both the producer and parser as one change.
  • If package exports, optional peer use, or host request formats change, update the packed consumer fixtures and each packaged host journey together.
  • If package size or file mode rules change, update the tarball cap, platform rule, and release verification expectations together.
  • If rule validation changes, keep the packaged over-limit checks aligned with the command that owns live rule-file validation. Do not restore a separate synchronization step as the package safety check.
  • If supported runtimes or operating systems change, update the packed-runtime matrix and the platform-specific command checks together. Select platform-specific peer fixtures by package family rather than by a pinned version.
  • If a bundled dependency changes, keep the dependency audit scope aligned with the build dependency set.
  • If a downstream release notification changes, keep the event type and payload fields aligned across the release workflow and the landing-page and documentation repository dispatch handlers.
  • If the DSH Plugin Hub issue titles or recovery command changes, keep the issue filter, close message, and supported reinstall path aligned.

Important failure modes

TriggerConsequenceGuard
origin/main advances after preparationThe release could include a different history than the verified base.Exact base and remote-main checks stop the transaction before mutation.
A version manifest disagrees with another manifestDifferent distribution channels can report different release versions.Release state and repository-plugin checks reject the mismatch.
A tag points to a different commitnpm or GitHub could receive artifacts that do not match the named release.Immutable tag, HEAD, and npm gitHead must identify one commit.
A release has a duplicate, extra, or prerelease assetConsumers can receive an unclear or incomplete release set.The asset planner rejects the state before upload or finalization.
A downstream dispatch uses the wrong tag or release identityThe landing page or documentation site can sync the wrong release or fail to sync it.The notification jobs send a fixed event type with the source repository, tag, release URL, and release ID.
Generated output is stale, has an unresolved import, or contains an orphaned chunkThe published artifact can fail at runtime or differ from source.Build verification follows chunk links and CI's generated-file diff rejects it.
A packed artifact changes file set, mode, size, or public behaviorInstallation can fail or protection can weaken after packaging.Tarball inspection and temporary consumer journeys fail the package check.
A packaged host allows shell indirection or an unsafe rule verification pathA release can weaken command protection even when direct command checks pass.CLI, Pi, OpenCode, and Amp journeys require safe requests to pass and unsafe requests to fail closed.
The package exposes an internal rule synchronization operationConsumers can depend on a private operation that the packaged safety boundary does not support.Packed bundle inspection rejects the internal operation before consumer journeys run.
LCOV is missing, malformed, unmeasurable, or below 90 percentDelivery loses its measured test-coverage floor.The coverage parser and line/function threshold gate fail closed.
A dependency audit finds a known issue in the delivery dependency setCI stops before the build can become a release candidate.The dependency audit runs as a delivery gate after the main checks and does not run only when the workflow is canceled.
A platform-specific package or command path failsA release can work on Linux but fail for Windows or macOS users.The packed-runtime matrix and the Windows native-shell command check cover the supported platforms.

Key files

FileWhy to read it
.github/…/prepare-release.ymlDefines the verified preparation, dry-run proof, and Git mutation stages.
.github/…/publish.ymlDefines immutable-tag verification, plugin-branch publication, npm publication, and GitHub release completion.
.github/…/notify-landing-page-release.ymlDefines the release event sent to the landing-page and documentation repositories.
.github/…/release-notes.ymlDefines the release event sent to the release-notes consumer.
.github/…/close-dsh-plugin-hub-issues.ymlDefines the supported response to known external DSH Plugin Hub issue reports.
.github/…/ci.ymlShows source, end-to-end, build, package, coverage, dependency, and cross-platform delivery checks.
package.jsonDefines the package identity, public entry points, supported Node version, and verification commands.
scripts/release-transaction.tsCoordinates release state checks with the commit, tag, and push boundary.
scripts/release-state.tsDefines the allowed new, resumable, and published release states.
scripts/release-git.tsDefines the exact-base and atomic Git protections.
scripts/release-assets.tsDefines the safe expected-asset plan for a resumable GitHub release.
scripts/build.tsConnects bundle generation, declarations, schema generation, licenses, and build verification.
scripts/verify-build.tsDefines the public shape, chunk reachability, managed plugin artifacts, and runtime integrity checks for generated artifacts.
scripts/verify-package.tsDefines the packed npm artifact checks, isolated consumer checks, API boundary checks, and packaged host protection journeys.
scripts/verify-coverage.tsDefines the LCOV record rules and line/function coverage threshold gate.
scripts/verify-repository-plugin.tsDefines the checked-in Claude, Codex, and Cursor plugin surface checks.