Skip to content

build(repo): add git hooks and content scan, fix release npm version - #232

Merged
Jordan Harband (ljharb) merged 4 commits into
SocketDev:mainfrom
ljharb:claude/remove-ghcr-fleet-pack-8fae7b
Nov 5, 2026
Merged

Jordan Harband (ljharb) merged 4 commits into
SocketDev:mainfrom
ljharb:claude/remove-ghcr-fleet-pack-8fae7b

Conversation

@ljharb

@ljharb Jordan Harband (ljharb) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #231, which removed the fleet pack. This PR adds four changes main doesn't have yet. Each commit can be reviewed on its own.

Changes

1. Fix the npm version in the release workflows (fix(ci))

devEngines requires npm >=12.2.0 with onFail: error. Node 26.12.1 bundles npm 11.20.0, which errors with EBADDEVENGINES when run in the checkout. I reproduced that error with npm view and npm pack. npm publish makes the same check, so:

  • publish-npm.yml would fail at its final step. It now installs npm@12.2.0 next to pnpm.
  • release-github.yml would fail at npm view. It now runs npm view outside the checkout.

2. Git hooks and a tracked-file content scan (feat(repo))

pnpm install points core.hooksPath at .git-hooks/. The prepare script skips this in CI.

  • pre-commit scans the staged copy of each file for secrets, personal home paths and private repository names. It fails if it can't read a staged file.
  • commit-msg requires a Conventional Commit subject and rejects AI attribution lines.
  • pre-push runs pnpm run repo:type.

pnpm run check now also runs the manifest version check and pnpm run repo:scan. CI's check job runs pnpm run check instead of pnpm run repo:check, so the scan gates pull requests. test/repo/unit/repo-scan.test.mts covers the scanner and the pre-commit hook, including a secret that is staged and then edited or deleted on disk.

3. Drop unused dev dependencies (build(deps))

This removes 33 dev dependencies that no script, test, config or workflow uses. Removing them leaves the brace-expansion and minimatch patches unused, and pnpm rejects unused patches, so those are removed too.

4. Update stale config comments (chore(repo))

.editorconfig and .npmrc had comments pointing at deleted fleet files and generators. Only comments change; the settings are identical.

Testing

On a fresh copy of the branch with Node 26.12.1 and pnpm 12.14.0:

  • pnpm install --frozen-lockfile passed and set core.hooksPath.
  • pnpm run check passed, including the scan of 173 tracked files.
  • pnpm test passed: 60 files, 537 tests.
  • zizmor 1.30.1 reported no findings.
  • actionlint reported only the ubuntu-26.04 runner-label warning that main also has.
  • I tried each hook. They rejected a non-conventional subject, an AI attribution trailer, and a token that was staged and then removed from disk. A clean commit went through.

@ljharb
Jordan Harband (ljharb) force-pushed the claude/remove-ghcr-fleet-pack-8fae7b branch from 4a54804 to b853f0f Compare November 5, 2026 18:38

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b853f0f. Configure here.

Comment thread scripts/repo/hooks/pre-commit.mts Resolved
Node 26.12.1 bundles npm 11.20.0, and `devEngines` requires npm >=12.2.0
with `onFail: error`, so `npm publish` and `npm view` in the checkout fail
with EBADDEVENGINES. The publish job now installs npm 12.2.0, and the
release job runs `npm view` outside the checkout.
None of these 33 packages is imported or run by any script, test,
config, or workflow. Removing them also leaves the brace-expansion and
minimatch patches unused, so pnpm would reject them; drop those too.
`pnpm install` points `core.hooksPath` at `.git-hooks/`:

- pre-commit scans the staged copy of each file for secrets, personal
  paths, and private repository names, and fails when a blob cannot be
  read.
- commit-msg requires a Conventional Commit subject and rejects AI
  attribution lines.
- pre-push runs `pnpm run repo:type`.

