Skip to content

[M2.4c] Audit coverage test for every mutating route - #128

Merged
samuelmbabhazi merged 2 commits into
mainfrom
feat/m2.4c-audit-coverage
Nov 5, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
feat/m2.4c-audit-coverage

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

What changed

M2.4c (CLAUDE.md rule 6): apps/api/src/audit-coverage.spec.ts.

  • It lists every registered mutating route (from the shared route inventory) and requires a reviewed entry naming the audit events its command publishes. Stale entries also fail.
  • It checks that each named event is really emitted by production code: either the full name, or the literal last part used by the module's event builder (identityEvent('registered'), `membership.${action}`, `${purpose}_requested`).
  • The PLAN ticks M2.4c.

How it was tested

  • It runs locally with the unit tests; no database is needed.
  • Adding an invented identity.teleported_moon event makes it fail as expected. I checked this, then reverted.
  • The local gate passes.

Limits

This is a declaration and code check, not a runtime check. Runtime audit behavior stays covered by each command's integration tests.

@samuelmbabhazi
samuelmbabhazi merged commit 5140648 into main Nov 5, 2026
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.4c-audit-coverage branch November 5, 2026 17:29
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