commit 2e3997631cf1c6860d4bc50cc8c9419905826d50
parent 8bc4344059cfcb6e4c4757fcece498c829db03d4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 6 Nov 2026 03:42:57 -0500
umtool: the promise clock's AS OF is the playhead's in-record date
AS OF advanced only on the promise's own rows, so it lagged: "2 DAYS AS OF
25 OCT" through c46 (26 Oct), "10 DAYS AS OF 2 NOV" through n01/n02 (3 Nov)
until p05 landed. It is now the latest date of ANY event seen so far in cut
order -- a running max, so an earlier date later in the cut never takes it
back -- never before the promise itself, and measure.asOfRender from the
finale on, as before. The day count follows it; kept still stops it on the
day it was kept.
On the rev9 panel: 3 days as of 26 Oct from c46's weight, 11 days as of
3 Nov from n01, 14 as of 6 Nov in the finale. A unit test pins the rev9
order; the fixture's expectations move with the rule (the 31 Oct goal now
moves AS OF; a claim's date the cut has not reached does not).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/umtool/report-to-video/measure-extras.mjs b/umtool/report-to-video/measure-extras.mjs
@@ -338,7 +338,8 @@ export const PROMISE_OUTCOMES = Object.freeze(["kept", "refunded", "withdrawn"])
* The promise clock's states: `{ at, rows: [row], asOf }`, one row (the latest
* promise): `{ row, what, said, days, to, kept, outcome: { kind, date } | null,
* claim: { speaker, date, paidOn } | null (the first claim with a `paidOn`, else
- * the first), `to` the latest of the promise's own rows' dates so far, word: { text, date, speaker, his } |
+ * the first), `to` the in-record date so far (the latest date of any event seen
+ * in cut order, never before `said`), word: { text, date, speaker, his } |
* null, fresh }` -- `to` the date the days are counted to, `claim` another
* party's (her) latest claim on it (CONTRACT addendum: "PAID 23 OCT BY
* @MadamSavvy"), `word` the latest words said about it -- his check, her
@@ -385,11 +386,11 @@ export function promiseStates(schedule, render) {
}
// Kept stops the count on the day it was kept.
const stop = outcome?.kind === "kept" && outcome.date ? outcome.date : null;
- // AS OF: the latest of the promise's OWN rows so far -- the promise, its
- // checks, the claims on it, its outcome -- never a later date another row
- // showed earlier in cut order.
- const own = [p.said, ...checks.map((r) => byRow.get(r)?.date), ...claims.map((x) => x.date), outcome?.date].filter((d) => typeof d === "string" && /^\d{4}-\d{2}-\d{2}$/.test(d));
- const latest = own.reduce((a, b) => (b > a ? b : a), p.said);
+ // AS OF: the in-record date of the playhead -- the latest date of ANY event
+ // seen so far in cut order (the cut is chronological; a running max, so it
+ // never goes back), never before the promise itself (rev 9, 6 Nov: "2 DAYS
+ // AS OF 25 OCT" lagged through c46, which is 26 Oct).
+ const latest = seen && seen > p.said ? seen : p.said;
const to = stop ?? latest;
return {
row: p.row,
@@ -407,7 +408,10 @@ export function promiseStates(schedule, render) {
const out = [];
let lastSig = null;
let lastS = null;
+ // The in-record date so far: the running max of every event's date, in cut order.
+ let seen = null;
for (const { e, s } of steps) {
+ if (typeof e.date === "string" && /^\d{4}-\d{2}-\d{2}$/.test(e.date) && (!seen || e.date > seen)) seen = e.date;
if (e.t < first.e.t) continue;
let fresh = null;
if ((e.kind === "promiseCheck" || e.kind === "promiseClaim" || e.kind === "promiseOutcome") && e.promise) {
diff --git a/umtool/report-to-video/measure-extras.test.mjs b/umtool/report-to-video/measure-extras.test.mjs
@@ -95,10 +95,10 @@ test("peak: a tick per telling of a start in the drift, a count per retelling, t
test("promise: the days to the clip's in-record date, her claim and the outcome, the words flashed, then counted on to the render date", () => {
const states = promiseStates(schedule(), RENDER);
- // AS OF is the promise's own rows' latest date: the goal said on 31 Oct between them moves nothing.
- // (The goal's state at 720.09 is its own only because her words stop flashing there.)
- assert.deepEqual(states.map((s) => s.rows[0].days), [0, 1, 1, 8, 11, 12, 13]);
- assert.deepEqual(states.map((s) => s.rows[0].to), ["2026-10-23", "2026-10-24", "2026-10-24", "2026-10-31", "2026-11-03", "2026-11-05", "2026-11-05"]);
+ // AS OF is the in-record date of the playhead: the latest date of ANY event so far -- the goal said on 31 Oct
+ // moves it too (rev 9, 6 Nov).
+ assert.deepEqual(states.map((s) => s.rows[0].days), [0, 1, 8, 8, 11, 12, 13]);
+ assert.deepEqual(states.map((s) => s.rows[0].to), ["2026-10-23", "2026-10-24", "2026-10-31", "2026-10-31", "2026-11-03", "2026-11-05", "2026-11-05"]);
assert.equal(states[0].at, 712.18, "from the promise on");
assert.equal(states[0].rows[0].what, "scale video");
assert.equal(states[0].rows[0].claim, null);
@@ -132,7 +132,7 @@ test("promise: the days to the clip's in-record date, her claim and the outcome,
}
const ps = promiseStates(schedule(paid), RENDER);
assert.deepEqual(ps[1].rows[0].claim, { speaker: "madamsavvy", date: "2026-10-23", paidOn: "2026-10-23" });
- assert.equal(ps[1].rows[0].to, "2026-10-25", "AS OF: the latest of its own rows, the claims' too");
+ assert.equal(ps[1].rows[0].to, "2026-10-24", "AS OF: the events seen so far, not a claim's date the cut has not reached");
// No paidOn anywhere: the first claim, by its date.
const unpaid = clone(paid);
for (const s of unpaid.state) for (const p of s.promises ?? []) for (const c of p.claims ?? []) delete c.paidOn;
@@ -152,6 +152,29 @@ test("promise: the days to the clip's in-record date, her claim and the outcome,
assert.match(page(), /@MadamSavvy<\/b> reads/);
});
+test("promise: AS OF follows the playhead's in-record date in the rev9 order -- any event's, a running max", () => {
+ // The rev9 cut's tail, in its order: the promise (23 Oct), her claims, c46 (a weight said 26 Oct), a late
+ // memory dated earlier (it must not pull AS OF back), n01 (3 Nov), then his check p05.
+ const said = "2026-10-23";
+ const ev = [
+ { t: 535, kind: "promise", date: said, row: "p01", label: "scale video" },
+ { t: 630.6, kind: "promiseClaim", date: "2026-10-25", row: "s03", promise: "p01", speaker: "madamsavvy" },
+ { t: 686.2, kind: "stated", date: "2026-10-26", row: "w118", value: 291.5 },
+ { t: 700, kind: "remembered", date: "2026-10-15", row: "w200", value: 390 },
+ { t: 736.9, kind: "promiseClaim", date: "2026-11-02", row: "s04", promise: "p01", speaker: "madamsavvy" },
+ { t: 758.8, kind: "lost", date: "2026-11-03", row: "w122", value: -10 },
+ { t: 778, kind: "promiseCheck", date: "2026-11-03", row: "p05", promise: "p01", label: "still no video" },
+ ];
+ const promises = [{ row: "p01", said, claims: [] }];
+ const m = { version: 1, unit: "lb", asOfRender: "2026-11-06", events: ev, hidden: [], state: [{ t: 0, promises: [] }, ...ev.map((e) => ({ t: e.t, promises }))] };
+ const states = promiseStates({ kind: "deck", fps: 30, total: 800, transition: 0.4, segments: [{ id: "a", start: 0, duration: 800, end: 800 }], measure: m }, withDeck({ promise: { label: "scale video" } }));
+ const at = (t) => states.filter((s) => s.at <= t).at(-1).rows[0];
+ assert.deepEqual([at(690).to, at(690).days], ["2026-10-26", 3], "during c46: 3 DAYS AS OF 26 OCT, not 25 Oct");
+ assert.equal(at(710).to, "2026-10-26", "an earlier date later in the cut never takes it back");
+ assert.deepEqual([at(760).to, at(760).days], ["2026-11-03", 11], "during n01: AS OF 3 NOV before p05 lands");
+ assert.deepEqual([states.at(-1).rows[0].to, states.at(-1).asOf], ["2026-11-06", true], "the render date from the finale on");
+});
+
test("diet: a stamp per change of regime or number, words alone not slammed, a null after one is No diet", () => {
const states = dietStates(schedule(), RENDER);
assert.equal(states[0].diet.label, "Some diet");