Skip to content

docs(jobs): a job body's default locale and time zone are the server's - #29355

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-29202-jobs-intl-default-zone
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-29202-jobs-intl-default-zone

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by 田騏 · project thread
Fixes #29202
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:定时任务文档 jobs.mdx 在 Intl.DateTimeFormat 那条说明里补两句话:不传语言和 timeZone 时用的是服务器的默认语言和时区,要稳定输出就显式传 timeZone(和语言)。
  • 为什么改:开发者本地跑和服务器跑会得到不同的日期,文档之前没提醒;这是 feat(runtime): a sandboxed body can do time-zone date maths, through Intl.DateTimeFormat #29031 合约复审点名的后续。
  • 风险与回滚:纯文档,不改代码、不发布任何包;回滚即还原这 5 行。
  • 先看:content/docs/automation/jobs.mdx 第 199–203 行(新增的两句与示例)。
  • 两分钟验证:打开文档站「Jobs」页的沙箱一节,Intl.DateTimeFormat 那条下应看到 “server's default locale and time zone” 与 { timeZone: 'UTC' } 示例。
  • 需要你做的:无,席位落地。

What changes

One addition to the Intl.DateTimeFormat bullet in content/docs/automation/jobs.mdx (+5 / -0): a formatter built with no locale or timeZone uses the server's default locale and time zone, and its resolvedOptions() reports them; a body should pass timeZone (and a locale) for output that does not depend on where it runs, with new Intl.DateTimeFormat('en-US', { timeZone: 'UTC' }) as the example. No code change.

Tests

None owed: docs only, no tested behaviour changes. The statement was measured before it was written (below).

Acceptance notes

  • The wiring that backs the sentence: the VM-side constructor in packages/runtime/src/sandbox/sandbox-intl.ts snapshots locales / options; with neither given the snapshot is empty, readSnapshot hands undefined / undefined to the host, and installSandboxIntl builds new Intl.DateTimeFormat(locales, options) with the host's own Intl, so the host's defaults apply. QuickJSScriptRunner.execute() in packages/runtime/src/sandbox/quickjs-runner.ts calls installSandboxIntl(vm) for every body kind.
  • Hook and action pages (content/docs/automation/hooks.mdx, content/docs/automation/hook-bodies.mdx, content/docs/ui/actions.mdx) do not carry the Intl.DateTimeFormat bullet, so there is nothing to mirror there; the jobs bullet already says hook and action bodies get the same formatter.
  • No changeset: content/docs ships in no package's files[], so skip-changeset.

Verification

Measured: a no-option formatter answers the host's locale and zone

A scratch script installed installSandboxIntl into a fresh QuickJS context (the same call execute() makes) and evaluated new Intl.DateTimeFormat().resolvedOptions() and .format(0) inside the VM, beside a formatter given 'en-US', { timeZone: 'UTC' }, under three host settings:

Host TZ / locale No-option resolvedOptions() No-option format(0) Pinned format(0)
Asia/Tokyo / de_DE de-DE, Asia/Tokyo 1.1.1970 1/1/1970
America/New_York / de_DE de-DE, America/New_York 31.12.1969 1/1/1970
Asia/Tokyo / en_GB en-GB, Asia/Tokyo 01/01/1970 1/1/1970

Each no-option row equals the host's own new Intl.DateTimeFormat().resolvedOptions() in the same process; the pinned formatter answers the same in all three. The script was not committed.

Derived gates at 7dc9c8c (after merging origin/main a2fcede)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 43 commands. All 43 ran, each exit code captured before any pipe: 43 at exit 0. Four first refused with exit 3 (PREREQUISITE NOT MET: @objectstack/lint / @objectstack/formula / @objectstack/client-react not built); after pnpm --filter '@objectstack/lint...' --filter '@objectstack/client-react...' build (VERDICT command-exit 0) each re-ran at exit 0: check:doc-formula-expressions, check:doc-security-posture, check:skill-examples, check:docs-transcript-drift.

--ran reconciliation: 43 derived, 43 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero: all 43 recorded an exit code).

NOT MEASURED locally, left to CI: ci.yml · Build Docs and ci.yml · Plan Test Core shards, and the type-check lanes the derivation lists.

🤖 Generated with Claude Code

A body's Intl.DateTimeFormat answers with the host's own, so a formatter
built with no locale or timeZone uses the server's defaults and its
resolvedOptions() reports them. Say so beside the Intl.DateTimeFormat
bullet, and tell the author to pass timeZone (and a locale) for output
that does not depend on where the body runs.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 2, 2026
@github-actions github-actions Bot added size/xs documentation Improvements or additions to documentation labels Nov 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

席位核对 — ACCEPT · domain:devx#2 · head 7dc9c8c1ee73220c02e42ca54d976bcb68154e0c · 2026-11-02T13:08Z

Checked against GitHub and the PR head, not against the report (os-dev-report 6577620968 on #29202).

  • Shape: a draft to main with Fixes #29202 once, Clause-②: no and Metadata-protocol: none. It has no assignees and no reviewers. skip-changeset is correct, because only content/docs/automation/jobs.mdx changes.
  • Path surface: one docs page (+5/−0), inside the Intl.DateTimeFormat bullet that feat(runtime): a sandboxed body can do time-zone date maths, through Intl.DateTimeFormat #29031 added. It is not governed, touches no contract face, and changes no code, so the seat reads it with CI and no second agent.
  • Card rules, read in the diff: both points of the card's Acceptance hold.
    • The bullet says a formatter with no locale or timeZone uses the server's default locale and time zone, and that resolvedOptions() reports them.
    • It tells the author to pass timeZone and a locale for output that does not depend on where the body runs, with new Intl.DateTimeFormat('en-US', { timeZone: 'UTC' }) as the example.
    • Both statements are backed by packages/runtime/src/sandbox/sandbox-intl.ts. Its readSnapshot passes undefined locales and options through to the host's Intl.DateTimeFormat, and execute() in quickjs-runner.ts installs it for every body kind.
    • The dev's probe showed the host's zone and locale under three host settings (Tokyo and New York, de_DE and en_GB), and showed the pinned formatter stable in all three.
  • Gates: dispatch-gates --commands lists 43 commands. All exit 0 after building the packages four of them needed, and --ran reports 43/43. The seat lands once every check on this head is green.
  • Accepted deviations: the probe called installSandboxIntl directly rather than going through QuickJSScriptRunner.run(). That reads the same wiring the runner installs, so it is enough for a docs sentence.
  • Out of scope: the hook and action pages carry no Intl.DateTimeFormat bullet to mirror, and this page already says those bodies share the same sandbox. The generated references/system/job.mdx is accurate as written. Neither gets a card. Skills-docs: none — docs page only.
  • Landing: non-governed. Once every check on this head is green, the seat marks the PR ready and enables auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 13:09
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 0138641 Nov 2, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-29202-jobs-intl-default-zone branch November 2, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(jobs): say a job body's default locale and time zone are the server's, so always pass timeZone

1 participant