Refine case-hash grouping semantics and analysis UI#157
Conversation
CASE_HASH support
1e30535 to
44af70e
Compare
There was a problem hiding this comment.
Pull request overview
Adds hybrid support for CASE_HASH by parsing it from env_case.xml, persisting
it on simulations, and exposing it via simulation schemas/API while keeping
case-name-based grouping authoritative and emitting warnings on hash drift.
Changes:
- Parse
CASE_HASHinto ingestion metadata and persist it onSimulation. - Add
simulations.case_hashvia Alembic migration and exposecaseHashin
SimulationCreate/SimulationOut. - Add drift-detection logic that warns on conflicting hashes for the same case
name (without changing grouping), plus test updates.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backend/app/features/ingestion/ingest.py | Tracks CASE_HASH observations during ingestion and logs drift warnings. |
| backend/app/features/ingestion/parsers/case_docs.py | Parses CASE_HASH from env_case.xml into metadata. |
| backend/app/features/ingestion/parsers/parser.py | Plumbs parsed case_hash into ParsedSimulation. |
| backend/app/features/ingestion/parsers/types.py | Extends ParsedSimulation with optional case_hash. |
| backend/app/features/simulation/models.py | Adds nullable case_hash column to ORM model. |
| backend/app/features/simulation/schemas.py | Exposes case_hash on create/out schemas with descriptions. |
| backend/migrations/versions/20260414_000000_add_case_hash_to_simulations.py | Adds case_hash column to simulations table. |
| backend/tests/features/ingestion/parsers/test_case_docs.py | Verifies CASE_HASH is parsed (or None on read error). |
| backend/tests/features/ingestion/test_ingest.py | Verifies persistence of case_hash and drift warning behavior. |
| backend/tests/features/simulation/test_api.py | Asserts caseHash is returned by simulation GET endpoint. |
| backend/tests/features/simulation/test_schemas.py | Updates schema tests to include caseHash/case_hash. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44af70e685
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8f83448 to
50b2231
Compare
CASE_HASH support
Summary
Caseidentity and uniqueness unchanged in this PRcase_hashas optional per-execution grouping metadata within an existing casecase_hashonSimulationcase_hashon nested case simulation summaries used by case pagesCase Hashis visible in both case-detail and All Cases execution summariesCASE_HASHas the canonical Case identifier #136Scope
This PR stays focused on
case_hash-aware case analysis without changing top-level case identity.Included:
case_hashfor grouping related executions within one casecase_hashto nested case summary responses so case-detail views can group executions without extra fetchesCase HashterminologyCase Hashin the All Cases simulation summaries table to distinguish executions more clearlyNot included:
Case HashImplementation notes
backend/app/features/ingestion/ingest.pytreatscase_hashas within-case grouping metadata rather than failed consistency signalingSimulation.case_hashstorage remains unchangedSimulationSummaryOutincludes optionalcase_hash, and case endpoints populate it from nested simulationsfrontend/src/features/simulations/CaseDetailsPage.tsxnow:Case Hashdisplay terminologyGrouped by Case HashandAll executionsviewsfrontend/src/features/simulations/CasesPage.tsxnow showsCase Hashin expanded simulation summariesfrontend/src/features/simulations/caseUtils.tsprovides shared fallback labeling and grouping helpers for the updated UIUser impact
Testing
cd backend && uv run pytest tests/features/ingestion/test_ingest.py tests/features/simulation/test_api.py tests/features/simulation/test_schemas.pymake backend-testmake frontend-lintpnpm --dir frontend run type-checkNotes
pnpm --dir frontend run type-checkstill fails from pre-existing unrelated artifact typing errors in browse/compare/simulation detail views; this PR does not change those files.Refs #136