chore(services): add port-drift audit

Each services/*/CLAUDE.md declares `## Port: NNNN` — the authoritative
per-service port spec (docs/PORT_SCHEMA.md is explicitly partially
aspirational). This audit verifies:

  1. Declared port appears as a literal in the service's own source
     (catches: moved port in code but forgot to update CLAUDE.md).
  2. No two services claim the same port (catches: accidental
     collision when scaffolding new services).

Current state: ✓ 15 services, all declared ports found in code, zero
collisions (mana-auth/geocoding/stt/tts/image-gen/voice-bot/mail/
credits/user/subscriptions/analytics/events/news-ingester/ai/research).

Report-only; not a CI gate. Run with `pnpm run audit:port-drift`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-22 17:22:37 +02:00
parent 52af8c0cec
commit 4d91e2daad
2 changed files with 156 additions and 0 deletions

View file

@ -33,6 +33,7 @@
"audit:complexity": "node scripts/audit-complexity.mjs",
"audit:map": "node scripts/build-complexity-map.mjs",
"audit:i18n-coverage": "node scripts/audit-i18n-coverage.mjs",
"audit:port-drift": "node scripts/audit-port-drift.mjs",
"generate:dockerfiles": "node scripts/generate-dockerfiles.mjs",
"setup:env": "node scripts/generate-env.mjs",
"setup:secrets": "node scripts/setup-secrets.mjs",