Skip to content

feat(doctor): kit doctor row — is the triage pre-commit gate actually wired? (increment 2d) - #332

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

Closes the loop on the triage delegate line. Increment 2c installs the triage pre-commit gates via kit setup --recommended; 2d makes their presence auditable. kit doctor now reads the repo's actual .git/hooks/pre-commit and reports — never silently — whether the commit-time triage chokepoint is live.

Type of Change

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

Related Issues

Changes Made

  • src/doctor.ts: new "triage pre-commit gates" posture row (checkTriageGates), wired after the deep-skill-scanner row. Verdicts:
    • pass — both kit triage check-deps + check-skills present in the pre-commit hook
    • warn — the hook exists but wires only one gate (partial drift, e.g. installed before check-skills shipped); names the missing gate
    • skip — not a git repo, or the gates aren't wired (optional; suggests kit setup --recommended)
  • Pure decision triageGateStatus(hookContent) split out and exported for deterministic unit testing (no git required).

Testing

Honest posture is the point: the row is always present, degrades to skip rather than a false pass, and a partial wiring surfaces as warn instead of being swallowed.

Test Coverage

  • Added new tests (4 pure triageGateStatus cases + 1 runDoctor integration assertion)

  • 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 — 2810/2810 pass

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

Manual Testing

  1. kit doctor in a repo without the gates → row shows skip with the kit setup --recommended hint.
  2. After kit setup --recommended → row shows pass (both gates present).
  3. A pre-commit hook with only check-deps → row shows warn, naming check-skills as missing.

Breaking Changes

None / N/A.

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
  • No hardcoded secrets or sensitive data
  • Code has been self-reviewed

Performance Impact

  • No performance impact

Reviewer Notes

Same "never silent" doctrine as the other posture rows (identity keystore, exec-broker scope/runtime): an inactive or partially-wired gate is surfaced, not hidden behind a green check.

🤖 Generated with Claude Code


Generated by Claude Code

… wired? (increment 2d)

Adds a "triage pre-commit gates" posture row that reads the repo's actual
.git/hooks/pre-commit and reports, never silently, whether the commit-time
triage chokepoint is live:
  pass  both `kit triage check-deps` + `check-skills` present
  warn  the hook exists but wires only one gate (partial drift — e.g. installed
        before check-skills shipped); names the missing gate
  skip  not a git repo, or the gates aren't wired (optional; run
        `kit setup --recommended`)

Closes the loop with increment 2c: 2c installs the gates, 2d makes their
presence auditable. Pure decision (triageGateStatus) split out and unit-tested.

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