Skip to content

feat(husky): enforce 6DQ L1 on git index snapshot in pre-commit - #55

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/l1-index-snapshot-pre-commit-9454
Nov 9, 2026
Merged

cursor[bot] merged 3 commits into
mainfrom
cursor/l1-index-snapshot-pre-commit-9454

Conversation

@nocoo

@nocoo nocoo commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Upgrades base-cli pre-commit from working-tree checks to 6DQ L1 on the Git index snapshot, aligned with nocoo/hooky / nocoo/matrix checkout-index templates.

Changes

  1. .husky/pre-commit

    • gitleaks protect --staged
    • git checkout-index → temp dir under /tmp/base-cli-index-*
    • Symlink node_modules from the installed worktree; verify staged package.json / bun.lock match installed copies
    • Run typecheck, lint, test:coverage in the snapshot (Vitest enforces four metrics ≥95%)
    • trap cleanup on EXIT/INT/TERM/HUP
  2. src/update-command.ts

    • Import consola from "consola" so Biome noUnresolvedImports passes in index snapshots (isolated cwd) without relying on worktree-only module resolution.
  3. AGENTS.md

    • L1 row → enforced; document hook behavior and timing note.

Verification (local)

Scenario Result
Staged TS error, clean worktree Hook exit 1 (typecheck TS2322 on index)
Staged untested exports (functions 90.9%) Hook exit 1 (Vitest coverage threshold)
Clean tree Hook exit 0
Warm path timing ~2.5s (time sh .husky/pre-commit)
Coverage (healthy) Stmts/Branches/Lines 100%, Functions 97.56% (all ≥95%)

Commits (preserved via merge)

  • fix(update-command): import consola from package for index-safe lint
  • feat(husky): run L1 on git index snapshot with coverage
  • docs(AGENTS): mark L1 pre-commit as enforced

Remaining gaps (unchanged)

  • Pre-commit does not yet measure/record formal cold-path <30s evidence on CI runners.
  • src/update-command.ts still excluded from coverage by design; functions floor is 97.56% with one counted function in login.ts at 92.85% within excluded-adjacent scope.
  • Local pre-push still skips gitleaks when missing (AGENTS G2 gap for local pre-push vs CI).
Open in Web Open in Cursor 

@cursor
cursor Bot merged commit b6dd60d into main Nov 9, 2026
8 checks passed
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