briefings.ts
Language TypeScript1.9 KB48 lines
/*** The shape of the model-written briefings. Type only, runtime-neutral.** Split from briefings-file.ts because the Cloudflare Worker imports the* renderer, the renderer needs this type, and a file containing a static* `node:fs` import fails the Worker typecheck even when only its type is* imported (rule 7). See also history-file.ts.*//*** Two `generatedAt` fields, on types one letter apart, with opposite* requirements:** Briefings.generatedAt (here) a raw UTC ISO string, written by* analysis/brief.py. Must be formatted before* a reader sees it.* Briefing.generatedAt (view-model.ts) already formatted in MERIDIAN_TZ.* Rendering it again would be wrong.** Slicing this one raw shows a Chicago reader a UTC clock time. Anything* reading this field goes through localStamp/localClock; anything reading the* view-model's does not.*/export interface Briefings {generatedAt: stringday: string | nullmodel: string/** The sync these were written from. Used to detect a stale pairing. */payloadGeneratedAt: string | nullmode: 'live' | 'fixtures' | null/*** Keyed by 'company', 'exec', or a person's roster name. Absent keys simply* mean that briefing has not been generated today.*/briefings: Record<string, string>/*** Which of the above were cut off at the model's output limit.** The page needs to know: a truncated briefing is still worth reading (it is* most of a briefing), but rendered unlabelled it is indistinguishable from a* finished one. Same rule as everywhere else here: broken must not look like* fine.** Optional because an older briefings.json has no such list, and an absent list means "nothing known to be truncated", not* that the question was never asked.*/truncated?: string[]}