Files
core/TODO.md

161 lines
5.2 KiB
Markdown

# Reanimator Development Milestones
This file is the single source of truth for delivery progress and AI task delegation.
Status legend: `[ ] todo` `[-] in progress` `[x] done` `[!] blocked`
## MVP-1 Scope (Agreed)
### In Scope
- Registry: `customer/project/asset/component/internal_pn (LOT)`
- Ingest `logbundle` -> parse `first_seen` + installation relationships
- Timeline events: `LOG_COLLECTED`, `INSTALLED`, `REMOVED`, `FIRMWARE_CHANGED`
- UI: dashboard + server card + current components + movement list + ingest console
- Basic tickets import + link to server (`asset`)
### Out of Scope (After MVP-1)
- AFR/MTBF production analytics
- Spare-parts forecasting (Spare)
- Advanced ticket/component time-window inheritance
- Predictive models and anomaly detection
---
## Milestone 0 - Bootstrap Foundation
**Goal:** ready-to-build Go service skeleton and migration scaffolding.
- [x] Initialize Go module (`go mod init`)
- [x] Create base folders (`cmd`, `internal/*`, `migrations`)
- [x] Add API entrypoint and `/health` endpoint
- [x] Add env-based config loader
- [x] Add migration loader command (`cmd/reanimator-migrate`)
- [x] Add Make targets (`build`, `test`, `run`, `migrate-up`, `migrate-down`)
- [x] Verify `go build ./...` passes
**Current state:** completed.
**AI task prompt:**
> Milestone 0 is done. Do not change bootstrap unless required by later milestones.
---
## Milestone 1 - Registry (MVP-1)
**Goal:** implement registry domain and CRUD API.
- [x] SQL migrations: `customers`, `projects`, `locations`
- [x] SQL migrations: `assets`, `components`, `lots`, `installations`
- [x] Add indexes from README
- [x] Repositories for registry entities
- [x] API endpoints for create/list/get (`customers`, `projects`, `assets`, `components`)
- [x] Basic validation and error mapping
**Definition of done:**
- migrations apply cleanly on MariaDB
- registry API works end-to-end
**AI task prompt:**
> Implement Milestone 1 from TODO.md. Focus on clean schema and working CRUD endpoints for registry entities. Update checkbox statuses in TODO.md.
---
## Milestone 2 - Ingest First Seen + Installations (MVP-1)
**Goal:** idempotent logbundle ingestion with first useful derived data.
- [x] SQL migrations: `log_bundles`, `observations`
- [x] `POST /ingest/logbundle` idempotent by content hash
- [x] Persist raw bundle metadata + parsed observations
- [x] Detect and persist `first_seen` for components
- [x] Detect and persist installation relationships from observations
**Definition of done:**
- duplicate bundle upload does not duplicate state
- first_seen and installation data are queryable
**AI task prompt:**
> Implement Milestone 2 from TODO.md with strict idempotency and first_seen/installation extraction. Add integration test for duplicate uploads.
---
## Milestone 3 - Timeline v1 (MVP-1)
**Goal:** produce event history visible in API and ready for UI.
- [x] SQL migration: `timeline_events`
- [x] Event derivation from observations/installation deltas
- [x] Emit: `LOG_COLLECTED`, `INSTALLED`, `REMOVED`, `FIRMWARE_CHANGED`
- [x] API: `GET /assets/{id}/timeline`
- [x] API: `GET /components/{id}/timeline`
- [x] Deterministic sorting + pagination
**Definition of done:**
- timeline endpoints return stable chronological event history
- install/remove/firmware changes appear correctly
**AI task prompt:**
> Implement Milestone 3 from TODO.md. Build deterministic timeline generation and API pagination. Add tests for installed/removed/firmware-changed cases.
---
## Milestone 4 - UI v1 + Ticket Import (MVP-1)
**Goal:** first visible product value for operations workflow.
- [x] Minimal UI: server card
- [x] Minimal UI: current components list
- [x] Minimal UI: movement/event list from timeline
- [x] Minimal UI: dashboard + assets/components lists
- [x] Minimal UI: ticket/failure lists
- [x] Minimal UI: ingest console
- [x] Minimal UI: analytics view (lot/firmware/spare)
- [x] SQL migrations: `tickets`, `ticket_links`
- [x] Endpoint: `POST /connectors/tickets/sync`
- [x] Link ticket to server (`asset`)
**Definition of done:**
- operator opens server page and sees current hardware + movement history + linked tickets
**AI task prompt:**
> Implement Milestone 4 from TODO.md with minimal but usable UI and basic ticket sync/linking to assets.
---
## Milestone 5 - Post-MVP Analytics
**Goal:** after MVP-1, add reliability metrics and planning value.
- [x] Explicit `failure_events` model and ingestion path
- [x] AFR/MTBF calculations by LOT/component class
- [x] Firmware risk analytics
- [x] Spare forecasting baseline
**Definition of done:**
- metrics are reproducible and usable for operational planning
**AI task prompt:**
> Implement Milestone 5 from TODO.md only after MVP-1 is complete. Prioritize metric correctness and reproducibility.
---
## Cross-Cutting Tasks
- [ ] Structured logs + request IDs
- [ ] OpenAPI spec
- [ ] CI (build/test/migration check)
- [ ] Release note discipline
---
## Progress Snapshot
Update this section after each merged PR.
- Last update: 2026-02-05
- Current milestone: Cross-Cutting Tasks
- MVP-1 progress: 5/5 milestones completed (Milestone 0 done, Milestone 1 done, Milestone 2 done, Milestone 3 done, Milestone 4 done)
- Active blockers: none