---
path: /domains/veritas/research
surface: customer
domain: veritas
auth: signed-in
source: apps/oshun/web/src/app/domains/veritas/research/page.tsx
status: walked
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 Research Hub addendum — authenticated browse filters/search/empty
  branch, detail sections, citation graph, dedicated citations view, compare
  workflow, compare-paper switching, reduced motion, keyboard close, standalone
  PWA restore, offline mobile use, and horizontal overflow checks are covered by
  the E2E evidence below.
---

# Research Hub · Veritas

## Purpose

The Veritas Research Hub is a full-screen, fixture-backed workspace for
reviewing research papers. A signed-in user can search and filter papers by
field or evidence grade, open a paper detail view, inspect methodology and
citation evidence, switch into a dedicated citation-network view, and compare
two papers side-by-side.

## Entry Points

- **Direct URL / bookmark** — `/domains/veritas/research` (auth required)
- **`/domains/veritas` index** — internal Veritas tool grid
- **Linked from Veritas workspaces** — claim detail and topic hub follow-up
  actions can route into the research workspace.
- **Shell navigation history** — opening after `/library` lets the Close control
  return with `router.back()`

## Layout Regions

`page.tsx` is a client route that renders an `sr-only` `<h1>` ("Research Hub ·
Veritas · OSHUN") and mounts
`<VeritasResearchHub onClose={() => router.back()} />`.

- **Overlay root**: `[data-veritas-research-hub]` with current
  `data-veritas-research-view`, selected paper, compare paper, total/filtered
  paper counts, filter state, query state, and reduced-motion state.
- **Header**: `[data-veritas-research-header]`, title, optional tablist
  `[data-veritas-research-tabs]`, and `[data-veritas-research-close]`.
- **Browse view**: `[data-veritas-research-browse-view]` with search input,
  field filters, grade filters, result count, paper cards, and empty branch.
- **Detail view**: `[data-veritas-research-detail-view]` with header metrics,
  abstract, expandable findings/methodology/citation/conflict sections, Compare,
  and Citations actions.
- **Citations view**: `[data-veritas-research-citations-view]` with a citation
  graph, reference list, and cited-by list or empty cited-by state.
- **Compare view**: `[data-veritas-research-compare-view]` with two paper
  columns, metric rows, key findings, and compare-paper selector buttons.

## States

- [x] **Authenticated render** — route opens through the signed-in shell and
      renders `[data-veritas-research-hub]`.
- [x] **Browse populated** — paper-card count matches `SAMPLE_PAPERS`.
- [x] **Field-filtered browse** — field filter buttons update active state and
      `data-veritas-research-results-count`.
- [x] **Grade-filtered browse** — grade buttons update active state and visible
      paper count.
- [x] **Search no matches** — a query with no matching title/summary/author
      renders `[data-veritas-research-empty]`.
- [x] **Detail populated** — selected paper, grade, peer-review status,
      methodology, publication data, and metrics are asserted from the fixture.
- [x] **Detail sections expanded/collapsed** — findings, methodology, citations,
      and conflicts expose section-open state and item counts where applicable.
- [x] **Citation graph populated** — graph data attributes expose references and
      cited-by counts for the selected paper.
- [x] **Dedicated citations view** — the previously declared `citations` view is
      reachable from detail and renders reference/cited-by rows.
- [x] **Compare view** — selected paper and compare paper render in responsive
      side-by-side columns with fixture-backed metrics and findings.
- [x] **Compare-paper switch** — selector buttons replace the compare paper and
      expose active state.
- [x] **Offline** — standalone mobile test switches the browser context offline
      and still searches, opens detail, opens citations, and compares from local
      fixture state.
- [x] **Standalone PWA** — `mockStandaloneLaunch()` restores directly into the
      route from `/?surface=pwa`.
- [x] **Reduced motion** — card, detail, graph, and section animations collapse
      to `none` under `prefers-reduced-motion`.
- [x] **Mobile horizontal overflow** — standalone/offline test asserts no
      document overflow at 390×844 across browse, detail, citations, and
      compare.

## Interactions

### Header

- [x] **Close** — `[data-veritas-research-close]` has accessible name "Close
      Research Hub", a 44×44 target, keyboard activation, and returns to
      `/library` in the desktop path.
- [x] **Tabs** — `browse`, `detail`, `compare`, and `citations` expose active
      state through `data-veritas-research-tab-active`; tabs that require a
      paper are disabled until the required state exists. The tablist appears
      after leaving browse.

### Browse View

- [x] **Search** — `[data-veritas-research-search]` filters title, summary, and
      author text, including an empty-results branch.
- [x] **Field filter** — `[data-veritas-research-field-filter="<field>"]`
      applies the field and exposes active state.
- [x] **Grade filter** — `[data-veritas-research-grade-filter="all|A|B|C|D"]`
      applies grade filtering and exposes active state.
- [x] **Paper details** — `[data-veritas-research-paper-details="<paper-id>"]`
      selects a paper and opens detail view.
- [x] **Paper compare** — `[data-veritas-research-paper-compare="<paper-id>"]`
      selects a paper, chooses a default alternate comparison paper, and opens
      compare view.

### Detail View

- [x] **Back to browse** — `[data-veritas-research-action="back-to-browse"]`
      returns to browse.
- [x] **Section toggle** —
      `[data-veritas-research-section-toggle="findings|methodology|citations|conflicts"]`
      expands/collapses section content.
- [x] **Methodology metrics** —
      `[data-veritas-research-methodology-metric="sample-size|controls|reproducibility"]`
      exposes assessment values.
- [x] **Citation graph** — `[data-veritas-research-citation-graph]` exposes the
      selected paper, reference count, and cited-by count.
- [x] **Compare selected paper** —
      `[data-veritas-research-action="compare-selected"]` opens compare with a
      default alternate paper.
- [x] **View citations** — `[data-veritas-research-action="view-citations"]`
      opens the dedicated citations view.

### Citations View

- [x] **Back to detail** — `[data-veritas-research-action="back-to-detail"]`
      returns to detail.
- [x] **Reference list** —
      `[data-veritas-research-citations-reference="<paper-id>"]` renders each
      cited paper with citation count.
- [x] **Cited-by list / empty** —
      `[data-veritas-research-citations-cited-by="<paper-id>"]` renders citing
      papers; `[data-veritas-research-citations-cited-by-empty]` covers papers
      with none.

### Compare View

- [x] **Back to detail** — `[data-veritas-research-action="back-to-detail"]`
      returns to the selected paper detail.
- [x] **Compare columns** —
      `[data-veritas-research-compare-column="<paper-id>"]` exposes grade,
      citation count, and methodology for both papers.
- [x] **Compare metrics** —
      `[data-veritas-research-compare-metric="<metric>"][data-veritas-research-compare-metric-paper="<paper-id>"]`
      exposes grade, citations, impact factor, methodology, and reproducibility.
- [x] **Compare option** — `[data-veritas-research-compare-option="<paper-id>"]`
      swaps the comparison paper and exposes active state.

## Data & Contracts

- **Reads**: `SAMPLE_PAPERS` from
  `apps/oshun/web/src/lib/veritas/veritas-extended-simulation.ts`.
- **Types**: `ResearchPaper`, `EvidenceGrade`, `PeerReviewStatus`, and
  `MethodologyType` from `veritas-extended-types.ts`.
- **Writes**: local React state only (`view`, `selectedPaper`, `comparePaper`,
  `searchQuery`, `fieldFilter`, `gradeFilter`, `expandedSections`).
- **Realtime / external network**: none for the core route; the hub remains
  usable while the browser context is offline.
- **Telemetry**: no route-local telemetry import or event dispatch.
- **Auth/role check**: shell middleware gates `/domains/veritas/*`.
- **Page metadata**: no `Metadata` export in this client page; the screen-reader
  `<h1>` reads "Research Hub · Veritas · OSHUN".

## Current E2E Evidence

- `apps/oshun/web/e2e/veritas-research-hub.spec.ts`
  - Desktop browse: fixture total, field and grade filtering, empty search,
    reduced-motion cards, detail selection, accessible 44×44 close, and keyboard
    close.
  - Detail/citations: selected-paper data, metric values, findings, methodology
    metrics, conflict disclosures, section toggling, citation graph, dedicated
    citations view, and compare-selected action.
  - Compare: browse-to-compare flow, selected/compare paper columns, impact
    factor metric, compare-paper switching, and return to detail.
  - Standalone/offline mobile: PWA relaunch, offline search, detail, citations,
    compare, reduced motion, and no horizontal overflow at 390×844.

## Cross-References

- Component:
  `apps/oshun/web/src/components/domains/veritas/VeritasResearchHub.tsx`
- Route: `apps/oshun/web/src/app/domains/veritas/research/page.tsx`
- Sibling tools:
  - [`domains-veritas-articles.md`](./domains-veritas-articles.md)
  - [`domains-veritas-knowledge-graph.md`](./domains-veritas-knowledge-graph.md)
  - [`domains-veritas-newsletter.md`](./domains-veritas-newsletter.md)
  - [`domains-veritas-nlp.md`](./domains-veritas-nlp.md)
- Customer-facing Veritas surfaces: [`veritas-source.md`](./veritas-source.md),
  [`veritas.md`](./veritas.md)
- Feature spec: [`V1/features.md`](../../../V1/features.md#veritas)

## Open Questions / Known Gaps

- [ ] Research selection, compare state, and expanded sections are session-local
      only; they do not persist through reload or sync to Library.
- [ ] No telemetry currently records selection, search, filtering, section
      expansion, citation viewing, or comparison.
- [ ] `SAMPLE_PAPERS` currently includes only peer-reviewed A/B evidence; grade
      C/D, preprint, under-review, accepted, and retracted branches need fixture
      coverage if V1 expects those states in the shipped UI.
- [ ] Citations are local fixture objects only; no DOI resolver, external link,
      or live citation graph service is wired.
