@ai-ecoverse/slicc-shared-web 2.7.2 → 2.7.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.
package/README.md CHANGED
@@ -73,13 +73,13 @@ The caller cancels superseded runs on pull requests only, so a push to `main` ne
73
73
 
74
74
  **Reviewer** runs twice, once with [claude-code-action](https://github.com/anthropics/claude-code-action) and once with [codex-action](https://github.com/openai/codex-action), on the same prompt, whether the tests passed or not. Both run on Amazon Bedrock with the org secret `AWS_BEARER_TOKEN_BEDROCK`, in the region of the org variable `CERT_AWS_REGION` (`us-west-2` without it). Claude uses the model in `CERT_BEDROCK_MODEL` (`global.anthropic.claude-opus-5-5` without it), as the cert reviews do. Codex uses its built-in `amazon-bedrock-runtime` provider (codex-action waits for its OpenAI proxy's `<run id>.json` in `codex-home` whenever it has a prompt, so the job writes a placeholder one) and the model in `CODEX_BEDROCK_MODEL` (`global.openai.gpt-6.1-sol` without it). Models that Bedrock serves only through inference profiles, as Sol 6.1 is, need the runtime provider and the profile's `global.` id; the `amazon-bedrock` provider's endpoint doesn't list them. The job token can only read. Each reviewer gets:
75
75
 
76
- - the pull request's head as the working directory and its base in `$RUNNER_TEMP/base`, each after `npm ci` (claude-code-action needs the working directory to be a checkout, and a base nested inside it would break the head's Biome config);
77
- - `review/integration/`, every shard's artifact;
78
- - `review/context/`, from the `context` job: the pull request's diff, files and commits from git and its title, body and labels from the event, which cost no GitHub API call, then its comments and reviews and the repo's issues and recent pull requests from the REST API, each retried once and listed in `missing.txt` when the repo's `GITHUB_TOKEN` quota (1,000 requests an hour, shared by every run in the repo) runs out, rather than failing the job;
79
- - `review/browsers.json`: four headed Chrome instances on one machine (on Xvfb display `:99` when the runner has no `DISPLAY`, since headless Chrome behaves slightly differently), `head` and `base` each linked through the extension and through slicc-cli, on CDP ports 9301 to 9304. For each one the job runs `review-browser` (by default `npm run --if-present review:browser`) in that side's tree with `SLICC_REVIEW_SIDE` (`head` or `base`), `SLICC_REVIEW_LINK` (`extension` or `cli`) and `SLICC_REVIEW_CDP`, so the repo loads its own build into that browser. Every one of them also runs the [harness extension](#harness-extension) (loaded with `--load-extension`), so the review sees pages the way a user with a content-script extension does;
76
+ - the pull request's head, with full history, as the working directory, and its base in `$RUNNER_TEMP/base`, each after `npm ci` (claude-code-action needs the working directory to be a checkout, and a base nested inside it would break the head's Biome config). Everything else the reviewers get or write (the prompt, context, integration artifacts, `browsers.json`, findings and screenshots) is in `$RUNNER_TEMP/review`, outside the checkout, so a reviewer's `npm run lint` sees only the repository;
77
+ - `$RUNNER_TEMP/review/integration/`, every shard's artifact;
78
+ - `$RUNNER_TEMP/review/context/`, from the `context` job: the pull request's diff, files and commits from git and its title, body and labels from the event, which cost no GitHub API call, then its comments and reviews and the repo's issues and recent pull requests from the REST API, each retried once and listed in `missing.txt` when the repo's `GITHUB_TOKEN` quota (1,000 requests an hour, shared by every run in the repo) runs out, rather than failing the job;
79
+ - `$RUNNER_TEMP/review/browsers.json`: four headed Chrome instances on one machine (on Xvfb display `:99` when the runner has no `DISPLAY`, since headless Chrome behaves slightly differently), `head` and `base` each linked through the extension and through slicc-cli, on CDP ports 9301 to 9304. For each one the job runs `review-browser` (by default `npm run --if-present review:browser`) in that side's tree with `SLICC_REVIEW_SIDE` (`head` or `base`), `SLICC_REVIEW_LINK` (`extension` or `cli`) and `SLICC_REVIEW_CDP`, so the repo loads its own build into that browser. Every one of them also runs the [harness extension](#harness-extension) (loaded with `--load-extension`), so the review sees pages the way a user with a content-script extension does;
80
80
  - `review-prompt`, appended to the shared prompt.
