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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Commit TypeScript source, focused tests, lockfile changes, and rebuilt `dist/` t

Use visibly synthetic fixtures only. No real SAP credentials, tenant endpoints, customer identifiers, production subscription requests, private source, local machine paths, or live API recordings belong here. IntelliJ files, node_modules, coverage, and local environment files are ignored. Never read the complete GitHub event payload into notification data.

Both shared packages are pinned to `0.0.2`. `.npmrc` commits only the `@commercekit-tools` registry mapping. Before installation, configure a **user-level**, untracked npm configuration containing `//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}` and supply `NODE_AUTH_TOKEN` through your secure credential tooling. Use a GitHub token with `read:packages` and access to both packages. Never put the token in repository configuration or command-line arguments. pnpm 12 verifies lockfile supply-chain metadata during installation; after a lockfile change, repeat the authenticated frozen installation before running other pnpm commands.
Both shared packages are pinned to `0.0.3`. `.npmrc` commits only the `@commercekit-tools` registry mapping. Before installation, configure a **user-level**, untracked npm configuration containing `//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}` and supply `NODE_AUTH_TOKEN` through your secure credential tooling. Use a GitHub token with `read:packages` and access to both packages. Never put the token in repository configuration or command-line arguments. pnpm 12 verifies lockfile supply-chain metadata during installation; after a lockfile change, repeat the authenticated frozen installation before running other pnpm commands.

CI and the manual Sandbox workflow grant only `contents: read` and `packages: read`, use the existing SHA-pinned setup-node Action with the scoped registry, and expose `secrets.GITHUB_TOKEN` only to installation steps. Package owners must grant this repository Actions read access to both packages. The bundled Action needs no registry credentials.

`pnpm contracts:check` verifies installed and declared package versions, imports the package's public schema export, validates the captured baseline events, rejects the old duplicate schema, and runs Action-level compatibility scenarios offline. It never fetches Notify main or a live schema. Baseline fixtures were captured from `ebdc830161cf9122121ddeb137d005f375063997`; do not regenerate them merely to accept a changed result.

Review package upgrades for authentication/refresh behavior, explicit retry policies, disclosure, event compatibility, licenses, and bundle changes. Use exact published versions, run all quality gates, and rebuild committed dist. The release-age exceptions in pnpm-workspace.yaml apply only to the two explicitly reviewed `0.0.2` versions; they do not exempt future versions.
Review package upgrades for authentication/refresh behavior, explicit retry policies, disclosure, event compatibility, licenses, and bundle changes. Use exact published versions, run all quality gates, and rebuild committed dist. The release-age exceptions in pnpm-workspace.yaml apply only to the two explicitly reviewed `0.0.3` versions; they do not exempt future versions.

Read [Sandbox policy](docs/sandbox.md) before requesting live smoke approval. Routine PR CI must never create Sandbox runs. No deployment implementation, provider delivery, new shared package publication, tags, or release belongs in this change. Review [RELEASING.md](RELEASING.md).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Create-build POST is **not** automatically retried after timeout, network ambigu

## Shared dependencies

`@commercekit-tools/notification-contract@0.0.2` and `@commercekit-tools/ccv2-client@0.0.2` are pinned exactly and bundled into `dist/index.js`. Workflow consumers do not install these packages, authenticate to GitHub Packages, or grant `packages: read` to run the bundled Action. Build endpoint validation, polling, deadlines, status mapping, result JSON, outputs, and summaries remain owned by this Action. See the [migration inventory and compatibility checks](docs/shared-packages.md).
`@commercekit-tools/notification-contract@0.0.3` and `@commercekit-tools/ccv2-client@0.0.3` are pinned exactly and bundled into `dist/index.js`. Workflow consumers do not install these packages, authenticate to GitHub Packages, or grant `packages: read` to run the bundled Action. Build endpoint validation, polling, deadlines, status mapping, result JSON, outputs, and summaries remain owned by this Action. See the [migration inventory and compatibility checks](docs/shared-packages.md).

