Skip to content

feat(ai): audit-mixin-rollout-tier3 group 1 — created_by/updated_by - #302

Merged
arutsh merged 3 commits into
mainfrom
Shared/feat/Issue-301/audit-mixin-rollout-tier3-group1
Sep 20, 2026
Merged

arutsh merged 3 commits into
mainfrom
Shared/feat/Issue-301/audit-mixin-rollout-tier3-group1

Conversation

@arutsh

@arutsh arutsh commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds AuditMixin/AuditColumnsMixin to AIAuditLog, AIPrompt, UserProviderKey, CustomerAiDefaults, and PrivilegedAccessLog so created_by/updated_by populate automatically via the existing audit-mixin-auto-population mechanism.
  • Adds an Alembic migration (nullable columns, no backfill) and fixes id type annotations (Mapped[t.GUID] → Mapped[uuid.UUID]) that the mixin's own id column exposed as a real mypy conflict.
  • PrivilegedAccessLog's created_by is asserted to match its existing actor_user_id field in a test, rather than treated as a second, unrelated source of truth (per design.md's decision).

Test plan

  • services/ai full test suite passes (131 tests)
  • New tests cover created_by on insert (all 5 models) and updated_by behavior split by mutability (populated on update for AIPrompt/UserProviderKey/CustomerAiDefaults; stays NULL for append-only AIAuditLog/PrivilegedAccessLog)
  • Migration verified column-for-column against model metadata (schema-diff script) and applied/confirmed against a real local Postgres DB
  • flake8 (--max-line-length=100) and mypy clean on touched files

Closes #301

🤖 Generated with Claude Code

arutsh and others added 2 commits September 20, 2026 16:39
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…or ai-service models

Adds AuditMixin/AuditColumnsMixin to AIAuditLog, AIPrompt, UserProviderKey,
CustomerAiDefaults, and PrivilegedAccessLog so created_by/updated_by populate
automatically via the existing audit-mixin-auto-population mechanism.
PrivilegedAccessLog's created_by is asserted to match its existing
actor_user_id field rather than treated as a second, unrelated source of truth.

Closes #301

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

vercel Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
grant-flow Ready Ready Preview Sep 20, 2026 4:31pm UTC

…ag coverage-guard metadata

- black --check was failing in CI on the 4 models edited for audit-mixin-rollout-tier3
  group 1 (shorter uuid.uuid4() default now fits the mapped_column call on one line).
- Add scripts/git-hooks/pre-push mirroring each service's CI lint step (black/mypy/flake8),
  scoped to whichever service(s) a push touches, documented in WORKFLOW.md.
- Tag audit-mixin-coverage-guard's priority/author/depends_on in its .openspec.yaml.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@arutsh
arutsh merged commit 367cf63 into main Sep 20, 2026
24 of 25 checks passed
@arutsh
arutsh deleted the Shared/feat/Issue-301/audit-mixin-rollout-tier3-group1 branch September 20, 2026 16:34

This branch was successfully deployed

1 active deployment
Preview — 59e6f8f8 Deployed Sep 20, 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.

audit-mixin-rollout-tier3: ai service — depends on audit-mixin-auto-population being merged (group 1)

1 participant