fix(07-05): pay IN-01/IN-02/IN-03 — dead export gone, wrangler comment truthful, 900 s boundary pinned

- IN-01: delete the never-constructed ParsedInitData export (sole repo hit was
  its own declaration); the three read-helper catches now carry Intent:
  comments stating malformed-vs-tampered precedence and the chat-degrade law
- IN-02: wrangler.jsonc line 2 states the post-fact truth — the chat_sessions
  namespace id below is live, no re-creation
- IN-03: new T4 vector 'age 900 s → ok:true (the boundary is INCLUSIVE)' pins
  the strictly-greater comparator's inclusive edge (T-07-08); suite 126/126
This commit is contained in:
araharah-executor
2026-10-25 04:44:37 +08:00
parent dea6261deb
commit 84cb93d10a
3 changed files with 16 additions and 12 deletions
+8
View File
@@ -188,6 +188,14 @@ test("T4 freshness boundary: age 901 s → reason stale", async () => {
assert.equal(res.reason, "stale");
});
test("T4 freshness boundary: age 900 s → ok:true (the boundary is INCLUSIVE)", async () => {
const validateInitData = await loadValidator();
const now = Math.floor(Date.now() / 1000);
const raw = signedUser(now - 900);
const res = await validateInitData(raw, TEST_TOKEN);
assert.equal(res.ok, true, `expected ok:true at exactly 900 s, got ${JSON.stringify(res)}`);
});
/* ————— T5 — field order independence (RESEARCH Pitfall 1) ————— */
test("T5 fields arriving out of alphabetical order still validate", async () => {