[dev_260105_03] Ground Truth Single Source Architecture
Date: 2026-01-05 Type: Development Status: Resolved Stage: [Stage 6: Async Processing & Ground Truth Integration]
Problem Description
Ground truth data (answers, metadata) needed for both UI table display and JSON export. Previous iterations had complex dual-storage approaches and double access patterns.
Key Decisions
- Single source of truth: Store all data once in results_log, both formats read from it
- Remove ground_truth parameter: Export function no longer needs ground_truth object
- Accept UI limitation: Dict displays as "[object Object]" in pandas table - acceptable tradeoff
- JSON export primary: Metadata most useful in JSON format for analysis
Outcome
Clean single-source architecture: results_log contains all data, export function simplified, no double work.
Architecture:
- One object (results_log) → Two formats (UI table + JSON)
- Both identical, no filtering, no double access
- Export function uses
result.get("annotator_metadata")directly from stored data
Deliverables:
app.py- Removed ground_truth parameter, simplified data flow, single storage approach
Changelog
What was changed:
- app.py (~10 lines modified)
- Removed
ground_truthparameter fromexport_results_to_json()function signature - Removed double work: no longer access
ground_truth.metadatain export function - Changed
_annotator_metadatatoannotator_metadata(removed underscore prefix) - Updated all 6 function calls to remove
ground_truthparameter - Simplified JSON export:
result.get("annotator_metadata")from stored data - Updated docstring: "Single source: Both UI and JSON use identical results_log data"
- Removed
Current Behavior:
- results_log contains:
{"annotator_metadata": {...dict...}} - UI table: Shows "[object Object]" for dict values (pandas limitation, acceptable)
- JSON export: Includes full
annotator_metadataobject - Both formats read from same source, no filtering