Maintainers and CI need GitHub Packages read access for dependency installation; see [CONTRIBUTING.md](CONTRIBUTING.md). Package upgrades require compatibility review and a rebuilt bundle. Publishing a shared package does not release this Action.

Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Implementation may merge after review. Do not create `v1.0.0`, create or move `v

The manual Sandbox workflow requires owner approval after PR review and local/CI success. The five scenarios passed locally with the same guarded scripts and bundled Action under explicit owner approval on 2026-11-09; see [validation evidence](docs/build-validation.md). GitHub-hosted dispatch was unavailable before the workflow existed on main. Do not infer live smoke authorization from permission to merge. No release workflow is provided here. Future maintainers must separately design and review coordinated version-tag and publication procedures after every gate passes.

The shared-package migration does not satisfy any additional live validation gate and does not authorize release. Both shared dependencies remain exactly pinned at `0.0.2` and included in dist. Before approving a package upgrade, review the public contract, authentication/retry behavior, licenses, offline compatibility fixtures, standalone bundle test, and reproducibility. Existing Sandbox evidence describes the earlier implementation; live Sandbox verification of a migration requires separate owner authorization.
The shared-package migration does not satisfy any additional live validation gate and does not authorize release. Both shared dependencies remain exactly pinned at `0.0.3` and included in dist. Before approving a package upgrade, review the public contract, authentication/retry behavior, licenses, offline compatibility fixtures, standalone bundle test, and reproducibility. Existing Sandbox evidence describes the earlier implementation; live Sandbox verification of a migration requires separate owner authorization.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Only synthetic fixtures belong in this public repository. Never add real SAP cre

Exact direct dependencies, pinned external Actions, CodeQL, Dependabot, bundle reproducibility, and offline contract validation are part of the quality gate. The minimatch override in pnpm-workspace.yaml mitigates GHSA-g3hv-75wg-m249 in development tooling; remove it only after upstream dependencies select a patched compatible version.

Shared authentication/transport and notification code comes from the exact published `@commercekit-tools/ccv2-client@0.0.2` and `@commercekit-tools/notification-contract@0.0.2` packages. They are included in the reviewed bundle; runtime does not access GitHub Packages. Registry authentication is for maintainer/CI installation only, with read-only package permissions and no committed credentials. Package upgrades must retain mutation retry safety, secret masking/redaction, bounded outputs, and the compatibility fixtures. Build retains its conservative markup/JWT disclosure filter and HTML summary escaping around the shared sanitizers.
Shared authentication/transport and notification code comes from the exact published `@commercekit-tools/ccv2-client@0.0.3` and `@commercekit-tools/notification-contract@0.0.3` packages. They are included in the reviewed bundle; runtime does not access GitHub Packages. Registry authentication is for maintainer/CI installation only, with read-only package permissions and no committed credentials. Package upgrades must retain mutation retry safety, secret masking/redaction, bounded outputs, and the compatibility fixtures. Build retains its disclosure order and HTML summary escaping; shared primitives implement markup filtering and linear JWT-like token redaction.
4 changes: 2 additions & 2 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The generated [dist/licenses.txt](dist/licenses.txt) is produced by `@vercel/ncc
Runtime direct dependencies:

- `@actions/core`: GitHub inputs, masking, outputs, logs, summary, and failure status.
- `@commercekit-tools/ccv2-client@0.0.2`: technical-user authentication, token lifecycle, validated transport, retry policies, and safe problem facts.
- `@commercekit-tools/notification-contract@0.0.2`: NotificationEvent v1 types/schema, validation, factories, context/links, and text sanitization. Its exact Ajv and ajv-formats dependencies provide JSON Schema 2020-12, URI, and date-time validation.
- `@commercekit-tools/ccv2-client@0.0.3`: technical-user authentication, token lifecycle, validated transport, retry policies, and safe problem facts.
- `@commercekit-tools/notification-contract@0.0.3`: NotificationEvent v1 types/schema, validation, factories, context/links, and text sanitization. Its exact Ajv and ajv-formats dependencies provide JSON Schema 2020-12, URI, and date-time validation.

Development tooling: TypeScript and Node types, ESLint with typescript-eslint and globals, Prettier, Vitest and V8 coverage, and ncc. Development-only dependencies are not runtime requirements. Exact versions and transitive licenses are inspectable through package.json and pnpm-lock.yaml. SAP-authored OpenAPI is not included or relicensed.
2 changes: 1 addition & 1 deletion contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NotificationEvent contract

