Skip to content

BE-764: Model the public actor as an anonymous caller instead of the nil UUID - #9259

Open
TimDiekmann wants to merge 3 commits into
t/be-770-use-the-kratos-user-id-lookup-on-the-admin-delete-user-pathfrom
t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid
Open

BE-764: Model the public actor as an anonymous caller instead of the nil UUID#9259
TimDiekmann wants to merge 3 commits into
t/be-770-use-the-kratos-user-id-lookup-on-the-admin-delete-user-pathfrom
t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid

Conversation

@TimDiekmann

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

Requests without credentials now resolve to an anonymous caller instead of impersonating the nil UUID. Whether a route serves anonymous callers is expressed in the types: authentication chains resolve to ActorId (actor required) or Option<ActorId> (anonymous allowed), and the stores take Option<ActorId> only on the read paths that serve public data.

🔗 Related links

🚫 Blocked by

🔍 What does this change?

  • AuthenticationProvider is generic over a sealed Caller (ActorId or Option<ActorId>); a chain without a recognized credential resolves through Caller::anonymous(), so the REST chain serves anonymous callers while the admin chain rejects them
  • ServiceDelegationProvider treats the service secret as the credential: the delegated actor is resolved against the principal store, the nil UUID reads as "acting for nobody", and a verified secret without a delegated actor fails as the new MissingDelegatedActor
  • An actor-ID header without the secret no longer yields 401 — the request resolves as anonymous, since the header alone was never a credential
  • Admin router split: /entities/delete and /users/delete authenticate through the chain and require an actor, while the unsafe-dev-endpoints group is gated by the service secret alone
  • Store boundary: reads that serve public data take Option<ActorId>; everything else (writes, search, validate/diff/cluster, policy CRUD) requires an actor
  • Benches, seeds, the AI worker, and tests act as the system machine — fetched through the secret-gated bootstrap route — instead of the nil UUID
  • Removes the unused isEntityPublic GraphQL field, resolver, and query

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies a Cargo-publishable library, but it is not yet ready to publish

📜 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

  • authentication_middleware takes the service secret only for the bootstrap routes, so the parameter is unused on the admin chain. Kept for a uniform middleware signature — splitting it buys nothing until the bootstrap routes move onto the admin API (BE-771).

🐾 Next steps

  • BE-771: move the bootstrap routes onto the admin API

🛡 What tests cover this?

  • Unit tests on the Caller/provider chain, the delegation flow, and the middleware (bootstrap admission, secret gate, extractor behaviour)
  • Postgres integration tests for public-actor reads (permit/deny pair, empty permission maps in subgraphs)
  • The httpyac suite pins the delegation rejection paths and an anonymous entity query end to end

❓ How to test this?

  1. cargo nextest run --package hash-graph-authentication --package hash-graph-api --all-features
  2. From tests/graph/http/: yarn reset-database -o none && yarn httpyac send --all tests/service-delegation.http -o none

@TimDiekmann TimDiekmann self-assigned this Aug 20, 2026
@vercel

vercel Bot commented Aug 20, 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 Aug 24, 2026 6:03pm
petrinaut Ready Ready Preview Aug 24, 2026 6:03pm
petrinaut-docs Ready Ready Preview Aug 24, 2026 6:03pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 24, 2026 6:03pm

@github-actions github-actions Bot added 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 > 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 labels Aug 20, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 18 untouched benchmarks
⏩ 80 skipped benchmarks1


Comparing t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid (b187c25) with main (f8d59a0)2

Open in CodSpeed

Footnotes

  1. 80 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on t/be-770-use-the-kratos-user-id-lookup-on-the-admin-delete-user-path (6dd73ab) during the generation of this report, so main (f8d59a0) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 21, 2026 08:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 21, 2026 08:47 Inactive
@TimDiekmann
TimDiekmann marked this pull request as ready for review August 21, 2026 09:04
Copilot AI balanced review requested due to automatic review settings August 21, 2026 09:04
@cursor

cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

PR Summary

Overview
Unable to generate summary.

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

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@TimDiekmann
TimDiekmann force-pushed the t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid branch from 346feb8 to cd9e9b1 Compare August 21, 2026 09:13
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 21, 2026 09:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 21, 2026 09:13 Inactive
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.41162% with 296 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.34%. Comparing base (6dd73ab) to head (b187c25).

Files with missing lines Patch % Lines
...cal/graph/postgres-store/src/store/postgres/mod.rs 0.00% 68 Missing ⚠️
libs/@local/graph/api/src/rest/admin.rs 0.00% 27 Missing ⚠️
...s-store/src/store/postgres/knowledge/entity/mod.rs 0.00% 20 Missing ⚠️
libs/@local/graph/api/src/rest/mod.rs 0.00% 14 Missing ⚠️
libs/@local/graph/api/src/rpc/account.rs 0.00% 14 Missing ⚠️
libs/@local/graph/authentication/src/provider.rs 69.76% 11 Missing and 2 partials ⚠️
...s-store/src/store/postgres/ontology/entity_type.rs 0.00% 12 Missing ⚠️
libs/@local/graph/store/src/filter/mod.rs 0.00% 12 Missing ⚠️
...res-store/src/store/postgres/ontology/data_type.rs 0.00% 10 Missing ⚠️
libs/@local/graph/api/src/rest/data_type.rs 0.00% 9 Missing ⚠️
... and 29 more
Additional details and impacted files
@@                                           Coverage Diff                                            @@
##           t/be-770-use-the-kratos-user-id-lookup-on-the-admin-delete-user-path    #9259      +/-   ##
========================================================================================================
+ Coverage                                                                 60.27%   60.34%   +0.07%     
========================================================================================================
  Files                                                                      1430     1430              
  Lines                                                                    140642   140960     +318     
  Branches                                                                   6612     6614       +2     
========================================================================================================
+ Hits                                                                      84770    85062     +292     
- Misses                                                                    54794    54819      +25     
- Partials                                                                   1078     1079       +1     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <0.00%> (-0.01%) ⬇️
apps.hash-api 14.68% <0.00%> (+0.01%) ⬆️
blockprotocol.type-system 40.84% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.hash-graph-api 16.94% <71.47%> (+2.98%) ⬆️
rust.hash-graph-authentication 96.09% <92.78%> (-0.36%) ⬇️
rust.hash-graph-authorization 63.02% <0.00%> (+0.43%) ⬆️
rust.hash-graph-embeddings 91.88% <ø> (ø)
rust.hash-graph-postgres-store 29.37% <0.00%> (-0.02%) ⬇️
rust.hash-graph-store 46.76% <0.00%> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 84.71% <ø> (ø)
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-eval 79.82% <ø> (ø)

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.

@TimDiekmann
TimDiekmann force-pushed the t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid branch from 3548ee9 to c5111df Compare August 21, 2026 14:08
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 21, 2026 14:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 21, 2026 14:09 Inactive
@TimDiekmann
TimDiekmann force-pushed the t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid branch from c5111df to e90a514 Compare August 21, 2026 14:25
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 21, 2026 14:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 21, 2026 14:25 Inactive
@TimDiekmann
TimDiekmann force-pushed the t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid branch from e90a514 to f9c06df Compare August 21, 2026 15:05
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 21, 2026 15:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 21, 2026 15:05 Inactive
@TimDiekmann
TimDiekmann force-pushed the t/be-764-model-the-public-actor-as-an-actor-not-as-the-nil-uuid branch from f9c06df to 44aeab3 Compare August 21, 2026 15:09
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 21, 2026 15:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 21, 2026 15:09 Inactive
@github-actions

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 $$20.9 \mathrm{ms} \pm 154 \mathrm{μs}\left({\color{gray}0.772 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.69 \mathrm{ms} \pm 17.4 \mathrm{μs}\left({\color{gray}0.900 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$11.2 \mathrm{ms} \pm 64.4 \mathrm{μs}\left({\color{red}7.90 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$36.0 \mathrm{ms} \pm 350 \mathrm{μs}\left({\color{gray}0.818 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$12.4 \mathrm{ms} \pm 123 \mathrm{μs}\left({\color{gray}3.86 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$20.7 \mathrm{ms} \pm 191 \mathrm{μs}\left({\color{gray}0.388 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$22.2 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{gray}-1.080 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.95 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}1.39 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$12.0 \mathrm{ms} \pm 106 \mathrm{μs}\left({\color{gray}-4.238 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.16 \mathrm{ms} \pm 24.8 \mathrm{μs}\left({\color{red}6.97 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.39 \mathrm{ms} \pm 23.3 \mathrm{μs}\left({\color{gray}-2.201 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$2.71 \mathrm{ms} \pm 18.2 \mathrm{μs}\left({\color{gray}-1.280 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.28 \mathrm{ms} \pm 29.7 \mathrm{μs}\left({\color{gray}4.80 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.83 \mathrm{ms} \pm 16.2 \mathrm{μs}\left({\color{gray}0.209 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$3.33 \mathrm{ms} \pm 22.8 \mathrm{μs}\left({\color{gray}0.943 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.50 \mathrm{ms} \pm 28.2 \mathrm{μs}\left({\color{gray}2.36 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.86 \mathrm{ms} \pm 17.0 \mathrm{μs}\left({\color{gray}4.78 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.26 \mathrm{ms} \pm 21.3 \mathrm{μs}\left({\color{gray}2.54 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.15 \mathrm{ms} \pm 12.3 \mathrm{μs}\left({\color{gray}2.68 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.00 \mathrm{ms} \pm 13.4 \mathrm{μs}\left({\color{gray}0.885 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.11 \mathrm{ms} \pm 10.4 \mathrm{μs}\left({\color{gray}0.895 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.33 \mathrm{ms} \pm 12.8 \mathrm{μs}\left({\color{gray}0.279 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.17 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}0.544 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.31 \mathrm{ms} \pm 12.7 \mathrm{μs}\left({\color{gray}0.472 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.50 \mathrm{ms} \pm 18.5 \mathrm{μs}\left({\color{gray}3.16 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.27 \mathrm{ms} \pm 17.6 \mathrm{μs}\left({\color{gray}4.97 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$2.47 \mathrm{ms} \pm 16.6 \mathrm{μs}\left({\color{gray}4.30 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.73 \mathrm{ms} \pm 20.7 \mathrm{μs}\left({\color{gray}0.524 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.43 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}4.33 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$2.56 \mathrm{ms} \pm 12.2 \mathrm{μs}\left({\color{gray}-3.120 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.70 \mathrm{ms} \pm 21.7 \mathrm{μs}\left({\color{gray}2.96 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.41 \mathrm{ms} \pm 15.5 \mathrm{μs}\left({\color{gray}2.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.58 \mathrm{ms} \pm 21.8 \mathrm{μs}\left({\color{gray}-0.697 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$34.3 \mathrm{ms} \pm 195 \mathrm{μs}\left({\color{gray}2.27 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$28.0 \mathrm{ms} \pm 175 \mathrm{μs}\left({\color{gray}3.63 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$30.6 \mathrm{ms} \pm 184 \mathrm{μs}\left({\color{red}5.48 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$26.6 \mathrm{ms} \pm 169 \mathrm{μs}\left({\color{gray}2.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$35.3 \mathrm{ms} \pm 169 \mathrm{μs}\left({\color{gray}1.72 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$39.6 \mathrm{ms} \pm 237 \mathrm{μs}\left({\color{gray}2.19 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$33.1 \mathrm{ms} \pm 249 \mathrm{μs}\left({\color{gray}1.72 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$74.3 \mathrm{ms} \pm 583 \mathrm{μs}\left({\color{gray}1.90 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$27.8 \mathrm{ms} \pm 251 \mathrm{μs}\left({\color{gray}-0.864 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$225 \mathrm{ms} \pm 892 \mathrm{μs}\left({\color{gray}-1.175 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$8.79 \mathrm{ms} \pm 48.8 \mathrm{μs}\left({\color{gray}2.17 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$8.79 \mathrm{ms} \pm 53.0 \mathrm{μs}\left({\color{gray}-1.661 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$8.67 \mathrm{ms} \pm 71.7 \mathrm{μs}\left({\color{gray}-3.311 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$8.46 \mathrm{ms} \pm 49.9 \mathrm{μs}\left({\color{gray}-4.913 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$8.70 \mathrm{ms} \pm 61.3 \mathrm{μs}\left({\color{gray}-0.504 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$8.73 \mathrm{ms} \pm 64.8 \mathrm{μs}\left({\color{gray}-0.156 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$8.58 \mathrm{ms} \pm 65.1 \mathrm{μs}\left({\color{gray}-2.780 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$8.49 \mathrm{ms} \pm 63.0 \mathrm{μs}\left({\color{lightgreen}-5.128 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$8.46 \mathrm{ms} \pm 51.8 \mathrm{μs}\left({\color{lightgreen}-6.461 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$8.91 \mathrm{ms} \pm 61.8 \mathrm{μs}\left({\color{lightgreen}-5.964 \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 $$9.02 \mathrm{ms} \pm 57.7 \mathrm{μs}\left({\color{gray}-3.265 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$8.88 \mathrm{ms} \pm 51.0 \mathrm{μs}\left({\color{lightgreen}-5.631 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$8.76 \mathrm{ms} \pm 55.1 \mathrm{μs}\left({\color{gray}-3.234 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$8.75 \mathrm{ms} \pm 46.0 \mathrm{μs}\left({\color{lightgreen}-7.120 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$9.19 \mathrm{ms} \pm 67.1 \mathrm{μs}\left({\color{gray}-1.152 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$8.88 \mathrm{ms} \pm 59.2 \mathrm{μs}\left({\color{lightgreen}-6.574 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$9.19 \mathrm{ms} \pm 49.0 \mathrm{μs}\left({\color{gray}-0.444 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$8.92 \mathrm{ms} \pm 50.1 \mathrm{μs}\left({\color{gray}-1.717 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$8.70 \mathrm{ms} \pm 44.9 \mathrm{μs}\left({\color{lightgreen}-6.483 \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 $$6.30 \mathrm{ms} \pm 43.3 \mathrm{μs}\left({\color{lightgreen}-5.782 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$52.0 \mathrm{ms} \pm 576 \mathrm{μs}\left({\color{red}5.27 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$92.8 \mathrm{ms} \pm 520 \mathrm{μs}\left({\color{gray}2.34 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$57.4 \mathrm{ms} \pm 226 \mathrm{μs}\left({\color{gray}3.29 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$65.3 \mathrm{ms} \pm 459 \mathrm{μs}\left({\color{gray}3.13 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$73.0 \mathrm{ms} \pm 535 \mathrm{μs}\left({\color{gray}2.91 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$77.0 \mathrm{ms} \pm 573 \mathrm{μs}\left({\color{gray}3.06 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$37.4 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}1.10 \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 $$59.1 \mathrm{ms} \pm 274 \mathrm{μs}\left({\color{gray}-1.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 $$42.1 \mathrm{ms} \pm 232 \mathrm{μs}\left({\color{gray}-1.567 \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 $$49.4 \mathrm{ms} \pm 306 \mathrm{μs}\left({\color{gray}-1.292 \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 $$51.5 \mathrm{ms} \pm 328 \mathrm{μs}\left({\color{gray}-0.483 \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 $$52.3 \mathrm{ms} \pm 461 \mathrm{μs}\left({\color{gray}1.64 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$98.7 \mathrm{ms} \pm 474 \mathrm{μs}\left({\color{gray}2.78 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$106 \mathrm{ms} \pm 366 \mathrm{μs}\left({\color{gray}0.664 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$18.2 \mathrm{ms} \pm 268 \mathrm{μs}\left({\color{red}20.8 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$428 \mathrm{ms} \pm 781 \mathrm{μs}\left({\color{gray}1.46 \mathrm{\%}}\right) $$ Flame Graph

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/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.

2 participants