Skip to content

H-6679: Migrate monorepo to TypeScript 6.0.3#8999

Draft
claude[bot] wants to merge 6 commits into
mainfrom
claude/h-6679-migrate-to-typescript-6
Draft

H-6679: Migrate monorepo to TypeScript 6.0.3#8999
claude[bot] wants to merge 6 commits into
mainfrom
claude/h-6679-migrate-to-typescript-6

Conversation

@claude

@claude claude Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Requested by Chris Feijoo · Slack thread

🌟 What is the purpose of this PR?

Before: the monorepo type-checked with TypeScript 5.9.3, leaning on long-deprecated compiler options — baseUrl-based paths resolution, moduleResolution: "node" (node10), an ignoreDeprecations: "5.0" escape hatch — and on TS 5.x's implicit inclusion of every node_modules/@types package.

After: the whole repo type-checks, lints, and builds with TypeScript 6.0.3 (typescript-eslint 8.62.1). The legacy base tsconfig is cleaned of deprecated options, workspaces resolve modules with bundler/nodenext, and ambient type packages are declared explicitly. This absorbs the TS 6 defaults now, so the follow-up TS 7 (Go-native) side-by-side compiler flip is a much smaller diff.

🔗 Related links

🔍 What does this change?

Dependency bumps (chore: bump TypeScript to 6.0.3 and typescript-eslint to 8.62.1)

  • typescript 5.9.3 → 6.0.3 in every workspace manifest; typescript-eslint resolution → 8.62.1.
  • Changeset for @blockprotocol/graph, whose codegen module depends on typescript at runtime.
  • petrinaut runtime LSP deliberately frozen at TypeScript 5.9.3: @hashintel/petrinaut-core now depends on "typescript5": "npm:typescript@5.9.3" with a matching Vite resolve.alias (/^typescript(\/.*)?$/typescript5$1), because the in-browser language service uses the TypeScript JS API (createLanguageService), which TS 7 no longer ships. Source files keep importing plain typescript so they type-check against the workspace-wide version. yarn.config.cjs's allowedUnscriptedDevDependencies carve-out updated accordingly, and the root workspace now pins typescript so node_modules/.bin/tsc deterministically resolves to 6.0.3 rather than the alias's tsc bin.

