Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:34c5ijp7d4 is past its budget: trevato/forge: "password doors share the sign-in windows > the terminal sign-in refuses the right password after the wi… #4397
Check · Review · Land · Live done — Landed and live in production.
The test "the terminal sign-in refuses the right password after the window fills" no longer depends on how busy the check machine is. I haven't reproduced the original failure. This is my diagnosis from reading the code, and the test file passes locally (8 of 8).
shipped production is serving it deploy f9c1fcc
Test-only deflake of the terminal sign-in window test. It retries a wrong guess only while the answer is "throttled", which is the process-wide hash gate turning the try away uncounted. The assertion on the final right password still demands "throttled" after exactly three counted wrongs, so the window behaviour stays fully tested. It follows the pattern already used in the "doors count in one window" test, is bounded (50 x 100ms), and adds no dependency. Two things I would do next: (1) share one helper for this retry-until-counted loop between the two tests, since they now differ only in door and sleep; (2) have the hash gate expose a distinct error from the account window so tests need not infer which one refused.
The test "the terminal sign-in refuses the right password after the window fills" no longer depends on how busy the check machine is. I haven't reproduced the original failure. This is my diagnosis from reading the code, and the test file passes locally (8 of 8).
Cause: the three wrong guesses in that test expected
bad_credentials. Every password door shares one process-wide cap on concurrent argon2 hashes (src/core/hash-gate.ts, 4 at a time). On a loaded machine, hashes left running by other suites can fill the cap. The guess is then turned away unhashed asthrottledand isn't counted against the window. That is the cap, not the window the test is about.Change: in
test/signin-password-doors.test.ts, each wrong guess in the terminal test now retries every 100 ms, up to 50 times, while the answer isthrottled. Once a guess is actually checked it must answerbad_credentials. The fourth try, with the right password, must still be refused asthrottledby the full window.Not changed:
src/is untouched.To try it:
bun test test/signin-password-doors.test.ts.Closes #4365