AletheiaFact / AletheiaFact/aletheia

INST-2 · Materialize stateHistory[] + stageDurations on the reviewTask

Open
#2,492 0 comments 0 reactions 0 assignees View on GitHub
backlog needs-migration performance server
Dominant language
TypeScript
Stars
55
Forks
20
Avg merge
2d 6h
Merged PRs (30d)
2

Description

> Item derived from the fact-checking cycle analysis (**2026-07-03**). Production numbers (namespace `main`), unless noted.

### Finding (evidence)
Measuring time-per-stage today requires parsing **163 MB** of `histories` and rebuilding each task's timeline from `details.after.value` (a generic field, easy to get wrong — that's where the first pass went wrong).

### Action
A single `transitionState()` helper that, on transition, writes to `histories` (as today) **and** pushes to a typed `stateHistory[]` (`from` / `to` / `at` / `byUserId` / `byRole`) + recomputes `stageDurations` / `cycleMetrics`. Retroactive backfill already available (it's the reconstruction run during the analysis).

### Impact
Time-per-stage becomes a flat field; no future analysis needs to rebuild the timeline.

---
- **Priority:** 🔴 High · **Effort:** M (medium)
- **Dependencies:** requires migration/backfill (`needs-migration`). Wave 2, alongside INST-4.
- **Epic:** #2489

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.