commit 2b1986e69fb26cee9339bebb69b3f05415b7af47
parent d1315cba1ab80251e4f72421251e5cea00162493
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 22 Oct 2026 10:59:30 -0400
knobs: claim.at inside the window exactly, as the renderer's validateClaims; updateClaimKnobs runs it too
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/umtool/lib/report/knobs.mjs b/umtool/lib/report/knobs.mjs
@@ -28,9 +28,6 @@ const numIn = (v, lo, hi) => num(v) && v >= lo && v <= hi;
const q = (v) => JSON.stringify(v);
const round = (n, dp) => Number(Number(n).toFixed(dp));
-/** Same tolerance the writer uses for a stored 2 dp edge. */
-const EPS = 0.02;
-
// ---------------------------------------------------------------------------
// A claim's knobs (per entry).
// ---------------------------------------------------------------------------
@@ -170,7 +167,7 @@ export function claimKnobProblems(manifest) {
errors.push(`${where}.${err instanceof Error ? err.message : String(err)}`);
}
}
- if (num(e.claim.at) && num(e.start) && num(e.end) && (e.claim.at < e.start - EPS || e.claim.at > e.end + EPS)) {
+ if (num(e.claim.at) && num(e.start) && num(e.end) && (e.claim.at < e.start || e.claim.at > e.end)) {
errors.push(`${where}.claim.at ${e.claim.at} must lie inside the clip's window ${e.start}–${e.end}`);
}
});
diff --git a/umtool/lib/report/manifest.mjs b/umtool/lib/report/manifest.mjs
@@ -360,7 +360,7 @@ export async function updateClip(dir, clipId, patch, { token = null, edit = "tri
// that leaves it outside is refused, as the mute mark's is, rather than
// keeping a mark that no longer says anything about the clip.
if ((patch.start !== undefined || patch.end !== undefined) && isObj(entry.claim) && typeof entry.claim.at === "number") {
- if (entry.claim.at < entry.start - WIN_EPS || entry.claim.at > entry.end + WIN_EPS) {
+ if (entry.claim.at < entry.start || entry.claim.at > entry.end) {
throw new Error(
`the stamp's second (claim.at ${entry.claim.at}) must lie inside the window ` +
`${entry.start}–${entry.end} — widen the window, or clear claim.at`,
@@ -1756,7 +1756,8 @@ export async function updateClaimKnobs(dir, entryId, patch, { token = null } = {
else e.claim[k] = v;
}
}
- const bad = claimKnobProblems({ timeline: entries });
+ // Ours, then the renderer's own (which also reads the knobs once it knows them).
+ const bad = [...claimKnobProblems({ timeline: entries }), ...validateClaims(claimsForRenderer({ timeline: entries }))];
if (bad.length) throw new Error(`${bad.join("; ")} — nothing was written`);
const nextToken = await writeManifestAtomic(dir, manifest);
const stampsOn = stampingEntryId(manifest, entries[0].claim.id);