Skip to content

BE-918: Derive deterministic entity IDs in the integrations engine - #10071

Draft
montekki wants to merge 1 commit into
asa/hash-integrations/04c-engine-parametersfrom
fs/be-918-derive-deterministic-entity-ids-in-the-integrations-engine
Draft

montekki wants to merge 1 commit into
asa/hash-integrations/04c-engine-parametersfrom
fs/be-918-derive-deterministic-entity-ids-in-the-integrations-engine

Conversation

@montekki

@montekki montekki commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Integration reruns need stable entity IDs to update the same source records. Add derive_entity_id to the engine, deriving a live EntityId with UUID v5 from the integration namespace, versioned entity type URL, and source ID text.

The function preserves the prototype's fixed UUID namespace and namespace::entity_type::source_id input format. Callers supply the source ID as text. Eight recorded vectors cover the hash inputs, Unicode, separators, composite source IDs, and the full entity ID.

Validation: all 31 engine tests passed. Clippy passed for all features and targets with warnings denied. Rustdoc, Rust formatting, Oxfmt, and whitespace checks passed.

Stacked on the workspace parameter-binding PR.

Related: BE-918 (internal).

@montekki
montekki added this pull request to stack #9985 October 16, 2026 17:00
@github-actions github-actions Bot added 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) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps > hash-integrations labels Oct 16, 2026
@vercel

vercel Bot commented Oct 16, 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 19, 2026 12:50pm UTC
petrinaut Ready Ready Preview Oct 19, 2026 12:50pm UTC
petrinaut-docs Ready Ready Preview Oct 19, 2026 12:50pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Oct 19, 2026 12:50pm UTC

Request Review

@codspeed

codspeed Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 10.38%

⚠️ 6 benchmarks measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. These results are not comparable, so they count as unchanged.

Preventing compiler optimizations

⚠️ 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

⚡ 1 improved benchmark
✅ 97 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ repeated[1000] 2.4 ms 2.2 ms +10.38%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fs/be-918-derive-deterministic-entity-ids-in-the-integrations-engine (cf28f73) with asa/hash-integrations/04c-engine-parameters (4562bd9)

Open in CodSpeed

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.31%. Comparing base (4562bd9) to head (cf28f73).

Additional details and impacted files
@@                             Coverage Diff                              @@
##           asa/hash-integrations/04c-engine-parameters   #10071   +/-   ##
============================================================================
  Coverage                                        68.31%   68.31%           
============================================================================
  Files                                             2004     2005    +1     
  Lines                                           205917   205930   +13     
  Branches                                          8746     8746           
