Skip to content

Phase 97: Data Catalog & Block 10 Validation

Status: Complete Block: 10 (UI Depth & Engine Exposure) — BLOCK 10 COMPLETE Tests: 7 new frontend tests (416 total vitest) Files: 5 new + 6 modified frontend files, 2 new test files

What Was Built

97a: Weapon Catalog Page

  • WeaponCatalogPage.tsx (new): URL-driven filters via useSearchParams, client-side filtering with useMemo, grid of WeaponCards. Filters: category dropdown (10 weapon categories), text search. Click card → WeaponDetailModal.
  • WeaponCard.tsx (new): Card component showing display_name, category badge, range, caliber.
  • WeaponDetailModal.tsx (new): @headlessui/react Dialog showing full weapon YAML definition via recursive renderValue(). Uses useWeaponDetail(id) hook.
  • API client: fetchWeapons(), fetchWeaponDetail(id) added to api/meta.ts.
  • Hooks: useWeapons(), useWeaponDetail(id) added to hooks/useMeta.ts.
  • Types: WeaponSummary, WeaponDetail interfaces added to types/api.ts.
  • Backend already existed: GET /meta/weapons and GET /meta/weapons/{id} from Phase 92.

97b: Doctrine Catalog Page

  • DoctrineCatalogPage.tsx (new): Card grid with text search filter. Click card toggles inline detail expansion (doctrine ID, category). Uses useDoctrines() hook.
  • Hook: useDoctrines() added to hooks/useMeta.ts (wraps existing fetchDoctrines()).
  • No detail modal — doctrines endpoint only returns summary metadata, so inline expansion is appropriate.

97c: Regression Validation

  • Frontend: 416 vitest tests pass (79 files)
  • Python: ~10,323 tests pass (9998 passed, 21 skipped, 304 deselected slow)
  • TypeScript: compiles clean
  • Vite build: succeeds
  • Zero engine regressions — Block 10 made no engine changes

97d: Navigation & Routing

  • Sidebar.tsx: Added "Weapons" and "Doctrines" nav items between "Units" and "Runs".
  • App.tsx: Added /weapons → WeaponCatalogPage and /doctrines → DoctrineCatalogPage routes.

Documentation Lockstep

All living documents updated for Phase 97 + Block 10 completion: - CLAUDE.md, README.md, docs/index.md — badges, test counts, Block 10 COMPLETE - devlog/index.md — Phase 97 entry - development-phases-block10.md — Phase 97 status → Complete - mkdocs.yml — phase-97 devlog in nav - MEMORY.md — Block 10 COMPLETE status

Design Decisions

  1. No new backend work — weapon and doctrine endpoints already existed from Phase 92.
  2. Followed UnitCatalogPage pattern exactly — same URL-driven filters, same card grid, same modal pattern.
  3. Doctrine catalog uses inline expansion (not modal) — no detail endpoint exists for doctrines (only list), so clicking a card toggles inline metadata display.
  4. Flat nav — Weapons and Doctrines added as top-level items alongside Units.
  5. Category dropdown for weapons — 10 predefined categories covering guns through directed energy.

Files Changed

New Files

  • frontend/src/pages/weapons/WeaponCatalogPage.tsx
  • frontend/src/pages/weapons/WeaponCard.tsx
  • frontend/src/pages/weapons/WeaponDetailModal.tsx
  • frontend/src/pages/doctrines/DoctrineCatalogPage.tsx
  • frontend/src/__tests__/pages/WeaponCatalogPage.test.tsx
  • frontend/src/__tests__/pages/DoctrineCatalogPage.test.tsx

Modified Files

  • frontend/src/types/api.ts — WeaponSummary, WeaponDetail interfaces
  • frontend/src/api/meta.ts — fetchWeapons, fetchWeaponDetail
  • frontend/src/hooks/useMeta.ts — useDoctrines, useWeapons, useWeaponDetail
  • frontend/src/components/Sidebar.tsx — 2 new nav items
  • frontend/src/App.tsx — 2 new routes

Postmortem

  • Scope: On target. All 4 sub-phases delivered.
  • Quality: High. Zero TODOs, clean TypeScript, all tests pass.
  • Integration: Fully wired. All components imported, routes working, nav links active.
  • Block 10 Exit Criteria: All 8 criteria met (analytics endpoints, map overlays, calibration sliders, doctrine/commander selectors, event filtering, weapon/doctrine catalogs, all scenarios correct, all tests pass).

Block 10 Summary

Block 10 delivered 6 phases (92–97) across ~120 new frontend tests: - Phase 92: API analytics + frame enrichment + metadata endpoints - Phase 93: 4 Plotly chart components + analytics summary card - Phase 94: 5 tactical map overlay toggles + engagement flash + enhanced sidebar - Phase 95: Per-side calibration + morale/rout sliders + doctrine/commander pickers + victory weights - Phase 96: Event filtering + engagement detail modal + doctrine comparison analysis - Phase 97: Weapon + doctrine catalog pages + regression validation

Zero engine changes across all 6 phases — every feature surfaces existing data through existing APIs.