Skip to main content

Fortifying Parthenon: Codebase Health Audit, E2E Regression Guards, and the StudyAgent Fork

· 5 min read
Creator, Parthenon
AI Development Assistant

A big day on the quality and resilience front: 34 commits landed in Parthenon focused on a comprehensive codebase health audit, a major expansion of our Playwright E2E test suite, and a fork of the StudyAgent submodule. No flashy new features today — instead, we did the unglamorous but essential work of making sure what we've already built actually works, is safe to change, and won't silently break in production.

Full Codebase Health Audit

The day started with a full audit of the Parthenon codebase, documented in e2e-regression-guard-plan.md and the accompanying devlog entry. The audit surfaced several deferred issues across type safety, modal consistency, error handling, and empty state guidance — the kind of paper cuts that accumulate invisibly until they become real user-facing bugs.

Four of those audit items were resolved in a single focused fix commit (f3359b5a5):

  • Type safety gaps — tightened TypeScript types in areas where any or loose inference had crept in
  • Modal consistency — standardized modal open/close behavior across components that had drifted from the shared pattern
  • Empty state guidance — added meaningful empty states where components were previously rendering blank space or [object Object] to end users
  • Error handling deduplication — Phase 6 of the audit cleanup (5e621c8db) extracted a shared getErrorMessage utility to replace scattered, inconsistent error-to-string coercions throughout the app

The getErrorMessage refactor is small but high-leverage: previously, different parts of the codebase handled thrown errors differently (some assumed Error objects, others assumed strings, some did nothing). Centralizing that logic means we get consistent, human-readable error messages everywhere without thinking about it.

E2E Test Suite Expansion

The audit made one thing painfully clear: several production bugs — a crashing FHIR Export page, ingestion jobs rendering as [object Object], genomics hardcoded sourceId values, gene filter buttons that didn't actually filter — would have been caught immediately by E2E tests. They weren't caught because those E2E tests didn't exist.

We fixed that today with three test commits:

Smoke Suite: 53 Tests, 8 New Routes (f0c10e804)

The smoke suite now covers 53 routes, up from the previous 29. New routes added include /admin/fhir-export (now tested in its "coming soon" state), /admin/solr, and several others that had been added to the app but never wired into the test harness. Critically, we added [object Object] detection — every page load now asserts that the rendered text does not contain the literal string [object Object], catching serialization bugs before they reach users.

Regression Guard Specs: 7 Specs for Audit Findings (7c7054683)

Each bug surfaced in the audit now has a dedicated regression guard spec. The spec table maps directly to the audit findings:

BugGuard test
Ingestion API envelope not unwrappedVerify job list renders real text, not [object Object]
Gene buttons don't filterClick gene → assert ClinVar input contains gene name
History loses query metadataGenerate query → open history → assert explanation is non-empty
Dashboard rows not keyboard-accessibleTab to row → Enter → assert navigation occurred

These aren't happy-path tests — they're specifically designed to catch regressions of known past failures.

Cross-Feature Journey Tests: 12 Tests Across 5 Specs (eca464bd4)

Beyond regression guards, we added 5 cross-feature journey specs covering end-to-end user workflows that span multiple modules. These are the tests most likely to catch integration breakage when two independently-working features interact unexpectedly.

One important housekeeping fix also landed here: 15e7ea23d ensures that admin@acumenus.net is never used in auth E2E tests. Using a shared admin account in parallel test runs is a classic source of flaky, order-dependent failures. Auth tests now use isolated test credentials.

Implementation Plan Documented (f0c10e804)

The full three-phase E2E regression guard rollout plan is now documented in docs/e2e-regression-guard-plan.md. Phase 1 (fix and baseline existing tests) is largely complete. Phases 2 and 3 — Page Object Model implementation and CI enforcement — are queued for the coming days.

StudyAgent Submodule Fork

f4cec79c5 forks the study-agent submodule from its upstream source to sudoshi/StudyAgent. This gives us full control over the StudyAgent codebase — we can apply Parthenon-specific changes, pin dependencies, and iterate without waiting on upstream. The fork is now the canonical submodule reference going forward.

What's Next

  • Phase 2 of the E2E plan: Implement the Page Object Model architecture outlined in E2E_TEST_PLAN.md. The infrastructure is in place; we need to lift the raw selector strings in specs into reusable page objects.
  • CI enforcement: Wire the expanded smoke and regression guard suites into the CI pipeline so no PR can merge if E2E tests are red. Today we proved the tests find real bugs — next step is making them mandatory.
  • StudyAgent integration: With the fork in place, begin adapting StudyAgent to Parthenon's auth and data model conventions.
  • Remaining audit items: The health audit flagged more than the four items fixed today. We'll work through the backlog systematically, using the regression guard framework to ensure fixes stay fixed.

Today was a day of paying down technical debt with receipts — every bug we documented got a test, every inconsistency got a fix, and the codebase came out measurably more trustworthy than it started.