Requirements — metrics & status tracking v1

At a glance

  • What it is: a metrics store + append-only status-snapshot ledger — automatic health capture, honest tracking history for both instances, generated dashboards
  • Status: Draft v1 — current focus
  • Depends on: North Star (kernel/instance model), vault-indexer, project-dashboard spec (ledger design adopted here), 2026 PRD (signal list only), retrieval v2 Phase 0 (tags table pattern; no hard ordering dependency)
  • Ceiling-bound: Foundation work — phases sized for ≤5 hrs/week, each independently shippable, auto-pause honored
  • Serves: Job B, under Principles 1–2. Scope is tracking + sensemaking; the capacity layer is designed (Capacity layer) but explicitly out of v1, gated on the data this doc produces (S8)

1. Background and problem statement

Two tracking gaps, one substrate:

  1. The life instance has no runtime. The 2026 PRD defined states, ceilings, and a burnout early-warning rule (“any two signals → downshift”) — but nothing captured the signals, nothing evaluated the rule, nothing showed state. Per the North Star its modules dissolve into standard kernel entities (projects and routines); what v1 owes the life instance is the same thing it owes the work instance: honest tracking with history.
  2. OrionUpOS status has no history. Project status lives scattered in frontmatter with an inconsistent vocabulary; a Dataview board would show “now” but nothing survives moves/deletes. The paused project-dashboard spec already designed the fix (append-only snapshot ledger keyed by stable project-id); it lands here.

Both reduce to the same primitives on the existing SQLite substrate: time-series metrics and append-only status snapshots, with generated visual output.

2. Goals and non-goals

Goals

  • G1. Metrics store fed primarily by automatic sources (Apple Health export first), secondarily by ≤10-second manual capture.
  • G2. Status snapshot ledger for entities in both instances — work projects, life projects and routines — keyed by stable IDs, surviving file churn.
  • G3. Generated visual dashboards — heatmaps, trends, status board — written into the vault as artifacts; never hand-maintained.
  • G4. The PRD’s burnout rule evaluated automatically, surfaced as an explicit warning (“2 signals active → downshift”), with the evaluation logged.
  • G5. Zero new required infrastructure: SQLite + Python + existing indexer patterns. Grafana/Postgres is a Layer-2 upgrade path, not a dependency.

Non-goals

  • NG1. No redesign of LaquaOS or OrionUpOS — vocabularies, states, and rules come from their existing docs verbatim.
  • NG2. No enforcement actuators in v1 (calendar blocking, app locking). v1 detects and tells; teeth are a v2 question pending North Star O-A.
  • NG3. No cloud services, no third-party analytics. Health data flows device → owned store only.
  • NG4. No general-purpose quantified-self platform. The schema serves the PRD signal list + chosen habits (North Star O-C); nothing speculative.
  • NG5. No changes to retrieval v2 scope; shared DB, separate concerns.

3. Current state

  • vault-index.db: files table with proven migration pattern (open_db), content-hash change detection, content_mtime semantics; tags table arriving via retrieval v2 Phase 0.
  • Project-dashboard spec (paused, in-vault): project-id frontmatter convention, OrionUpOS 6-status vocabulary (inbox|active|review|blocked|paused|done), project_snapshots table sketch, weekly cadence hook. Verified finding: 20+ inconsistent status values across 71 files — vocabulary lock is a prerequisite, not a nice-to-have.
  • 2026 PRD (historical source, per North Star): supplies the burnout signal list verbatim (sleep < 6.5 h × 5 d, craving spikes, irritability/numbness, perfectionist rigidity, “I’ll rest after this”). Its former modules map to kernel entities: certs and the hike → projects; weight, savings → routines.
  • Apple Health: captures sleep/activity/weight today; exportable on schedule via Health Auto Export (JSON/CSV to an endpoint or file drop) — no wearable assumptions beyond what’s already worn.

4. Functional requirements

5. Non-functional requirements

6. Interface specification

vault_indexer.py snapshot [--date]            # project + routine entities → status_snapshots
metrics.py ingest [--drop-dir]                # health export + quick-capture files → metrics
metrics.py log <key> <value> [--date]         # manual capture
metrics.py evaluate [--window 7]              # burnout rule → warning states
metrics.py report [--out Dashboards/]         # regenerate dashboard notes (runs evaluate)
metrics.py export --csv <dir> | --postgres <dsn>   # longevity / Layer-2 path

Config: metrics.yaml (HK mappings, metric keys, habit list once O-C lands, heatmap options). Env: SECOND_BRAIN_DB reused; METRICS_DROP_DIR for ingest.

7. Implementation phases

Each ≤ a few ceiling-respecting sessions; each shippable; stop-anywhere is a feature.

  1. Phase 0 — conventions (mostly editing, not code): lock status vocabulary; add project-id + type: project-index to the 11 project notes (dashboard spec Phase 1’s authoring half, statuses drafted for review); translate the PRD’s former modules into project/routine notes with the standard frontmatter (the dissolution made concrete); fix the tracked-metric list (resolves O-C — write the real list). Exit: the vault says true things for tools to read.
  2. Phase 1 — stores + snapshot: FR-10/11/12 migrations; snapshot across both instances’ entities; transitions view. Exit: a week of snapshots queryable; “how long blocked” answerable.
  3. Phase 2 — ingest: Health Auto Export → drop folder → metrics; source freshness; Screen Time spike (FR-23) with an honest yes/no. Exit: sleep + weight + activity flowing hands-free (S2’s pipeline).
  4. Phase 3 — capture + evaluate: log CLI; Shortcut → drop-file path; burnout evaluation with insufficient-data honesty. Exit: a drill fires the downshift warning end-to-end (S4).
  5. Phase 4 — dashboards: heatmap SVGs, metrics + status-board notes, warning surfacing. Exit: the 21-day autopilot test starts counting (S2).
  6. Phase 5 — docs + longevity: README (new subcommands, mapping guide), CSV export, CHANGELOG. Postgres/Grafana export deferred until the autopilot test passes — earn Layer 2.

8. Testing requirements

9. Acceptance criteria

10. Risks and open questions