============================================================================
+ Hits                                            140669   140684   +15     
+ Misses                                           63565    63564    -1     
+ Partials                                          1683     1682    -1     
Flag Coverage Δ
hash-integrations-engine 91.38% <100.00%> (+0.44%) ⬆️

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.5 \mathrm{ms} \pm 288 \mathrm{μs}\left({\color{gray}0.976 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.52 \mathrm{ms} \pm 28.3 \mathrm{μs}\left({\color{gray}-0.725 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$13.3 \mathrm{ms} \pm 164 \mathrm{μs}\left({\color{gray}0.708 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$45.3 \mathrm{ms} \pm 528 \mathrm{μs}\left({\color{gray}0.059 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.8 \mathrm{ms} \pm 214 \mathrm{μs}\left({\color{gray}-3.366 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$25.3 \mathrm{ms} \pm 276 \mathrm{μs}\left({\color{gray}0.773 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$29.6 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{gray}-0.838 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.82 \mathrm{ms} \pm 28.6 \mathrm{μs}\left({\color{gray}-0.763 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$14.4 \mathrm{ms} \pm 152 \mathrm{μs}\left({\color{gray}0.144 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.94 \mathrm{ms} \pm 39.6 \mathrm{μs}\left({\color{gray}0.705 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.09 \mathrm{ms} \pm 26.0 \mathrm{μs}\left({\color{gray}1.66 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.46 \mathrm{ms} \pm 35.1 \mathrm{μs}\left({\color{gray}0.835 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.39 \mathrm{ms} \pm 57.0 \mathrm{μs}\left({\color{gray}0.473 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.62 \mathrm{ms} \pm 25.9 \mathrm{μs}\left({\color{gray}-0.299 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.28 \mathrm{ms} \pm 40.9 \mathrm{μs}\left({\color{gray}-1.312 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.58 \mathrm{ms} \pm 41.1 \mathrm{μs}\left({\color{gray}0.331 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.49 \mathrm{ms} \pm 35.8 \mathrm{μs}\left({\color{gray}0.101 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.28 \mathrm{ms} \pm 38.4 \mathrm{μs}\left({\color{gray}2.22 \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 27.6 \mathrm{μs}\left({\color{gray}-0.689 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.75 \mathrm{ms} \pm 25.0 \mathrm{μs}\left({\color{gray}0.380 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.89 \mathrm{ms} \pm 28.4 \mathrm{μs}\left({\color{gray}0.856 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.14 \mathrm{ms} \pm 32.1 \mathrm{μs}\left({\color{gray}0.117 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.92 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-0.547 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.31 \mathrm{ms} \pm 44.9 \mathrm{μs}\left({\color{gray}2.04 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.18 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-0.293 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.85 \mathrm{ms} \pm 21.1 \mathrm{μs}\left({\color{gray}-1.392 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.02 \mathrm{ms} \pm 20.3 \mathrm{μs}\left({\color{gray}-0.869 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.60 \mathrm{ms} \pm 25.9 \mathrm{μs}\left({\color{gray}-2.096 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.15 \mathrm{ms} \pm 31.9 \mathrm{μs}\left({\color{gray}-1.367 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.41 \mathrm{ms} \pm 28.2 \mathrm{μs}\left({\color{gray}0.771 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.56 \mathrm{ms} \pm 32.9 \mathrm{μs}\left({\color{gray}-0.431 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.08 \mathrm{ms} \pm 23.4 \mathrm{μs}\left({\color{gray}-3.485 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.48 \mathrm{ms} \pm 39.7 \mathrm{μs}\left({\color{gray}0.689 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$33.1 \mathrm{ms} \pm 259 \mathrm{μs}\left({\color{gray}2.34 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$73.0 \mathrm{ms} \pm 659 \mathrm{μs}\left({\color{gray}0.405 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$36.5 \mathrm{ms} \pm 361 \mathrm{μs}\left({\color{gray}0.824 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$40.3 \mathrm{ms} \pm 384 \mathrm{μs}\left({\color{gray}1.58 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$42.8 \mathrm{ms} \pm 413 \mathrm{μs}\left({\color{gray}1.03 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$34.2 \mathrm{ms} \pm 330 \mathrm{μs}\left({\color{gray}0.082 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$427 \mathrm{ms} \pm 2.30 \mathrm{ms}\left({\color{gray}-0.524 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$93.4 \mathrm{ms} \pm 814 \mathrm{μs}\left({\color{gray}0.448 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$80.8 \mathrm{ms} \pm 711 \mathrm{μs}\left({\color{gray}-0.494 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$309 \mathrm{ms} \pm 1.88 \mathrm{ms}\left({\color{red}9.46 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.7 \mathrm{ms} \pm 146 \mathrm{μs}\left({\color{gray}1.53 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$10.8 \mathrm{ms} \pm 97.9 \mathrm{μs}\left({\color{gray}0.279 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$10.9 \mathrm{ms} \pm 96.0 \mathrm{μs}\left({\color{gray}-0.323 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$10.7 \mathrm{ms} \pm 86.5 \mathrm{μs}\left({\color{gray}-0.048 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$10.9 \mathrm{ms} \pm 81.9 \mathrm{μs}\left({\color{gray}-0.444 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$10.7 \mathrm{ms} \pm 110 \mathrm{μs}\left({\color{gray}0.298 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$10.7 \mathrm{ms} \pm 114 \mathrm{μs}\left({\color{gray}1.49 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$10.7 \mathrm{ms} \pm 99.6 \mathrm{μs}\left({\color{gray}0.932 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$10.9 \mathrm{ms} \pm 110 \mathrm{μs}\left({\color{gray}1.86 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$11.0 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{gray}0.322 \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 107 \mathrm{μs}\left({\color{gray}-0.232 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.3 \mathrm{ms} \pm 125 \mathrm{μs}\left({\color{gray}1.03 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.2 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{gray}-0.251 \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 114 \mathrm{μs}\left({\color{gray}1.42 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.3 \mathrm{ms} \pm 117 \mathrm{μs}\left({\color{gray}0.494 \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 105 \mathrm{μs}\left({\color{gray}-3.110 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.2 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{gray}-0.231 \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 101 \mathrm{μs}\left({\color{gray}-1.855 \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 101 \mathrm{μs}\left({\color{gray}0.164 \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.18 \mathrm{ms} \pm 60.3 \mathrm{μs}\left({\color{gray}0.866 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$57.8 \mathrm{ms} \pm 628 \mathrm{μs}\left({\color{gray}0.446 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$111 \mathrm{ms} \pm 799 \mathrm{μs}\left({\color{gray}-0.138 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$63.9 \mathrm{ms} \pm 828 \mathrm{μs}\left({\color{gray}0.102 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$72.2 \mathrm{ms} \pm 552 \mathrm{μs}\left({\color{gray}0.070 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$81.9 \mathrm{ms} \pm 910 \mathrm{μs}\left({\color{gray}0.162 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$89.3 \mathrm{ms} \pm 719 \mathrm{μs}\left({\color{gray}-0.269 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$46.2 \mathrm{ms} \pm 324 \mathrm{μs}\left({\color{gray}-1.014 \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 $$75.3 \mathrm{ms} \pm 751 \mathrm{μs}\left({\color{gray}0.502 \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 $$53.4 \mathrm{ms} \pm 567 \mathrm{μs}\left({\color{gray}0.629 \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 $$61.7 \mathrm{ms} \pm 773 \mathrm{μs}\left({\color{gray}0.475 \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 $$63.6 \mathrm{ms} \pm 576 \mathrm{μs}\left({\color{gray}-0.477 \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 $$64.0 \mathrm{ms} \pm 713 \mathrm{μs}\left({\color{gray}1.02 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$120 \mathrm{ms} \pm 1.25 \mathrm{ms}\left({\color{gray}0.942 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$130 \mathrm{ms} \pm 1.11 \mathrm{ms}\left({\color{gray}-0.146 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$23.5 \mathrm{ms} \pm 256 \mathrm{μs}\left({\color{gray}-0.772 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$514 \mathrm{ms} \pm 2.70 \mathrm{ms}\left({\color{gray}-1.611 \mathrm{\%}}\right) $$ Flame Graph

This branch was successfully deployed

5 active (2 outdated) deployments
Preview – petrinaut-docs — cf28f738 Deployed Oct 19, 2026 by vercel[bot]
Preview – hash — cf28f738 Deployed Oct 19, 2026 by vercel[bot]
Preview – petrinaut — cf28f738 Deployed Oct 19, 2026 by vercel[bot]
pull-request — f1a8b325 Deployed Oct 19, 2026 by montekki via Sourcemaps (@apps/hash-ai-worker-ts) #40187
Preview – hashdotdesign-tokens — ced33b90 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash-integrations 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 New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant