Files
deepseek-harness/lefthook.yml
Tianyi Cui 4c8c1da8b3 feat: generate module dependency graph with freshness gate
Add scripts/gen-module-graph.ts, which derives the inter-package
dependency graph from each package's @deepseek-ai/dsh-* peerDependencies
and renders docs/module-graph.md (a GitHub-native Mermaid graph plus a
dependency table). Output is deterministic so a regenerate-and-diff
check is stable.

Wire a freshness gate the same way doc-sync is wired (ADR 0007: hooks
and CI run the same package.json scripts): verify-module-graph runs in
pre-push (lefthook) and as a CI step. It fails if the committed file
drifts from what the generator would produce.
2026-06-16 21:00:24 +08:00

36 lines
878 B
YAML

# Git hooks (lefthook). Hooks call the same package.json scripts CI runs —
# one source of truth; the hook is just an earlier, faster checkpoint.
# Install: `pnpm exec lefthook install` (runs automatically via postinstall).
pre-commit:
parallel: true
jobs:
- name: lint (staged)
glob: '*.{ts,mts,cts,mjs}'
exclude:
- 'vendor/*/src/**'
run: node_modules/.bin/eslint --fix {staged_files} && git add {staged_files}
stage_fixed: true
- name: typecheck
glob: '*.ts'
run: pnpm run typecheck
- name: vendor manifest guard
run: scripts/check-vendor-manifest.sh
pre-push:
parallel: true
jobs:
- name: test
run: pnpm run test
- name: hygiene
run: pnpm run hygiene
- name: doc-sync
run: pnpm run doc-sync
- name: module-graph freshness
run: pnpm run verify-module-graph