From bdebb1c1179d0cebbfcf342a67fec4d56957814e Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 9 Nov 2026 08:36:16 +0200 Subject: [PATCH 1/5] feat(canary): test Safari's ICU and time zone data, and add a Browser support page (CNRY-1, #483) The weekly native suite now has a fifth leg, `webkit-macos`. It runs Playwright's WebKit on a macOS runner, so GMT is tested against the ICU and time zone data that Safari and every iOS browser use. The Linux `webkit` leg keeps testing the Linux distribution's ICU. - Add `webkit-macos` to the canary scripts from one list of legs. The leg refuses to run on a host that is not macOS, and its engine line names the macOS version. The polyfill swap check keeps its four legs. - Run the leg in `temporal-oracle.yml` on `macos-latest`, with a trace of disk and memory that works on macOS and a step that prints which ICU WebKit links. - Tag what the Mac fails, sorted by cause: Apple's locale text, POSIX time zone ids on both WebKit legs, and record AE (ICU4C 75 and later count every Persian year before year 0 as a leap year). - Add the Browser support page under Start here. It shows the syntax floor and the Node version from generated files, not by hand. - Name five legs in the wording about when host `Temporal` is reconsidered. Adds no function and changes no output of `packages/gmt`: no changeset. --- .agents/architect.md | 6 +- .agents/finalizer.md | 2 +- .agents/skills/implement/SKILL.md | 2 +- .agents/skills/pipeline/SKILL.md | 3 +- .agents/skills/plan-story/SKILL.md | 5 +- .../skills/plan-story/scripts/plan_gate.py | 4 +- .../plan-story/scripts/test_plan_gate.py | 12 + .github/workflows/temporal-oracle.yml | 48 ++- AGENTS.md | 1 + apps/dox/package.json | 2 +- .../dox/scripts/browser-support-built.test.ts | 59 ++++ apps/dox/scripts/canary/canary-issues.test.ts | 216 +++++++++++- apps/dox/scripts/canary/canary-report.test.ts | 31 +- .../dox/scripts/canary/canary-summary.test.ts | 47 ++- .../dox/scripts/canary/canary-verdict.test.ts | 3 + .../canary/native-suite-compat.test.ts | 90 ++++- .../canary/native-suite-run-pass.test.ts | 17 + apps/dox/scripts/canary/native-suite.test.ts | 235 ++++++++++++- .../canary/temporal-oracle-workflow.test.ts | 119 +++++++ apps/dox/scripts/generate-version-map.mjs | 12 + apps/dox/scripts/syntax-floor.test.ts | 60 ++++ apps/dox/src/content/docs/browser-support.mdx | 68 ++++ apps/dox/src/content/docs/bundle-size.mdx | 2 +- apps/dox/src/content/docs/install.mdx | 2 + apps/dox/src/content/docs/upstream.mdx | 13 +- apps/dox/src/data/temporal-compat.json | 6 +- apps/dox/src/lib/browser-support.test.ts | 85 +++++ .../src/lib/page-expression-values.test.ts | 1 + apps/dox/src/lib/page-expression-values.ts | 5 + apps/dox/src/lib/section-order.ts | 1 + apps/dox/src/lib/top-level-pages.test.ts | 2 + context/canary/index.md | 14 + context/canary/issues/CNRY-1.md | 145 +++++++++ context/canary/overview.md | 71 ++++ context/canary/tracker.md | 30 ++ context/domination/issues/CORE-80.md | 4 +- .../domination/js-temporal-polyfill-bugs.md | 116 ++++++- context/domination/overview.md | 2 +- package.json | 1 + .../gmt/src/internal/temporalCompat/README.md | 6 +- pnpm-lock.yaml | 3 + scripts/deps.mjs | 40 ++- scripts/lib/canary-issues.mjs | 96 +++--- scripts/lib/canary-summary.mjs | 12 +- scripts/lib/canary-verdict.mjs | 6 +- scripts/lib/native-suite-compat.mjs | 64 +++- scripts/lib/native-suite-tags.mjs | 308 ++++++++++++++++-- scripts/lib/workarounds.mjs | 15 +- scripts/native-suite.mjs | 94 ++++-- scripts/syntax-floor.mjs | 145 +++++++++ 50 files changed, 2156 insertions(+), 175 deletions(-) create mode 100644 apps/dox/scripts/browser-support-built.test.ts create mode 100644 apps/dox/scripts/canary/temporal-oracle-workflow.test.ts create mode 100644 apps/dox/scripts/syntax-floor.test.ts create mode 100644 apps/dox/src/content/docs/browser-support.mdx create mode 100644 apps/dox/src/lib/browser-support.test.ts create mode 100644 context/canary/index.md create mode 100644 context/canary/issues/CNRY-1.md create mode 100644 context/canary/overview.md create mode 100644 context/canary/tracker.md create mode 100644 scripts/syntax-floor.mjs diff --git a/.agents/architect.md b/.agents/architect.md index c508d7247..54a9ba9ec 100644 --- a/.agents/architect.md +++ b/.agents/architect.md @@ -33,8 +33,8 @@ You do not delegate. Return the finished plan to whoever invoked you — the mai ## Process 1. Read the user's request and any referenced plan/story/spec documents. For an epic - story, that is `context/domination/issues/.md` — and **check the story's - `Blocked by` cell in `context/domination/tracker.md` before planning it.** A + story, that is `context/domination/issues/.md` (`context/canary/` for `CNRY-*`) — and + **check the story's `Blocked by` cell in its tracker before planning it.** A non-empty cell means something must land first: say so and propose a different story rather than planning around the gap. A `(parenthesised)` entry is not a blocker — it is a shared primitive this story must build as part of its own scope, @@ -63,7 +63,7 @@ You do not delegate. Return the finished plan to whoever invoked you — the mai A plan the main session can hand straight to `tdd-dev`. Include function signatures, file locations, error-handling shape (try-catch + sentinel), JSDoc format, and the specific edge cases to test. A spec with a loop over a span, a log or a list states the target complexity and the bench rows that show it, per [§ Loop cost](../context/coding-standards.md#loop-cost). -**Shape — a spec folder, not one long file.** Write `context/domination/specs//index.md`, 150 lines or fewer, starting with frontmatter `story`, `issue`, `status: draft` and `dox: none` (the [plan gate](./skills/plan-story/SKILL.md#6-approve-and-hand-over) reads it; only the owner's approval sets `approved`): scope, signatures, file list, the authority table, and a slice table linking one file per function or slice (`/.md`, 200 lines or fewer each). Each worker reads the index plus its own slice, so a slice must stand on its own: its edge cases, expected values and the clauses it implements. Link context files by section; never copy them in. +**Shape — a spec folder, not one long file.** Write `context/domination/specs//index.md` (`context/canary/specs//index.md` for a `CNRY-*` story), 150 lines or fewer, starting with frontmatter `story`, `issue`, `status: draft` and `dox: none` (the [plan gate](./skills/plan-story/SKILL.md#6-approve-and-hand-over) reads it; only the owner's approval sets `approved`): scope, signatures, file list, the authority table, and a slice table linking one file per function or slice (`/.md`, 200 lines or fewer each). Each worker reads the index plus its own slice, so a slice must stand on its own: its edge cases, expected values and the clauses it implements. Link context files by section; never copy them in. ### The Authority table diff --git a/.agents/finalizer.md b/.agents/finalizer.md index 2fc42750a..e94e258e5 100644 --- a/.agents/finalizer.md +++ b/.agents/finalizer.md @@ -17,7 +17,7 @@ You are the Finalizer for the `@northguild/gmt` project. You close stories by ha **Release workflow:** Deep familiarity with `PUBLISHING.md`. This agent's release output is exactly one thing: a well-written `.changeset/*.md` on the feature branch. Versioning and publishing are both `release.yml`'s job — never run `changeset version`, `npm publish`, `changeset publish`, or `gh release create`. -**Epic structure:** `context/domination/tracker.md` contains the story table — build order, the generated `Blocked by` column, `Status`, the GitHub issue number, and `Release`. Per-story specs live in `context/domination/issues/.md`. `Release` is the owner's: never edit it. When the story you close carries `Cut`, tell the owner it is time to cut a release. +**Epic structure:** `context/domination/tracker.md` contains the story table — build order, the generated `Blocked by` column, `Status`, the GitHub issue number, and `Release`. Per-story specs live in `context/domination/issues/.md`. `Release` is the owner's: never edit it. A `CNRY-*` story uses `context/canary/` in place of `context/domination/` throughout (tracker, `issues/.md`, `specs//`); its tracker has no `Release` column and its `Blocked by` cell is hand-written. When the story you close carries `Cut`, tell the owner it is time to cut a release. **Legacy library awareness:** Luxon, date-fns, Moment.js — enough to verify competitive-gap claims during changelog writing. diff --git a/.agents/skills/implement/SKILL.md b/.agents/skills/implement/SKILL.md index e96e6e75a..4fe0fe86c 100644 --- a/.agents/skills/implement/SKILL.md +++ b/.agents/skills/implement/SKILL.md @@ -23,7 +23,7 @@ lines, links slices that exist and stay within 200 lines, and records the Dox de ## 2. Blocked by -Read the story's `Blocked by` cell in `context/domination/tracker.md` (or `context/dox/tracker.md`). +Read the story's `Blocked by` cell in `context/domination/tracker.md` (or `context/dox/tracker.md`, or `context/canary/tracker.md` for `CNRY-*`). A non-empty cell means something has to land first: say so instead of working around it. A `(parenthesised)` entry is not a blocker — it is a shared primitive this story builds itself, so fold it into the work and say so. `pnpm deps:ready` lists what is startable. diff --git a/.agents/skills/pipeline/SKILL.md b/.agents/skills/pipeline/SKILL.md index 8d3c571b2..8623dd599 100644 --- a/.agents/skills/pipeline/SKILL.md +++ b/.agents/skills/pipeline/SKILL.md @@ -65,7 +65,8 @@ and one slice), never no spec. Nothing else has a story spec, so nothing else ru Planning is [`/plan-story`](../plan-story/SKILL.md), in its own session. To implement, read the story id from the branch (`feature/197-mar-16-…` → `MAR-16`) and load -`context/domination/specs//index.md`, plus `context/dox/specs//index.md` if it exists. +`context/domination/specs//index.md` (`context/canary/specs//index.md` for `CNRY-*`), plus +`context/dox/specs//index.md` if it exists. For a story (category A), run `python3 .agents/skills/plan-story/scripts/plan_gate.py` first. On `FAIL`, stop and tell the owner to run `/plan-story`; never plan inline. diff --git a/.agents/skills/plan-story/SKILL.md b/.agents/skills/plan-story/SKILL.md index 355b9bcc8..371ec9be1 100644 --- a/.agents/skills/plan-story/SKILL.md +++ b/.agents/skills/plan-story/SKILL.md @@ -17,14 +17,14 @@ Planning ends with approved specs on disk. Implementation is a separate, fresh s - **`MAR-16`:** use it as given. Find the row: `grep -n '| MAR-16 ' context/domination/tracker.md` (a `DOX-*` id lives in -`context/dox/tracker.md`). Read the row only, not the whole tracker. If no row matches, stop and +`context/dox/tracker.md`, a `CNRY-*` id in `context/canary/tracker.md`). Read the row only, not the whole tracker. If no row matches, stop and ask the owner which story they mean. ## 2. Gate - Run `pnpm deps:ready`. If the story is not in the ready list, stop and report its `Blocked by`. - If the row's `Status` is `Done`, stop and say so. -- If `context/domination/specs//index.md` already exists, show its scope and ask the owner +- If `context/domination/specs//index.md` (`context/canary/specs//` for `CNRY-*`) already exists, show its scope and ask the owner whether to revise it or start over. Never overwrite a spec silently. ## 3. Route @@ -34,6 +34,7 @@ ask the owner which story they mean. | Realm story (`MAR-*`, `TRAN-*`, `INT-*`, `CORE-*`, …) | 4, then 5 | | `CORE-*` story that adds no function and whose work is the docs site (`CORE-86` … `CORE-88`) | 4 only, then `dox: none`. The writer is `dox-architect` for `apps/dox` work (`CORE-86`, `CORE-88`) and `architect` for the export step (`CORE-87`); skip 5, there is no tool | | `DOX-*` story | 5 only (skip the library index input) | +| `CNRY-*` story | 4 only, with every `context/domination/` path read as `context/canary/` (issue file, spec folder). A Dox page the story names is a slice of the same spec; `dox: none` unless it adds a Dox tool, then 5 | ## 4. Library spec — `architect` (Opus) diff --git a/.agents/skills/plan-story/scripts/plan_gate.py b/.agents/skills/plan-story/scripts/plan_gate.py index 22cdfed3f..72fc1fcd6 100755 --- a/.agents/skills/plan-story/scripts/plan_gate.py +++ b/.agents/skills/plan-story/scripts/plan_gate.py @@ -23,6 +23,7 @@ SLICE_LINE_BUDGET = 200 LIB_SPECS = "context/domination/specs" DOX_SPECS = "context/dox/specs" +CANARY_SPECS = "context/canary/specs" # /--...; a story id is letters, a dash, then a token holding a digit. BRANCH_RE = re.compile(r"^[a-z]+/\d+-([a-z]+-[a-z]*\d[a-z0-9]*)(?:-|$)") @@ -82,7 +83,8 @@ def check(root: Path, story: str) -> list[str]: if story.startswith("DOX-"): found, _ = check_spec(root, root / DOX_SPECS / story.lower() / "index.md", story) return found - found, fields = check_spec(root, root / LIB_SPECS / story / "index.md", story) + specs = CANARY_SPECS if story.startswith("CNRY-") else LIB_SPECS + found, fields = check_spec(root, root / specs / story / "index.md", story) if not fields: return found dox = fields.get("dox", "") diff --git a/.agents/skills/plan-story/scripts/test_plan_gate.py b/.agents/skills/plan-story/scripts/test_plan_gate.py index 9b1915f3b..cec47f7fe 100755 --- a/.agents/skills/plan-story/scripts/test_plan_gate.py +++ b/.agents/skills/plan-story/scripts/test_plan_gate.py @@ -46,6 +46,7 @@ def problems(root: Path, story: str = "FIX-1") -> list[str]: [ ("feature/197-mar-16-gpstoutc-utctogps", "MAR-16"), ("feature/289-dox-e1c-chat-tools", "DOX-E1C"), + ("feature/490-cnry-1-safari-icu", "CNRY-1"), ("fix/12-core-8-range-edges", "CORE-8"), ("feature/304-dox-three-intermodal-tools", None), ("main", None), @@ -110,6 +111,17 @@ def test_dox_story_uses_dox_specs_only(tmp_path: Path) -> None: assert problems(tmp_path, "DOX-E1C") == [] +def test_canary_story_uses_canary_specs(tmp_path: Path) -> None: + write(tmp_path, f"{LIB}/index.md", index()) + write(tmp_path, f"{LIB}/a.md", "slice\n") + assert any("context/canary/specs/CNRY-1/index.md" in p for p in problems(tmp_path, "CNRY-1")) + write(tmp_path, "context/canary/specs/CNRY-1/index.md", index(dox="")) + write(tmp_path, "context/canary/specs/CNRY-1/a.md", "slice\n") + assert any("no dox decision" in p for p in problems(tmp_path, "CNRY-1")) + write(tmp_path, "context/canary/specs/CNRY-1/index.md", index()) + assert problems(tmp_path, "CNRY-1") == [] + + def test_main_exit_codes(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: assert plan_gate.main(["FIX-1", "--root", str(tmp_path)]) == 1 assert "FAIL" in capsys.readouterr().out diff --git a/.github/workflows/temporal-oracle.yml b/.github/workflows/temporal-oracle.yml index 5d3ba8de9..67f271553 100644 --- a/.github/workflows/temporal-oracle.yml +++ b/.github/workflows/temporal-oracle.yml @@ -13,7 +13,8 @@ name: Temporal oracle # have filed in the job summary and files nothing. # # The native-suite job runs the whole packages/gmt suite on native Temporal in Node 26, -# Chromium, Firefox and WebKit, one matrix leg each. A failing leg means an untagged failure of either +# Chromium, Firefox, WebKit on Linux and WebKit on macOS (Apple's ICU and time zone data, the data +# Safari uses), one matrix leg each. A failing leg means an untagged failure of either # kind: a divergence (fails natively, passes on the polyfill in the same runtime) or a host # failure (fails on both) that no host group covers. The report job files it as an issue, one per # engine for divergences. @@ -122,12 +123,19 @@ jobs: native-suite: name: Native Temporal suite (${{ matrix.leg }}) - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} timeout-minutes: 45 strategy: fail-fast: false matrix: - leg: [node, chromium, firefox, webkit] + # macos-latest is free because the repository is public. It is a moving label on purpose: + # the webkit-macos leg tests the data Apple ships now, and its engine line names the macOS. + include: + - { leg: node, os: ubuntu-latest } + - { leg: chromium, browser: chromium, os: ubuntu-latest } + - { leg: firefox, browser: firefox, os: ubuntu-latest } + - { leg: webkit, browser: webkit, os: ubuntu-latest } + - { leg: webkit-macos, browser: webkit, os: macos-latest } steps: - uses: actions/checkout@v7 @@ -142,11 +150,24 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile --no-runtime - - name: Install Playwright ${{ matrix.leg }} + - name: Install Playwright ${{ matrix.browser }} if: matrix.leg != 'node' env: - LEG: ${{ matrix.leg }} - run: pnpm --filter @gmt/dox exec playwright install --with-deps "$LEG" + BROWSER: ${{ matrix.browser }} + run: | + if [ "$RUNNER_OS" = Linux ]; then + pnpm --filter @gmt/dox exec playwright install --with-deps "$BROWSER" + else + pnpm --filter @gmt/dox exec playwright install "$BROWSER" + fi + + # Shows which ICU Playwright's JavaScriptCore links, so each run's log names the data source. + # It never fails the job. + - name: Show the ICU WebKit links + if: runner.os == 'macOS' + run: | + find ~/Library/Caches/ms-playwright -path '*JavaScriptCore.framework/Versions/A/JavaScriptCore' \ + -exec otool -L {} \; | grep -iE 'icu|:$' || echo "JavaScriptCore not found or no ICU linked" - name: Build if: matrix.leg != 'node' @@ -158,14 +179,25 @@ jobs: env: LEG: ${{ matrix.leg }} run: | + avail_mib() { df -Pk "${TMPDIR:-/tmp}" | awk 'NR == 2 { print int($4 / 1024) }'; } + mem_mib() { + if command -v free >/dev/null 2>&1; then + free -m | awk '/^Mem:/ { print $7 }' + else + vm_stat | awk ' + /page size of/ { size = $8 } + /^Pages (free|inactive|speculative):/ { gsub(/\./, "", $NF); pages += $NF } + END { print int(pages * size / 1048576) }' + fi + } if [ "$LEG" != node ]; then ( while true; do printf 'resources %s: %s MiB free under %s, %s MiB memory available\n' \ "$(date -u +%H:%M:%S)" \ - "$(($(df --output=avail -k "${TMPDIR:-/tmp}" | tail -1) / 1024))" \ + "$(avail_mib)" \ "${TMPDIR:-/tmp}" \ - "$(free -m | awk '/^Mem:/ { print $7 }')" + "$(mem_mib)" sleep 15 done ) & diff --git a/AGENTS.md b/AGENTS.md index 151941dd7..d233990ef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,6 +20,7 @@ Read these before working in the repo. Each is scoped — load only what you nee | [context/linting-packages.md](./context/linting-packages.md) | When working on gmt-eslint, gmt-oxlint, or gmt-biome | | [context/dox/index.md](./context/dox/index.md) | When working on the `apps/dox` documentation site (the Dox epic) | | [context/domination/index.md](./context/domination/index.md) | When picking up any epic story — check `Blocked by` in its tracker first | +| [context/canary/index.md](./context/canary/index.md) | When working on a canary (scheduled checks that file issues) or a `CNRY-*` story | ## Git — Only on an Explicit Instruction diff --git a/apps/dox/package.json b/apps/dox/package.json index 4f7404bca..191d0cd74 100644 --- a/apps/dox/package.json +++ b/apps/dox/package.json @@ -6,7 +6,7 @@ "license": "UNLICENSED", "type": "module", "scripts": { - "generate": "node ../../scripts/upstream.mjs refresh && node ./scripts/generate-version-map.mjs && tsx ./scripts/build-reference.ts && node ./scripts/build-guides.mjs && node ./scripts/build-changelog.mjs && node ./scripts/build-scenario-index.mjs && tsx ./scripts/build-tool-index.ts && tsx ./scripts/build-industry-pages.ts && tsx ./scripts/build-industry-sidebars.ts && node ./scripts/ensure-sidebar-order.mjs && node ../../scripts/bundle-size.mjs report --json src/generated/bundle-size.json && tsx ./scripts/build-corpus-counts.ts", + "generate": "node ../../scripts/upstream.mjs refresh && node ./scripts/generate-version-map.mjs && node ../../scripts/syntax-floor.mjs --ts src/generated/syntax-floor.ts && tsx ./scripts/build-reference.ts && node ./scripts/build-guides.mjs && node ./scripts/build-changelog.mjs && node ./scripts/build-scenario-index.mjs && tsx ./scripts/build-tool-index.ts && tsx ./scripts/build-industry-pages.ts && tsx ./scripts/build-industry-sidebars.ts && node ./scripts/ensure-sidebar-order.mjs && node ../../scripts/bundle-size.mjs report --json src/generated/bundle-size.json && tsx ./scripts/build-corpus-counts.ts", "predev": "pnpm --filter @northguild/gmt build:dev", "dev": "pnpm run generate && node ./scripts/dev-all.mjs", "predev:site": "pnpm --filter @northguild/gmt build:dev", diff --git a/apps/dox/scripts/browser-support-built.test.ts b/apps/dox/scripts/browser-support-built.test.ts new file mode 100644 index 000000000..1b3152cee --- /dev/null +++ b/apps/dox/scripts/browser-support-built.test.ts @@ -0,0 +1,59 @@ +import { readdirSync, readFileSync } from "node:fs"; +import { join, resolve } from "node:path"; + +import { syntaxFloor } from "../src/generated/syntax-floor"; +import { gmtNodeEngines } from "../src/generated/versions"; +import { distDirOrSkip } from "./dist-dir"; + +/** + * On the built site: the figures the Browser support page states reach its HTML + * as values. MDX does not evaluate an expression inside a backtick span, so a figure written as + * `{gmtNodeEngines}` in code ticks ships its braces. Needs a build; returns early without one and + * throws under `DOX_DIST_REQUIRED`. + */ + +/** Every built `.html` page under `dist/gmt`. */ +function builtHtml(root: string): string[] { + return (readdirSync(root, { recursive: true }) as string[]) + .filter((f) => f.endsWith(".html")) + .map((f) => join(root, f)); +} + +/** Text of the page's `
`, tags removed. */ +function mainText(html: string): string { + const main = html.match(//)?.[0] ?? ""; + return main + .replace(/<[^>]*>/g, " ") + .replace(/>|>/g, ">") + .replace(/<|</g, "<") + .replace(/\s+/g, " "); +} + +describe("browser support page, built", () => { + const dist = distDirOrSkip(); + + it("shows the generated Node range and syntax figures, and no literal expression", () => { + if (dist === null) return; + const html = readFileSync( + resolve(dist, "gmt", "browser-support", "index.html"), + "utf8", + ); + const text = mainText(html); + expect(text).toMatch( + new RegExp( + `says ${gmtNodeEngines.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*\\.`, + ), + ); + expect(text).toContain(`edition ${syntaxFloor.edition} (ES modules)`); + expect(text).toContain(`all ${syntaxFloor.entries} entry points`); + expect(text).not.toMatch(/\{[A-Za-z_][\w.]*\}/); + }); + + it("no built page shows a bare expression in a code span, such as {gmtNodeEngines}", () => { + if (dist === null) return; + const hits = builtHtml(resolve(dist, "gmt")).filter((file) => + /]*>\{[A-Za-z_][\w.]*\}<\/code>/.test(readFileSync(file, "utf8")), + ); + expect(hits).toEqual([]); + }); +}); diff --git a/apps/dox/scripts/canary/canary-issues.test.ts b/apps/dox/scripts/canary/canary-issues.test.ts index 2c77e3c99..3c8b28b7a 100644 --- a/apps/dox/scripts/canary/canary-issues.test.ts +++ b/apps/dox/scripts/canary/canary-issues.test.ts @@ -3,6 +3,8 @@ import { createHash } from "node:crypto"; import { CANARY_LABEL, DRY_RUN_LABEL, + NATIVE_LEGS as DERIVED_NATIVE_LEGS, + SWAP_LEGS as DERIVED_SWAP_LEGS, SWAP_SOURCES, WORKFLOW_SOURCES, applyForce, @@ -72,17 +74,21 @@ const check = (workarounds: Workaround[], current = true) => ({ workarounds, }); -const BROWSER_LEGS = ["chromium", "firefox", "webkit"] as const; +/** The macOS WebKit leg's engine line, as its verdicts print it. */ +const MACOS_ENGINE = "macOS WebKit 26.6 \u00b7 macOS 15.7.2"; +const BROWSER_LEGS = ["chromium", "firefox", "webkit", "webkit-macos"] as const; type BrowserLeg = (typeof BROWSER_LEGS)[number]; const BROWSER_ENGINE_IDS: Record = { chromium: "v8", firefox: "firefox", webkit: "webkit", + "webkit-macos": "webkit", }; const BROWSER_ENGINES: Record = { chromium: "Chromium 153.0.8010.12", firefox: "Firefox 155.0", webkit: "WebKit 26.6", + "webkit-macos": "macOS WebKit 26.6 \u00b7 macOS 15.7.2", }; /** The same probes run in one browser of the native suite: no snapshot, the browser's engine. */ @@ -108,9 +114,9 @@ const everywhere = (workarounds: Workaround[], current = true) => ({ ), }); -/** The four engines' names in the order the compat sources run, as the bodies list them. */ +/** The five engines' names in the order the compat sources run, as the bodies list them. */ const EVERY_ENGINE = - "Node v24.11.0, Chromium 153.0.8010.12, Firefox 155.0, WebKit 26.6"; + "Node v24.11.0, Chromium 153.0.8010.12, Firefox 155.0, WebKit 26.6, macOS WebKit 26.6 \u00b7 macOS 15.7.2"; const mismatchRow = (n: number, over: Record = {}) => ({ scan: "grid", @@ -177,12 +183,19 @@ const cleanCheck = () => workaround("D10", "guard", { guard: { ...GUARD, lapsed: false } }), ]); -const NATIVE_LEGS = ["node", "chromium", "firefox", "webkit"] as const; +const NATIVE_LEGS = [ + "node", + "chromium", + "firefox", + "webkit", + "webkit-macos", +] as const; const ENGINES = { node: "Node v26.10.0 · V8 14.6.202.34-node.34 · ICU 78.3 · tz 2026c", chromium: "Chromium 153.0.8010.12", firefox: "Firefox 155.0", webkit: "WebKit 26.6", + "webkit-macos": "macOS WebKit 26.6 \u00b7 macOS 15.7.2", }; interface NativeOptions { @@ -247,7 +260,7 @@ const native = ( staleTags, }); -/** The four legs, all clean. */ +/** Every native-suite leg, all clean. */ const cleanNative = () => Object.fromEntries( NATIVE_LEGS.map((leg) => [`native-suite-${leg}`, native(leg)]), @@ -442,11 +455,13 @@ describe("constants and marker", () => { "temporal-compat-chromium", "temporal-compat-firefox", "temporal-compat-webkit", + "temporal-compat-webkit-macos", "temporal-oracle", "native-suite-node", "native-suite-chromium", "native-suite-firefox", "native-suite-webkit", + "native-suite-webkit-macos", "temporal-polyfill-swap-node", "temporal-polyfill-swap-chromium", "temporal-polyfill-swap-firefox", @@ -568,7 +583,8 @@ describe("removable body", () => { "| temporal-compat-check | Node v24.11.0 | removable | 2 of 2 pass |\n" + "| temporal-compat-chromium | Chromium 153.0.8010.12 | removable | 2 of 2 pass |\n" + "| temporal-compat-firefox | Firefox 155.0 | removable | 2 of 2 pass |\n" + - "| temporal-compat-webkit | WebKit 26.6 | removable | 2 of 2 pass |\n\n" + + "| temporal-compat-webkit | WebKit 26.6 | removable | 2 of 2 pass |\n" + + `| temporal-compat-webkit-macos | ${MACOS_ENGINE} | removable | 2 of 2 pass |\n\n` + "### Removal steps", ); }); @@ -713,6 +729,7 @@ describe("removable on every engine in scope", () => { ["temporal-compat-chromium", true, "removable"], ["temporal-compat-firefox", true, "still-needed"], ["temporal-compat-webkit", true, "removable"], + ["temporal-compat-webkit-macos", true, "removable"], ]); }); @@ -792,6 +809,7 @@ describe("removable on every engine in scope", () => { ["temporal-compat-chromium", false, "out-of-scope"], ["temporal-compat-firefox", true, "removable"], ["temporal-compat-webkit", false, "still-needed"], + ["temporal-compat-webkit-macos", false, "out-of-scope"], ]); }); @@ -1026,6 +1044,7 @@ describe("could not run", () => { "- **temporal-compat-chromium**: no verdict file: an earlier step or job failed\n" + "- **temporal-compat-firefox**: no verdict file: an earlier step or job failed\n" + "- **temporal-compat-webkit**: no verdict file: an earlier step or job failed\n" + + "- **temporal-compat-webkit-macos**: no verdict file: an earlier step or job failed\n" + "- **temporal-oracle**: no Temporal\n", ); }); @@ -1174,7 +1193,7 @@ describe("applyForce and forced findings", () => { "**Dry run.** Forced by a manual dispatch (--force-removable=D2); nothing here is a real finding. Close this issue once checked.", ); expect(action.body).toContain( - "Forced removable for a dry run. Real state on this run: still needed (2 of 2 probes fail) on Node v24.11.0; still needed (2 of 2 probes fail) on Chromium 153.0.8010.12; still needed (2 of 2 probes fail) on Firefox 155.0; still needed (2 of 2 probes fail) on WebKit 26.6.", + "Forced removable for a dry run. Real state on this run: still needed (2 of 2 probes fail) on Node v24.11.0; still needed (2 of 2 probes fail) on Chromium 153.0.8010.12; still needed (2 of 2 probes fail) on Firefox 155.0; still needed (2 of 2 probes fail) on WebKit 26.6; still needed (2 of 2 probes fail) on macOS WebKit 26.6 \u00b7 macOS 15.7.2.", ); expect(action.body).toContain( "| temporal-compat-check | Node v24.11.0 | still needed (2 of 2 probes fail) | 0 of 2 pass |", @@ -1201,7 +1220,7 @@ describe("applyForce and forced findings", () => { "temporal-oracle/could-not-run", ]); expect(actions[0].body).toContain( - "Real state on this run: still needed (2 of 2 probes fail) on Node v24.11.0; removable on Chromium 153.0.8010.12; no verdict (the compat page failed in firefox: boom) on temporal-compat-firefox; removable on WebKit 26.6.", + "Real state on this run: still needed (2 of 2 probes fail) on Node v24.11.0; removable on Chromium 153.0.8010.12; no verdict (the compat page failed in firefox: boom) on temporal-compat-firefox; removable on WebKit 26.6; removable on macOS WebKit 26.6 \u00b7 macOS 15.7.2.", ); expect(actions[0].body).toContain( "| temporal-compat-firefox | — | no verdict (the compat page failed in firefox: boom) | — |", @@ -1220,7 +1239,7 @@ describe("applyForce and forced findings", () => { ); const [action] = forcedOpen(verdicts); expect(action.body).toContain( - "Real state on this run: guard on Node v24.11.0; guard on Chromium 153.0.8010.12; guard on Firefox 155.0; guard on WebKit 26.6.", + "Real state on this run: guard on Node v24.11.0; guard on Chromium 153.0.8010.12; guard on Firefox 155.0; guard on WebKit 26.6; guard on macOS WebKit 26.6 \u00b7 macOS 15.7.2.", ); }); @@ -1961,7 +1980,7 @@ describe("native suite findings", () => { ${HOST_KEY} ${CONTROL_KEY} `( - "body size: 4 legs of 50 rows with 300-character messages stay under 65,536 for $key, every leg cut to the same count", + "body size: 5 legs of 50 rows with 300-character messages stay under 65,536 for $key, every leg cut to the same count", ({ key }) => { const message = "m".repeat(300); const options = optionsOf(key, message); @@ -1971,14 +1990,15 @@ describe("native suite findings", () => { chromium: native("chromium", options), firefox: native("firefox", options), webkit: native("webkit", options), + "webkit-macos": native("webkit-macos", options), }), key, ); const shown = finding.body.match(/m{300}/g)?.length ?? 0; expect(shown).toBeGreaterThan(0); expect(shown).toBeLessThan(200); - expect(shown % 4).toBe(0); - const perLeg = shown / 4; + expect(shown % NATIVE_LEGS.length).toBe(0); + const perLeg = shown / NATIVE_LEGS.length; for (const engine of Object.values(ENGINES)) { expect(finding.body).toContain(`### ${engine} (first ${perLeg} of 60)`); } @@ -1992,7 +2012,7 @@ describe("native suite findings", () => { ${HOST_KEY} ${CONTROL_KEY} `( - "body size: 4 legs of 60 rows with 365-character names and 300-character messages stay under 65,536 for $key", + "body size: 5 legs of 60 rows with 365-character names and 300-character messages stay under 65,536 for $key", ({ key }) => { const longName = ( leg: (typeof NATIVE_LEGS)[number], @@ -2019,6 +2039,7 @@ describe("native suite findings", () => { chromium: longName("chromium", options), firefox: longName("firefox", options), webkit: longName("webkit", options), + "webkit-macos": longName("webkit-macos", options), }), key, ); @@ -2029,10 +2050,13 @@ describe("native suite findings", () => { ); expect(finding.body).toMatch(/### Firefox 155.0 \(first \d+ of 60\)/); expect(finding.body).toMatch(/### WebKit 26.6 \(first \d+ of 60\)/); + expect(finding.body).toMatch( + /### macOS WebKit 26.6 \u00b7 macOS 15.7.2 \(first \d+ of 60\)/, + ); }, ); - it("body size: 4 legs of 60 rows with 365-character names give four untagged findings, each under 65,536 with one section", () => { + it("body size: 5 legs of 60 rows with 365-character names give five untagged findings, each under 65,536 with one section", () => { const longName = (leg: (typeof NATIVE_LEGS)[number]) => { const v = native(leg, { untagged: 60, message: "m".repeat(300) }); return { @@ -2049,6 +2073,7 @@ describe("native suite findings", () => { chromium: longName("chromium"), firefox: longName("firefox"), webkit: longName("webkit"), + "webkit-macos": longName("webkit-macos"), }); for (const leg of NATIVE_LEGS) { const [finding] = only(verdicts, failureKey(leg)); @@ -2827,3 +2852,166 @@ describe("shortenRepeats", () => { ]); }); }); + +describe("the macOS WebKit leg", () => { + it("is one list of legs, with the swap check on four", () => { + expect(DERIVED_NATIVE_LEGS).toEqual([ + "node", + "chromium", + "firefox", + "webkit", + "webkit-macos", + ]); + expect(DERIVED_SWAP_LEGS).toEqual([ + "node", + "chromium", + "firefox", + "webkit", + ]); + }); + + it.each` + engine | label + ${"Node v26.12.1 \u00b7 V8 14.6.1 \u00b7 ICU 78.3 \u00b7 tz 2026e"} | ${"Node 26"} + ${"Chromium 153.0.8010.12"} | ${"Chromium 153"} + ${"WebKit 26.6"} | ${"WebKit 26"} + ${"macOS WebKit 26.6 \u00b7 macOS 15.7.2"} | ${"macOS WebKit 26"} + `( + "the engine line '$engine' titles the issue '$label'", + ({ engine, label }) => { + const leg = engine.startsWith("macOS") ? "webkit-macos" : "webkit"; + const [f] = findings( + withLegs({ [leg]: { ...native(leg, { untagged: 1 }), engine } }), + ORACLE_CONTEXT, + ); + expect(f.title).toBe(`Native Temporal: GMT tests fail on ${label}`); + }, + ); + + it("an engine line with no version titles the issue with the leg name", () => { + const [f] = findings( + withLegs({ + "webkit-macos": { + ...native("webkit-macos", { untagged: 1 }), + engine: "(no version)", + }, + }), + ORACLE_CONTEXT, + ); + expect(f.title).toBe("Native Temporal: GMT tests fail on webkit-macos"); + }); + + it("keys the two WebKit legs apart: separate issues, titled by their own label", () => { + const found = findings( + withLegs({ + webkit: native("webkit", { untagged: 1 }), + "webkit-macos": native("webkit-macos", { untagged: 1 }), + }), + ORACLE_CONTEXT, + ).filter((f) => f.key.startsWith("native-suite/untagged-failure/")); + expect(found.map((f) => [f.key, f.title])).toEqual([ + [ + "native-suite/untagged-failure/webkit", + "Native Temporal: GMT tests fail on WebKit 26", + ], + [ + "native-suite/untagged-failure/webkit-macos", + "Native Temporal: GMT tests fail on macOS WebKit 26", + ], + ]); + }); + + it.each` + key | title + ${HOST_KEY} | ${"Native suite: tests fail on both engines in WebKit 26, macOS WebKit 26"} + ${CONTROL_KEY} | ${"Native suite: tests fail only on the polyfill in WebKit 26, macOS WebKit 26"} + `( + "the $key title lists both WebKit labels when both legs have rows", + ({ key, title }) => { + const options = optionsOf(key, "m"); + const [f] = findings( + withLegs({ + webkit: native("webkit", options), + "webkit-macos": native("webkit-macos", options), + }), + ORACLE_CONTEXT, + ).filter((x) => x.key === key); + expect(f.title).toBe(title); + }, + ); + + it("a missing native-suite-webkit-macos verdict is a could-not-run line, and nothing else", () => { + const verdicts = { + ...(withLegs({}) as object), + "native-suite-webkit-macos": null, + }; + const [f] = findings(verdicts as never, ORACLE_CONTEXT); + expect(f.key).toBe("temporal-oracle/could-not-run"); + expect(f.body).toContain( + "- **native-suite-webkit-macos**: no verdict file: an earlier step or job failed\n", + ); + expect(f.body).not.toContain("**native-suite-webkit**"); + }); +}); + +describe("workarounds scoped to WebKit, with two WebKit legs", () => { + const d18 = (state: State) => + workaround("D18", state, { engines: ["webkit"] }); + const states = (verdicts: unknown) => + compatStates(verdicts as never).map((s) => [s.everywhere]); + + it("D18 removable on webkit but no webkit-macos verdict: not removable", () => { + const verdicts = { + ...everywhere([d18("removable")]), + "temporal-compat-webkit-macos": null, + "temporal-oracle": oracle(), + }; + expect(states(verdicts)).toEqual([[false]]); + expect(plan(verdicts).map((a) => a.key)).not.toContain( + "temporal-compat/removable/D18", + ); + }); + + it("D18 removable on webkit, still needed on webkit-macos: not removable", () => { + const verdicts = { + ...everywhere([d18("removable")]), + "temporal-compat-webkit-macos": browserCompat("webkit-macos", [ + d18("still-needed"), + ]), + "temporal-oracle": oracle(), + }; + expect(states(verdicts)).toEqual([[false]]); + }); + + it("D18 removable on both WebKit legs, out of scope elsewhere: removable everywhere", () => { + const verdicts = { + ...everywhere([d18("out-of-scope")]), + "temporal-compat-webkit": browserCompat("webkit", [d18("removable")]), + "temporal-compat-webkit-macos": browserCompat("webkit-macos", [ + d18("removable"), + ]), + "temporal-oracle": oracle(), + }; + expect(states(verdicts)).toEqual([[true]]); + }); + + it("D16 with no engines needs all five compat sources", () => { + const d16 = (state: State) => workaround("D16", state); + const verdicts = { + ...everywhere([d16("removable")]), + "temporal-oracle": oracle(), + }; + expect(states(verdicts)).toEqual([[true]]); + const [row] = compatStates(verdicts as never); + expect(row.engines.map((e) => e.source)).toEqual([ + "temporal-compat-check", + "temporal-compat-chromium", + "temporal-compat-firefox", + "temporal-compat-webkit", + "temporal-compat-webkit-macos", + ]); + expect( + states({ ...verdicts, "temporal-compat-webkit-macos": null }), + ).toEqual([[false]]); + }); +}); diff --git a/apps/dox/scripts/canary/canary-report.test.ts b/apps/dox/scripts/canary/canary-report.test.ts index 97a22dbf3..ef5e4d9a8 100644 --- a/apps/dox/scripts/canary/canary-report.test.ts +++ b/apps/dox/scripts/canary/canary-report.test.ts @@ -449,6 +449,7 @@ describe("main", () => { chromium: "v8", firefox: "firefox", webkit: "webkit", + "webkit-macos": "webkit", }; const browserCompatVerdict = ( leg: string, @@ -603,13 +604,19 @@ describe("main", () => { } }; const writeNativeFiles = () => { - for (const leg of ["node", "chromium", "firefox", "webkit"]) { + for (const leg of [ + "node", + "chromium", + "firefox", + "webkit", + "webkit-macos", + ]) { write(`native-suite-${leg}.json`, nativeVerdict(leg)); } }; - /** The three browsers' compat verdicts, the same rows as the Node check. */ + /** The four browsers' compat verdicts, the same rows as the Node check. */ const writeCompatFiles = (workarounds?: ReturnType[]) => { - for (const leg of ["chromium", "firefox", "webkit"]) { + for (const leg of ["chromium", "firefox", "webkit", "webkit-macos"]) { write( `temporal-compat-${leg}.json`, browserCompatVerdict(leg, workarounds), @@ -735,6 +742,24 @@ describe("main", () => { ); }); + it("a run with no webkit-macos artifacts lists both of its sources as could-not-run", () => { + writeOracleFiles(); + rmSync(join(root, "artifacts", "native-suite-webkit-macos.json")); + rmSync(join(root, "artifacts", "temporal-compat-webkit-macos.json")); + const { code, out } = run(["temporal-oracle", "--print"]); + expect(code).toBe(0); + const actions = JSON.parse(out.slice(out.indexOf("[\n"))); + expect(actions).toHaveLength(1); + expect(actions[0].key).toBe("temporal-oracle/could-not-run"); + expect(actions[0].body).toContain( + "- **temporal-compat-webkit-macos**: no verdict file: an earlier step or job failed", + ); + expect(actions[0].body).toContain( + "- **native-suite-webkit-macos**: no verdict file: an earlier step or job failed", + ); + expect(actions[0].body).not.toContain("polyfill-swap-webkit-macos"); + }); + it("a missing swap verdict file is listed as no verdict", () => { writeOracleFiles(); rmSync(join(root, "artifacts", "temporal-polyfill-swap-webkit.json")); diff --git a/apps/dox/scripts/canary/canary-summary.test.ts b/apps/dox/scripts/canary/canary-summary.test.ts index 8ee0b2c99..633d937ed 100644 --- a/apps/dox/scripts/canary/canary-summary.test.ts +++ b/apps/dox/scripts/canary/canary-summary.test.ts @@ -56,6 +56,7 @@ const BROWSER_ENGINE_IDS: Record = { chromium: "v8", firefox: "firefox", webkit: "webkit", + "webkit-macos": "webkit", }; /** The compat check's verdict in one browser: the same probes, no snapshot. */ @@ -76,7 +77,7 @@ const compat = ( const cleanCompat = () => Object.fromEntries( - ["chromium", "firefox", "webkit"].map((leg) => [ + ["chromium", "firefox", "webkit", "webkit-macos"].map((leg) => [ `temporal-compat-${leg}`, compat(leg, [guardWorkaround], { stillNeeded: 15, @@ -93,7 +94,7 @@ const compatEverywhere = ( ) => ({ "temporal-compat-check": check(workarounds, counts), ...Object.fromEntries( - ["chromium", "firefox", "webkit"].map((leg) => [ + ["chromium", "firefox", "webkit", "webkit-macos"].map((leg) => [ `temporal-compat-${leg}`, compat(leg, workarounds, counts), ]), @@ -135,6 +136,7 @@ const ENGINES: Record = { chromium: "Chromium 153.0.8010.12", firefox: "Firefox 155.0", webkit: "WebKit 26.6", + "webkit-macos": "macOS WebKit 26.6 \u00b7 macOS 15.7.2", }; const native = (leg: string, over: Record = {}) => ({ @@ -171,6 +173,7 @@ const cleanNative = () => ({ "native-suite-chromium": native("chromium"), "native-suite-firefox": native("firefox"), "native-suite-webkit": native("webkit"), + "native-suite-webkit-macos": native("webkit-macos"), }); const swapSweep = (differingZones = 0) => ({ @@ -285,6 +288,7 @@ const CLEAN_SUMMARY = [ "| temporal-compat-chromium | Chromium 153.0.8010.12 (v8) | 15 | 0 | 1 | 0 |", "| temporal-compat-firefox | Firefox 155.0 (firefox) | 15 | 0 | 1 | 0 |", "| temporal-compat-webkit | WebKit 26.6 (webkit) | 15 | 0 | 1 | 0 |", + "| temporal-compat-webkit-macos | macOS WebKit 26.6 \u00b7 macOS 15.7.2 (webkit) | 15 | 0 | 1 | 0 |", "", "| Oracle | Count |", "| --- | --- |", @@ -303,6 +307,7 @@ const CLEAN_SUMMARY = [ "| chromium | Chromium 153.0.8010.12 | 61613 | 61600 | 3 | 0 | 0 | 0 | 0 | 0 |", "| firefox | Firefox 155.0 | 61613 | 61600 | 3 | 0 | 0 | 0 | 0 | 0 |", "| webkit | WebKit 26.6 | 61613 | 61600 | 3 | 0 | 0 | 0 | 0 | 0 |", + "| webkit-macos | macOS WebKit 26.6 \u00b7 macOS 15.7.2 | 61613 | 61600 | 3 | 0 | 0 | 0 | 0 | 0 |", "", ...SWAP_BLOCK, "", @@ -315,6 +320,27 @@ describe("summaryMarkdown: temporal-oracle", () => { expect(oracleSummary(clean())).toBe(CLEAN_SUMMARY); }); + it("every native and swap source ran: five native rows, five compat rows, four swap rows, no swap row for webkit-macos", () => { + const lines = oracleSummary(clean()).split("\n"); + const rowsOf = (prefix: string) => + lines.filter((l) => l.startsWith(prefix)); + expect( + lines.filter( + (l) => + /^\| (node|chromium|firefox|webkit|webkit-macos) \| .* \| 61613 \|/.test( + l, + ) && l.includes("| 61600 |"), + ), + ).toHaveLength(5); + expect(rowsOf("| temporal-compat-")).toHaveLength(5); + expect( + lines + .filter((l) => /^\| \S+ \| 71337 \|/.test(l)) + .map((l) => l.split(" | ")[0]), + ).toEqual(["| node", "| chromium", "| firefox", "| webkit"]); + expect(lines.join("\n")).not.toContain("did not run"); + }); + it("a leg that could not run is a row with the message and empty counts", () => { const text = oracleSummary({ ...clean(), @@ -445,7 +471,7 @@ describe("summaryMarkdown: temporal-oracle", () => { const lines = oracleSummary(verdicts).split("\n"); expect(lines).not.toContain("Removable on every engine in scope: D2"); expect(lines).toContain( - "Removable on some engines only: D2 (Node v24.11.0: removable; Chromium 153.0.8010.12: still needed, 2 of 2 probes fail; temporal-compat-firefox: no verdict; temporal-compat-webkit: no verdict)", + "Removable on some engines only: D2 (Node v24.11.0: removable; Chromium 153.0.8010.12: still needed, 2 of 2 probes fail; temporal-compat-firefox: no verdict; temporal-compat-webkit: no verdict; temporal-compat-webkit-macos: no verdict)", ); expect(lines).toContain( "| temporal-compat-firefox | could not run — the compat page failed in firefox: boom | — | — | — | — |", @@ -453,6 +479,9 @@ describe("summaryMarkdown: temporal-oracle", () => { expect(lines).toContain( "| temporal-compat-webkit | could not run — no verdict file: an earlier step or job failed | — | — | — | — |", ); + expect(lines).toContain( + "| temporal-compat-webkit-macos | could not run — no verdict file: an earlier step or job failed | — | — | — | — |", + ); }); it("a Firefox-only group removable on Firefox and out of scope elsewhere is removable on every engine in scope", () => { @@ -482,6 +511,12 @@ describe("summaryMarkdown: temporal-oracle", () => { guard: 0, outOfScope: 1, }), + "temporal-compat-webkit-macos": compat("webkit-macos", [elsewhere], { + stillNeeded: 15, + removable: 0, + guard: 0, + outOfScope: 1, + }), "temporal-oracle": oracle(), }; const lines = oracleSummary(verdicts).split("\n"); @@ -521,6 +556,12 @@ describe("summaryMarkdown: temporal-oracle", () => { removable: 0, guard: 0, }), + "temporal-compat-webkit-macos": compat("webkit-macos", [elsewhere], { + stillNeeded: 15, + removable: 0, + guard: 0, + outOfScope: 1, + }), "temporal-oracle": oracle(), }; const lines = oracleSummary(verdicts).split("\n"); diff --git a/apps/dox/scripts/canary/canary-verdict.test.ts b/apps/dox/scripts/canary/canary-verdict.test.ts index 7109fbead..8aaf3ad7a 100644 --- a/apps/dox/scripts/canary/canary-verdict.test.ts +++ b/apps/dox/scripts/canary/canary-verdict.test.ts @@ -520,12 +520,15 @@ describe("VERDICT_FILES", () => { "temporal-compat-chromium": "artifacts/temporal-compat-chromium.json", "temporal-compat-firefox": "artifacts/temporal-compat-firefox.json", "temporal-compat-webkit": "artifacts/temporal-compat-webkit.json", + "temporal-compat-webkit-macos": + "artifacts/temporal-compat-webkit-macos.json", "temporal-oracle": "artifacts/temporal-oracle-verdict.json", "leap-seconds": "artifacts/leap-seconds.json", "native-suite-node": "artifacts/native-suite-node.json", "native-suite-chromium": "artifacts/native-suite-chromium.json", "native-suite-firefox": "artifacts/native-suite-firefox.json", "native-suite-webkit": "artifacts/native-suite-webkit.json", + "native-suite-webkit-macos": "artifacts/native-suite-webkit-macos.json", "temporal-polyfill-swap-node": "artifacts/temporal-polyfill-swap-node.json", "temporal-polyfill-swap-chromium": diff --git a/apps/dox/scripts/canary/native-suite-compat.test.ts b/apps/dox/scripts/canary/native-suite-compat.test.ts index 5f4cce449..9002af6c4 100644 --- a/apps/dox/scripts/canary/native-suite-compat.test.ts +++ b/apps/dox/scripts/canary/native-suite-compat.test.ts @@ -14,7 +14,11 @@ import { compatFile, compatPage, compatPaths, + engineLine, groupResults, + hostProblem, + LEG_BROWSER, + LEG_HOST, runBrowserCompat, } from "../../../../scripts/lib/native-suite-compat.mjs"; import { @@ -282,10 +286,22 @@ describe("runBrowserCompat with a fake browser", () => { }, close: async () => log.push({ close: true }), }; - const launcher = { launch: async () => browser }; + /** The browser types launched, in order: proves which Playwright browser a leg asked for. */ + const launched: string[] = []; + const launcher = (name: string) => ({ + launch: async () => { + launched.push(name); + return browser; + }, + }); return { log, - module: { chromium: launcher, firefox: launcher, webkit: launcher }, + launched, + module: { + chromium: launcher("chromium"), + firefox: launcher("firefox"), + webkit: launcher("webkit"), + }, route: (pathname: string) => { const fulfilled: Record[] = []; if (!handler) throw new Error("no route was registered"); @@ -343,7 +359,33 @@ describe("runBrowserCompat with a fake browser", () => { chromium: "Chromium", firefox: "Firefox", webkit: "WebKit", + "webkit-macos": "macOS WebKit", + }); + }); + + it("launches the webkit browser type for webkit-macos and labels the verdict macOS WebKit", async () => { + const fake = fakePlaywright({ results: everyProbe() }); + const verdict = await runBrowserCompat("webkit-macos", root, { + playwright: async () => fake.module, + osVersion: () => "15.7.2", }); + expect(fake.launched).toEqual(["webkit"]); + expect(verdict).toMatchObject({ + source: "temporal-compat-webkit-macos", + leg: "webkit-macos", + engine: "macOS WebKit 1.2.3 \u00b7 macOS 15.7.2", + engineId: "webkit", + }); + }); + + it("launches each other leg's own browser type", async () => { + const fake = fakePlaywright({ results: everyProbe() }); + for (const leg of ["chromium", "firefox", "webkit"] as const) { + await runBrowserCompat(leg, root, { + playwright: async () => fake.module, + }); + } + expect(fake.launched).toEqual(["chromium", "firefox", "webkit"]); }); it("answers the page at /, a dist file from disk, and 404 for anything else", async () => { @@ -414,3 +456,47 @@ describe("runBrowserCompat with a fake browser", () => { expect(loaded).toBe(false); }); }); + +describe("LEG_BROWSER and LEG_HOST", () => { + it("maps both WebKit legs to the webkit browser and project, every other leg to itself", () => { + expect(LEG_BROWSER).toEqual({ + chromium: "chromium", + firefox: "firefox", + webkit: "webkit", + "webkit-macos": "webkit", + }); + }); + + it("pins the two WebKit legs to their host OS and leaves the rest free", () => { + expect(LEG_HOST).toEqual({ webkit: "linux", "webkit-macos": "darwin" }); + }); +}); + +describe("hostProblem", () => { + it.each` + leg | platform | problem + ${"webkit"} | ${"linux"} | ${null} + ${"webkit"} | ${"darwin"} | ${"webkit runs on Linux; this host is darwin"} + ${"webkit-macos"} | ${"darwin"} | ${null} + ${"webkit-macos"} | ${"linux"} | ${"webkit-macos runs on macOS; this host is linux"} + ${"webkit-macos"} | ${"win32"} | ${"webkit-macos runs on macOS; this host is win32"} + ${"chromium"} | ${"darwin"} | ${null} + ${"firefox"} | ${"linux"} | ${null} + ${"node"} | ${"win32"} | ${null} + `("'$leg' on '$platform': $problem", ({ leg, platform, problem }) => { + expect(hostProblem(leg, platform)).toBe(problem); + }); +}); + +describe("engineLine", () => { + it.each` + leg | version | os | line + ${"webkit-macos"} | ${"26.6"} | ${"15.7.2"} | ${"macOS WebKit 26.6 \u00b7 macOS 15.7.2"} + ${"webkit-macos"} | ${"26.6"} | ${null} | ${"macOS WebKit 26.6"} + ${"webkit"} | ${"26.6"} | ${null} | ${"WebKit 26.6"} + ${"chromium"} | ${"153.0.1"} | ${null} | ${"Chromium 153.0.1"} + ${"firefox"} | ${"155.0"} | ${null} | ${"Firefox 155.0"} + `("'$leg' '$version' with OS $os: $line", ({ leg, version, os, line }) => { + expect(engineLine(leg, version, os)).toBe(line); + }); +}); diff --git a/apps/dox/scripts/canary/native-suite-run-pass.test.ts b/apps/dox/scripts/canary/native-suite-run-pass.test.ts index d82de891a..db441884c 100644 --- a/apps/dox/scripts/canary/native-suite-run-pass.test.ts +++ b/apps/dox/scripts/canary/native-suite-run-pass.test.ts @@ -74,6 +74,23 @@ describe("runPass", () => { }, ); + it.each` + leg | project + ${"chromium"} | ${"chromium"} + ${"firefox"} | ${"firefox"} + ${"webkit"} | ${"webkit"} + ${"webkit-macos"} | ${"webkit"} + `("starts the $leg pass with --project $project", ({ leg, project }) => { + runPass(leg, "native", rootDir()); + const args = spawned[0]?.args ?? []; + expect(args[args.indexOf("--project") + 1]).toBe(project); + }); + + it("starts the node pass without --project", () => { + runPass("node", "native", rootDir()); + expect(spawned[0]?.args).not.toContain("--project"); + }); + it("starts the native browser pass without GMT_TEMPORAL, keeping the parent's other variables", () => { vi.stubEnv("GMT_TEMPORAL", undefined as never); vi.stubEnv("RUN_PASS_PROBE", "kept"); diff --git a/apps/dox/scripts/canary/native-suite.test.ts b/apps/dox/scripts/canary/native-suite.test.ts index f2a6b3b88..b567ad3dc 100644 --- a/apps/dox/scripts/canary/native-suite.test.ts +++ b/apps/dox/scripts/canary/native-suite.test.ts @@ -21,6 +21,7 @@ import { shimSource, } from "../../../../scripts/native-suite.mjs"; import { browserCompatVerdict } from "../../../../scripts/lib/canary-verdict.mjs"; +import { engineLine } from "../../../../scripts/lib/native-suite-compat.mjs"; import NativeSuiteReporter from "../../../../scripts/lib/native-suite-reporter.mjs"; import { ENGINE_IDS } from "../../../../scripts/lib/workarounds.mjs"; import { @@ -38,7 +39,7 @@ import { * is control-only. */ -type Leg = "node" | "chromium" | "firefox" | "webkit"; +type Leg = "node" | "chromium" | "firefox" | "webkit" | "webkit-macos"; type Row = { file: string; test: string; @@ -1071,6 +1072,66 @@ describe("classify, overlapping host groups", () => { }); }); +describe("classify, the two WebKit legs", () => { + const failing = report(suite(OTHER, [["format > is-IS", "failed"]])); + const passing = report(suite(OTHER, [["format > is-IS", "passed"]])); + const both = group({ + id: "webkit-shared", + legs: ["webkit", "webkit-macos"], + }); + const linuxOnly = group({ id: "webkit-linux-only", legs: ["webkit"] }); + + it("a group naming both WebKit legs matches a failure on webkit-macos", () => { + const r = classify(failing, failing, "webkit-macos", [], [both]); + expect(r.hostTagged.map((g) => [g.group, g.count])).toEqual([ + ["webkit-shared", 1], + ]); + expect(r.counts).toMatchObject({ hostTagged: 1, hostUntagged: 0 }); + }); + + it("a group naming only webkit does not match a failure on webkit-macos", () => { + const r = classify(failing, failing, "webkit-macos", [], [linuxOnly]); + expect(r.hostTagged).toEqual([]); + expect(r.counts).toMatchObject({ hostTagged: 0, hostUntagged: 1 }); + }); + + it("a group naming only webkit goes stale on neither webkit-macos nor the legs it does not name", () => { + for (const leg of ["webkit-macos", "chromium"] as const) { + const r = classify(passing, passing, leg, [], [linuxOnly]); + expect(r.staleTags).toEqual([]); + } + }); + + it("a group naming both WebKit legs goes stale on webkit-macos when its tests pass there", () => { + const r = classify(passing, passing, "webkit-macos", [], [both]); + expect(r.staleTags.map((s) => (s.kind === "host" ? s.group : ""))).toEqual([ + "webkit-shared", + ]); + }); + + it("a divergence row naming both WebKit legs tags a failure on webkit-macos; one naming webkit does not", () => { + const fails = report(suite(FILE, [["round > day", "failed"]])); + const passes = report(suite(FILE, [["round > day", "passed"]])); + const shared = classify( + fails, + passes, + "webkit-macos", + [row({ legs: ["webkit", "webkit-macos"] })], + [], + ); + expect(shared.counts).toMatchObject({ tagged: 1, untagged: 0 }); + const linux = classify( + fails, + passes, + "webkit-macos", + [row({ legs: ["webkit"] })], + [], + ); + expect(linux.counts).toMatchObject({ tagged: 0, untagged: 1 }); + expect(linux.staleTags).toEqual([]); + }); +}); + // --- the command ----------------------------------------------------------------------------- type Spec = { @@ -1087,6 +1148,7 @@ const BROWSER_ENGINES: Record = { chromium: "Chromium 153.0.8010.12", firefox: "Firefox 155.0", webkit: "WebKit 26.6", + "webkit-macos": "macOS WebKit 26.6 \u00b7 macOS 15.7.2", }; const COMPAT_RUNTIME = { polyfill: "0.5.1", @@ -1094,10 +1156,10 @@ const COMPAT_RUNTIME = { playwright: "1.63.0", }; /** The stubbed compat check's verdict for a browser leg: one group, still needed. */ -function compatVerdict(leg: string) { +function compatVerdict(leg: string, engine = BROWSER_ENGINES[leg]) { return browserCompatVerdict({ - leg: leg as "chromium" | "firefox" | "webkit", - engine: BROWSER_ENGINES[leg], + leg: leg as "chromium" | "firefox" | "webkit" | "webkit-macos", + engine, engineId: ENGINE_IDS[leg as keyof typeof ENGINE_IDS], runtime: COMPAT_RUNTIME, groups: [ @@ -1129,6 +1191,9 @@ function setup() { stdout: (t: string) => (out += t), stderr: (t: string) => (err += t), deps: { + // The suite's legs run on whatever host the test names; the host check has its own rows. + platform: (): NodeJS.Platform => "linux", + osVersion: (): string | null => null, preflight: async () => ({ engine: ENGINE, playwright: null }), compatCheck: async (leg: string) => compatVerdict(leg), runPass: ( @@ -2082,6 +2147,7 @@ describe("native-suite command", () => { ${["node", "extra"]} ${["summary"]} ${["summary", "safari"]} + ${["webkit-linux"]} `( "argument $argv: usage on stderr, exit 2, no verdict file", async ({ argv }) => { @@ -2090,7 +2156,10 @@ describe("native-suite command", () => { const code = await main(argv, s.io(null)); expect(code).toBe(2); expect(s.err()).toContain( - "Usage: node scripts/native-suite.mjs ", + "Usage: node scripts/native-suite.mjs ", + ); + expect(s.err()).toContain( + "node scripts/native-suite.mjs summary ", ); expect(existsSync(join(s.root, "artifacts"))).toBe(false); } finally { @@ -2219,6 +2288,162 @@ describe("native-suite command: the compat check in a browser", () => { }); }); +describe("native-suite command: the host check", () => { + const ok = report(suite(FILE, [["a", "passed"]])); + + /** A run that must stop at the host check: nothing after it may be called. */ + const guarded = (calls: string[]) => ({ + compatCheck: async () => { + calls.push("compatCheck"); + return compatVerdict("webkit"); + }, + preflight: async () => { + calls.push("preflight"); + return { engine: ENGINE, playwright: null }; + }, + runPass: () => { + calls.push("runPass"); + return 0; + }, + }); + + it.each` + leg | platform | problem + ${"webkit-macos"} | ${"linux"} | ${"webkit-macos runs on macOS; this host is linux"} + ${"webkit-macos"} | ${"win32"} | ${"webkit-macos runs on macOS; this host is win32"} + ${"webkit"} | ${"darwin"} | ${"webkit runs on Linux; this host is darwin"} + `( + "'$leg' on '$platform': exit 2, both could-not-run verdicts, nothing else called", + async ({ leg, platform, problem }) => { + const s = setup(); + try { + const calls: string[] = []; + const code = await main( + [leg], + s.io(null, { ...guarded(calls), platform: () => platform }), + ); + expect(code).toBe(2); + expect(calls).toEqual([]); + expect(s.compat(leg)).toEqual({ + source: `temporal-compat-${leg}`, + status: "could-not-run", + message: problem, + }); + expect(s.verdict(leg)).toEqual({ + source: `native-suite-${leg}`, + status: "could-not-run", + message: problem, + }); + expect(s.err()).toContain( + `native-suite: ${leg} could not run: ${problem}\n`, + ); + } finally { + s.done(); + } + }, + ); + + it.each` + leg | platform + ${"webkit-macos"} | ${"darwin"} + ${"webkit"} | ${"linux"} + ${"chromium"} | ${"darwin"} + ${"chromium"} | ${"linux"} + ${"firefox"} | ${"darwin"} + `("'$leg' on '$platform': runs", async ({ leg, platform }) => { + const s = setup(); + try { + const code = await main( + [leg], + s.io({ native: ok, control: ok }, { platform: () => platform }), + ); + expect(code).toBe(0); + expect(s.verdict(leg).status).toBe("ran"); + expect(s.compat(leg).status).toBe("ran"); + } finally { + s.done(); + } + }); + + it("the node leg writes no compat verdict on a refused host and no host refuses it", async () => { + const s = setup(); + try { + const code = await main( + ["node"], + s.io({ native: ok, control: ok }, { platform: () => "win32" }), + ); + expect(code).toBe(0); + expect(s.hasCompat("node")).toBe(false); + } finally { + s.done(); + } + }); + + it.each` + leg | platform | os | seen | line + ${"webkit-macos"} | ${"darwin"} | ${"15.7.2"} | ${"15.7.2"} | ${"macOS WebKit 26.6 \u00b7 macOS 15.7.2"} + ${"chromium"} | ${"darwin"} | ${"15.7.2"} | ${null} | ${"Chromium 26.6"} + ${"firefox"} | ${"darwin"} | ${"15.7.2"} | ${null} | ${"Firefox 26.6"} + ${"webkit"} | ${"linux"} | ${null} | ${null} | ${"WebKit 26.6"} + `( + "'$leg' on '$platform' with OS $os: both steps get $seen and the engine lines agree", + async ({ leg, platform, os, seen: want, line }) => { + // The real browserPreflight loads Playwright through createRequire, so it cannot be injected + // here; its use of engineLine is covered by the engineLine table, not by this test. + const s = setup(); + try { + const seen: unknown[] = []; + await main( + [leg], + s.io( + { native: ok, control: ok }, + { + platform: () => platform, + osVersion: () => os, + compatCheck: async ( + l: Parameters[0], + _r: string, + o: string | null, + ) => { + seen.push(["compat", o]); + return compatVerdict(l, engineLine(l, "26.6", o)); + }, + preflight: async ( + l: Parameters[0], + _r: string, + o: string | null, + ) => { + seen.push(["preflight", o]); + return { engine: engineLine(l, "26.6", o), playwright: null }; + }, + }, + ), + ); + expect(seen).toEqual([ + ["compat", want], + ["preflight", want], + ]); + expect(s.verdict(leg).engine).toBe(s.compat(leg).engine); + expect(s.compat(leg).engine).toBe(line); + } finally { + s.done(); + } + }, + ); + + it("accepts webkit-macos in summary and reports both of its sources", async () => { + const s = setup(); + try { + expect(await main(["summary", "webkit-macos"], s.io(null))).toBe(0); + expect(s.out()).toBe( + "native-suite-webkit-macos: no verdict\ntemporal-compat-webkit-macos: no verdict\n", + ); + } finally { + s.done(); + } + }); +}); + describe("native-suite summary", () => { it("prints the engine line and the counts of a verdict that ran", async () => { const s = setup(); diff --git a/apps/dox/scripts/canary/temporal-oracle-workflow.test.ts b/apps/dox/scripts/canary/temporal-oracle-workflow.test.ts new file mode 100644 index 000000000..8dcb0c9e2 --- /dev/null +++ b/apps/dox/scripts/canary/temporal-oracle-workflow.test.ts @@ -0,0 +1,119 @@ +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; + +import { parse } from "yaml"; + +import { + NATIVE_LEGS, + SWAP_LEGS, +} from "../../../../scripts/lib/canary-issues.mjs"; +import { + LEG_BROWSER, + LEG_HOST, +} from "../../../../scripts/lib/native-suite-compat.mjs"; + +// The workflow and the scripts list the same legs, and the report job reads every leg's artifact. + +type Row = { leg: string; browser?: string; os: string }; +type Step = { name?: string; run?: string }; +type Job = { + strategy: { matrix: { include?: Row[]; leg?: string[] } }; + steps: Step[]; +}; + +const text = readFileSync( + resolve( + import.meta.dirname, + "../../../../.github/workflows/temporal-oracle.yml", + ), + "utf8", +); +const jobs = (parse(text) as { jobs: Record }).jobs; +const rows = jobs["native-suite"].strategy.matrix.include ?? []; +const hostOf = LEG_HOST as Record; +const browserOf = LEG_BROWSER as Record; + +function step(job: string, name: string): string { + const found = jobs[job].steps.find((s) => s.name === name); + if (!found?.run) throw new Error(`no step "${name}" in ${job}`); + return found.run; +} + +/** The first `awk -F'\t' -v run="${RUN_ID}' '...'` program of a script. */ +function firstAwkProgram(run: string): string { + const start = run.indexOf(`awk -F'\\t' -v run="\${RUN_ID}" '`); + if (start < 0) throw new Error("no awk program"); + const open = run.indexOf("'", run.indexOf("-v run=", start) + 1) + 1; + return run.slice(open, run.indexOf("'", open)); +} + +describe("native-suite matrix", () => { + it("lists the legs of NATIVE_LEGS, in order", () => { + expect(rows.map((r) => r.leg)).toEqual(NATIVE_LEGS); + }); + + it.each(NATIVE_LEGS.map((leg: string) => ({ leg })))( + "row '$leg' installs the browser LEG_BROWSER names", + ({ leg }) => { + const row = rows.find((r) => r.leg === leg); + expect(row?.browser).toBe(browserOf[leg]); + }, + ); + + it.each(NATIVE_LEGS.map((leg: string) => ({ leg })))( + "row '$leg' runs on the host LEG_HOST requires", + ({ leg }) => { + const row = rows.find((r) => r.leg === leg); + expect(row?.os).toBe( + hostOf[leg] === "darwin" ? "macos-latest" : "ubuntu-latest", + ); + }, + ); +}); + +describe("polyfill-swap matrix", () => { + it("keeps the four SWAP_LEGS", () => { + expect(jobs["polyfill-swap"].strategy.matrix.leg).toEqual(SWAP_LEGS); + }); +}); + +describe("report job artifact parse", () => { + const t = "2026-01-05T06:20:00Z"; + const input = [ + `Native Temporal suite (webkit-macos)\t${t}`, + `Native Temporal suite (webkit)\t${t}`, + `Temporal polyfill swap (webkit)\t${t}`, + `Native Temporal oracle\t${t}`, + "", + ].join("\n"); + + it("maps each job name to its artifact name", () => { + const program = firstAwkProgram(step("report", "Download verdicts")); + const out = spawnSync("awk", ["-F", "\t", "-v", "run=123", program], { + input, + encoding: "utf8", + }); + expect(out.stdout.trim().split("\n")).toEqual([ + `native-suite-webkit-macos-123 ${t}`, + `native-suite-webkit-123 ${t}`, + `temporal-polyfill-swap-webkit-123 ${t}`, + `temporal-oracle-123 ${t}`, + ]); + }); +}); + +describe("native-suite resource trace", () => { + const run = step("native-suite", "Native suite"); + + it("uses no GNU-only df option", () => { + expect(run).not.toContain("--output"); + }); + + it("calls free only behind command -v free", () => { + const calls = run.split("\n").filter((l) => /\bfree -m\b/.test(l)); + expect(calls).toHaveLength(1); + expect(run).toContain("command -v free"); + expect(run.indexOf("command -v free")).toBeLessThan(run.indexOf("free -m")); + }); +}); diff --git a/apps/dox/scripts/generate-version-map.mjs b/apps/dox/scripts/generate-version-map.mjs index e5e884e0a..87c3b5b33 100644 --- a/apps/dox/scripts/generate-version-map.mjs +++ b/apps/dox/scripts/generate-version-map.mjs @@ -77,6 +77,16 @@ if (!gmt) { process.exit(1); } +// 2b. The Node floor the site states: engines.node of the published package. Missing is fatal, +// never defaulted. +const gmtManifest = join(packagesDir, "gmt", "package.json"); +const gmtNodeEngines = JSON.parse(readFileSync(gmtManifest, "utf-8")).engines + ?.node; +if (typeof gmtNodeEngines !== "string" || gmtNodeEngines === "") { + console.error(`ERROR: ${gmtManifest} has no engines.node`); + process.exit(1); +} + // 3. Emit a typed module, not JSON — consumers get autocomplete and type errors. const body = entries .map( @@ -94,6 +104,8 @@ ${body} export type PackageName = keyof typeof packageVersions; export const gmtVersion: string = packageVersions["@northguild/gmt"]; + +export const gmtNodeEngines: string = ${JSON.stringify(gmtNodeEngines)}; `; mkdirSync(resolve(appRoot, "src", "generated"), { recursive: true }); diff --git a/apps/dox/scripts/syntax-floor.test.ts b/apps/dox/scripts/syntax-floor.test.ts new file mode 100644 index 000000000..93d6f6323 --- /dev/null +++ b/apps/dox/scripts/syntax-floor.test.ts @@ -0,0 +1,60 @@ +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +import { + exportEntries, + measureSyntaxFloor, + syntaxFloor, +} from "../../../scripts/syntax-floor.mjs"; + +/** + * The syntax floor is the lowest ECMA-262 edition whose grammar parses every + * file a consumer loads. Each row is the edition a syntax first appears in (ES2016 `**`, ES2017 + * async functions, ES2018 object rest, ES2019 optional catch binding, ES2020 `?.`, `??` and + * BigInt, ES2021 logical assignment, ES2022 static blocks and private fields), written from + * ECMA-262, never read back from the parser. + */ + +describe("syntaxFloor", () => { + it.each` + source | expected + ${"let a = 1;"} | ${2015} + ${"a ** 2;"} | ${2016} + ${"async function f() { await 1 }"} | ${2017} + ${"const { a, ...r } = o;"} | ${2018} + ${"try {} catch {}"} | ${2019} + ${"a?.b ?? c; 1n;"} | ${2020} + ${"a ??= 1;"} | ${2021} + ${"class A { static { } #x; }"} | ${2022} + `("$source needs edition $expected", ({ source, expected }) => { + expect(syntaxFloor([source])).toBe(expected); + }); + + it("is the highest floor of the sources: 2018 and 2021 give 2021", () => { + expect(syntaxFloor(["const { a, ...r } = o;", "a ??= 1;"])).toBe(2021); + }); + + it("throws, naming the source index, when no edition parses a source", () => { + expect(() => syntaxFloor(["let a = 1;", "a b"])).toThrow(/source 1/); + }); +}); + +describe("the real entries", () => { + it("measure a floor from 2015 up, over every exports entry of packages/gmt", async () => { + const manifest = JSON.parse( + readFileSync( + resolve( + fileURLToPath(import.meta.url), + "../../../../packages/gmt/package.json", + ), + "utf8", + ), + ); + const result = await measureSyntaxFloor(); + expect(result.entries).toBe(Object.keys(manifest.exports).length); + expect(exportEntries()).toHaveLength(result.entries); + expect(result.edition).toBeGreaterThanOrEqual(2015); + expect(Number.isInteger(result.edition)).toBe(true); + }, 120_000); +}); diff --git a/apps/dox/src/content/docs/browser-support.mdx b/apps/dox/src/content/docs/browser-support.mdx new file mode 100644 index 000000000..1f82600aa --- /dev/null +++ b/apps/dox/src/content/docs/browser-support.mdx @@ -0,0 +1,68 @@ +--- +title: Browser support +description: What GMT needs from a browser or runtime, which engine each one runs, and which weekly test run covers it. +industries: [core] +--- + +import { syntaxFloor } from "~/generated/syntax-floor"; +import { gmtNodeEngines } from "~/generated/versions"; + +## What GMT needs from a host + +GMT runs on any host that has these three things: + +1. **Modern JavaScript.** The code GMT ships, with its Temporal polyfill, parses as ECMAScript edition {syntaxFloor.edition} (ES modules). The number is measured on every build: the lowest edition whose grammar parses all {syntaxFloor.entries} entry points. +2. **`Intl.DateTimeFormat` with time zones.** It must accept an IANA `timeZone` and format a date and time to the second. The bundled polyfill reads every offset from it ([polyfill source, `lib/ecmascript.ts`](https://github.com/js-temporal/temporal-polyfill/blob/v0.5.1/lib/ecmascript.ts)). The `timeZone` option is defined in [ECMA-402](https://tc39.es/ecma402/#sec-createdatetimeformat). +3. **On Node, the version GMT's package asks for.** Its `engines` field says {gmtNodeEngines}. + +Native `Temporal` is not needed. GMT ships its own. + +## Why the engine still matters + +A host's time zone offsets and locale text are the host's own data. The Temporal specification leaves time zone offsets to the implementation ([GetNamedTimeZoneOffsetNanoseconds](https://tc39.es/proposal-temporal/#GetNamedTimeZoneOffsetNanoseconds) and [GetNamedTimeZoneEpochNanoseconds](https://tc39.es/proposal-temporal/#GetNamedTimeZoneEpochNanoseconds)), and ECMA-402 does the same for [locale data](https://tc39.es/ecma402/#sec-internal-slots). GMT gives the right answer for the data it is handed. So two browsers can show different text for one call, and a browser whose data is older than a time zone release gives that release's old offsets. [Upstream](/upstream/#native-engines) lists the cases we found. + +## Browsers and runtimes + +ICU is the Unicode library that holds locale text and time zone data. Each engine uses its own copy or the system's. + +| Browser or runtime | Engine | Where its ICU and time zone data comes from | Weekly leg | +| --- | --- | --- | --- | +| Chrome, Edge, Brave, Opera, Vivaldi, Samsung Internet | Chromium | bundled with the browser | `chromium` | +| Firefox | Gecko and SpiderMonkey | bundled with the browser | `firefox` | +| Safari on macOS | WebKit and JavaScriptCore | the operating system | `webkit-macos` | +| Safari and other browsers on iPhone and iPad | WebKit, except where Apple allows another engine | the operating system | `webkit-macos` (same engine and Apple's ICU; iOS's own data is not tested) | +| DuckDuckGo | the system engine: WebKit on macOS and iOS, Chromium-based on Windows and Android | as that engine | `webkit-macos` or `chromium` | +| WebKit on Linux (WebKitGTK, WPE) | WebKit and JavaScriptCore | the Linux distribution's ICU | `webkit` | +| Node.js | V8 | bundled with Node (full ICU) | `node` | +| Deno | V8 | not documented | none | +| Cloudflare Workers | V8 | not documented | none | +| Bun | JavaScriptCore | not documented | none | + +Brave, Edge, Opera, Vivaldi, Samsung Internet and DuckDuckGo are covered through their engine. No run tests them by name. + +Bun runs JavaScriptCore, the engine Safari uses. No weekly run tests Bun, and its time zone and locale data is not documented. + +Where each cell comes from: + +- Chromium bundles its own ICU data ([Chromium ICU notes](https://chromium.googlesource.com/chromium/deps/icu/+/refs/heads/main/README.chromium)). +- Brave, Edge, Opera, Vivaldi and Samsung Internet are built on Chromium: [Brave](https://github.com/brave/brave-core/blob/master/README.md), [Edge](https://learn.microsoft.com/en-us/deployedge/ms-edge-security-for-business), [Opera](https://dev.opera.com/extensions/), [Vivaldi](https://vivaldi.com/blog/vivaldi-browser-open-source/) and [Samsung Internet](https://developer.samsung.com/internet/release-note.html). +- Firefox keeps its own copy of ICU ([`intl/icu`](https://github.com/mozilla-firefox/firefox/tree/main/intl/icu)) and of the time zone data ([`intl/tzdata`](https://github.com/mozilla-firefox/firefox/tree/main/intl/tzdata)). Its engines are [Gecko](https://mozilla.github.io/geckoview/) and [SpiderMonkey](https://spidermonkey.dev/). +- Apple's WebKit links the operating system's ICU: the [WebKit source](https://github.com/WebKit/WebKit/blob/main/Source/WTF/WTF.xcodeproj/project.pbxproj) references `libicucore.dylib`, which [Apple's open-source ICU](https://github.com/apple-oss-distributions/ICU) builds. +- WebKit on Linux uses the ICU the distribution provides: see the [WebKitGTK](https://github.com/WebKit/WebKit/blob/main/Source/cmake/OptionsGTK.cmake) and [WPE](https://github.com/WebKit/WebKit/blob/main/Source/cmake/OptionsWPE.cmake) build files. +- On iPhone and iPad, browsers must use WebKit unless Apple grants an entitlement: [App Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) and [BrowserEngineKit](https://developer.apple.com/documentation/browserenginekit). +- DuckDuckGo uses the system engine: [WebKit on Mac](https://spreadprivacy.com/introducing-duckduckgo-for-mac/), [WebKit on iPhone and iPad](https://duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections), [WebView2 on Windows](https://spreadprivacy.com/windows-browser-open-beta/), and on Android the [Android WebView](https://chromium.googlesource.com/chromium/src/+/main/android_webview/README.md), which Chromium implements. +- Node ships full ICU data ([Node Intl](https://nodejs.org/api/intl.html)) and runs on [V8](https://nodejs.org/en/learn/getting-started/the-v8-javascript-engine). +- Deno is [built on V8](https://github.com/denoland/deno/blob/main/README.md), Cloudflare Workers run [V8](https://developers.cloudflare.com/workers/reference/how-workers-works/), and Bun runs [JavaScriptCore](https://bun.sh/docs/runtime/). None of the three documents where its ICU or time zone data comes from. + +## Not tested + +The weekly run does not cover these. A wrong answer there is still a GMT bug, and we want the report. + +- Browser versions older than the one each weekly run installs. +- Other macOS versions, and iOS itself. The `webkit-macos` leg runs the macOS version its runner has. +- Deno, Bun and Cloudflare Workers, which have their own data. +- Android System WebView. + +## Where the results are + +The [weekly workflow](https://github.com/northguild/gmt/actions/workflows/temporal-oracle.yml) lists every run. Each run's summary names the engine version it tested and, for `webkit-macos`, the macOS version. diff --git a/apps/dox/src/content/docs/bundle-size.mdx b/apps/dox/src/content/docs/bundle-size.mdx index e7cd15746..1d0393cea 100644 --- a/apps/dox/src/content/docs/bundle-size.mdx +++ b/apps/dox/src/content/docs/bundle-size.mdx @@ -15,4 +15,4 @@ The `@northguild/gmt` row is the whole package, all {formatCount(gmtStats.functi Sizes come from bundling `packages/gmt/src` with esbuild, minified, as ES modules for a neutral platform. 1 kB is 1,000 bytes. The minified size of each row is gated: the repository's check fails when it passes the budget in the last column, and a budget changes only by a reviewed edit. Gzipped sizes are reported and never gated, because they vary with the version of zlib. -The polyfill stays until a stable Safari ships `Temporal` and the weekly run against native `Temporal` passes on Node 26, Chromium, Firefox and WebKit for 12 weeks running ([#316](https://github.com/northguild/gmt/issues/316)). +The polyfill stays until a stable Safari ships `Temporal` and the weekly run against native `Temporal` passes on Node 26, Chromium, Firefox, WebKit on Linux and WebKit on macOS for 12 weeks running ([#316](https://github.com/northguild/gmt/issues/316)). diff --git a/apps/dox/src/content/docs/install.mdx b/apps/dox/src/content/docs/install.mdx index 5d025be1b..93f6580ca 100644 --- a/apps/dox/src/content/docs/install.mdx +++ b/apps/dox/src/content/docs/install.mdx @@ -41,6 +41,8 @@ bun add @northguild/gmt +Which browsers and runtimes run GMT: [Browser support](/browser-support/). + ## Your first call ISO 8601 strings go in and come out. There is no `Date` object to create first. diff --git a/apps/dox/src/content/docs/upstream.mdx b/apps/dox/src/content/docs/upstream.mdx index 9f0461c94..099dc5ffa 100644 --- a/apps/dox/src/content/docs/upstream.mdx +++ b/apps/dox/src/content/docs/upstream.mdx @@ -128,7 +128,7 @@ found no differences. ## Native engines Every week, GMT runs its whole test suite on the Temporal built into Node 26, Chromium, -Firefox and WebKit, and expects the same answers it gets on the polyfill. A failure that no known bug +Firefox, WebKit on Linux and WebKit on macOS, and expects the same answers it gets on the polyfill. A failure that no known bug explains opens an issue in GMT's repository. Each run lists the exact engine versions it used: see the [weekly runs](https://github.com/northguild/gmt/actions/workflows/temporal-oracle.yml). @@ -146,10 +146,13 @@ The built-in engines have a few bugs of their own. We report each one we find. T zoned date on 19 April −271821, just outside the range the standard allows. - [Bugzilla 2085525](https://bugzilla.mozilla.org/show_bug.cgi?id=2085525): Firefox prints AM and PM in a time range that asks for a day period such as "in the morning", when a zone name is shown. -- WebKit adds a year to the 30th of Dhu al-Hijjah in an Islamic year before the Hijra as 13 - months, so the result lands a month late. The report to WebKit is pending. -- WebKit throws when it adds a year to the last day of Chaitra in a year before about - 4800 BCE. The report to WebKit is pending. +- WebKit, on Linux and on macOS, adds a year to the 30th of Dhu al-Hijjah in an Islamic year + before the Hijra as 13 months, so the result lands a month late. The report to WebKit is pending. +- WebKit, on Linux and on macOS, throws when it adds a year to the last day of Chaitra in a year + before about 4800 BCE. The report to WebKit is pending. +- ICU 75 and later, which WebKit on macOS uses for calendar arithmetic, counts every Persian year + before year 0 (621 CE) as a leap year. Adding a month to the 30th of Bahman, the 11th month, in + such a year then throws instead of giving the 29th of Esfand. The report to ICU is pending. GMT gives the standard's answer in every case. diff --git a/apps/dox/src/data/temporal-compat.json b/apps/dox/src/data/temporal-compat.json index 3eb004d59..1ef3a4e3c 100644 --- a/apps/dox/src/data/temporal-compat.json +++ b/apps/dox/src/data/temporal-compat.json @@ -112,7 +112,7 @@ { "defects": ["D16"], "title": "D16 — formatRange drops O and long zone-name widths (ICU-20548)", - "trigger": "an ICU release that fixes ICU-20548 is bundled by GMT's engines.node floor (>=22.16.0) and by every browser the native suite runs, so every D16 repro passes on every engine: this check reports Node, and the weekly run's compat check in each browser (the temporal-compat-chromium, -firefox and -webkit verdicts) reports the rest; D16 is removable only when all of them say so", + "trigger": "an ICU release that fixes ICU-20548 is bundled by GMT's engines.node floor (>=22.16.0) and by every browser the native suite runs, so every D16 repro passes on every engine: this check reports Node, and the weekly run's compat check in each browser (the temporal-compat-chromium, -firefox, -webkit and -webkit-macos verdicts) reports the rest; D16 is removable only when all of them say so", "probes": 6, "failing": 4, "state": "still-needed" @@ -129,7 +129,7 @@ { "defects": ["D18"], "title": "D18 — Islamic calendar dates before the Hijra read as positive years in a second era (WebKit)", - "trigger": "the weekly run's compat check in WebKit (the temporal-compat-webkit verdict) reports D18 removable: every D18 repro passes in the WebKit the native suite runs, once a js-temporal release reads the Islamic eras or WebKit prints the year as V8 does. WebKit is the only engine in D18's scope; this check runs on Node, where D18 is out of scope and never removable", + "trigger": "the weekly run's compat check in WebKit (the temporal-compat-webkit and temporal-compat-webkit-macos verdicts, Linux and macOS) reports D18 removable: every D18 repro passes in the WebKit the native suite runs, once a js-temporal release reads the Islamic eras or WebKit prints the year as V8 does. WebKit is the only engine in D18's scope; this check runs on Node, where D18 is out of scope and never removable", "probes": 6, "failing": 0, "state": "out-of-scope", @@ -138,7 +138,7 @@ { "defects": ["D19"], "title": "D19 — ZonedDateTime#equals answers false for two identifiers of one zone where resolvedOptions keeps the identifier (JavaScriptCore)", - "trigger": "a js-temporal release whose TimeZoneEquals finds the primary identifier on a host whose Intl.DateTimeFormat#resolvedOptions returns the identifier as written, so the D19 probe (Etc/UTC equals UTC, ECMA-402 §6.5) passes in the WebKit the native suite runs: the weekly run's compat check in WebKit (the temporal-compat-webkit verdict) reports it. WebKit is the only engine in D19's scope; this check runs on Node, where D19 is out of scope and never removable", + "trigger": "a js-temporal release whose TimeZoneEquals finds the primary identifier on a host whose Intl.DateTimeFormat#resolvedOptions returns the identifier as written, so the D19 probe (Etc/UTC equals UTC, ECMA-402 §6.5) passes in the WebKit the native suite runs: the weekly run's compat check in WebKit (the temporal-compat-webkit and temporal-compat-webkit-macos verdicts, Linux and macOS) reports it. WebKit is the only engine in D19's scope; this check runs on Node, where D19 is out of scope and never removable", "probes": 1, "failing": 0, "state": "out-of-scope", diff --git a/apps/dox/src/lib/browser-support.test.ts b/apps/dox/src/lib/browser-support.test.ts new file mode 100644 index 000000000..723956fa2 --- /dev/null +++ b/apps/dox/src/lib/browser-support.test.ts @@ -0,0 +1,85 @@ +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +import { NATIVE_LEGS } from "../../../../scripts/lib/canary-issues.mjs"; +import { START_HERE } from "./section-order"; + +/** + * The browser support page states no figure by hand and names exactly the + * weekly legs the workflow runs. + */ + +const HERE = fileURLToPath(import.meta.url); +const page = readFileSync( + resolve(HERE, "../../content/docs/browser-support.mdx"), + "utf8", +); +const WORKFLOW = + "https://github.com/northguild/gmt/actions/workflows/temporal-oracle.yml"; + +/** The page text without its import lines and frontmatter. */ +const text = page.replace(/^---[\s\S]*?---\n/, "").replace(/^import .*$/gm, ""); + +/** The code spans in the last column of the page's first table. */ +function legColumn(): string[] { + const rows = text + .split("\n") + .filter((line) => line.startsWith("|")) + .slice(2); + const spans: string[] = []; + for (const row of rows) { + const cells = row.split("|").slice(1, -1); + const last = cells[cells.length - 1] ?? ""; + for (const m of last.matchAll(/`([^`]+)`/g)) spans.push(m[1] as string); + } + return spans; +} + +describe("browser support page", () => { + it("lists every native-suite leg in the table's last column, and no other leg", () => { + const spans = new Set(legColumn()); + expect([...spans].sort()).toEqual([...NATIVE_LEGS].sort()); + }); + + it("imports and uses syntaxFloor and gmtNodeEngines", () => { + expect(page).toMatch( + /import \{ syntaxFloor \} from "~\/generated\/syntax-floor";/, + ); + expect(page).toMatch( + /import \{ gmtNodeEngines \} from "~\/generated\/versions";/, + ); + expect(text).toContain("{syntaxFloor.edition}"); + expect(text).toContain("{gmtNodeEngines}"); + }); + + it.each` + label | pattern + ${"an ECMAScript year"} | ${/ES20\d\d/} + ${"a node range"} | ${/>=\s*\d/} + ${"a browser version"} | ${/\b(?:Chrome|Chromium|Firefox|Safari|WebKit|Node)(?:\.js)? \d/} + `("has no hand-written figure: $label", ({ pattern }) => { + expect(text).not.toMatch(pattern); + }); + + it("links the weekly workflow and no dated run", () => { + expect(text).toContain(WORKFLOW); + const links = + text.match( + /https:\/\/github\.com\/northguild\/gmt\/actions\/[^\s)>"]*/g, + ) ?? []; + expect(new Set(links)).toEqual(new Set([WORKFLOW])); + expect(text).not.toContain("/actions/runs/"); + }); +}); + +describe("START_HERE", () => { + it("puts browser-support second", () => { + expect(START_HERE.map((p) => p.slug)).toEqual([ + "install", + "browser-support", + "core-rules", + "why-gmt", + ]); + }); +}); diff --git a/apps/dox/src/lib/page-expression-values.test.ts b/apps/dox/src/lib/page-expression-values.test.ts index f2968fadb..9db9d1625 100644 --- a/apps/dox/src/lib/page-expression-values.test.ts +++ b/apps/dox/src/lib/page-expression-values.test.ts @@ -18,6 +18,7 @@ const PAGES = [ "why-gmt.mdx", "compare.mdx", "compare/behaviour.mdx", + "browser-support.mdx", "migrate/index.mdx", "migrate/date-fns.mdx", "migrate/luxon.mdx", diff --git a/apps/dox/src/lib/page-expression-values.ts b/apps/dox/src/lib/page-expression-values.ts index c780ab74d..37dc7e864 100644 --- a/apps/dox/src/lib/page-expression-values.ts +++ b/apps/dox/src/lib/page-expression-values.ts @@ -30,6 +30,8 @@ import { industryNamespaces, runsPerTest, } from "../data/gmt-stats"; +import { syntaxFloor } from "../generated/syntax-floor"; +import { gmtNodeEngines } from "../generated/versions"; import { measurementDateRange } from "./library-compare-tables"; import { familyCounts, formatFamilyCounts } from "./locale-families"; import { formatOffset, zoneOffsetRange } from "./timezone-offset-range"; @@ -125,6 +127,9 @@ export function pageExpressionValues(): Record { "formatCount(largestSuite.stats.tests)": formatCount( largestSuite.stats.tests, ), + "syntaxFloor.edition": String(syntaxFloor.edition), + "syntaxFloor.entries": String(syntaxFloor.entries), + gmtNodeEngines, "competitorTimeResolutionLabel()": competitorTimeResolutionLabel(), }; } diff --git a/apps/dox/src/lib/section-order.ts b/apps/dox/src/lib/section-order.ts index e042bd381..7e057079a 100644 --- a/apps/dox/src/lib/section-order.ts +++ b/apps/dox/src/lib/section-order.ts @@ -10,6 +10,7 @@ /** What a reader needs first, in reading order. */ export const START_HERE = [ { slug: "install" }, + { slug: "browser-support" }, { slug: "core-rules" }, { slug: "why-gmt" }, ] as const satisfies readonly { slug: string; label?: string }[]; diff --git a/apps/dox/src/lib/top-level-pages.test.ts b/apps/dox/src/lib/top-level-pages.test.ts index 9a538c3e5..554e8697a 100644 --- a/apps/dox/src/lib/top-level-pages.test.ts +++ b/apps/dox/src/lib/top-level-pages.test.ts @@ -30,10 +30,12 @@ describe("topLevelPages", () => { "../content/docs/index.mdx": "x", "../content/docs/why-gmt.mdx": "w", "../content/docs/core-rules.mdx": "c", + "../content/docs/browser-support.mdx": "b", }; expect(topLevelPages(raw)).toEqual([ { slug: "index", source: "x" }, { slug: "install", source: "i" }, + { slug: "browser-support", source: "b" }, { slug: "core-rules", source: "c" }, { slug: "why-gmt", source: "w" }, { slug: "alpha", source: "a" }, diff --git a/context/canary/index.md b/context/canary/index.md new file mode 100644 index 000000000..7f8a9a66b --- /dev/null +++ b/context/canary/index.md @@ -0,0 +1,14 @@ +# Canary: the scheduled checks that watch what GMT depends on + +A canary is a scheduled job that checks something GMT does not control: the engines it runs on, +the polyfill it ships, the data tables it carries. It never fails a pull request. It reports +through GitHub issues. Load only what the task needs: + +- [overview.md](overview.md) — every canary, what it checks and files, the rules they share, and + which engine covers which browser. **Start here.** +- [tracker.md](tracker.md) — the `CNRY-*` stories and the earlier canary stories, with status. +- [issues/](issues/) — one file per `CNRY-*` story, named by story ID. + +Story IDs for canary work are `CNRY-`. The canary stories built before this epic keep their +`CORE-*` IDs and their records in [../domination/issues/](../domination/issues/); the tracker +lists them. diff --git a/context/canary/issues/CNRY-1.md b/context/canary/issues/CNRY-1.md new file mode 100644 index 000000000..b7d008fd7 --- /dev/null +++ b/context/canary/issues/CNRY-1.md @@ -0,0 +1,145 @@ +# CNRY-1 — Safari's ICU and time zone data in the native suite, and a browser support page + +**Issue:** #483 + +**Scope:** Add a `webkit-macos` leg to the weekly native suite, so GMT is tested against the ICU +and time zone data Safari and every iOS browser use. Add a Dox page that says which browsers GMT +supports and which weekly leg covers each one. Adds no function and changes no output. + +## Why + +GMT ships `@js-temporal/polyfill`, which reads offsets and locale text from the host's +`Intl.DateTimeFormat`. So a browser's answers depend on its engine and on the ICU and tzdb built +with it. The native suite runs four legs: Node, Chromium, Firefox and WebKit. The WebKit leg is +Playwright's WebKit on Ubuntu, which uses the runner's `libicu74`. Safari uses Apple's ICU and the +time zone data macOS and iOS ship. + +The two differ. The suite run on Mac WebKit 26.6 (see Evidence) fails 220 tests on Apple's data +in both passes, 119 of which no tag explains, and passes two tag groups Linux WebKit fails (the +Morocco 2026 rows and Linux's pre-2023d tzdb). No leg tests the data Safari users have, so a +wrong answer GMT gives them can go unseen. + +Brave, Edge, Opera, Samsung Internet and the other Chromium browsers get no leg of their own. They +run Chromium's V8 and its bundled ICU, the `chromium` leg's engine and data. DuckDuckGo has no +engine of its own and no automation hook: it runs on the system engine (WebKit on macOS and iOS, +Chromium on Windows and Android). The browser support page says this, instead of a job per brand. + +## Parts + +### 1. The `webkit-macos` leg + +- A fifth `native-suite` matrix leg, `webkit-macos`, on a `macos-latest` runner. The repo is + public, so macOS minutes are free. The leg runs Playwright's WebKit and the Vitest `webkit` + project; only the host differs. +- The leg name runs through `scripts/native-suite.mjs` (`LEGS`, the `Leg` type, preflight, the + `--project` argument), `scripts/lib/native-suite-compat.mjs` (a leg-to-browser map beside + `BROWSER_LABELS`), `scripts/lib/workarounds.mjs` (`ENGINE_IDS["webkit-macos"] = "webkit"`), + `scripts/lib/canary-issues.mjs` (`COMPAT_SOURCES`, `SOURCE_ENGINE`, `NATIVE_LEGS`), + `scripts/lib/canary-summary.mjs` (`NATIVE_LEGS`), `scripts/lib/canary-verdict.mjs` and + `scripts/lib/native-suite-tags.mjs` (the `Leg` types), and their tests in + `apps/dox/scripts/canary/`. +- Preflight refuses to run `webkit-macos` on a host that is not macOS: a could-not-run verdict, + never a Linux result filed under the macOS name. +- The engine line reads `macOS WebKit `, so the leg's issue titles differ from the Linux + leg's. `legLabel` in `canary-issues.mjs` keeps the words before the version + (`macOS WebKit 26`), not only the first word. +- Both WebKit legs are engine `webkit`. A workaround scoped to WebKit (D18, D19) is removable only + when both legs' `temporal-compat-*` verdicts say so. The D16, D18 and D19 triggers in + `workarounds.mjs` name the new verdict, and `pnpm compat:snapshot` regenerates + `apps/dox/src/data/temporal-compat.json`. +- Tags: a group's legs follow what each leg fails, not the group's name. From the local run: + the JavaScriptCore divergences (S, T), `webkit-ar-sa-islamic-default-calendar`, + `browser-canada-2026-tz-data`, and the rows of `webkit-legacy-zone-ids` and + `webkit-linux-icu74-locale-data` that the Mac also fails, widen to `webkit-macos`. A group that + then covers both legs loses `linux` from its name. `browser-morocco-2026-tz-data` and + `webkit-linux-tz-data` stay off the Mac leg: it passes them, so they would go stale there. New + groups cover the 119 untagged host failures, each with its evidence. Every row is checked + against the leg's own run, here and on the first CI run. +- The resource trace in the browser steps uses GNU `df --output` and `free`. It needs a form that + also runs on macOS (`df -Pk`, and `vm_stat` where there is no `free`). +- The report job's artifact parsing already keys on the job name, so `Native Temporal suite + (webkit-macos)` needs no change there. A test confirms it. + +### 2. The browser support page + +- A Dox page under Start here, beside Install: which browsers GMT supports, the engine each one + runs, and the weekly leg that tests that engine. It covers the Chromium family (Chrome, Edge, + Brave, Opera, Vivaldi, Samsung Internet), the Firefox family, Safari and every iOS browser, + DuckDuckGo, and the server runtimes on V8 (Node, Deno, Cloudflare Workers). +- It states the support floor from evidence: the published build's syntax target and what + `@js-temporal/polyfill` needs from the host (`Intl.DateTimeFormat` with time zones). It names no + version it has not checked. +- It says plainly that Brave and DuckDuckGo are covered through their engine, not run by name. +- It links to the weekly workflow, not to a dated run. + +## Not in scope + +- A macOS leg for the `polyfill-swap` job. The swap check compares two polyfills in one runtime; + the native suite's control pass already tests the shipped polyfill on Apple's data. +- A job per Chromium brand. Same engine and data as the `chromium` leg. +- Real Safari through `safaridriver`. Playwright's macOS WebKit uses the system ICU and time zone + data, which is what this story tests; Safari's own release lag is not a GMT input. + +## Evidence + +`node scripts/native-suite.mjs webkit` on macOS 27.0.1, Playwright 1.63.0 (WebKit 26.6), `main` +at 58d4e150, with the Linux leg's tags. Run 2026-11-08. + +- 71,590 tests in 944 files: 71,361 pass. **No control-only failure:** nothing GMT's own code + gets wrong on Apple's data. +- Workaround check: 25 workarounds, 23 still needed, none removable, 1 guard, 1 out of scope on + WebKit. +- **2 untagged native failures.** `addDate` and `subtractDate` on Persian dates at -271820, the + range minimum: JavaScriptCore's native `Temporal` returns an empty string where the polyfill + returns `-271820-04-09[u-ca=persian]`. An engine defect: tagged with evidence, and filed + upstream through the usual upstream-filing steps. +- **220 host failures** (both passes fail, so the data is Apple's, not GMT's): + - 101 match existing tags: ar-SA Islamic default calendar 47, Linux ICU 74 locale data 39, + legacy zone ids 8, Canada 2026 tz data 7 (`America/Winnipeg` still changes clocks on + 2026-11-01, as on Chromium and Firefox). + - 119 match none. Apple's ICU locale text: `Feb 3, 2024 at 2:30 PM` for + `Feb 3, 2024, 2:30 PM`, `14:30 - 16:46` range separators in en-GB, es-ES and zh-CN, no space + in ja-JP durations (`1日、2時間、30分`), `Uhr` missing from de-DE ranges, across 30 format + test files. zh-CN weeks start on Sunday (`getLocaleFirstDayOfWeek`, start and end of week, + week of month, weeks in month). `CST6CDT`, `EST5EDT`, `MST7MDT` and `PST8PDT` refused + (`isValidTimeZone`, `getTimeZoneOffset`, `toOffsetInstant`, `fromOffsetInstant`). +- **2 stale tags on the Mac:** `browser-morocco-2026-tz-data` and `webkit-linux-tz-data` pass, so + Apple's tzdb has those changes. + +## Definition of done + +- A `workflow_dispatch` run of `temporal-oracle.yml` on `main` shows five native-suite legs, and + the `webkit-macos` job summary names `macOS WebKit `. +- The `webkit-macos` leg passes, or every failure it reports is tagged with evidence or fixed in + GMT. No control-only failure is tagged. +- `pnpm --filter dox test` passes with the new leg in every canary test that lists legs. +- The browser support page builds, passes the Dox gates and is linked from Start here. + +## Decisions + +Stated as current rules. Where each rule is enforced is named beside it. + +**Legs** + +- `ENGINE_IDS` in `scripts/lib/workarounds.mjs` is the one list of native-suite legs, in leg order: `node`, `chromium`, `firefox`, `webkit`, `webkit-macos`. `NATIVE_LEGS`, `LEGS`, `COMPAT_SOURCES` and `SOURCE_ENGINE` derive from its keys, so a sixth leg needs no test edit. The swap check keeps its own four legs (`SWAP_LEGS`); the native suite's control pass already tests the shipped polyfill on Apple's data, so `polyfill-swap` has no macOS leg. +- Both WebKit legs are engine `webkit`. A workaround scoped to WebKit (D18, D19) is removable only when both legs' `temporal-compat-*` verdicts say so, and D16 needs all five compat sources. The D16, D18 and D19 trigger rows name both verdicts in `workarounds.mjs`, in `packages/gmt/src/internal/temporalCompat/README.md` and in `apps/dox/src/data/temporal-compat.json` (regenerated by `pnpm compat:snapshot`). +- `LEG_BROWSER` maps each leg to its Playwright browser and Vitest project; `LEG_HOST` names the OS a leg must run on (`webkit`: Linux, `webkit-macos`: macOS). A verdict names the data it tested, so `native-suite.mjs` refuses a leg on the wrong host with two could-not-run verdicts and exit 2, never a result filed under another host's name. +- The engine line is `macOS WebKit · macOS ` for the Mac leg and `WebKit ` for the Linux leg, from `engineLine`; the compat verdict and the preflight use it, so one leg's two lines agree. `legLabel` keeps every word before the first version (`macOS WebKit 26`), so each WebKit leg keeps its own issue keys and titles. +- The workflow `native-suite` matrix is `include:` rows with `leg`, `browser` and `os`; the job name stays `Native Temporal suite ()`, so the report job's artifact parsing needs no change (`temporal-oracle-workflow.test.ts` runs its `awk` program to prove it). `macos-latest` is a moving label on purpose: the leg tests the data Apple ships now, and the engine line records which macOS ran. System packages (`--with-deps`) install on Linux only. The resource trace uses `df -Pk` and, where `free` is missing, `vm_stat`. An `otool -L` step prints which ICU Playwright's JavaScriptCore links (`libicucore` on the Mac) and never fails the job. +- The leg runs on `macos-latest` at no cost because the repository is public (GitHub Docs, "About billing for GitHub Actions"). Brave, Edge, Opera, Vivaldi and Samsung Internet run Chromium's engine and bundled ICU, so they have no leg of their own; DuckDuckGo runs the system engine and has no automation hook. The browser support page says both. + +**Tags** + +- A tag group covers two legs only when one cause, shown by the same received value, holds on both, so a group's `reason` is true on every leg it names. A group covering both WebKit legs has no `linux` in its id. A group the Mac passes stays off the Mac leg, or it would go stale there: `browser-morocco-2026-tz-data` and `webkit-linux-tz-data`. +- JavaScriptCore divergences S and T, `webkit-ar-sa-islamic-default-calendar`, `browser-canada-2026-tz-data` (`America/Winnipeg` still changes clocks on 2026-11-01) and the POSIX zone ids `CST6CDT`, `EST5EDT`, `MST7MDT` and `PST8PDT` (group `webkit-posix-zone-ids`) cover both WebKit legs. `webkit-legacy-zone-ids` narrows to `CET`, `EET`, `MET` and `WET` on Linux. Those ids are valid in ECMA-402 §6.5, "Use of the IANA Time Zone Database" (every IANA Zone and Link name), and the IANA `backward` file, so a refusal is the host's defect, and the tag stays whether or not it is filed. +- The `webkit-macos-*` groups hold Apple's ICU locale text, sorted by cause, each with evidence: engine and OS version, one call and its received value, Node 26's value, and the other legs' result. Never a pattern that matches everything; prefer `file` plus a `test` pattern naming the locale or id. Before a week-start or connector row is tagged as host data, the CLDR element for the Node release's ICU decides whether the test's expected value is the wrong one, which is then fixed in the test instead. +- Record AE: ICU4C 75 and later count every Persian year before year 0 as a leap year, so `addDate` and `subtractDate` on a Persian date at ISO -271820 diverge on macOS WebKit. It is an engine defect with the rows tagged on `webkit-macos` only, shipped GMT is right (it runs the polyfill), and nothing about it goes on a Dox page except the bullet in `upstream.mdx` § Native engines. A control-only failure is never tagged; it is a GMT bug and gets fixed. +- Tags are checked against the leg's own run. The runner's macOS can differ from a local Mac, so a branch dispatch of `temporal-oracle.yml` reconciles the Mac tags before merge: a group the runner passes is narrowed or dropped, a new failure is tagged with evidence or fixed. Nothing is filed upstream, and no issue edited, until the owner approves the exact text; the drafts sit in `context/domination/js-temporal-polyfill-bugs.md` (record AE, and the POSIX zone ids for bugs.webkit.org). + +**Browser support page** + +- `browser-support.mdx` sits second under Start here (`START_HERE`: `install`, `browser-support`, `core-rules`, `why-gmt`). It states no figure by hand: `syntaxFloor` (`~/generated/syntax-floor`) and `gmtNodeEngines` (`~/generated/versions`) are generated before the build. MDX does not evaluate an expression inside a backtick span, so a figure is written outside code ticks. `browser-support.test.ts` checks that the table's leg column equals `NATIVE_LEGS`, that both figures are used, that no version number is typed, and that the workflow link is the workflow URL and no dated run. +- The syntax floor is measured, not read from the `tsdown` target (`esnext`): `scripts/syntax-floor.mjs` bundles each `exports` entry in memory with esbuild, polyfill and `jsbi` included, and parses it with acorn (`8.16.0`, exact) from `ecmaVersion` 2015 upward. An entry's floor is the lowest edition that parses; the page's floor is the highest entry floor. A bundle no edition parses exits 2 naming the entry; there is no fallback. The ECMA-262 edition table decides what each edition adds; acorn is the tool, not the authority. `gmtNodeEngines` comes from `packages/gmt/package.json` `engines.node`, and a missing field exits 1. +- Every cell that names a data source cites its primary page, or says "not documented". The iPhone row cites Apple App Review Guidelines §2.5.6 and Apple's BrowserEngineKit documentation, names no law or region, and says only "except where Apple allows another engine". Bun runs JavaScriptCore with its own data and no weekly run tests it. The page states Safari's native `Temporal` status only with a source from WebKit's feature status page or Apple's release notes, and otherwise says nothing, because Playwright's WebKit build is not Safari. +- The page names no browser version it has not run; versions belong to the weekly job summary. It links to the workflow, never to a dated run. The table passes `dox-tables` at 390px. +- Issue #316 and `bundle-size.mdx`, `CORE-80.md` and `domination/overview.md` name five legs (Node 26, Chromium, Firefox, WebKit on Linux and WebKit on macOS) in the reconsideration condition for host `Temporal`. diff --git a/context/canary/overview.md b/context/canary/overview.md new file mode 100644 index 000000000..ff4a8b58b --- /dev/null +++ b/context/canary/overview.md @@ -0,0 +1,71 @@ +# Canary overview + +## The canaries + +| Canary | Where | Checks | Files | Story | +| -------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| Workaround check (Node) | `temporal-oracle.yml` job `oracle`, `pnpm compat` | Each `temporalCompat` workaround's probes on Node: is the polyfill defect still there? | One issue per workaround removable on every engine in its scope | [CORE-81](../domination/issues/CORE-81.md) | +| Native oracle | `temporal-oracle.yml` job `oracle`, `pnpm compat:oracle` | GMT's calendar results against Chromium's native `Temporal`; test262 decides a disagreement | One `temporal-compat` issue for untagged mismatches | [CORE-81](../domination/issues/CORE-81.md) | +| Native suite | `temporal-oracle.yml` job `native-suite` | The whole `packages/gmt` suite on native `Temporal` and on the polyfill, per leg: Node 26, Chromium, Firefox, WebKit. Each browser leg also runs the workaround probes in that browser | One issue per engine for untagged divergences; one for host failures; one for control-only failures; stale tags | [CORE-82](../domination/issues/CORE-82.md) | +| Polyfill swap | `temporal-oracle.yml` job `polyfill-swap` | The suite on the newest `temporal-polyfill` beside `@js-temporal/polyfill`, per leg. The Node leg also sweeps every zone's offsets against `Intl.DateTimeFormat` and every calendar's years against Node | One issue when every leg passes: the swap is due | [CORE-92](../domination/issues/CORE-92.md), [CORE-110](../domination/issues/CORE-110.md) | +| Leap-second table | `leap-seconds.yml` | GMT's leap-second table against IERS `Leap_Second.dat`, or IANA `leap-seconds.list` when IERS is down | One issue per difference | [CORE-81](../domination/issues/CORE-81.md) | +| Dox weekly gate sweep | `dox-gates-weekly.yml` | Every Dox page's gates in Chromium, Firefox and WebKit, both themes | `dox-gate` issues | Dox epic: [../dox/built.md](../dox/built.md) | +| Runtime time zone data | `apps/dox/src/lib/runtime-tz-canary.test.ts`, in CI | The test machine's tzdb gives the 2026e offsets the Canada and Morocco pages state | Fails the Dox tests with "Update Node." | Dox epic | + +The first five run Mondays (06:17 and 06:43 UTC) and on manual dispatch. The gate sweep runs +Sundays. + +## Which browsers the canaries cover + +A browser's date results come from its engine: the `Temporal` and `Intl` code, and the ICU and +time zone data built with it. Most browsers share one of three engines, so a leg per engine +covers them. + +| Browser | Engine underneath | Leg | +| -------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------ | +| Chrome, Edge, Brave, Opera, Vivaldi, Arc, Samsung Internet | Chromium (V8, bundled ICU) | `chromium` | +| Firefox, Tor Browser, LibreWolf, Zen, Waterfox | Gecko (SpiderMonkey, bundled ICU) | `firefox` | +| Safari, and every browser on iOS | WebKit (JavaScriptCore, Apple's ICU and time zone data) | `webkit-macos` | +| DuckDuckGo | The system engine: WebKit on macOS and iOS, WebView2 (Chromium) on Windows, Chromium WebView on Android | `webkit-macos`, `chromium` | +| Node, Deno, Cloudflare Workers | V8 | `node` | + +The `webkit` leg runs Playwright's WebKit on Ubuntu, which takes its ICU and time zone data from +the runner's `libicu74`. The `webkit-macos` leg runs the same browser on a macOS runner, which uses +the ICU and time zone data Safari takes from macOS and iOS. The two differ (the tags in +`scripts/lib/native-suite-tags.mjs` record where), so each leg tests the data it names. +[CNRY-1](issues/CNRY-1.md) records the rules. + +## Rules every canary follows + +- **Manual and scheduled only.** Never part of `ci.yml` or `pnpm run validate`: "upstream still + broken" must never fail a build, and those runs have no network. +- **Issues only from `main`.** A run on another branch lists what it would file in the job + summary and files nothing. +- **One issue per finding.** A finding's key is a hidden marker on the issue's first line + (`scripts/lib/canary-issues.mjs`). An open `canary` issue with that marker gets a comment; a + repeat with nothing new is one line. +- **Dry runs are labelled.** Every dispatch input that forces a finding files a `[dry run]` + issue with the `canary-dry-run` label and changes no probe, tally or exit code. +- **Only the report job writes.** Jobs that install the workspace and run browsers hold a + read-only token; `report` runs first-party Node and `gh` alone, with `issues: write`. +- **A tag sorts, never skips.** A known failure is tagged in `scripts/lib/native-suite-tags.mjs` + with its evidence. The test still runs on every leg, and the tag goes stale, with a finding, + once the test stops failing that way. A control-only failure is never tagged: it is a wrong + answer GMT gives that runtime's users, and gets fixed. +- **Tags match Vitest titles exactly.** After any Vitest upgrade, check every tag against a + listing from the new Vitest. +- **A canary names its retirement.** A canary for a closed table or a temporary workaround says + in its header what retires it (the leap-second canary: IERS publishing its continuous-UTC + format). + +## Shared code + +- `scripts/canary-report.mjs` — the report job's entry point. +- `scripts/lib/canary-issues.mjs` — findings, issue keys, titles and bodies. +- `scripts/lib/canary-verdict.mjs`, `scripts/lib/canary-summary.mjs` — the verdict files the + jobs write, and the job summaries. +- `scripts/native-suite.mjs`, `scripts/lib/native-suite-compat.mjs`, + `scripts/lib/native-suite-tags.mjs` — the native-suite legs, the in-browser workaround check, + the known-failure tags. +- `scripts/lib/workarounds.mjs` — the workaround groups, their engine scope and removal triggers. +- Tests: `apps/dox/scripts/canary/*.test.ts`. diff --git a/context/canary/tracker.md b/context/canary/tracker.md new file mode 100644 index 000000000..bb25705c5 --- /dev/null +++ b/context/canary/tracker.md @@ -0,0 +1,30 @@ +# Canary — Tracker + +A row is a canary story with its own GitHub issue. New canary work is a `CNRY-` row with its +spec in [issues/](issues/). `/plan-story` and `/implement` take a `CNRY-*` ID like any other. + +The four canary stories built before this epic keep their `CORE-*` IDs and their records in +[../domination/issues/](../domination/issues/), and their rows stay in +[../domination/tracker.md](../domination/tracker.md) as well. A story ID never changes. + +`CNRY-*` work ships nothing in `packages/gmt`, so it carries no changeset unless it also changes +the package. + +| Order | Story | Title | Blocked by | GitHub Issue | Status | +| ----- | -------- | ------------------------------------------------------------------------------- | ---------- | ------------ | ------ | +| 1 | CORE-81 | Weekly Temporal oracle and leap-second canary open issues, not just write logs | — | #319 | Done | +| 2 | CORE-82 | The suite runs on native `Temporal`: Node 26, Chromium, Firefox, WebKit, weekly | — | #322 | Done | +| 3 | CORE-92 | Weekly check for a `temporal-polyfill` release GMT can swap to | — | #386 | Done | +| 4 | CORE-110 | The weekly upgrade check compares each calendar's years with native `Temporal` | — | #468 | Done | +| 5 | CNRY-1 | Safari's ICU and time zone data in the native suite, and a browser support page | — | #483 | Done | + +Canary issues fixed with no story of their own: + +- #361 the WebKit leg; #364 the workaround probes in each browser leg; #366 known failures no + longer fail a leg. +- #365, #393, #462 the first untagged failures on Chromium 153, Firefox 155 and WebKit 26, tagged + or fixed. +- #372, #373 the browser legs outgrew the runner; each browser pass now runs as eight shards. +- #380 the report job reads the newest verdict artifact after a rerun. +- #371 the leap-second canary falls back to IANA `leap-seconds.list` when IERS is down. +- PR #472 issues are filed only from `main`, one per engine, with one-line repeats. diff --git a/context/domination/issues/CORE-80.md b/context/domination/issues/CORE-80.md index c06a27910..349ece62a 100644 --- a/context/domination/issues/CORE-80.md +++ b/context/domination/issues/CORE-80.md @@ -31,7 +31,7 @@ In build order. Each part leaves `pnpm run validate` green on its own. 5. **Zone transitions.** Pass `until` in `certainlyTouchesMoreBuckets`. Keep a per-zone memo of transitions found and of stretches verified to have none. Read the clock once per public call. 6. **Epoch-day walks.** `walkSchedule` and `walkFreeTime` work in epoch days and epoch nanoseconds inside each stretch with no offset change. Counts use whole weeks times the weekly total, plus the leftover days, minus holidays found by binary search. Wall times resolve straight to epoch nanoseconds, with no string round-trip. 7. **Calendar resolution and formatter caches.** Holidays parsed once, by integer arithmetic, into a sorted array of epoch days. Calendars, schedules and zones resolved once per public call and handed to an internal core. Formatters cached by locale and resolved options. -8. **Polyfill strategy.** `@js-temporal/polyfill` stays the only engine in the published package. The seam from part 2 exists so CORE-82 can run the suite on native `Temporal`, not to switch engines. Host `Temporal` is reconsidered only when both hold: a stable Safari release ships `Temporal`, and CORE-82's weekly leg has passed on Node 26, Chromium, Firefox and WebKit for 12 consecutive weekly runs. Until then a host engine would change GMT's answers by browser, and the bundle saving would reach only some users. +8. **Polyfill strategy.** `@js-temporal/polyfill` stays the only engine in the published package. The seam from part 2 exists so CORE-82 can run the suite on native `Temporal`, not to switch engines. Host `Temporal` is reconsidered only when both hold: a stable Safari release ships `Temporal`, and CORE-82's weekly leg has passed on Node 26, Chromium, Firefox, WebKit on Linux and WebKit on macOS for 12 consecutive weekly runs. Until then a host engine would change GMT's answers by browser, and the bundle saving would reach only some users. 9. **Agent and rule changes.** A *Performance shape* section in `.agents/tdd-dev.md`, a *Cost* step in `.agents/gmt-reviewer.md`, three items in `context/code-review-checklist.md`, and a *Loop cost* paragraph in `context/coding-standards.md § Loop Style`. The text is in Part 3 of the audit. ## Tool @@ -75,7 +75,7 @@ Stated as current rules. Where each rule is enforced is named beside it. - A size budget is an entry's minified size after the last code change, plus 1%, rounded up to the next 0.1 kB. `pnpm run validate` fails above it. A budget is raised only by a reviewed edit to the budgets file. - Interim budgets follow one rule: cut bytes first, then raise. The root and `operatingTimeBetween` budgets were raised because the day-by-day schedule walk stays beside the new walk, near Temporal's limits. - A cost finding blocks in new or changed code only. One in code the diff did not touch is reported, not blocking. -- The polyfill stays the only engine in the published package. The seam exists so CORE-82 can run the suite on native `Temporal`. Host `Temporal` is reconsidered only when a stable Safari ships it and CORE-82's weekly leg has passed on Node 26, Chromium, Firefox and WebKit for 12 consecutive weekly runs. +- The polyfill stays the only engine in the published package. The seam exists so CORE-82 can run the suite on native `Temporal`. Host `Temporal` is reconsidered only when a stable Safari ships it and CORE-82's weekly leg has passed on Node 26, Chromium, Firefox, WebKit on Linux and WebKit on macOS for 12 consecutive weekly runs. - A speed or size change with no output change is a `patch`, and its changeset states the savings (row in [coding-standards § Changesets](../../coding-standards.md#changesets)). **Rules the change adds** (live in [coding-standards § Loop cost](../../coding-standards.md#loop-cost), the tdd-dev and gmt-reviewer personas, and the code-review checklist) diff --git a/context/domination/js-temporal-polyfill-bugs.md b/context/domination/js-temporal-polyfill-bugs.md index 36ebc299e..9e21ab91b 100644 --- a/context/domination/js-temporal-polyfill-bugs.md +++ b/context/domination/js-temporal-polyfill-bugs.md @@ -4,7 +4,7 @@ Record of the defects GMT needs fixed in `js-temporal/temporal-polyfill` (and, w `tc39/proposal-temporal`), the evidence for each, and what has been filed. The owner files every item, or tells an agent in plain words to post a named one: tc39 #3331 (J) and #3332 (K) were posted that way. It also lists GMT's five reports to `fullcalendar/temporal-polyfill`, found by the swap check -([research §4.6](../research/temporal-polyfill-swap.md#46-upstream)). +([research §4.6](research/temporal-polyfill-swap.md#46-upstream)). > **Status of this document:** updated 2026-11-04. **Filed:** 14 items by us, plus a comment on the > maintainer's own PR #361, and five reports to `fullcalendar/temporal-polyfill` (fc #119, #120, #121, #125, #126; see "Filed"). The newest is tc39 #3335 (AB, D21), 2026-10-31; before it, tc39 #3331 (J) and #3332 (K), both 2026-10-21. **All six js-temporal PRs @@ -31,10 +31,10 @@ is 0.5.1, and the latest ICU4C release is 78.3. | `D2`: buddhist dates before 1582 | js-temporal `2bb6ba1` | Nothing | | `D3`: Hebrew leap years for negative years | js-temporal `57d7734` (PR #361; `86a89df` on its branch) | `D4`. The two share one group and one code path, and leave together | | `D4`: Hebrew years 0 and earlier, one day off | ICU `5267bb5778` (unicode-org/icu, ICU-23007). Not a polyfill fix | An ICU4C release with that commit, and a Node release that bundles it as GMT's `engines.node` floor | -| `D16`: `formatRange` cuts long zone names to short and drops offset names (V8, JSC; ICU-20548) | Not a polyfill fix. ICU-20548 is open | An ICU release that keeps `long`, `longGeneric`, `shortOffset` and `longOffset` in range output, in every engine GMT supports. `pnpm compat` reports the Node half: the `D16` probes must all pass on the `engines.node` floor. The weekly `temporal-oracle` run runs the same probes in Chromium, Firefox and WebKit (`temporal-compat-` verdicts) and files the removal issue only when every engine says removable | +| `D16`: `formatRange` cuts long zone names to short and drops offset names (V8, JSC; ICU-20548) | Not a polyfill fix. ICU-20548 is open | An ICU release that keeps `long`, `longGeneric`, `shortOffset` and `longOffset` in range output, in every engine GMT supports. `pnpm compat` reports the Node half: the `D16` probes must all pass on the `engines.node` floor. The weekly `temporal-oracle` run runs the same probes in Chromium, Firefox, WebKit on Linux and WebKit on macOS (the `temporal-compat-chromium`, `-firefox`, `-webkit` and `-webkit-macos` verdicts) and files the removal issue only when all five sources say removable | | `D17`: Firefox `formatRange` prints AM/PM for a day period with a zone name (§ Q) | Not a polyfill fix. A SpiderMonkey bug, open as [Bugzilla 2085525](https://bugzilla.mozilla.org/show_bug.cgi?id=2085525) | A Firefox release that prints the flexible day period in a range: the weekly `temporal-oracle` run's compat check in Firefox (`temporal-compat-firefox`) reports D17 removable, and Firefox is the only engine in D17's scope | -| `D18`: Islamic dates before the Hijra read as positive years in WebKit (§ R) | None. Not filed yet | A js-temporal release that reads the Islamic eras (`main` declares them; whether its parser accepts WebKit's `Before Hijra` spelling is untested), or a WebKit that prints the year as V8 does, so every `D18` repro passes in the weekly `temporal-oracle` run's compat check in WebKit (`temporal-compat-webkit`); WebKit is the only engine in D18's scope | -| `D19`: `ZonedDateTime#equals` answers false for two identifiers of one zone where `resolvedOptions` keeps the identifier (§ U) | None. Not filed yet | A js-temporal release that finds a non-primary identifier's primary without `Intl.DateTimeFormat#resolvedOptions`, so the `D19` probe passes in the weekly `temporal-oracle` run's compat check in WebKit (`temporal-compat-webkit`); WebKit is the only engine in D19's scope | +| `D18`: Islamic dates before the Hijra read as positive years in WebKit (§ R) | None. Not filed yet | A js-temporal release that reads the Islamic eras (`main` declares them; whether its parser accepts WebKit's `Before Hijra` spelling is untested), or a WebKit that prints the year as V8 does, so every `D18` repro passes in the weekly `temporal-oracle` run's compat check in both WebKit builds (the `temporal-compat-webkit` and `temporal-compat-webkit-macos` verdicts, Linux and macOS); WebKit is the only engine in D18's scope | +| `D19`: `ZonedDateTime#equals` answers false for two identifiers of one zone where `resolvedOptions` keeps the identifier (§ U) | None. Not filed yet | A js-temporal release that finds a non-primary identifier's primary without `Intl.DateTimeFormat#resolvedOptions`, so the `D19` probe passes in the weekly `temporal-oracle` run's compat check in both WebKit builds (the `temporal-compat-webkit` and `temporal-compat-webkit-macos` verdicts, Linux and macOS); WebKit is the only engine in D19's scope | | `D20`: `PlainMonthDay.from` rejects an upper-case `iso8601` calendar annotation (§ V) | tc39 `385b479bf8` | A js-temporal rebase and a release | | `D21`: `Temporal.Now` reads a millisecond early after a pre-1970 clock reading (§ AB) | None. Filed as tc39 #3335 | A tc39 fix, the js-temporal rebase and a release, so the `D21` canary repro passes | | `D22`: a length in days or larger is measured from the wrong pass of a repeated hour (§ AC) | js-temporal `3c403686d39` | tc39 #3319 in the same release, or `P7D` with `largestUnit: "week"` regresses to `P1W1D`. A release that still strips the Asserts of tc39/proposal-temporal#3336, #3311 and #3310 keeps GMT's gate | @@ -2218,7 +2218,7 @@ Probe: `new Intl.DateTimeFormat("en", { hour: "numeric", dayPeriod: "short", tim ### Status -**Not filed.** Draft in the session scratchpad (`draft-upstream-polyfill-islamic-era.md`); the owner files it on js-temporal/temporal-polyfill. Reproduced with polyfill 0.5.1 in Playwright WebKit 26.6 (JavaScriptCore, macOS); V8 (Node 26, Chromium 153) and SpiderMonkey (Firefox 155) are right. GMT corrects it as `D18` (a lazy probe, dormant on every engine that passes), scoped to WebKit (`engines: ["webkit"]` in `scripts/lib/workarounds.mjs`, so the Node, Chromium and Firefox checks report it as out of scope, never removable). The removal signal is the weekly run's compat check in WebKit (`temporal-compat-webkit`): once every `D18` repro returns the spec value there, the run files the removal issue. js-temporal `main` declares the Islamic eras (`ah`, `bh`); whether its era parser accepts WebKit's `Before Hijra` spelling is untested, so a release may or may not retire D18 on its own. +**Not filed.** Draft in the session scratchpad (`draft-upstream-polyfill-islamic-era.md`); the owner files it on js-temporal/temporal-polyfill. Reproduced with polyfill 0.5.1 in Playwright WebKit 26.6 (JavaScriptCore, macOS); V8 (Node 26, Chromium 153) and SpiderMonkey (Firefox 155) are right. GMT corrects it as `D18` (a lazy probe, dormant on every engine that passes), scoped to WebKit (`engines: ["webkit"]` in `scripts/lib/workarounds.mjs`, so the Node, Chromium and Firefox checks report it as out of scope, never removable). The removal signal is the weekly run's compat check in both WebKit builds (the `temporal-compat-webkit` and `temporal-compat-webkit-macos` verdicts, Linux and macOS): once every `D18` repro returns the spec value in both, the run files the removal issue. js-temporal `main` declares the Islamic eras (`ah`, `bh`); whether its era parser accepts WebKit's `Before Hijra` spelling is untested, so a release may or may not retire D18 on its own. ### What goes wrong @@ -2252,7 +2252,7 @@ Before D18 the WebKit control pass of the native suite (the polyfill in WebKit) ### Status -**Not filed.** Draft in the session scratchpad (`draft-webkit-islamic-add-year.md`); the owner files it on bugs.webkit.org. Reproduced on WebKit 26.6's own `Temporal` (JavaScriptCore; Playwright's Linux build and the Mac build agree). The polyfill in the same WebKit, V8 (Node 26.12.1, Chromium 153) and SpiderMonkey (Firefox 155) give the spec value. Six rows of the native suite fail on it and are tagged with this anchor in `scripts/lib/native-suite-tags.mjs` (WebKit leg only). +**Not filed.** Draft in the session scratchpad (`draft-webkit-islamic-add-year.md`); the owner files it on bugs.webkit.org. Reproduced on WebKit 26.6's own `Temporal` (JavaScriptCore; Playwright's Linux build and the Mac build agree). The polyfill in the same WebKit, V8 (Node 26.12.1, Chromium 153) and SpiderMonkey (Firefox 155) give the spec value. Six rows of the native suite fail on it and are tagged with this anchor in `scripts/lib/native-suite-tags.mjs` (both WebKit legs, Linux and macOS). ### What goes wrong @@ -2282,7 +2282,7 @@ Only GMT run on WebKit's own `Temporal` sees it: `addDate`, `diffDateAsDuration` ### Status -**Not filed.** Draft in the session scratchpad (`draft-webkit-indian-add-year.md`); the owner files it on bugs.webkit.org. Reproduced on WebKit 26.6's own `Temporal` (JavaScriptCore; Playwright's Linux build and the Mac build agree). The polyfill in the same WebKit, V8 (Node 26.12.1, Chromium 153) and SpiderMonkey (Firefox 155) give the spec value. One row of the native suite fails on it and is tagged with this anchor in `scripts/lib/native-suite-tags.mjs` (WebKit leg only). +**Not filed.** Draft in the session scratchpad (`draft-webkit-indian-add-year.md`); the owner files it on bugs.webkit.org. Reproduced on WebKit 26.6's own `Temporal` (JavaScriptCore; Playwright's Linux build and the Mac build agree). The polyfill in the same WebKit, V8 (Node 26.12.1, Chromium 153) and SpiderMonkey (Firefox 155) give the spec value. One row of the native suite fails on it and is tagged with this anchor in `scripts/lib/native-suite-tags.mjs` (both WebKit legs, Linux and macOS). ### What goes wrong @@ -2323,7 +2323,7 @@ native WebKit `Temporal`, Node 26, Chromium 153 and Firefox 155. Confirmed on po No upstream issue found (searched the polyfill's issues for `resolvedOptions`, `canonical` and `GetAvailableNamedTimeZoneIdentifier`). GMT works around it as temporalCompat **D19** (`temporalCompat/timeZoneEquals.ts`, probe `isTimeZoneEqualsCompatNeeded`), scoped to WebKit (`engines: ["webkit"]` in `scripts/lib/workarounds.mjs`, so the -Node, Chromium and Firefox checks report it out of scope, and the weekly run's `temporal-compat-webkit` verdict decides). +Node, Chromium and Firefox checks report it out of scope, and the weekly run's `temporal-compat-webkit` and `temporal-compat-webkit-macos` verdicts decide). ### What goes wrong @@ -2740,3 +2740,103 @@ None in the library, which gives `P1W` on the polyfill. Only GMT run on Node 26' earlier-pass rows of the same table pass on Node 26. The native-suite runner tags the two rows of `packages/gmt/src/test/laterPassOrigin.test.ts` that pin it, the UTC and New York noon origins, to this section (Node leg only). When a Node release carries a `temporal_rs` with #723, the tags go stale and the runner reports it. + +## AE. ICU4C 75+ counts every Persian year before year 0 as a leap year (macOS WebKit, engine) + +### Status + +**Not filed yet.** The filing text is below; the owner decides where it goes. The tracker is the ICU Jira (project ICU, component calendar). Cause: ICU4C commit `d43d216feb` (ICU-22633, 2024-03-08) changed `PersianCalendar::isLeapYear` in `i18n/persncal.cpp` from + +```cpp +ClockMath::floorDivide(25*year+11, 33, &remainder); return remainder < 8; +``` + +to + +```cpp +int64_t y = year*25LL+11LL; return (y % 33L < 8); +``` + +C++ `%` rounds toward zero, so for every year -1 and earlier the remainder is zero or negative, which is below 8, and the year counts as leap. The change is in ICU4C 75-1 and every later release (read in the release tags 75-1, 76-1, 77-1 and 78.1 and in `main`; 77-1, 78.1 and `main` add a table of corrections for some later years, but keep the `%` line); release 74-2 still uses `floorDivide`, and ICU4J still does. ICU4C 78.3 gives the symptom (see the check below). Reproduced on WebKit 26.6's own `Temporal` as built for macOS (Playwright 1.63.0, macOS 27.0.1, Apple's libicucore). Playwright's Linux WebKit 26.6 links the runner's ICU 74, so it is right; Chromium 153 and Node 26 do their calendar arithmetic in temporal_rs on ICU4X, so they are right too. Intl formatting on the same Mac is right because it goes through `firstJulianOfYear`, which still uses `floorDivide`. The polyfill does its own arithmetic and is right. Two rows of the native suite fail on it and are tagged with this anchor in `scripts/lib/native-suite-tags.mjs` (`webkit-macos` leg only). + +**Risk:** if the Linux runner's ICU moves to 75 or later, the Playwright `webkit` leg starts failing the same two rows, and the two tags need that leg. + +### What goes wrong + +A Persian year before year 0 counts as leap in every case: in WebKit on macOS `inLeapYear` is true for 272,441 of the 272,441 years from -272441 to -1, where the correct count is 66,046 (Chromium and Node give it). Year 0 and years 1 and later are right. The calendar then thinks Esfand (`M12`) has 30 days in a common year. That is not a range-limit problem: it happens at ordinary years. + +- Adding a month to the 30th of `M11`, or subtracting a month from the 30th of `M01`, lands in a 29-day Esfand and has to constrain the day to 29. WebKit throws `RangeError: Result of calendar date addition is outside representable range` instead. The result is inside the supported range. +- `daysInMonth` for Esfand of such a year says 30, but `from({ calendar: "persian", year: -722, monthCode: "M12", day: 30 }, { overflow: "reject" })` throws "Day is out of range for the given month in this calendar", so the two answers disagree. +- With the default `constrain` the same call returns a wrong date without an error: `-000100-03-21[u-ca=persian]` (1 Farvardin of year -721), where the day should be constrained to the 29th of Esfand, `-000100-03-20`. + +No test262 file covers a negative Persian year: `intl402/Temporal/Calendar/prototype/inLeapYear/basic-persian.js` covers 1348 to 1427, `add/constrain-day-persian.js` covers 1362 to 1364, and `from/extreme-dates.js` covers the minimum only. So the expected values come from the Temporal specification (`overflow: "constrain"` clamps a day past the end of the month, and the calendar's year and month lengths follow the Intl Era and Month Code rules), and Node, Chromium and Linux WebKit agree with them. + +### Repro (macOS WebKit 26.6 native `Temporal`; expected values Node 26.12.1 native `Temporal`, which Chromium 153 and Linux WebKit also give) + +| Call | macOS WebKit | Expected | +| ---- | ------------ | -------- | +| `PlainDate.from({ calendar: "persian", year: -722, monthCode: "M11", day: 30 }).add({ months: 1 })` (`-000100-02-19`) | throws `RangeError: Result of calendar date addition is outside representable range` | `-000100-03-20[u-ca=persian]` (year -722, M12, day 29) | +| `PlainDate.from({ calendar: "persian", year: -721, monthCode: "M01", day: 30 }).subtract({ months: 1 })` (`-000100-04-19`) | throws the same `RangeError` | `-000100-03-20[u-ca=persian]` | +| `PlainDate.from({ calendar: "persian", year: -722, monthCode: "M12", day: 30 })` | `-000100-03-21[u-ca=persian]` (year -721, M01, day 1) | `-000100-03-20[u-ca=persian]` | +| the same with `{ overflow: "reject" }` | throws `RangeError: Day is out of range for the given month in this calendar` | throws a `RangeError` | +| `PlainDate.from("-271820-03-11[u-ca=persian]").add({ months: 1 })` (year -272442, M11 day 30; the suite's `xscan persian min[327]` row) | throws the same `RangeError` | `-271820-04-09[u-ca=persian]` | +| `PlainDate.from("-271820-05-09[u-ca=persian]").subtract({ months: 1 })` (year -272441, M01 day 30; the suite's `D1-A persian (xscan min[386])` row) | throws the same `RangeError` | `-271820-04-09[u-ca=persian]` | +| `PlainDate.from({ calendar: "persian", year: 1402, monthCode: "M11", day: 30 }).add({ months: 1 })` | `2024-03-19[u-ca=persian]` | `2024-03-19[u-ca=persian]` | +| `PlainDate.from({ calendar: "persian", year: 0, monthCode: "M12", day: 1 }).daysInMonth` | 29 | 29 | + +ICU4C 78.3 check (`ucal_open` with `en@calendar=persian`, `ucal_getLimit(UCAL_DATE, UCAL_ACTUAL_MAXIMUM)` on Esfand (ICU month 11, counted from 0) and `UCAL_DAY_OF_YEAR` for the year): year 1403 gives 30 and 366 (right), 1402 gives 29 and 365, year 1 gives 30 and 366 (right), year 0 gives 29 and 365 (right), years -1, -2, -722 and -272442 give 30 and 366 where they should give 29 and 365; year -721 gives 30 and 366, which is right (it is a leap year). + +The raw polyfill (0.5.1) throws `RangeError: Invalid ISO date: -271821-01-01T00:00Z` on the two suite rows in every engine, which is polyfill defect `D1`; GMT's workaround for it gives the right answer, so GMT on the polyfill passes in macOS WebKit. + +### Effect on GMT + +Only GMT run on macOS WebKit's own `Temporal` sees it: `addDate` and `subtractDate` return the sentinel `''` where the engine throws, and a day 30 of Esfand would be read as the next year's first day. The two native-suite rows (`plain/calculate/addDate.test.ts`, the `xscan persian min[327]` row, and `plain/calculate/subtractDate.test.ts`, the `D1-A persian (xscan min[386])` row) are tagged to this section for the `webkit-macos` leg; the tag goes stale, with a finding, once the Mac's ICU counts the years right. GMT on the polyfill is right. + +### Filed text + +Title: Persian calendar: isLeapYear says every year before year 0 is a leap year (ICU4C 75 and later) + +Since ICU4C 75, `PersianCalendar::isLeapYear` says that every Persian year before year 0 is a leap year. Years 0 and later are right, and ICU4C 74 is right. + +The cause is commit d43d216feb (ICU-22633, March 2024). It replaced + + ClockMath::floorDivide(25 * year + 11, 33, &remainder); + return (remainder < 8); + +with + + int64_t y = year * 25LL + 11LL; + return (y % 33L < 8); + +In C++, `%` rounds toward zero, so for a negative year `y % 33` is zero or negative, and a number that small is always below 8. `floorDivide` gave a remainder from 0 to 32, which is what the rule needs. ICU4J still uses `floorDivide`. + +How to see it with ICU4C 78.3: open a calendar with `ucal_open(u"UTC", -1, "en@calendar=persian", UCAL_DEFAULT, &status)`, set the extended year, month 11 (Esfand, since ICU counts months from 0) and date 1, then call `ucal_getLimit` with `UCAL_DATE` and `UCAL_ACTUAL_MAXIMUM`, and with `UCAL_DAY_OF_YEAR` and `UCAL_ACTUAL_MAXIMUM`. + +- Year 1403: 30 days in Esfand, 366 days in the year (right). +- Year 1402: 29 and 365 (right). +- Year 1: 30 and 366 (right). +- Year 0: 29 and 365 (right). +- Year -722: 30 and 366. It should be 29 and 365. +- Years -1, -2 and -272442 also give 30 and 366. They should be 29 and 365. (Year -721 is a leap year, so 30 and 366 is right for it.) + +It shows in WebKit's Temporal on macOS (WebKit 26.6, Playwright's macOS build, on macOS 27.0.1 with the system ICU, libicucore), which uses this code. Temporal counts months from 1, so Bahman is month 11 and Esfand is month 12. Adding one month to day 30 of Bahman in year -722 throws `RangeError: Result of calendar date addition is outside representable range`, where it should give day 29 of Esfand. Creating day 30 of Esfand in year -722 gives the first day of year -721 instead of day 29 of Esfand. Formatting dates is not affected, because it does not use `isLeapYear` for this. + +The fix is to go back to `floorDivide`, or to use a modulo that floors, for example `((y % 33) + 33) % 33 < 8`. + +### POSIX zone ids: draft for bugs.webkit.org (not filed) + +Title: Temporal and Intl reject the time zone ids CST6CDT, EST5EDT, MST7MDT and PST8PDT + +WebKit 26.6 (Playwright's builds for Linux and for macOS 27.0.1) does not accept four time zone identifiers that the time zone database defines as zones: `CST6CDT`, `EST5EDT`, `MST7MDT` and `PST8PDT`. Chromium 153, Firefox 155 and Node 26 accept them. + +What I did, with `id` set to each of the four in turn (the output below is for `EST5EDT`; the other three are the same except for the name): + +1. `new Intl.DateTimeFormat("en", { timeZone: "EST5EDT" })` throws `RangeError: invalid time zone: EST5EDT`. +2. `Temporal.ZonedDateTime.from("2024-07-15T12:00:00-04:00[EST5EDT]")` throws `RangeError: '2024-07-15T12:00:00-04:00[EST5EDT]' contains an invalid time zone identifier`. +3. `new Temporal.ZonedDateTime(0n, "EST5EDT")` throws `RangeError: 'EST5EDT' is not a valid time zone identifier`. + +The other legacy ids work in the same WebKit on macOS: `CET`, `EET`, `MET`, `WET`, `EST`, `MST` and `HST` are accepted by `Intl.DateTimeFormat` and by `new Temporal.ZonedDateTime(0n, id)`. + +Why I think the four ids are valid: the time zone database release 2026e, in its file `backward`, defines them as zones: `Zone EST5EDT -5:00 USback E%sT`, `Zone CST6CDT -6:00 USback C%sT`, `Zone MST7MDT -7:00 USback M%sT` and `Zone PST8PDT -8:00 USback P%sT`. ECMA-402 section 6.5 (Use of the IANA Time Zone Database) says that each Zone in the IANA Time Zone Database must be a primary time zone identifier, so these four should be accepted and `Temporal` should treat them as named zones. + +What I expected: the same results as in Chromium, Firefox and Node, for example `new Intl.DateTimeFormat("en", { timeZone: "EST5EDT" }).resolvedOptions().timeZone` returns `"EST5EDT"`. diff --git a/context/domination/overview.md b/context/domination/overview.md index 990b35623..a90cc71e8 100644 --- a/context/domination/overview.md +++ b/context/domination/overview.md @@ -60,7 +60,7 @@ realm. [tracker.md](tracker.md) has the 51 stories in build order. | Authority order | **International first.** An international treaty or standards body, then a multinational industry body, then national sources only as labelled peers. No national system, agency or convention is a default, the sole authority, or gets its own named function; with no international source, a GMT rule backed by sources from at least two countries. Example: the six GNSS are peers because each is an IMO-recognised WWRNS component, not because any one nation's document says so. Examples are spread across regions (tracker, "Added for this epic"). | | Law | **GMT tracks no law.** Regulated windows, limits and tables — from legislatures, regulators, treaties and professional bodies alike — are caller parameters with no defaults; nothing names a statute, agency or jurisdiction in code or docs (tracker, "Added for this epic"). | | Calendar semantics | **TC39 Temporal is the authority.** Arithmetic clamps a non-existent day (`overflow: "constrain"`); parsers reject. Matches EU, UK and US law and every major library but date-fns. | -| Temporal engine | **The polyfill only.** `@js-temporal/polyfill` is the engine in the published package. CORE-80's seam lets CORE-82 run the suite on native `Temporal` weekly. Host `Temporal` is reconsidered when a stable Safari ships it and CORE-82's leg has passed on Node 26, Chromium, Firefox and WebKit for 12 consecutive weekly runs. | +| Temporal engine | **The polyfill only.** `@js-temporal/polyfill` is the engine in the published package. CORE-80's seam lets CORE-82 run the suite on native `Temporal` weekly. Host `Temporal` is reconsidered when a stable Safari ships it and CORE-82's leg has passed on Node 26, Chromium, Firefox, WebKit on Linux and WebKit on macOS for 12 consecutive weekly runs. | | Zone-aware boundaries | **Real boundaries, never truncate-and-re-resolve.** `start ≤ input < next start`, via `internal/zonedBucket.ts`; tested on the probe zones. See [coding-standards § Calendar & zone semantics](../coding-standards.md#calendar--zone-semantics). | ### Why the build order changed diff --git a/package.json b/package.json index 4c6167adf..8751e2f8c 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@tanstack/intent": "^0.4.0", "@types/node": "^22.13.10", "@vitest/browser-playwright": "5.0.5", + "acorn": "8.16.0", "esbuild": "^0.28.2", "fallow": "^3.35.0", "oxfmt": "^0.67.0", diff --git a/packages/gmt/src/internal/temporalCompat/README.md b/packages/gmt/src/internal/temporalCompat/README.md index 1796dcfca..bb6d1bc69 100644 --- a/packages/gmt/src/internal/temporalCompat/README.md +++ b/packages/gmt/src/internal/temporalCompat/README.md @@ -189,10 +189,10 @@ limits) is the `D1` group. | D13 | A js-temporal release on which **every** `D13` probe returns the spec value, the `stall.*` ones within 20,000 offset reads. `a79c6a1` (per-zone transition search windows, on main, in no release) is **not** enough: it fixes the zones it lists, leaves `bisect` unchanged, and gives `Africa/El_Aaiun` a 17-day window that holds three offsets in April 1976, so `stall.nextElAaiun` fails there and GMT would hang without the workaround (bug doc § K; not filed). Expected values are Node 26.10.0's native Temporal and `zdump -v` | | D14 | A js-temporal release contains the port of tc39/proposal-temporal#3312 (reference polyfill commit `59a51ea9d4`), so the `D14` probe returns `2010-03-04T00:00:00+11:00[Antarctica/Casey]`. Expected values are test262 `intl402/Temporal/ZonedDateTime/prototype/round/same-date-starts-twice.js` | | D15 | A js-temporal release (and a Node whose V8 matches) in which `ToTemporalZonedDateTime` keeps a `Z` string's own instant under `offset: "ignore"`, so the `D15` probe returns `2022-07-08T00:14:07Z`. Expected value is the specification's (`InterpretISODateTimeOffset`), not an oracle run: native V8 has the defect too. js-temporal `main` (`c55b211`) and tc39/proposal-temporal `main` (`e8cc03f`) still have it (bug doc § O) | -| D16 | An ICU release that fixes ICU-20548 is bundled by GMT's `engines.node` floor (`>=22.16.0`) and by every browser the native suite runs, so every `D16` repro passes on every engine (the range's zone name equals the single format's for all six styles). `pnpm compat` reports Node; the weekly `temporal-oracle` run runs the same probes in Chromium, Firefox and WebKit (`scripts/lib/native-suite-compat.mjs`, one `temporal-compat-` verdict each) and files the removal issue only when every engine says removable. The expected value is a self-comparison, so GMT owns no CLDR string | +| D16 | An ICU release that fixes ICU-20548 is bundled by GMT's `engines.node` floor (`>=22.16.0`) and by every browser the native suite runs, so every `D16` repro passes on every engine (the range's zone name equals the single format's for all six styles). `pnpm compat` reports Node; the weekly `temporal-oracle` run runs the same probes in Chromium, Firefox, WebKit on Linux and WebKit on macOS (`scripts/lib/native-suite-compat.mjs`, one `temporal-compat-` verdict each) and files the removal issue only when every engine says removable. The expected value is a self-comparison, so GMT owns no CLDR string | | D17 | The weekly `temporal-oracle` run's compat check in Firefox (`temporal-compat-firefox`) reports D17 removable: every `D17` repro passes in the Firefox the native suite runs, once Firefox prints the flexible day period in a range (Bugzilla 2085525). D17 names `engines: ["firefox"]` (`scripts/lib/workarounds.mjs`), so Firefox is the only engine in its scope; `pnpm compat` and the Chromium and WebKit checks report it out of scope, never removable. The expected value is a self-comparison, so GMT owns no CLDR string | -| D18 | The weekly `temporal-oracle` run's compat check in WebKit (`temporal-compat-webkit`) reports D18 removable: every `D18` repro passes in the WebKit the native suite runs, once a js-temporal release reads the Islamic eras (`main` declares `ah` and `bh` for the Islamic helpers; whether its era parser accepts WebKit's `Before Hijra` spelling is untested) or WebKit prints the year as V8 does. D18 names `engines: ["webkit"]` (`scripts/lib/workarounds.mjs`), so WebKit is the only engine in its scope; `pnpm compat` and the Chromium and Firefox checks report it out of scope, never removable. Expected values are Node 26.12.1's native Temporal | -| D19 | A js-temporal release whose TimeZoneEquals finds the primary identifier on a host whose `Intl.DateTimeFormat#resolvedOptions` returns the identifier as written (the Time Zone Canonicalization proposal's rule, which JavaScriptCore applies today): the weekly `temporal-oracle` run's compat check in WebKit (`temporal-compat-webkit`) reports D19 removable once the `D19` probe (`Etc/UTC` equals `UTC`) passes there. D19 names `engines: ["webkit"]` (`scripts/lib/workarounds.mjs`), so `pnpm compat` and the Chromium and Firefox checks report it out of scope, never removable; a failing probe on any engine still keeps it. Widen `engines` when another engine keeps the identifier as written. The expected value is the pair ECMA-402 §6.5 fixes, so GMT owns no time zone data | +| D18 | The weekly `temporal-oracle` run's compat check in WebKit (the `temporal-compat-webkit` and `temporal-compat-webkit-macos` verdicts, Linux and macOS) reports D18 removable: every `D18` repro passes in the WebKit the native suite runs (Linux and macOS), once a js-temporal release reads the Islamic eras (`main` declares `ah` and `bh` for the Islamic helpers; whether its era parser accepts WebKit's `Before Hijra` spelling is untested) or WebKit prints the year as V8 does. D18 names `engines: ["webkit"]` (`scripts/lib/workarounds.mjs`), so WebKit is the only engine in its scope; `pnpm compat` and the Chromium and Firefox checks report it out of scope, never removable. Expected values are Node 26.12.1's native Temporal | +| D19 | A js-temporal release whose TimeZoneEquals finds the primary identifier on a host whose `Intl.DateTimeFormat#resolvedOptions` returns the identifier as written (the Time Zone Canonicalization proposal's rule, which JavaScriptCore applies today): the weekly `temporal-oracle` run's compat check in WebKit (the `temporal-compat-webkit` and `temporal-compat-webkit-macos` verdicts, Linux and macOS) reports D19 removable once the `D19` probe (`Etc/UTC` equals `UTC`) passes there. D19 names `engines: ["webkit"]` (`scripts/lib/workarounds.mjs`), so `pnpm compat` and the Chromium and Firefox checks report it out of scope, never removable; a failing probe on any engine still keeps it. Widen `engines` when another engine keeps the identifier as written. The expected value is the pair ECMA-402 §6.5 fixes, so GMT owns no time zone data | | D20 | A js-temporal release carrying tc39 `385b479bf8` ("Canonicalize calendar before checking YYYY-MM or MM-DD format"), so the `D20` probe (`--12-25[u-ca=ISO8601]` reads as `12-25` and `2026-10[u-ca=ISO8601]` as `2026-10`) passes on Node. The expected value is the specification's, so GMT owns no calendar data | | D21 | A js-temporal release whose `SystemUTCEpochNanoSeconds` carries a floored modulo (or none), so the `D21` repro (the second `Temporal.Now.instant()` with `Date.now()` at 1960-01-01T00:00:00Z reads 1960) passes on Node; tc39/proposal-temporal#3335. The expected value is the specification's and test262's, not an oracle run | | D22 | A js-temporal release contains `3c403686d39` ("fix for issues #3141, #3148 and #3149", on `main`, no filing needed) and tc39/proposal-temporal#3319, so every `D22` repro passes, `P7D` with `largestUnit: "week"` giving `P1W` among them. `3c403686d39` alone is not enough: it tests `r1 = 0`, where #3319 and tc39/ecma262#3759 test for an empty date duration. `main` (read, not run) does not yet carry #3319, so by its source `P7D` gives `P1W1D` there, where TC39 and Chromium 153 give `P1W`. The release must also give no value for every read in `totalsWithNoValue`, `noDayCorrection` and `emptyDaySpan`: `main` has the window, sign and day-correction Asserts in its source and strips them from a production build, so by that reading it fails those repros. The repros are samples of each shape, so `test/noSpecValue.test.ts` must also pass on the release (bug doc § AC) | diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43a7afb90..0f836b48e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -188,6 +188,9 @@ importers: '@vitest/browser-playwright': specifier: 5.0.5 version: 5.0.5(playwright@1.63.0)(vite@8.3.5(@types/node@22.19.17)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.12)(yaml@2.9.0))(vitest@5.0.5) + acorn: + specifier: 8.16.0 + version: 8.16.0 esbuild: specifier: ^0.28.2 version: 0.28.2 diff --git a/scripts/deps.mjs b/scripts/deps.mjs index 7358e171b..644a6dfcc 100644 --- a/scripts/deps.mjs +++ b/scripts/deps.mjs @@ -2,7 +2,7 @@ /** * Story dependency tooling for the epic trackers. * - * node scripts/deps.mjs check validate both trackers; exit 1 on drift + * node scripts/deps.mjs check validate the three trackers; exit 1 on drift * node scripts/deps.mjs sync regenerate the domination `Blocked by` column and * `context/domination/issues/index.md` * node scripts/deps.mjs ready list stories nothing is blocking (a `Waiting` row is not one) @@ -19,6 +19,10 @@ * tracker rows are GitHub issues that bundle several sub-stories. So an issue's cell is the * union of its sub-stories' dependencies, mapped back to issue numbers. Every Dox story is * done and `context/dox/issues/` no longer exists, so today every Dox cell is `—`. + * + * The canary tracker's `Blocked by` cell is written by hand: canary stories are few and name + * their blockers in the row. `check` makes sure each one is a story some tracker knows and is + * not already `Done`. */ import { existsSync, readFileSync, writeFileSync, readdirSync } from "node:fs"; @@ -28,6 +32,7 @@ const DOMINATION_ISSUES = "context/domination/issues"; const DOMINATION_INDEX = `${DOMINATION_ISSUES}/index.md`; const DOX = "context/dox/tracker.md"; const DOX_ISSUES = "context/dox/issues"; +const CANARY = "context/canary/tracker.md"; const DOX_SUB = /\bitem (DOX-[A-E]\d+[a-z]?)\b/; const DOX_ID = /\bDOX-[A-E]\d+[a-z]?\b/g; @@ -178,6 +183,7 @@ function doxIssueDeps(rows) { */ const DOMINATION_COLUMNS = { Story: 1, "Blocked by": 4 }; const DOX_COLUMNS = { Story: 1, "Blocked by": 2, "GitHub Issue": 3 }; +const CANARY_COLUMNS = { Story: 1, "Blocked by": 3, "GitHub Issue": 4 }; /** * Fail loudly when a tracker's header row is not the shape the index-based code assumes. @@ -249,6 +255,12 @@ const doxTracker = () => depColumn: DOX_COLUMNS["Blocked by"], columns: DOX_COLUMNS, }); +const canaryTracker = () => + parseTracker(CANARY, { + idColumn: CANARY_COLUMNS.Story, + depColumn: CANARY_COLUMNS["Blocked by"], + columns: CANARY_COLUMNS, + }); /** * The bare story ID or issue number in a cell entry. @@ -469,6 +481,23 @@ function check() { } } + // Canary: the hand-written cell names stories some tracker knows, none of them Done. + const canary = canaryTracker(); + const allStatus = new Map( + [...rows, ...canary.rows].map((r) => [r.id, r.status]), + ); + for (const r of canary.rows) { + for (const d of r.deps.map(bareId)) { + const status = allStatus.get(d); + if (status === undefined) + problems.push(`canary ${r.id}: blocked by unknown story ${d}`); + else if (status.startsWith("Done")) + problems.push( + `canary ${r.id}: ${d} is Done — remove it from Blocked by`, + ); + } + } + for (const w of warnings) console.warn(` warning: ${w}`); if (problems.length) { console.error( @@ -478,7 +507,7 @@ function check() { } const suffix = warnings.length ? `, ${warnings.length} unresolved` : ""; console.log( - `deps check: ${rows.length} domination + ${dox.rows.length} dox rows OK${suffix}`, + `deps check: ${rows.length} domination + ${dox.rows.length} dox + ${canary.rows.length} canary rows OK${suffix}`, ); } @@ -511,6 +540,13 @@ function ready() { const doxReady = doxOpen.filter((r) => isReady(r.cells[2])); console.log(`\nDox — ${doxReady.length} ready of ${doxOpen.length} open:`); for (const r of doxReady) console.log(` ${r.id}`); + + const canaryOpen = open(canaryTracker().rows); + const canaryReady = canaryOpen.filter((r) => isReady(r.cells[3])); + console.log( + `\nCanary — ${canaryReady.length} ready of ${canaryOpen.length} open:`, + ); + for (const r of canaryReady) console.log(` ${r.id}`); } /** Reverse lookup against the permanent graph in the issue files. */ diff --git a/scripts/lib/canary-issues.mjs b/scripts/lib/canary-issues.mjs index b940d9087..7eb284b30 100644 --- a/scripts/lib/canary-issues.mjs +++ b/scripts/lib/canary-issues.mjs @@ -21,26 +21,51 @@ export const DRY_RUN_LABEL = "canary-dry-run"; export const COMPAT_LABEL = "temporal-compat"; /** GitHub issue type every canary issue is created with. */ export const ISSUE_TYPE = "Task"; -/** The four `temporal-polyfill` swap legs' verdict sources (CORE-92), in leg order. */ -export const SWAP_SOURCES = [ - "temporal-polyfill-swap-node", - "temporal-polyfill-swap-chromium", - "temporal-polyfill-swap-firefox", - "temporal-polyfill-swap-webkit", +/** + * The native-suite legs, in the order their findings and summary rows list them. Derived from + * `ENGINE_IDS`, the one list: a new leg is added there and nowhere else. + */ +export const NATIVE_LEGS = Object.keys(ENGINE_IDS); +/** + * The `temporal-polyfill` swap legs (CORE-92). The swap runs on one host per engine, so it keeps + * its own four legs when the native suite gains a second WebKit leg. + */ +export const SWAP_LEGS = ["node", "chromium", "firefox", "webkit"]; +/** The swap legs' verdict sources, in leg order. */ +export const SWAP_SOURCES = SWAP_LEGS.map( + (leg) => `temporal-polyfill-swap-${leg}`, +); + +const CHECK = "temporal-compat-check"; +/** @param {string} leg */ +const COMPAT = (leg) => `temporal-compat-${leg}`; +/** @param {string} leg */ +const NATIVE = (leg) => `native-suite-${leg}`; +/** @param {string} leg */ +const SWAP = (leg) => `temporal-polyfill-swap-${leg}`; +/** + * Every source that judges the workaround groups, the Node check first, then one browser per + * native-suite leg. A group is removable when every source in its scope says so. + */ +export const COMPAT_SOURCES = [ + CHECK, + ...NATIVE_LEGS.filter((leg) => leg !== "node").map(COMPAT), ]; +/** The engine a compat source runs on, with or without its verdict. */ +const SOURCE_ENGINE = Object.fromEntries([ + [CHECK, ENGINE_IDS.node], + ...NATIVE_LEGS.filter((leg) => leg !== "node").map((leg) => [ + COMPAT(leg), + /** @type {Record} */ (ENGINE_IDS)[leg], + ]), +]); /** The verdict sources each workflow reads, in the order its could-not-run message lists them. */ export const WORKFLOW_SOURCES = { "temporal-oracle": [ - "temporal-compat-check", - "temporal-compat-chromium", - "temporal-compat-firefox", - "temporal-compat-webkit", + ...COMPAT_SOURCES, "temporal-oracle", - "native-suite-node", - "native-suite-chromium", - "native-suite-firefox", - "native-suite-webkit", + ...NATIVE_LEGS.map(NATIVE), ...SWAP_SOURCES, ], "leap-seconds": ["leap-seconds"], @@ -54,36 +79,11 @@ export const WORKFLOW_SOURCES = { */ const UNTAGGED_GROUPS_IN_BODY = 50; -const CHECK = "temporal-compat-check"; -/** @param {string} leg */ -const COMPAT = (leg) => `temporal-compat-${leg}`; -/** - * Every source that judges the workaround groups, the Node check first, then one browser per - * native-suite leg. A group is removable when every source in its scope says so. - */ -export const COMPAT_SOURCES = [ - CHECK, - COMPAT("chromium"), - COMPAT("firefox"), - COMPAT("webkit"), -]; -/** The engine a compat source runs on, with or without its verdict. */ -const SOURCE_ENGINE = { - [CHECK]: ENGINE_IDS.node, - [COMPAT("chromium")]: ENGINE_IDS.chromium, - [COMPAT("firefox")]: ENGINE_IDS.firefox, - [COMPAT("webkit")]: ENGINE_IDS.webkit, -}; const ORACLE = "temporal-oracle"; const LEAP = "leap-seconds"; const LEAP_IANA = "IANA leap-seconds.list"; const LEAP_IANA_URL = "https://data.iana.org/time-zones/tzdb/leap-seconds.list"; const LEAP_IERS_URL = "https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat"; -/** The native-suite legs, in the order their findings and summary rows list them. */ -const NATIVE_LEGS = ["node", "chromium", "firefox", "webkit"]; -/** @param {string} leg */ -const NATIVE = (leg) => `native-suite-${leg}`; -const SWAP = (leg) => `temporal-polyfill-swap-${leg}`; const SWAP_NODE = SWAP("node"); const SWAP_RESEARCH_URL = "https://github.com/northguild/gmt/blob/main/context/domination/research/temporal-polyfill-swap.md"; @@ -138,7 +138,7 @@ const FORCED_ROW = { * workarounds: Workaround[], forced?: { removable: string }, * }} CompatCheckVerdict * @typedef {{ - * source: string, status: "ran", leg: "chromium" | "firefox" | "webkit", engine: string, + * source: string, status: "ran", leg: "chromium" | "firefox" | "webkit" | "webkit-macos", engine: string, * engineId: "v8" | "firefox" | "webkit", * runtime: { polyfill: string, node: string, playwright: string }, * counts: CompatCounts, workarounds: Workaround[], @@ -167,7 +167,7 @@ const FORCED_ROW = { * after they ran * @typedef {{ file: string, test: string, message: string }} NativeFailure * @typedef {{ - * source: string, status: "ran", leg: "node" | "chromium" | "firefox" | "webkit", engine: string, + * source: string, status: "ran", leg: "node" | "chromium" | "firefox" | "webkit" | "webkit-macos", engine: string, * runtime: { node: string, vitest: string, playwright: string | null }, * counts: { files: number, tests: number, passed: number, skipped: number, tagged: number, untagged: number, * hostTagged: number, hostUntagged: number, controlOnly: number, staleTags: number }, @@ -319,7 +319,7 @@ function forceNativeFailure(copy, skipped) { * @param {{ flag: string, reason: string }[]} skipped */ function forceSwapReady(copy, skipped) { - const first = NATIVE_LEGS.find((leg) => copy[SWAP(leg)]?.status === "ran"); + const first = SWAP_LEGS.find((leg) => copy[SWAP(leg)]?.status === "ran"); if (first) { copy[SWAP(first)].forced = { swapReady: true }; return; @@ -702,12 +702,12 @@ function mismatchFinding(oracle, isForced, runUrl) { } /** - * "Node 26" or "Chromium 153" from a verdict's engine line; the leg name when the line has no - * leading name and version. + * "Node 26", "Chromium 153" or "macOS WebKit 26" from a verdict's engine line: every word before + * the first version. The leg name when the line has no leading name and version. * @param {NativeSuiteVerdict} v */ function legLabel(v) { - const m = /^(\w+) v?(\d+)/.exec(v.engine); + const m = /^(.+?) v?(\d+)/.exec(v.engine); return m ? `${m[1]} ${m[2]}` : v.leg; } @@ -1208,7 +1208,7 @@ function swapRuntimeName(leg, v) { * @returns {string[]} */ function swapParagraphs(verdicts, version, ready) { - const rows = NATIVE_LEGS.map((leg) => { + const rows = SWAP_LEGS.map((leg) => { const v = verdictOf(verdicts, SWAP(leg)); if (v?.status !== "ran") { return [SWAP_LEG_NAMES[leg], "did not run", "", "", ""]; @@ -1276,12 +1276,12 @@ function swapParagraphs(verdicts, version, ready) { */ function swapFindings(verdicts, runUrl) { const result = swapReady(verdicts); - const forcedBy = NATIVE_LEGS.some( + const forcedBy = SWAP_LEGS.some( (leg) => /** @type {any} */ (verdictOf(verdicts, SWAP(leg)))?.forced, ); if (!result.ready && !forcedBy) return []; const firstRan = /** @type {SwapVerdict | undefined} */ ( - NATIVE_LEGS.map((leg) => verdictOf(verdicts, SWAP(leg))).find( + SWAP_LEGS.map((leg) => verdictOf(verdicts, SWAP(leg))).find( (v) => v?.status === "ran", ) ); diff --git a/scripts/lib/canary-summary.mjs b/scripts/lib/canary-summary.mjs index d3ef04f9d..349c77b6c 100644 --- a/scripts/lib/canary-summary.mjs +++ b/scripts/lib/canary-summary.mjs @@ -7,14 +7,18 @@ * the verdict holds them, with no locale grouping, so the summary matches the log digit for digit. */ -import { COMPAT_SOURCES, compatStates, swapReady } from "./canary-issues.mjs"; +import { + COMPAT_SOURCES, + compatStates, + NATIVE_LEGS, + SWAP_LEGS, + swapReady, +} from "./canary-issues.mjs"; const CHECK = "temporal-compat-check"; const ORACLE = "temporal-oracle"; const LEAP = "leap-seconds"; -const NATIVE_LEGS = ["node", "chromium", "firefox", "webkit"]; - const NO_VERDICT = "no verdict file: an earlier step or job failed"; /** @@ -281,7 +285,7 @@ const SWAP_CALENDARS_LISTED = 10; * @returns {string[]} */ function swapBlocks(verdicts) { - const legs = NATIVE_LEGS.map((leg) => ({ + const legs = SWAP_LEGS.map((leg) => ({ leg, found: sourceOf(verdicts, `temporal-polyfill-swap-${leg}`), })); diff --git a/scripts/lib/canary-verdict.mjs b/scripts/lib/canary-verdict.mjs index e2980545c..842700c16 100644 --- a/scripts/lib/canary-verdict.mjs +++ b/scripts/lib/canary-verdict.mjs @@ -14,12 +14,14 @@ export const VERDICT_FILES = { "temporal-compat-chromium": "artifacts/temporal-compat-chromium.json", "temporal-compat-firefox": "artifacts/temporal-compat-firefox.json", "temporal-compat-webkit": "artifacts/temporal-compat-webkit.json", + "temporal-compat-webkit-macos": "artifacts/temporal-compat-webkit-macos.json", "temporal-oracle": "artifacts/temporal-oracle-verdict.json", "leap-seconds": "artifacts/leap-seconds.json", "native-suite-node": "artifacts/native-suite-node.json", "native-suite-chromium": "artifacts/native-suite-chromium.json", "native-suite-firefox": "artifacts/native-suite-firefox.json", "native-suite-webkit": "artifacts/native-suite-webkit.json", + "native-suite-webkit-macos": "artifacts/native-suite-webkit-macos.json", "temporal-polyfill-swap-node": "artifacts/temporal-polyfill-swap-node.json", "temporal-polyfill-swap-chromium": "artifacts/temporal-polyfill-swap-chromium.json", @@ -105,7 +107,7 @@ export function compatCheckVerdict({ runtime, groups, snapshotCurrent }) { * (`scripts/lib/native-suite-compat.mjs`), against the polyfill GMT ships. No snapshot: the * committed one is Node's. * - * @param {{ leg: "chromium" | "firefox" | "webkit", engine: string, + * @param {{ leg: "chromium" | "firefox" | "webkit" | "webkit-macos", engine: string, * engineId: "v8" | "firefox" | "webkit", * runtime: { polyfill: string, node: string, playwright: string }, * groups: CompatGroup[] }} input @@ -180,7 +182,7 @@ const MESSAGE_CHARS_IN_VERDICT = 300; * from `classify`; the verdict keeps the first 50 of each, with each message cut to 300 characters, and * says when it cut. The counts stay the full numbers. Raw Vitest reports stay in `artifacts/`. * - * @param {{ leg: "node" | "chromium" | "firefox" | "webkit", engine: string, + * @param {{ leg: "node" | "chromium" | "firefox" | "webkit" | "webkit-macos", engine: string, * runtime: { node: string, vitest: string, playwright: string | null }, * counts: { files: number, tests: number, passed: number, tagged: number, * untagged: number, hostTagged: number, hostUntagged: number, diff --git a/scripts/lib/native-suite-compat.mjs b/scripts/lib/native-suite-compat.mjs index 3294ea5c8..28ae1ad55 100644 --- a/scripts/lib/native-suite-compat.mjs +++ b/scripts/lib/native-suite-compat.mjs @@ -30,8 +30,57 @@ export const BROWSER_LABELS = Object.freeze({ chromium: "Chromium", firefox: "Firefox", webkit: "WebKit", + "webkit-macos": "macOS WebKit", }); +/** The Playwright browser and Vitest project each browser leg runs. */ +export const LEG_BROWSER = Object.freeze({ + chromium: "chromium", + firefox: "firefox", + webkit: "webkit", + "webkit-macos": "webkit", +}); + +/** + * The host OS a leg must run on; a leg not listed runs anywhere. Values are `process.platform`. + * A verdict names the data it tested (the host's time zone and locale data), so a result from + * another host under that leg's name would be false. + */ +export const LEG_HOST = Object.freeze({ + webkit: "linux", + "webkit-macos": "darwin", +}); + +/** How `hostProblem` names a host OS. */ +const HOST_NAMES = { linux: "Linux", darwin: "macOS" }; + +/** + * The engine line a verdict and the preflight print: "macOS WebKit 26.6 · macOS 15.7.2", + * "WebKit 26.6", "Chromium 153.0…". Only `webkit-macos` is given an OS version. + * @param {BrowserLeg} leg + * @param {string} browserVersion + * @param {string | null} osVersion + * @returns {string} + */ +export function engineLine(leg, browserVersion, osVersion) { + const line = `${BROWSER_LABELS[leg]} ${browserVersion}`; + return typeof osVersion === "string" + ? `${line} \u00b7 macOS ${osVersion}` + : line; +} + +/** + * Why this host cannot run the leg, or null when it can. + * @param {string} leg + * @param {string} platform `process.platform` + * @returns {string | null} + */ +export function hostProblem(leg, platform) { + const host = /** @type {Record} */ (LEG_HOST)[leg]; + if (host === undefined || host === platform) return null; + return `${leg} runs on ${/** @type {Record} */ (HOST_NAMES)[host]}; this host is ${platform}`; +} + /** The origin the compat page is served from; nothing listens there, routing answers it. */ export const COMPAT_ORIGIN = "http://gmt.local"; /** The page's path for the polyfill's ESM build and for its one dependency. */ @@ -48,7 +97,7 @@ const PAGE_ZONE = "UTC"; const PAGE_LOCALE = "en-US"; /** - * @typedef {"chromium" | "firefox" | "webkit"} BrowserLeg + * @typedef {"chromium" | "firefox" | "webkit" | "webkit-macos"} BrowserLeg * @typedef {{ defect: string, calendar: string, name: string, output: string, passes: boolean }} ProbeResult * @typedef {{ dist: string, polyfill: string, jsbi: string }} Paths */ @@ -190,9 +239,14 @@ export function groupResults(results, installed, engineId) { * verdict for the `temporal-compat-` source. * @param {BrowserLeg} leg * @param {string} root - * @param {{ playwright: () => Promise }} deps loads the `playwright` module + * @param {{ playwright: () => Promise, osVersion?: () => string | null }} deps + * `playwright` loads the module; `osVersion` is the macOS version for the engine line (none by default) */ -export async function runBrowserCompat(leg, root, { playwright: load }) { +export async function runBrowserCompat( + leg, + root, + { playwright: load, osVersion = () => null }, +) { const paths = compatPaths(root); const page = compatPage(); let playwright; @@ -209,7 +263,7 @@ export async function runBrowserCompat(leg, root, { playwright: load }) { "utf8", ), ).version; - const browser = await playwright[leg].launch(); + const browser = await playwright[LEG_BROWSER[leg]].launch(); try { const context = await browser.newContext({ timezoneId: PAGE_ZONE, @@ -248,7 +302,7 @@ export async function runBrowserCompat(leg, root, { playwright: load }) { const polyfill = polyfillVersion(); return browserCompatVerdict({ leg, - engine: `${BROWSER_LABELS[leg]} ${browser.version()}`, + engine: engineLine(leg, browser.version(), osVersion()), engineId, runtime: { polyfill, diff --git a/scripts/lib/native-suite-tags.mjs b/scripts/lib/native-suite-tags.mjs index 93ae146e9..c487d6d6e 100644 --- a/scripts/lib/native-suite-tags.mjs +++ b/scripts/lib/native-suite-tags.mjs @@ -22,7 +22,7 @@ * fix it in GMT (a temporalCompat workaround for a polyfill defect), never tag it. */ -/** @typedef {"node" | "chromium" | "firefox" | "webkit"} Leg */ +/** @typedef {"node" | "chromium" | "firefox" | "webkit" | "webkit-macos"} Leg */ const L_ANCHOR = "l-a-one-character-annotation-key-is-refused"; const M_ANCHOR = "m-u-caislamic-is-accepted-instead-of-refused"; @@ -35,6 +35,8 @@ const S_ANCHOR = "s-webkit-adds-a-year-to-the-30th-of-dhu-al-hijjah-before-the-hijra-as-13-months-webkit-only-engine"; const T_ANCHOR = "t-webkit-throws-adding-a-year-to-the-last-day-of-chaitra-in-far-past-indian-years-webkit-only-engine"; +const AE_ANCHOR = + "ae-icu4c-75-counts-every-persian-year-before-year-0-as-a-leap-year-macos-webkit-engine"; const AD_ANCHOR = "ad-node-26s-v8-rounds-p7d-to-weeks-as-p1w1d-from-a-zoned-origin-node-only-engine"; const BOA_723 = "https://github.com/boa-dev/temporal/pull/723"; @@ -56,7 +58,12 @@ const BOA_723 = "https://github.com/boa-dev/temporal/pull/723"; * spec refuses it (Bugzilla 1998020). The 7 tests that fail on WebKit 26.6 (JavaScriptCore) and pass on * the polyfill are S (six: JavaScriptCore adds a year to Dhu al-Hijjah 30 of a year before the Hijra as * 13 months) and T (one: it throws adding a year to the last day of Chaitra in a far-past Indian year); - * neither is filed yet. Evidence: the records. + * both fail on Playwright's Linux build and on the Mac build, so the rows name both WebKit legs. + * Two more fail on the Mac build alone and are AE: Apple's libicucore (ICU4C 75 or later) counts every + * Persian year before year 0 as a leap year, so adding a month to day 30 of Bahman, or subtracting one from + * day 30 of Farvardin, in a year before year 0 throws. If the Linux runner's ICU moves to 75 or later, the + * `webkit` leg starts failing + * these two rows too and they need that leg. None is filed yet. Evidence: the records. * Goose Bay day rounding is not here: it was a GMT defect and is fixed (temporalCompat D14). * * @type {ReadonlyArray<{ file: string, test: string, legs: Leg[], defect: string, upstream: string | null }>} @@ -241,52 +248,66 @@ export const KNOWN_NATIVE_FAILURES = [ { file: "src/plain/calculate/diffDateAsDuration.edges.test.ts", test: "diffDateAsDuration next to the range limits (CORE-6 §4.4) returns P1Y5M23D in years from -271820-01-19[u-ca=islamic-civil] to -271819-06-27[u-ca=islamic-civil] (xscan islamic-civil min[275], 800 d ins…)", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: S_ANCHOR, upstream: null, }, { file: "src/plain/calculate/diffDateAsDuration.edges.test.ts", test: "diffDateAsDuration next to the range limits (CORE-6 §4.4) returns P1Y5M24D in years from -271820-01-18[u-ca=islamic-tbla] to -271819-06-27[u-ca=islamic-tbla] (xscan islamic-tbla min[274], 800 d insi…)", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: S_ANCHOR, upstream: null, }, { file: "src/plain/calculate/diffDateAsDuration.edges.test.ts", test: "diffDateAsDuration next to the range limits (CORE-6 §4.4) returns P1Y5M23D in years from -271820-01-19[u-ca=islamic-umalqura] to -271819-06-27[u-ca=islamic-umalqura] (xscan islamic-umalqura min[275], 800 d …)", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: S_ANCHOR, upstream: null, }, { file: "src/plain/calculate/diffDateAsDuration.edges.test.ts", test: "diffDateAsDuration next to the range limits (CORE-6 §4.4) returns P2Y2M7D in years from -271821-04-20[u-ca=indian] to -271819-06-27[u-ca=indian] (xscan indian min[1], 800 d inside)", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: T_ANCHOR, upstream: null, }, { file: "src/plain/calculate/addDate.edges.test.ts", test: "addDate next to the range limits (CORE-6 §4.4) adds { years: 1 } to -271820-01-19[u-ca=islamic-civil] as '-271819-01-07[u-ca=islamic-civil]' (xscan islamic-civil min[275])", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: S_ANCHOR, upstream: null, }, { file: "src/plain/calculate/addDate.edges.test.ts", test: "addDate next to the range limits (CORE-6 §4.4) adds { years: 1 } to -271820-01-18[u-ca=islamic-tbla] as '-271819-01-06[u-ca=islamic-tbla]' (xscan islamic-tbla min[274])", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: S_ANCHOR, upstream: null, }, { file: "src/plain/calculate/addDate.edges.test.ts", test: "addDate next to the range limits (CORE-6 §4.4) adds { years: 1 } to -271820-01-19[u-ca=islamic-umalqura] as '-271819-01-07[u-ca=islamic-umalqura]' (xscan islamic-umalqura min[275])", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], defect: S_ANCHOR, upstream: null, }, + { + file: "src/plain/calculate/addDate.test.ts", + test: "addDate returns -271820-04-09[u-ca=persian] for -271820-03-11[u-ca=persian] + { months: 1 } (xscan persian min[327]: into the 29-day…)", + legs: ["webkit-macos"], + defect: AE_ANCHOR, + upstream: null, + }, + { + file: "src/plain/calculate/subtractDate.test.ts", + test: "subtractDate returns '-271820-04-09[u-ca=persian]' for -271820-05-09[u-ca=persian] - { months: 1 } (D1-A persian (xscan min[386]))", + legs: ["webkit-macos"], + defect: AE_ANCHOR, + upstream: null, + }, { file: "src/test/laterPassOrigin.test.ts", test: "normalizeDuration from a repeated hour P7D with { largestUnit: 'week', …(1) } from 2024-11-01T00:00:00+00:00[UTC] is P1W", @@ -357,12 +378,16 @@ export const KNOWN_HOST_FAILURES = [ // 2026-11-01T08:00Z it gives America/Edmonton -07:00 (Edmonton changed in 2026c, so its data // predates 2026c), and at 2026-11-01T07:00Z America/Winnipeg -06:00 (before 2026e). Node 26.12.1 (tz 2026e) gives -07:00 and -05:00. // Playwright's Linux WebKit 26.6 (ubuntu-24.04, the runner's libicu74 74.2) fails all 37 rows of this - // file on both engines; Mac WebKit 26.6 gives America/Vancouver -07:00 at 2026-11-15T17:00Z. The - // group goes stale once a Playwright Chromium, Firefox and Linux WebKit all carry 2026e. + // file on both engines; Mac WebKit 26.6 (macOS 27.0.1, Apple's libicucore) gives America/Vancouver + // -07:00 at 2026-11-15T17:00Z (it has 2026b) but America/Winnipeg -06:00 at 2026-11-01T07:00Z, where + // tzdb 2026e gives -05:00 (its NEWS: Manitoba's 2026-03-08 spring forward was its last foreseeable + // clock change, as it moved to permanent -05 thereafter; it temporarily models the change on 2026-11-01 + // at 02:00); it fails seven rows of this file. + // The group goes stale once a Playwright Chromium, Firefox, Linux WebKit and a Mac WebKit all carry 2026e. id: "browser-canada-2026-tz-data", - legs: ["chromium", "firefox", "webkit"], + legs: ["chromium", "firefox", "webkit", "webkit-macos"], reason: - "Chromium's, Firefox's and Linux WebKit's time zone data predates tzdb 2026e, so some of the Canadian zones that stopped changing their clocks in 2026 still turn back on 2026-11-01.", + "Chromium's, Firefox's, Linux WebKit's and Mac WebKit's time zone data predates tzdb 2026e, so some of the Canadian zones that stopped changing their clocks in 2026 still turn back on 2026-11-01.", file: /\/oh-canada\.test\.ts$/, }, { @@ -396,30 +421,49 @@ export const KNOWN_HOST_FAILURES = [ "Linux WebKit's time zone data predates tzdb 2023d and 2024b, so Asia/Manila's 1844 local mean time and 1899 change and Antarctica/Casey's 2021 change read as before those releases.", test: /\bManila\b|Antarctica\/Casey/, }, + { + // Evidence, WebKit 26.6 on both builds (Playwright's Linux build on ubuntu-24.04, and the Mac build on + // macOS 27.0.1): `new Intl.DateTimeFormat("en", { timeZone: "EST5EDT" })` throws `RangeError: invalid + // time zone: EST5EDT`, and `Temporal.ZonedDateTime.from("2024-07-15T12:00:00-04:00[EST5EDT]")` throws + // `RangeError` too; the same for CST6CDT, MST7MDT and PST8PDT. Node 26.12.1, Chromium 153 and + // Firefox 155 accept all four. IANA's `backward` file (tzdb 2026e) defines them as zones + // (`Zone EST5EDT -5:00 USback E%sT`, and the same for CST6CDT, MST7MDT and PST8PDT), and ECMA-402 + // § 6.5 makes each Zone of the IANA Time Zone Database a primary time zone identifier. + id: "webkit-posix-zone-ids", + legs: ["webkit", "webkit-macos"], + reason: + "WebKit refuses the tzdb legacy zone ids CST6CDT, EST5EDT, MST7MDT and PST8PDT as invalid time zones, so the rows that pass them through fail.", + file: /\/(isValidTimeZone|toOffsetInstant|fromOffsetInstant|getTimeZoneOffset)\.test\.ts$/, + test: /\b(CST6CDT|EST5EDT|MST7MDT|PST8PDT)\b/, + }, { // Evidence, Playwright's Linux WebKit 26.6, both engines: `new Intl.DateTimeFormat("en", { timeZone: // "CET" })` and `Temporal.ZonedDateTime.from("...[CET]")` throw `RangeError: invalid time zone: CET`, - // and the same for CST6CDT, EET, EST5EDT, MET, MST7MDT, PST8PDT and WET; tzdb 2024b made these - // ids links in `backward`. Mac WebKit 26.6 accepts CET and EST in Intl and Temporal and refuses - // EST5EDT in Temporal only (`contains an invalid time zone identifier`). Node 26.12.1 accepts all - // eight (CET resolves to Europe/Brussels), as do Chromium 153 and Firefox 155. + // and the same for EET, MET and WET; tzdb 2024b made these ids links in `backward`. Mac WebKit 26.6 + // accepts CET, EET, MET, WET, EST, MST and HST in Intl and Temporal (its refusals are the four POSIX + // ids of `webkit-posix-zone-ids`). Node 26.12.1 accepts all of them (CET resolves to Europe/Brussels), as do + // Chromium 153 and Firefox 155. id: "webkit-legacy-zone-ids", legs: ["webkit"], reason: - "Linux WebKit refuses the tzdb legacy zone ids CET, CST6CDT, EET, EST5EDT, MET, MST7MDT, PST8PDT and WET as invalid time zones, so the rows that pass them through fail.", + "Linux WebKit refuses the tzdb legacy zone ids CET, EET, MET and WET as invalid time zones, so the rows that pass them through fail.", file: /\/(isValidTimeZone|toOffsetInstant|fromOffsetInstant|getTimeZoneOffset)\.test\.ts$/, - test: /\b(CET|CST6CDT|EET|EST5EDT|MET|MST7MDT|PST8PDT|WET)\b/, + test: /\b(CET|EET|MET|WET)\b/, }, { // Evidence, WebKit 26.6 (Mac and Playwright Linux alike), both engines: // `new Intl.DateTimeFormat("ar-SA").resolvedOptions().calendar` is "islamic-umalqura" and // `{ dateStyle: "long" }` prints 2024-02-03 as "٢٢ رجب، ١٤٤٥ هـ". Node 26.12.1 (CLDR 48), Chromium 153 // and Firefox 155 resolve "gregory" and print "٣ فبراير ٢٠٢٤", which the expected values carry. + // The lookahead leaves out the three ar-SA rows that are not about the calendar (relative tomorrow, + // the date and time connector, the weekday names): `webkit-macos-ar-sa-relative-connector` and + // `webkit-macos-ar-sa-weekday-names` explain them on the Mac. Those titles name no calendar, so the Hijri + // reason never applied to them on Linux either. id: "webkit-ar-sa-islamic-default-calendar", - legs: ["webkit"], + legs: ["webkit", "webkit-macos"], reason: "WebKit's default calendar for ar-SA is islamic-umalqura where Node, Chromium and Firefox use gregory, so ar-SA rows that name no calendar print Hijri dates.", - test: /\bar-SA\b/, + test: /^(?!.*(tomorrow for ar-SA|ar-SA's connector|getLocaleWeekdayNames)).*\bar-SA\b/, }, { // Evidence, Playwright's Linux WebKit 26.6 on ubuntu-24.04, which takes its locale data from the @@ -437,6 +481,228 @@ export const KNOWN_HOST_FAILURES = [ file: /\/(formatDuration|formatDate|formatDateRange|formatDateTime|formatTime|getLocaleMeridiems|formatZonedDateTime|formatZonedRange)\.test\.ts$/, test: /\b(he-IL|en-GB|ru-RU|pt-PT|is-IS|ko-KR|zh-TW)\b|keeps the requested timeZoneName style/, }, + { + // Evidence, Mac WebKit 26.6 (macOS 27.0.1, Apple's libicucore), the same call in Node 26.12.1 (ICU 78.3, + // CLDR 48.0) in brackets: `{ dateStyle: "medium", timeStyle: "medium", timeZone: "UTC" }` for + // 2024-02-03T14:30:45Z prints "Feb 3, 2024 at 2:30:45 PM" (en-US; "Feb 3, 2024, 2:30:45 PM"), "3 Feb 2024 + // at 14:30:45" (en-GB) and "3 févr. 2024 à 14:30:45" (fr-FR; "3 févr. 2024, 14:30:45"). CLDR 48 en.xml + // (gregorian dateTimeFormats) gives medium and short `{1}, {0}` in all three variants and the "at" form + // `{1} 'at' {0}` only for full and long; fr.xml's medium standard pattern is `{1}, {0}` and en_GB.xml + // inherits en_001, which inherits en. The two formatUnix rows name no locale because they pass + // MustTestLocales.enUS with `{ dateStyle: "medium", timeStyle: "short" }` and fail on "Feb 29, 2024 at 12:00 AM". + id: "webkit-macos-medium-date-time-connector", + legs: ["webkit-macos"], + reason: + "Mac WebKit joins a medium date and a time with the word at (à in French) where CLDR 48 uses a comma, in en-US, en-GB and fr-FR.", + file: /\/(formatDateTime|formatZonedDateTime|formatUtc|formatUnix|formatDateTimeToParts|formatZonedToParts)\.test\.ts$/, + test: /\b(en-US|en-GB|fr-FR)\b.*(dateStyle: 'medium'| to (Feb 3, 2024, 2:30 PM|3 Feb 2024, 14:30|3 févr\. 2024, 14:30)$)|medium\/short \(UTC\) formats for (en-US|en-GB|fr-FR)|style variants \(UTC\) formats \{ dateStyle: 'medium'|formatUnix (epochUnit: seconds formats a unix-seconds value identically to the ms equivalent|numeric string input accepts a numeric ms string)$|dateStyle\/timeStyle returns exact parts for (en-US|en-GB|fr-FR)|returns '3 févr\. 2024, 14:30' \(parts joined\)/, + }, + { + // Evidence, Mac WebKit 26.6: `{ dateStyle: "long", timeStyle: "long" }` in sv-SE prints "3 februari 2024 + // 14:30:45" where Node 26.12.1 (CLDR 48.0) prints "3 februari 2024 kl. 14:30:45"; `Intl.RelativeTimeFormat + // ("sv-SE", { numeric: "auto" }).format(1, "day")` is "imorgon" where Node prints "i morgon". CLDR 48 + // sv.xml has the atTime pattern `{1} 'kl'. {0}` for full and long dates and `i morgon`. + id: "webkit-macos-sv-se-connector-and-tomorrow", + legs: ["webkit-macos"], + reason: + "Mac WebKit leaves out kl. between a long Swedish date and the time, and spells tomorrow imorgon where CLDR 48 has i morgon.", + file: /\/(formatDateTime|formatZonedDateTime|formatCalendar|formatCalendarUnix|formatCalendarZoned|formatCalendarUtc)\.test\.ts$/, + test: /tomorrow for sv-SE|sv-SE's connector|for sv-SE with options \{ (dateStyle: '(full|long)'|year: 'numeric', month: 'long')/, + }, + { + // Evidence, Mac WebKit 26.6: `new Intl.DateTimeFormat("ar-SA", { dateStyle: "long", timeStyle: "short", + // timeZone: "UTC" })` keeps the Hijri calendar (`webkit-ar-sa-islamic-default-calendar`), and + // `Intl.RelativeTimeFormat` with `numeric: "auto"` plus a time prints tomorrow at 14:30 as "غدًا، ٢:٣٠ م" + // where Node 26.12.1 (CLDR 48.0) prints "غدًا في ٢:٣٠ م". CLDR 48 ar.xml has the atTime pattern + // `{1} في {0}` for full and long dates and `غدًا`. + id: "webkit-macos-ar-sa-relative-connector", + legs: ["webkit-macos"], + reason: + "Mac WebKit joins tomorrow and the time in Arabic with a comma where CLDR 48 has the word في.", + test: /tomorrow for ar-SA|ar-SA's connector/, + }, + { + // Evidence, Mac WebKit 26.6 and Node 26.12.1 (CLDR 48.0): `new Intl.Locale("zh-CN").getWeekInfo()` is + // `{ firstDay: 7, weekend: [6, 7] }` on Mac WebKit and `{ firstDay: 1, weekend: [6, 7] }` in Node. + // CLDR 48 supplementalData.xml lists CN in ``, + // so weeks in zh-CN start on Monday. + id: "webkit-macos-zh-cn-week-start", + legs: ["webkit-macos"], + reason: + "Mac WebKit starts the week on Sunday for zh-CN where CLDR 48 starts it on Monday.", + file: /\/(getLocaleFirstDayOfWeek|getLocaleStartOfWeek|getLocaleEndOfWeek|getLocaleZonedStartOfWeek|getLocaleZonedEndOfWeek|getLocaleWeekdayNames|isThisUnit|isZonedThisUnit|getWeekOfMonth|getWeeksInMonth)\.test\.ts$/, + test: /(\bin zh-CN( \(locale matrix\)| -> false)?|for locale zh-CN|for zh-CN in locale-first-day order)$/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): ru-RU abbreviated weekdays print "Пн" + // (CLDR 48 ru.xml gregorian abbreviated format days: пн, вт, ср, чт, пт, сб, вс), en-GB's September + // abbreviation prints "Sep" (en_001.xml: `Sept`, en_GB inherits it), and the + // ru-RU narrow relative day prints "-3 дн" (ru.xml day-narrow few: `-{0} дн.`). + id: "webkit-macos-ru-gb-short-names", + legs: ["webkit-macos"], + reason: + "Mac WebKit capitalises the Russian short weekday names, drops the full stop of the Russian narrow day unit and spells September Sep in en-GB, where CLDR 48 has lower case, дн. and Sept.", + test: /getLocaleWeekdayNames returns 7 weekday names \(long\/short\/narrow\) for ru-RU|getLocaleMonthNames returns 12 Gregorian month names \(long\/short\/narrow\) for en-GB|formatRelativeDate formats 2024-03-\d\d for ru-RU with style narrow/, + }, + { + // Evidence, Mac WebKit 26.6: the short ar-SA weekday names come back as "أحد", "اثنين", "ثلاثاء", ... + // where Node 26.12.1 returns "الأحد", "الاثنين", "الثلاثاء", ...; the long width passes (the failing + // assertion is the short one). CLDR 48 ar.xml gregorian abbreviated format weekdays inherit the wide ones + // (`↑↑↑`; wide `الأحد`, mon `الاثنين`, tue `الثلاثاء`). + id: "webkit-macos-ar-sa-weekday-names", + legs: ["webkit-macos"], + reason: + "Mac WebKit's short Arabic weekday names drop the article (أحد where CLDR 48 ar.xml has الأحد), so the short list differs from Node's.", + test: /getLocaleWeekdayNames returns 7 weekday names \(long\/short\/narrow\) for ar-SA/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0), 12-hour day periods: zh-CN and zh-TW at + // 03:30 and 00:30 print "凌晨" where Node prints "上午" (zh.xml gregorian abbreviated am "上午", pm "下午"); + // he-IL prints "אח׳" for PM where Node prints "PM" (he.xml inherits root's `PM`); pt-PT prints "PM" where + // Node prints "p.m." (pt_PT.xml am "a.m.", pm "p.m."). + id: "webkit-macos-day-period-words", + legs: ["webkit-macos"], + reason: + "Mac WebKit prints other day period words than CLDR 48 for zh-CN, zh-TW, he-IL and pt-PT: 凌晨 for the early morning, אח׳ for PM in Hebrew and PM for Portuguese.", + file: /\/(getLocaleMeridiems|formatDateTime|formatZonedDateTime|formatTime)\.test\.ts$/, + test: /getLocaleMeridiems (returns \[(上午, 下午|AM, PM|AM-label, PM-label)\] for (zh-CN|zh-TW|he-IL|pt-PT)|varies by locale)|for he-IL with options \{ (year: 'numeric'|hour: '2-digit'), .* to (03\.02\.2024, )?02:30:45 PM$|for (he-IL|pt-PT) with 12-hour day period|pt-PT with 12-hour day period/, + }, + { + // Evidence, Mac WebKit 26.6: `{ year: "numeric", month: "numeric", day: "numeric" }` in tr-TR prints + // "3.02.2024" where Node 26.12.1 (CLDR 48.0) prints "03.02.2024". CLDR 48 tr.xml `dd.MM.y`. + id: "webkit-macos-tr-day-padding", + legs: ["webkit-macos"], + reason: + "Mac WebKit leaves the day of a numeric Turkish date without its leading zero where CLDR 48 has dd.MM.y.", + file: /\/(formatDate|formatDateTime|formatZonedDateTime|formatDateToParts)\.test\.ts$/, + test: /for tr-TR with options (\{ year: 'numeric'|year (numeric|2-digit), month numeric)|returns exact parts for tr-TR$/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): `{ dateStyle: "full" }` for 2024-02-03 in + // zh-CN prints "2024年2月3日 星期六" (a space before the weekday) and in ja-JP "2024年2月3日 土曜日"; Node + // prints "2024年2月3日星期六" and "2024年2月3日土曜日". CLDR 48 zh.xml and ja.xml: full date pattern + // `y年M月d日EEEE`, no space. The zh-CN zoned full/full row in formatZonedDateTime shows this cause and the + // one of `webkit-macos-zh-time-zone-name-position`: Mac prints "2024年2月3日 星期六 中国标准时间14:30:45" + // where Node prints "2024年2月3日星期六 中国标准时间 14:30:45". + id: "webkit-macos-zh-ja-full-date-weekday-space", + legs: ["webkit-macos"], + reason: + "Mac WebKit puts a space before the weekday of a full zh-CN or ja-JP date where CLDR 48 has none.", + file: /\/(formatDate|formatDateTime|formatZonedDateTime)\.test\.ts$/, + test: /for (zh-CN|ja-JP) with options (\{ dateStyle: 'full'|dateStyle full)/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): zh-CN `{ dateStyle: "long", timeStyle: + // "long", timeZone: "Asia/Shanghai" }` prints "2024年2月3日 GMT+814:30:45" (no space between the zone and + // the time) where Node prints "2024年2月3日 GMT+8 14:30:45" (zh.xml time long `z HH:mm:ss`); zh-TW prints the + // zone first ("GMT+8 下午2:30:45") where Node prints "下午2:30:45 [GMT+8]" (zh_Hant.xml time long + // `Bh:mm:ss [z]`, full `Bh:mm:ss [zzzz]`). The zh-CN zoned full/full row in formatZonedDateTime also + // shows the weekday space of `webkit-macos-zh-ja-full-date-weekday-space`: both causes are in its text. + id: "webkit-macos-zh-time-zone-name-position", + legs: ["webkit-macos"], + reason: + "Mac WebKit puts the time zone name of a Chinese long or full time in another place or with another spacing than CLDR 48.", + file: /\/(formatZonedDateTime|formatZonedRange)\.test\.ts$/, + test: /for zh-(CN|TW) with options \{ dateStyle: '(full|long)', timeStyle|for zh-TW with \{ (dateStyle: 'long'|hour: 'numeric')/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0), zh-TW date-time ranges: with + // `{ dateStyle: "long", timeStyle: "long" }` Mac prints "2024/2/3 下午2:30:45至下午4:46:15" where Node prints + // "2024/2/3 下午2:30:45 - 下午4:46:15"; with `{ hour: "numeric", minute: "numeric" }` Mac prints + // "下午2:30-4:46" where Node prints "下午2:30至4:46". CLDR 48 settles both: zh_Hant.xml gregorian `hm` + // interval is `Bh:mm至h:mm` (the 至 of the hour-minute range), and its gregorian `intervalFormatFallback` + // is `↑↑↑`, which inherits zh.xml's `{0} – {1}` (the dash between two full date-times). Mac has the two + // swapped; formatZonedRange with `{ hour: "numeric", dayPeriod, timeZoneName: "shortOffset" }` prints + // "清晨5 GMT-5至下午3 GMT-5" where Node prints "清晨5 GMT-5 – 下午3 GMT-5". + id: "webkit-macos-zh-tw-datetime-range-separator", + legs: ["webkit-macos"], + reason: + "Mac WebKit joins the two ends of a zh-TW range with 至 where CLDR 48 has a dash (long date-time, and hour ranges with a zone name) and with a dash where CLDR 48 has 至 (hour and minute).", + file: /\/(formatDateTimeRange|formatZonedRange)\.test\.ts$/, + test: /for locale zh-TW with options \{ (dateStyle: 'long', timeStyle: 'long'|hour: 'numeric', minute: 'numeric') \}|formats zh-TW with \{ hour: 'numeric'/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): `{ dateStyle: "short" }` for 2024-02-03 in + // ko-KR prints "2024. 2. 3." where Node prints "24. 2. 3.". CLDR 48 ko.xml short date `yy. M. d.`. + id: "webkit-macos-ko-short-date-year", + legs: ["webkit-macos"], + reason: + "Mac WebKit prints the year of a short ko-KR date in four digits where CLDR 48 has two.", + file: /\/(formatDate|formatDateTime|formatZonedDateTime|formatDateRange|formatDateTimeRange|formatZonedRange)\.test\.ts$/, + test: /\bko-KR\b.*(dateStyle: 'short'|dateStyle short)|ko-KR with \{ dateStyle: 'short'/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (ICU 78.3, CLDR 48.0): `{ year: "numeric", month: "long" }` + // in ko-KR-u-ca-hebrew prints "AM 5784년 스밧월" where Node and Chromium print "AM 5784년 5월". CLDR 48 ko.xml + // has no hebrew availableFormats; root.xml aliases them to the generic calendar, whose `yyyyMMMM` is + // `G y년 M월` (a numeric month). Apple's ICU data for ko has generic `yyyyMMMM` `G y년 MMMM` and hebrew format + // wide month 5 `스밧월` where CLDR has `스밧`. + id: "webkit-macos-ko-hebrew-year-month", + legs: ["webkit-macos"], + reason: + "Mac WebKit uses Apple's own ICU data for ko, which writes a Hebrew year and month with the month name where CLDR 48 has the month number (G y년 M월).", + test: /in ko-KR-u-ca-hebrew with \{ year: 'numeric', month: 'long' \}/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): `{ year: "numeric", month: "numeric" }` in + // ja-JP-u-ca-japanese prints "R6/02" where Node prints "R6/2". CLDR 48 ja.xml japanese calendar + // `GGGGGy/M` has a one-digit month. + id: "webkit-macos-ja-japanese-year-month", + legs: ["webkit-macos"], + reason: + "Mac WebKit pads the month of a Japanese-calendar year and month to two digits where CLDR 48 has one (GGGGGy/M).", + test: /in ja-JP-u-ca-japanese with \{ year: 'numeric', month: 'numeric' \}/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0), `formatRange` with `{ hour: "numeric", + // minute: "numeric", timeZone: "UTC" }`: en-GB, es-ES, zh-CN and pt-PT print "14:30 – 16:46" (an en dash + // with a space on each side) and Node prints "14:30–16:46". CLDR 48 en_001.xml and root.xml `HH:mm–HH:mm`, + // es.xml `H:mm–H:mm`, es.xml `d–d MMM y`, and for `dateStyle: "long"` es.xml `yMMMMd` `d–d 'de' MMMM 'de' y` and pt_PT.xml `yMMMd` `d–d 'de' MMM 'de' y` (pt_PT.xml has no `yMMMMd` of its own): no spaces. + id: "webkit-macos-range-dash-spacing", + legs: ["webkit-macos"], + reason: + "Mac WebKit puts spaces around the dash of an en-GB, es-ES, zh-CN or pt-PT range where CLDR 48 has none.", + file: /\/(formatDateRange|formatDateTimeRange|formatZonedRange)\.test\.ts$/, + test: /for locale (en-GB|es-ES|zh-CN) with options|locale (es-ES|pt-PT) with options \{ dateStyle: 'long' \}|for (en-GB|es-ES|zh-CN) with \{|en-GB shortOffset London|in zh-CN with \{ timeZoneName/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): de-DE `formatRange` with `{ hour: "numeric", + // minute: "numeric" }` prints "14:30–16:46" where Node prints "14:30–16:46 Uhr" (de.xml `` `HH:mm–HH:mm 'Uhr'`); it-IT `{ dateStyle: "long" }` prints "3–5 febbraio 2024" where Node prints + // "03–05 febbraio 2024" (it.xml yMMMd `dd–dd MMM y`). + id: "webkit-macos-de-it-range-patterns", + legs: ["webkit-macos"], + reason: + "Mac WebKit drops the word Uhr from a German time range and the leading zeros from an Italian date range, which CLDR 48 keeps.", + file: /\/(formatDateRange|formatDateTimeRange|formatZonedRange)\.test\.ts$/, + test: /for locale de-DE with options|for de-DE with \{|locale it-IT with options|in de with \{ timeZoneName/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): en-IN `formatRange` with `{ hour: "numeric", + // minute: "numeric", timeZoneName: "long" }` prints "10:30 AM - 12:30 PM India Standard Time" where Node + // prints "10:30 am - 12:30 pm India Standard Time" (the dash is the same on both sides; only the case + // differs; en_IN inherits en_001.xml: am `am`, pm `pm`). + id: "webkit-macos-en-in-day-period-case", + legs: ["webkit-macos"], + reason: + "Mac WebKit prints the en-IN day periods in capitals (AM, PM) where CLDR 48 en_IN, through en_001, has am and pm.", + file: /\/formatZonedRange\.test\.ts$/, + test: /in en-IN with \{ timeZoneName/, + }, + { + // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0): zh-TW relative times print "30分鐘前" + // where Node prints "30 分鐘前" (zh_Hant.xml minute relativeTimePattern past `{0} 分鐘前`, with a space); + // zh-TW and ja-JP durations print "1天、2小時和30分鐘" and "1日、2時間、30分" where Node prints "1 天、2 小時和30 分鐘" + // and "1 日、2 時間、30 分"; he-IL prints "יום אחד" where Node prints "1 יום" (he.xml duration-day one + // `{0} יום`); tr-TR prints a narrow no-break space "1 gün" (U+202F) where Node prints "1 gün". + id: "webkit-macos-unit-spacing-and-words", + legs: ["webkit-macos"], + reason: + "Mac WebKit spaces relative times and durations differently from CLDR 48 in zh-TW, ja-JP and tr-TR, and writes one day in Hebrew as יום אחד where CLDR 48 has 1 יום.", + file: /\/(formatDuration|formatRelativeDate|formatRelativeDateTime|formatRelativeTime|formatRelativeUtc|formatRelativeUnix|formatRelativeZoned)\.test\.ts$/, + test: /for zh-TW|for locale (zh-TW|ja-JP|he-IL|tr-TR)/, + }, ]; /** The pseudo test name a file that failed to load counts as. */ diff --git a/scripts/lib/workarounds.mjs b/scripts/lib/workarounds.mjs index f4d5be285..ff40e3633 100644 --- a/scripts/lib/workarounds.mjs +++ b/scripts/lib/workarounds.mjs @@ -25,14 +25,19 @@ const LAST_OF_D1_D7 = `The last of D1–D7 to go also follows ${COMPAT_README} /** * The JavaScript engine each native-suite leg runs on, as a group's `engines` names it. Node and - * Chromium are both V8: a defect in V8 or in the ICU it bundles reads the same on both. - * @type {Readonly>} + * Chromium are both V8: a defect in V8 or in the ICU it bundles reads the same on both. WebKit + * runs on two hosts (Playwright's build on Linux, and on macOS the ICU and time zone data Apple + * ships), so it has two legs of one engine. The keys are the native-suite legs, in leg order: the + * one list every canary script derives its legs from. + * @type {Readonly>} */ export const ENGINE_IDS = Object.freeze({ node: "v8", chromium: "v8", firefox: "firefox", webkit: "webkit", + "webkit-macos": "webkit", }); export const WORKAROUNDS = [ @@ -194,7 +199,7 @@ export const WORKAROUNDS = [ defects: ["D16"], title: "D16 — formatRange drops O and long zone-name widths (ICU-20548)", trigger: - "an ICU release that fixes ICU-20548 is bundled by GMT's engines.node floor (>=22.16.0) and by every browser the native suite runs, so every D16 repro passes on every engine: this check reports Node, and the weekly run's compat check in each browser (the temporal-compat-chromium, -firefox and -webkit verdicts) reports the rest; D16 is removable only when all of them say so", + "an ICU release that fixes ICU-20548 is bundled by GMT's engines.node floor (>=22.16.0) and by every browser the native suite runs, so every D16 repro passes on every engine: this check reports Node, and the weekly run's compat check in each browser (the temporal-compat-chromium, -firefox, -webkit and -webkit-macos verdicts) reports the rest; D16 is removable only when all of them say so", steps: [ "Delete the zoneNames branch of rangeWithRepairedParts and its gate in zoned/format/formatZonedRange.ts, isRangeZoneNameCompatNeeded in capabilities.ts and its export in index.ts, and the D16 repros.", "Keep every formatZonedRange row: their values are the field formats and hold either way.", @@ -222,7 +227,7 @@ export const WORKAROUNDS = [ title: "D18 — Islamic calendar dates before the Hijra read as positive years in a second era (WebKit)", trigger: - "the weekly run's compat check in WebKit (the temporal-compat-webkit verdict) reports D18 removable: every D18 repro passes in the WebKit the native suite runs, once a js-temporal release reads the Islamic eras or WebKit prints the year as V8 does. WebKit is the only engine in D18's scope; this check runs on Node, where D18 is out of scope and never removable", + "the weekly run's compat check in WebKit (the temporal-compat-webkit and temporal-compat-webkit-macos verdicts, Linux and macOS) reports D18 removable: every D18 repro passes in the WebKit the native suite runs, once a js-temporal release reads the Islamic eras or WebKit prints the year as V8 does. WebKit is the only engine in D18's scope; this check runs on Node, where D18 is out of scope and never removable", steps: [ "Delete islamicEra.ts, fixedMonthArithmetic.ts and their tests, islamicFields, polyfillMisreadsIslamicEra and polyfillCannotReturn in calendarFields.ts, the D18 branch and term in calendarDateFromFields.ts, fixedMonthsIfPolyfillCannotReturn in readArithmeticModel.ts, reachesPolyfillLimit and lowestYearOfSum in calendarDateArithmetic.ts, fixedMonthsPerYearOf in largeMonthSpan.ts, and the D18 repros.", "Keep every Islamic row of diffDateAsDuration.edges.test.ts and addDate.edges.test.ts: the values are the spec's and hold either way.", @@ -238,7 +243,7 @@ export const WORKAROUNDS = [ title: "D19 — ZonedDateTime#equals answers false for two identifiers of one zone where resolvedOptions keeps the identifier (JavaScriptCore)", trigger: - "a js-temporal release whose TimeZoneEquals finds the primary identifier on a host whose Intl.DateTimeFormat#resolvedOptions returns the identifier as written, so the D19 probe (Etc/UTC equals UTC, ECMA-402 §6.5) passes in the WebKit the native suite runs: the weekly run's compat check in WebKit (the temporal-compat-webkit verdict) reports it. WebKit is the only engine in D19's scope; this check runs on Node, where D19 is out of scope and never removable", + "a js-temporal release whose TimeZoneEquals finds the primary identifier on a host whose Intl.DateTimeFormat#resolvedOptions returns the identifier as written, so the D19 probe (Etc/UTC equals UTC, ECMA-402 §6.5) passes in the WebKit the native suite runs: the weekly run's compat check in WebKit (the temporal-compat-webkit and temporal-compat-webkit-macos verdicts, Linux and macOS) reports it. WebKit is the only engine in D19's scope; this check runs on Node, where D19 is out of scope and never removable", steps: [ "Delete timeZoneEquals.ts, its exports in index.ts, isTimeZoneEqualsCompatNeeded in capabilities.ts and the D19 repros; isCalendarDifferenceAcrossZones (internal/zonedWallClockDifference.ts) compares with new Temporal.ZonedDateTime(0n, id).equals(...) again.", "Keep every diffZoned and intervalLengthZoned row: the values are TimeZoneEquals answers and hold either way.", diff --git a/scripts/native-suite.mjs b/scripts/native-suite.mjs index f4fffc731..c3f3692bf 100644 --- a/scripts/native-suite.mjs +++ b/scripts/native-suite.mjs @@ -2,8 +2,11 @@ /** * Runs the whole packages/gmt suite on a native Temporal engine and sorts what fails. * - * node scripts/native-suite.mjs - * node scripts/native-suite.mjs summary + * node scripts/native-suite.mjs + * node scripts/native-suite.mjs summary + * + * `webkit` runs on Linux and `webkit-macos` on macOS; on another host a leg writes could-not-run + * verdicts and exits 2, because its verdict names the data of the host it ran on. * * A leg runs the suite twice on the same host: once on @js-temporal/polyfill (the control) and * once on the native engine. A test that fails natively and passes on the control is a @@ -35,7 +38,7 @@ * * Node built-ins and Vitest only, and no `Date`. */ -import { spawnSync } from "node:child_process"; +import { execFileSync, spawnSync } from "node:child_process"; import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { createRequire, stripTypeScriptTypes } from "node:module"; import { dirname, join } from "node:path"; @@ -47,9 +50,13 @@ import { VERDICT_FILES, } from "./lib/canary-verdict.mjs"; import { - BROWSER_LABELS, + engineLine, + hostProblem, + LEG_BROWSER, + LEG_HOST, runBrowserCompat, } from "./lib/native-suite-compat.mjs"; +import { ENGINE_IDS } from "./lib/workarounds.mjs"; import { classify, KNOWN_HOST_FAILURES, @@ -58,10 +65,11 @@ import { } from "./lib/native-suite-tags.mjs"; const ROOT = fileURLToPath(new URL("..", import.meta.url)); -const LEGS = ["node", "chromium", "firefox", "webkit"]; +/** The native-suite legs: the one list in `ENGINE_IDS`. */ +const LEGS = Object.keys(ENGINE_IDS); const USAGE = - "Usage: node scripts/native-suite.mjs \n" + - " node scripts/native-suite.mjs summary "; + `Usage: node scripts/native-suite.mjs <${LEGS.join("|")}>\n` + + ` node scripts/native-suite.mjs summary <${LEGS.join("|")}>`; const SHOWN = 20; /** * One pass may run this long, all of its shards together (the job allows 45 minutes for both @@ -85,14 +93,16 @@ const NO_NATIVE_MESSAGE = "native Temporal is not available on this runtime"; const SHIM_PATH = "packages/gmt/src/test/nativeTemporal.ts"; /** - * @typedef {"node" | "chromium" | "firefox" | "webkit"} Leg + * @typedef {"node" | "chromium" | "firefox" | "webkit" | "webkit-macos"} Leg * @typedef {"control" | "native" | "swap"} Pass * @typedef {{ index: number, count: number }} Shard one of a pass's Vitest runs, 1-based * @typedef {{ engine: string, playwright: string | null }} Engine * @typedef {ReturnType} CompatVerdict * @typedef {{ - * preflight: (leg: Leg, root: string) => Promise, - * compatCheck: (leg: Exclude, root: string) => Promise, + * preflight: (leg: Leg, root: string, osVersion: string | null) => Promise, + * compatCheck: (leg: Exclude, root: string, osVersion: string | null) => Promise, + * platform: () => NodeJS.Platform, + * osVersion: () => string | null, * runPass: (leg: Leg, pass: Pass, root: string, shard: Shard, timeoutMs: number) => number | void, * shards: (leg: Leg) => number, * runtime: () => { node: string, vitest: string }, @@ -434,9 +444,10 @@ async function bareProblems(context, load) { /** * @param {Exclude} leg * @param {string} root + * @param {string | null} osVersion * @returns {Promise} */ -async function browserPreflight(leg, root) { +async function browserPreflight(leg, root, osVersion) { const require = createRequire(import.meta.url); let playwright; try { @@ -447,7 +458,7 @@ async function browserPreflight(leg, root) { const version = JSON.parse( readFileSync(require.resolve("playwright/package.json"), "utf8"), ).version; - const browser = await playwright[leg].launch(); + const browser = await playwright[LEG_BROWSER[leg]].launch(); try { const zone = "America/New_York"; const context = await browser.newContext({ timezoneId: zone }); @@ -467,7 +478,7 @@ async function browserPreflight(leg, root) { ...(await bareProblems(context, load)), ]); return { - engine: `${BROWSER_LABELS[leg]} ${browser.version()}`, + engine: engineLine(leg, browser.version(), osVersion), playwright: version, }; } finally { @@ -481,10 +492,13 @@ async function browserPreflight(leg, root) { * with its time zone set through the context and without `Temporal` in a second page. * @param {Leg} leg * @param {string} root + * @param {string | null} osVersion the macOS version for a browser's engine line * @returns {Promise} */ -function preflight(leg, root) { - return leg === "node" ? nodePreflight(root) : browserPreflight(leg, root); +function preflight(leg, root, osVersion) { + return leg === "node" + ? nodePreflight(root) + : browserPreflight(leg, root, osVersion); } /** @@ -556,7 +570,9 @@ export function runPass( "run", "--config", config, - ...(browser ? ["--project", leg] : []), + ...(browser + ? ["--project", LEG_BROWSER[/** @type {Exclude} */ (leg)]] + : []), ...(shard.count > 1 ? [`--shard=${shard.index}/${shard.count}`] : []), // The module cache is keyed by path, so a `temporal-polyfill` upgraded in place would run // from the old version's cached transform. @@ -594,11 +610,34 @@ export function runPass( return result.status; } +/** + * The macOS version (`sw_vers -productVersion`), or null on another OS or when the command fails: + * the engine line then has no OS part. Never throws. + * @returns {string | null} + */ +function macOsVersion() { + if (process.platform !== "darwin") return null; + try { + const text = execFileSync("sw_vers", ["-productVersion"], { + encoding: "utf8", + timeout: CHILD_TIMEOUT_MS, + }).trim(); + return text === "" ? null : text; + } catch { + return null; + } +} + /** @type {Deps} */ const realDeps = { preflight, - compatCheck: (leg, root) => - runBrowserCompat(leg, root, { playwright: () => import("playwright") }), + compatCheck: (leg, root, osVersion) => + runBrowserCompat(leg, root, { + playwright: () => import("playwright"), + osVersion: () => osVersion, + }), + platform: () => process.platform, + osVersion: macOsVersion, runPass, shards: shardsFor, runtime: () => ({ @@ -1059,13 +1098,28 @@ export async function main(argv, { root = ROOT, stdout, stderr, deps = {} }) { return 2; }; + // A verdict names the data of the host it ran on, so a leg refuses another OS's runner. + const problem = hostProblem(leg, d.platform()); + if (problem) { + if (leg !== "node") { + saveVerdict( + root, + couldNotRunVerdict(`temporal-compat-${leg}`, problem), + "native-suite", + ); + } + return couldNotRun(new Error(problem)); + } + // Only a leg pinned to macOS reports the macOS version in its engine line. + const osVersion = LEG_HOST[leg] === "darwin" ? d.osVersion() : null; + // The compat check comes first and on its own: it needs the browser and the built dist, not // the suite, and a check that cannot run must not stop the suite (nor the other way round). let compatFailed = false; if (leg !== "node") { const compatSource = `temporal-compat-${leg}`; try { - const compat = await d.compatCheck(leg, root); + const compat = await d.compatCheck(leg, root, osVersion); saveVerdict(root, compat, "native-suite"); stdout(`${compatLine(compat)}\n`); } catch (error) { @@ -1087,7 +1141,7 @@ export async function main(argv, { root = ROOT, stdout, stderr, deps = {} }) { /** @type {ReturnType} */ let passes; try { - engine = await d.preflight(leg, root); + engine = await d.preflight(leg, root, osVersion); passes = runPasses(leg, root, d, stderr); } catch (error) { return couldNotRun(error); diff --git a/scripts/syntax-floor.mjs b/scripts/syntax-floor.mjs new file mode 100644 index 000000000..040d87931 --- /dev/null +++ b/scripts/syntax-floor.mjs @@ -0,0 +1,145 @@ +#!/usr/bin/env node +/** + * Syntax floor of `@northguild/gmt`: the lowest ECMA-262 edition whose grammar parses every file a + * consumer's bundler or browser loads. + * + * node scripts/syntax-floor.mjs [--ts ] print the floor; with --ts also write + * `export const syntaxFloor = { edition, entries }` + * + * The published build's `tsdown` target is `esnext`, so the target is not a floor. The floor is + * measured: esbuild bundles each `packages/gmt/package.json` `exports` entry in memory + * (`write: false`, the polyfill and `jsbi` bundled in), so `dist` is never touched and no build is + * needed. Each output is parsed with acorn as a module, trying `ecmaVersion` from 2015 up. An entry's + * floor is the lowest edition that parses it; the page's floor is the highest entry floor. ECMA-262 + * says what each edition adds; acorn is the tool, not the authority. A bundle no edition parses + * exits 2 with the entry name and acorn's message. There is no fallback. + */ +import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { parse } from "acorn"; +import { build } from "esbuild"; + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); +const GMT_DIR = path.join(ROOT, "packages", "gmt"); + +/** The editions acorn can parse, lowest first: 2015 up to the first one it refuses. */ +function supportedEditions() { + const editions = []; + for (let year = 2015; year < 2100; year += 1) { + try { + parse("", { ecmaVersion: year, sourceType: "module" }); + } catch { + break; + } + editions.push(year); + } + return editions; +} + +/** + * The lowest edition that parses every source. + * @param {string[]} sources JavaScript module text + * @returns {number} an ECMA-262 edition year + * @throws {Error} naming the source index when no edition parses a source + */ +export function syntaxFloor(sources) { + const editions = supportedEditions(); + let floor = editions[0]; + sources.forEach((source, index) => { + let lastError = null; + for (const edition of editions) { + try { + parse(source, { ecmaVersion: edition, sourceType: "module" }); + floor = Math.max(floor, edition); + return; + } catch (error) { + lastError = error; + } + } + throw new Error( + `source ${index}: no edition parses it (${lastError?.message})`, + ); + }); + return floor; +} + +/** Every `exports` entry of `packages/gmt/package.json`: its key and the `src` file it is built from. */ +export function exportEntries() { + const manifest = JSON.parse( + readFileSync(path.join(GMT_DIR, "package.json"), "utf8"), + ); + return Object.entries(manifest.exports).map(([key, target]) => { + const file = typeof target === "string" ? target : target.default; + return { + key, + src: file.replace(/^\.\/dist\//, "./src/").replace(/\.js$/, ".ts"), + }; + }); +} + +/** Bundle every entry in memory and measure the floor. */ +export async function measureSyntaxFloor() { + const entries = exportEntries(); + const sources = []; + for (const entry of entries) { + const result = await build({ + stdin: { + contents: `export * from ${JSON.stringify(entry.src)};`, + resolveDir: GMT_DIR, + loader: "ts", + }, + bundle: true, + format: "esm", + platform: "neutral", + mainFields: ["module", "main"], + target: "esnext", + write: false, + logLevel: "silent", + }); + const text = result.outputFiles[0].text; + try { + syntaxFloor([text]); + } catch (error) { + throw new Error(`${entry.key}: ${error.message}`); + } + sources.push(text); + } + return { edition: syntaxFloor(sources), entries: entries.length }; +} + +if ( + process.argv[1] && + path.resolve(process.argv[1]) === fileURLToPath(import.meta.url) +) { + const args = process.argv.slice(2).filter((a) => a !== "--"); + const tsIndex = args.indexOf("--ts"); + const out = tsIndex === -1 ? null : args[tsIndex + 1]; + if (tsIndex !== -1 && !out) { + console.error("syntax-floor: --ts needs a file"); + process.exit(2); + } + try { + const result = await measureSyntaxFloor(); + console.log( + `[syntax-floor] ECMAScript ${result.edition} over ${result.entries} entries`, + ); + if (out) { + const source = `// GENERATED FILE — do not edit by hand. +// Produced by scripts/syntax-floor.mjs (\`pnpm dox:generate\`). +export const syntaxFloor = { edition: ${result.edition}, entries: ${result.entries} } as const; +`; + mkdirSync(path.dirname(path.resolve(out)), { recursive: true }); + let previous = ""; + try { + previous = readFileSync(out, "utf8"); + } catch { + previous = ""; + } + if (previous !== source) writeFileSync(out, source); + } + } catch (error) { + console.error(`syntax-floor: ${error.message}`); + process.exit(2); + } +} From 9835952bd0fcb8c0d0144c53e4b88997a3bfb981 Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 9 Nov 2026 09:44:43 +0200 Subject: [PATCH 2/5] fix(canary): answer the review on #484, and require an empty changeset for any change under packages/ - Browser support: the chromium leg covers desktop Chromium only. Chromium on Android (Chrome, Samsung Internet, DuckDuckGo, Android System WebView) loads a smaller ICU data file built for Android, so the page lists it as not tested. - deps check: a canary story may be blocked by an open Dox story. - syntax floor: one parse with `latest` decides whether any edition parses a source, so a source no edition parses fails at once with that parse's error. - Changesets: any file under packages/ needs a changeset, an empty one when nothing ships, because CI's Story consistency check runs changeset status. The rule, AGENTS.md, the finalizer, dox-architect, pipeline, pr-desc and changelog now say so, and this branch carries an empty changeset for its workaround README edit. --- .agents/dox-architect.md | 2 +- .agents/finalizer.md | 4 +- .agents/skills/changelog/SKILL.md | 2 +- .agents/skills/pipeline/SKILL.md | 4 +- .agents/skills/pr-desc/SKILL.md | 2 +- .changeset/canary-webkit-macos-leg.md | 6 +++ AGENTS.md | 2 +- apps/dox/src/content/docs/browser-support.mdx | 11 +++-- context/canary/issues/CNRY-1.md | 14 +++--- context/coding-standards.md | 10 +++- scripts/deps.mjs | 2 +- scripts/syntax-floor.mjs | 49 +++++++++---------- 12 files changed, 61 insertions(+), 47 deletions(-) create mode 100644 .changeset/canary-webkit-macos-leg.md diff --git a/.agents/dox-architect.md b/.agents/dox-architect.md index b4ec49dba..771dd1004 100644 --- a/.agents/dox-architect.md +++ b/.agents/dox-architect.md @@ -100,7 +100,7 @@ chooses; the main session then resumes you with the choice and you write the spe - `pnpm run validate` stays green, including the CI timezone matrix (10 zones × Node 22/24/26 — the `gmt-matrix` job in `.github/workflows/ci.yml`); `apps/dox` must not perturb `packages/gmt`. -- No changesets unless the work also modifies `packages/gmt`. +- A Dox-only change needs no changeset. Any file the work changes under `packages/` needs one, an empty one when no behaviour changes ([rule](../context/coding-standards.md#changesets)). - No `octane` or `@octanejs/*` dependency. - Every tier after Tier 1 stays independently droppable; the docs work with the chat deleted. diff --git a/.agents/finalizer.md b/.agents/finalizer.md index e94e258e5..af6e9ec2c 100644 --- a/.agents/finalizer.md +++ b/.agents/finalizer.md @@ -31,9 +31,9 @@ Story closer. Called after `tdd-dev` (and optionally `tester`) complete. Produce 2. **If public API surface changed:** update the TanStack Intent agent skills in `packages/gmt/skills/` (new functions, renamed functions, new options, new domain concept). See `PUBLISHING.md` contributor flow step 2. -3. **Write a `.changeset/*.md` entry** for the story — one-line summary, bump level per the [changeset rule](../context/coding-standards.md#changesets): a new-API story is `minor`, a fix to shipped behaviour is `patch`, a change with no behaviour change needs none. A breaking change is `minor` with a **Breaking changes** migration section (old → new for every affected function); never write `major`, and do not ask the owner before shipping a breaking change. Polish the text with `/changelog`. +3. **Write a `.changeset/*.md` entry** for the story — one-line summary, bump level per the [changeset rule](../context/coding-standards.md#changesets): a new-API story is `minor`, a fix to shipped behaviour is `patch`, a change with no behaviour change gets an empty changeset when any file under `packages/` changed (a README, a test or a comment counts) and none otherwise. A breaking change is `minor` with a **Breaking changes** migration section (old → new for every affected function); never write `major`, and do not ask the owner before shipping a breaking change. Polish the text with `/changelog`. - Then prove it exists: `pnpm changeset:status` exits non-zero when a publishable + Then prove it, on every story, including one whose spec says no changeset: `pnpm changeset:status` exits non-zero when a publishable package changed and no changeset covers it. A PR without one bumps nothing and ships nothing, silently — CI runs this on every PR, so a missing entry fails the branch rather than surfacing at release time. diff --git a/.agents/skills/changelog/SKILL.md b/.agents/skills/changelog/SKILL.md index 03992f49a..90cab2f6d 100644 --- a/.agents/skills/changelog/SKILL.md +++ b/.agents/skills/changelog/SKILL.md @@ -37,4 +37,4 @@ See [references/steps.md](references/steps.md) for the full step-by-step (findin - **Do not run `changeset:version`** — it bumps versions and consumes every pending changeset. It is a maintainer's deliberate release action, run in a release PR of its own. See [PUBLISHING.md](../../../PUBLISHING.md). - **Never fabricate function names.** Every export named in the description must exist in `packages/*/src/`. Verify with `grep` if uncertain. - **One changeset file per affected package group.** If multiple packages are in the same changeset file, the description must cover all of them, or note which packages are unaffected. -- **Internal-only changes** (skills, agent config, test infrastructure, README) do not warrant a changeset entry by themselves. If the changeset exists only because of those, flag it for the user. +- **Internal-only changes** (skills, agent config, test infrastructure, README) get an empty changeset when they touch `packages/`, never a bump. Flag a bump that exists only because of those. diff --git a/.agents/skills/pipeline/SKILL.md b/.agents/skills/pipeline/SKILL.md index 8623dd599..b1230c339 100644 --- a/.agents/skills/pipeline/SKILL.md +++ b/.agents/skills/pipeline/SKILL.md @@ -33,8 +33,8 @@ and [§ Git — Only on an Explicit Instruction](../../../AGENTS.md#git--only-on | --- | --- | --- | --- | | **A. Story** | A tracker story: realm (`MAR-*`, `CORE-*`, …) or `DOX-*` | [`/plan-story`](../plan-story/SKILL.md) in its own session, then the gate, then `tdd-dev` → (`tester`) → `gmt-reviewer` → (`dox-builder` → `dox-tester`) → `finalizer` | per rule | | **B. Bug fix** | Incorrect behaviour or a failing test | (`researcher`) → `tdd-dev` → `tester` → `gmt-reviewer` → `finalizer` | `patch` | -| **C. Refactor** | Internals only, no behaviour change | `tdd-dev` → `tester` → `finalizer` (commit message only) | none | -| **D. Documentation** | Docs, READMEs, JSDoc | `finalizer` (documentation steps only) | none | +| **C. Refactor** | Internals only, no behaviour change | `tdd-dev` → `tester` → `finalizer` (commit message only) | empty | +| **D. Documentation** | Docs, READMEs, JSDoc | `finalizer` (documentation steps only) | empty if `packages/` changed | | **E. Research** | Temporal behaviour, design options | `researcher` only; do not implement unless asked | — | | **F. Code review** | Review code or a diff | `gmt-reviewer` ([checklist](../../../context/code-review-checklist.md) first) | — | | **G. Owner's spec, no story** | The owner hands over a complete spec for work with no tracker row | `tdd-dev` → `gmt-reviewer` → `finalizer` | per rule | diff --git a/.agents/skills/pr-desc/SKILL.md b/.agents/skills/pr-desc/SKILL.md index 2972d3a45..08a7dff5f 100644 --- a/.agents/skills/pr-desc/SKILL.md +++ b/.agents/skills/pr-desc/SKILL.md @@ -74,7 +74,7 @@ The changeset(s) in `.changeset/` and their bump level, per [coding-standards § - [ ] Each "What Changed" section has a corresponding entry - [ ] Type-check passed - [ ] No secrets committed -- [ ] Changeset present with the correct bump (or none, for no behaviour change) +- [ ] Changeset present with the correct bump (empty for no behaviour change under `packages/`; none for a change outside it) --- diff --git a/.changeset/canary-webkit-macos-leg.md b/.changeset/canary-webkit-macos-leg.md new file mode 100644 index 000000000..c15ab1282 --- /dev/null +++ b/.changeset/canary-webkit-macos-leg.md @@ -0,0 +1,6 @@ +--- +--- + +No release. Only the canary tooling, the Dox site and an internal README in `@northguild/gmt` +change: the weekly native suite gains a `webkit-macos` leg, and the workaround README names it +among the engines each compat check runs. No public function, output or bundle size changes. diff --git a/AGENTS.md b/AGENTS.md index d233990ef..21bdb93e8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -73,7 +73,7 @@ These are the non-negotiables. Full detail is in the context files above. 8. **JSDoc with `@example` on every public function.** Cover valid, invalid, and edge-case inputs. 9. **TC39 Temporal is the calendar authority.** Arithmetic clamps (`overflow: "constrain"`); parsers reject. See [§ Calendar & zone semantics](./context/coding-standards.md#calendar--zone-semantics). 10. **Never truncate-and-re-resolve a zoned boundary.** Use `internal/zonedBucket.ts` or `startOfDay()`/`hoursInDay`; test against the probe zones. Same section. -11. **One changeset rule.** Fix → `patch`, no behaviour change → none, new API → `minor`, breaking change → `minor` with a **Breaking changes** migration section. `major` is never used. See [coding-standards § Changesets](./context/coding-standards.md#changesets). +11. **One changeset rule.** Fix → `patch`, no behaviour change → an empty changeset if any file under `packages/` changed (else none), new API → `minor`, breaking change → `minor` with a **Breaking changes** migration section. `major` is never used. See [coding-standards § Changesets](./context/coding-standards.md#changesets). 12. **Zero known bugs.** A defect found is fixed now, in the same story, and its whole class with it. It is never deferred, pinned with `it.fails`, skipped, or documented as known. No disabled, focused or expected-to-fail test ships; `node scripts/test-markers.mjs check` in `validate` enforces it. That script is a backstop, not the definition of this rule: its checks are lexical, so it catches `it.skip` / `it.fails` reliably but cannot see a carried defect worded any other way, and a green check is never on its own evidence that the rule was met. See [testing standards § Zero known bugs](./context/testing-standards/references/index.md#zero-known-bugs). 13. **Plain English for anything a person reads.** Commit messages, changesets, PR titles, descriptions and review comments, issues and comments on upstream repos, handoff notes, and replies to the user all follow ISO 24495-1:2023 — the reader can find what they need, understand it first time, and act on it. Plain governs how it is said, not how much: depth, numbers and precise domain terms stay. The [`plain-english` skill](./.agents/skills/plain-english/SKILL.md) carries the rules. diff --git a/apps/dox/src/content/docs/browser-support.mdx b/apps/dox/src/content/docs/browser-support.mdx index 1f82600aa..10f08e9b1 100644 --- a/apps/dox/src/content/docs/browser-support.mdx +++ b/apps/dox/src/content/docs/browser-support.mdx @@ -27,24 +27,25 @@ ICU is the Unicode library that holds locale text and time zone data. Each engin | Browser or runtime | Engine | Where its ICU and time zone data comes from | Weekly leg | | --- | --- | --- | --- | -| Chrome, Edge, Brave, Opera, Vivaldi, Samsung Internet | Chromium | bundled with the browser | `chromium` | +| Chrome, Edge, Brave, Opera and Vivaldi on desktop | Chromium | bundled with the browser | `chromium` | +| Chrome, Samsung Internet and other Chromium browsers on Android, and Android System WebView | Chromium | bundled with the browser, in a smaller data file built for Android | none | | Firefox | Gecko and SpiderMonkey | bundled with the browser | `firefox` | | Safari on macOS | WebKit and JavaScriptCore | the operating system | `webkit-macos` | | Safari and other browsers on iPhone and iPad | WebKit, except where Apple allows another engine | the operating system | `webkit-macos` (same engine and Apple's ICU; iOS's own data is not tested) | -| DuckDuckGo | the system engine: WebKit on macOS and iOS, Chromium-based on Windows and Android | as that engine | `webkit-macos` or `chromium` | +| DuckDuckGo | the system engine: WebKit on macOS and iOS, Chromium on Windows, Android System WebView on Android | as that engine | `webkit-macos` or `chromium`; none on Android | | WebKit on Linux (WebKitGTK, WPE) | WebKit and JavaScriptCore | the Linux distribution's ICU | `webkit` | | Node.js | V8 | bundled with Node (full ICU) | `node` | | Deno | V8 | not documented | none | | Cloudflare Workers | V8 | not documented | none | | Bun | JavaScriptCore | not documented | none | -Brave, Edge, Opera, Vivaldi, Samsung Internet and DuckDuckGo are covered through their engine. No run tests them by name. +Brave, Edge, Opera, Vivaldi and DuckDuckGo are covered on desktop through their engine. No run tests them by name, and no run tests a browser on Android. Bun runs JavaScriptCore, the engine Safari uses. No weekly run tests Bun, and its time zone and locale data is not documented. Where each cell comes from: -- Chromium bundles its own ICU data ([Chromium ICU notes](https://chromium.googlesource.com/chromium/deps/icu/+/refs/heads/main/README.chromium)). +- Chromium bundles its own ICU data, and builds a separate, smaller data file for Android with only minimal calendar data ([Chromium ICU notes](https://chromium.googlesource.com/chromium/deps/icu/+/refs/heads/main/README.chromium)). The `chromium` leg runs the desktop data. - Brave, Edge, Opera, Vivaldi and Samsung Internet are built on Chromium: [Brave](https://github.com/brave/brave-core/blob/master/README.md), [Edge](https://learn.microsoft.com/en-us/deployedge/ms-edge-security-for-business), [Opera](https://dev.opera.com/extensions/), [Vivaldi](https://vivaldi.com/blog/vivaldi-browser-open-source/) and [Samsung Internet](https://developer.samsung.com/internet/release-note.html). - Firefox keeps its own copy of ICU ([`intl/icu`](https://github.com/mozilla-firefox/firefox/tree/main/intl/icu)) and of the time zone data ([`intl/tzdata`](https://github.com/mozilla-firefox/firefox/tree/main/intl/tzdata)). Its engines are [Gecko](https://mozilla.github.io/geckoview/) and [SpiderMonkey](https://spidermonkey.dev/). - Apple's WebKit links the operating system's ICU: the [WebKit source](https://github.com/WebKit/WebKit/blob/main/Source/WTF/WTF.xcodeproj/project.pbxproj) references `libicucore.dylib`, which [Apple's open-source ICU](https://github.com/apple-oss-distributions/ICU) builds. @@ -61,7 +62,7 @@ The weekly run does not cover these. A wrong answer there is still a GMT bug, an - Browser versions older than the one each weekly run installs. - Other macOS versions, and iOS itself. The `webkit-macos` leg runs the macOS version its runner has. - Deno, Bun and Cloudflare Workers, which have their own data. -- Android System WebView. +- Chromium on Android: Chrome, Samsung Internet, DuckDuckGo and Android System WebView. They read the smaller Android data file, which the `chromium` leg does not load. ## Where the results are diff --git a/context/canary/issues/CNRY-1.md b/context/canary/issues/CNRY-1.md index b7d008fd7..236a6980d 100644 --- a/context/canary/issues/CNRY-1.md +++ b/context/canary/issues/CNRY-1.md @@ -19,10 +19,12 @@ in both passes, 119 of which no tag explains, and passes two tag groups Linux We Morocco 2026 rows and Linux's pre-2023d tzdb). No leg tests the data Safari users have, so a wrong answer GMT gives them can go unseen. -Brave, Edge, Opera, Samsung Internet and the other Chromium browsers get no leg of their own. They -run Chromium's V8 and its bundled ICU, the `chromium` leg's engine and data. DuckDuckGo has no -engine of its own and no automation hook: it runs on the system engine (WebKit on macOS and iOS, -Chromium on Windows and Android). The browser support page says this, instead of a job per brand. +Brave, Edge, Opera, Vivaldi and the other desktop Chromium browsers get no leg of their own. They +run Chromium's V8 and its bundled ICU, the `chromium` leg's engine and data. Chromium on Android +(Chrome, Samsung Internet, Android System WebView) reads a separate, smaller ICU data file that no +leg loads, so it is listed as not tested. DuckDuckGo has no engine of its own and no automation +hook: it runs on the system engine (WebKit on macOS and iOS, Chromium on Windows, Android System +WebView on Android). The browser support page says this, instead of a job per brand. ## Parts @@ -64,7 +66,7 @@ Chromium on Windows and Android). The browser support page says this, instead of - A Dox page under Start here, beside Install: which browsers GMT supports, the engine each one runs, and the weekly leg that tests that engine. It covers the Chromium family (Chrome, Edge, - Brave, Opera, Vivaldi, Samsung Internet), the Firefox family, Safari and every iOS browser, + Brave, Opera, Vivaldi on desktop; Chromium on Android as not tested), the Firefox family, Safari and every iOS browser, DuckDuckGo, and the server runtimes on V8 (Node, Deno, Cloudflare Workers). - It states the support floor from evidence: the published build's syntax target and what `@js-temporal/polyfill` needs from the host (`Intl.DateTimeFormat` with time zones). It names no @@ -126,7 +128,7 @@ Stated as current rules. Where each rule is enforced is named beside it. - `LEG_BROWSER` maps each leg to its Playwright browser and Vitest project; `LEG_HOST` names the OS a leg must run on (`webkit`: Linux, `webkit-macos`: macOS). A verdict names the data it tested, so `native-suite.mjs` refuses a leg on the wrong host with two could-not-run verdicts and exit 2, never a result filed under another host's name. - The engine line is `macOS WebKit · macOS ` for the Mac leg and `WebKit ` for the Linux leg, from `engineLine`; the compat verdict and the preflight use it, so one leg's two lines agree. `legLabel` keeps every word before the first version (`macOS WebKit 26`), so each WebKit leg keeps its own issue keys and titles. - The workflow `native-suite` matrix is `include:` rows with `leg`, `browser` and `os`; the job name stays `Native Temporal suite ()`, so the report job's artifact parsing needs no change (`temporal-oracle-workflow.test.ts` runs its `awk` program to prove it). `macos-latest` is a moving label on purpose: the leg tests the data Apple ships now, and the engine line records which macOS ran. System packages (`--with-deps`) install on Linux only. The resource trace uses `df -Pk` and, where `free` is missing, `vm_stat`. An `otool -L` step prints which ICU Playwright's JavaScriptCore links (`libicucore` on the Mac) and never fails the job. -- The leg runs on `macos-latest` at no cost because the repository is public (GitHub Docs, "About billing for GitHub Actions"). Brave, Edge, Opera, Vivaldi and Samsung Internet run Chromium's engine and bundled ICU, so they have no leg of their own; DuckDuckGo runs the system engine and has no automation hook. The browser support page says both. +- The leg runs on `macos-latest` at no cost because the repository is public (GitHub Docs, "About billing for GitHub Actions"). Brave, Edge, Opera and Vivaldi on desktop run Chromium's engine and bundled ICU, so they have no leg of their own; Chromium on Android, Samsung Internet included, reads a smaller ICU data file no leg loads; DuckDuckGo runs the system engine and has no automation hook. The browser support page says both. **Tags** diff --git a/context/coding-standards.md b/context/coding-standards.md index b3fcce1e0..6b904cd1c 100644 --- a/context/coding-standards.md +++ b/context/coding-standards.md @@ -474,7 +474,7 @@ The one rule; other docs link here. | -------------------------------------------------------------- | ------------------------------------------------------ | | Bug fix, including a behaviour correction to shipped API | `patch` | | Speed or size gain; no output, option or signature change | `patch` | -| Refactor, docs, tests or agent config with no behaviour change | none | +| Refactor, docs, tests or agent config with no behaviour change | empty, when a file under `packages/` changed; else none | | New public API (function, option, namespace) | `minor` | | Breaking change (removed option, changed output or signature) | `minor`, with a **Breaking changes** migration section | @@ -483,9 +483,15 @@ release (owner decision, 2026-09-17). Fix to the standard: no compatibility shim period, and no "removed in a later version" wording. The changeset's **Breaking changes** section names every affected function and shows each old call or output next to its replacement. +Any file under `packages/` counts as a package change, even a README, a test or a comment, and CI's +**Story consistency** check (`changeset status`) fails without a changeset. So a change with no +release still carries an empty one (`pnpm changeset:add --empty`): two `---` lines and no package, +then one line that starts "No release." and says what changed. `apps/dox` is private, so a Dox-only +change needs none. A spec that says "no changeset" means no bump, never no file. + A speed or size changeset states the savings: before → after for size (minified and gzipped) and for speed. -Every epic story so far adds API, so its changeset is `minor`. A fix to an earlier story is still `patch`. Run `pnpm changeset:status` to prove coverage. See `PUBLISHING.md` for the release flow. +Every epic story so far adds API, so its changeset is `minor`. A fix to an earlier story is still `patch`. Run `pnpm changeset:status` on every change, whatever the level, to prove coverage. It sees only files git tracks, so a new changeset counts once it is staged or committed. See `PUBLISHING.md` for the release flow. ## Linting Enforcement diff --git a/scripts/deps.mjs b/scripts/deps.mjs index 644a6dfcc..5fb3f7977 100644 --- a/scripts/deps.mjs +++ b/scripts/deps.mjs @@ -484,7 +484,7 @@ function check() { // Canary: the hand-written cell names stories some tracker knows, none of them Done. const canary = canaryTracker(); const allStatus = new Map( - [...rows, ...canary.rows].map((r) => [r.id, r.status]), + [...rows, ...dox.rows, ...canary.rows].map((r) => [r.id, r.status]), ); for (const r of canary.rows) { for (const d of r.deps.map(bareId)) { diff --git a/scripts/syntax-floor.mjs b/scripts/syntax-floor.mjs index 040d87931..905fdb6d0 100644 --- a/scripts/syntax-floor.mjs +++ b/scripts/syntax-floor.mjs @@ -23,43 +23,42 @@ import { build } from "esbuild"; const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const GMT_DIR = path.join(ROOT, "packages", "gmt"); -/** The editions acorn can parse, lowest first: 2015 up to the first one it refuses. */ -function supportedEditions() { - const editions = []; - for (let year = 2015; year < 2100; year += 1) { - try { - parse("", { ecmaVersion: year, sourceType: "module" }); - } catch { - break; - } - editions.push(year); +/** The lowest edition the floor reports: ES2015, the first with modules. */ +const FIRST_EDITION = 2015; + +/** Whether acorn parses `source` as a module under `ecmaVersion`. */ +function parses(source, ecmaVersion) { + try { + parse(source, { ecmaVersion, sourceType: "module" }); + return true; + } catch { + return false; } - return editions; } /** * The lowest edition that parses every source. + * + * acorn refuses no edition year: it reads any year past its newest grammar as that grammar. So + * one parse with `"latest"` settles whether any edition parses a source, and the climb from 2015 + * then stops at the lowest one that does, no later than acorn's newest. * @param {string[]} sources JavaScript module text * @returns {number} an ECMA-262 edition year * @throws {Error} naming the source index when no edition parses a source */ export function syntaxFloor(sources) { - const editions = supportedEditions(); - let floor = editions[0]; + let floor = FIRST_EDITION; sources.forEach((source, index) => { - let lastError = null; - for (const edition of editions) { - try { - parse(source, { ecmaVersion: edition, sourceType: "module" }); - floor = Math.max(floor, edition); - return; - } catch (error) { - lastError = error; - } + try { + parse(source, { ecmaVersion: "latest", sourceType: "module" }); + } catch (error) { + throw new Error( + `source ${index}: no edition parses it (${error.message})`, + ); } - throw new Error( - `source ${index}: no edition parses it (${lastError?.message})`, - ); + let edition = FIRST_EDITION; + while (!parses(source, edition)) edition += 1; + floor = Math.max(floor, edition); }); return floor; } From c98d050c1374b0aabfa5aefd80e53d67a7529f74 Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 9 Nov 2026 10:19:07 +0200 Subject: [PATCH 3/5] fix(canary): tag the macOS 26 runner results on the webkit-macos leg (CNRY-1, #483) The runner (macos-26-arm64, macOS 26.7.2) has time zone data older than tzdb 2026c and older pt-PT short weekday names, and it accepts CST6CDT, EST5EDT, MST7MDT and PST8PDT. `browser-morocco-2026-tz-data` now names the Mac leg, a new `webkit-macos-26-pt-pt-short-weekdays` group tags the pt-PT row, and `webkit-posix-zone-ids` names the Linux leg only. Records WebKit bug 330688 and the icu-support thread for record AE. --- context/canary/issues/CNRY-1.md | 15 +++++-- .../domination/js-temporal-polyfill-bugs.md | 6 ++- scripts/lib/native-suite-tags.mjs | 40 ++++++++++++++----- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/context/canary/issues/CNRY-1.md b/context/canary/issues/CNRY-1.md index 236a6980d..69804ff89 100644 --- a/context/canary/issues/CNRY-1.md +++ b/context/canary/issues/CNRY-1.md @@ -108,6 +108,15 @@ at 58d4e150, with the Linux leg's tags. Run 2026-11-08. - **2 stale tags on the Mac:** `browser-morocco-2026-tz-data` and `webkit-linux-tz-data` pass, so Apple's tzdb has those changes. +The runner disagrees with that Mac. `temporal-oracle.yml` run 42578821204 on the branch +(`macos-26-arm64`, macOS 26.7.2, WebKit 26.6): 45 untagged host failures and 1 stale tag. + +- 44 rows of `oh-morocco.test.ts`: the runner's time zone data predates tzdb 2026c, so + `browser-morocco-2026-tz-data` names the Mac leg too. +- The pt-PT short weekday names (`webkit-macos-26-pt-pt-short-weekdays`). +- `webkit-posix-zone-ids` is stale: macOS 26.7.2 accepts `CST6CDT`, `EST5EDT`, `MST7MDT` and + `PST8PDT`, so the group names the Linux leg only. + ## Definition of done - A `workflow_dispatch` run of `temporal-oracle.yml` on `main` shows five native-suite legs, and @@ -132,11 +141,11 @@ Stated as current rules. Where each rule is enforced is named beside it. **Tags** -- A tag group covers two legs only when one cause, shown by the same received value, holds on both, so a group's `reason` is true on every leg it names. A group covering both WebKit legs has no `linux` in its id. A group the Mac passes stays off the Mac leg, or it would go stale there: `browser-morocco-2026-tz-data` and `webkit-linux-tz-data`. -- JavaScriptCore divergences S and T, `webkit-ar-sa-islamic-default-calendar`, `browser-canada-2026-tz-data` (`America/Winnipeg` still changes clocks on 2026-11-01) and the POSIX zone ids `CST6CDT`, `EST5EDT`, `MST7MDT` and `PST8PDT` (group `webkit-posix-zone-ids`) cover both WebKit legs. `webkit-legacy-zone-ids` narrows to `CET`, `EET`, `MET` and `WET` on Linux. Those ids are valid in ECMA-402 §6.5, "Use of the IANA Time Zone Database" (every IANA Zone and Link name), and the IANA `backward` file, so a refusal is the host's defect, and the tag stays whether or not it is filed. +- A tag group covers two legs only when one cause, shown by the same received value, holds on both, so a group's `reason` is true on every leg it names. A group covering both WebKit legs has no `linux` in its id. A group the Mac runner passes stays off the Mac leg, or it would go stale there: `webkit-linux-tz-data`, and `webkit-posix-zone-ids` while the runner's macOS 26 accepts those ids. A group the runner fails names the Mac leg even where a newer local Mac passes it: `browser-morocco-2026-tz-data`. +- JavaScriptCore divergences S and T, `webkit-ar-sa-islamic-default-calendar` and `browser-canada-2026-tz-data` (`America/Winnipeg` still changes clocks on 2026-11-01) cover both WebKit legs. The POSIX zone ids `CST6CDT`, `EST5EDT`, `MST7MDT` and `PST8PDT` (group `webkit-posix-zone-ids`) fail on Linux and on macOS 27, not on the runner's macOS 26, so the group names the Linux leg. `webkit-legacy-zone-ids` narrows to `CET`, `EET`, `MET` and `WET` on Linux. Those ids are valid in ECMA-402 §6.5, "Use of the IANA Time Zone Database" (every IANA Zone and Link name), and the IANA `backward` file, so a refusal is the host's defect, and the tag stays whether or not it is filed. - The `webkit-macos-*` groups hold Apple's ICU locale text, sorted by cause, each with evidence: engine and OS version, one call and its received value, Node 26's value, and the other legs' result. Never a pattern that matches everything; prefer `file` plus a `test` pattern naming the locale or id. Before a week-start or connector row is tagged as host data, the CLDR element for the Node release's ICU decides whether the test's expected value is the wrong one, which is then fixed in the test instead. - Record AE: ICU4C 75 and later count every Persian year before year 0 as a leap year, so `addDate` and `subtractDate` on a Persian date at ISO -271820 diverge on macOS WebKit. It is an engine defect with the rows tagged on `webkit-macos` only, shipped GMT is right (it runs the polyfill), and nothing about it goes on a Dox page except the bullet in `upstream.mdx` § Native engines. A control-only failure is never tagged; it is a GMT bug and gets fixed. -- Tags are checked against the leg's own run. The runner's macOS can differ from a local Mac, so a branch dispatch of `temporal-oracle.yml` reconciles the Mac tags before merge: a group the runner passes is narrowed or dropped, a new failure is tagged with evidence or fixed. Nothing is filed upstream, and no issue edited, until the owner approves the exact text; the drafts sit in `context/domination/js-temporal-polyfill-bugs.md` (record AE, and the POSIX zone ids for bugs.webkit.org). +- Tags are checked against the leg's own run. The runner's macOS can differ from a local Mac, so a branch dispatch of `temporal-oracle.yml` reconciles the Mac tags before merge: a group the runner passes is narrowed or dropped, a new failure is tagged with evidence or fixed. Nothing is filed upstream, and no issue edited, until the owner approves the exact text. The POSIX zone ids are [WebKit bug 330688](https://bugs.webkit.org/show_bug.cgi?id=330688); record AE's text and its icu-support thread sit in `context/domination/js-temporal-polyfill-bugs.md`. **Browser support page** diff --git a/context/domination/js-temporal-polyfill-bugs.md b/context/domination/js-temporal-polyfill-bugs.md index 9e21ab91b..82bb053c7 100644 --- a/context/domination/js-temporal-polyfill-bugs.md +++ b/context/domination/js-temporal-polyfill-bugs.md @@ -2745,7 +2745,7 @@ leg only). When a Node release carries a `temporal_rs` with #723, the tags go st ### Status -**Not filed yet.** The filing text is below; the owner decides where it goes. The tracker is the ICU Jira (project ICU, component calendar). Cause: ICU4C commit `d43d216feb` (ICU-22633, 2024-03-08) changed `PersianCalendar::isLeapYear` in `i18n/persncal.cpp` from +**Reported, no ticket yet.** The ICU Jira (project ICU, component calendar) did not let a new account create issues, so the report went to the icu-support list with a request for access or a ticket: [icu-support thread](https://groups.google.com/a/unicode.org/g/icu-support/c/IJBZUe3T4WY). The filing text below is the ticket to open once that is granted. Cause: ICU4C commit `d43d216feb` (ICU-22633, 2024-03-08) changed `PersianCalendar::isLeapYear` in `i18n/persncal.cpp` from ```cpp ClockMath::floorDivide(25*year+11, 33, &remainder); return remainder < 8; @@ -2823,7 +2823,9 @@ It shows in WebKit's Temporal on macOS (WebKit 26.6, Playwright's macOS build, o The fix is to go back to `floorDivide`, or to use a modulo that floors, for example `((y % 33) + 33) % 33 < 8`. -### POSIX zone ids: draft for bugs.webkit.org (not filed) +### POSIX zone ids: WebKit bug 330688 + +**Filed** as [WebKit bug 330688](https://bugs.webkit.org/show_bug.cgi?id=330688). Safari on macOS gives the same `RangeError` for step 1; the bug carries a screenshot of its console. Mac WebKit 26.6 on GitHub's `macos-26-arm64` runner (macOS 26.7.2) accepts all four ids, so on the Mac the refusal comes with macOS 27. The filed text: Title: Temporal and Intl reject the time zone ids CST6CDT, EST5EDT, MST7MDT and PST8PDT diff --git a/scripts/lib/native-suite-tags.mjs b/scripts/lib/native-suite-tags.mjs index c487d6d6e..5b3773d87 100644 --- a/scripts/lib/native-suite-tags.mjs +++ b/scripts/lib/native-suite-tags.mjs @@ -394,15 +394,17 @@ export const KNOWN_HOST_FAILURES = [ // Evidence: under Playwright 1.63.0, Chromium 153.0.8010.12 gives Africa/Casablanca and // Africa/El_Aaiun +01:00 at 2026-09-20T01:00Z, 2026-11-02T12:00Z and 2027-06-01T12:00Z, and // +00:00 at 2027-02-22T12:00Z (tz data before 2026c). Chromium 156.0.8078.4 under Playwright - // 1.64.1, Mac WebKit 26.6 and Node 26.12.1 (tz 2026e) give +00:00 at all four. Firefox 155.0 under - // Playwright 1.63.0 fails the same 44 rows of this file: it gives Africa/Casablanca +01:00 at - // 2026-09-20T01:00Z, where tz data from 2026c gives +00:00. Playwright's Linux WebKit 26.6 - // (ubuntu-24.04, the runner's libicu74 74.2) fails the same 44 rows on both engines. The group - // goes stale once a Playwright Chromium, Firefox and Linux WebKit all carry 2026c. + // 1.64.1, Mac WebKit 26.6 on macOS 27.0.1 and Node 26.12.1 (tz 2026e) give +00:00 at all four. + // Firefox 155.0 under Playwright 1.63.0 fails the same 44 rows of this file: it gives + // Africa/Casablanca +01:00 at 2026-09-20T01:00Z, where tz data from 2026c gives +00:00. + // Playwright's Linux WebKit 26.6 (ubuntu-24.04, the runner's libicu74 74.2) fails the same 44 rows + // on both engines, and so does Mac WebKit 26.6 on the macos-26-arm64 runner (macOS 26.7.2), whose + // system time zone data predates 2026c. The group goes stale once a Playwright Chromium, Firefox, + // Linux WebKit and the Mac runner all carry 2026c. id: "browser-morocco-2026-tz-data", - legs: ["chromium", "firefox", "webkit"], + legs: ["chromium", "firefox", "webkit", "webkit-macos"], reason: - "Chromium's, Firefox's and Linux WebKit's time zone data predates tzdb 2026c, so Morocco and Western Sahara still read +01:00 outside the old Ramadan weeks.", + "Chromium's, Firefox's, Linux WebKit's and the Mac runner's time zone data predates tzdb 2026c, so Morocco and Western Sahara still read +01:00 outside the old Ramadan weeks.", file: /\/oh-morocco\.test\.ts$/, }, { @@ -422,17 +424,20 @@ export const KNOWN_HOST_FAILURES = [ test: /\bManila\b|Antarctica\/Casey/, }, { - // Evidence, WebKit 26.6 on both builds (Playwright's Linux build on ubuntu-24.04, and the Mac build on - // macOS 27.0.1): `new Intl.DateTimeFormat("en", { timeZone: "EST5EDT" })` throws `RangeError: invalid + // Evidence, WebKit 26.6 (Playwright's Linux build on ubuntu-24.04; also the Mac build on macOS 27.0.1, + // and Safari there): `new Intl.DateTimeFormat("en", { timeZone: "EST5EDT" })` throws `RangeError: invalid // time zone: EST5EDT`, and `Temporal.ZonedDateTime.from("2024-07-15T12:00:00-04:00[EST5EDT]")` throws // `RangeError` too; the same for CST6CDT, MST7MDT and PST8PDT. Node 26.12.1, Chromium 153 and // Firefox 155 accept all four. IANA's `backward` file (tzdb 2026e) defines them as zones // (`Zone EST5EDT -5:00 USback E%sT`, and the same for CST6CDT, MST7MDT and PST8PDT), and ECMA-402 // § 6.5 makes each Zone of the IANA Time Zone Database a primary time zone identifier. + // Filed as https://bugs.webkit.org/show_bug.cgi?id=330688. The Mac leg's runner (macos-26-arm64, + // macOS 26.7.2) accepts all four, so the group names the Linux leg only; a Mac runner on macOS 27 + // fails these rows untagged, and the group then needs `webkit-macos` again. id: "webkit-posix-zone-ids", - legs: ["webkit", "webkit-macos"], + legs: ["webkit"], reason: - "WebKit refuses the tzdb legacy zone ids CST6CDT, EST5EDT, MST7MDT and PST8PDT as invalid time zones, so the rows that pass them through fail.", + "Linux WebKit refuses the tzdb legacy zone ids CST6CDT, EST5EDT, MST7MDT and PST8PDT as invalid time zones, so the rows that pass them through fail.", file: /\/(isValidTimeZone|toOffsetInstant|fromOffsetInstant|getTimeZoneOffset)\.test\.ts$/, test: /\b(CST6CDT|EST5EDT|MST7MDT|PST8PDT)\b/, }, @@ -555,6 +560,19 @@ export const KNOWN_HOST_FAILURES = [ "Mac WebKit's short Arabic weekday names drop the article (أحد where CLDR 48 ar.xml has الأحد), so the short list differs from Node's.", test: /getLocaleWeekdayNames returns 7 weekday names \(long\/short\/narrow\) for ar-SA/, }, + { + // Evidence, Mac WebKit 26.6 on the macos-26-arm64 runner (macOS 26.7.2): the pt-PT short weekday + // list fails `expected [ Array(7) ] to deeply equal [ 'domingo', 'segunda', 'terça', …(4) ]`; the + // runner's report does not print the names it got. Node 26.12.1 (CLDR 48.0) and Mac WebKit 26.6 on + // macOS 27.0.1 return domingo, segunda, terça, quarta, quinta, sexta, sábado. On the runner the long + // list passes and the short one fails (the narrow one is not reached), so this is the older macOS's + // locale data. + id: "webkit-macos-26-pt-pt-short-weekdays", + legs: ["webkit-macos"], + reason: + "The Mac runner's macOS 26 locale data gives other short Portuguese (pt-PT) weekday names than CLDR 48's domingo, segunda, terça.", + test: /getLocaleWeekdayNames returns 7 weekday names \(long\/short\/narrow\) for pt-PT/, + }, { // Evidence, Mac WebKit 26.6 against Node 26.12.1 (CLDR 48.0), 12-hour day periods: zh-CN and zh-TW at // 03:30 and 00:30 print "凌晨" where Node prints "上午" (zh.xml gregorian abbreviated am "上午", pm "下午"); From c2511df5b9d9da3498de968a8b721b41d12cf1d2 Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 9 Nov 2026 10:47:03 +0200 Subject: [PATCH 4/5] fix(dox): rename the engine page to `Temporal in every engine`, move it beside `Helping fix Temporal`, and list WebKit bug 330688 (CNRY-1, #483) The page tracks each engine's built-in Temporal, not GMT's support, so it leaves Start here. Install gets one line on what GMT needs from a host. Answers the review on #484: the engine list carries WebKit bug 330688, and the ICU line says the report is in. --- ...est.ts => install-host-line-built.test.ts} | 14 ++--- apps/dox/scripts/llms.test.ts | 9 ++- apps/dox/src/content/docs/install.mdx | 5 +- ...browser-support.mdx => native-engines.mdx} | 30 +++++----- apps/dox/src/content/docs/upstream.mdx | 7 ++- ...support.test.ts => native-engines.test.ts} | 57 ++++++++++++------- .../src/lib/page-expression-values.test.ts | 2 +- apps/dox/src/lib/page-expression-values.ts | 1 - apps/dox/src/lib/section-order.ts | 4 +- apps/dox/src/lib/top-level-pages.test.ts | 11 ++-- context/canary/issues/CNRY-1.md | 25 ++++---- context/canary/tracker.md | 2 +- 12 files changed, 96 insertions(+), 71 deletions(-) rename apps/dox/scripts/{browser-support-built.test.ts => install-host-line-built.test.ts} (78%) rename apps/dox/src/content/docs/{browser-support.mdx => native-engines.mdx} (80%) rename apps/dox/src/lib/{browser-support.test.ts => native-engines.test.ts} (61%) diff --git a/apps/dox/scripts/browser-support-built.test.ts b/apps/dox/scripts/install-host-line-built.test.ts similarity index 78% rename from apps/dox/scripts/browser-support-built.test.ts rename to apps/dox/scripts/install-host-line-built.test.ts index 1b3152cee..4aedd7ad7 100644 --- a/apps/dox/scripts/browser-support-built.test.ts +++ b/apps/dox/scripts/install-host-line-built.test.ts @@ -6,7 +6,7 @@ import { gmtNodeEngines } from "../src/generated/versions"; import { distDirOrSkip } from "./dist-dir"; /** - * On the built site: the figures the Browser support page states reach its HTML + * On the built site: the figures Install's host line states reach its HTML * as values. MDX does not evaluate an expression inside a backtick span, so a figure written as * `{gmtNodeEngines}` in code ticks ships its braces. Needs a build; returns early without one and * throws under `DOX_DIST_REQUIRED`. @@ -19,33 +19,33 @@ function builtHtml(root: string): string[] { .map((f) => join(root, f)); } -/** Text of the page's `
`, tags removed. */ +/** Text of the page's `
`, scripts, styles and tags removed. */ function mainText(html: string): string { const main = html.match(//)?.[0] ?? ""; return main + .replace(/<(script|style)\b[\s\S]*?<\/\1>/g, " ") .replace(/<[^>]*>/g, " ") .replace(/>|>/g, ">") .replace(/<|</g, "<") .replace(/\s+/g, " "); } -describe("browser support page, built", () => { +describe("Install's host line, built", () => { const dist = distDirOrSkip(); it("shows the generated Node range and syntax figures, and no literal expression", () => { if (dist === null) return; const html = readFileSync( - resolve(dist, "gmt", "browser-support", "index.html"), + resolve(dist, "gmt", "install", "index.html"), "utf8", ); const text = mainText(html); expect(text).toMatch( new RegExp( - `says ${gmtNodeEngines.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*\\.`, + `asks for ${gmtNodeEngines.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*\\.`, ), ); - expect(text).toContain(`edition ${syntaxFloor.edition} (ES modules)`); - expect(text).toContain(`all ${syntaxFloor.entries} entry points`); + expect(text).toContain(`ECMAScript ${syntaxFloor.edition} and`); expect(text).not.toMatch(/\{[A-Za-z_][\w.]*\}/); }); diff --git a/apps/dox/scripts/llms.test.ts b/apps/dox/scripts/llms.test.ts index 3498173b6..7d8a0119a 100644 --- a/apps/dox/scripts/llms.test.ts +++ b/apps/dox/scripts/llms.test.ts @@ -739,7 +739,12 @@ Body text here.`; const startHere = section("Start here"); expect(startHere[0]).toMatch(/\/install\.md\)/); const migrate = section("Migrate"); - for (const slug of ["compare", "bundle-size", "upstream"]) { + for (const slug of [ + "compare", + "bundle-size", + "upstream", + "native-engines", + ]) { const link = new RegExp(`/${slug}\\.md\\)`); expect( migrate.some((line) => link.test(line)), @@ -768,7 +773,7 @@ Body text here.`; expect(firstMigrate).toBeGreaterThan(lastStart); for (const url of urls.slice(firstMigrate)) { expect(path(url), url).toMatch( - /^(migrate\/|compare\/behaviour\.md$|compare\.md$|bundle-size\.md$|upstream\.md$)/, + /^(migrate\/|compare\/behaviour\.md$|compare\.md$|bundle-size\.md$|upstream\.md$|native-engines\.md$)/, ); } }); diff --git a/apps/dox/src/content/docs/install.mdx b/apps/dox/src/content/docs/install.mdx index 93f6580ca..e832af618 100644 --- a/apps/dox/src/content/docs/install.mdx +++ b/apps/dox/src/content/docs/install.mdx @@ -6,7 +6,8 @@ industries: [core] import { TabItem, Tabs } from "@astrojs/starlight/components"; -import { gmtVersion } from "~/generated/versions"; +import { syntaxFloor } from "~/generated/syntax-floor"; +import { gmtNodeEngines, gmtVersion } from "~/generated/versions"; Latest release: **v{gmtVersion}** @@ -41,7 +42,7 @@ bun add @northguild/gmt -Which browsers and runtimes run GMT: [Browser support](/browser-support/). +GMT runs in any browser or runtime that parses ECMAScript {syntaxFloor.edition} and whose `Intl.DateTimeFormat` accepts IANA time zones. On Node, its `engines` field asks for {gmtNodeEngines}. It ships its own Temporal, so a built-in `Temporal` is not needed. [Temporal in every engine](/native-engines/) shows the weekly test runs on each engine. ## Your first call diff --git a/apps/dox/src/content/docs/browser-support.mdx b/apps/dox/src/content/docs/native-engines.mdx similarity index 80% rename from apps/dox/src/content/docs/browser-support.mdx rename to apps/dox/src/content/docs/native-engines.mdx index 10f08e9b1..55abf0ad8 100644 --- a/apps/dox/src/content/docs/browser-support.mdx +++ b/apps/dox/src/content/docs/native-engines.mdx @@ -1,25 +1,21 @@ --- -title: Browser support -description: What GMT needs from a browser or runtime, which engine each one runs, and which weekly test run covers it. +title: Temporal in every engine +description: GMT's whole test suite runs every week on each engine's built-in Temporal and data. Which engine each browser and runtime runs, where its data comes from, and which weekly run tests it. industries: [core] --- -import { syntaxFloor } from "~/generated/syntax-floor"; -import { gmtNodeEngines } from "~/generated/versions"; +GMT runs on every browser and runtime on this page. It ships its own Temporal, the community +[`@js-temporal/polyfill`](https://github.com/js-temporal/temporal-polyfill), so it does not wait +for an engine to build Temporal in. -## What GMT needs from a host +**If you use GMT, there is nothing on this page for you to do.** The page tracks the engines +themselves. Every week, GMT's whole test suite runs on each engine's built-in `Temporal` and on its +time zone and locale data. That shows us where an engine differs from the standard, and the +[bugs we found](/upstream/#native-engines) go back to the engine's makers. -GMT runs on any host that has these three things: +## Why each engine is tested -1. **Modern JavaScript.** The code GMT ships, with its Temporal polyfill, parses as ECMAScript edition {syntaxFloor.edition} (ES modules). The number is measured on every build: the lowest edition whose grammar parses all {syntaxFloor.entries} entry points. -2. **`Intl.DateTimeFormat` with time zones.** It must accept an IANA `timeZone` and format a date and time to the second. The bundled polyfill reads every offset from it ([polyfill source, `lib/ecmascript.ts`](https://github.com/js-temporal/temporal-polyfill/blob/v0.5.1/lib/ecmascript.ts)). The `timeZone` option is defined in [ECMA-402](https://tc39.es/ecma402/#sec-createdatetimeformat). -3. **On Node, the version GMT's package asks for.** Its `engines` field says {gmtNodeEngines}. - -Native `Temporal` is not needed. GMT ships its own. - -## Why the engine still matters - -A host's time zone offsets and locale text are the host's own data. The Temporal specification leaves time zone offsets to the implementation ([GetNamedTimeZoneOffsetNanoseconds](https://tc39.es/proposal-temporal/#GetNamedTimeZoneOffsetNanoseconds) and [GetNamedTimeZoneEpochNanoseconds](https://tc39.es/proposal-temporal/#GetNamedTimeZoneEpochNanoseconds)), and ECMA-402 does the same for [locale data](https://tc39.es/ecma402/#sec-internal-slots). GMT gives the right answer for the data it is handed. So two browsers can show different text for one call, and a browser whose data is older than a time zone release gives that release's old offsets. [Upstream](/upstream/#native-engines) lists the cases we found. +A host's time zone offsets and locale text are the host's own data. The Temporal specification leaves time zone offsets to the implementation ([GetNamedTimeZoneOffsetNanoseconds](https://tc39.es/proposal-temporal/#GetNamedTimeZoneOffsetNanoseconds) and [GetNamedTimeZoneEpochNanoseconds](https://tc39.es/proposal-temporal/#GetNamedTimeZoneEpochNanoseconds)), and ECMA-402 does the same for [locale data](https://tc39.es/ecma402/#sec-internal-slots). GMT gives the right answer for the data it is handed. So two browsers can show different text for one call, and a browser whose data is older than a time zone release gives that release's old offsets. [Helping fix Temporal](/upstream/#native-engines) lists the cases we found. ## Browsers and runtimes @@ -55,9 +51,9 @@ Where each cell comes from: - Node ships full ICU data ([Node Intl](https://nodejs.org/api/intl.html)) and runs on [V8](https://nodejs.org/en/learn/getting-started/the-v8-javascript-engine). - Deno is [built on V8](https://github.com/denoland/deno/blob/main/README.md), Cloudflare Workers run [V8](https://developers.cloudflare.com/workers/reference/how-workers-works/), and Bun runs [JavaScriptCore](https://bun.sh/docs/runtime/). None of the three documents where its ICU or time zone data comes from. -## Not tested +## No weekly run yet -The weekly run does not cover these. A wrong answer there is still a GMT bug, and we want the report. +GMT runs on these too, but no weekly run tests their engine or data yet. If GMT gives a wrong answer on one, we want the report. - Browser versions older than the one each weekly run installs. - Other macOS versions, and iOS itself. The `webkit-macos` leg runs the macOS version its runner has. diff --git a/apps/dox/src/content/docs/upstream.mdx b/apps/dox/src/content/docs/upstream.mdx index 099dc5ffa..b48b7896b 100644 --- a/apps/dox/src/content/docs/upstream.mdx +++ b/apps/dox/src/content/docs/upstream.mdx @@ -150,9 +150,14 @@ The built-in engines have a few bugs of their own. We report each one we find. T before the Hijra as 13 months, so the result lands a month late. The report to WebKit is pending. - WebKit, on Linux and on macOS, throws when it adds a year to the last day of Chaitra in a year before about 4800 BCE. The report to WebKit is pending. +- [WebKit bug 330688](https://bugs.webkit.org/show_bug.cgi?id=330688): WebKit on Linux, and + Safari on macOS 27, reject the time zone ids `CST6CDT`, `EST5EDT`, `MST7MDT` and `PST8PDT`, + which the time zone database still defines. - ICU 75 and later, which WebKit on macOS uses for calendar arithmetic, counts every Persian year before year 0 (621 CE) as a leap year. Adding a month to the 30th of Bahman, the 11th month, in - such a year then throws instead of giving the 29th of Esfand. The report to ICU is pending. + such a year then throws instead of giving the 29th of Esfand. We reported it on + [ICU's support list](https://groups.google.com/a/unicode.org/g/icu-support/c/IJBZUe3T4WY); the + ICU ticket is pending. GMT gives the standard's answer in every case. diff --git a/apps/dox/src/lib/browser-support.test.ts b/apps/dox/src/lib/native-engines.test.ts similarity index 61% rename from apps/dox/src/lib/browser-support.test.ts rename to apps/dox/src/lib/native-engines.test.ts index 723956fa2..f287c3dfb 100644 --- a/apps/dox/src/lib/browser-support.test.ts +++ b/apps/dox/src/lib/native-engines.test.ts @@ -3,16 +3,20 @@ import { resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { NATIVE_LEGS } from "../../../../scripts/lib/canary-issues.mjs"; -import { START_HERE } from "./section-order"; +import { MIGRATE, START_HERE } from "./section-order"; /** - * The browser support page states no figure by hand and names exactly the - * weekly legs the workflow runs. + * The engine page names exactly the weekly legs the workflow runs and no version by hand, and + * Install's host line takes its figures from the generated values. */ const HERE = fileURLToPath(import.meta.url); const page = readFileSync( - resolve(HERE, "../../content/docs/browser-support.mdx"), + resolve(HERE, "../../content/docs/native-engines.mdx"), + "utf8", +); +const install = readFileSync( + resolve(HERE, "../../content/docs/install.mdx"), "utf8", ); const WORKFLOW = @@ -36,23 +40,12 @@ function legColumn(): string[] { return spans; } -describe("browser support page", () => { +describe("Temporal in every engine", () => { it("lists every native-suite leg in the table's last column, and no other leg", () => { const spans = new Set(legColumn()); expect([...spans].sort()).toEqual([...NATIVE_LEGS].sort()); }); - it("imports and uses syntaxFloor and gmtNodeEngines", () => { - expect(page).toMatch( - /import \{ syntaxFloor \} from "~\/generated\/syntax-floor";/, - ); - expect(page).toMatch( - /import \{ gmtNodeEngines \} from "~\/generated\/versions";/, - ); - expect(text).toContain("{syntaxFloor.edition}"); - expect(text).toContain("{gmtNodeEngines}"); - }); - it.each` label | pattern ${"an ECMAScript year"} | ${/ES20\d\d/} @@ -73,13 +66,39 @@ describe("browser support page", () => { }); }); -describe("START_HERE", () => { - it("puts browser-support second", () => { +describe("Install's host line", () => { + it("imports and uses syntaxFloor and gmtNodeEngines", () => { + expect(install).toMatch( + /import \{ syntaxFloor \} from "~\/generated\/syntax-floor";/, + ); + expect(install).toMatch( + /import \{ gmtNodeEngines, gmtVersion \} from "~\/generated\/versions";/, + ); + expect(install).toContain("ECMAScript {syntaxFloor.edition}"); + expect(install).toContain("{gmtNodeEngines}"); + expect(install).toContain("](/native-engines/)"); + }); + + it.each` + label | pattern + ${"an ECMAScript year"} | ${/ES20\d\d/} + ${"a node range"} | ${/>=\s*\d/} + `("has no hand-written figure: $label", ({ pattern }) => { + expect(install).not.toMatch(pattern); + }); +}); + +describe("the sidebar", () => { + it("keeps the engine page out of Start here", () => { expect(START_HERE.map((p) => p.slug)).toEqual([ "install", - "browser-support", "core-rules", "why-gmt", ]); }); + + it("puts the engine page right after Helping fix Temporal", () => { + const slugs = MIGRATE.map((p) => p.slug); + expect(slugs.indexOf("native-engines")).toBe(slugs.indexOf("upstream") + 1); + }); }); diff --git a/apps/dox/src/lib/page-expression-values.test.ts b/apps/dox/src/lib/page-expression-values.test.ts index 9db9d1625..42d633a15 100644 --- a/apps/dox/src/lib/page-expression-values.test.ts +++ b/apps/dox/src/lib/page-expression-values.test.ts @@ -18,7 +18,7 @@ const PAGES = [ "why-gmt.mdx", "compare.mdx", "compare/behaviour.mdx", - "browser-support.mdx", + "install.mdx", "migrate/index.mdx", "migrate/date-fns.mdx", "migrate/luxon.mdx", diff --git a/apps/dox/src/lib/page-expression-values.ts b/apps/dox/src/lib/page-expression-values.ts index 37dc7e864..f06993b7d 100644 --- a/apps/dox/src/lib/page-expression-values.ts +++ b/apps/dox/src/lib/page-expression-values.ts @@ -128,7 +128,6 @@ export function pageExpressionValues(): Record { largestSuite.stats.tests, ), "syntaxFloor.edition": String(syntaxFloor.edition), - "syntaxFloor.entries": String(syntaxFloor.entries), gmtNodeEngines, "competitorTimeResolutionLabel()": competitorTimeResolutionLabel(), }; diff --git a/apps/dox/src/lib/section-order.ts b/apps/dox/src/lib/section-order.ts index 7e057079a..346e56b0f 100644 --- a/apps/dox/src/lib/section-order.ts +++ b/apps/dox/src/lib/section-order.ts @@ -10,17 +10,17 @@ /** What a reader needs first, in reading order. */ export const START_HERE = [ { slug: "install" }, - { slug: "browser-support" }, { slug: "core-rules" }, { slug: "why-gmt" }, ] as const satisfies readonly { slug: string; label?: string }[]; -/** The Migrate group: the overview, the pages that weigh GMT against the others, one page per library, then the behaviour matrix. */ +/** The Migrate group: the overview, the pages that weigh GMT against the others, the weekly engine runs, one page per library, then the behaviour matrix. */ export const MIGRATE = [ { slug: "migrate", label: "Overview" }, { slug: "compare", label: "GMT vs. the others" }, { slug: "bundle-size" }, { slug: "upstream" }, + { slug: "native-engines" }, { slug: "migrate/date-fns", label: "From date-fns" }, { slug: "migrate/luxon", label: "From Luxon" }, { slug: "migrate/dayjs", label: "From Day.js" }, diff --git a/apps/dox/src/lib/top-level-pages.test.ts b/apps/dox/src/lib/top-level-pages.test.ts index 554e8697a..865ccacef 100644 --- a/apps/dox/src/lib/top-level-pages.test.ts +++ b/apps/dox/src/lib/top-level-pages.test.ts @@ -30,12 +30,10 @@ describe("topLevelPages", () => { "../content/docs/index.mdx": "x", "../content/docs/why-gmt.mdx": "w", "../content/docs/core-rules.mdx": "c", - "../content/docs/browser-support.mdx": "b", }; expect(topLevelPages(raw)).toEqual([ { slug: "index", source: "x" }, { slug: "install", source: "i" }, - { slug: "browser-support", source: "b" }, { slug: "core-rules", source: "c" }, { slug: "why-gmt", source: "w" }, { slug: "alpha", source: "a" }, @@ -115,17 +113,18 @@ describe("migratePages", () => { ).toEqual([{ slug: "migrate/index", source: "index" }]); }); - it("names eleven pages, the overview keyed as a folder index", () => { - expect(MIGRATE_ORDER).toHaveLength(11); + it("names twelve pages, the overview keyed as a folder index", () => { + expect(MIGRATE_ORDER).toHaveLength(12); expect(MIGRATE_ORDER[0]).toBe("migrate/index"); }); - it("lists compare, bundle-size and upstream after the overview", () => { - expect(MIGRATE_ORDER.slice(0, 4)).toEqual([ + it("lists compare, bundle-size, upstream and native-engines after the overview", () => { + expect(MIGRATE_ORDER.slice(0, 5)).toEqual([ "migrate/index", "compare", "bundle-size", "upstream", + "native-engines", ]); }); }); diff --git a/context/canary/issues/CNRY-1.md b/context/canary/issues/CNRY-1.md index 69804ff89..c15a5e21f 100644 --- a/context/canary/issues/CNRY-1.md +++ b/context/canary/issues/CNRY-1.md @@ -1,4 +1,4 @@ -# CNRY-1 — Safari's ICU and time zone data in the native suite, and a browser support page +# CNRY-1 — Safari's ICU and time zone data in the native suite, and an engine page **Issue:** #483 @@ -24,7 +24,7 @@ run Chromium's V8 and its bundled ICU, the `chromium` leg's engine and data. Chr (Chrome, Samsung Internet, Android System WebView) reads a separate, smaller ICU data file that no leg loads, so it is listed as not tested. DuckDuckGo has no engine of its own and no automation hook: it runs on the system engine (WebKit on macOS and iOS, Chromium on Windows, Android System -WebView on Android). The browser support page says this, instead of a job per brand. +WebView on Android). The engine page says this, instead of a job per brand. ## Parts @@ -62,15 +62,15 @@ WebView on Android). The browser support page says this, instead of a job per br - The report job's artifact parsing already keys on the job name, so `Native Temporal suite (webkit-macos)` needs no change there. A test confirms it. -### 2. The browser support page +### 2. The engine page -- A Dox page under Start here, beside Install: which browsers GMT supports, the engine each one - runs, and the weekly leg that tests that engine. It covers the Chromium family (Chrome, Edge, +- A Dox page, "Temporal in every engine", beside "Helping fix Temporal": the engine each browser + and runtime runs, where its data comes from, and the weekly leg that tests it. It covers the Chromium family (Chrome, Edge, Brave, Opera, Vivaldi on desktop; Chromium on Android as not tested), the Firefox family, Safari and every iOS browser, DuckDuckGo, and the server runtimes on V8 (Node, Deno, Cloudflare Workers). -- It states the support floor from evidence: the published build's syntax target and what - `@js-temporal/polyfill` needs from the host (`Intl.DateTimeFormat` with time zones). It names no - version it has not checked. +- Install states the host floor from evidence in one line: the published build's syntax target + and what `@js-temporal/polyfill` needs from the host (`Intl.DateTimeFormat` with time zones). It + names no version it has not checked. - It says plainly that Brave and DuckDuckGo are covered through their engine, not run by name. - It links to the weekly workflow, not to a dated run. @@ -124,7 +124,7 @@ The runner disagrees with that Mac. `temporal-oracle.yml` run 42578821204 on the - The `webkit-macos` leg passes, or every failure it reports is tagged with evidence or fixed in GMT. No control-only failure is tagged. - `pnpm --filter dox test` passes with the new leg in every canary test that lists legs. -- The browser support page builds, passes the Dox gates and is linked from Start here. +- The engine page builds, passes the Dox gates and is linked from Install. ## Decisions @@ -137,7 +137,7 @@ Stated as current rules. Where each rule is enforced is named beside it. - `LEG_BROWSER` maps each leg to its Playwright browser and Vitest project; `LEG_HOST` names the OS a leg must run on (`webkit`: Linux, `webkit-macos`: macOS). A verdict names the data it tested, so `native-suite.mjs` refuses a leg on the wrong host with two could-not-run verdicts and exit 2, never a result filed under another host's name. - The engine line is `macOS WebKit · macOS ` for the Mac leg and `WebKit ` for the Linux leg, from `engineLine`; the compat verdict and the preflight use it, so one leg's two lines agree. `legLabel` keeps every word before the first version (`macOS WebKit 26`), so each WebKit leg keeps its own issue keys and titles. - The workflow `native-suite` matrix is `include:` rows with `leg`, `browser` and `os`; the job name stays `Native Temporal suite ()`, so the report job's artifact parsing needs no change (`temporal-oracle-workflow.test.ts` runs its `awk` program to prove it). `macos-latest` is a moving label on purpose: the leg tests the data Apple ships now, and the engine line records which macOS ran. System packages (`--with-deps`) install on Linux only. The resource trace uses `df -Pk` and, where `free` is missing, `vm_stat`. An `otool -L` step prints which ICU Playwright's JavaScriptCore links (`libicucore` on the Mac) and never fails the job. -- The leg runs on `macos-latest` at no cost because the repository is public (GitHub Docs, "About billing for GitHub Actions"). Brave, Edge, Opera and Vivaldi on desktop run Chromium's engine and bundled ICU, so they have no leg of their own; Chromium on Android, Samsung Internet included, reads a smaller ICU data file no leg loads; DuckDuckGo runs the system engine and has no automation hook. The browser support page says both. +- The leg runs on `macos-latest` at no cost because the repository is public (GitHub Docs, "About billing for GitHub Actions"). Brave, Edge, Opera and Vivaldi on desktop run Chromium's engine and bundled ICU, so they have no leg of their own; Chromium on Android, Samsung Internet included, reads a smaller ICU data file no leg loads; DuckDuckGo runs the system engine and has no automation hook. The engine page says both. **Tags** @@ -147,9 +147,10 @@ Stated as current rules. Where each rule is enforced is named beside it. - Record AE: ICU4C 75 and later count every Persian year before year 0 as a leap year, so `addDate` and `subtractDate` on a Persian date at ISO -271820 diverge on macOS WebKit. It is an engine defect with the rows tagged on `webkit-macos` only, shipped GMT is right (it runs the polyfill), and nothing about it goes on a Dox page except the bullet in `upstream.mdx` § Native engines. A control-only failure is never tagged; it is a GMT bug and gets fixed. - Tags are checked against the leg's own run. The runner's macOS can differ from a local Mac, so a branch dispatch of `temporal-oracle.yml` reconciles the Mac tags before merge: a group the runner passes is narrowed or dropped, a new failure is tagged with evidence or fixed. Nothing is filed upstream, and no issue edited, until the owner approves the exact text. The POSIX zone ids are [WebKit bug 330688](https://bugs.webkit.org/show_bug.cgi?id=330688); record AE's text and its icu-support thread sit in `context/domination/js-temporal-polyfill-bugs.md`. -**Browser support page** +**Engine page and Install's host line** -- `browser-support.mdx` sits second under Start here (`START_HERE`: `install`, `browser-support`, `core-rules`, `why-gmt`). It states no figure by hand: `syntaxFloor` (`~/generated/syntax-floor`) and `gmtNodeEngines` (`~/generated/versions`) are generated before the build. MDX does not evaluate an expression inside a backtick span, so a figure is written outside code ticks. `browser-support.test.ts` checks that the table's leg column equals `NATIVE_LEGS`, that both figures are used, that no version number is typed, and that the workflow link is the workflow URL and no dated run. +- `native-engines.mdx` ("Temporal in every engine") tracks the engines' built-in `Temporal` and data, not GMT's support: GMT ships its own `Temporal` and runs on every host the page lists, and the page says so first. It sits in the Migrate group right after `upstream` ("Helping fix Temporal"), never under Start here (`START_HERE`: `install`, `core-rules`, `why-gmt`). +- What GMT needs from a host is one line on Install, linking the engine page. It states no figure by hand: `syntaxFloor` (`~/generated/syntax-floor`) and `gmtNodeEngines` (`~/generated/versions`) are generated before the build. MDX does not evaluate an expression inside a backtick span, so a figure is written as `{…}`. `native-engines.test.ts` checks that the table's leg column equals `NATIVE_LEGS`, that neither page types a version number, that Install uses both figures, that the workflow link is the workflow URL and no dated run, and the sidebar placement; `install-host-line-built.test.ts` checks the figures reach the built Install page. - The syntax floor is measured, not read from the `tsdown` target (`esnext`): `scripts/syntax-floor.mjs` bundles each `exports` entry in memory with esbuild, polyfill and `jsbi` included, and parses it with acorn (`8.16.0`, exact) from `ecmaVersion` 2015 upward. An entry's floor is the lowest edition that parses; the page's floor is the highest entry floor. A bundle no edition parses exits 2 naming the entry; there is no fallback. The ECMA-262 edition table decides what each edition adds; acorn is the tool, not the authority. `gmtNodeEngines` comes from `packages/gmt/package.json` `engines.node`, and a missing field exits 1. - Every cell that names a data source cites its primary page, or says "not documented". The iPhone row cites Apple App Review Guidelines §2.5.6 and Apple's BrowserEngineKit documentation, names no law or region, and says only "except where Apple allows another engine". Bun runs JavaScriptCore with its own data and no weekly run tests it. The page states Safari's native `Temporal` status only with a source from WebKit's feature status page or Apple's release notes, and otherwise says nothing, because Playwright's WebKit build is not Safari. - The page names no browser version it has not run; versions belong to the weekly job summary. It links to the workflow, never to a dated run. The table passes `dox-tables` at 390px. diff --git a/context/canary/tracker.md b/context/canary/tracker.md index bb25705c5..ce92ce862 100644 --- a/context/canary/tracker.md +++ b/context/canary/tracker.md @@ -16,7 +16,7 @@ the package. | 2 | CORE-82 | The suite runs on native `Temporal`: Node 26, Chromium, Firefox, WebKit, weekly | — | #322 | Done | | 3 | CORE-92 | Weekly check for a `temporal-polyfill` release GMT can swap to | — | #386 | Done | | 4 | CORE-110 | The weekly upgrade check compares each calendar's years with native `Temporal` | — | #468 | Done | -| 5 | CNRY-1 | Safari's ICU and time zone data in the native suite, and a browser support page | — | #483 | Done | +| 5 | CNRY-1 | Safari's ICU and time zone data in the native suite, and an engine page | — | #483 | Done | Canary issues fixed with no story of their own: From 4da30b6edb7a972c506fa69429b81eb2d346b78c Mon Sep 17 00:00:00 2001 From: "Craig C." Date: Mon, 9 Nov 2026 10:56:04 +0200 Subject: [PATCH 5/5] fix(dox): say on the engine page that older browsers need what Install asks for (CNRY-1, #483) --- apps/dox/src/content/docs/native-engines.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/dox/src/content/docs/native-engines.mdx b/apps/dox/src/content/docs/native-engines.mdx index 55abf0ad8..1cf23d349 100644 --- a/apps/dox/src/content/docs/native-engines.mdx +++ b/apps/dox/src/content/docs/native-engines.mdx @@ -4,7 +4,8 @@ description: GMT's whole test suite runs every week on each engine's built-in Te industries: [core] --- -GMT runs on every browser and runtime on this page. It ships its own Temporal, the community +GMT runs on every current browser and runtime on this page, and on any older one that meets +[Install's requirements](/install/). It ships its own Temporal, the community [`@js-temporal/polyfill`](https://github.com/js-temporal/temporal-polyfill), so it does not wait for an engine to build Temporal in. @@ -53,7 +54,8 @@ Where each cell comes from: ## No weekly run yet -GMT runs on these too, but no weekly run tests their engine or data yet. If GMT gives a wrong answer on one, we want the report. +GMT runs on these too, as long as they meet [Install's requirements](/install/), but no weekly run +tests their engine or data yet. If GMT gives a wrong answer on one, we want the report. - Browser versions older than the one each weekly run installs. - Other macOS versions, and iOS itself. The `webkit-macos` leg runs the macOS version its runner has.