Xray
daily rollups 1h 6h 24h 48h 3d 5d 7d 14d 30d ‹
Last 3 days▾
Ends now. Anything up to this cluster's 30-day retention.
Start and end times
Cancel
Interpreted in UTC (change it at the right of this bar). Earliest available: 2026-10-19 09:34:47.
› →|
updated 22h ago
Sample data. This database was generated by scripts/seed_dev_db.py — every service, deploy, person and figure on this page is synthetic. Names are sample.*@seed.invalid and image tags are prefixed SEED-. Nothing here happened.

Shared data paths 21

stored 22h ago all 21coupling through shared query shapes

Which services on nexus read the same graph over the last 3d — the coupling that decides the blast radius of a schema change. ?Two services running the same query shape depend on the same labels, properties and indexes, whether or not they ever call each other. Change one and both are affected. A matrix rather than a node graph because at this size a force-directed graph is a hairball whose layout changes every render, while a matrix sorts meaningfully and lets you read one row across.

How to read this page — shared data paths

Two services that run the same query shape depend on the same labels, properties and indexes — whether or not they ever call each other. That is the coupling that decides the blast radius of a schema or index change.

a cell
How many query shapes the two services on that row and column both run. Darker is more. The diagonal is left empty because a service trivially shares everything with itself.
query shape
A statement with its literal values stripped out, identified by Neo4j's own plan-cache hash — so the same query with different ids counts once.
widest reach
Shapes ordered by how many services run them. These are the statements where a changed index or a renamed property hurts most at once.

What this page will not tell you

  • Who calls whom. This is not a call graph and cannot become one from stored data: nothing here carries both a trace id and a service name, so the edge "A called B" does not exist in the database. See docs/UPSTREAM-DATA.md.
  • Direction or dependency. A shared shape is symmetric — it says both services read the same thing, not that one depends on the other.
This is coupling through the data, not a call graph. Nothing stored here carries both a trace id and a service name, so an edge saying “A called B” cannot be drawn from the database — only from a collector that scans traces and stores the pairs. That is written up in docs/UPSTREAM-DATA.md. What is on this page is real and from stored data: services that read the same shapes.

Services × services, by shapes they both run

