Skip to content

FE-1406, FE-1431, FE-1504, FE-1506, FE-1505, FE-1431, FE-1507, FE-1521, FE-1522, FE-1524: Consolidate the Brunch harness mission stack - #9463

Merged
lunelson merged 13 commits into
mainfrom
ln/fe-1406-1524-consolidated
Aug 31, 2026
Merged

FE-1406, FE-1431, FE-1504, FE-1506, FE-1505, FE-1431, FE-1507, FE-1521, FE-1522, FE-1524: Consolidate the Brunch harness mission stack#9463
lunelson merged 13 commits into
mainfrom
ln/fe-1406-1524-consolidated

Conversation

@lunelson

@lunelson lunelson commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Land the accepted Brunch work from FE-1406 through FE-1524 through one stable review and merge surface. The ten-PR Graphite stack repeatedly lost approvals when a parent merged and GitHub rebased the remaining branches, so this PR preserves the sequence as ten ordered commits plus three follow-up fix commits on current main without making the consolidation branch part of another Graphite stack.

The final production throughline is the one established by the accepted missions: Petrinaut assistant panel → AI SDK /api/chat → Brunch-hosted plain Flue ChatAgent → model and tools → AI SDK stream → same Flue conversation, followed by an explicit harness-side capture sweep over a settled history range. The proof establishes that this integrated path is durable and that reapplying the range does not duplicate captures. It does not establish Mission 3's runbook/template/headless-PN path, extraction quality, a typed IR, session-as-net, or two brains.

The Brunch context root is libs/@hashintel/brunch-agent/. Its AGENTS.md defines the mission and PR-writing contract used below.

🔗 Related links

🚫 Blocked by

  • No external blocker; required CI and review are in progress.

