Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,34 @@

Shared contracts and runtime libraries for CommerceKit GitHub Actions. This public repository is a pnpm monorepo, not a GitHub Marketplace Action. There is no root `action.yml`.

The source manifests prepare `notification-contract@0.0.6` (unpublished candidate) and `ccv2-client@0.0.3` under the `preview` dist-tag. Source versions are not registry publication evidence. APIs remain pre-1.0; verify registry publication before installation. Placeholder reserved versions, if published later, are not supported dependencies.
`notification-contract@0.0.6` and `ccv2-client@0.0.3` are published preview packages. APIs remain pre-1.0; pin supported exact versions. See the [publication evidence and consumer compatibility record](docs/release-status.md) for the current pins and the distinction between source integrations and released Actions. Reservation versions are unsupported placeholders.

| Package | Responsibility | Consumers |
| ------------------------------------------ | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `@commercekit-tools/notification-contract` | NotificationEvent v1 schema, semantic validation, safe context, factories and text primitives | Notify, Build, Deploy, future Check, reusable workflows and external producers |
| `@commercekit-tools/ccv2-client` | Technical-user OAuth and policy-driven Cloud Portal HTTP transport | Build, Deploy and future CCv2 Actions |
| Package | Responsibility | Consumers |
| ------------------------------------------ | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `@commercekit-tools/notification-contract` | NotificationEvent v1 schema, semantic validation, safe context, factories and text primitives | Notify, Setup, Build, Deploy, Cleanup and integration tests; future Check/reusable workflows |
| `@commercekit-tools/ccv2-client` | Technical-user OAuth and policy-driven Cloud Portal HTTP transport | Build, Deploy, Cleanup and integration tests; future CCv2 Actions |

The packages release independently and do not depend on each other. Notification producers need no CCv2 knowledge. Neither package depends on GitHub Actions SDKs.

```mermaid
flowchart LR
Notify --> Contract[notification-contract]
Setup --> Contract
Cleanup --> Contract
Harness[Integration tests] --> Contract
Build --> Contract
Deploy --> Contract
Check[Future Check] --> Contract
Workflows[Reusable workflows] --> Contract
Workflows[Future reusable workflows] --> Contract
Build --> Client[ccv2-client]
Deploy --> Client
Cleanup --> Client
Harness --> Client
```

Provider rendering and delivery, Action inputs/outputs, summaries, lifecycle state machines and endpoint-specific validation remain in consumers. See [architecture](docs/architecture.md), the original [extraction audit](docs/extraction-audit.md), and the current [remaining extraction audit](docs/remaining-extraction-audit.md).
Provider rendering and delivery, Action inputs/outputs and summary writes, lifecycle state machines and endpoint-specific validation remain in consumers. See [architecture](docs/architecture.md), the original [extraction audit](docs/extraction-audit.md), and the historical [remaining extraction audit](docs/remaining-extraction-audit.md).

Installation requires GitHub Packages access, including for public packages. Configure the scope registry and credentials using [the release configuration and authentication guide](docs/github-packages.md). Consumers must pin exact supported versions. The source manifests contain prepared preview versions; this is not evidence of publication.
Installation requires GitHub Packages access, including for public packages. Configure the scope registry and credentials using [the release configuration and authentication guide](docs/github-packages.md). Verify any future version's publication before adopting it; a source manifest alone is not evidence.

Develop with Node **24.21.0** and pnpm **12.6.0**:

Expand All @@ -38,11 +43,11 @@ The quality suite checks formatting, lint, TypeScript, coverage, builds, install

See [CONTRIBUTING](CONTRIBUTING.md) for individual commands, [compatibility policy](docs/compatibility-policy.md), [migration plan](docs/migration-plan.md) and [SECURITY](SECURITY.md).

Package reservation, preview/stable publication and GitHub Releases are separate manually confirmed owner workflows. Publication never runs on push or PR. [RELEASING](RELEASING.md) describes two-phase recovery and coordinated stable gates. No package or Action is published by this implementation PR.
Package reservation, preview/stable publication and GitHub Releases are separate manually confirmed owner workflows. Publication never runs on push or PR. [RELEASING](RELEASING.md) describes two-phase recovery and coordinated stable gates. Documentation and normal CI do not publish packages or Actions.