81
81
 
82
- A reviewer can attach screenshots: it saves PNGs to `review/shots/` and references them in the summary, a comment or an issue as `![what it shows](shots/name.png)`. `post` uploads them to R2 (the bucket in `R2_BUCKET`, `slicc-pr-screenshots` by default, under `<repo>/pr-<n>/<commit>/<reviewer>/`) with `CLOUDFLARE_API_TOKEN`, which only `post` gets, and rewrites each reference to its public URL (`R2_PUBLIC_BASE_URL`); without the token, a reference becomes a link to the run, whose `findings-<reviewer>` artifact holds the files.
82
+ A reviewer can attach screenshots: it saves PNGs to `$RUNNER_TEMP/review/shots/` and references them in the summary, a comment or an issue as `![what it shows](shots/name.png)`. `post` uploads them to R2 (the bucket in `R2_BUCKET`, `slicc-pr-screenshots` by default, under `<repo>/pr-<n>/<commit>/<reviewer>/`) with `CLOUDFLARE_API_TOKEN`, which only `post` gets, and rewrites each reference to its public URL (`R2_PUBLIC_BASE_URL`); without the token, a reference becomes a link to the run, whose `findings-<reviewer>` artifact holds the files.
83
83
 
84
84
  Each reviewer answers with `findings.json`, held to one JSON schema:
85
85
 
@@ -233,12 +233,12 @@ Without it, every worktree of a repo shares `.git/hooks/` with the main clone, a
233
233
 
234
234
  and the PR commits the `.githooks/` directory that the first `npm install` writes.
235
235
 
236
- - **What it does:** sets one shared, relative `core.hooksPath` of `.githooks` (`<dir>/.githooks` for a package in a subdirectory of the repo), runs `lefthook install --force` with its output pointed at this worktree's gitignored `node_modules/.git-hooks/`, and writes a shim into `.githooks/` for every hook lefthook installed that has none yet. It never overwrites an existing shim. Git resolves a relative `core.hooksPath` against the top of the worktree a commit runs in, so each worktree runs its own committed shim, and the shim runs that worktree's own `node_modules/.git-hooks/<hook>`. No `extensions.worktreeConfig`, no per-worktree config, and `core.bare` stays where it is, so worktrees of a bare repo work too. Running it again changes nothing.
236
+ - **What it does:** sets one shared, relative `core.hooksPath` of `.githooks` (`<dir>/.githooks` for a package in a subdirectory of the repo), writes a hook into this worktree's gitignored `node_modules/.git-hooks/` for every git hook in the config `lefthook dump` prints, `extends` included, and a shim into `.githooks/` for each one that has none yet. Each hook runs `lefthook run --no-auto-install <hook>` with the lefthook binary from its own `node_modules/`, found relative to the hook, so lefthook never tries to sync hooks into `core.hooksPath`. It sets no git config from the command line or the environment, so the AI git wrapper lets it run. It never overwrites an existing shim. Git resolves a relative `core.hooksPath` against the top of the worktree a commit runs in, so each worktree runs its own committed shim, and the shim runs that worktree's own `node_modules/.git-hooks/<hook>`. No `extensions.worktreeConfig`, no per-worktree config, and `core.bare` stays where it is, so worktrees of a bare repo work too. Running it again changes nothing.
237
237
  - **Hooks are never shared:** whatever another worktree installs later, removing a worktree removes only its own hooks, and a moved checkout keeps working. Lefthook's own `postinstall` refuses the custom `core.hooksPath`, writes nothing and doesn't fail the install, and git never reads `.git/hooks/` once `core.hooksPath` is set, so `allowScripts` needs no entry for lefthook.
238
238
  - **A worktree that never ran `npm install`** fails every commit with `pre-commit: run npm install`, since its shim finds no `node_modules/.git-hooks/pre-commit`.
239
239
  - **A checkout without the committed `.githooks/`** (a branch cut before the rollout PR) has no shim, so its commits run no hooks until it merges or rebases onto the rollout.
