Skip to content

Team rationale: on-demand AI explanation per team#28

Merged
comwanga merged 14 commits into
mainfrom
feat/team-rationale
Jun 21, 2026
Merged

Team rationale: on-demand AI explanation per team#28
comwanga merged 14 commits into
mainfrom
feat/team-rationale

Conversation

@comwanga

Copy link
Copy Markdown
Owner

First "deeper AI" feature from the audit. Stacked on #27 (base = fix/self-custody-payouts) so the diff is exactly the rationale work — retarget to main once #27 merges.

Built subagent-driven from the spec + plan, 8 TDD tasks, per-task review + a final whole-branch review (verdict: ready to merge, no Critical/Important).

  • Spec: docs/superpowers/specs/2026-06-20-team-rationale-design.md
  • Plan: docs/superpowers/plans/2026-06-20-team-rationale.md

What it does

An on-demand, PII-free AI explanation per team — title, one-sentence summary, strengths, gaps — cached on the team and shown in the organizer engine view ("Explain teams" button) and on public results. Descriptive only: it never reads into or changes the deterministic allocation engine.

How it works

  • POST /api/v1/allocations/{id}/rationale (organizer-only) → one batched Claude (Haiku) call → structured {title, summary, strengths, gaps} persisted as JSON on each Team (migration 0009, additive/nullable).
  • The AI request carries only roles, experience, and tech_stack/interests when present — never names or emails (_team_payloads); a test asserts no PII reaches the model, so the public surface is PII-free by construction.
  • No ANTHROPIC_API_KEY400 "AI not configured" (no crash, no fake fallback). A model error degrades to "no rationale", never aborting.
  • Cache is cleared when a member is moved; fresh allocations start with none.
  • Separate RATIONALE_MODEL config; reuses the batched, system-cacheable pattern from categorization_service.

Tests

Backend 170 passed; frontend tsc clean + 53 vitest, lint clean, production build green. PII-exclusion, no-key 400, clear-on-move, and the organizer + public surfaces are all covered by tests that exercise real behavior.

Known follow-up

tech_stack/interests aren't collected by the registration form yet (always empty today); the rationale uses them only when present. Capturing them is the "complementary pairing" track. When that lands, re-confirm the PII test (free-text fields an organizer types could contain a name).

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
squadsync Ready Ready Preview, Comment Jun 21, 2026 4:10pm

@comwanga comwanga mentioned this pull request Jun 21, 2026
@comwanga comwanga changed the base branch from fix/self-custody-payouts to main June 21, 2026 16:18
@comwanga comwanga merged commit 4a7ce2a into main Jun 21, 2026
6 checks passed
@comwanga comwanga deleted the feat/team-rationale branch June 21, 2026 16:21
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