tsconfig burn-down (chore: rework tsconfigs for TypeScript 6.0)

  • libs/@local/tsconfig/legacy-base-tsconfig-to-refactor.json: dropped baseUrl (bare-paths resolution retired), moduleResolution: "node""bundler", removed the root ts-node block and outDir, fixed the stale @local/status/type-defs/* path mapping.
  • TS 6 no longer auto-includes every node_modules/@types package, so the base config declares "types": ["node"] explicitly; workspaces needing more ambient globals extend it (e.g. frontend adds gapi/google.accounts/google.picker, plugin-browser adds chrome).
  • Kept TS 5.x behavior for noUncheckedSideEffectImports: false (bundler-handled asset imports like import "./styles.css").
  • Removed the now-rejected ignoreDeprecations: "5.0" from @hashintel/ds-components; added explicit rootDir: "./src" to build configs.

Source fixes (fix: adjust sources for TypeScript 6 and typescript-eslint 8.62)

  • Replaced deep dist/cjs type imports (react-pdf, @blockprotocol/type-system) with public/esm entry points — stricter exports-map enforcement under moduleResolution: "bundler" blocks the old paths (apps/hash-frontend/src/pages/shared/pdf-preview.tsx and friends).
  • libs/@hashintel/design-system/src/e-chart.tsx: derive GraphNode/GraphEdge from the public GraphSeriesOption instead of reaching into echarts/types/src/*.
  • Temporarily disabled @typescript-eslint/no-unnecessary-type-assertion in @local/eslint: 8.62 mis-reports assertions as unnecessary under TS 6.0 (removing them breaks tsc). To be re-enabled once typescript-eslint officially supports TS 6.0.

What surfaced

  • @local/effect-dns-hickory lint failed in the migration container only because the napi CLI (provided in CI via mise, npm:@napi-rs/cli) isn't available there, so the napi-generated dist/impl.d.ts was missing and the package import resolved to an error type. With the build artifact present, lint:tsc and lint:eslint pass unchanged under TS 6.0.3 — no code change needed.
  • @apps/plugin-browser:build requires SENTRY_DSN/SENTRY_AUTH_TOKEN for production builds (hard error in webpack.config.js); these are CI-provided secrets (Vault, see deploy.yml) absent in the migration container. tsc --noEmit for plugin-browser passes under 6.0.3.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)
    • @blockprotocol/graph (runtime typescript dependency bump — changeset added); @hashintel/petrinaut-core is touched but the typescript5 alias is a bundled devDependency, not a published-consumer-facing change.

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

  • @typescript-eslint/no-unnecessary-type-assertion is temporarily off repo-wide (false positives against TS 6.0); re-enable when typescript-eslint ≥ 8.63 lands.
  • typescript-eslint 8.62.1 does not yet declare official TS 6.0 support — expect a warning banner, behavior verified across the repo lint run.

🐾 Next steps

  • Step 2 of the migration plan: TS 7 (Go-native) side-by-side compiler flip — this PR intentionally absorbs the TS 6 config defaults to keep that diff small.
  • Re-enable no-unnecessary-type-assertion once typescript-eslint officially supports TS 6.
  • SRE-381: replace the legacy base tsconfig with the community-maintained base.

🛡 What tests cover this?

  • Full turbo run (build / lint:tsc / lint:eslint / unit tests) across all workspaces under TS 6.0.3 — green except the two environment-only items called out above.
  • @hashintel/petrinaut-core: 665 unit tests pass; vite build output verified to bundle TypeScript 5.9 (versionMajorMinor = "5.9") into the LSP worker; tsgo --noEmit clean.
  • yarn constraints passes.

❓ How to test this?

  1. Checkout the branch, yarn install.
  2. yarn tsc --version → 6.0.3; run turbo run lint:tsc lint:eslint — repo-wide green.
  3. yarn workspace @hashintel/petrinaut-core test:unit --run && yarn workspace @hashintel/petrinaut-core build — LSP worker still bundles TS 5.9.3.

Generated by Claude Code

claude added 3 commits July 9, 2026 17:39
Bumps the workspace-wide typescript pin from 5.9.3 to 6.0.3 across all
package.json manifests and moves the typescript-eslint resolution to
8.62.1.

The petrinaut-core LSP worker deliberately keeps bundling TypeScript
5.9.3 via a new `typescript5` npm alias (plus a matching Vite
resolve.alias): the in-browser language service relies on the
TypeScript JS API, which the Go-native TypeScript 7 no longer provides.

Includes a changeset for @blockprotocol/graph, whose codegen module
uses typescript as a runtime dependency.
- Drop `baseUrl` from the legacy base tsconfig (deprecated bare-`paths`
  resolution is the default now) and move workspaces from
  `moduleResolution: node` (node10) to `bundler`.
- TypeScript 6.0 no longer auto-includes every node_modules/@types
  package, so declare `types` explicitly (`node` in the base config;
  workspaces with extra ambient globals such as `chrome` or `gapi`
  extend it).
- Keep TS 5.x behavior for `noUncheckedSideEffectImports` (asset
  side-effect imports) for now.
- Remove the obsolete `ignoreDeprecations: "5.0"` escape hatch and the
  root-level `ts-node` block, set explicit `rootDir` in build configs,
  and fix the stale `@local/status/type-defs/*` path mapping.
- Replace deep `dist/cjs` type imports (react-pdf,
  @blockprotocol/type-system) with public / esm entry points, which the
  stricter exports-map resolution under `moduleResolution: bundler`
  requires.
- Derive echarts GraphNode/GraphEdge types from the public
  `GraphSeriesOption` instead of reaching into `echarts/types/src/*`,
  which the echarts exports map blocks.
- Temporarily disable @typescript-eslint/no-unnecessary-type-assertion:
  typescript-eslint 8.62 mis-reports assertions as unnecessary under
  TypeScript 6.0 (removing them breaks tsc). Re-enable once
  typescript-eslint officially supports TS 6.0 (>= 8.63).
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jul 9, 2026 7:13pm
hashdotdesign-tokens Ready Ready Preview, Comment Jul 9, 2026 7:13pm
petrinaut Ready Ready Preview, Comment Jul 9, 2026 7:13pm

@claude claude Bot assigned kube Jul 9, 2026
@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/tests New or updated tests area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests area/apps area/apps > hash.design Affects the `hash.design` design site (app) labels Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.68%. Comparing base (186b284) to head (73d13fb).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8999      +/-   ##
==========================================
+ Coverage   59.20%   59.68%   +0.48%     
==========================================
  Files        1358     1371      +13     
  Lines      132674   134930    +2256     
  Branches     6019     6067      +48     
==========================================
+ Hits        78546    80534    +1988     
- Misses      53198    53465     +267     
- Partials      930      931       +1     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.39% <ø> (ø)
apps.hash-api 6.39% <ø> (ø)
blockprotocol.type-system 40.84% <ø> (ø)
local.claude-hooks 0.00% <ø> (ø)
local.harpc-client 51.49% <ø> (ø)
local.hash-backend-utils 2.81% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 0.18% <ø> (ø)
rust.antsi 0.00% <ø> (ø)
rust.error-stack 90.89% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.23% <ø> (+0.03%) ⬆️
rust.harpc-tower 67.03% <ø> (ø)
rust.harpc-types 0.00% <ø> (ø)
rust.harpc-wire-protocol 92.23% <ø> (ø)
rust.hash-codec 72.76% <ø> (ø)
rust.hash-graph-api 7.41% <ø> (-0.05%) ⬇️
rust.hash-graph-authorization 62.59% <ø> (ø)
rust.hash-graph-embeddings 91.88% <ø> (?)
rust.hash-graph-postgres-store 29.02% <ø> (-0.09%) ⬇️
rust.hash-graph-store 38.20% <ø> (-0.02%) ⬇️
rust.hash-graph-temporal-versioning 47.95% <ø> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 83.43% <ø> (ø)
rust.hashql-ast 89.63% <ø> (+2.39%) ⬆️
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-core 78.95% <ø> (-0.47%) ⬇️
rust.hashql-diagnostics 72.51% <ø> (+0.19%) ⬆️
rust.hashql-eval 79.47% <ø> (ø)
rust.hashql-hir 89.09% <ø> (+0.02%) ⬆️
rust.hashql-mir 88.05% <ø> (+<0.01%) ⬆️
rust.hashql-syntax-jexpr 94.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.38%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 2 regressed benchmarks
✅ 96 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
bit_matrix/dense/iter_row[64] 140.8 ns 170 ns -17.16%
bit_matrix/dense/iter_row[200] 185.8 ns 215 ns -13.57%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/h-6679-migrate-to-typescript-6 (73d13fb) with main (232f15c)

Open in CodSpeed

Comment on lines +4 to +6
"compilerOptions": {
"moduleResolution": "bundler"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivated this change?

DocumentCallback,
OnDocumentLoadSuccess,
} from "react-pdf/dist/cjs/shared/types";
} from "react-pdf/dist/esm/shared/types.js";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These import updates need manual checking (by adding a PDF file and checking that the preview renders)

"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"moduleResolution": "bundler",
"types": ["node", "gapi", "google.accounts", "google.picker"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivated this? These types are already in dev dependencies.

Comment on lines +5 to +9
/**
* "DOM" is needed because the program pulls in `@blockprotocol/graph` sources
* (via the shared `paths` aliases), which reference DOM types such as `HTMLElement`.
*/
"lib": ["ES2024", "DOM"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes DOM APIs available across the files, which will not work in a Node environment (or be different to their browser equivalents). This is a potential footgun for developers. Is there a more targeted fix to the issue?

Comment on lines +465 to +468
// Temporarily disabled: typescript-eslint 8.62 mis-reports assertions as
// unnecessary under TypeScript 6.0 (removing them breaks `tsc`).
// Re-enable once typescript-eslint >= 8.63 (official TS 6.0 support) is in.
"@typescript-eslint/no-unnecessary-type-assertion": "off",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add more disable lines? Then they will be flagged for removal when the linter is upgraded and agrees with tsc.

This just completely removes the linting entirely, for true as well as false positives.

Comment on lines +23 to +30
/**
* TypeScript 6.0 no longer contributes globals from every `node_modules/@types`
* package automatically. Most workspaces extending this config rely on Node.js
* globals (`process`, `Buffer`, `URL`, `import.meta.url`, ...), so include them
* explicitly. Workspaces needing further ambient globals (e.g. `chrome`,
* `google.maps`) add them in their own `types` array (which must repeat "node").
*/
"types": ["node"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not set any default here. A mix of browser and Node packages extend this. This change has blanket added Node APIs to everything. What's wrong with just adding 'node' to the ones that need it?

Comment on lines -50 to +63
},
"outDir": "./dist"
},
"ts-node": {
"transpileOnly": true
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have these gone?

Comment thread package.json Outdated
"qs": "6.15.2",
"react": "19.2.6",
"react-dom": "19.2.6",
"typescript-eslint@npm:^8.46.4": "8.62.1",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just run yarn up -R typescript-eslint? We shouldn't need to put a valid version for the range in resolutions, we can just put it in yarn.lock directly.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$27.3 \mathrm{ms} \pm 223 \mathrm{μs}\left({\color{gray}-1.559 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.53 \mathrm{ms} \pm 22.8 \mathrm{μs}\left({\color{gray}-0.051 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$12.2 \mathrm{ms} \pm 104 \mathrm{μs}\left({\color{gray}-0.328 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$42.8 \mathrm{ms} \pm 421 \mathrm{μs}\left({\color{gray}0.794 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.7 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{gray}0.127 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$23.8 \mathrm{ms} \pm 268 \mathrm{μs}\left({\color{gray}1.83 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.3 \mathrm{ms} \pm 214 \mathrm{μs}\left({\color{gray}0.032 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.91 \mathrm{ms} \pm 33.6 \mathrm{μs}\left({\color{gray}2.10 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.3 \mathrm{ms} \pm 132 \mathrm{μs}\left({\color{gray}1.01 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.83 \mathrm{ms} \pm 23.9 \mathrm{μs}\left({\color{gray}0.312 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.01 \mathrm{ms} \pm 18.4 \mathrm{μs}\left({\color{gray}0.636 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.38 \mathrm{ms} \pm 17.2 \mathrm{μs}\left({\color{gray}0.425 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.17 \mathrm{ms} \pm 30.2 \mathrm{μs}\left({\color{gray}-0.390 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.57 \mathrm{ms} \pm 24.1 \mathrm{μs}\left({\color{gray}2.18 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.13 \mathrm{ms} \pm 25.5 \mathrm{μs}\left({\color{gray}-0.402 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.39 \mathrm{ms} \pm 22.5 \mathrm{μs}\left({\color{gray}-1.541 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.47 \mathrm{ms} \pm 23.4 \mathrm{μs}\left({\color{gray}0.624 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.12 \mathrm{ms} \pm 23.5 \mathrm{μs}\left({\color{gray}0.801 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.66 \mathrm{ms} \pm 19.9 \mathrm{μs}\left({\color{gray}-0.272 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.55 \mathrm{ms} \pm 14.2 \mathrm{μs}\left({\color{gray}1.71 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.59 \mathrm{ms} \pm 15.9 \mathrm{μs}\left({\color{gray}-2.434 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.89 \mathrm{ms} \pm 19.8 \mathrm{μs}\left({\color{gray}-1.691 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.73 \mathrm{ms} \pm 20.2 \mathrm{μs}\left({\color{gray}0.071 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.88 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}-1.169 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.06 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-0.027 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.79 \mathrm{ms} \pm 17.5 \mathrm{μs}\left({\color{gray}2.03 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$2.95 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}0.503 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.48 \mathrm{ms} \pm 20.9 \mathrm{μs}\left({\color{gray}1.31 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.99 \mathrm{ms} \pm 17.7 \mathrm{μs}\left({\color{gray}0.958 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.25 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}0.674 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.44 \mathrm{ms} \pm 21.2 \mathrm{μs}\left({\color{gray}2.00 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.97 \mathrm{ms} \pm 17.0 \mathrm{μs}\left({\color{gray}0.374 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.34 \mathrm{ms} \pm 27.0 \mathrm{μs}\left({\color{gray}1.70 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$41.7 \mathrm{ms} \pm 293 \mathrm{μs}\left({\color{gray}1.66 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$32.1 \mathrm{ms} \pm 181 \mathrm{μs}\left({\color{gray}-1.266 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$35.0 \mathrm{ms} \pm 207 \mathrm{μs}\left({\color{gray}0.883 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$33.2 \mathrm{ms} \pm 714 \mathrm{μs}\left({\color{lightgreen}-30.924 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$41.0 \mathrm{ms} \pm 265 \mathrm{μs}\left({\color{gray}2.00 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$48.8 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}0.796 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$39.6 \mathrm{ms} \pm 238 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$92.0 \mathrm{ms} \pm 627 \mathrm{μs}\left({\color{gray}0.686 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$44.4 \mathrm{ms} \pm 3.77 \mathrm{ms}\left({\color{red}33.5 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$261 \mathrm{ms} \pm 975 \mathrm{μs}\left({\color{lightgreen}-13.835 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.6 \mathrm{ms} \pm 71.0 \mathrm{μs}\left({\color{gray}2.58 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$11.1 \mathrm{ms} \pm 92.8 \mathrm{μs}\left({\color{red}5.55 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$11.4 \mathrm{ms} \pm 98.0 \mathrm{μs}\left({\color{red}8.85 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$11.3 \mathrm{ms} \pm 70.6 \mathrm{μs}\left({\color{red}9.22 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$12.4 \mathrm{ms} \pm 122 \mathrm{μs}\left({\color{red}18.2 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$11.5 \mathrm{ms} \pm 93.8 \mathrm{μs}\left({\color{red}9.08 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$11.0 \mathrm{ms} \pm 67.7 \mathrm{μs}\left({\color{gray}3.89 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$12.8 \mathrm{ms} \pm 103 \mathrm{μs}\left({\color{red}21.2 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$12.6 \mathrm{ms} \pm 116 \mathrm{μs}\left({\color{red}20.0 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$12.9 \mathrm{ms} \pm 158 \mathrm{μs}\left({\color{red}18.3 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$11.2 \mathrm{ms} \pm 90.7 \mathrm{μs}\left({\color{gray}4.47 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.1 \mathrm{ms} \pm 58.5 \mathrm{μs}\left({\color{gray}3.61 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.0 \mathrm{ms} \pm 69.6 \mathrm{μs}\left({\color{gray}2.79 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.3 \mathrm{ms} \pm 85.5 \mathrm{μs}\left({\color{gray}2.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.2 \mathrm{ms} \pm 67.1 \mathrm{μs}\left({\color{gray}3.52 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.2 \mathrm{ms} \pm 71.2 \mathrm{μs}\left({\color{gray}3.68 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.4 \mathrm{ms} \pm 114 \mathrm{μs}\left({\color{red}6.81 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.8 \mathrm{ms} \pm 129 \mathrm{μs}\left({\color{red}7.71 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$13.7 \mathrm{ms} \pm 220 \mathrm{μs}\left({\color{red}26.5 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$8.69 \mathrm{ms} \pm 46.4 \mathrm{μs}\left({\color{gray}0.734 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$58.9 \mathrm{ms} \pm 414 \mathrm{μs}\left({\color{red}5.23 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$113 \mathrm{ms} \pm 782 \mathrm{μs}\left({\color{gray}3.48 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$64.3 \mathrm{ms} \pm 436 \mathrm{μs}\left({\color{gray}4.55 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$74.5 \mathrm{ms} \pm 573 \mathrm{μs}\left({\color{red}5.60 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$83.3 \mathrm{ms} \pm 566 \mathrm{μs}\left({\color{gray}4.44 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$90.6 \mathrm{ms} \pm 602 \mathrm{μs}\left({\color{gray}5.00 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$45.9 \mathrm{ms} \pm 297 \mathrm{μs}\left({\color{red}7.84 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$77.8 \mathrm{ms} \pm 466 \mathrm{μs}\left({\color{red}6.97 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$52.7 \mathrm{ms} \pm 418 \mathrm{μs}\left({\color{red}7.06 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$63.4 \mathrm{ms} \pm 378 \mathrm{μs}\left({\color{red}8.63 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$67.7 \mathrm{ms} \pm 485 \mathrm{μs}\left({\color{red}11.1 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$68.0 \mathrm{ms} \pm 436 \mathrm{μs}\left({\color{red}11.2 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$121 \mathrm{ms} \pm 735 \mathrm{μs}\left({\color{gray}-2.818 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$131 \mathrm{ms} \pm 639 \mathrm{μs}\left({\color{gray}-3.706 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$18.6 \mathrm{ms} \pm 144 \mathrm{μs}\left({\color{gray}2.65 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$544 \mathrm{ms} \pm 1.21 \mathrm{ms}\left({\color{gray}-0.362 \mathrm{\%}}\right) $$ Flame Graph

claude added 3 commits July 9, 2026 18:56
The module handlers reference HTMLElement in their public API. Downstream
Node.js workspaces type-check these sources via the shared tsconfig paths
aliases, and under TypeScript 6 no longer pick up the empty HTMLElement
fallback that @types/react used to contribute (TS <= 6 auto-included every
node_modules/@types package; TS 6 only includes packages listed in types).

Declare a minimal empty-interface fallback in the package itself instead of
adding the whole DOM lib to Node workspaces. This fixes the failing
Package (@local/hash-graph-sdk), Package (@local/hash-backend-utils) and
Package (@apps/hash-api) CI jobs, and lets hash-integration-worker drop the
DOM lib it had been given to work around the same error.
…base

Review feedback: the shared legacy base tsconfig is extended by both browser
and Node workspaces, so it should not blanket-add Node globals via a default
types entry. Remove the base-level "types": ["node"] and declare the
ambient @types packages each workspace actually needs in its own tsconfig
(TypeScript 6 only contributes globals from packages listed in types).

Also drop the redundant moduleResolution overrides that duplicated the base
config value in apps/hash-api and apps/hash-frontend.
Review feedback on the TypeScript 6 migration:

- Re-enable @typescript-eslint/no-unnecessary-type-assertion instead of
  turning it off wholesale. Remove the assertions it correctly flags as
  unnecessary under TypeScript 6 (and the imports they alone used), and
  keep the ~30 assertions that are false positives of typescript-eslint
  8.62 (removing them breaks tsc) with per-line eslint-disable comments,
  so --report-unused-disable-directives flags them for cleanup once
  typescript-eslint >= 8.63 (official TS 6.0 support) is in.
- Drop the typescript-eslint resolutions entry in favour of resolving the
  eslint-config-sheriff ^8.46.4 range directly in yarn.lock via
  yarn up -R typescript-eslint. (8.63.0 is 3 days old and still behind the
  npmMinimalAgeGate: 5d, so the lockfile stays on 8.62.1 for now.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests area/tests New or updated tests type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants