@ai-ecoverse/slicc-shared-web 2.13.2 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -3
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -73,7 +73,7 @@ The caller cancels superseded runs on pull requests only, so a push to `main` ne
73
73
 
74
74
  **Deploy** runs on pull requests only, never in the merge queue, with `id-token: write` for an OIDC-authenticated deploy. The merge queue's tests therefore run without `STAGING_URL`: a test that needs it skips when it's empty. It runs the pull request's own code, so it gets no secret unless `deploy-secrets` names it: a newline- or space-separated list of secret names, which the step exports as environment variables. The pipeline's own `AWS_BEARER_TOKEN_BEDROCK`, `SLICC_ISSUES_TOKEN`, `CLOUDFLARE_API_TOKEN` and `github_token` are never exported. The command writes `url=<staging URL>` to `$GITHUB_OUTPUT`; the tests and the reviewers get it as `STAGING_URL`.
75
75
 
76
- **Integration tests** install Chrome for Testing with `slicc-cdp install-browser` (with `--with-deps` where the runner has root or passwordless sudo) (`--version` from the `chrome` input, stable without it), then each runs its share of the files matching `test-glob`. `lint` plans the split once for all `shards`, so the shards can't disagree: it weighs each file by the most it took in the last five completed runs of the same workflow that uploaded `timings` (merge queue runs first, then pull request runs, none from a fork), since a file that downloads a lot can take several times its median when the network is slow, and hands each file to the shard with the least time so far, longest first; a file without a timing counts as the average, and without any timings every file counts the same. `integration` uploads each run's `junit/**/*.times` and `junit/**/*.xml` as one `timings` artifact, so `lint` downloads one artifact per earlier run through the REST API with the job token (about a dozen requests a run, of the repo's 1,000 an hour); until a run has one, it reads the `junit-*` artifacts of the newest run that has them. Its log names the predicted seconds of each shard, how many files had timings, and from which runs. A file's time is its own wall time where `shard.cjs` recorded one: it preloads `harness/file-time.cjs` into each test file's own process, which writes the file's wall time to `junit/<shard>-<pid>.times` when it exits, so tests registered through a shared helper still count for the file that ran them. Otherwise it is the sum of the JUnit times of the tests that name the file, and Node names the file that calls `test()`. Each shard runs the repo's own `test` command unchanged: `harness/shard.cjs`, preloaded through `NODE_OPTIONS`, makes the outermost `node --test` run only the shard's files that its own patterns match, writes `junit/<shard>.xml` next to the usual spec output, and then takes itself out of the environment, so a `node --test` that a test starts runs as it would without it. Files a `node --test` call would run that are not in `test-glob` (unit tests, say, whether in the same call or another) run on shard 0 only, so nothing is dropped; when `test-glob` matches nothing, shard 0 runs the command unchanged and the others run nothing. Each call keeps its own JUnit report (`junit/<shard>-<pid>.xml` for all but the last). Each shard uploads `coverage/`, `artifacts/` and `junit/` as `integration-<shard>`. Before its tests, each shard restores the harness's download cache, `node_modules/.cache/slicc-harness/cdn` (after `npm ci`, which would remove it), from the newest cache whose key starts with `slicc-harness-cdn-<OS>-<hash of every package-lock.json and pnpm-lock.yaml>`, else `slicc-harness-cdn-<OS>-`, so a lockfile change still starts warm. The harness's `download()` lists each npm tarball and exact-version jsdelivr file it served in the file `SLICC_TEST_DOWNLOADS` names, which the shard sets to `junit/<shard>.downloads` (an older `@ai-ecoverse/slicc-shared-web` lists nothing, so its cache stays empty). Shards only restore: a cache saved on a pull request or in the merge queue would be scoped to that ref, so no later run could use it. On a push to `main`, `downloads` reads those lists from the newest successful merge queue run (else pull request run, never a fork's), restores the cache, fetches what's missing (only tarballs from `registry.npmjs.org` and exact-version files from `cdn.jsdelivr.net`), deletes what no shard listed, and saves it under the key plus a hash of the list, only when the list changed. The cache never holds packuments, attestations or other files that can change, so a restored cache can't serve stale metadata; those are fetched fresh as before. `integration` passes only when every shard did and their JUnit reports add up to at least one test that ran, not skipped, and no failure or error (the placeholder an empty shard runs doesn't count), and every file matching `test-glob` was handed to `node --test` on exactly one shard (`shard.cjs` lists the files it hands over next to its JUnit report, as `junit/<shard>-<pid>.files`, since a test registered through a helper is attributed to the helper); a file that ran on no shard or on two is named as an error, and it prints `integration: PASS <n> tests (<k> skipped) in <m> JUnit reports, <f> of <f> test-glob files on exactly one shard` or `integration: FAIL <why>`; a repo without node tests sets `require-tests: false`. Setting `NODE_OPTIONS` in `test` would replace the pipeline's own, which carry the shard preload and the JUnit reporter, so extra node flags (a bigger heap, say) go in `node-options`. `integration` is therefore the one check to require for the tests, under the caller's job name (`ci / integration`). A suite whose last step reads every test's artifacts, as this repo's `verify.mjs` does, sets `shards: 1`.
76
+ **Integration tests** install Chrome for Testing with `slicc-cdp install-browser` (with `--with-deps` where the runner has root or passwordless sudo) (`--version` from the `chrome` input, stable without it), then each runs its share of the files matching `test-glob`. `lint` plans the split once for all `shards`, so the shards can't disagree: it weighs each file by the most it took in the last ten completed runs of the same workflow that uploaded `timings` (merge queue runs first, then pull request runs, none from a fork), since a file that downloads a lot can take several times its median when the network is slow. Files whose most is over twice their median go first, longest first, each to the shard with the fewest of them (then the least time), so the files that are slow together in a slow run don't pile up on one shard; then every other file goes to the shard with the least time so far, longest first; a file without a timing counts as the average, and without any timings every file counts the same. `integration` uploads each run's `junit/**/*.times` and `junit/**/*.xml` as one `timings` artifact, so `lint` downloads one artifact per earlier run through the REST API with the job token (about a dozen requests a run, of the repo's 1,000 an hour); until a run has one, it reads the `junit-*` artifacts of the newest run that has them. Its log names the predicted seconds of each shard, how many files had timings, from which runs, and which files took over twice their median. A file's time is its own wall time where `shard.cjs` recorded one: it preloads `harness/file-time.cjs` into each test file's own process, which writes the file's wall time to `junit/<shard>-<pid>.times` when it exits, so tests registered through a shared helper still count for the file that ran them. Otherwise it is the sum of the JUnit times of the tests that name the file, and Node names the file that calls `test()`. Each shard runs the repo's own `test` command unchanged: `harness/shard.cjs`, preloaded through `NODE_OPTIONS`, makes the outermost `node --test` run only the shard's files that its own patterns match, writes `junit/<shard>.xml` next to the usual spec output, and then takes itself out of the environment, so a `node --test` that a test starts runs as it would without it. Files a `node --test` call would run that are not in `test-glob` (unit tests, say, whether in the same call or another) run on shard 0 only, so nothing is dropped; when `test-glob` matches nothing, shard 0 runs the command unchanged and the others run nothing. Each call keeps its own JUnit report (`junit/<shard>-<pid>.xml` for all but the last). Each shard uploads `coverage/`, `artifacts/` and `junit/` as `integration-<shard>`. Before its tests, each shard restores the harness's download cache, `node_modules/.cache/slicc-harness/cdn` (after `npm ci`, which would remove it), from the newest cache whose key starts with `slicc-harness-cdn-<OS>-<hash of every package-lock.json and pnpm-lock.yaml>`, else `slicc-harness-cdn-<OS>-`, so a lockfile change still starts warm. The harness's `download()` lists each npm tarball and exact-version jsdelivr file it served in the file `SLICC_TEST_DOWNLOADS` names, which the shard sets to `junit/<shard>.downloads` (an older `@ai-ecoverse/slicc-shared-web` lists nothing, so its cache stays empty). Shards only restore: a cache saved on a pull request or in the merge queue would be scoped to that ref, so no later run could use it. On a push to `main`, `downloads` reads those lists from the newest successful merge queue run (else pull request run, never a fork's), restores the cache, fetches what's missing (only tarballs from `registry.npmjs.org` and exact-version files from `cdn.jsdelivr.net`), deletes what no shard listed, and saves it under the key plus a hash of the list, only when the list changed. The cache never holds packuments, attestations or other files that can change, so a restored cache can't serve stale metadata; those are fetched fresh as before. `integration` passes only when every shard did and their JUnit reports add up to at least one test that ran, not skipped, and no failure or error (the placeholder an empty shard runs doesn't count), and every file matching `test-glob` was handed to `node --test` on exactly one shard (`shard.cjs` lists the files it hands over next to its JUnit report, as `junit/<shard>-<pid>.files`, since a test registered through a helper is attributed to the helper); a file that ran on no shard or on two is named as an error, and it prints `integration: PASS <n> tests (<k> skipped) in <m> JUnit reports, <f> of <f> test-glob files on exactly one shard` or `integration: FAIL <why>`; a repo without node tests sets `require-tests: false`. Setting `NODE_OPTIONS` in `test` would replace the pipeline's own, which carry the shard preload and the JUnit reporter, so extra node flags (a bigger heap, say) go in `node-options`. `integration` is therefore the one check to require for the tests, under the caller's job name (`ci / integration`). A suite whose last step reads every test's artifacts, as this repo's `verify.mjs` does, sets `shards: 1`.
77
77
 
78
78
  **Windows.** With `windows-test` set, a `windows` job runs after lint on pull requests and in the merge queue, on GitHub-hosted `windows-latest`: checkout, setup-node at `node-version`, `npm ci`, then `windows-test` as a PowerShell 7 (`pwsh`) command, raw like the other commands, so a package script is `npm run test:windows`; a program that exits non-zero stops it, as `bash -e` would. Its token can only read and it gets no secrets. `integration` fails unless it passed, so `ci / integration` covers it and no other check needs requiring; without the input it is skipped, costs no Windows minutes, and `integration` doesn't wait for it. This repo's own CI runs it with `node -e "process.platform==='win32'||process.exit(1)"` only on a pull request labelled `windows` (the label counts from the next push).
79
79
 
@@ -104,11 +104,11 @@ Each reviewer answers with `findings.json`, held to one JSON schema:
104
104
  "verdict": "approved",
105
105
  "summary": "…",
106
106
  "comments": [{ "path": "src/a.ts", "line": 12, "body": "…" }],
107
- "issues": [{ "repo": "ai-ecoverse/slicc-cdp", "title": "…", "body": "…" }]
107
+ "issues": [{ "repo": "ai-ecoverse/slicc-cdp", "title": "…", "body": "…", "security": false }]
108
108
  }
109
109
  ```
110
110
 
111
- **Post** is the only job that writes to GitHub. Per reviewer it sets the commit status `review / claude` or `review / codex` (`success` for `approved`, `failure` for `denied`, `error` without findings), keeps one comment with its latest verdict and summary on the pull request (edited on each run), posts each comment on its line (or, for a line outside the diff, as a pull request comment naming it) unless the same comment is already there, and opens each issue unless one with the same title is already open. An issue in another repo of the same org needs `SLICC_ISSUES_TOKEN`, a token that can open issues there; without it, or when it is refused, the issue becomes a pull request comment instead. One outside the org is logged and skipped.
111
+ **Post** is the only job that writes to GitHub. Per reviewer it sets the commit status `review / claude` or `review / codex` (`success` for `approved`, `failure` for `denied`, `error` without findings), keeps one comment with its latest verdict and summary on the pull request (edited on each run), posts each comment on its line (or, for a line outside the diff, as a pull request comment naming it) unless the same comment is already there, and opens each issue unless one with the same title is already open. An issue in another repo of the same org needs `SLICC_ISSUES_TOKEN`, a token that can open issues there; without it, or when it is refused, the issue becomes a pull request comment instead. One outside the org is logged and skipped. Security findings stay in the review: a reviewer puts one in its summary or a line comment, never in an issue, and `post` files and posts no issue whose `security` isn't `false` (`true`, missing or not a boolean), logging only one line without its title or body, such as `kept a security finding out of the issue tracker (claude)`.
112
112
 
113
113
  **Release** runs `semantic-release` after lint, on a push to `main` only, without any test: what reached `main` went through the merge queue. GitHub sometimes rejects a push right after the tag push with a bare `(failed)`, most often semantic-release's push of `refs/notes/semantic-release-vX.Y.Z`, so the step puts a small `git` wrapper first on `PATH`: it retries `git push` and `git fetch` up to five times, 5, 10, 15 and 20 seconds apart, and runs every other git command once, as well as semantic-release's `git fetch --unshallow`, which fails on the job's full clone by design before semantic-release falls back to a plain fetch. When the push still fails, semantic-release fails before it publishes. With `release-environment`, the job runs in that GitHub environment, and `after-release` is a command run after semantic-release when it released, that is when a new `v*` tag points at the commit, with that version as `RELEASE_VERSION` (a production deploy, say). It gets the job's OIDC token. With `release-secrets`, a newline- or space-separated list of secret names, semantic-release and `after-release` get those secrets as environment variables (signing keys, say); without it they get none. With `attest`, a path or glob (a newline-separated list for several), the job attests the build provenance of those files after a release, through GitHub artifact attestations, even when a later semantic-release step such as the npm publish failed once the `v*` tag was pushed, so that tag's release never goes without its attestation: the certificate names `ai-ecoverse/slicc-shared-web/.github/workflows/pipeline.yml` at the pipeline's tag, and its build configuration names the caller's `.github/workflows/ci.yml`, so a verifier checks both. The release job asks for `attestations: write` whether or not `attest` is set, so the caller grants it.
114
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "2.13.2",
3
+ "version": "2.13.4",
4
4
  "description": "Shared Renovate, Biome, TypeScript, lefthook and GitHub Actions configuration, plus the CDP integration-test harness, for SLICC's web repos",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -75,8 +75,8 @@
75
75
  "release": "semantic-release"
76
76
  },
77
77
  "devDependencies": {
78
- "@ai-ecoverse/slicc-browsers": "1.18.15",
79
- "@ai-ecoverse/slicc-cdp": "1.41.22",
78
+ "@ai-ecoverse/slicc-browsers": "1.18.16",
79
+ "@ai-ecoverse/slicc-cdp": "1.42.2",
80
80
  "@biomejs/biome": "2.5.15",
81
81
  "lefthook": "2.2.2",
82
82
  "monocart-coverage-reports": "2.13.2",