mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 15:47:43 +01:00
* Make mobile agent conversations and shared project progress coherent * Remove the retired automatic personal-goal dispatch reader * Keep the conversation connection indicator in sync with its live stream * Preserve existing phone install identity and clarify the historical implementation plan * Make session recovery instructions user-facing and record the security-alert source review * Carry project proposals into coding handoffs and clarify empty-session routing
24 lines
923 B
TypeScript
24 lines
923 B
TypeScript
import assert from "node:assert/strict";
|
|
import { controlNextStep } from "../../src/lib/control-next-step";
|
|
const now = Date.parse("2026-10-15T12:00:00Z");
|
|
assert.equal(
|
|
controlNextStep(
|
|
{ next: "Obsolete production database advice", mtime: now - 150 * 86_400_000 },
|
|
undefined,
|
|
now / 1000,
|
|
),
|
|
null,
|
|
);
|
|
assert.equal(controlNextStep({ next: "Undated", mtime: NaN }, undefined, now / 1000), null);
|
|
assert.equal(controlNextStep({ next: "Future", mtime: now + 1000 }, undefined, now / 1000), null);
|
|
assert.equal(
|
|
controlNextStep({ next: "Current task", mtime: now - 60_000 }, undefined, now / 1000)?.text,
|
|
"Current task",
|
|
);
|
|
assert.equal(controlNextStep(null, "Unknown", now / 1000), null);
|
|
assert.equal(
|
|
controlNextStep(null, "Profile suggestion", now / 1000)?.label,
|
|
"Suggested next (profile):",
|
|
);
|
|
console.log("✓ Control does not promote old, future or unknown handoffs as current instructions");
|