Team rationale: on-demand AI explanation per team#28
Merged
Conversation
On-demand, PII-free AI explanation per team (title/summary/strengths/gaps), cached on the team row and shown on public results. Descriptive only — never influences the deterministic allocation. Foundation for later AI features.
8 TDD tasks: teams.rationale column + migration, PII-free prompt/parse helpers, generate+persist, organizer endpoint, organizer+public surfacing, clear-on-edit, and the frontend (Explain teams button, team-card + public rendering).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First "deeper AI" feature from the audit. Stacked on #27 (base =
fix/self-custody-payouts) so the diff is exactly the rationale work — retarget tomainonce #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).
docs/superpowers/specs/2026-06-20-team-rationale-design.mddocs/superpowers/plans/2026-06-20-team-rationale.mdWhat 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 eachTeam(migration0009, additive/nullable)._team_payloads); a test asserts no PII reaches the model, so the public surface is PII-free by construction.ANTHROPIC_API_KEY→400"AI not configured" (no crash, no fake fallback). A model error degrades to "no rationale", never aborting.RATIONALE_MODELconfig; reuses the batched, system-cacheable pattern fromcategorization_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/interestsaren'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).