`pnpm run check` now also runs the manifest version match and
`pnpm run repo:scan`, and CI runs `pnpm run check` so the scan gates
pull requests.
@ljharb
Jordan Harband (ljharb) force-pushed the claude/remove-ghcr-fleet-pack-8fae7b branch from 4bbd523 to 6969de5 Compare November 5, 2026 21:05
John-David Dalton (jdalton) pushed a commit to SocketDev/sauce that referenced this pull request Nov 5, 2026
* chore(sauce): regenerate agents readme and fix formatting

Run pnpm run generate to refresh the stale agents/README.md, and run
oxfmt on three files that were unformatted on main.

* build: drop the fleet pack and own the repo tooling

Match SocketDev/socket-mcp#232: sauce no longer hydrates the GHCR fleet
pack and keeps no fleet code. The repo owns small scripts for each job,
and CI uses SHA-pinned upstream actions.

- test, cover, fuzz harnesses, structural: plain vitest through
  .config/repo/vitest.config.mts.
- format and lint: oxfmt and oxlint with root .oxfmtrc.json and
  .oxlintrc.json.
- type: tsc on tsconfig.json and .config/repo/tsconfig.release-kit.json.
- check: scripts/repo/check.mts runs format, lint, type, check-paths, the
  scripts/repo/check/*.mts gates, generate:check, and a content scan.
- prepare: scripts/repo/install-git-hooks.mts sets core.hooksPath.
- git hooks: commit-msg checks Conventional Commits and AI attribution,
  pre-commit scans staged files, pre-push runs the type check.
- CI: actions/checkout and actions/setup-node pinned by SHA, pnpm 12.14.0
  from npm, and the no-telemetry env in every workflow. Delete
  .github/actions and the workflows that needed fleet scripts.

From socket-mcp: scripts/repo/util/{main,commit-message,scan}.mts,
scripts/repo/hooks/*.mts, .git-hooks/*, .oxfmtrc.json, CLAUDE.md,
.gitattributes, test/repo/unit/repo-scan.test.mts, and the ci-gates.yml
shape. The scan drops the private-repo-name rule, because sauce names
that repository in its plugin installer and release-kit browser profile,
and the shipped-content check governs that name. The scan also skips
tracked directory symlinks, and pre-commit skips staged gitlinks, which
have no blob to read. repo-scan.test.mts and commit-message.test.mts
cover the scan, the hooks, and both differences.

Delete the GHCR download, verification and hydration code
(scripts/repo/bootstrap), its .gitignore block, and its setup steps in
.claude/settings.json. Delete the fleet trees (scripts/fleet,
.claude/hooks/fleet, .claude/skills/fleet, .config/fleet, test/fleet, the
fleet git-hook chain, .husky), the fleet member configs under .config and
.config/repo, and the scripts/repo entry points that only fleet tooling
ran. Move the few helpers sauce code used next to their one consumer.
Drop the devDependencies, catalog pins, soak exclusions, and patches that
only that code needed, and rewrite AGENTS.md, .gitignore and the
remaining fleet comments to describe this repository.

* fix(test): make lock-step and bootstrap tests pass on windows

check-lock-step-refs prints repo-relative paths with `/` on every
platform. The bootstrap integration test maps temp-repo reads onto the
fake scenario root by relative path, so its path.join keys match on
Windows. Both failed on main's Windows job before this change.

oxlint also ignores **/plugin-patches/**, so `pnpm run fix` cannot
rewrite those byte copies of upstream sources.

* fix(test): match the workflows dir by segment in the bootstrap fixture

The fake listDir seam compared the path suffix with `/`, so on Windows it
never saw .github\workflows and the trusted-publisher step planned as if
no workflow existed.
@ljharb Jordan Harband (ljharb) changed the title build: replace the fleet pack with repo-owned tooling build(repo): add git hooks and content scan, fix release npm version Nov 5, 2026
@ljharb
Jordan Harband (ljharb) merged commit 1ba48c7 into SocketDev:main Nov 5, 2026
9 checks passed
@ljharb
Jordan Harband (ljharb) deleted the claude/remove-ghcr-fleet-pack-8fae7b branch November 5, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants