Conversation
6 tasks
678961c to
ef434a8
Compare
… portfolio Two user-facing pages were rendering fabricated data instead of real state: 1. apps/agentanchor/components/profile/ConsumerPortfolio.tsx Shipped with const agents = [] and a "TODO: Fetch actual agent data from API" comment. The Agent Portfolio card always showed zero agents regardless of what the user actually owned. Wire to a Supabase browser client query against the `bots` table filtered by user_id=profile.id. Real loading + error states replace the silent empty array. "Avg Trust Score" and "Active" counts are now computed from live data. 2. apps/agentanchor/app/(dashboard)/trust-engine/page.tsx The fetchPhase6Data() catch block silently fell back to getDemoStats() / getDemoEvents() with a "Use demo data for now" comment — 47 fake agents, 1842 fabricated compliance events, 3291 made-up role-gate evaluations rendered as if they were live. And the success path only ran on res.ok but didn't throw on non-ok responses, so 4xx/5xx also went silently to the demo fallback. Delete the local getDemoStats / getDemoEvents helpers. Throw on non-ok responses so errors reach the catch. Render a proper error card with the real HTTP status and a retry button instead of fabricating numbers. A governance product cannot lie about trust scores and compliance events. Real empty state + real error state > plausible fake data. Typecheck: both changed files clean. Pre-existing errors in unrelated files (trust-tier enum drift in TrustBadge etc) are untouched. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ef434a8 to
bfd0143
Compare
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.
Summary
Track 1 PR-FAKE-3. Removes two user-facing silent-demo-fallback fakes from the agentanchor dashboard.
1. ConsumerPortfolio.tsx
Shipped with `const agents = []` and a `// TODO: Fetch actual agent data from API` comment. The Agent Portfolio card on the user profile always showed zero agents regardless of what the user actually owned. "Total Agents", "Active", and "Avg Trust Score" were all hardcoded to 0.
Fix: wire to `createClient()` from `@/lib/supabase/client` and query the `bots` table filtered by `user_id=profile.id`. Real loading, error, and empty states. "Avg Trust Score" and "Active" counts computed from live data.
2. trust-engine/page.tsx (Phase 6 dashboard)
`fetchPhase6Data()` had two fakes in one:
Fix:
Why this matters
AgentAnchor is a governance product. Hardcoded trust scores and fabricated compliance events are worse than useless — they create false confidence in a system that's actually broken. Real empty state + real error state > plausible fake data.
Test plan
Files changed