240
- - **A hook type added to `lefthook.yml` later** needs `npm install` again in each worktree, and its new shim committed: lefthook skips its own hook sync while `core.hooksPath` is set.
241
- - **Lefthook's `core.hooksPath is set locally` notice** on commits is expected. Don't follow its advice to unset `core.hooksPath`: that sends every worktree back to the shared `.git/hooks/`.
240
+ - **A hook type added to `lefthook.yml` later** needs `npm install` again in each worktree, and its new shim committed.
241
+ - **Don't unset `core.hooksPath`** when `lefthook install` suggests it: that sends every worktree back to the shared `.git/hooks/`.
242
242
  - **Clones set up by the previous version** (2.1.1, 1.29.3), which set an absolute per-worktree `core.hooksPath` into a `worktree-hooks/` directory: it unsets that in the current worktree's `config.worktree`. It leaves `extensions.worktreeConfig` and the moved `core.bare` alone.
243
243
  - **Outside a git checkout** (a packed tarball, say) it does nothing and exits 0.
244
244
 
@@ -8,16 +8,25 @@ if [ -f "$own" ]; then
8
8
  esac
9
9
  fi
10
10
  git config core.hooksPath "$(git rev-parse --show-prefix).githooks"
11
- n="${GIT_CONFIG_COUNT:-0}"
12
- (
13
- export "GIT_CONFIG_COUNT=$((n + 1))" "GIT_CONFIG_KEY_$n=core.hooksPath" "GIT_CONFIG_VALUE_$n=$(pwd -P)/node_modules/.git-hooks"
14
- lefthook install --force "$@"
15
- )
16
- mkdir -p .githooks
17
- for hook in node_modules/.git-hooks/*; do
18
- name="${hook##*/}"
19
- case "$name" in *.*) continue ;; esac
20
- if [ ! -f "$hook" ] || [ -e ".githooks/$name" ]; then continue; fi
11
+ config="$(lefthook dump)"
12
+ githooks=" applypatch-msg pre-applypatch post-applypatch pre-commit pre-merge-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-push pre-receive update proc-receive post-receive post-update reference-transaction push-to-checkout pre-auto-gc post-rewrite sendemail-validate fsmonitor-watchman p4-changelist p4-prepare-changelist p4-post-changelist p4-pre-submit post-index-change "
13
+ mkdir -p node_modules/.git-hooks .githooks
14
+ for name in $(printf '%s\n' "$config" | sed -n 's/^\([a-z][a-z0-9-]*\):.*/\1/p'); do
15
+ case "$githooks" in *" $name "*) ;; *) continue ;; esac
16
+ hook="node_modules/.git-hooks/$name"
17
+ sed "s/@HOOK@/$name/g" >"$hook" <<'HOOK'
18
+ #!/bin/sh
19
+ if [ "${LEFTHOOK_VERBOSE:-}" = 1 ] || [ "${LEFTHOOK_VERBOSE:-}" = true ]; then set -x; fi
20
+ modules="$(cd "${0%/*}/.." && pwd -P)"
21
+ os="$(uname -s | tr '[:upper:]' '[:lower:]')"
22
+ cpu="$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')"
23
+ lefthook="$modules/lefthook-$os-$cpu/bin/lefthook"
24
+ [ -x "$lefthook" ] || lefthook="$modules/.bin/lefthook"
25
+ [ -x "$lefthook" ] || { echo "@HOOK@: run npm install" >&2; exit 1; }
26
+ exec "$lefthook" run --no-auto-install "@HOOK@" "$@"
27
+ HOOK
28
+ chmod +x "$hook"
29
+ [ ! -e ".githooks/$name" ] || continue
21
30
  cat >".githooks/$name" <<'SHIM'
22
31
  #!/bin/sh
23
32
  hook="${0%/*}/../node_modules/.git-hooks/${0##*/}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "2.7.2",
3
+ "version": "2.7.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",
@@ -66,7 +66,7 @@
66
66
  "release": "semantic-release"
67
67
  },
68
68
  "devDependencies": {
69
- "@ai-ecoverse/slicc-browsers": "1.15.1",
69
+ "@ai-ecoverse/slicc-browsers": "1.16.0",
70
70
  "@ai-ecoverse/slicc-cdp": "1.30.23",
71
71
  "@biomejs/biome": "2.5.15",
72
72
  "lefthook": "2.2.2",