feat(ai): admin Shadow + Models tabs (Phase 12, AI-076 slice 2)#367
Merged
Conversation
Read-only visualization of the slice-1 shadow data on /ai-quality. - Shadow tab: shadow_runs rolled up per (feature, primary, shadow) via one GROUP BY (no N+1) — p50 latency (percentile_cont), SQL-side lexical agreement (exact-match rate, avg length-ratio, both-present rate), shadow-minus-primary latency/cost/token deltas + projected monthly cost delta (pure unit-tested ToPairDto helper). Row -> modal with paged side-by-side primary-vs-shadow response samples (limit 1..50). Caption: agreement is lexical, NOT a quality verdict (judge scoring = later slice). Empty state explains shadow is OFF by default + how to enable. - Models tab: flat view of seeded models registry, status color-coded. - 3 read-only endpoints under /admin/ai-quality (shadow/summary, shadow/samples, models), admin-auth inherited. NO mutation — promote/ rollback + table-driven routing is the next slice. 700 unit tests green (9 new); admin tsc + build clean; integration tests (empty/auth/400/seeded) run in CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Phase 12 (RLOps) — slice 2: make shadow data visible
Two read-only tabs on the admin AI-quality page (
/ai-quality), surfacing theshadow_runs+modelsdata shipped in slice 1 (#366).Shadow tab
shadow_runsrolled up per (feature, primary-model, shadow-model) via a single PostgreSQLGROUP BY(no N+1):percentile_contp50 latency, SQL-side lexical agreement (exact-match rate + avg length-ratio + both-present rate, over rows where both responses exist).ToPairDtohelper.Ai:Shadow:Routes:{feature}+ a sample rate).Models tab
Flat view of the seeded
modelsregistry (feature, provider, model, status) — status color-coded Primary/Shadow/Retired.Backend
3 endpoints under
/admin/ai-quality(GET /shadow/summary,/shadow/samples,/models), DTOs appended to the Ai-quality contract, admin-auth inherited. Strictly read-only — promote/rollback + table-driven routing is the next slice.Verification
700 unit tests green (9 new on the delta/projection math); admin
tsc --noEmit+vite buildclean; integration tests (summary empty/auth-401/400/models-seeded) run in CI. Browser-check deferred to owner (admin JWT + needs shadow enabled for non-empty data).Architect → backend + frontend (parallel, locked contract). Files:
AdminAiQualityEndpoints.cs,AiQualityDtos.cs,AiQualityPage.tsx,api/client.ts.🤖 Generated with Claude Code