Skip to content

FE-1861: Upgrade to Effect 4 - #10011

Open
indietyp wants to merge 3 commits into
bm/fe-1862-upgrade-to-vite-5from
bm/fe-1861-upgrade-to-effect-4
Open

indietyp wants to merge 3 commits into
bm/fe-1862-upgrade-to-vite-5from
bm/fe-1861-upgrade-to-effect-4

Conversation

@indietyp

@indietyp indietyp commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

🌟 Purpose

Upgrade to stable Effect 4.0.0. Straightforward move, allows us to have less dependencies, use the new maintained version that has LTS built-in, required to make #10013 work.

🔍 Changes

  • Synchronous wire codecs return Result instead of Either. Callers use Effect.fromResult when composing those results into effects.
  • Decoder.decode and Encoder.encode accept Schema.Codec with separate decoding and encoding service requirements. Schema failures use Schema.SchemaError, and JSON codecs use Schema.fromJsonString.
  • Transaction.read consumes responses through Stream.fromQueue, and dropping a transaction ends its queue with Queue.end.

@indietyp
indietyp added this pull request to stack #9934 October 12, 2026 19:36
@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps labels Oct 12, 2026
@indietyp
indietyp deployed to pull-request October 12, 2026 19:37 — with GitHub Actions Active
@indietyp
indietyp deployed to pull-request October 12, 2026 19:37 — with GitHub Actions Active
@indietyp indietyp changed the title bm/fe 1861 upgrade to effect 4 FE-1861: Upgrade to Effect 4 Oct 12, 2026
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hash Ready Ready Preview Oct 21, 2026 11:37am UTC
hashdotdesign-tokens Ready Ready Preview Oct 21, 2026 11:37am UTC
petrinaut Ready Ready Preview Oct 21, 2026 11:37am UTC
petrinaut-docs Ready Ready Preview Oct 21, 2026 11:37am UTC

Request Review

@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.93%

1 warning

⚠️ Unable to measure the execution of 6 benchmarks

These benchmarks measured no execution time, so their results are not comparable and count as unchanged. This usually happens when the compiler removes the code under test.

Prevent compiler optimizations

See affected benchmarks

❌ 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] 137.2 ns 166.4 ns -17.53%
❌ bit_matrix/dense/iter_row[200] 174.7 ns 203.9 ns -14.31%

Tip

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


Comparing bm/fe-1861-upgrade-to-effect-4 (d047d06) with bm/fe-1862-upgrade-to-vite-5 (f79dc8d)1

Open in CodSpeed

Footnotes

  1. No successful run was found on bm/fe-1862-upgrade-to-vite-5 (4e0c06b) during the generation of this report, so ca9cf75 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.49102% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.03%. Comparing base (4e0c06b) to head (d047d06).

Files with missing lines Patch % Lines
libs/@local/graph/sdk/typescript/src/harpc.ts 0.00% 10 Missing ⚠️
...al/harpc/client/typescript/src/net/internal/dns.ts 0.00% 9 Missing ⚠️
...pc/client/typescript/src/net/internal/transport.ts 0.00% 8 Missing ⚠️
...ocal/harpc/client/typescript/src/net/Connection.ts 12.50% 7 Missing ⚠️
...t/src/wire-protocol/models/request/RequestFlags.ts 25.00% 6 Missing ⚠️
...l/harpc/client/typescript/src/net/NetworkLogger.ts 25.00% 3 Missing ⚠️
...pt/src/wire-protocol/models/request/RequestBody.ts 78.57% 3 Missing ⚠️
...s/@local/harpc/client/typescript/src/net/Client.ts 33.33% 2 Missing ⚠️
...lient/typescript/src/net/internal/networkLogger.ts 0.00% 2 Missing ⚠️
...client/typescript/src/types/ProcedureDescriptor.ts 33.33% 2 Missing ⚠️
... and 18 more
Additional details and impacted files
@@                       Coverage Diff                        @@
##           bm/fe-1862-upgrade-to-vite-5   #10011      +/-   ##
================================================================
- Coverage                         68.03%   68.03%   -0.01%     
================================================================
  Files                              2006     2006              
  Lines                            206287   206286       -1     
  Branches                           8815     8817       +2     