workplansvcworkplansvcdocprocdocprocexecsvcexecsvctuskertuskeronboardingsvconboardingsvcdata_monitordata_monitorvirtual-assistantvirtual-assistantdocsvcdocsvcstudiosvcstudiosvcfinsvcfinsvcregsvcregsvcenrollsvcenrollsvcschedsvcschedsvcnotifsvcnotifsvcpatientsvcpatientsvcdashrsvcdashrsvcdashqldashqlchat-agentchat-agentontologysvcontologysvcschema-migrateschema-migrateexportsvcexportsvcworkplansvc ↔ execsvc: 3 shared shapesworkplansvc ↔ tusker: 2 shared shapesworkplansvc ↔ onboardingsvc: 3 shared shapesworkplansvc ↔ docsvc: 3 shared shapesworkplansvc ↔ studiosvc: 2 shared shapesworkplansvc ↔ finsvc: 1 shared shapesworkplansvc ↔ regsvc: 1 shared shapesworkplansvc ↔ enrollsvc: 3 shared shapesworkplansvc ↔ schedsvc: 3 shared shapesworkplansvc ↔ notifsvc: 1 shared shapesworkplansvc ↔ dashql: 2 shared shapesdocproc ↔ virtual-assistant: 6 shared shapesdocproc ↔ chat-agent: 2 shared shapesdocproc ↔ ontologysvc: 8 shared shapesexecsvc ↔ workplansvc: 3 shared shapesexecsvc ↔ tusker: 14 shared shapesexecsvc ↔ onboardingsvc: 32 shared shapesexecsvc ↔ docsvc: 23 shared shapesexecsvc ↔ studiosvc: 9 shared shapesexecsvc ↔ finsvc: 4 shared shapesexecsvc ↔ regsvc: 8 shared shapesexecsvc ↔ enrollsvc: 21 shared shapesexecsvc ↔ schedsvc: 13 shared shapesexecsvc ↔ notifsvc: 5 shared shapesexecsvc ↔ patientsvc: 6 shared shapesexecsvc ↔ dashql: 9 shared shapesexecsvc ↔ schema-migrate: 2 shared shapestusker ↔ workplansvc: 2 shared shapestusker ↔ execsvc: 14 shared shapestusker ↔ onboardingsvc: 9 shared shapestusker ↔ docsvc: 10 shared shapestusker ↔ studiosvc: 5 shared shapestusker ↔ finsvc: 3 shared shapestusker ↔ regsvc: 5 shared shapestusker ↔ enrollsvc: 8 shared shapestusker ↔ schedsvc: 9 shared shapestusker ↔ notifsvc: 3 shared shapestusker ↔ patientsvc: 5 shared shapestusker ↔ dashql: 6 shared shapestusker ↔ schema-migrate: 1 shared shapesonboardingsvc ↔ workplansvc: 3 shared shapesonboardingsvc ↔ execsvc: 32 shared shapesonboardingsvc ↔ tusker: 9 shared shapesonboardingsvc ↔ docsvc: 29 shared shapesonboardingsvc ↔ studiosvc: 6 shared shapesonboardingsvc ↔ finsvc: 4 shared shapesonboardingsvc ↔ regsvc: 5 shared shapesonboardingsvc ↔ enrollsvc: 17 shared shapesonboardingsvc ↔ schedsvc: 11 shared shapesonboardingsvc ↔ notifsvc: 8 shared shapesonboardingsvc ↔ patientsvc: 7 shared shapesonboardingsvc ↔ dashql: 9 shared shapesonboardingsvc ↔ schema-migrate: 4 shared shapesvirtual-assistant ↔ docproc: 6 shared shapesvirtual-assistant ↔ chat-agent: 4 shared shapesvirtual-assistant ↔ ontologysvc: 4 shared shapesdocsvc ↔ workplansvc: 3 shared shapesdocsvc ↔ execsvc: 23 shared shapesdocsvc ↔ tusker: 10 shared shapesdocsvc ↔ onboardingsvc: 29 shared shapesdocsvc ↔ studiosvc: 6 shared shapesdocsvc ↔ finsvc: 4 shared shapesdocsvc ↔ regsvc: 6 shared shapesdocsvc ↔ enrollsvc: 15 shared shapesdocsvc ↔ schedsvc: 12 shared shapesdocsvc ↔ notifsvc: 5 shared shapesdocsvc ↔ patientsvc: 6 shared shapesdocsvc ↔ dashql: 9 shared shapesdocsvc ↔ schema-migrate: 2 shared shapesstudiosvc ↔ workplansvc: 2 shared shapesstudiosvc ↔ execsvc: 9 shared shapesstudiosvc ↔ tusker: 5 shared shapesstudiosvc ↔ onboardingsvc: 6 shared shapesstudiosvc ↔ docsvc: 6 shared shapesstudiosvc ↔ regsvc: 1 shared shapesstudiosvc ↔ enrollsvc: 6 shared shapesstudiosvc ↔ schedsvc: 6 shared shapesstudiosvc ↔ patientsvc: 4 shared shapesstudiosvc ↔ dashql: 6 shared shapesfinsvc ↔ workplansvc: 1 shared shapesfinsvc ↔ execsvc: 4 shared shapesfinsvc ↔ tusker: 3 shared shapesfinsvc ↔ onboardingsvc: 4 shared shapesfinsvc ↔ docsvc: 4 shared shapesfinsvc ↔ regsvc: 3 shared shapesfinsvc ↔ enrollsvc: 3 shared shapesfinsvc ↔ schedsvc: 4 shared shapesfinsvc ↔ notifsvc: 4 shared shapesfinsvc ↔ dashql: 1 shared shapesfinsvc ↔ schema-migrate: 2 shared shapesregsvc ↔ workplansvc: 1 shared shapesregsvc ↔ execsvc: 8 shared shapesregsvc ↔ tusker: 5 shared shapesregsvc ↔ onboardingsvc: 5 shared shapesregsvc ↔ docsvc: 6 shared shapesregsvc ↔ studiosvc: 1 shared shapesregsvc ↔ finsvc: 3 shared shapesregsvc ↔ enrollsvc: 4 shared shapesregsvc ↔ schedsvc: 7 shared shapesregsvc ↔ notifsvc: 3 shared shapesregsvc ↔ patientsvc: 2 shared shapesregsvc ↔ dashql: 2 shared shapesregsvc ↔ schema-migrate: 1 shared shapesenrollsvc ↔ workplansvc: 3 shared shapesenrollsvc ↔ execsvc: 21 shared shapesenrollsvc ↔ tusker: 8 shared shapesenrollsvc ↔ onboardingsvc: 17 shared shapesenrollsvc ↔ docsvc: 15 shared shapesenrollsvc ↔ studiosvc: 6 shared shapesenrollsvc ↔ finsvc: 3 shared shapesenrollsvc ↔ regsvc: 4 shared shapesenrollsvc ↔ schedsvc: 10 shared shapesenrollsvc ↔ notifsvc: 4 shared shapesenrollsvc ↔ patientsvc: 5 shared shapesenrollsvc ↔ dashql: 9 shared shapesenrollsvc ↔ schema-migrate: 1 shared shapesschedsvc ↔ workplansvc: 3 shared shapesschedsvc ↔ execsvc: 13 shared shapesschedsvc ↔ tusker: 9 shared shapesschedsvc ↔ onboardingsvc: 11 shared shapesschedsvc ↔ docsvc: 12 shared shapesschedsvc ↔ studiosvc: 6 shared shapesschedsvc ↔ finsvc: 4 shared shapesschedsvc ↔ regsvc: 7 shared shapesschedsvc ↔ enrollsvc: 10 shared shapesschedsvc ↔ notifsvc: 12 shared shapesschedsvc ↔ patientsvc: 5 shared shapesschedsvc ↔ dashql: 8 shared shapesschedsvc ↔ schema-migrate: 2 shared shapesnotifsvc ↔ workplansvc: 1 shared shapesnotifsvc ↔ execsvc: 5 shared shapesnotifsvc ↔ tusker: 3 shared shapesnotifsvc ↔ onboardingsvc: 8 shared shapesnotifsvc ↔ docsvc: 5 shared shapesnotifsvc ↔ finsvc: 4 shared shapesnotifsvc ↔ regsvc: 3 shared shapesnotifsvc ↔ enrollsvc: 4 shared shapesnotifsvc ↔ schedsvc: 12 shared shapesnotifsvc ↔ dashql: 1 shared shapesnotifsvc ↔ schema-migrate: 2 shared shapespatientsvc ↔ execsvc: 6 shared shapespatientsvc ↔ tusker: 5 shared shapespatientsvc ↔ onboardingsvc: 7 shared shapespatientsvc ↔ docsvc: 6 shared shapespatientsvc ↔ studiosvc: 4 shared shapespatientsvc ↔ regsvc: 2 shared shapespatientsvc ↔ enrollsvc: 5 shared shapespatientsvc ↔ schedsvc: 5 shared shapespatientsvc ↔ dashql: 5 shared shapesdashql ↔ workplansvc: 2 shared shapesdashql ↔ execsvc: 9 shared shapesdashql ↔ tusker: 6 shared shapesdashql ↔ onboardingsvc: 9 shared shapesdashql ↔ docsvc: 9 shared shapesdashql ↔ studiosvc: 6 shared shapesdashql ↔ finsvc: 1 shared shapesdashql ↔ regsvc: 2 shared shapesdashql ↔ enrollsvc: 9 shared shapesdashql ↔ schedsvc: 8 shared shapesdashql ↔ notifsvc: 1 shared shapesdashql ↔ patientsvc: 5 shared shapesdashql ↔ schema-migrate: 1 shared shapeschat-agent ↔ docproc: 2 shared shapeschat-agent ↔ virtual-assistant: 4 shared shapeschat-agent ↔ ontologysvc: 3 shared shapeschat-agent ↔ exportsvc: 1 shared shapesontologysvc ↔ docproc: 8 shared shapesontologysvc ↔ virtual-assistant: 4 shared shapesontologysvc ↔ chat-agent: 3 shared shapesontologysvc ↔ exportsvc: 1 shared shapesschema-migrate ↔ execsvc: 2 shared shapesschema-migrate ↔ tusker: 1 shared shapesschema-migrate ↔ onboardingsvc: 4 shared shapesschema-migrate ↔ docsvc: 2 shared shapesschema-migrate ↔ finsvc: 2 shared shapesschema-migrate ↔ regsvc: 1 shared shapesschema-migrate ↔ enrollsvc: 1 shared shapesschema-migrate ↔ schedsvc: 2 shared shapesschema-migrate ↔ notifsvc: 2 shared shapesschema-migrate ↔ dashql: 1 shared shapesexportsvc ↔ chat-agent: 1 shared shapesexportsvc ↔ ontologysvc: 1 shared shapes

