Skip to content

Add audit-mixin coverage guard tests (auto-discovery + shared helper) - #312

Merged
arutsh merged 2 commits into
mainfrom
chore/audit-mixin-coverage-guard-auto-discovery
Sep 22, 2026
Merged

arutsh merged 2 commits into
mainfrom
chore/audit-mixin-coverage-guard-auto-discovery

Conversation

@arutsh

@arutsh arutsh commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds test_every_model_inherits_audit_mixin to ai/budget/chat/users, completing task group 1 of the audit-mixin-coverage-guard OpenSpec change.
  • Guard auto-discovers every module under each service's app/models/ via pkgutil instead of relying on __init__.py's explicit imports, so a model that forgets to be wired into __init__.py can no longer silently skip the check.
  • Shared assertion logic lives in shared/tests/audit_mixin_coverage.py::assert_full_audit_mixin_coverage() instead of being duplicated four times.

Test plan

  • All four services' test_audit_mixin_coverage.py pass in isolation
  • Manually added an unwired model file under services/ai/app/models/ (not imported by __init__.py) and confirmed the guard fails as expected, then removed it
  • black/flake8/mypy clean via pre-push hook

🤖 Generated with Claude Code

arutsh and others added 2 commits September 22, 2026 13:53
Auto-discovers every module under app/models/ via pkgutil instead of
relying on __init__.py's explicit imports, so a model that forgets to
be wired in can no longer silently skip the coverage check. Shared
assertion logic now lives in shared/tests/audit_mixin_coverage.py
instead of being duplicated across all four services.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
grant-flow Building Building Preview Sep 22, 2026 1:00pm UTC

@arutsh
arutsh merged commit 2836aad into main Sep 22, 2026
23 of 25 checks passed
@arutsh
arutsh deleted the chore/audit-mixin-coverage-guard-auto-discovery branch September 25, 2026 09:30

This branch was successfully deployed

1 active deployment
Preview — 3ce2e5e0 Deployed Sep 22, 2026 by vercel[bot]
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.

1 participant