================================================================
- Hits                             140354   140348       -6     
- Misses                            64258    64262       +4     
- Partials                           1675     1676       +1     
Flag Coverage Δ
apps.hash-ai-worker-ts 7.46% <ø> (ø)
apps.hash-api 15.59% <ø> (ø)
blockprotocol.type-system 41.73% <ø> (ø)
durable-kernel 86.65% <ø> (ø)
error-stack 90.55% <ø> (ø)
harpc-codec 84.61% <ø> (ø)
harpc-net 96.28% <ø> (+0.03%) ⬆️
harpc-tower 67.11% <ø> (ø)
harpc-types 0.00% <ø> (ø)
harpc-wire-protocol 93.85% <ø> (ø)
hash-codec 72.09% <ø> (ø)
hash-config 83.57% <ø> (ø)
hash-graph 21.07% <ø> (ø)
hash-graph-api 39.82% <ø> (ø)
hash-graph-atlas 80.00% <ø> (-0.01%) ⬇️
hash-graph-authentication 96.71% <ø> (ø)
hash-graph-authorization 68.47% <ø> (ø)
hash-graph-embeddings 91.92% <ø> (ø)
hash-graph-postgres-store 31.60% <ø> (ø)
hash-graph-store 50.82% <ø> (ø)
hash-graph-temporal-versioning 50.53% <ø> (ø)
hash-graph-types 0.00% <ø> (ø)
hash-graph-validation 85.37% <ø> (ø)
hash-integrations-definition 95.05% <ø> (ø)
hash-middleware 87.62% <ø> (ø)
hash-secret 99.50% <ø> (ø)
hashql-ast 90.01% <ø> (ø)
hashql-compiletest 28.71% <ø> (ø)
hashql-core 81.41% <ø> (ø)
hashql-diagnostics 72.85% <ø> (ø)
hashql-eval 81.55% <ø> (ø)
hashql-hir 89.10% <ø> (ø)
hashql-mir 87.22% <ø> (ø)
hashql-syntax-jexpr 94.77% <ø> (ø)
local.harpc-client 51.07% <57.96%> (-0.43%) ⬇️
local.hash-backend-utils 6.21% <ø> (ø)
local.hash-graph-sdk 9.79% <0.00%> (ø)
local.hash-isomorphic-utils 32.22% <ø> (ø)
problematic 90.09% <ø> (ø)
railroad-plugin 45.28% <ø> (ø)

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.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$28.1 \mathrm{ms} \pm 326 \mathrm{μs}\left({\color{gray}0.972 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.57 \mathrm{ms} \pm 31.9 \mathrm{μs}\left({\color{gray}1.09 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$12.8 \mathrm{ms} \pm 157 \mathrm{μs}\left({\color{gray}-2.585 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$44.7 \mathrm{ms} \pm 446 \mathrm{μs}\left({\color{gray}1.12 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.8 \mathrm{ms} \pm 206 \mathrm{μs}\left({\color{gray}1.38 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$24.7 \mathrm{ms} \pm 256 \mathrm{μs}\left({\color{gray}-0.013 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$29.3 \mathrm{ms} \pm 289 \mathrm{μs}\left({\color{gray}0.879 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.79 \mathrm{ms} \pm 24.7 \mathrm{μs}\left({\color{gray}-0.571 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.9 \mathrm{ms} \pm 166 \mathrm{μs}\left({\color{gray}-0.427 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.95 \mathrm{ms} \pm 31.2 \mathrm{μs}\left({\color{gray}1.22 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.08 \mathrm{ms} \pm 23.2 \mathrm{μs}\left({\color{gray}-0.242 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.47 \mathrm{ms} \pm 25.9 \mathrm{μs}\left({\color{gray}-0.297 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.36 \mathrm{ms} \pm 41.0 \mathrm{μs}\left({\color{gray}0.160 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.68 \mathrm{ms} \pm 34.2 \mathrm{μs}\left({\color{gray}1.27 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.26 \mathrm{ms} \pm 38.9 \mathrm{μs}\left({\color{gray}-0.653 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.62 \mathrm{ms} \pm 47.1 \mathrm{μs}\left({\color{gray}1.11 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.50 \mathrm{ms} \pm 25.4 \mathrm{μs}\left({\color{gray}-0.446 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.32 \mathrm{ms} \pm 42.7 \mathrm{μs}\left({\color{gray}1.45 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.79 \mathrm{ms} \pm 21.0 \mathrm{μs}\left({\color{gray}0.082 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.74 \mathrm{ms} \pm 22.2 \mathrm{μs}\left({\color{gray}0.065 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.87 \mathrm{ms} \pm 21.8 \mathrm{μs}\left({\color{gray}0.533 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.12 \mathrm{ms} \pm 28.5 \mathrm{μs}\left({\color{gray}-0.175 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.92 \mathrm{ms} \pm 21.8 \mathrm{μs}\left({\color{gray}0.479 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.21 \mathrm{ms} \pm 26.3 \mathrm{μs}\left({\color{gray}-0.291 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.21 \mathrm{ms} \pm 32.9 \mathrm{μs}\left({\color{gray}-0.038 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.85 \mathrm{ms} \pm 22.4 \mathrm{μs}\left({\color{gray}-1.028 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.04 \mathrm{ms} \pm 20.8 \mathrm{μs}\left({\color{gray}-0.710 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.64 \mathrm{ms} \pm 23.4 \mathrm{μs}\left({\color{gray}0.407 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.12 \mathrm{ms} \pm 28.0 \mathrm{μs}\left({\color{gray}-1.282 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.40 \mathrm{ms} \pm 29.5 \mathrm{μs}\left({\color{gray}-0.123 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.55 \mathrm{ms} \pm 30.6 \mathrm{μs}\left({\color{gray}-0.528 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.11 \mathrm{ms} \pm 23.7 \mathrm{μs}\left({\color{gray}0.120 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.48 \mathrm{ms} \pm 29.2 \mathrm{μs}\left({\color{gray}0.885 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$32.4 \mathrm{ms} \pm 262 \mathrm{μs}\left({\color{gray}0.047 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$72.1 \mathrm{ms} \pm 586 \mathrm{μs}\left({\color{gray}0.285 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$36.1 \mathrm{ms} \pm 318 \mathrm{μs}\left({\color{gray}0.130 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$39.8 \mathrm{ms} \pm 307 \mathrm{μs}\left({\color{gray}-1.582 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$44.5 \mathrm{ms} \pm 463 \mathrm{μs}\left({\color{red}5.79 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$34.0 \mathrm{ms} \pm 243 \mathrm{μs}\left({\color{gray}-0.241 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$426 \mathrm{ms} \pm 1.69 \mathrm{ms}\left({\color{gray}-0.624 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$91.9 \mathrm{ms} \pm 724 \mathrm{μs}\left({\color{gray}0.061 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$79.9 \mathrm{ms} \pm 644 \mathrm{μs}\left({\color{gray}-0.214 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$280 \mathrm{ms} \pm 1.13 \mathrm{ms}\left({\color{gray}0.488 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.6 \mathrm{ms} \pm 81.4 \mathrm{μs}\left({\color{gray}0.013 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$10.7 \mathrm{ms} \pm 97.4 \mathrm{μs}\left({\color{gray}-1.006 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$10.9 \mathrm{ms} \pm 99.6 \mathrm{μs}\left({\color{gray}0.189 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$10.7 \mathrm{ms} \pm 81.6 \mathrm{μs}\left({\color{gray}-0.188 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$10.8 \mathrm{ms} \pm 82.4 \mathrm{μs}\left({\color{gray}0.304 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$10.7 \mathrm{ms} \pm 83.5 \mathrm{μs}\left({\color{gray}0.926 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$10.6 \mathrm{ms} \pm 84.4 \mathrm{μs}\left({\color{gray}0.681 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$10.7 \mathrm{ms} \pm 81.1 \mathrm{μs}\left({\color{gray}0.008 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$10.7 \mathrm{ms} \pm 82.1 \mathrm{μs}\left({\color{gray}0.939 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$11.0 \mathrm{ms} \pm 97.4 \mathrm{μs}\left({\color{gray}0.345 \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.1 \mathrm{ms} \pm 79.2 \mathrm{μs}\left({\color{gray}0.682 \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 80.1 \mathrm{μs}\left({\color{gray}0.384 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.3 \mathrm{ms} \pm 99.0 \mathrm{μs}\left({\color{gray}-1.138 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.0 \mathrm{ms} \pm 83.1 \mathrm{μs}\left({\color{gray}-0.913 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.1 \mathrm{ms} \pm 73.2 \mathrm{μs}\left({\color{gray}-1.158 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.1 \mathrm{ms} \pm 71.1 \mathrm{μs}\left({\color{gray}0.532 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.1 \mathrm{ms} \pm 85.2 \mathrm{μs}\left({\color{gray}-0.357 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.1 \mathrm{ms} \pm 82.0 \mathrm{μs}\left({\color{gray}0.014 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.1 \mathrm{ms} \pm 90.7 \mathrm{μs}\left({\color{gray}-0.207 \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.27 \mathrm{ms} \pm 57.5 \mathrm{μs}\left({\color{gray}0.598 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$56.3 \mathrm{ms} \pm 555 \mathrm{μs}\left({\color{gray}-1.253 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$109 \mathrm{ms} \pm 715 \mathrm{μs}\left({\color{gray}-1.546 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$62.7 \mathrm{ms} \pm 564 \mathrm{μs}\left({\color{gray}-1.080 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$71.0 \mathrm{ms} \pm 474 \mathrm{μs}\left({\color{gray}-2.573 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$80.3 \mathrm{ms} \pm 718 \mathrm{μs}\left({\color{gray}-1.691 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$87.1 \mathrm{ms} \pm 818 \mathrm{μs}\left({\color{gray}-0.988 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$45.9 \mathrm{ms} \pm 371 \mathrm{μs}\left({\color{gray}-2.337 \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 $$73.9 \mathrm{ms} \pm 559 \mathrm{μs}\left({\color{gray}-2.296 \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.1 \mathrm{ms} \pm 435 \mathrm{μs}\left({\color{gray}-1.481 \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 $$60.7 \mathrm{ms} \pm 476 \mathrm{μs}\left({\color{gray}-0.921 \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 $$62.9 \mathrm{ms} \pm 500 \mathrm{μs}\left({\color{gray}-1.790 \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 $$63.1 \mathrm{ms} \pm 501 \mathrm{μs}\left({\color{gray}-1.929 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$123 \mathrm{ms} \pm 926 \mathrm{μs}\left({\color{gray}3.92 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$134 \mathrm{ms} \pm 796 \mathrm{μs}\left({\color{red}5.73 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$24.0 \mathrm{ms} \pm 244 \mathrm{μs}\left({\color{gray}4.18 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$516 \mathrm{ms} \pm 1.82 \mathrm{ms}\left({\color{gray}1.50 \mathrm{\%}}\right) $$ Flame Graph

@indietyp
indietyp force-pushed the bm/fe-1861-upgrade-to-effect-4 branch from 910e379 to 4dd74b8 Compare October 19, 2026 12:58
@indietyp
indietyp force-pushed the bm/fe-1861-upgrade-to-effect-4 branch from 4dd74b8 to e405447 Compare October 19, 2026 14:02
@indietyp
indietyp force-pushed the bm/fe-1861-upgrade-to-effect-4 branch from e405447 to e0fd993 Compare October 19, 2026 14:36
@indietyp
indietyp marked this pull request as ready for review October 19, 2026 15:09
@indietyp
indietyp requested a review from a team as a code owner October 19, 2026 15:09
@cursor

cursor Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Large-scale migration of RPC/networking wire codecs, streams, and schema decoding on a major Effect release; regressions could affect binary protocol compatibility or runtime behavior despite extensive test updates.

Overview
Upgrades the monorepo from Effect 3.21 to Effect 4.0.3, including hash-api, @local/eslint, @local/hash-graph-sdk, and @local/harpc-client. The custom Yarn patch for @effect/vitest is removed in favor of @effect/vitest / @effect/platform-node 4.0.3.

The harpc client and graph SDK are updated to Effect 4 APIs: synchronous wire/binary codecs return Result (composed via Effect.fromResult), Either/Chunk-style patterns are replaced with Result, arrays, and Stream.flattenIterable, and Schema moves to Codec, fromJsonString / encodeEffect / decodeEffect, and Schema.SchemaError. Services use Context.Service instead of GenericTag, layers use Layer.effect, queues use Queue.end and typed shutdown causes, and property tests use Arbitrary instead of FastCheck.

hash-api RPC wiring switches to Logger.layer and References.MinimumLogLevel, and invalid echo input uses Cause.IllegalArgumentError. Tests and wire-protocol helpers adopt NodeServices, ChildProcessSpawner, and updated decode/encode expectations for JSON schema errors.

Reviewed by Cursor Bugbot for commit 7eaa3b6. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e0fd993. Configure here.


// TODO: we might want to observe the task, for that we would need to have a partial connection that we then patch
yield* Effect.fork(task(self));
yield* Effect.forkChild(task(self));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Forked connection fibers die immediately

High Severity

Effect.fork was renamed to Effect.forkChild, but Effect 4 child fibers are interrupted when the parent succeeds. makeUnchecked and send return right after forking, so the response reader and request writer are cancelled immediately and RPC traffic never completes.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e0fd993. Configure here.

@lunelson lunelson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure why this pinged Design System, it doesn't seem to overlap?

@lunelson lunelson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took a run at an agent review on this one, and came up with a handful of comments that may or may not be of value to you. They are posted as me but they are Claude. Main thing seems to be the "lag-drop question".

It also noted one follow-up outside this diff: the shared Renovate config (hashintel/actions) excludes @effect/vitest from the effect group. Now that @effect/vitest@4 requires effect ^4.0.3, they need to update together, so you could remove the !/@effect/vitest/ exclusion.


MutableHashMap.remove(connection.transactions, id);
yield* transaction.value.queue.shutdown;
yield* Queue.end(transaction.value.queue);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When a transaction lags and gets dropped, the reader now gets a cut-off response with no error. The lag timeout (the catchTag("TimeoutError") above) calls drop, which ends the queue normally. Response.decode then treats a body with no end-of-response packet as complete. Before this PR the single-packet read (see the Transaction.ts comment) hid this. Now it can actually happen.

Suggestion: since v4 queues carry a typed error, fail the queue on the lag path (e.g. Queue.fail(queue, new TransactionLaggedError(...))) and keep Queue.end for a normal end of response. If it's out of scope here, a follow-up ticket works too.

Comment thread libs/@local/harpc/client/typescript/src/net/Transaction.ts
// cast needed as fast-check doesn't support Uint8Array<ArrayBuffer> yet
.map((array) => array as Uint8Array<ArrayBuffer>)
.map(makeUnchecked);
export const arbitrary = Arbitrary.array(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These test-data generators now use effect/Arbitrary, which is marked @stability unstable. They're also built when the module is imported: the docs say derivation "is immediate and throws" when it can't compile. These modules are on hash-api's import path, so an effect minor release could break hash-api at startup. Before, they were lazy (fc) => … functions. Could we make them thunks again, or move them into tests/? The same applies to every arbitrary in types/ and wire-protocol/models/.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why? This is the exact same thing that already exists in e.g. zod, Effect.Schema, etc. We pin our dependencies, so minor changes will not silently take effect, and the arbitrary derivation - much like w/ schemas are core to the actual types defined. (also note that Arbitrary itself has been stable for quite a while, so I don't see much of a risk)

Comment thread libs/@local/harpc/client/typescript/tests/codec/JsonDecoder.test.ts

This branch was successfully deployed

5 active (1 outdated) deployments
Preview – hash — d047d066 Deployed Oct 21, 2026 by vercel[bot]
Preview – petrinaut — d047d066 Deployed Oct 21, 2026 by vercel[bot]
Preview – petrinaut-docs — d047d066 Deployed Oct 21, 2026 by vercel[bot]
Preview – hashdotdesign-tokens — d047d066 Deployed Oct 21, 2026 by vercel[bot]
pull-request — 32076ced Deployed Oct 19, 2026 by indietyp via Sourcemaps (@apps/hash-ai-worker-ts) #40445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants