// What play-measure.spec.ts plays: play-cut-fixture's short deck cut on playvid // with a MEASURE LEDGER (the weight video's measure extras: // report-to-video/measure-extras.mjs) -- so its schedule, the estimate's that // Play draws, carries the measure slice (deck.mjs estimateSchedule -> // measure-slice.mjs), and the goal stack, the moving start, the promise clock, // the diet badge and the streak chain play in Play the cut through the module // contract's `play`. Rows are pinned to the clips by `entryId`; with no words // in an estimate, a clip's rows land at its start. // // c01 diet keto, "lose 100" c02 ≈390 remembered, "lose 100" again, 365.7 remembered // c03 carnivore, 291.5 stated, the scale-video promise (23 Oct), a SYNTHETIC claim by madamsavvy (24 Oct) // c04 "lose 65" by Christmas, the check (3 Nov) // // Synthetic, like every fixture. import { readFileSync, writeFileSync } from "node:fs"; import path from "node:path"; import { makePlayCutFixture } from "./play-cut-fixture.mjs"; export const MEASURE_SCHEMA = { kind: "measure", unit: "lb", yMin: 220, yMax: 400, bandGapDays: 60, tracks: [ { key: "weight", role: "value", label: "Weight" }, { key: "regime", role: "regime", label: "Diet", regimes: ["keto", "carnivore", "off"] }, ], forms: ["current", "past", "delta", "goal", "goal_loss", "overweight_by", "status"], regimes: [{ key: "keto", label: "Keto" }, { key: "carnivore", label: "Carnivore" }, { key: "off", label: "No diet" }], // The bound a row may carry ("≈390"): a field of the schema, as the weight ledger's. fields: [{ key: "qualifier", label: "Bound", kind: "enum", options: [">", "<", "≈"], appliesTo: { scope: "weight" }, render: "cell" }], }; const row = (o) => ({ scope: "weight", scopeBasis: "his words", scopeConfidence: "read", valueKind: "uttered", flags: [], asOf: null, ...o }); export const MEASURE_LEDGER = [ row({ id: "r01", date: "2026-07-19", scope: "regime", population: "status", value: "keto", event: "start", display: "Keto", entryId: "c01" }), row({ id: "w01", date: "2026-07-19", population: "goal_loss", value: -100, display: "lose 100", entryId: "c01" }), row({ id: "w02", date: "2026-08-01", population: "past", asOf: "2025-02-01", value: 390, qualifier: "≈", display: "≈390 lb", entryId: "c02" }), row({ id: "w03", date: "2026-08-01", population: "goal_loss", value: -100, display: "lose 100", entryId: "c02" }), row({ id: "w04", date: "2026-08-02", population: "past", asOf: "2023-12-31", value: 365.7, display: "365.7 lb", entryId: "c02" }), row({ id: "r02", date: "2026-09-01", scope: "regime", population: "status", value: "carnivore", event: "start", display: "Carnivore", entryId: "c03" }), row({ id: "w05", date: "2026-10-20", population: "current", value: 291.5, display: "291.5 lb", entryId: "c03" }), row({ id: "p01", date: "2026-10-23", population: "promise", value: null, display: "post a video of the scale", label: "I'll post a video of the scale", entryId: "c03" }), row({ id: "SYNTH-c01", date: "2026-10-24", population: "promise_claim", value: null, speaker: "madamsavvy", promise: "p01", display: "bought the 5 bags", label: "I bought the 5 bags — where's the scale video?", synthetic: true, entryId: "c03" }), row({ id: "w06", date: "2026-10-26", population: "goal_loss", value: -65, display: "lose 65", deadline: "by Christmas", due: "2026-12-25", entryId: "c04" }), row({ id: "p02", date: "2026-11-03", population: "promise_check", value: null, promise: "p01", display: "brush-off", label: "\"just pull up a video from three months ago\"", entryId: "c04" }), ]; /** * @param {{ reports: string, deckManifest: Function, cachedWindow: string, name?: string, title?: string, deck?: Record, render?: Record | null }} o * `name`/`title`/`deck`: another copy with more deck keys (play-instruments-fixture: the dial, the odometer and * the trail on, the extras off -- instruments.spec.ts). */ export async function makeMeasureExtrasFixture({ reports, deckManifest, cachedWindow, name = "play-measure-fixture", title = "The Play Measure Fixture", deck = {}, render = null }) { const { dir } = makePlayCutFixture({ reports, deckManifest, cachedWindow, name, title, chrome: { // The tally's word fitted to its cell (the Play cut's own "Seizures" overflows it, so its chrome never composes). factcheck: { verdicts: { CORROBORATED: { label: "Seizures", tallyLabel: "Seized", color: "#6fa8dc" } }, stamp: { seconds: 1 } }, }, }); const file = path.join(dir, "video.manifest.json"); const m = JSON.parse(readFileSync(file, "utf8")); m.ledgerSchema = MEASURE_SCHEMA; m.ledger = MEASURE_LEDGER; m.render.chrome.deck = { ...(m.render.chrome.deck ?? {}), measure: { scopes: ["weight", "regime"], asOf: "2026-11-05" }, promise: { label: "scale video" }, ...deck, }; // More render keys (vertical-deck-fixture: format vertical, the stacked deck). if (render) m.render = { ...m.render, ...render }; writeFileSync(file, JSON.stringify(m, null, 2) + "\n"); return { dir }; }