feat: lay down the day view and timeline contract

Land every file the day view, the timeline and life events share before
any of them is built, so the server, the day view and the timeline can be
built side by side without editing the same file (#613).

Schema and migration 0387: LifeEvent with a short category list, calendar
start and end dates, a day/month/year precision, encrypted title and note,
a soft-delete tombstone and an index for the per-user live list. Every new
column is annotated for the column-reader sweep. Life events travel in both
backup purposes with their two ends in one file, are wiped with the
account, and are registered for key rotation.

src/lib/day/contract.ts carries the constants and wire types for
GET /api/day/{date}, /api/day/index, /api/timeline, /api/timeline/readiness
and the life-event routes, free of Zod so the navigation chrome can import
it; the schemas beside it feed the routes and the published contract. The
Coach and MCP tool name get_day is reserved there, and life events are
listed as the one section no model ever sees.

The opt-in timeline module, its navigation entry, the day-section and
timeline-lane surfaces, the day and timeline query keys (evicted by every
record data bundle), and stub routes that answer 501 behind their
admissions. The four cross-section reads declare the whole record for now;
the life-event list is a profile read, and life events join the profile
sharing domain and its consent copy in all seven locales. The day,
timeline and lifeEvents message namespaces carry their base copy as
release-pending keys.

The aggregate bundle cap moves to 4400: the branch already measured 4365
against 4335, and the new copy adds 10 KB.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 13:03:37 +02:00
1 parent 861ba21086
commit c79fc6cc7b
57 files changed
+4290 -21

No files matched your search

+21
View File
@@ -173,6 +173,19 @@ export const MODULE_KEYS = [
// surfaces the person made content for; it does not silently retract a
// commitment the app made to them.
"vaccinations",
// v1.42 (#613) — the life timeline (`/timeline`): years at a glance, the
// record's conditions, medications, visits and documents in lanes beside the
// value series, plus the person's own life events. OPT-IN (off by default):
// not because it egresses (it does not), but because it is a new way of
// looking at the whole record, and the readiness inventory that greets the
// switch is the right first contact with it. The day view is NOT this
// module: it is core and opens for every account.
//
// Life events belong to this module. They are only created from the
// timeline and the day's capture sheet while it is on, and they disappear
// from the day with it; the `/api/life-events` row store stays reachable so
// a restore keeps working and re-enabling finds the events intact.
"timeline",
] as const;
export type ModuleKey = (typeof MODULE_KEYS)[number];
@@ -369,6 +382,14 @@ export const MODULE_REGISTRY: Readonly<Record<ModuleKey, ModuleDefinition>> =
// No `optIn`: default-on. Nothing leaves the instance and the surfaces
// are inert until the person logs a dose.
},
timeline: {
key: "timeline",
labelKey: "modules.timeline.label",
descriptionKey: "modules.timeline.description",
category: "tracking",
// Off by default; see the key's comment in `MODULE_KEYS`.
optIn: true,
},
});
const MODULE_KEY_SET: ReadonlySet<string> = new Set(MODULE_KEYS);