Skip to content

social test: face-rooms pins local-time titles to UTC strings, so the file is red on every non-UTC machine - #3107

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-face-when-local-tz
Nov 15, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-face-when-local-tz

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3106

Owner: Dev-1
Written-by: Dev-1
Bot: FlyBot Dev-1
Tier: T1 (test-only, plugins/social/test/**; no product code)
Claim-Id: b8416b79222d43199c9183fce882b342
Base: 5cb1692
Verified commit: 9ba6d08a9a253882976c0ecc3f67c4cfb8d38252 (tree 2c6ec41c0bd457082aed0df5c4bd57237e0fe000)
Pushed head: efb2676
Tree: 2c6ec41c0bd457082aed0df5c4bd57237e0fe000

What was wrong

plugins/social/test/face-rooms.test.js wrote its fixture instants as UTC
(2026-10-17T14:38:00.000Z) and then asserted the rendered title as
Oct 17 14:38. The title prints the wall clock of the box that draws it —
core/src/shared/face-title.js formatFaceWhen reads getHours() /
getMinutes() / getMonth() / getDate() — so that pair only agrees on a UTC
box. Nothing is wrong with the product: the test pinned a local rendering to a
UTC expectation, and the file is red on every non-UTC machine.

Rebase onto the live main, and why the shas in this body differ

The branch was cut from 5cb16923 (the Base: line above). While the push ran,
upstream main moved to fc32c5fe8d4a1ad480a78d2f470e5d6f25dc7807 (#3104, a
core/test/** change; no file of this PR is touched by it), so the push path
overlaid this one-file change onto the new main. The branch was then rebased onto
fc32c5fe, giving the verified commit 9ba6d08a; its tree,
2c6ec41c0bd457082aed0df5c4bd57237e0fe000, is bit-for-bit the tree of the
pushed head efb26767. Every reading below was re-taken on the rebased tree.

Red first, before the change

cd plugins/social && TZ=<zone> node --import ./test/resolve.mjs --test test/face-rooms.test.js

On the cut base 5cb16923, and again on the rebased base fc32c5fe8, two runs
per zone, every run identical: # tests 38 # pass 36 # fail 2, exit 1.

TZ=Asia/Shanghai:

not ok 9 - owner-typed face-room lines encode as a human envelope
  location: '.../plugins/social/test/face-rooms.test.js:232:1'
  expected: 'Face-to-face · UiA1415, UiB1415 · Oct 17 14:38'
  actual: 'Face-to-face · UiA1415, UiB1415 · Oct 17 22:38'
  operator: 'strictEqual'
  stack: TestContext.<anonymous> (.../face-rooms.test.js:254:10)

not ok 28 - \#194: a face room title shows one time, the creation time, before and after Enter chat
  location: '.../plugins/social/test/face-rooms.test.js:644:1'
  error: The input did not match the regular expression /12:56$/. Input: 'Face-to-face · Alice · Oct 17 20:56'
  actual: 'Face-to-face · Alice · Oct 17 20:56'
  operator: 'match'
  stack: TestContext.<anonymous> (.../face-rooms.test.js:649:10)

TZ=America/New_York, same two cases, same expectation, different offset:
actual: 'Face-to-face · UiA1415, UiB1415 · Oct 17 10:38' (against the
Oct 17 14:38 expectation) and actual: 'Face-to-face · Alice · Oct 17 08:56'
(against /12:56$/); # tests 38 # pass 36 # fail 2. Two zones with different
offsets move the rendering by exactly their offset, which pins the cause to
"local rendering vs UTC expectation", not to one zone.

The fix

The fixtures are built from the same local parts the title prints, with one
helper at the top of the file:

const localIso = (year, month, day, hour, minute, second = 0) =>
  new Date(year, month - 1, day, hour, minute, second).toISOString()
  • :256 the human-envelope fixture: const at = localIso(2026, 10, 17, 14, 38).
  • #194 (:652): deadline = localIso(2026, 10, 17, 13, 6),
    created = localIso(2026, 10, 17, 12, 40),
    startedAt: localIso(2026, 10, 17, 13, 1, 30).

The expected strings did not change and no assertion was relaxed, skipped or
turned into a regex. It cannot pass vacuously: the case still asserts the exact
title Face-to-face · UiA1415, UiB1415 · Oct 17 14:38, still asserts two members
in handle order (titleA === titleB), still asserts two different starts give
different titles (assert.notEqual(...)), and #194 still asserts
candidate === open, /12:56$/ and the isGenericFaceTitle branch.

Green after, same commands, on the rebased tree

TZ runs result
UTC 2 38/38, # fail 0, exit 0
Asia/Shanghai 2 38/38, # fail 0, exit 0
Europe/Berlin 2 38/38, # fail 0, exit 0

Whole social package under a non-UTC zone on this tree:
TZ=Asia/Shanghai npm --prefix plugins/social test → # tests 701 # pass 701 # fail 0.

No second place in this file pins a local rendering to a fixed string (grepped
the file; social.test.js:4076/4086 carries the same literal but reuses the
stored stamp instead of re-rendering, so it is not red and is out of scope).

verify

unset ARCH_DOCS_BASE; TZ=UTC npm run verify → exit 0 (log sha256
656794a5b736ad6cd607e6ecb105c17ce164f0fef70a8c02dd6b40dca73370f9):
core 3255, social 701, tree 149, timeline 172, workflow 535, project 147,
gate/policy 681, interop 37, live-e2e 34 — # fail 0 everywhere; core lint 88
warnings / 0 errors, plugin lint 0 errors; arch-docs: OK (1 changed file(s));
build-client --check exit 0, patches check three ok lines, canonical a no-op.

Who verified what, and what was not run

The reverse check in this PR's verdict (comment 6892099408, from the Reviewer at this tip) is the reason to believe the fix rather than the green run alone: the base blob of plugins/social/test/face-rooms.test.js, dropped back into this tip's tree, fails 2 of 38 in Asia/Shanghai and America/New_York, and those two are exactly the two cases this diff touches (:254 Oct 17 14:38 vs 22:38/10:38, :649 /12:56$/ vs 20:56/08:56); the same file at this tip is 38/38 in UTC, Asia/Shanghai, America/New_York and Asia/Kolkata (a :30 offset).

The Reviewer did not run npm run verify: that box has no @deepseek-ai/dsh-llm for core/dev/harness, so test/social.test.js stops on module resolution on the base tree and on this tip alike (TZ=Asia/Shanghai npm test: base 206 pass / 3 fail, tip 208 pass / 1 fail). The verify row above is ours, run on the same tree; the CI plugins (social) job is green at this tip.

Files

1 file, +13/−5: plugins/social/test/face-rooms.test.js. git diff against the
base touches no product file (git diff 5cb16923 HEAD -- core plugins/social/src patches = 0 lines), no core/client.js, no patches/**.

Docs-not-needed: test-only; only how the fixture instant is built changed, and the title behaviour it pins is untouched.

Not run: the test bench / smoke — no product code changed.

{
  "pr": 3107,
  "claim": "Dev-1",
  "issue": 3106,
  "summary": "face-rooms wrote its fixture instants as UTC strings and then asserted locally rendered titles, so the file was red on every non-UTC box (Asia/Shanghai drew 22:38, New York 10:38). The fixtures now come from local parts through one localIso helper, so the same exact-string assertions hold in any zone; no assertion was relaxed, skipped or removed, and the two-different-starts notEqual plus the isGenericFaceTitle branch keep the case from passing vacuously. Test-only, one file.",
  "files": [
    "plugins/social/test/face-rooms.test.js"
  ],
  "checks": {
    "ran": "unset ARCH_DOCS_BASE; TZ=UTC npm run verify; face-rooms.test.js under TZ=UTC/Asia_Shanghai/Europe_Berlin x2; whole social package under TZ=Asia_Shanghai",
    "result": "green",
    "at": "efb26767ce0ca483d0dae9cfbb64905fd7b06f9a"
  },
  "next": "ready for review at this tip"
}

Fixes ThinkFlowLab#3106

Owner: Dev-1
Written-by: Dev-1
Bot: FlyBot Dev-1
Tier: T1 (test-only, `plugins/social/test/**`; no product code)
Docs-not-needed: test-only; only how the fixture instant is built changed, and the title behaviour it pins is untouched.

`plugins/social/test/face-rooms.test.js` wrote its fixture instants in UTC
(`2026-10-17T14:38:00.000Z`) and then asserted the rendered title as
`Oct 17 14:38`. The title prints the wall clock of the box that draws it
(`core/src/shared/face-title.js` `formatFaceWhen` reads `getHours()` /
`getMinutes()` / `getMonth()` / `getDate()`), so that pair only agrees on a
UTC box: `TZ=Asia/Shanghai` renders `Oct 17 22:38` and `TZ=America/New_York`
renders `Oct 17 10:38`, and the file is red there. Nothing is wrong with the
product — the test pinned a local rendering to a UTC expectation.

The fixtures are now built from the same local parts the title prints, so the
expectation holds everywhere while still asserting the same thing: the title
carries the exact minute (`Oct 17 14:38`) and the owners in handle order. A
`localIso(year, month, day, hour, minute)` helper does the conversion, used
by the human-envelope fixture and by the `ThinkFlowLab#194` case (`12:56` is still the
deadline minus the ten-minute window). No assertion was relaxed, skipped or
turned into a regex; the two-different-starts `notEqual` and the
`isGenericFaceTitle` branch are unchanged, so the case cannot pass vacuously.

Verified: `TZ=UTC`, `TZ=Asia/Shanghai`, `TZ=Europe/Berlin` — 38/38 green,
twice each.
@HugoXK

HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy merge request — tip efb26767ce0ca483d0dae9cfbb64905fd7b06f9a (T1)

  • Tier T1 (test-only: plugins/social/test/**, no product code), 1 file +13/−5, non-draft, maintainer_can_modify: true, single commit, parent fc32c5fe, mergeable.
  • checks at this tip: 15 success + 2 skipped (window check, live · ubuntu · Node 24 · real model), tests-ok: success, merge-gate: success, policy-sign: success.
  • the only red is enqueue-guard, and its whole reason is this: no Verifier report names the tip efb26767ce0c.
  • base fc32c5fe is one commit behind live main 5ef73488; nothing of this PR is touched by it, so no conflict was resolved and the tip was not rebuilt for it.

One Verifier report naming efb26767 is what this PR still needs; nothing else is outstanding on our side.

@Birfy

Birfy commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at efb2676
Written-by: Reviewer
Attestation: efb2676 role=Reviewer

Ran at this tip:

$ cd plugins/social && for tz in UTC Asia/Shanghai America/New_York; do TZ=$tz node --import ./test/resolve.mjs --test test/face-rooms.test.js; done
$ cd plugins/social && TZ=Asia/Kolkata node --import ./test/resolve.mjs --test test/face-rooms.test.js
$ cd plugins/social && TZ=Asia/Shanghai npm test
$ cp face-rooms.base.js ../mut/plugins/social/test/face-rooms.test.js   # base blob of the file at fc32c5fe into the tip tree
$ cd ../mut/plugins/social && for tz in Asia/Shanghai America/New_York; do TZ=$tz node --import ./test/resolve.mjs --test test/face-rooms.test.js; done
# tests 38  # pass 38  # fail 0   (tip, UTC / Asia_Shanghai / America_New_York / Asia_Kolkata)
# tests 38  # pass 36  # fail 2   (tip tree with the base blob restored, Asia_Shanghai and America_New_York)

Reviewer read at 2026-11-15T09:05Z, tarball of efb2676, Node v22.23.3, GitHub REST /pulls + /pulls/3107/files + /check-runs.

Red first, before believing the fix: the base blob of plugins/social/test/face-rooms.test.js (as at base fc32c5f) dropped back into this tip's tree fails 2 of 38 in both non-UTC zones, and the two failures are the two cases the diff touches — :254 Oct 17 14:38 vs Shanghai 22:38 / New York 10:38, and :649 /12:56$/ vs 20:56 / 08:56. The same file at this tip is 38/38 in UTC and three non-UTC zones, and in Asia/Kolkata (a :30 offset), so the offset, not one zone, is what moved.

The fix is the right shape, not a second pin: localIso(y, m, d, h, mi, s) builds the fixture from local parts (new Date(year, month - 1, ...)) and the expected strings are untouched — :260 still asserts the exact Face-to-face · UiA1415, UiB1415 · Oct 17 14:38, :259 titleA === titleB, :657 still /12:56$/, and the notEqual between two different starts and the isGenericFaceTitle branch are still there, so nothing passes vacuously. No assertion was relaxed, skipped or turned into a regex.

Same-file UTC literals that remain are not local renderings: countdownLabel cases (:155-167) are differences between two instants, :264-268 assert only the Face-to-face · Alice · prefix across differing starts, and the :345-397 / :781+ literals are event keys and API fixture payloads compared as strings. No time zone is hidden in the environment either: no process.env.TZ / TZ= in the file or in plugins/social/test/**, and this PR touches no workflow file — one file, +13/−5, plugins/social/test/face-rooms.test.js only, zero product lines (/pulls/3107/files).

Checks at this tip: 16 success + 2 skipped (window check, live · ubuntu · Node 24 · real model), tests-ok/plugins (social)/merge-gate/policy-sign green; the only red is enqueue-guard for the missing Verifier report this comment supplies. mergeable=true, not dirty against live main 5ef7348 (that commit touches plugins/workflow and i18n only).

Not run: npm run verify and the live bench here — this box has no @deepseek-ai/dsh-llm for core/dev/harness, so test/social.test.js errors out on module resolution on the tip and on the base tree alike (TZ=Asia/Shanghai npm test: base 206 pass / 3 fail, tip 208 pass / 1 fail — the two removed failures are exactly this PR's). The CI plugins (social) job is green at this tip.

@github-actions github-actions Bot added the pass label Nov 15, 2026
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 15, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 15, 2026
@HugoXK

HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for queue — tip efb26767ce0ca483d0dae9cfbb64905fd7b06f9a (T1)

  • Verdict: PASS at efb26767ce0ca483d0dae9cfbb64905fd7b06f9a (comment 6892099408, 09:06:24Z) — names this exact tip.
  • enqueue-guard is green on that tip now: enqueue #3107: no hold and the gate passes. merge-gate, tests-ok, policy-sign green too.
  • checks at this tip: 17 success + 2 skipped (window check, live · ubuntu · Node 24 · real model), 0 pending, nothing non-green.
  • mergeable: true, mergeable_state: clean; 1 file +13/−5 (plugins/social/test/face-rooms.test.js only), single commit, parent fc32c5fe, non-draft, maintainer_can_modify: true.
  • base fc32c5fe is one commit behind live main 5ef73488 (that commit touches plugins/workflow and one i18n test); no file of this PR is in it, so a plain merge has no conflict and the tip is not rebuilt for it.

Nothing left on our side; the row is in the queue at this tip.

Merged via the queue into ThinkFlowLab:main with commit 3773d25 Nov 15, 2026
20 checks passed
@Birfy
Birfy deleted the dev/1-face-when-local-tz branch November 15, 2026 09:10
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

social test: face-rooms pins local-time titles to UTC strings, so the file is red on every non-UTC machine

2 participants