Context. surface customer · domain veritas · route /domains/veritas/bias · auth signed-in · source apps/oshun/web/src/app/domains/veritas/bias/page.tsx
Last walked. 2026-05-29 automated runtime walk (Playwright headless) — render, /v1 data (2xx), console/page-errors, expected content, screenshot verified; live screen-reader, touch, offline, and telemetry-delivery checks pending a manual AT pass. Evidence: WALKTHROUGH/results/runtime-sweep-2026-05-29.md. 2026-06-28 Codex Bias Detector addendum — signed-in cognitive-bias filtering, keyboard accordion expansion, close/back, media spectrum, framing analysis, dashboard metrics, debiasing guidance, blind-spot quiz completion/results/reset, personal profile, reduced-motion chart/bar checks, standalone PWA launch, offline mobile use, no-horizontal-overflow checks, /domains/veritas tool-grid entry, and /veritas broadsheet-subnav entry are covered by the E2E evidence below.
Purpose#
The Veritas Bias Detector — a full-screen overlay tool that explains cognitive biases, charts a media political spectrum, compares story framing across sources, summarizes fixture bias metrics, suggests debiasing exercises, runs a "blind spot" diagnostic, and surfaces a personal bias profile dashboard.
Entry points#
/domains/veritasindex — secondary "More verification tools" panel → "Bias" button opens this detector in-place and Close returns to the domain home view.- Linked from
/veritas— broadsheet subnav "Bias analysis" navigates to/domains/veritas/bias; Close uses browser history to return to/veritas. - Direct URL / bookmark — yes (auth required)
Layout regions#
page.tsx is a 'use client' component that renders an sr-only <h1> ("Bias
Detector · Veritas · OSHUN") then mounts
<VeritasBiasDetector onClose={() => router.back()} />. The detector is a fixed
full-screen overlay.
- Header: title "Veritas Bias Detector", 44px-minimum Close button
(
aria-label="Close Bias Detector"), and responsive wrap behavior. - Nav tablist: seven tabs with
role="tab",aria-selected, and stabledata-veritas-bias-tabhooks. - Body: focusable scrollable region labelled "Bias detector workspace";
current view is driven by
view: BiasView.- Cognitive Biases (
cognitive) — default fixture list, category filter, and keyboardable per-bias accordion viaexpandedBias - Media Spectrum (
spectrum) — spectrum marker buttons and keyboardable source detail rows viaexpandedSource - Framing Analysis (
framing) — story cards with perspective accordions viaexpandedFraming - Bias Score (
dashboard) — fixture source/count/factual-reporting metrics - Debiasing (
debiasing) — profile-derived suggestions, vulnerable biases, and toolkit exercises - Blind Spot Test (
blindspot) — local quiz state inblindSpotAnswers,blindSpotIndex, andshowBlindSpotResult - My Profile (
profile) — fixture reading lean, scores, top sources, and vulnerability bars
- Cognitive Biases (
States#
- Loading — overlay renders synchronously; no async fetch, skeleton, or spinner.
- Cognitive Biases view (default) — list count and category filtering
are verified against
COGNITIVE_BIASES. - Cognitive no-hidden state branch — all fixture categories currently contain results; no empty state is implemented for category filters.
- Media Spectrum view — all
MEDIA_SOURCESrender as source rows and spectrum marker buttons; source details expand. - Framing view — all
FRAMING_ANALYSESrender with divergence scores and perspective details. - Bias Score view — average/source/cognitive/framing counts, source distribution, and factual-reporting buckets render from fixture data.
- Debiasing view — suggestions, vulnerable biases, and toolkit exercises
render from
SAMPLE_PERSONAL_BIAS_PROFILE. - Blind Spot view — all questions can be answered, results score is computed, result rows render, and retake resets to the first question.
- Profile view — reading lean, diversity score, blind-spot score, top sources, and vulnerability bars render from the profile fixture.
- Offline — client-only filter/detail interactions remain usable after
context.setOffline(true). - Standalone PWA —
/?surface=pwarestores to/domains/veritas/biasand matches standalone display-mode. - Reduced motion — E2E emulates reduced motion and verifies score-ring arcs and chart/bar transitions are effectively zero.
Interactions#
Header#
- Close Bias Detector (button,
aria-label="Close Bias Detector", X icon)- Function: keyboard Enter calls
onClose()→router.back()
- Function: keyboard Enter calls
-
/veritasbroadsheet subnav entry — "Bias analysis" link navigates to the standalone detector route and the detector Close action returns to the lead. -
/domains/veritassecondary-tools entry — "Show tools" reveals the "Bias" button, which opens the detector in the domain shell and closes back to the domain home view. - Nav tablist (per
navItems):cognitive—Brainicon, label "Cognitive Biases"spectrum—ArrowLeftRighticon, label "Media Spectrum"framing—Newspapericon, label "Framing Analysis"dashboard—BarChart3icon, label "Bias Score"debiasing—Lightbulbicon, label "Debiasing"blindspot—Targeticon, label "Blind Spot Test"profile—Usericon, label "My Profile"
Cognitive view#
- Category filter (
biasCategory) —all | decision_making | social | memory | probability | belief. - Bias card — click/Enter/Space toggles
expandedBias === bias.id.- Expanded content includes definition context, example, information impact, and debiasing strategy.
Spectrum view#
- Spectrum marker button — click opens/closes the associated media
source detail via
expandedSource. - Source row — click/Enter/Space toggles the detail panel.
- Expanded detail includes source description, political spectrum bar, bias breakdown bars, factual-reporting badge, sample article, and linguistic triggers.
Framing view#
- Framing card — click/Enter/Space toggles
expandedFraming === id.- Expanded content includes source, lean, tone, bias score, headline, framing angle, and key phrases for each perspective.
Bias Score view#
- Metric cards — average bias score, source count, cognitive-bias count, and framing-story count render fixture-derived values.
- Source distribution bars — one bar per media source; transition is disabled under reduced motion.
- Factual reporting breakdown — buckets are aggregated from
MEDIA_SOURCES.
Debiasing view#
- Personalized suggestions — fixture suggestions render in order.
- Vulnerable-bias bars — fixture vulnerability scores render and respect reduced motion.
- Quick debiasing toolkit — four static exercises render.
Blind Spot Test view#
- Answer button — writes
blindSpotAnswers[questionId] = answerIdand exposes selected state. - Previous / Next / See Results — navigation remains disabled until the current question has an answer; final action shows results once every question is answered.
- Results — score is computed from answers where
option.biasRevealed === null; result rows include correctness and explanations. - Retake Test — clears local answers, resets
blindSpotIndexto0, and hides results.
Profile view#
- Profile metrics — reading lean, diversity score, and blind-spot score
render from
SAMPLE_PERSONAL_BIAS_PROFILE. - Top sources — source names, lean labels, and article counts render.
- Bias Vulnerability Profile — one
BreakdownBarper vulnerable bias.
Current E2E evidence#
apps/oshun/web/e2e/veritas-bias-detector.spec.ts—opens from the Veritas domain tool grid and returns to the domain homecovers signed-in/domains/veritasnavigation, secondary-tools disclosure, the "Bias" tool button, detector default cognitive state, and Close returning to the Veritas domain home without route replacement.apps/oshun/web/e2e/veritas-bias-detector.spec.ts—opens from the /veritas broadsheet subnav and browser-back closes to the leadcovers the/veritas"Bias analysis" subnav entry, navigation to/domains/veritas/bias, detector default cognitive state, and Close/browser history returning to the broadsheet lead.apps/oshun/web/e2e/veritas-bias-detector.spec.ts—filters cognitive biases, opens a card by keyboard, and closes by keyboardcovers signed-in navigation from/library, default cognitive count, close target size/name, category filtering, keyboard accordion expansion, example/strategy detail content, and keyboard close/back behavior.apps/oshun/web/e2e/veritas-bias-detector.spec.ts—audits spectrum, framing, dashboard metrics, and reduced-motion animationscovers media-source rows and marker buttons, keyboard source expansion, source trigger details, reduced-motion score/breakdown transitions, framing counts and keyboard expansion, dashboard metrics, source distribution, and factual-reporting aggregation.apps/oshun/web/e2e/veritas-bias-detector.spec.ts—reviews debiasing guidance, completes the blind spot test, and opens profilecovers debiasing suggestions/vulnerabilities/toolkit exercises, full blind-spot quiz completion with correct fixture answers, score/result rows, retake reset, profile metrics, top-source count, and vulnerability bars.apps/oshun/web/e2e/veritas-bias-detector.spec.ts—keeps the client-only detector usable offline and restores standalone without mobile overflowcovers standalone PWA launch restoration, offline cognitive filtering, offline accordion expansion, offline spectrum navigation/source expansion, mobile no-horizontal-overflow checks, and standalone display-mode.
Data & contracts#
- Reads:
COGNITIVE_BIASES,MEDIA_SOURCES,FRAMING_ANALYSES,BIAS_BLIND_SPOT_QUESTIONS,SAMPLE_PERSONAL_BIAS_PROFILE, andMEDIA_BIAS_LEAN_CONFIGfrom@/lib/veritas/veritas-simulation-data. - Writes: none externally; all quiz answers, filters, and expanded panels are local component state only.
- Realtime: none.
- Caching: not applicable.
- Auth/role check: shell middleware (verify).
- Telemetry: no
track*imports in this file. - Page metadata: not set (client component); sr-only
<h1>reads "Bias Detector · Veritas · OSHUN".
Cross-references#
- Component:
apps/oshun/web/src/components/domains/veritas/VeritasBiasDetector.tsx - Type:
BiasView— seven-option enum - Route E2E:
apps/oshun/web/e2e/veritas-bias-detector.spec.ts - Sibling tools:
- Customer-facing Veritas hub:
veritas.md - Feature spec:
V1/features.md
Open questions / known gaps#
- No telemetry on tab switches, source expansion, quiz answer selection, or test completion.
- Blind-spot answers, profile scores, source spectrum, and debiasing guidance are fixture/local-only; verify whether V1 intends persistence or a backend analysis endpoint.
- Live screen-reader and touch-device AT passes remain pending beyond the automated keyboard/Playwright coverage here.