Commit Graph
3 Commits
Author SHA1 Message Date
g-but 16dfdc0c88 fix(home): lint clean — convert require() to top-level imports + extend pre-commit to home/
home/log.ts:selfTest used `require("node:os")` and `require("node:crypto")`
to avoid adding top-level imports for test-only deps. Eslint's
@typescript-eslint/no-require-imports flagged both as errors. The
pre-commit hook only ran `eslint src/` so it never caught them.

Two fixes in one commit:
  • Moved the imports to top-level alongside the existing fs + path
    imports. randomUUID is named-imported (matches the existing
    home/emit.ts style); os stays default-imported.
  • Extended .husky/pre-commit's eslint step from 'src/' to 'src/ home/'
    so future home/ lint regressions can't slip through.

Three remaining cryp.randomUUID() callsites and the import block all
updated together. tsc clean, eslint clean, home/log 6/6 still green.
2026-05-20 07:28:56 +02:00
g-butandClaude Sonnet 4.6 78ace3d904 chore(hooks): add pre-push smoke test gate
Runs npm run smoke before push when the local server is detected.
Silent skip when server is down so offline pushes are never blocked.
Supports COCKPIT_SESSION_TOKEN for fully authenticated smoke runs.
pre-commit now documents that authenticated smoke lives in pre-push.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 10:26:42 +02:00
g-butandClaude Opus 4.7 bceacc8222 chore(husky): add pre-commit hook running tsc + eslint
Adds husky as a dev dep and wires .husky/pre-commit to run:
  npx tsc --noEmit
  npx eslint src/

Both must pass for the commit to land. Smoke is intentionally NOT in
the hook because it needs a live dev server — run `npm run smoke`
manually before opening a PR.

Catches the regressions a 100-commit refactor sweep can introduce
(broken zod schema, missed import, accidentally-disabled rule)
before they reach origin/main, complementing the human / cron /
agent commit flow we've established.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:35:54 +02:00