-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
99 lines (99 loc) · 4.87 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
99 lines (99 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
repos:
- repo: local
hooks:
- id: lore-trailers
name: lore-trailers
entry: python3 .githooks/commit-msg
language: system
stages: [commit-msg]
- id: check-circular-imports
name: check-circular-imports
entry: python3 scripts/check_circular_imports.py
language: system
pass_filenames: false
- id: check-event-spine-wiring
name: check-event-spine-wiring
# ADR 0032 M7 invariant: one typed lifecycle path (EventSpine -> audit
# consumer), no orphaned/competing event bus, every RunEventType mapped
# to the audit record. Read-only static check.
entry: python3 scripts/validate_event_spine_wiring.py
language: system
pass_filenames: false
- id: ruff-format
name: ruff-format
entry: env UV_CACHE_DIR=.uv-cache uv run ruff format
language: system
pass_filenames: false
- id: ruff
name: ruff
entry: env UV_CACHE_DIR=.uv-cache uv run ruff check --fix --exit-non-zero-on-fix .
language: system
pass_filenames: false
- id: mypy
name: mypy
entry: env UV_CACHE_DIR=.uv-cache MYPY_CACHE_DIR=.mypy_cache uv run mypy teaagent/ tests/ --explicit-package-bases
language: system
pass_filenames: false
- id: check-public-docstrings
name: check-public-docstrings
entry: python3 scripts/check_public_docstrings.py
language: system
pass_filenames: false
- id: check-test-assertion-regression
name: check-test-assertion-regression
# A1 governance gate: blocks weakening/deleting existing test assertions vs HEAD.
# Override with ALLOW_TEST_WEAKENING=1 for a genuine refactor/rename.
entry: python3 scripts/check_test_assertion_regression.py
language: system
pass_filenames: false
- id: pytest
name: pytest
# Smoke subset = governance core + regression contracts (fast, ~0.5s).
# The regression tests would have caught the permission_mode enum vs
# string bugs and the sandbox run_id collision — real regressions that
# the governance-only subset missed.
# Full suite: TEAAGENT_PRECOMMIT_FULL=1 pre-commit run --all-files
entry: bash -c 'if [ "${TEAAGENT_PRECOMMIT_FULL:-0}" = 1 ]; then env UV_CACHE_DIR=.uv-cache uv run pytest -q; else env UV_CACHE_DIR=.uv-cache uv run pytest tests/test_p0_harness.py tests/test_surface_auth_hardening.py tests/test_policy.py tests/test_phase5_context_bus.py tests/test_governance_hardening.py tests/regression/ tests/acceptance/test_subagent_lineage_flow.py -q; fi'
language: system
pass_filenames: false
- id: check-docs-inventory
name: check-docs-inventory
# Fail the commit if docs/generated/docs-inventory.md is stale. --check is
# read-only: it never writes, so a failure forces the committer to run the
# generator and stage the result. (A regenerate-then-check entry would pass
# trivially while leaving the regenerated file unstaged.)
entry: python3 scripts/generate_docs_inventory.py --check
language: system
pass_filenames: false
- id: check-okf-catalogs
name: check-okf-catalogs
# Fail the commit if any OKF catalog bundle is stale. --check is read-only.
entry: bash -c 'python3 scripts/generate_okf_docs_bundle.py --check && python3 scripts/generate_okf_docs_bundle.py --manifest docs/okf-catalog-reference.yaml --output knowledge/teaagent-reference --check && python3 scripts/generate_okf_docs_bundle.py --manifest docs/okf-catalog-history.yaml --output knowledge/teaagent-history --check'
language: system
pass_filenames: false
- id: check-action-register-link
name: check-action-register-link
# Phase B G9 gate: require action ID in commit message or staged diff.
entry: python3 scripts/check_action_register_link.py --commit-msg .git/COMMIT_EDITMSG
language: system
pass_filenames: false
stages: [commit-msg]
- id: check-github-url-consistency
name: check-github-url-consistency
# Enforce one canonical GitHub URL (U-P0-1).
entry: python3 scripts/check_github_url_consistency.py
language: system
pass_filenames: false
- id: check-god-modules
name: check-god-modules
# Thin-harness rule: no module > 800 lines without ADR exemption.
entry: python3 scripts/check_god_modules.py
language: system
pass_filenames: false
- id: check-high-risk-paths
name: check-high-risk-paths
# review-system §4.2 G4: high-risk path changes (scripts/high_risk_paths.yaml)
# require a docs/reviews/<id>-risk.md report, or TEAAGENT_RISK_ACK="<reason>".
entry: python3 scripts/check_high_risk_paths.py
language: system
pass_filenames: false