0.2.3's host acted on any jumpRequest no older than 15 s, a future one
too, and kept its time in $XDG_CACHE_HOME/agent-office/last-jump.json;
every later click had at <= that time and was dropped until the clock
got there. The decision is now judgeJump(at, seen, now) in lib/jump.mjs:
- A request fires only from 15 s old to 5 s ahead, once.
- One stamped further ahead is set aside and recorded, so it never
fires when the clock reaches it.
- A seen time ahead of now (0.2.3's file for such a request, or a clock
that stepped back) blocks only that same request (at === seen); any
other fresh click fires and rewrites the file. With seen in the past,
an older or equal request is still never acted on, so nothing is
replayed across restarts.
- The target is still worked out by the host from the session id; a
page-stamped time can only make a request be skipped, not fire it
later or elsewhere. Non-finite times are ignored and never written.
Existing bad last-jump.json from 0.2.3: read as before, no migration
needed; it no longer blocks, and the next click replaces it.
Run at this tree (base b797476), HOME=$(mktemp -d):
- mote (macOS): packages/agent-office bun test 180 pass, 0 fail;
bun scripts/stamp-page.mjs --check ok; bun scripts/check.mjs ok.
- wsl-run (Ubuntu 24.04): agent-office bun test 180 pass, 0 fail.
- win-run (Windows 11): agent-office bun test 180 pass, 0 fail.
The two host tests are macOS-only (fake herdr, like the 0.2.3 restart
test); judgeJump's table test runs on all three.
- New tests against 0.2.3's office.hooks.mjs (mote): both host tests
fail; a bad last-jump.json blocked the fresh jump, and a request an
hour ahead fired at once.
- Broken by hand (mote): dropping the 5 s ahead bound (2 fail), letting
a seen time ahead of now order requests again (3 fail), not recording
a set-aside future request (2 fail).
Not tried: a real magpie with a real herdr or terminal, or a real clock
step; whole-repo bun test (only agent-office changed).