feat: filter coding Slack analytics by author

Merged
SI
1mo ago
+285-6

Admins cannot currently narrow coding-agent Slack analytics to one author. Add optional tag (a trimmed, nonblank Slack user ID) to GET /api/admins/coding/slack; filter before calculating mention and pull-request totals. Omitting it preserves the current result. Unknown IDs return empty results.

Add admin-only GET /api/admins/coding-agent/slack-tags, returning distinct authors as { status, total, tags: [{ id, name, avatar }] }, sorted by display name and deduplicated by ID. Reuse current admin authentication and Slack collection. This is a bounded successor to existing #338; the original branch remains untouched.

The options route performs one existing all-period scan when requested. It inherits current channel access, retention, pagination and partial-failure limitations; it does not promise a complete all-time directory. No new Slack scope, token handling, automatic caller, UI, poller, scheduled job or Slack send. Billing, SDKv7 and original651 remain out of scope. Docs owns operation inventory/publication companions; source contract is in docs/verification/slack-tag-filter.md.

Validation:

  • Baseline 42 tests passed; regression stage exposed four failing existing-path assertions plus the missing new route suite.
  • 198 focused admin/auth tests across 32 files pass, full lint and changed-file formatting pass.
  • Whole-project local typecheck has 211 diagnostics byte-identical to the baseline.
  • Tests invoke actual GET/query/handler code with auth/Slack leaves mocked. No live admin collector, Slack/provider/customer/credit/database operation or credential inspection.
  • Independent Spec and Standards reviews are clear at the refreshed exact head. Full CI: 7,215 tests passed and 15 skipped; response-contract typecheck, format, lint, compatibility and preview passed. Coordinator owns merge.

Refreshed onto actual main 0428bdedf6798a628e08f37f8095b28216fe8228 to preserve API1092 fixture changes. Head ab0169e85b84fa3304f95caad2f69b3242399453, tree efcd6d2732996bbb4b64fa53aef00b487a702513; all nine candidate files remain byte-identical to the initial reviewed candidate. Fresh checks and independent delta review passed on this head.