The manual publish workflow verifies the exact commit's CI/CodeQL results and publishes the tested tarball after an integrity check. A separate manual workflow verifies registry publication before creating a package-specific Git tag and GitHub Release. See [dispatch examples](RELEASING.md#dispatch-examples-after-merge-and-owner-approval). Tags do not trigger publication.

The [consistent Action reporting candidate](docs/action-reporting.md) adds shared
The [published consistent Action reporting contract](docs/action-reporting.md) adds shared
input snapshots, status styling, GitHub summary formatting and setup events.
Published 0.0.5 remains the registry baseline; candidate consumer readiness is
blocked until separately authorized 0.0.6 publication and normal repinning.
The [compatibility record](docs/release-status.md) identifies the registry-backed
consumers and reporting enhancements that remain unreleased as Actions.
10 changes: 5 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Nothing is published by a feature PR or ordinary CI. Package versions are immuta
2. Verify main CI and CodeQL.
3. Optionally dispatch `reserve-package-names` with confirmation `RESERVE-COMMERCEKIT-PACKAGES`. It publishes only temporary unsupported `0.0.0-reserved.1` packages under `reserved`, never source implementations or `preview`/`latest`. Both versions are checked absent before publishing. If one succeeds and the second fails, stop for owner review rather than bypassing immutability checks.
4. Configure public visibility, repository association and Actions read access using the [package access checklist](docs/github-packages.md#package-access).
5. Prepare a selected-package version/changelog PR. Source manifests currently prepare `notification-contract@0.0.4` and `ccv2-client@0.0.3`. Source versions are not registry publication evidence. Source versions are not publication evidence.
5. Prepare a selected-package version/changelog PR for a new unpublished version. Check the [current publication record](docs/release-status.md) first; never attempt to republish an existing version. Source manifests alone are not registry publication evidence.
6. Merge the reviewed version PR.
7. Dispatch `publish-package`: package `notification-contract` or `ccv2-client`, channel `preview` or `stable`, exact confirmation `PUBLISH-COMMERCEKIT-PREVIEW` or `PUBLISH-COMMERCEKIT-STABLE`. Preview accepts nonzero `0.x.y` initial releases (including `0.0.1`) or `0.x.y-preview.n`; stable requires 1.0.0 or later without prerelease. The workflow checks version absence and successful CI/CodeQL for the exact main commit, runs full quality and the selected pack/install checks, and verifies clean generated files. It retains the tested tarball in runner temporary storage, verifies its SHA-256 immediately before publication, and publishes those exact bytes with `preview` or `latest` and lifecycle scripts disabled. No source-directory repack or artifact upload is involved.
8. Verify the exact package version in GitHub Packages and its visibility/access.
Expand All @@ -23,22 +23,22 @@ The release workflow fails closed if required CI check evidence is unavailable.

## Dispatch examples after merge and owner approval

Use GitHub's Actions tab or the following commands after the version/changelog PR is merged and main checks pass. These examples publish only the selected package; repeat deliberately for the other package. They are instructions, not commands executed by this implementation.
Use GitHub's Actions tab or the following commands only for a future approved version after its version/changelog PR is merged and main checks pass. These examples publish only the selected package; repeat deliberately for the other package. The [currently published versions](docs/release-status.md) must not be republished. No dispatch is performed by a documentation update.

```sh
gh workflow run publish-package.yml --ref main \
-f package=notification-contract -f channel=preview \
-f confirmation=PUBLISH-COMMERCEKIT-PREVIEW
```

Wait for publication success and verify the exact registry version before the separate tag/Release phase:
Wait for publication success and verify the exact registry version before the separate tag/Release phase. Set `PUBLISHED_VERSION` to that newly published, owner-approved version:

```sh
gh workflow run create-package-release.yml --ref main \
-f package=notification-contract -f version=0.0.3 \
-f package=notification-contract -f version="$PUBLISHED_VERSION" \
-f confirmation=CREATE-COMMERCEKIT-PACKAGE-RELEASE
```

This creates `notification-contract-v0.0.3`; selecting ccv2-client creates its independent `ccv2-client-v<version>` tag. Stable publication uses channel `stable`, a reviewed stable manifest version and confirmation `PUBLISH-COMMERCEKIT-STABLE`.
This creates `notification-contract-v<version>`; selecting ccv2-client creates its independent `ccv2-client-v<version>` tag. Stable publication uses channel `stable`, a reviewed stable manifest version and confirmation `PUBLISH-COMMERCEKIT-STABLE`.

Tags are an output of the verified release phase, not a publication trigger. This keeps failed publication from creating a misleading release tag and avoids relying on a token-created tag to trigger another workflow. Both release phases require explicit dispatch. The publish and Release jobs have `checks: read` to verify commit check results and `security-events: read` to verify exact-commit main CodeQL analyses and the absence of open alerts; CI remains read-only and publication has no contents-write permission.
59 changes: 17 additions & 42 deletions docs/action-reporting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Consistent Action reporting candidate
# Consistent Action reporting

The five release-candidate Actions are setup-commercekit, ccv2-build,
ccv2-deploy, ccv2-build-cleanup and notify. They share this reporting contract
The reporting implementations in setup-commercekit, ccv2-build,
ccv2-deploy, ccv2-build-cleanup and notify share this contract
through the existing notification-contract package. No new package, authentication
implementation, provider delivery, schedule or SAP operation is introduced.

Expand Down Expand Up @@ -73,45 +73,20 @@ The package contains no CLI execution, Action I/O or provider renderer. Factorie
project known event fields and validate; callers retain endpoint-specific result
projection and register tokens with their existing masker.

## Provenance and rollout gate

Source prepares **0.0.6**, an unpublished candidate. Registry-backed baseline
0.0.5 is published; it lacks these shared helpers and the setup event. Existing
source baselines inspected for this change:

| Repository | Main inspected |
| ------------------------ | ------------------------------------------ |
| action-kit | `7cc2e8e6af46e7438064cc6205b22f4f7154eb94` |
| notify | `6331ff4a60956a3a2b546e84d737c9338ca46bda` |
| setup-commercekit | `7f650f3162ab027bfd784cf879832f44d3248584` |
| ccv2-build | `923535d589bd8cebece4f3cbf479608f9535c4c3` |
| ccv2-deploy | `bb6d1d6a2ac43a5b6e5b6831c78c5cf28bdb95ca` |
| ccv2-build-cleanup | `9b7ab34515a2fb8ed643f786f754e44e485868d2` |
| action-integration-tests | `e6cefd75d5a926ca2232ac06f332e5b4394a09b5` |

Candidate consumers must use the exact-source packed tarball only in isolated
private integration workspaces, recording source commits, tarball integrity and
bundle hashes. Normal registry dependencies/lockfiles must never pretend that
0.0.6 is published or contain developer-local links. Consumer readiness remains
**BLOCKED** until a separately authorized publication, exact registry repinning,
normal bundle regeneration and green validation. Publication and source merge
do not authorize release tags, deployment, provider sends or real SAP deletion.

## Validation

The additive contract suite passes **394 tests in 12 files** on Node 24.21.0
and pnpm 12.6.0. Notification-contract coverage is **100% statements, 99.64%
branches, 100% functions and 100% lines**. All existing 95% thresholds remain
unchanged, including the untouched CCv2 client package. Focused tests cover every
new status, confidential-first capture, all-input previews, forged snapshots,
malformed Unicode secrets, schema/type compatibility, private links, Markdown/
HTML escaping, explicit truncation and the UTF-8 summary cap.

Packed ESM, JSON schema, declarations and public export boundaries are exercised
with installed temporary consumers. Full quality, public scanning and audit must
pass before the exact-source tarball is retained for final consumer replay.
Candidate consumer totals and exact artifact/source/bundle fingerprints are
recorded separately; WIP artifact success is not final registry readiness.
## Release and validation provenance

These helpers are available in published notification-contract 0.0.6. Use normal
exact registry dependencies, not private candidate tarballs or machine-local
links. The [publication and consumer compatibility record](release-status.md)
owns the successful publication evidence, reviewed source pins and separate
Action release status. Setup's released v1 interface does not yet contain the
reporting output present on main.

The original source-candidate baseline table, test totals and packed replay
procedure remain archived in the
[immutable pre-publication report](https://github.com/commercekit-tools/action-kit/blob/3fecce40414d709884fa48e48eca278f470b20b0/docs/action-reporting.md#provenance-and-rollout-gate).
Those historical results do not replace current consumer validation or prove
live provider delivery, real SAP behavior or coordinated stable readiness.

Independent privacy review found and reproduced two gaps before publication:
known secrets encoded with lowercase/mixed-case percent hex, and Slack webhook
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Two focused ESM libraries form independent boundaries. `notification-contract` owns NotificationEvent v1, not notification delivery. `ccv2-client` owns authentication and HTTP mechanics, not CCv2 business operations. The root workspace is private. Only `packages/*` are workspace members; compatibility adapters are private test source, not packages.

Notify → notification-contract. Build and Deploy → notification-contract + ccv2-client. Future Check and reusable workflows → notification-contract. Neither library imports the other or `@actions/core` / `@actions/github`.
Notify and Setup → notification-contract. Build, Deploy, Cleanup and the integration harness → notification-contract + ccv2-client. Future Check and reusable workflows → notification-contract. Current package pins, publication evidence and released-versus-main interfaces live in the [compatibility record](release-status.md). Neither library imports the other or `@actions/core` / `@actions/github`.

The contract schema is copied from Notify main at the exact SHA in `compatibility/baselines.json`. `src/schema.ts` embeds the identical JSON for a filesystem-free runtime; a parity test compares it with the canonical schema file. JSON Schema handles version, event/status compatibility, counts and bounds. Additional semantic HTTPS checks apply to links and run URLs. Additive v1 fields remain accepted by validation; factories select supported data, source, link and safe error fields. Factories accept normalized producer data rather than raw API responses. They validate the result; callers sanitize any untrusted human-readable text first.

`extractSafeGitHubContext` reads only the approved runner fields. It rejects malformed repositories, run IDs, attempts and unsafe server origins. It never reads an event payload. Producer merge applies explicit producer values before filling gaps; factories can generate a run URL from extracted runner identity. Notifier merge preserves additive producer context and fills only missing/empty values; it never overwrites valid producer identity. The functions are separate public operations even where their current fill-only behavior overlaps. Generated run URLs use the merged repository/run ID on the validated extracted server origin, matching Notify enrichment; explicit producer run URLs always win.

The transport requires a policy for every request. `token` and `safe-read` allow bounded transient retries; `unsafe-mutation` permits one attempt for network, timeout, 429 and selected 5xx outcomes. A caller can explicitly opt into one 401 invalidation/replay for any policy. There is no method-based inference. Bodies must be replayable strings or bytes, not streams. Consumers own mutation ambiguity classification and endpoint-specific status/shape validation.

All bodies are streamed with a byte bound and request abort signal. JSON content types support objects, arrays and primitives; zero-byte bodies are empty; other content types remain binary. Error response bodies are discarded except bounded, redacted problem facts. Consumers decide whether to show those facts. No logging, telemetry, persistence, build/deployment operations or step summaries exist in either library.
All bodies are streamed with a byte bound and request abort signal. JSON content types support objects, arrays and primitives; zero-byte bodies are empty; other content types remain binary. Error response bodies are discarded except bounded, redacted problem facts. Consumers decide whether to show those facts. No logging, telemetry, persistence, build/deployment operations or step-summary I/O exist in either library. Notification-contract provides pure shared status and summary formatting; consumers own writes and preserve the underlying operation outcome.
Loading
Loading