You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
api/analytics_precommit BUILTIN_CHECKS drifted from engine — API missing 5 checks incl. SEC005/SEC006 #9873
api/analytics_precommit.py carries its own copy of the BUILTIN_CHECKS dict that has drifted out of sync with the canonical definitions in the analyzer engine code_intelligence/precommit_analyzer.py. The API copy is a stale subset — it is missing 5 checks the engine defines, including two security checks.
Found during the duplication-elimination sweep (#9794, PR #9865). The CheckDefinitionclass is already shared (the API imports it from the engine at api/analytics_precommit.py:23); only the data dict is duplicated, and it has diverged. The dedup sweep deliberately did not consolidate it because doing so would change the API's check surface (not behavior-preserving) — this is a product/correctness decision, filed here.
If the /api/.../precommit endpoint is meant to reflect the same checks the engine runs, the API is silently under-reporting — notably two security checks (SEC005/SEC006) are absent from whatever the API surfaces (check catalog / config UI / results). If the subset is intentional, that intent is undocumented and fragile (new engine checks won't propagate).
Recommended fix
Make api/analytics_precommit.py import BUILTIN_CHECKS from code_intelligence/precommit_analyzer.py (the engine is the SSOT; the API already imports CheckDefinition from it). If the API genuinely needs a curated subset, derive it explicitly from the engine dict (e.g. an allow-list of IDs) rather than maintaining a hand-copied dict, and document why. Either way eliminates the ~111 lines of duplicated definitions and prevents future drift.
Verify against code_intelligence/precommit_analyzer_test.py and any API tests for the precommit endpoint.
Resolved on Dev_new_gui. The fix landed in two PRs: #9886 (catalog derived from the engine SSOT) and #9889 (full delegation — removed the duplicate runner + stale fast-mode skip list, so the API now executes via PrecommitAnalyzer). The API precommit surface is now a thin layer over code_intelligence/precommit_analyzer.py: catalog, execution, expensive-set and multiline handling all come from the engine and can no longer drift. The previously-missing SEC005/SEC006/DOC002/QUA004/STY003 are now exposed and (incl. multiline) actually run.
Bug sweep 2026-06-10 → skipped (actively owned). Local worktrees issue-9873 and issue-9873b already carry commits for this (fix(precommit): derive API check catalog from engine SSOT / delegate execution to engine). Confirmed the fix direction is right (api/analytics_precommit.py already imports CheckDefinition from the engine at L23; importing BUILTIN_CHECKS from code_intelligence/precommit_analyzer.py — 19 checks — restores SEC005/SEC006/DOC002/QUA004/STY003). The sweep did not touch it to avoid clobbering that in-progress work.
Activity
fix(precommit): derive API check catalog from engine SSOT — adds 5 mi…
github-actions commentedon Jun 10, 2026
PR #9886 (merged to
Dev_new_gui) references this issue with a close keyword.If this issue is fully resolved, close it manually. If work remains, no action is needed.
fix(precommit): delegate execution to engine, remove duplicate runner (…
mrveiss commentedon Jun 10, 2026
Resolved on
Dev_new_gui. The fix landed in two PRs: #9886 (catalog derived from the engine SSOT) and #9889 (full delegation — removed the duplicate runner + stale fast-mode skip list, so the API now executes viaPrecommitAnalyzer). The API precommit surface is now a thin layer overcode_intelligence/precommit_analyzer.py: catalog, execution, expensive-set and multiline handling all come from the engine and can no longer drift. The previously-missing SEC005/SEC006/DOC002/QUA004/STY003 are now exposed and (incl. multiline) actually run.mrveiss commentedon Jun 10, 2026
Bug sweep 2026-06-10 → skipped (actively owned). Local worktrees
issue-9873andissue-9873balready carry commits for this (fix(precommit): derive API check catalog from engine SSOT/delegate execution to engine). Confirmed the fix direction is right (api/analytics_precommit.pyalready importsCheckDefinitionfrom the engine at L23; importingBUILTIN_CHECKSfromcode_intelligence/precommit_analyzer.py— 19 checks — restores SEC005/SEC006/DOC002/QUA004/STY003). The sweep did not touch it to avoid clobbering that in-progress work.