Skip to content

Commit 3c439e4

Browse files
committed
chore(wheelhouse): cascade template@765f1d4e74
Auto-applied by socket-wheelhouse commit-cascade into cascade-socket-cli-53117. 34 file(s) touched: - .git-hooks/_shared/push-repo-gates.mts - .gitattributes - .github/actions/fleet/checkout/action.yml - .github/actions/fleet/github-payload-app-token/action.yml - .github/actions/fleet/setup-and-install/action.yml - .github/actions/fleet/setup/action.yml - .github/workflows/fleet-pack-current.yml - .github/workflows/get-green.yml - .github/workflows/github-release.yml - .github/workflows/publish-npm.yml - .github/workflows/sweep-jobs.yml - .github/workflows/weekly-fuzz.yml - .github/workflows/weekly-odai-cache.yml - .github/workflows/weekly-update.yml - .gitignore - CLAUDE.md - package.json - pnpm-workspace.yaml - scripts/repo/bootstrap/fetch-session.mts - scripts/repo/bootstrap/fleet.d.mts ... and 14 more
1 parent f63229d commit 3c439e4

29 files changed

Lines changed: 782 additions & 722 deletions

‎.git-hooks/_shared/push-repo-gates.mts‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ import {
4242
// One owner for the path, per `paths-are-constructed-once`: a cascaded file is
4343
// tracked twice (source + live mirror), so a literal spelled here counts as
4444
// two construction sites on its own.
45-
import { TYPECHECK_CACHE_DIR } from '../../scripts/fleet/paths.mts'
45+
import { HEAVY_JOB_BUSY_EXIT_CODE } from '../../scripts/fleet/process/heavy-job/admission.mts'
46+
import {
47+
FLEET_TYPE_SCRIPT,
48+
TYPECHECK_CACHE_DIR,
49+
} from '../../scripts/fleet/paths.mts'
4650

4751
import type { TypecheckVerdict } from './typecheck-cache.mts'
4852
import { scanSoakExcludeDateAnnotations } from './scan-supply-chain.mts'
@@ -403,16 +407,16 @@ function runTypeCheckOnce(cacheKey: string): TypecheckVerdict {
403407
// Captured rather than inherited so the diagnostics can be ATTRIBUTED. tsc
404408
// reads the working tree, which in a shared checkout holds a co-session's
405409
// half-finished edits — errors this push neither caused nor can fix.
406-
const r = spawnSync(
407-
process.execPath,
408-
[TSC_BIN, '--noEmit', '-p', TYPE_CHECK_TSCONFIG],
409-
{ stdioString: true },
410-
)
410+
const r = spawnSync(process.execPath, [FLEET_TYPE_SCRIPT], {
411+
stdioString: true,
412+
})
411413
const verdict: TypecheckVerdict = {
412414
output: `${String(r.stdout ?? '')}${String(r.stderr ?? '')}`,
413415
status: r.status ?? 1,
414416
}
415-
writeTypecheckVerdict(TYPECHECK_CACHE_DIR, cacheKey, verdict)
417+
if (verdict.status !== HEAVY_JOB_BUSY_EXIT_CODE) {
418+
writeTypecheckVerdict(TYPECHECK_CACHE_DIR, cacheKey, verdict)
419+
}
416420
return verdict
417421
} finally {
418422
held?.release()

‎.gitattributes‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ docs/fleet/perf linguist-generated=true
105105
docs/fleet/testing linguist-generated=true
106106
docs/fleet/workflows linguist-generated=true
107107
docs/references/fleet/sfw-local-install.md linguist-generated=true
108-
patches/@socketsecurity__lib@7.0.1.patch linguist-generated=true
109-
patches/brace-expansion@5.0.9.patch linguist-generated=true
110-
patches/minimatch@10.2.6.patch linguist-generated=true
111-
patches/run-local-ci@0.18.1.patch linguist-generated=true
112-
patches/vitest@5.0.0.patch linguist-generated=true
108+
patches/fleet/@polka__url@1.0.0-next.29.patch linguist-generated=true
109+
patches/fleet/@socketsecurity__lib@7.0.1.patch linguist-generated=true
110+
patches/fleet/brace-expansion@5.0.9.patch linguist-generated=true
111+
patches/fleet/minimatch@10.2.6.patch linguist-generated=true
112+
patches/fleet/run-local-ci@0.18.1.patch linguist-generated=true
113+
patches/fleet/vitest@5.0.0.patch linguist-generated=true
113114
scripts/fleet linguist-generated=true
114115
scripts/repo/bootstrap linguist-generated=true
115116
test/fleet/_shared/lib linguist-generated=true

‎.github/actions/fleet/checkout/action.yml‎

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ inputs:
5050
payload-token-private-key:
5151
description: >-
5252
Existing PR App private key. Pass secrets.SOCKET_PR_APP_PRIVATE_KEY.
53-
An absent key skips the optional mint and leaves public GHCR available.
53+
An absent credential pair leaves public GHCR hydration anonymous.
5454
required: false
5555
default: ''
5656

@@ -70,8 +70,8 @@ runs:
7070
env:
7171
# Route every workflow-context value through env so no ${{ }} expands
7272
# directly into the shell body (zizmor expression-injection). The token
73-
# authorizes the fetch inline via `git -c …extraheader` and is NEVER
74-
# written to .git/config — the persist-credentials:false equivalent.
73+
# authorizes Git through step-local environment configuration.
74+
# The credential stays out of arguments and .git/config.
7575
CHECKOUT_REF: ${{ inputs.ref }}
7676
CHECKOUT_DEST: ${{ inputs.working-directory }}
7777
CHECKOUT_FETCH_DEPTH: ${{ inputs.fetch-depth }}
@@ -111,7 +111,10 @@ runs:
111111
# Inline, non-persisting auth header (persist-credentials:false equiv).
112112
if [ -n "${GITHUB_TOKEN}" ]; then
113113
AUTH_B64="$(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 | tr -d '\n')"
114-
git -c "http.${SERVER_URL}/.extraheader=AUTHORIZATION: basic ${AUTH_B64}" fetch "${FETCH_ARGS[@]}"
114+
export GIT_CONFIG_COUNT=1
115+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
116+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
117+
git fetch "${FETCH_ARGS[@]}"
115118
else
116119
git fetch "${FETCH_ARGS[@]}"
117120
fi
@@ -126,7 +129,7 @@ runs:
126129
# origin/HEAD, and they fail loud with their own What/Where/Fix.
127130
if [ "${CHECKOUT_FETCH_DEPTH}" = "0" ]; then
128131
if [ -n "${GITHUB_TOKEN}" ]; then
129-
git -c "http.${SERVER_URL}/.extraheader=AUTHORIZATION: basic ${AUTH_B64:-}" remote set-head origin --auto \
132+
git remote set-head origin --auto \
130133
|| echo "::warning::set-head failed — origin/HEAD unset"
131134
else
132135
git remote set-head origin --auto \
@@ -150,11 +153,24 @@ runs:
150153
fi
151154
echo "needed=${NEEDED}" >> "${GITHUB_OUTPUT}"
152155
156+
- name: Validate fleet payload credentials
157+
if: steps.detect-hydration.outputs.needed == 'true'
158+
shell: bash
159+
env:
160+
PAYLOAD_TOKEN_CLIENT_ID: ${{ inputs.payload-token-client-id }}
161+
PAYLOAD_TOKEN_PRIVATE_KEY: ${{ inputs.payload-token-private-key }}
162+
run: |
163+
set -euo pipefail
164+
if { [ -z "${PAYLOAD_TOKEN_CLIENT_ID}" ] && [ -n "${PAYLOAD_TOKEN_PRIVATE_KEY}" ]; } || \
165+
{ [ -n "${PAYLOAD_TOKEN_CLIENT_ID}" ] && [ -z "${PAYLOAD_TOKEN_PRIVATE_KEY}" ]; }; then
166+
echo "::error title=fleet payload credentials are incomplete::The payload client variable and private-key secret are both required for thin payload hydration."
167+
exit 1
168+
fi
169+
153170
- name: Mint fleet payload read token
154171
# Scoped contents:read mint for the hydration fetch below. Gated on
155-
# BOTH hydration actually being needed AND the caller having provisioned
156-
# the PR App credentials, so a non-thin checkout — most callers of
157-
# this action — never mints a token it has no use for. Mirrors
172+
# hydration actually being needed, after validation rejects incomplete
173+
# PR App input pairs. A non-thin checkout never mints an unused token. Mirrors
158174
# setup-and-install's own later mint (for the `pnpm install`-time
159175
# fetch), scoped identically (contents:read on the wheelhouse repo
160176
# alone) — see github-payload-app-token's own description.
@@ -195,7 +211,7 @@ runs:
195211
if [ -d template/base/universal ]; then
196212
HYDRATE_ARGS+=(--from-template)
197213
else
198-
HYDRATE_ARGS+=(--ensure-current --quiet)
214+
HYDRATE_ARGS+=(--quiet)
199215
fi
200216
if ! node scripts/repo/bootstrap/fleet.mjs "${HYDRATE_ARGS[@]+"${HYDRATE_ARGS[@]}"}"; then
201217
echo "::error title=fleet payload hydration failed::node scripts/repo/bootstrap/fleet.mjs exited non-zero"

‎.github/actions/fleet/github-payload-app-token/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: >-
1111
1212
inputs:
1313
client-id:
14-
description: 'PR App Client ID — pass secrets.SOCKET_PR_CLIENT_ID.'
14+
description: 'PR App Client ID - pass secrets.SOCKET_PR_CLIENT_ID.'
1515
required: true
1616
private-key:
1717
description: 'PR App private key — pass secrets.SOCKET_PR_APP_PRIVATE_KEY.'

‎.github/actions/fleet/setup-and-install/action.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ inputs:
7676
payload-token-private-key:
7777
description: >-
7878
Existing PR App private key. Pass secrets.SOCKET_PR_APP_PRIVATE_KEY.
79-
An absent key skips the optional mint and leaves public GHCR available.
79+
An absent credential pair leaves public GHCR hydration anonymous.
8080
required: false
8181
default: ''
8282

@@ -188,6 +188,19 @@ runs:
188188
with:
189189
working-directory: ${{ inputs.working-directory }}
190190

191+
- name: Validate fleet payload credentials
192+
shell: bash
193+
env:
194+
PAYLOAD_TOKEN_CLIENT_ID: ${{ inputs.payload-token-client-id }}
195+
PAYLOAD_TOKEN_PRIVATE_KEY: ${{ inputs.payload-token-private-key }}
196+
run: |
197+
set -euo pipefail
198+
if { [ -z "${PAYLOAD_TOKEN_CLIENT_ID}" ] && [ -n "${PAYLOAD_TOKEN_PRIVATE_KEY}" ]; } || \
199+
{ [ -n "${PAYLOAD_TOKEN_CLIENT_ID}" ] && [ -z "${PAYLOAD_TOKEN_PRIVATE_KEY}" ]; }; then
200+
echo "::error title=fleet payload credentials are incomplete::The payload client variable and private-key secret are both required for dependency installation."
201+
exit 1
202+
fi
203+
191204
- name: Mint fleet payload read token
192205
id: payload-token
193206
if: inputs.payload-token-client-id != '' && inputs.payload-token-private-key != ''

‎.github/actions/fleet/setup/action.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ runs:
170170
fi
171171
printf '#!/bin/bash\nexec node "%s" "$@"\n' "$BINARY_PATH" > "$PNPM_BIN"
172172
chmod +x "$PNPM_BIN"
173+
if [[ "$OSTYPE" == msys* || "$OSTYPE" == cygwin* ]]; then
174+
BINARY_PATH_WIN="$(cygpath -w "$BINARY_PATH")"
175+
printf '@echo off\r\nnode "%s" %%*\r\nexit /b %%errorlevel%%\r\n' "$BINARY_PATH_WIN" > "${PNPM_BIN}.cmd"
176+
fi
173177
fi
174178
else
175179
# A THIN member untracks the whole scripts/fleet/** payload and
@@ -241,6 +245,10 @@ runs:
241245
fi
242246
printf '#!/bin/bash\nexec node "%s" "$@"\n' "$BINARY_PATH" > "$PNPM_BIN"
243247
chmod +x "$PNPM_BIN"
248+
if [[ "$OSTYPE" == msys* || "$OSTYPE" == cygwin* ]]; then
249+
BINARY_PATH_WIN="$(cygpath -w "$BINARY_PATH")"
250+
printf '@echo off\r\nnode "%s" %%*\r\nexit /b %%errorlevel%%\r\n' "$BINARY_PATH_WIN" > "${PNPM_BIN}.cmd"
251+
fi
244252
fi
245253
echo "$PNPM_DIR" >> "${GITHUB_PATH:-/dev/null}"
246254
# The pnpm installed above is pinned + SRI-verified from
@@ -626,6 +634,13 @@ runs:
626634
if [ -x "$CARGO_PROXY" ]; then REAL="$CARGO_PROXY"; break; fi
627635
done
628636
fi
637+
if $IS_WINDOWS; then
638+
if [[ "$REAL" != *.cmd && -f "${REAL}.cmd" ]]; then
639+
REAL="${REAL}.cmd"
640+
elif [[ "$REAL" != *.exe && -f "${REAL}.exe" ]]; then
641+
REAL="${REAL}.exe"
642+
fi
643+
fi
629644
if [ -n "$REAL" ]; then
630645
REAL="$(msys_to_win_path "$REAL")"
631646
# SFW_UNKNOWN_HOST_ACTION=ignore: only sfw-enterprise PARSES
@@ -756,6 +771,13 @@ runs:
756771
echo 'SFW_CUSTOM_REGISTRIES<<EOF'
757772
# Strip comments + blank lines so the env var holds only real entries.
758773
grep -vE '^\s*(#|$)' "$BYPASS_FILE"
774+
if [[ -n "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]]; then
775+
OIDC_HOST="${ACTIONS_ID_TOKEN_REQUEST_URL#*://}"
776+
OIDC_HOST="${OIDC_HOST%%/*}"
777+
case "$OIDC_HOST" in
778+
*.actions.githubusercontent.com) printf 'bypass:%s\n' "$OIDC_HOST" ;;
779+
esac
780+
fi
759781
echo 'EOF'
760782
} >> "${GITHUB_ENV:-/dev/null}"
761783
# Opt out of gh CLI telemetry (on-by-default as of late 2025).

‎.github/workflows/fleet-pack-current.yml‎

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/get-green.yml‎

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/github-release.yml‎

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ jobs:
7979
FETCH_ARGS=(--no-tags --prune --depth 1 origin "${TRIGGER_REF}")
8080
if [ -n "${GITHUB_TOKEN}" ]; then
8181
AUTH_B64="$(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 | tr -d '\n')"
82-
git -c "http.${SERVER_URL}/.extraheader=AUTHORIZATION: basic ${AUTH_B64}" fetch "${FETCH_ARGS[@]}"
82+
export GIT_CONFIG_COUNT=1
83+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
84+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
85+
git fetch "${FETCH_ARGS[@]}"
8386
else
8487
git fetch "${FETCH_ARGS[@]}"
8588
fi
@@ -107,47 +110,97 @@ jobs:
107110
permissions:
108111
contents: write
109112
steps:
110-
# First step can't call the local ./.github/actions/fleet/checkout
111-
# composite (nothing checked out yet); bootstrap the workspace with the
112-
# same inline git-fetch shape publish-npm.yml uses, so the fleet
113-
# checkout action below can re-check-out at its own depth.
114-
- name: Bootstrap checkout
113+
# Retain the current default branch's fleet actions before checking out
114+
# historical release content. The archive digest protects the retained
115+
# definitions until they are restored after checkout.
116+
- name: Bootstrap fleet Actions
115117
shell: bash
116118
env:
117119
# Route context through env (no ${{ }} in the shell body —
118120
# zizmor expression-injection). Token authorizes the fetch inline and
119121
# is never persisted to .git/config.
122+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
120123
GITHUB_TOKEN: ${{ github.token }}
121-
INPUT_TAG: ${{ inputs.tag }}
122124
REPOSITORY: ${{ github.repository }}
123125
SERVER_URL: ${{ github.server_url }}
124-
TRIGGER_REF: ${{ github.ref }}
125126
run: |
126127
set -euo pipefail
128+
if [ -z "${DEFAULT_BRANCH}" ]; then
129+
echo '::error::Cannot retain fleet actions: repository default branch is empty.' >&2
130+
exit 1
131+
fi
127132
git init -q
128133
git config --local advice.detachedHead false
129134
git remote remove origin 2>/dev/null || true
130135
git remote add origin "${SERVER_URL}/${REPOSITORY}"
131-
# A dispatched tag input wins; otherwise the ref that triggered the run.
132-
FETCH_REF="${TRIGGER_REF}"
136+
FETCH_ARGS=(--no-tags --prune --depth 1 origin "refs/heads/${DEFAULT_BRANCH}")
137+
if [ -n "${GITHUB_TOKEN}" ]; then
138+
AUTH_B64="$(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 | tr -d '\n')"
139+
export GIT_CONFIG_COUNT=1
140+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
141+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
142+
git fetch "${FETCH_ARGS[@]}"
143+
else
144+
git fetch "${FETCH_ARGS[@]}"
145+
fi
146+
ACTIONS_SHA="$(git rev-parse 'FETCH_HEAD^{commit}')"
147+
git checkout -q --detach "${ACTIONS_SHA}"
148+
ACTUAL_SHA="$(git rev-parse 'HEAD^{commit}')"
149+
if [ "${ACTUAL_SHA}" != "${ACTIONS_SHA}" ]; then
150+
echo "::error::Fleet action source mismatch: expected ${ACTIONS_SHA}, got ${ACTUAL_SHA}." >&2
151+
exit 1
152+
fi
153+
tar -czf "${RUNNER_TEMP}/fleet-actions.tar.gz" .github/actions/fleet
154+
(
155+
cd "${RUNNER_TEMP}"
156+
sha256sum fleet-actions.tar.gz > fleet-actions.tar.gz.sha256
157+
)
158+
printf '%s\n' "${ACTIONS_SHA}" > "${RUNNER_TEMP}/fleet-actions.sha"
159+
- name: Checkout release content
160+
shell: bash
161+
env:
162+
GITHUB_TOKEN: ${{ github.token }}
163+
INPUT_TAG: ${{ inputs.tag }}
164+
REPOSITORY: ${{ github.repository }}
165+
SERVER_URL: ${{ github.server_url }}
166+
TRIGGER_SHA: ${{ github.sha }}
167+
run: |
168+
set -euo pipefail
169+
FETCH_REF="${TRIGGER_SHA}"
133170
if [ -n "${INPUT_TAG}" ]; then
134171
FETCH_REF="refs/tags/${INPUT_TAG}"
135172
fi
136173
FETCH_ARGS=(--no-tags --prune --depth 1 origin "${FETCH_REF}")
137174
if [ -n "${GITHUB_TOKEN}" ]; then
138175
AUTH_B64="$(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 | tr -d '\n')"
139-
git -c "http.${SERVER_URL}/.extraheader=AUTHORIZATION: basic ${AUTH_B64}" fetch "${FETCH_ARGS[@]}"
176+
export GIT_CONFIG_COUNT=1
177+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
178+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
179+
git fetch "${FETCH_ARGS[@]}"
140180
else
141181
git fetch "${FETCH_ARGS[@]}"
142182
fi
143-
git checkout -q --detach FETCH_HEAD
144-
- name: Checkout
183+
RELEASE_SHA="$(git rev-parse 'FETCH_HEAD^{commit}')"
184+
git checkout -q --detach "${RELEASE_SHA}"
185+
ACTUAL_SHA="$(git rev-parse 'HEAD^{commit}')"
186+
if [ "${ACTUAL_SHA}" != "${RELEASE_SHA}" ]; then
187+
echo "::error::Release source mismatch: expected ${RELEASE_SHA}, got ${ACTUAL_SHA}." >&2
188+
exit 1
189+
fi
190+
- name: Restore fleet Actions
191+
shell: bash
192+
run: |
193+
set -euo pipefail
194+
(
195+
cd "${RUNNER_TEMP}"
196+
sha256sum -c fleet-actions.tar.gz.sha256
197+
)
198+
tar -xzf "${RUNNER_TEMP}/fleet-actions.tar.gz" -C "${GITHUB_WORKSPACE}"
199+
echo "Restored fleet actions from $(cat "${RUNNER_TEMP}/fleet-actions.sha")."
200+
- name: Hydrate release content
145201
uses: ./.github/actions/fleet/checkout
146202
with:
147-
ref: ${{ inputs.tag != '' && format('refs/tags/{0}', inputs.tag) || github.sha }}
148-
# Reuse the PR App for a contents:read token scoped to wheelhouse.
149-
# Both credentials enable the private release fallback. Without the
150-
# key, hydration still pulls public GHCR anonymously.
203+
checkout: 'false'
151204
payload-token-client-id: ${{ secrets.SOCKET_PR_CLIENT_ID }}
152205
payload-token-private-key: ${{ secrets.SOCKET_PR_APP_PRIVATE_KEY }}
153206
# The resolved tag is the single input every later step trusts — it

0 commit comments

Comments
 (0)