Shapes with the widest reach

A statement many services run is the one where an index change, a renamed property or a slow plan hurts most at once. These are ordered by how many services execute them.

Query shapes ordered by how many services execute them
Services Who runs it Statement
10 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, patientsvc, regsvc, schedsvc, studiosvc, tusker
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpe…
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpending:false, alias:$orgAlias}) // A deactivated (Inactive) org actor is not a membership (ENG-?). OPTIONAL MATCH (currentUser)-[:FOR_USER]-(orgActor:Actor{delpending:false})-[:ORGANIZATION_TO_ACTOR]-(targetOrg) WHERE coalesce(orgActor.state, ?) <> ? OPTIONAL MATCH (currentUser)-[supports:SUPPORTS_ORG]-(targetOrg) WITH *, false AS repOf // Evaluated only for non-members; members are decided by orgActor alone. WITH *, CASE WHEN orgActor IS NULL THEN EXISTS { MATCH (currentUser)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(targetOrg), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = targetOrg.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) } ELSE false END as delegated RETURN CASE WHEN orgActor is not null THEN currentUser WHEN delegated THEN currentUser WHEN repOf THEN currentUser WHEN supports is not null THEN coalesce(supportUser, currentUser) ELSE currentUser END as user, CASE WHEN orgActor is not null OR delegated OR repOf OR supports is not null THEN targetOrg ELSE null END as org, currentUser as tokenUser
10 docsvc, enrollsvc, execsvc, finsvc, notifsvc, onboardingsvc, regsvc, schedsvc, tusker, workplansvc
SHOW INDEXES YIELD name, labelsOrTypes, properties, type, entityType WHERE labelsOrTypes IS NOT NULL RETURN name, labelsOrTypes, properties, type, entityType
SHOW INDEXES YIELD name, labelsOrTypes, properties, type, entityType WHERE labelsOrTypes IS NOT NULL RETURN name, labelsOrTypes, properties, type, entityType
9 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, patientsvc, schedsvc, studiosvc, tusker
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpe…
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpending:false, alias:$orgAlias}) // A deactivated (Inactive) org actor is not a membership (ENG-?). OPTIONAL MATCH (currentUser)-[:FOR_USER]-(orgActor:Actor{delpending:false})-[:ORGANIZATION_TO_ACTOR]-(targetOrg) WHERE coalesce(orgActor.state, ?) <> ? OPTIONAL MATCH (currentUser)-[supports:SUPPORTS_ORG]-(targetOrg) WITH *, false AS repOf // Evaluated only for non-members; members are decided by orgActor alone. WITH *, CASE WHEN orgActor IS NULL THEN EXISTS { MATCH (currentUser)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(targetOrg), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = targetOrg.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) } ELSE false END as delegated RETURN CASE WHEN orgActor is not null THEN currentUser WHEN delegated THEN currentUser WHEN repOf THEN currentUser WHEN supports is not null THEN coalesce(supportUser, currentUser) ELSE currentUser END as user, CASE WHEN orgActor is not null OR delegated OR repOf OR supports is not null THEN targetOrg ELSE null END as org, currentUser as tokenUser
9 dashql, docsvc, enrollsvc, execsvc, finsvc, notifsvc, onboardingsvc, schedsvc, schema-migrate
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope{version:?}) // Both names go through one column: apoc.text.join takes a …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope{version:?}) // Both names go through one column: apoc.text.join takes a list of strings, // and concatenating two collected lists does not type-check as one. UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList return apoc.create.vNode([?], { name: p.name, description: p.description, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, scope: s.name})
9 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, patientsvc, regsvc, schedsvc, tusker
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIO…
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION with u, o // Delegated engagements in o. Only the delegated roles cross over — // the TildaScale Actor?s list. MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL {WITH u, o // WITH DISTINCT is a required pipeline barrier (see the studyMembership note // in scope.go): without it (u)<-[:FOR_USER]-(a) re-expands once per study in // the org — ?.0M -> 32k db hits. Splitting the MATCH without DISTINCT does // nothing; the barrier is what forbids the bad join order. Not applied to the // sites or org-roles subqueries, where it measured neutral or worse. // No longer OPTIONAL: the subquery ends in an ungrouped aggregation, so zero // matches still yield one row with empty collections. CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, a, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients; the pipeline // that replaced the old (u,o,s,a) grouping otherwise leaves it plan-dependent. WITH s, CASE when not s is null then {studyId: s.tildaid, name: s.name, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} end as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles}
9 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, patientsvc, schedsvc, studiosvc, tusker
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIO…
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION with u, o // Delegated engagements in o. Only the delegated roles cross over — // the TildaScale Actor?s list. MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL {WITH u, o // WITH DISTINCT is a required pipeline barrier (see the studyMembership note // in scope.go): without it (u)<-[:FOR_USER]-(a) re-expands once per study in // the org — ?.0M -> 32k db hits. Splitting the MATCH without DISTINCT does // nothing; the barrier is what forbids the bad join order. Not applied to the // sites or org-roles subqueries, where it measured neutral or worse. // No longer OPTIONAL: the subquery ends in an ungrouped aggregation, so zero // matches still yield one row with empty collections. CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, a, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients; the pipeline // that replaced the old (u,o,s,a) grouping otherwise leaves it plan-dependent. WITH s, CASE when not s is null then {studyId: s.tildaid, name: s.name, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} end as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles}
9 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, schedsvc, studiosvc, tusker, workplansvc
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpe…
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpending:false, alias:$orgAlias}) // A deactivated (Inactive) org actor is not a membership (ENG-?). OPTIONAL MATCH (currentUser)-[:FOR_USER]-(orgActor:Actor{delpending:false})-[:ORGANIZATION_TO_ACTOR]-(targetOrg) WHERE coalesce(orgActor.state, ?) <> ? OPTIONAL MATCH (currentUser)-[supports:SUPPORTS_ORG]-(targetOrg) WITH *, false AS repOf // Evaluated only for non-members; members are decided by orgActor alone. WITH *, CASE WHEN orgActor IS NULL THEN EXISTS { MATCH (currentUser)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(targetOrg), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = targetOrg.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) } ELSE false END as delegated RETURN CASE WHEN orgActor is not null THEN currentUser WHEN delegated THEN currentUser WHEN repOf THEN currentUser WHEN supports is not null THEN coalesce(supportUser, currentUser) ELSE currentUser END as user, CASE WHEN orgActor is not null OR delegated OR repOf OR supports is not null THEN targetOrg ELSE null END as org, currentUser as tokenUser
9 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, patientsvc, schedsvc, studiosvc, tusker
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIO…
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION with u, o // Delegated engagements in o. Only the delegated roles cross over — // the TildaScale Actor?s list. MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL {WITH u, o // WITH DISTINCT is a required pipeline barrier (see the studyMembership note // in scope.go): without it (u)<-[:FOR_USER]-(a) re-expands once per study in // the org — ?.0M -> 32k db hits. Splitting the MATCH without DISTINCT does // nothing; the barrier is what forbids the bad join order. Not applied to the // sites or org-roles subqueries, where it measured neutral or worse. // No longer OPTIONAL: the subquery ends in an ungrouped aggregation, so zero // matches still yield one row with empty collections. CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, a, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients; the pipeline // that replaced the old (u,o,s,a) grouping otherwise leaves it plan-dependent. WITH s, CASE when not s is null then {studyId: s.tildaid, name: s.name, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} end as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles}
9 docsvc, enrollsvc, execsvc, finsvc, notifsvc, onboardingsvc, regsvc, schedsvc, tusker
SHOW CONSTRAINTS YIELD name, labelsOrTypes, properties, type, entityType RETURN name, labelsOrTypes, properties, type, entityType
SHOW CONSTRAINTS YIELD name, labelsOrTypes, properties, type, entityType RETURN name, labelsOrTypes, properties, type, entityType
9 docsvc, execsvc, finsvc, notifsvc, onboardingsvc, regsvc, schedsvc, schema-migrate, tusker
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope{version:?}) // Both names go through one column: apoc.text.join takes a …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope{version:?}) // Both names go through one column: apoc.text.join takes a list of strings, // and concatenating two collected lists does not type-check as one. UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList return apoc.create.vNode([?], { name: p.name, description: p.description, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, scope: s.name})
8 dashql, docsvc, enrollsvc, execsvc, onboardingsvc, schedsvc, studiosvc, workplansvc
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpe…
MATCH (currentUser:User{deltimestamp:?,deltimestamp:?,email:$email}) WHERE (currentUser.isDummy IS NULL OR currentUser.isDummy <> true) OPTIONAL MATCH (supportUser:User{email:$supportUserEmail}) OPTIONAL MATCH (targetOrg:Organization{delpending:false, alias:$orgAlias}) // A deactivated (Inactive) org actor is not a membership (ENG-?). OPTIONAL MATCH (currentUser)-[:FOR_USER]-(orgActor:Actor{delpending:false})-[:ORGANIZATION_TO_ACTOR]-(targetOrg) WHERE coalesce(orgActor.state, ?) <> ? OPTIONAL MATCH (currentUser)-[supports:SUPPORTS_ORG]-(targetOrg) WITH *, false AS repOf // Evaluated only for non-members; members are decided by orgActor alone. WITH *, CASE WHEN orgActor IS NULL THEN EXISTS { MATCH (currentUser)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(targetOrg), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = targetOrg.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) } ELSE false END as delegated RETURN CASE WHEN orgActor is not null THEN currentUser WHEN delegated THEN currentUser WHEN repOf THEN currentUser WHEN supports is not null THEN coalesce(supportUser, currentUser) ELSE currentUser END as user, CASE WHEN orgActor is not null OR delegated OR repOf OR supports is not null THEN targetOrg ELSE null END as org, currentUser as tokenUser
5 dashql, docsvc, enrollsvc, execsvc, onboardingsvc
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIO…
MATCH (u:User{tildaid:$userId}), (o:Organization{delpending:false, alias:$orgAlias}) call { with u, o // An Inactive actor holds no roles (ENG-?): its roles would otherwise // still feed hidePhi, the role list and every policy match. OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION with u, o // Delegated engagements in o. Only the delegated roles cross over — // the TildaScale Actor?s list. MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL {WITH u, o // WITH DISTINCT is a required pipeline barrier (see the studyMembership note // in scope.go): without it (u)<-[:FOR_USER]-(a) re-expands once per study in // the org — ?.0M -> 32k db hits. Splitting the MATCH without DISTINCT does // nothing; the barrier is what forbids the bad join order. Not applied to the // sites or org-roles subqueries, where it measured neutral or worse. // No longer OPTIONAL: the subquery ends in an ungrouped aggregation, so zero // matches still yield one row with empty collections. CALL {WITH u, o MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, a, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients; the pipeline // that replaced the old (u,o,s,a) grouping otherwise leaves it plan-dependent. WITH s, CASE when not s is null then {studyId: s.tildaid, name: s.name, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} end as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles}