Skip to content

fix(agentanchor): remove demo-data fakes from trust-engine + consumer portfolio#101

Merged
vorionsys merged 1 commit intomainfrom
fix/agentanchor-trust-engine-portfolio-real-data
Apr 11, 2026
Merged

fix(agentanchor): remove demo-data fakes from trust-engine + consumer portfolio#101
vorionsys merged 1 commit intomainfrom
fix/agentanchor-trust-engine-portfolio-real-data

Conversation

@vorionsys
Copy link
Copy Markdown
Owner

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:

  1. The `if (res.ok)` gate meant non-2xx responses silently did nothing — no error, no loading state change, no indication to the user that the backend was broken. Stats just stayed as whatever was last set.
  2. The `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 data.

Fix:

  • Throw on non-ok responses so HTTP errors reach the catch
  • Catch surfaces the real error message (HTTP status / exception text)
  • New error-state UI with retry button instead of fabricating numbers
  • Delete the local `getDemoStats` / `getDemoEvents` helpers entirely

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

  • `npx tsc --noEmit` clean on both changed files (unrelated pre-existing errors in TrustBadge / phase6-repositories untouched)
  • Load `/trust-engine` against a dev backend where Supabase is reachable — real stats render
  • Load `/trust-engine` with Supabase env vars missing — error card with HTTP status + retry button appears (no fake 1842 compliance events)
  • Load `/profile` with no agents in the bots table — proper "No agents yet" empty state + "Browse Marketplace" CTA (unchanged)
  • Load `/profile` with 2 agents owned by the current user — both appear with real trust scores

Files changed

@vorionsys vorionsys force-pushed the fix/agentanchor-trust-engine-portfolio-real-data branch 6 times, most recently from 678961c to ef434a8 Compare April 11, 2026 22:36
… 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>
@vorionsys vorionsys force-pushed the fix/agentanchor-trust-engine-portfolio-real-data branch from ef434a8 to bfd0143 Compare April 11, 2026 22:46
@vorionsys vorionsys merged commit 57bf6e4 into main Apr 11, 2026
46 of 50 checks passed
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.

2 participants