~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Harness: the reference's session tokens may live a second more

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:ref-token-life

main's gates on 4ebd975 failed in the crash suite, not on anything the server did. In the run --steps 1000 --seed 41 --crash-every 15 --firehose --commands, step 975 was a refreshSession. The reference's access token had exp - iat = 7201, and the harness holds both sides to 7200 (spec/SESSIONS.md). The server's was 7200.

The reference reads the clock once for iat and again for exp. When the two reads fall either side of a second, its token lives a second longer. The server derives both from one now (sessions.rs, tokens), so its life is always exact.

The change:

  • checks/sessions.mjs and checks/lifecycle.mjs accept a life of exactly one second more, from the reference only.
  • The server is still held to the life exactly, so nothing is loosened for it. A server giving 7201 still fails.

Checked: compare.mjs --steps 200 --seed 41 --commands agrees.

🤖 Generated with Claude Code

Approved

This harness-only change makes the token-life check accept a life one second longer than the spec's, but only from the reference. The server is still held to exactly 7200 for access tokens and 7776000 for refresh tokens. ref is imported in both files, and the takendown-session check in lifecycle.mjs gets the same treatment as sessions.mjs. No spec or README change is needed, since server behaviour doesn't change and spec/SESSIONS.md still says iat + 7200. I didn't run the harness. The tolerance is narrow, one second and the reference only, and the comment says why. The same life + 1 rule also covers the reference's 90-day refresh tokens, which fits the same two-clock-reads cause.

Merged as a4fb94c