Skip to content

Commit 55cef29

Browse files
committed
chore: enable blockExoticSubdeps + sync .mjs->.mts script refs + soak-window wording
- pnpm-workspace.yaml: add blockExoticSubdeps: true (fleet default). Direct git deps still allowed; transitive ones refused. - Update sync-scaffolding script references from .mjs to .mts in hook READMEs, path-guard segments, _shared skill rules, CLAUDE.md, and xport-schema.mts header comment (the upstream rename has shipped; downstreams now reflect it). - Fold "soak-window" terminology into security-reviewer's checklist + CLAUDE.md tooling block — matches how the rest of the fleet refers to pnpm's minimumReleaseAge field. Pre-existing iocraft native-addon test failures unrelated to this change; user authorized --no-verify pending environment fix.
1 parent 9b615d9 commit 55cef29

8 files changed

Lines changed: 23 additions & 14 deletions

File tree

.claude/agents/security-reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Apply these rules from CLAUDE.md exactly:
1818

1919
1. **Secrets**: Hardcoded API keys, passwords, tokens, private keys in code or config
2020
2. **Injection**: Command injection via shell: true or string interpolation in spawn/exec. Path traversal in file operations.
21-
3. **Dependencies**: npx/dlx usage. Unpinned versions (^ or ~). Missing minimumReleaseAge bypass justification. # zizmor: documentation-checklist
21+
3. **Dependencies**: npx/dlx usage. Unpinned versions (^ or ~). Missing soak-window bypass justification (pnpm-workspace.yaml `minimumReleaseAgeExclude`). # zizmor: documentation-checklist
2222
4. **File operations**: fs.rm without safeDelete. process.chdir usage. fetch() usage (must use lib's httpRequest).
2323
5. **GitHub Actions**: Unpinned action versions (must use full SHA). Secrets outside env blocks. Template injection from untrusted inputs.
2424
6. **Error handling**: Sensitive data in error messages. Stack traces exposed to users.

.claude/hooks/path-guard/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# path-guard
22

3-
Claude Code `PreToolUse` hook that refuses `Edit`/`Write` tool calls that would *construct* a multi-segment build/output path inline in a `.mts` or `.cts` file. Mandatory across the Socket fleet — every repo ships this file byte-for-byte via `scripts/sync-scaffolding.mjs`.
3+
Claude Code `PreToolUse` hook that refuses `Edit`/`Write` tool calls that would *construct* a multi-segment build/output path inline in a `.mts` or `.cts` file. Mandatory across the Socket fleet — every repo ships this file byte-for-byte via `scripts/sync-scaffolding.mts`.
44

55
**Mantra: 1 path, 1 reference.**
66

@@ -57,10 +57,10 @@ Adding a new detection pattern: update `STAGE_SEGMENTS` (or `KNOWN_SIBLING_PACKA
5757

5858
## Updating across the fleet
5959

60-
This file is in `IDENTICAL_FILES` in `scripts/sync-scaffolding.mjs` (in `socket-repo-template`). After editing, run from `socket-repo-template`:
60+
This file is in `IDENTICAL_FILES` in `scripts/sync-scaffolding.mts` (in `socket-repo-template`). After editing, run from `socket-repo-template`:
6161

6262
```bash
63-
node scripts/sync-scaffolding.mjs --all --fix
63+
node scripts/sync-scaffolding.mts --all --fix
6464
```
6565

6666
to propagate the change to every fleet repo.

.claude/hooks/path-guard/segments.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// consumers import from here so they can never drift apart.
77
//
88
// Synced byte-identically across the Socket fleet via
9-
// socket-repo-template/scripts/sync-scaffolding.mjs (IDENTICAL_FILES).
9+
// socket-repo-template/scripts/sync-scaffolding.mts (IDENTICAL_FILES).
1010
// When adding a new stage/build-root/mode/sibling, edit this file in
1111
// the template and re-sync.
1212

@@ -41,7 +41,7 @@ export const MODE_SEGMENTS = new Set(['dev', 'prod', 'shared'])
4141
// Socket fleet — the gate is byte-identical via sync-scaffolding, so
4242
// listing every fleet package keeps Rule B firing in any repo. When a
4343
// new package joins the workspace, add it here and propagate via
44-
// `node scripts/sync-scaffolding.mjs --all --fix` from
44+
// `node scripts/sync-scaffolding.mts --all --fix` from
4545
// socket-repo-template.
4646
export const KNOWN_SIBLING_PACKAGES = new Set([
4747
// socket-btm

.claude/hooks/token-guard/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# token-guard
22

3-
Claude Code `PreToolUse` hook that refuses Bash tool calls that would leak secrets to tool output. Mandatory across the Socket fleet — every repo ships this file byte-for-byte via `scripts/sync-scaffolding.mjs`.
3+
Claude Code `PreToolUse` hook that refuses Bash tool calls that would leak secrets to tool output. Mandatory across the Socket fleet — every repo ships this file byte-for-byte via `scripts/sync-scaffolding.mts`.
44

55
## What it blocks
66

@@ -48,10 +48,10 @@ Adding new token-shape detections: update `LITERAL_TOKEN_PATTERNS` in `index.mts
4848

4949
## Updating across the fleet
5050

51-
This file is in `IDENTICAL_FILES` in `scripts/sync-scaffolding.mjs`. After editing, run from `socket-repo-template`:
51+
This file is in `IDENTICAL_FILES` in `scripts/sync-scaffolding.mts`. After editing, run from `socket-repo-template`:
5252

5353
```bash
54-
node scripts/sync-scaffolding.mjs --all --fix
54+
node scripts/sync-scaffolding.mts --all --fix
5555
```
5656

5757
to propagate the change to every fleet repo.

.claude/skills/_shared/path-guard-rule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
Shared snippet — the canonical "1 path, 1 reference" rule text.
33
Synced byte-identical across the Socket fleet via socket-repo-template's
4-
sync-scaffolding.mjs (SHARED_SKILL_FILES).
4+
sync-scaffolding.mts (SHARED_SKILL_FILES).
55
66
This file is the source of truth for the rule's wording. Three artifacts
77
embed (or paraphrase) it:
@@ -10,7 +10,7 @@ embed (or paraphrase) it:
1010
2. .claude/hooks/path-guard/README.md — what the hook blocks.
1111
3. .claude/skills/path-guard/SKILL.md — what the skill enforces.
1212
13-
If the wording changes here, re-run `node scripts/sync-scaffolding.mjs
13+
If the wording changes here, re-run `node scripts/sync-scaffolding.mts
1414
--all --fix` from socket-repo-template to propagate.
1515
-->
1616

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**MANDATORY**: Act as principal-level engineer. Follow these guidelines exactly.
44

5-
<!-- BEGIN FLEET-CANONICAL — sync via socket-repo-template/scripts/sync-scaffolding.mjs. Do not edit downstream. -->
5+
<!-- BEGIN FLEET-CANONICAL — sync via socket-repo-template/scripts/sync-scaffolding.mts. Do not edit downstream. -->
66

77
## 📚 Fleet Standards
88

@@ -59,7 +59,7 @@ The umbrella rule: never run a git command that mutates state belonging to a pat
5959

6060
- **Package manager**: `pnpm`. Run scripts via `pnpm run foo --flag`, never `foo:bar`. After `package.json` edits, `pnpm install`.
6161
- 🚨 NEVER use `npx`, `pnpm dlx`, or `yarn dlx` — use `pnpm exec <package>` or `pnpm run <script>` # socket-hook: allow npx
62-
- **`minimumReleaseAge`** — never add packages to `minimumReleaseAgeExclude` in CI. Locally, ASK before adding (security control).
62+
- **Soak window** (pnpm-workspace.yaml `minimumReleaseAge`, default 7 days) — never add packages to `minimumReleaseAgeExclude` in CI. Locally, ASK before adding (security control).
6363
- **Backward compatibility** — FORBIDDEN to maintain. Actively remove when encountered.
6464

6565
### Code style

pnpm-workspace.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ minimumReleaseAgeExclude:
165165
- '@socketregistry/*'
166166
- '@socketsecurity/*'
167167

168+
# Refuse transitive dependencies declared via git/tarball/local-tarball
169+
# specs — an npm package shouldn't be allowed to drag in a git URL we
170+
# don't control (bypasses npm registry validation, no provenance, no
171+
# soak window). Direct git deps are still allowed (the test suite at
172+
# pnpm/pkg-manager/core/test/install/blockExoticSubdeps.ts confirms
173+
# this). pnpm's current default is `false`; declared explicitly so a
174+
# future flip can't silently change install behavior.
175+
blockExoticSubdeps: true
176+
168177
# Dependency overrides (migrated from package.json pnpm.overrides).
169178
overrides:
170179
'@octokit/graphql': 'catalog:'

scripts/xport-schema.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* `@socketsecurity/lib/validation/validate-schema`
1111
*
1212
* Byte-identical across socket-tui / socket-btm / socket-sdxgen / ultrathink /
13-
* socket-registry / socket-repo-template via sync-scaffolding.mjs.
13+
* socket-registry / socket-repo-template via sync-scaffolding.mts.
1414
*/
1515

1616
import { Type, type Static } from '@sinclair/typebox'

0 commit comments

Comments
 (0)