Skip to content

feat(setup): recommended hardening wires the triage pre-commit gates (increment 2c) - #331

Merged
sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a
Jul 11, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

Adoption step for the triage delegate line. The gates kit triage check-deps (existing) and kit triage check-skills (increment 2b) were documented as pre-commit steps — but nothing installed them. kit setup --recommended wired only kit security scan-staged into the pre-commit hook, so the triage chokepoint existed on paper only.

This adds both triage gates to applyRecommendedHardening, turning the documented fail-closed gates into enforced ones: a commit that adds an untriaged dependency, or stages a skill without a fresh --deep triage, is now blocked at commit time.

Type of Change

  • New feature (non-breaking change that adds functionality)

Related Issues

Changes Made

  • src/recommended.ts: the recommended pre-commit hook now runs security scan-staged + triage check-deps + triage check-skills. Doc comment updated to explain the enforcement rationale.
  • src/commands/setup.ts: the --recommended confirmation prompt now names the triage gates it wires.
  • Docs: COMMANDS.md lists kit triage check-skills; ENFORCEMENT_AND_AUDIT.md notes both triage gates are wired by kit setup --recommended.

Testing

Both gates are cheap no-ops when nothing relevant is staged, so the addition doesn't disturb ordinary commits — it only fires on newly-added deps or staged skills.

Test Coverage

  • Updated existing tests (recommended.test.ts now asserts both triage gates land in the generated pre-commit hook)

  • All tests pass (npm test)

  • npx tsc --noEmit — clean

  • npx eslint src — 0 errors (pre-existing warnings only)

  • npm run build — clean

  • node scripts/test.mjs — 2805/2805 pass

  • Public surface unchanged — no public-surface.json regen needed

Manual Testing

  1. kit setup --recommended in a repo → .git/hooks/pre-commit contains all three gate commands.
  2. Stage a new untriaged dep in package.json and commit → blocked by check-deps.
  3. Stage a skill file with no --deep triage and commit → blocked by check-skills.

Breaking Changes

None / N/A. Only affects users who opt into --recommended, and the gates no-op unless a dep/skill is actually staged. --no-verify remains the audited escape hatch (logged to .kit-skipped-commits.jsonl).

Checklist

  • My code follows the project's style guidelines
  • All new code has test coverage
  • All tests pass locally (npm test)
  • No new warnings or errors introduced
  • I've updated documentation as needed
  • No hardcoded secrets or sensitive data
  • Code has been self-reviewed

Performance Impact

  • No performance impact

Reviewer Notes

This closes the same "exists but nothing installs it" gap that --broker-gate closed for the runtime egress/fs gates (#71). The gates were always designed to run at commit time; this just makes the recommended profile actually wire them.

🤖 Generated with Claude Code


Generated by Claude Code

…(increment 2c)

The triage gates (`kit triage check-deps` / `check-skills`) were documented as
pre-commit steps but nothing installed them — only `kit security scan-staged`
was wired into the recommended pre-commit hook. This adds both triage gates to
`applyRecommendedHardening`, so `kit setup --recommended` turns the documented
fail-closed gates into enforced ones: a commit adding an untriaged dep or a
staged skill without a fresh --deep triage is now blocked at commit time.

Both gates are cheap no-ops when nothing relevant is staged. Updates the setup
prompt and the COMMANDS / ENFORCEMENT docs to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 33a91fc into main Jul 11, 2026
18 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a branch July 11, 2026 13:32
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