---
id: M008
title: "Credibility Debt Cleanup — Broken Links, Test Data, Jargon, Empty Metrics"
status: complete
completed_at: 2026-03-31T05:31:05.559Z
key_decisions:
  - technique_page_slug resolved at query time (DB join for keyword, Qdrant payload for semantic) rather than requiring frontend second API call
  - Soft-delete via hidden boolean for Creator rather than hard delete — preserves data integrity
  - Client-side topic-category computation from existing techniques array rather than a new API endpoint
  - Correlated COUNT subquery for key_moment_count matching existing patterns in creators.py
key_files:
  - backend/schemas.py
  - backend/search_service.py
  - backend/pipeline/stages.py
  - backend/routers/techniques.py
  - backend/routers/creators.py
  - backend/models.py
  - backend/tests/test_search.py
  - alembic/versions/009_add_creator_hidden_flag.py
  - frontend/src/pages/SearchResults.tsx
  - frontend/src/pages/TechniquePage.tsx
  - frontend/src/pages/Home.tsx
  - frontend/src/pages/CreatorDetail.tsx
  - frontend/src/components/AppFooter.tsx
  - frontend/src/api/public-client.ts
lessons_learned:
  - Cross-entity link resolution should happen at query time (join or payload enrichment) rather than pushing second API calls to the frontend — this is both faster and eliminates 404 races
  - Correlated COUNT subqueries are the right pattern for adding aggregate counts to list endpoints without schema migrations — used successfully in both creators.py and techniques.py now
  - Client-side computation from existing API data is preferable to new endpoints when the data is already fetched and the dataset is small
---

# M008: Credibility Debt Cleanup — Broken Links, Test Data, Jargon, Empty Metrics

**Fixed key moment search 404s, removed test data from production, eliminated jargon banners, and replaced empty metrics with meaningful data — clearing credibility debt before future feature work.**

## What Happened

M008 targeted four credibility issues that eroded user trust before they could evaluate the actual content.

**S01 (Fix Key Moment Search Links)** was the highest-risk slice. Key moment search results were 404ing because the frontend tried to navigate to `/techniques/{moment_slug}` — but moments don't have standalone pages. The fix required coordinated backend and frontend changes: adding `technique_page_slug` to the search result schema, enriching Qdrant payloads with parent slugs during stage 6 indexing, joining to TechniquePage in keyword search, and routing key moment clicks to `/techniques/{parent_slug}#km-{id}` with anchor scroll. Three new integration tests verify slug population across technique pages, key moments with parents, and orphan moments.

**S02 (Trust & Credibility Cleanup)** addressed three quick wins: (1) Added a `hidden` boolean column to Creator with migration 009 marking TestCreator hidden, filtered from the browse page query. (2) Removed the yellow "semantic search unavailable" fallback banner and its CSS. (3) Cleaned up footer to hide commit info when showing 'dev'. Bumped version to 0.8.0.

**S03 (Homepage Cards & Creator Metric Polish)** enriched two surfaces with real data: (1) Added `key_moment_count` via correlated COUNT subquery to the techniques list endpoint, rendered on homepage cards alongside topic tag pills. (2) Replaced meaningless '0 views' on creator detail pages with a topic-category breakdown computed client-side from the existing techniques array.

All changes deployed to ub01:8096. Backend tests pass. Frontend builds clean with zero TypeScript errors.

## Success Criteria Results

### Success Criteria (from slice "After this" demos)

- **S01: Search 'compression', click any key moment result → lands on parent technique page with key moment visible** — ✅ MET. Backend tests verify `technique_page_slug` population. Frontend routes key moment clicks to `/techniques/{parent_slug}#km-{id}`. useEffect scrolls to hash target after data load.

- **S02: Creators page has no TestCreator. Footer shows clean version info. Search results have no yellow jargon banner.** — ✅ MET. Migration 009 marks TestCreator hidden; `list_creators()` filters `hidden != True`. No `search-fallback-banner` references remain in SearchResults.tsx or App.css. Footer hides commit section when `__GIT_COMMIT__` is 'dev'. Version bumped to 0.8.0.

- **S03: Homepage technique cards show sub-topic tags and key moment count. Creator pages show technique count by topic instead of '0 views'.** — ✅ MET. API returns `key_moment_count` (verified: values 4, 4, 2 for real data). Topic tags render as colored pills. CreatorDetail shows topic-category breakdown instead of view_count.

## Definition of Done Results

- ✅ All 3 slices complete (S01, S02, S03 — all marked ✅ in roadmap)
- ✅ All 3 slice summaries exist (S01-SUMMARY.md, S02-SUMMARY.md, S03-SUMMARY.md)
- ✅ Code changes verified: 19 files, 853 insertions across backend, frontend, migrations, tests
- ✅ Backend tests pass (8 tests in test_search.py including 3 new)
- ✅ Frontend builds clean with zero TypeScript errors
- ✅ No cross-slice integration issues (S02 and S03 were independent; S01 was standalone)

## Requirement Outcomes

### R005 — Search-First Web UI
**Status: validated (no change)**
Advanced by S01 (key moment links no longer 404) and S02 (no misleading yellow banner) and S03 (richer homepage card metadata). Already validated in prior milestones.

### R007 — Creators Browse Page
**Status: validated (no change)**
Advanced by S02 (TestCreator hidden from browse) and S03 (meaningful topic metrics on creator detail). Already validated.

### R015 — 30-Second Retrieval Target
**Status: active (no change)**
Advanced by S01 (eliminating 404 dead-end on key moment clicks) and S03 (richer card metadata reduces navigation guesswork). Not yet formally timed for validation.

## Deviations

Migration 009 written manually (no DB connection from dev machine). fallbackUsed state removed entirely (TS strict mode required it after banner removal). Docker service name chrysopedia-web not chrysopedia-web-8096 as originally documented.

## Follow-ups

Re-index Qdrant so all points carry slug fields (eliminates title-based fallback path). Address QdrantManager random UUID issue before next bulk re-index. Normalize topic category casing in pipeline stage 4. Run alembic upgrade head on ub01 to apply migration 009.