The Action uses the public exports of `@commercekit-tools/notification-contract@0.0.2`, published from the MIT-licensed [CommerceKit Action Kit](https://github.com/commercekit-tools/action-kit). The package owns NotificationEvent v1 types, schema, validator, event factory, safe context/links, and generic text sanitization. No schema is vendored locally and no runtime dependency on the Notify Action exists.
The Action uses the public exports of `@commercekit-tools/notification-contract@0.0.3`, published from the MIT-licensed [CommerceKit Action Kit](https://github.com/commercekit-tools/action-kit). The package owns NotificationEvent v1 types, schema, validator, event factory, safe context/links, and generic text sanitization. No schema is vendored locally and no runtime dependency on the Notify Action exists.

`pnpm contracts:check` imports `@commercekit-tools/notification-contract/schema`, checks schemaVersion 1 and exact installed/declared versions of both shared packages, verifies the local duplicate is absent, validates every pre-migration fixture, and executes all 16 compatibility scenarios against the current Action. Checks are offline after dependency installation. Event creation validates at runtime through `createBuildEvent` and `validateNotificationEvent` inside the package. Sandbox assertions use the same public validator.

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions docs/shared-packages.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Shared-package migration

This source-de-duplication uses exactly `@commercekit-tools/notification-contract@0.0.2` and `@commercekit-tools/ccv2-client@0.0.2`. The baseline is `ebdc830161cf9122121ddeb137d005f375063997`. Action metadata, lifecycle decisions, and public inputs/outputs are unchanged. No Notify, Deploy, Sandbox, or legacy repository is modified.
This source-de-duplication uses exactly `@commercekit-tools/notification-contract@0.0.3` and `@commercekit-tools/ccv2-client@0.0.3`. The baseline is `ebdc830161cf9122121ddeb137d005f375063997`. Action metadata, lifecycle decisions, and public inputs/outputs are unchanged. No Notify, Deploy, Sandbox, or legacy repository is modified.

## Responsibility inventory

| Existing module or responsibility | Classification | Result |
| --------------------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Vendored schema, provenance, copied license, update script, Ajv setup | REPLACE WITH NOTIFICATION PACKAGE | Removed; use public schema export and validator |
| `src/notification.ts` event envelope, types, context, workflow URL | MIXED — SPLIT | Shared `createBuildEvent`/context extraction; local outcome/result mapping and known-secret exclusions; shared factory selects approved data/error fields and the Build source |
| `src/security.ts` bounded text/error and exact-secret redaction | MIXED — SPLIT | Shared sanitizers and transport redaction; retain Build's masking registry, markup/JWT disclosure filter, and summary HTML escaping |
| `src/security.ts` bounded text/error and exact-secret redaction | MIXED — SPLIT | Shared sanitizers and transport redaction; retain Build's masking registry, filter ordering, and summary HTML escaping |
| `src/auth.ts` token exchange, cache, proactive refresh | REPLACE WITH CCV2 PACKAGE | Removed; `TechnicalUserTokenManager` owns token lifecycle |
| `src/http.ts` timeout, response reading, retries, Retry-After | REPLACE WITH CCV2 PACKAGE | Removed; shared client owns transport; monotonic Action runtime injection retained in `src/runtime.ts` |
| `src/inputs.ts` URL parsing | MIXED — SPLIT | Shared URL validators; local input constraints and stable INVALID_INPUT translation |
Expand Down Expand Up @@ -42,6 +42,12 @@ The duplication audit also replaces credential/runtime type declarations with `T
The remaining local helpers have no equivalent public API in the pinned packages:

- Poll/retry counting and transport-error translation preserve the existing Action outputs and stable error codes. They do not implement token storage, HTTP reads, retry loops, or 401 replay.
- Exact-secret registration connects package masking to `core.setSecret`. The markup/JWT filter and HTML summary escaping preserve Build's existing disclosure and rendering policy; generic redaction, bounds, and error text use package primitives.
- Exact-secret registration connects package masking to `core.setSecret`. The ordering of shared markup/JWT filters and local HTML summary escaping preserves Build's existing disclosure and rendering policy; generic redaction, bounds, and error text use package primitives.
- GitHub context filtering excludes known secrets and control characters before shared extraction. The shared extractor owns the field allowlist and run URL construction; the Action supplies its existing workflow-link label.
- Sandbox control requests use the separate control API's `Authorization` bearer model. The CCv2 Management client always sends `x-approuter-authorization`, so it is not a compatible replacement for these test-harness requests. No live Sandbox request is needed for this audit.

## Shared primitives in 0.0.3

CCv2 path-segment validation/encoding now delegates to `encodeCcv2PathSegment`. The Action keeps input diagnostics and translates `INVALID_PATH_ENCODING` to its existing malformed-Unicode failure classification. Markup filtering and JWT-shaped token redaction delegate to `stripAngleBracketText` and `redactJwtLikeTokens` at their original positions in the sanitization pipeline. The new JWT scanner removes the copied regex's quadratic behavior on repeated prefixes. No provider rendering, masking registration, HTML summary escaping, endpoint validation or lifecycle logic moves into the package.

The frozen integration corpus compares 25 text cases and 29 identifier cases with the pre-extraction Action. It includes the long-markup/truncation behavior that differs between Build and Deploy. Action metadata and existing notification-event fixtures remain unchanged.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"dependencies": {
"@actions/core": "3.0.1",
"@commercekit-tools/ccv2-client": "0.0.2",
"@commercekit-tools/notification-contract": "0.0.2"
"@commercekit-tools/ccv2-client": "0.0.3",
"@commercekit-tools/notification-contract": "0.0.3"
},
"devDependencies": {
"@eslint/js": "10.0.1",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minimumReleaseAgeExclude:
- "@commercekit-tools/ccv2-client@0.0.2"
- "@commercekit-tools/notification-contract@0.0.2"
- "@commercekit-tools/ccv2-client@0.0.3"
- "@commercekit-tools/notification-contract@0.0.3"
# Development tooling mitigation for GHSA-g3hv-75wg-m249.
overrides:
minimatch: 11.0.1
4 changes: 2 additions & 2 deletions scripts/contracts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ for (const name of ["notification-contract", "ccv2-client"]) {
const { default: pkg } = await import(id + "/package.json", {
with: { type: "json" },
});
assert.equal(pkg.version, "0.0.2");
assert.equal(root.dependencies[id], "0.0.2");
assert.equal(pkg.version, "0.0.3");
assert.equal(root.dependencies[id], "0.0.3");
}
assert.equal(schema.properties.schemaVersion.const, 1);
assert(!existsSync("contracts/notification-event-v1.schema.json"));
Expand Down
Loading
Loading