🔍 What does this change?

  • Preserves each original branch as one ordered commit while moving the complete stack onto current main.
  • Establishes and then freezes the harness-owned plugin authoring surface and repertoire topology documented under the Brunch context root.
  • Carries the Petrinaut panel integration, legible status, and per-purpose timing work through to the later topology.
  • Replaces the active elicitation path with the accepted plain Petrinaut-to-Flue chat door and canonical Flue history.
  • Adds the accepted mechanical capture-sweep pipe and proves idempotent reapplication on that live path.
  • Archives accepted Missions 1 and 2 and cuts Mission 3 as the next execution authority without implementing FE-1525 here.
  • Folds two current-toolchain test/lint corrections into the FE-1522 commit: the emitted-bundle assertion now recognizes Vite's named mount constant, and the history loader retains only the post-JSON cancellation guard.
  • Carries stable transport idempotency keys into both Flue dispatch paths, so repeated initial and client-tool-result POSTs converge on their original submissions.
  • Projects Flue's { awaiting: "client" } sentinel as a pending browser tool until a correlated client-tool-result signal supplies the actual output.
  • Keeps the app and both shipped plugin workspaces in the pruned Brunch-core CI job because its architecture and contract tests inspect all three directly.
  • Enables normal Turbo caching for all six Brunch build tasks; each already declares dist/** outputs, and no evidence-backed non-hermetic reason for the import-era opt-outs remains.
🏗️ Agent notes

Consolidation mission

Imperative: Get the accepted Brunch sequence through CI, review, and merge without another parent-merge rebase dismissing approvals. This is a delivery repair for the existing work, not a new product mission.

Throughline: current main → ten original branch deltas in order → one plain Git branch → one GitHub CI/review/merge surface. At the production boundary carried by those deltas: Petrinaut panel → transport-aisdk → Flue ChatAgent and canonical history → explicit harness apply-sweep → capture store keyed by Flue conversation identity → same range reapplied → same capture identities.

Proof: (1) the branch is based directly on current origin/main; (2) each original branch has one corresponding ordered commit; (3) the affected package tests, type checks, lint, builds, and architecture checks pass; and (4) the final Mission 1/2 throughline tests observe durable chat, tool return, history hydration, skill activation, capture creation, and idempotent reapplication. This proves a mergeable representation and the claims already closed by Missions 1 and 2. It does not prove Mission 3, improve extraction, join capture to an IR, or validate the approval workaround until GitHub actually merges this PR without rewriting it.

Constraints: Preserve semantic order and final content; keep FE-1525 out; keep this branch untracked by Graphite; retain the original PRs as review evidence until acceptance; preserve the topology gates in the Brunch context root; make no new harness mechanism for the sake of consolidation.

Fog-line: GitHub CI and merge behavior are still live evidence. Do not claim the approval-reset problem resolved until this plain branch passes required checks and merges without a history rewrite. Any failure must be discriminated as stack integration, current-main drift, or unrelated CI infrastructure before changing product code.

Stop or reorient: Stop if current main requires a semantic conflict resolution, if a correction changes an accepted mission's product behavior, if FE-1525 enters the branch, or if GitHub/Graphite begins rewriting this plain branch.

Observed proof and fog-line answers

  • The ten branch deltas replayed onto current main without merge conflicts and remain ten commits in their original order, followed by three fix commits rather than a history rewrite.
  • Before review fixes, the final tree differed from the original FE-1524 tip only by current-main changes and the two test/lint corrections named above. The additional commit now pins retry convergence and truthful pending-client-tool projection.
  • All affected unit-test, type-check, and lint tasks pass locally; the Petrinaut build and architecture validation pass.
  • The branch is confirmed untracked by Graphite.
  • GitHub accepted the branch as one PR. Required CI and the eventual merge remain the unresolved part of the delivery proof.

Carried flags

  • The original PRs remain open until this PR is accepted; then they can be closed as superseded.
  • Mission 3 is now the context root's live MISSION.md, but FE-1525 and its implementation are intentionally excluded.
  • This consolidation is a deliberate one-off exception to the context root's normal one-Linear-issue/one-Graphite-branch/one-PR lifecycle, forced by the broken approval/rebase integration. It should not become the ordinary Brunch workflow.

Included stack

Commit Issue Original PR Scope
1 FE-1406 #9327 Establish the harness-teaching plugin contract
2 FE-1431 #9337 Build the plugin authoring surface
3 FE-1504 #9345 Run process-model elicitation from the Petrinaut panel
4 FE-1506 #9346 Show captures and completion during panel elicitation
5 FE-1505 #9347 Time interviewer turns by purpose
6 FE-1431 #9348 Complete and freeze the plugin authoring surface
7 FE-1507 #9349 Move the repertoire into core
8 FE-1521 #9381 Cut the agentic guidance layer to a mission charter
9 FE-1522 #9382 Replace elicitation with a Petrinaut-to-Flue chat
10 FE-1524 #9384 Prove idempotent capture sweep on the live Flue chat path

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

The affected Brunch packages are private 0.0.0-private workspaces.

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

User-facing guidance, ADRs, specifications, evidence, mission archives, and the context-root mission declaration are updated with the behavior they accompany.

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

The changes in this PR:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

⚠️ Known issues

  • Running yarn workspace @apps/brunch-agent test:unit directly does not build workspace dependencies. Build @hashintel/brunch-agent-binding-flue first, or use the root Turbo test:unit task, whose dependency graph builds prerequisites.
  • Required GitHub CI restarted for the build-cache change and is still in progress. No approval should be requested until it is green.
  • History hydration now represents an unfinished browser tool truthfully as input-available, but AI SDK does not invoke onToolCall merely because an initial/hydrated message contains such a part. Full hard-reload execution and resume while readPetrinautDoc is pending remains unproven; this PR does not blanket-replay hydrated client tools because mutating tools would make that unsafe.

🐾 Next steps

  • After this PR is accepted, close the ten original PRs as superseded while retaining them as review history.
  • Continue Mission 3 on FE-1525 separately. Its runbook/template/headless-PN path must not be joined to Mission 2's capture store merely to tidy the architecture.
  • Keep Host trunk, typed Petrinaut read/write, capture improvement, and any capture-to-IR convergence in MISSION.next.md until separately cut and re-earned.

🛡 What tests cover this?

  • apps/brunch-agent/test/petrinaut-chat.test.ts drives the real Mission 1/2 entrypoint and covers the plain Flue chat door, server/client tools, canonical history, mounted skill, no interviewer sweep tool, capture creation, idempotent reapplication, duplicate initial/resume delivery convergence, and pending-client-tool history projection before resume.
  • The Brunch core, binding-flue, transport-aisdk, SDCPN plugin, and Gherkin plugin unit suites cover the retained contract and topology layers.
  • @apps/petrinaut-website unit tests cover principal/conversation identity, panel transport, and Flue-history hydration.
  • apps/brunch-agent/test/flue-transcript.test.ts pins pending and completed browser-tool projection, including a completed null result.
  • The emitted-artifact suite proves that the production bundle retains the agent registration, mounted route, database path, and client bundle.
  • Petrinaut architecture validation checks 45 layers, 206 edges, 465 files, 46 generated pages, and 21 authored pages.
  • .github/actions/prune-repository/prune_test.py pins the requested-scope extras, and a local reproduction of the CI prune followed by turbo run test:unit --env-mode=loose --filter @hashintel/brunch-agent passes all 18 files and 198 tests (197 passed, one skipped).
  • Two identical filtered turbo run build invocations prove the cache change: the first run built all six Brunch tasks with cache misses; the second reported cache hits for all six (6 cached, 7 total, with the unrelated @hashintel/petrinaut-core build still opting out independently).

All test:unit, lint:eslint, and lint:tsc tasks pass for @hashintel/brunch-agent, @hashintel/brunch-agent-binding-flue, @hashintel/brunch-agent-transport-aisdk, @hashintel/brunch-agent-plugin-gherkin, @hashintel/brunch-agent-plugin-sdcpn, @apps/brunch-agent, and @apps/petrinaut-website. @hashintel/petrinaut also builds successfully.

❓ How to test this?

  1. From the HASH root, run yarn install.
  2. Run turbo run test:unit lint:eslint lint:tsc --filter=@hashintel/brunch-agent --filter=@hashintel/brunch-agent-binding-flue --filter=@hashintel/brunch-agent-transport-aisdk --filter=@hashintel/brunch-agent-plugin-gherkin --filter=@hashintel/brunch-agent-plugin-sdcpn --filter=@apps/brunch-agent --filter=@apps/petrinaut-website.
  3. Run yarn workspace @local/petrinaut-arch-docs lint:arch-docs.
  4. Inspect apps/brunch-agent/test/petrinaut-chat.test.ts: the same production door must show activate_skill, one capture envelope per named user entry, and the same capture ids with non-empty skippedDedupKeys on reapplication.
  5. Optional human check: run the Brunch service and Petrinaut demo, send a panel message, reload to hydrate the same Flue conversation, and inspect the sibling <flueInstanceId>.json capture file. The interviewer must not expose a sweep tool.

📹 Demo

No new recording was made for this delivery-only consolidation. The durable proof is the production-path test and the accepted Mission 1 human-run record linked above.

@vercel

vercel Bot commented Aug 31, 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 31, 2026 11:09am
petrinaut Ready Ready Preview Aug 31, 2026 11:09am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 31, 2026 11:09am
petrinaut-docs Skipped Skipped Aug 31, 2026 11:09am

Request Review

@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes authentication and conversation ownership on agent routes plus the primary Petrinaut chat transport, though behavior is heavily covered by integration tests and explicit 401/403 gates.

Overview
This PR lands the accepted Brunch mission stack as one merge surface: the elicitation gallery (Gherkin/SDCPN elicitors, brunch_ask, target-document stores, and related integration tests) is removed in favor of a single plain Flue ChatAgent wired to Petrinaut’s /api/chat door.

Server and identity: Flue instance ids are SHA-256 hashes of x-brunch-principal plus conversation id; agentOwnershipGuard on /agents/chat/:id rejects missing identity (401) and hash mismatches (403). The chat handler now streams Flue chunks through a new AI SDK projector, supports GET history hydration, and resumes client tools via a client-tool-result signal (not elicitation ask/reply). Tools are ping, stub skill confirm-path, and browser-executed readPetrinautDoc (via @hashintel/petrinaut-core). Harness-side applyCaptureSweep writes JSON capture envelopes beside the sqlite DB; integration tests assert idempotent reapplication.

Petrinaut panel: The local-storage demo drops the brunch_ask interactive widget, pins stable principal and per-net conversation ids in localStorage, wraps the transport so useChat’s generated id does not replace the Flue conversation, and hydrates messages from GET /api/chat?id= before falling back to localStorage.

Docs, deps, CI: App dependencies drop direct elicitor plugins/core harness in favor of binding-flue + transport + petrinaut-core; OpenTelemetry is instrumented. .github/actions/prune-repository expands Brunch-core job fixtures (app, both plugins, evaluation paths). Brunch AGENTS.md is rewritten around mission contract (MISSION.md / archive). Large suites tied to the old path (walking skeleton, petrinaut-ask, duplicate transport-aisdk-server tests in the app) are deleted or replaced by expanded petrinaut-chat coverage.

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

@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 > frontend Owned by the @frontend team area/tests New or updated tests area/apps labels Aug 31, 2026
@lunelson
lunelson deployed to pull-request August 31, 2026 10:19 — with GitHub Actions Active
@lunelson
lunelson deployed to pull-request August 31, 2026 10:19 — with GitHub Actions Active

@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 2 potential issues.

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 3704688. Configure here.

Comment thread apps/brunch-agent/src/petrinaut-chat.ts
Comment thread apps/brunch-agent/src/flue-transcript.ts
@lunelson lunelson changed the title FE-1406–FE-1524: Consolidate the Brunch harness mission stack FE-1406, FE-1431, FE-1504, FE-1506, FE-1505, FE-1431, FE-1507, FE-1521, FE-1522, FE-1524: Consolidate the Brunch harness mission stack Aug 31, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 31, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 98 untouched benchmarks


Comparing ln/fe-1406-1524-consolidated (58058c7) with main (aae1779)

Open in CodSpeed

Carry transport idempotency keys into Flue dispatch so repeated initial and client-tool-result POSTs converge on their original submissions. Project an awaiting browser tool as input-available until its correlated client-tool-result signal exists.
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 31, 2026 10:31 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 10:31 Inactive
@lunelson
lunelson deployed to pull-request August 31, 2026 10:32 — with GitHub Actions Active
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.01%. Comparing base (3ebd68c) to head (58058c7).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9463      +/-   ##
==========================================
- Coverage   61.01%   61.01%   -0.01%     
==========================================
  Files        1448     1449       +1     
  Lines      144648   144663      +15     
  Branches     6692     6692              
==========================================
  Hits        88262    88262              
- Misses      55282    55297      +15     
  Partials     1104     1104              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <ø> (ø)
apps.hash-api 14.68% <ø> (ø)
blockprotocol.type-system 38.15% <ø> (-2.69%) ⬇️
local.claude-hooks 0.00% <ø> (ø)
local.harpc-client 51.49% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.antsi 2.36% <ø> (ø)
rust.error-stack 90.81% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.19% <ø> (ø)
rust.harpc-tower 67.03% <ø> (ø)
rust.harpc-types 0.00% <ø> (ø)
rust.harpc-wire-protocol 92.23% <ø> (ø)
rust.hash-codec 72.76% <ø> (ø)
rust.hash-config 74.74% <ø> (ø)
rust.hash-graph-api 19.76% <ø> (ø)
rust.hash-graph-authentication 97.00% <ø> (ø)
rust.hash-graph-authorization 63.14% <ø> (ø)
rust.hash-graph-embeddings 91.88% <ø> (ø)
rust.hash-graph-postgres-store 32.02% <ø> (ø)
rust.hash-graph-store 48.41% <ø> (ø)
rust.hash-graph-temporal-versioning 50.18% <ø> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 84.71% <ø> (ø)
rust.hash-middleware 92.19% <ø> (ø)
rust.hashql-ast 89.63% <ø> (ø)
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-core 78.95% <ø> (ø)
rust.hashql-diagnostics 72.51% <ø> (ø)
rust.hashql-eval 79.82% <ø> (ø)
rust.hashql-hir 89.09% <ø> (ø)
rust.hashql-mir 87.92% <ø> (ø)
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.

Remove the cache opt-outs introduced during the monorepo import. All six builds declare dist outputs and hit the local Turbo cache on an unchanged second run.
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 10:51 Inactive
@lunelson

Copy link
Copy Markdown
Contributor Author

Enabled normal Turbo caching for all six Brunch build tasks in 58058c71a7. The opt-outs arrived wholesale during the FE-1437 monorepo import and had no recorded non-hermetic justification. Verification used two identical filtered builds: first run missed all six Brunch caches; second run hit all six (6 cached, 7 total, with only unrelated @hashintel/petrinaut-core still bypassing its own cache).

@TimDiekmann

Copy link
Copy Markdown
Member

The failing Unit (@hashintel/brunch-agent) job was a pruned-checkout mismatch, not a product-test regression: core tests read the shipped SDCPN/Gherkin contracts and topology, while the prune rule retained only core and the app. Fixed in d2ded94308 by adding both plugin workspaces only when Brunch core is the requested scope. The hermetic prune-rule test passes, and an exact local prune followed by turbo run test:unit --env-mode=loose --filter @hashintel/brunch-agent now passes 18 test files / 198 tests (197 passed, one skipped).

Note, that on main we have merged the change in Turborepo to use affectedTasks instead of affectedPackages. So if you don't strictly need a dependency, you may just add a dependsOn relationship in turbo.json.

@lunelson
lunelson requested a review from CiaranMn August 31, 2026 11:32
@lunelson
lunelson enabled auto-merge August 31, 2026 11:33
@lunelson
lunelson added this pull request to the merge queue Aug 31, 2026
Merged via the queue into main with commit aa913dd Aug 31, 2026
226 checks passed
@lunelson
lunelson deleted the ln/fe-1406-1524-consolidated branch August 31, 2026 11:59
@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 $$16.3 \mathrm{ms} \pm 238 \mathrm{μs}\left({\color{lightgreen}-5.327 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.08 \mathrm{ms} \pm 22.7 \mathrm{μs}\left({\color{gray}0.246 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$7.71 \mathrm{ms} \pm 61.3 \mathrm{μs}\left({\color{lightgreen}-8.347 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$27.8 \mathrm{ms} \pm 256 \mathrm{μs}\left({\color{gray}3.47 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$9.40 \mathrm{ms} \pm 98.6 \mathrm{μs}\left({\color{gray}1.20 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$15.3 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}-2.187 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$17.5 \mathrm{ms} \pm 137 \mathrm{μs}\left({\color{gray}-4.454 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.34 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{gray}0.465 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$9.74 \mathrm{ms} \pm 81.8 \mathrm{μs}\left({\color{gray}0.726 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$2.45 \mathrm{ms} \pm 20.3 \mathrm{μs}\left({\color{red}6.38 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$1.98 \mathrm{ms} \pm 18.1 \mathrm{μs}\left({\color{gray}3.87 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$2.27 \mathrm{ms} \pm 35.4 \mathrm{μs}\left({\color{red}6.12 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$3.12 \mathrm{ms} \pm 21.1 \mathrm{μs}\left({\color{lightgreen}-5.414 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.14 \mathrm{ms} \pm 23.6 \mathrm{μs}\left({\color{gray}1.06 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$2.53 \mathrm{ms} \pm 20.1 \mathrm{μs}\left({\color{gray}-2.024 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$2.82 \mathrm{ms} \pm 30.9 \mathrm{μs}\left({\color{red}7.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.23 \mathrm{ms} \pm 15.8 \mathrm{μs}\left({\color{red}7.03 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$2.61 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{red}5.57 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$1.60 \mathrm{ms} \pm 13.4 \mathrm{μs}\left({\color{gray}-4.953 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$1.65 \mathrm{ms} \pm 27.4 \mathrm{μs}\left({\color{red}5.71 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$1.61 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}-2.240 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$1.81 \mathrm{ms} \pm 23.5 \mathrm{μs}\left({\color{gray}-3.137 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$1.64 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}-4.688 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$1.76 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}-4.803 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$1.94 \mathrm{ms} \pm 26.7 \mathrm{μs}\left({\color{red}5.02 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$1.77 \mathrm{ms} \pm 13.2 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$1.91 \mathrm{ms} \pm 22.5 \mathrm{μs}\left({\color{red}5.87 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.17 \mathrm{ms} \pm 23.7 \mathrm{μs}\left({\color{gray}1.99 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$1.83 \mathrm{ms} \pm 11.5 \mathrm{μs}\left({\color{gray}-4.074 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$2.00 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}-1.130 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.08 \mathrm{ms} \pm 22.6 \mathrm{μs}\left({\color{gray}3.88 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$1.89 \mathrm{ms} \pm 15.8 \mathrm{μs}\left({\color{gray}4.16 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.03 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{gray}3.70 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$26.0 \mathrm{ms} \pm 275 \mathrm{μs}\left({\color{gray}-0.105 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$22.3 \mathrm{ms} \pm 145 \mathrm{μs}\left({\color{red}5.35 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$23.3 \mathrm{ms} \pm 174 \mathrm{μs}\left({\color{gray}-2.696 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$21.0 \mathrm{ms} \pm 187 \mathrm{μs}\left({\color{gray}1.94 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$26.6 \mathrm{ms} \pm 156 \mathrm{μs}\left({\color{gray}-4.665 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$30.7 \mathrm{ms} \pm 216 \mathrm{μs}\left({\color{gray}1.81 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$26.2 \mathrm{ms} \pm 213 \mathrm{μs}\left({\color{red}6.40 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$59.2 \mathrm{ms} \pm 629 \mathrm{μs}\left({\color{red}6.25 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$21.7 \mathrm{ms} \pm 204 \mathrm{μs}\left({\color{gray}1.57 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$151 \mathrm{ms} \pm 922 \mathrm{μs}\left({\color{gray}4.36 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$6.70 \mathrm{ms} \pm 43.2 \mathrm{μs}\left({\color{gray}0.098 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$6.94 \mathrm{ms} \pm 77.9 \mathrm{μs}\left({\color{red}5.61 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$7.16 \mathrm{ms} \pm 62.0 \mathrm{μs}\left({\color{gray}3.85 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$6.81 \mathrm{ms} \pm 79.1 \mathrm{μs}\left({\color{red}5.15 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$7.15 \mathrm{ms} \pm 52.7 \mathrm{μs}\left({\color{red}7.90 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$6.97 \mathrm{ms} \pm 77.4 \mathrm{μs}\left({\color{red}6.51 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$6.95 \mathrm{ms} \pm 113 \mathrm{μs}\left({\color{gray}4.55 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$7.45 \mathrm{ms} \pm 66.8 \mathrm{μs}\left({\color{red}10.9 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$7.49 \mathrm{ms} \pm 82.7 \mathrm{μs}\left({\color{red}9.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$7.58 \mathrm{ms} \pm 69.2 \mathrm{μs}\left({\color{red}10.6 \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 $$7.06 \mathrm{ms} \pm 82.0 \mathrm{μs}\left({\color{gray}-1.035 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$7.99 \mathrm{ms} \pm 57.3 \mathrm{μs}\left({\color{red}15.0 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$7.86 \mathrm{ms} \pm 564 \mathrm{μs}\left({\color{red}16.5 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$7.51 \mathrm{ms} \pm 93.5 \mathrm{μs}\left({\color{red}10.1 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$7.56 \mathrm{ms} \pm 77.5 \mathrm{μs}\left({\color{red}13.1 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$8.01 \mathrm{ms} \pm 71.6 \mathrm{μs}\left({\color{red}17.6 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$7.01 \mathrm{ms} \pm 70.8 \mathrm{μs}\left({\color{red}5.83 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$7.31 \mathrm{ms} \pm 45.4 \mathrm{μs}\left({\color{red}8.30 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$7.58 \mathrm{ms} \pm 68.8 \mathrm{μs}\left({\color{red}13.1 \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 $$5.63 \mathrm{ms} \pm 38.1 \mathrm{μs}\left({\color{red}11.4 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$41.7 \mathrm{ms} \pm 269 \mathrm{μs}\left({\color{red}5.41 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$75.6 \mathrm{ms} \pm 971 \mathrm{μs}\left({\color{gray}3.68 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$47.6 \mathrm{ms} \pm 598 \mathrm{μs}\left({\color{red}7.10 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$51.9 \mathrm{ms} \pm 440 \mathrm{μs}\left({\color{gray}1.46 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$61.2 \mathrm{ms} \pm 507 \mathrm{μs}\left({\color{red}7.81 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$62.6 \mathrm{ms} \pm 478 \mathrm{μs}\left({\color{gray}1.65 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$29.2 \mathrm{ms} \pm 889 \mathrm{μs}\left({\color{gray}1.93 \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 $$44.8 \mathrm{ms} \pm 332 \mathrm{μs}\left({\color{lightgreen}-9.185 \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 $$32.3 \mathrm{ms} \pm 322 \mathrm{μs}\left({\color{gray}-3.849 \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 $$38.5 \mathrm{ms} \pm 271 \mathrm{μs}\left({\color{gray}-1.960 \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 $$39.0 \mathrm{ms} \pm 483 \mathrm{μs}\left({\color{lightgreen}-7.465 \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 $$37.6 \mathrm{ms} \pm 247 \mathrm{μs}\left({\color{lightgreen}-8.867 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$71.6 \mathrm{ms} \pm 345 \mathrm{μs}\left({\color{lightgreen}-5.612 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$79.1 \mathrm{ms} \pm 341 \mathrm{μs}\left({\color{gray}-2.670 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$13.7 \mathrm{ms} \pm 130 \mathrm{μs}\left({\color{red}25.3 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$327 \mathrm{ms} \pm 1.03 \mathrm{ms}\left({\color{gray}3.82 \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 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 > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants