@ai-ecoverse/slicc-shared-web 2.13.10 → 2.14.1
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.
- package/README.md +3 -3
- package/harness/chrome.mjs +2 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ Each reviewer answers with `findings.json`, held to one JSON schema:
|
|
|
110
110
|
|
|
111
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
|
-
**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. An `npm` wrapper, installed on PATH and temporarily at `node_modules/.bin/npm` so semantic-release's local binary lookup reaches it, checks `npm view <name>@<version> version` after every failed real publish using the publish directory's package.json. An exact visible version counts as success, including after E403 or an already-published error. If the version is absent, only `TLOG_CREATE_ENTRY_ERROR` or a 409 mentioning a transparency log, Sigstore or Rekor is retried, up to three attempts, 5 and 10 seconds apart. Every attempt keeps the publish arguments, including provenance; dry-run failures skip the registry check, and other failures keep their exit code. 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.
|
|
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. An `npm` wrapper, installed on PATH and temporarily at `node_modules/.bin/npm` so semantic-release's local binary lookup reaches it, checks `npm view <name>@<version> version` after every failed real publish using the publish directory's package.json. An exact visible version counts as success, including after E403 or an already-published error. If the version is absent, only `TLOG_CREATE_ENTRY_ERROR` or a 409 mentioning a transparency log, Sigstore or Rekor is retried, up to three attempts, 5 and 10 seconds apart. Every attempt keeps the publish arguments, including provenance; dry-run failures skip the registry check, and other failures keep their exit code. 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. It then attaches the attestation's Sigstore bundle (`actions/attest-build-provenance`'s `bundle-path`) to that tag's GitHub release, as `<file>.sigstore.json` when `attest` names a single file (`SHA256SUMS.sigstore.json` for `SHA256SUMS`) and as `attestation.sigstore.json` otherwise, through `gh release upload --clobber` with the job token, three attempts 5 and 10 seconds apart, failing the job when all three fail. A tag without a GitHub release (a caller whose semantic-release doesn't run `@semantic-release/github`) gets no bundle, and the step says so and passes. A client can download it like any release file and verify it offline, without the GitHub API and its rate limit of 60 requests an hour per IP address without a token; the bundle is the one the API serves, so trust comes from verifying it, not from where it came from. The release job asks for `attestations: write` whether or not `attest` is set, so the caller grants it.
|
|
114
114
|
|
|
115
115
|
**Artifacts the caller built.** A caller whose own jobs build something the tests or the reviewers need (packages, say) runs them before the pipeline (`needs:` on the job that `uses:` it) and names them with `artifacts`, a [download-artifact](https://github.com/actions/download-artifact) `pattern` such as `host-*`. Every test shard gets the matching artifacts of the run in `$RUNNER_TEMP/artifacts/<artifact>/`, and each reviewer in `$RUNNER_TEMP/review/artifacts/<artifact>/`, before `review-browser` runs, so the hook can load the change's build into both sides' browsers; the test step and the hook get that directory as `SLICC_ARTIFACTS`, and the prompt names it. Without `artifacts` nothing is downloaded and `SLICC_ARTIFACTS` is empty.
|
|
116
116
|
|
|
@@ -159,7 +159,7 @@ The commands in `lint`, `test`, `deploy`, `review-browser` and `after-release` r
|
|
|
159
159
|
| `release-environment` | none | the GitHub environment the release job runs in |
|
|
160
160
|
| `after-release` | none | a command run after semantic-release, with `RELEASE_VERSION` |
|
|
161
161
|
| `release-secrets` | none | newline- or space-separated secret names (any case) that semantic-release and `after-release` get |
|
|
162
|
-
| `attest` | none | files whose build provenance the release attests, as `actions/attest-build-provenance`'s `subject-path` |
|
|
162
|
+
| `attest` | none | files whose build provenance the release attests, as `actions/attest-build-provenance`'s `subject-path`; the bundle goes on the release as `<file>.sigstore.json` |
|
|
163
163
|
|
|
164
164
|
| Secret | Used by |
|
|
165
165
|
|---|---|
|
|
@@ -292,7 +292,7 @@ SLICC_UNIT_ALL=1 git commit
|
|
|
292
292
|
|
|
293
293
|
## Integration-test harness
|
|
294
294
|
|
|
295
|
-
`harness/` drives Chromium over raw CDP on `--remote-debugging-pipe`, as its only client, from `node --test`. On CI (`CI` set, as GitHub Actions does) Chrome runs headed, since headless Chrome behaves slightly differently; the pipeline starts Xvfb when the runner has no display. On a developer machine (no `CI`) it runs headless, so a test run doesn't open windows. `SLICC_HEADLESS=1` or `0`, or `launch({ headless })`, overrides either way. On Linux, a headed Chrome on CI (or with no `DISPLAY`) gets an Xvfb display of its own, started with `-displayfd` so it picks a free number and stopped with the browser: browsers launched side by side, as `node --test` runs files with `--test-concurrency`, never share a screen, so none takes another's window focus (four on one display broke `:focus-visible` checks in slicc-spectrum#572). This needs `Xvfb` on `PATH`; without it, Chrome uses `DISPLAY`, and on a Linux desktop without `CI` it always does. A repo that launches its own Chrome, for example on a TCP debugging port that `launch()` doesn't offer, matches this with the same exports: `headlessByDefault(env)` says whether to run headless, `modeFlags(headless)` gives the flags for that mode, and `screenFor(headed, env)` starts the private Xvfb when one is needed and returns `{ env, child, close }`, whose `env` the Chrome process gets. A headed Chrome gets `--enable-unsafe-swiftshader`, so WebGL falls back to software on a display without a GPU, as headless Chrome's does (slicc-bios#901's splash scene saw no WebGL2 otherwise). Every page, service worker, shared worker and dedicated worker, nested ones included, starts paused, gets coverage (and the CPU profiler, when profiling is on) switched on in the same tick, and only then runs. With nothing to collect (`coverage: []` and profiling off) pages and shared workers start paused, and service workers are left out of the auto-attach and attached once they exist, so they never wait for the harness. A held start that Chrome repeats when it stops and restarts a service worker during an update left the updated worker installed and the next navigation unanswered whenever the harness was slow to run it (slicc-bios#844, #836, #789). Shared workers stay in the held auto-attach: attaching one after the fact races its teardown, and Chrome's browser process then crashes on a failed `worker_host_` check in `shared_worker_devtools_agent_host.cc` (slicc-bios#901). Each test gets its own browser context and leaves `artifacts/<suite>/<test>/` behind: a screenshot per tab and a `console.log` of every target. `targets.log` is a timestamped JSON-lines timeline of target discovery, attachment (including parent sessions and held starts), navigation, load events and failed loads. It also records when the harness sends `Runtime.runIfWaitingForDebugger`, whether Chrome answers or the call fails, and any failed attachment-setup commands; each test starts with a snapshot of existing sessions and their last resume state. Lines logged before the first test, such as an extension service worker's at startup, go into the first test's `console.log`. The global teardown merges the raw coverage into `coverage/` (console table, lcov, V8 HTML) and writes `artifacts/hotspots.md`.
|
|
295
|
+
`harness/` drives Chromium over raw CDP on `--remote-debugging-pipe`, as its only client, from `node --test`. On CI (`CI` set, as GitHub Actions does) Chrome runs headed, since headless Chrome behaves slightly differently; the pipeline starts Xvfb when the runner has no display. On a developer machine (no `CI`) it runs headless, so a test run doesn't open windows. `SLICC_HEADLESS=1` or `0`, or `launch({ headless })`, overrides either way. On Linux, a headed Chrome on CI (or with no `DISPLAY`) gets an Xvfb display of its own, started with `-displayfd` so it picks a free number and stopped with the browser: browsers launched side by side, as `node --test` runs files with `--test-concurrency`, never share a screen, so none takes another's window focus (four on one display broke `:focus-visible` checks in slicc-spectrum#572). This needs `Xvfb` on `PATH`; without it, Chrome uses `DISPLAY`, and on a Linux desktop without `CI` it always does. A repo that launches its own Chrome, for example on a TCP debugging port that `launch()` doesn't offer, matches this with the same exports: `headlessByDefault(env)` says whether to run headless, `modeFlags(headless)` gives the flags for that mode, and `screenFor(headed, env)` starts the private Xvfb when one is needed and returns `{ env, child, close }`, whose `env` the Chrome process gets. Chrome always gets `--use-mock-keychain` and `--password-store=basic`, since every profile is a throwaway in the temp directory: on macOS, Chrome for Testing otherwise asks the login keychain for its Safe Storage key, and each new Chrome version needs the user to allow that again, so a run with nobody at the screen leaves a keychain prompt open that every other keychain read (`gh`'s token, say) then waits behind. A headed Chrome gets `--enable-unsafe-swiftshader`, so WebGL falls back to software on a display without a GPU, as headless Chrome's does (slicc-bios#901's splash scene saw no WebGL2 otherwise). Every page, service worker, shared worker and dedicated worker, nested ones included, starts paused, gets coverage (and the CPU profiler, when profiling is on) switched on in the same tick, and only then runs. With nothing to collect (`coverage: []` and profiling off) pages and shared workers start paused, and service workers are left out of the auto-attach and attached once they exist, so they never wait for the harness. A held start that Chrome repeats when it stops and restarts a service worker during an update left the updated worker installed and the next navigation unanswered whenever the harness was slow to run it (slicc-bios#844, #836, #789). Shared workers stay in the held auto-attach: attaching one after the fact races its teardown, and Chrome's browser process then crashes on a failed `worker_host_` check in `shared_worker_devtools_agent_host.cc` (slicc-bios#901). Each test gets its own browser context and leaves `artifacts/<suite>/<test>/` behind: a screenshot per tab and a `console.log` of every target. `targets.log` is a timestamped JSON-lines timeline of target discovery, attachment (including parent sessions and held starts), navigation, load events and failed loads. It also records when the harness sends `Runtime.runIfWaitingForDebugger`, whether Chrome answers or the call fails, and any failed attachment-setup commands; each test starts with a snapshot of existing sessions and their last resume state. Lines logged before the first test, such as an extension service worker's at startup, go into the first test's `console.log`. The global teardown merges the raw coverage into `coverage/` (console table, lcov, V8 HTML) and writes `artifacts/hotspots.md`.
|
|
296
296
|
|
|
297
297
|
CPU profiling is off by default. V8's sampler interrupts each page and worker thread every 100 µs with a signal, and the renderer SIGSEGVs in slicc-bios#114 all fault inside a signal handler walking the interrupted thread's frames, which points at it. Turn it on with `profile: true` or `SLICC_PROFILE=1` to get one CPU profile per target and snapshot in the test's artifact directory, and the 15 frames with the most self time in the repo's own scripts in `hotspots.md`. Without it, `hotspots.md` says that profiling is off.
|
|
298
298
|
|
package/harness/chrome.mjs
CHANGED
|
@@ -29,6 +29,8 @@ export const flags = [
|
|
|
29
29
|
'--no-first-run',
|
|
30
30
|
'--no-default-browser-check',
|
|
31
31
|
'--no-sandbox',
|
|
32
|
+
'--use-mock-keychain',
|
|
33
|
+
'--password-store=basic',
|
|
32
34
|
'--disable-extensions',
|
|
33
35
|
'--disable-component-extensions-with-background-pages',
|
|
34
36
|
'--disable-background-timer-throttling',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-shared-web",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.1",
|
|
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,12 +75,12 @@
|
|
|
75
75
|
"release": "semantic-release"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@ai-ecoverse/slicc-browsers": "1.
|
|
79
|
-
"@ai-ecoverse/slicc-cdp": "1.
|
|
80
|
-
"@biomejs/biome": "2.6.
|
|
78
|
+
"@ai-ecoverse/slicc-browsers": "1.21.1",
|
|
79
|
+
"@ai-ecoverse/slicc-cdp": "1.47.5",
|
|
80
|
+
"@biomejs/biome": "2.6.4",
|
|
81
81
|
"lefthook": "2.2.2",
|
|
82
|
-
"monocart-coverage-reports": "3.
|
|
83
|
-
"pnpm": "12.
|
|
82
|
+
"monocart-coverage-reports": "3.2.0",
|
|
83
|
+
"pnpm": "12.17.0",
|
|
84
84
|
"semantic-release": "25.0.9"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|