Skip to content

test: the Rest "tonight" case of the agent-access document test pins its clock - #2175

Merged
yw0nam merged 1 commit into
mainfrom
fix/rest-tonight-test-clock
Nov 29, 2026
Merged

yw0nam merged 1 commit into
mainfrom
fix/rest-tonight-test-clock

Conversation

@yw0nam

@yw0nam yw0nam commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Summary

One parameterised test read the real clock, so the web job failed for every pull request that ran between 00:00 and 07:59 UTC.

src/settings/agent-access/document.test.ts
  describe("pace.rest")
    it.each(...)("asks to start %s, and the allowed write reads it back")
+     vi.useFakeTimers({ toFake: ["Date"] });
+     vi.setSystemTime(T0);          // the block's 21:10, when every choice is offered

The validation under test calls restChoicesAt(Date.now()) (rows.ts:391), which drops "tonight" before 08:00 local (rest-end.ts:31-34). The block's existing afterEach(() => vi.useRealTimers()) (line 241 area) restores the clock, and its other tests already pin it the same way. No production file changes.

Related issues

Closes #2174

Related decisions / docs

None.

Runtime evidence (required for UI / DOM / runtime behavior)

N/A — no runtime behavior change (test file only).

Red, before the change: TZ=Etc/GMT+8 pnpm exec vitest run src/settings/agent-access/document.test.ts at local hour 01 gives 1 failed, 28 passed, with the assertion quoted in the issue. Green, after: the same command gives 29 passed; with no TZ (local hour 18) 29 passed.

Merge danger

Door: two-way (a revert undoes it). Blast radius: one test file.

Review tier: Ship. Nothing a user, the backend or another process can observe changes; the diff is two lines in a test, read in full.

Verification

  • pnpm build passes (includes tsc typecheck)
  • pnpm test passes (this file, with and without the early clock; the full suite runs in CI)
  • pnpm lint passes (biome check on the file: no fixes)
  • cargo test / cargo clippy pass (Rust changes): none
  • Runtime evidence attached above, or N/A justified

Checklist (YUI principles)

  • Schema changes update docs/reference/client-context.md alongside the code: none
  • docs/agent-guide/architecture/map.js carries every module, part, and exchange this PR adds, removes, or changes (or none changed): none changed
  • No unverified assumptions (docs first; web/context7 cross-check)
  • No brain in the client — judgment and mode live in the backend; persona text is client configuration (firing ≠ judgment)
  • No inline control tags — emotion/motion only via generate_express tool-call arguments
  • No hardcoding — endpoints/models/paths live in configs/
  • New/changed behavior ships a test in this PR (or skip-tests label justified): the change is the test

@yw0nam
yw0nam marked this pull request as ready for review November 29, 2026 10:33
@yw0nam
yw0nam merged commit 0eacfa3 into main Nov 29, 2026
12 checks passed
@yw0nam
yw0nam deleted the fix/rest-tonight-test-clock branch November 29, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] The Rest "tonight" case of the agent-access document test fails before 08:00 on the runner clock

1 participant