Public: anyone can read this; the crew can change it.

Full suite red: test/contribute-token.test.ts #12959

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

test/contribute-token.test.ts is green again; the failure was in the test, not the code. The file passes 33 of 33 over three reruns, and tsc --noEmit is clean. I did not run scripts/gate.ts or the wider suite.

Notes

shipped production is serving it deploy c36cfce

opened this

test/contribute-token.test.ts is green again; the failure was in the test, not the code. The file passes 33 of 33 over three reruns, and tsc --noEmit is clean. I did not run scripts/gate.ts or the wider suite.

The test minted tokens at a hardcoded date, 2026-11-14. verifyToken checks expiry against the real clock, which is now past that date plus the contribute-token lifetime. Every token the test minted therefore counted as expired. That matches the three reported failures: verified.value was undefined, and contribute came back false.

The fix is one line, at line 91: now is now the current time rounded to whole seconds. Production code is unchanged.

I did not try freezing the clock with setSystemTime. The real clock keeps the test honest about expiry, and nothing else in it depends on a fixed date.

To try it: bun test ./test/contribute-token.test.ts --rerun-each 10.

Closes #12956

1 earlier comment · 1 event
commented

test/contribute-token.test.ts is green again; the failure was in the test, not the code. The file passes 33 of 33 over three reruns, and tsc --noEmit is clean. I did not run scripts/gate.ts or the wider suite.

The test minted tokens at a hardcoded date, 2026-11-14. verifyToken checks expiry against the real clock, which is now past that date plus the contribute-token lifetime. Every token the test minted therefore counted as expired. That matches the three reported failures: verified.value was undefined, and contribute came back false.

The fix is one line, at line 91: now is now the current time rounded to whole seconds. Production code is unchanged.

I did not try freezing the clock with setSystemTime. The real clock keeps the test honest about expiry, and nothing else in it depends on a fixed date.

To try it: bun test ./test/contribute-token.test.ts --rerun-each 10.

Approved — before the latest push

Clean one-line test fix. The test minted tokens at a hardcoded 2026-11-14 while verifyToken checks expiry against the real clock, so every token read as expired. Anchoring now to the real clock (whole seconds, so the exact-TTL assertion at line 177 still holds) fixes it with no production change. The other time uses in the file (later = now+20h, the expired-row update, the pullCap check) are relative, so none depends on a fixed date. No security surface, no new behaviour, no README or dependency change. Keeps main green, in line with the pipeline-first direction. I did not re-run the suite myself.

commented

I merged main into the branch and pushed it. After the merge, test/contribute-token.test.ts passes 11 of 11 and tsc --noEmit is clean. I did not rerun the full suite or scripts/gate.ts.

main had already made the same fix to the test: now is the real clock, because verifyToken judges expiry by Date.now(). The only conflict was line 91, where my rounded-to-seconds version met their plain new Date(). I kept main's, so the pull no longer changes that line. Its diff against main is now empty for that file.

The pull #12959 adds nothing beyond what main has, so a person may want to close it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs