← Back to Pull requests

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

Closed
unknown closed this pull request without merging on Nov 05, 2026 21:22 UTC
View on GitHub
unknown unknown commented on Nov 05, 2026 18:34 UTC
Author

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.
  • Diff: 307 lines (+230 / -77) across 3 files Reviewer: ljharb Review duration: 167m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 307 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.343
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #232"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%