graphcore-kernel 0.2.3__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. {graphcore_kernel-0.2.3/graphcore_kernel.egg-info → graphcore_kernel-0.3.0}/PKG-INFO +4 -1
  2. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/api.py +9 -3
  3. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/base/views.py +9 -16
  4. graphcore_kernel-0.3.0/graphcore/agent_frontend/changes.py +77 -0
  5. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/client.py +3 -1
  6. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/context.py +52 -12
  7. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/loading.py +7 -0
  8. graphcore_kernel-0.3.0/graphcore/agent_frontend/mcp_server.py +81 -0
  9. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/render.py +41 -17
  10. graphcore_kernel-0.3.0/graphcore/agent_frontend/server.py +66 -0
  11. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/signatures.py +5 -2
  12. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/testing.py +2 -12
  13. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/tests/fakes.py +30 -11
  14. graphcore_kernel-0.3.0/graphcore/agent_frontend/tests/test_frontend.py +787 -0
  15. graphcore_kernel-0.3.0/graphcore/agent_frontend/tests/test_mcp_contract.py +148 -0
  16. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/tests/test_server.py +24 -10
  17. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/tools.py +51 -38
  18. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/graph_api.py +30 -1
  19. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/predicate_codec.py +14 -2
  20. graphcore_kernel-0.3.0/graphcore/api/tests/test_get_by_key.py +39 -0
  21. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_graph_api.py +34 -0
  22. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_predicate_codec.py +17 -1
  23. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/apps.py +5 -0
  24. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/README.md +16 -3
  25. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/authenticator.py +41 -11
  26. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/service_accounts.py +2 -0
  27. graphcore_kernel-0.3.0/graphcore/auth/authn/tests/test_authenticator.py +283 -0
  28. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/tests/test_onboarding.py +9 -5
  29. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/defaults.py +1 -1
  30. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/kernel_policy.py +9 -6
  31. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/policy.py +39 -26
  32. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_can_contain.py +45 -0
  33. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_creation.py +28 -25
  34. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_kernel_policy.py +5 -2
  35. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_lockout.py +1 -1
  36. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_policy.py +38 -21
  37. graphcore_kernel-0.3.0/graphcore/bootstrap/deployment.py +46 -0
  38. graphcore_kernel-0.3.0/graphcore/bootstrap/manifests.py +10 -0
  39. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/bootstrap/tests/test_deployment_seed.py +43 -16
  40. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/AGENT_FRONTEND_TDD.md +123 -31
  41. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/AUTHORIZATION_TECHNICAL_TDD.md +70 -55
  42. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/ENTITY_REFERENCE_TDD.md +8 -3
  43. graphcore_kernel-0.3.0/graphcore/docs/MANIFEST_TDD.md +603 -0
  44. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/SCHEDULING_TDD.md +4 -3
  45. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/STRATEGY_EXECUTION_TDD.md +500 -122
  46. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/VIEW_ENTITY_TDD.md +2 -1
  47. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/VIEW_SYSTEM_TDD.md +14 -0
  48. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/doc_topics.py +5 -0
  49. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/Entity.py +147 -12
  50. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/deployment/Deployment.py +2 -10
  51. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/grant/Grant.py +2 -10
  52. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/group/Group.py +3 -23
  53. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/group/README.md +7 -5
  54. graphcore_kernel-0.3.0/graphcore/domain/entity/invite/Invite.py +20 -0
  55. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/request_template/RequestTemplate.py +6 -19
  56. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/service_account/ServiceAccount.py +8 -13
  57. graphcore_kernel-0.3.0/graphcore/domain/entity/strategy_request/StrategyRequest.py +40 -0
  58. graphcore_kernel-0.3.0/graphcore/domain/entity/tests/test_declared_fields.py +190 -0
  59. graphcore_kernel-0.3.0/graphcore/domain/entity/tests/test_display_name.py +67 -0
  60. graphcore_kernel-0.3.0/graphcore/domain/entity/tests/test_key_field.py +116 -0
  61. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/user/User.py +8 -13
  62. graphcore_kernel-0.3.0/graphcore/domain/entity/view/View.py +22 -0
  63. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/BaseStrategy.py +34 -130
  64. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/GroupStrategies.py +4 -7
  65. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/InviteStrategies.py +2 -2
  66. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/runner.py +3 -1
  67. graphcore_kernel-0.3.0/graphcore/domain/strategy/session.py +176 -0
  68. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/test_BaseStrategies.py +18 -1
  69. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/test_runner.py +15 -18
  70. graphcore_kernel-0.3.0/graphcore/domain/strategy/tests/test_strategy_locks.py +91 -0
  71. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/errors.py +16 -1
  72. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/README.md +46 -21
  73. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/StrategyExecutorService.py +94 -29
  74. graphcore_kernel-0.3.0/graphcore/execution/environments/attempt.py +80 -0
  75. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/environments/celery.py +7 -14
  76. graphcore_kernel-0.3.0/graphcore/execution/environments/in_process.py +37 -0
  77. graphcore_kernel-0.3.0/graphcore/execution/local_session.py +133 -0
  78. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/requests.py +5 -3
  79. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/strategy_context.py +28 -0
  80. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/contract.py +125 -8
  81. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/support.py +79 -3
  82. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/test_dispatchers.py +2 -1
  83. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/test_executor.py +189 -16
  84. graphcore_kernel-0.3.0/graphcore/execution/tests/test_local_session.py +173 -0
  85. graphcore_kernel-0.3.0/graphcore/execution/tests/test_locks.py +75 -0
  86. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/EntityService.py +117 -5
  87. graphcore_kernel-0.3.0/graphcore/graph/tests/test_declared_freeze.py +228 -0
  88. graphcore_kernel-0.3.0/graphcore/management/commands/graphcore_manifest_apply.py +22 -0
  89. graphcore_kernel-0.3.0/graphcore/management/tests/test_manifest_apply.py +31 -0
  90. graphcore_kernel-0.3.0/graphcore/manifest/apply.py +181 -0
  91. graphcore_kernel-0.3.0/graphcore/manifest/codec.py +96 -0
  92. graphcore_kernel-0.3.0/graphcore/manifest/configure.py +45 -0
  93. graphcore_kernel-0.3.0/graphcore/manifest/manifest.py +120 -0
  94. graphcore_kernel-0.3.0/graphcore/manifest/record.py +60 -0
  95. graphcore_kernel-0.3.0/graphcore/manifest/registry.py +137 -0
  96. graphcore_kernel-0.3.0/graphcore/manifest/tests/test_apply.py +355 -0
  97. graphcore_kernel-0.3.0/graphcore/manifest/tests/test_manifest.py +306 -0
  98. graphcore_kernel-0.3.0/graphcore/manifest/tests/test_record.py +58 -0
  99. graphcore_kernel-0.3.0/graphcore/migrations/0003_entity_key.py +35 -0
  100. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/ENTITY_REPOSITORY_TECHNICAL_TDD.md +3 -1
  101. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/compiler.py +12 -1
  102. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/models.py +8 -6
  103. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/repository.py +21 -2
  104. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/tests/test_compiler.py +20 -1
  105. graphcore_kernel-0.3.0/graphcore/persistence/django/tests/test_migration_entity_key.py +29 -0
  106. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/tests/test_repository.py +12 -2
  107. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/repository.py +11 -1
  108. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/tests/contract.py +33 -1
  109. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/tests/evaluate.py +15 -1
  110. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/tests/memory.py +7 -0
  111. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/tests/test_query_types.py +15 -1
  112. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/__init__.py +3 -1
  113. graphcore_kernel-0.3.0/graphcore/public/agent_frontend.py +24 -0
  114. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/entities/__init__.py +2 -0
  115. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/errors.py +2 -2
  116. graphcore_kernel-0.3.0/graphcore/public/execution.py +23 -0
  117. graphcore_kernel-0.3.0/graphcore/public/live_testing.py +37 -0
  118. graphcore_kernel-0.3.0/graphcore/public/manifests.py +34 -0
  119. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/persistence/__init__.py +2 -1
  120. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/strategies/__init__.py +2 -1
  121. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/test_settings.py +2 -1
  122. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/testing.py +2 -0
  123. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/README.md +19 -11
  124. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/StrategyDirectory.py +5 -1
  125. graphcore_kernel-0.3.0/graphcore/registry/app_requirements.py +162 -0
  126. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/discovery.py +6 -0
  127. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/registry.py +7 -2
  128. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_app_config.py +9 -0
  129. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/runtime.py +6 -2
  130. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/beat_scheduler.py +1 -1
  131. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/tests/test_beat_scheduler.py +12 -1
  132. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/testing/case.py +5 -6
  133. graphcore_kernel-0.3.0/graphcore/testing/live/__main__.py +63 -0
  134. graphcore_kernel-0.3.0/graphcore/testing/live/asgi.py +23 -0
  135. graphcore_kernel-0.3.0/graphcore/testing/live/client.py +246 -0
  136. graphcore_kernel-0.3.0/graphcore/testing/live/issuer.py +45 -0
  137. graphcore_kernel-0.3.0/graphcore/testing/live/operations.py +56 -0
  138. graphcore_kernel-0.3.0/graphcore/testing/live/patching.py +278 -0
  139. graphcore_kernel-0.3.0/graphcore/testing/live/scenario.py +173 -0
  140. graphcore_kernel-0.3.0/graphcore/testing/live/settings.py +52 -0
  141. graphcore_kernel-0.3.0/graphcore/testing/live/stack.py +259 -0
  142. graphcore_kernel-0.3.0/graphcore/testing/live/tests/fixture_app/__init__.py +1 -0
  143. graphcore_kernel-0.3.0/graphcore/testing/live/tests/fixture_app/apps.py +7 -0
  144. graphcore_kernel-0.3.0/graphcore/testing/live/tests/patch_targets.py +22 -0
  145. graphcore_kernel-0.3.0/graphcore/testing/live/tests/test_client.py +147 -0
  146. graphcore_kernel-0.3.0/graphcore/testing/live/tests/test_issuer.py +34 -0
  147. graphcore_kernel-0.3.0/graphcore/testing/live/tests/test_patching.py +108 -0
  148. graphcore_kernel-0.3.0/graphcore/testing/live/tests/test_scenario.py +133 -0
  149. graphcore_kernel-0.3.0/graphcore/testing/live/tests/test_settings.py +58 -0
  150. graphcore_kernel-0.3.0/graphcore/testing/live/tests/test_stack.py +69 -0
  151. graphcore_kernel-0.3.0/graphcore/testing/live/urls.py +4 -0
  152. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/testing/runner.py +18 -1
  153. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/testing/settings.py +6 -2
  154. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/testing/tests/test_case_and_runner.py +8 -2
  155. graphcore_kernel-0.3.0/graphcore/testing/tests/test_settings_for_apps.py +155 -0
  156. graphcore_kernel-0.3.0/graphcore/tests/__init__.py +0 -0
  157. graphcore_kernel-0.3.0/graphcore/tests/memory_runtime.py +21 -0
  158. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/public_api_manifest.py +14 -4
  159. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_composition_boundaries.py +4 -1
  160. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_packaging.py +16 -0
  161. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_public_api_boundaries.py +14 -0
  162. graphcore_kernel-0.3.0/graphcore/transport/__init__.py +0 -0
  163. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/agent_asgi.py +3 -4
  164. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/agent_client.py +20 -1
  165. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/consumers.py +33 -17
  166. graphcore_kernel-0.3.0/graphcore/transport/tests/__init__.py +0 -0
  167. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/tests/test_api_views.py +26 -2
  168. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/tests/test_consumers.py +58 -0
  169. graphcore_kernel-0.3.0/graphcore/transport/tests/test_in_process_mcp.py +83 -0
  170. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/views.py +27 -2
  171. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/execution.py +6 -2
  172. graphcore_kernel-0.3.0/graphcore/types/keys.py +25 -0
  173. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/query.py +30 -2
  174. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/strategy.py +12 -0
  175. graphcore_kernel-0.3.0/graphcore/types/tests/__init__.py +0 -0
  176. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0/graphcore_kernel.egg-info}/PKG-INFO +4 -1
  177. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore_kernel.egg-info/SOURCES.txt +56 -0
  178. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore_kernel.egg-info/requires.txt +4 -0
  179. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/pyproject.toml +7 -1
  180. graphcore_kernel-0.2.3/graphcore/agent_frontend/server.py +0 -123
  181. graphcore_kernel-0.2.3/graphcore/agent_frontend/tests/test_frontend.py +0 -548
  182. graphcore_kernel-0.2.3/graphcore/auth/authn/tests/test_authenticator.py +0 -145
  183. graphcore_kernel-0.2.3/graphcore/bootstrap/deployment.py +0 -67
  184. graphcore_kernel-0.2.3/graphcore/domain/entity/invite/Invite.py +0 -31
  185. graphcore_kernel-0.2.3/graphcore/domain/entity/strategy_request/StrategyRequest.py +0 -61
  186. graphcore_kernel-0.2.3/graphcore/domain/entity/view/View.py +0 -37
  187. graphcore_kernel-0.2.3/graphcore/domain/strategy/session.py +0 -56
  188. graphcore_kernel-0.2.3/graphcore/domain/strategy/tests/test_strategy_locks.py +0 -446
  189. graphcore_kernel-0.2.3/graphcore/execution/environments/in_process.py +0 -55
  190. graphcore_kernel-0.2.3/graphcore/execution/local_session.py +0 -117
  191. graphcore_kernel-0.2.3/graphcore/execution/tests/test_local_session.py +0 -95
  192. graphcore_kernel-0.2.3/graphcore/testing/tests/test_settings_for_apps.py +0 -50
  193. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/LICENSE +0 -0
  194. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/NOTICE +0 -0
  195. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/README.md +0 -0
  196. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/__init__.py +0 -0
  197. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/__init__.py +0 -0
  198. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/base/__init__.py +0 -0
  199. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/errors.py +0 -0
  200. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/registry.py +0 -0
  201. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/tests/__init__.py +0 -0
  202. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/agent_frontend/tests/test_loading.py +0 -0
  203. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/__init__.py +0 -0
  204. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/__init__.py +0 -0
  205. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_changed_entities.py +0 -0
  206. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_graph_api_access.py +0 -0
  207. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_graph_api_grants.py +0 -0
  208. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_strategy_tokens.py +0 -0
  209. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/api/tests/test_subtree_query.py +0 -0
  210. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/__init__.py +0 -0
  211. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/__init__.py +0 -0
  212. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/onboarding.py +0 -0
  213. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/principals.py +0 -0
  214. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/resource_metadata.py +0 -0
  215. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/strategy_tokens.py +0 -0
  216. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/testing.py +0 -0
  217. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/tests/__init__.py +0 -0
  218. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/tests/test_service_accounts.py +0 -0
  219. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authn/users.py +0 -0
  220. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/__init__.py +0 -0
  221. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/access_port.py +0 -0
  222. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/__init__.py +0 -0
  223. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/default_access_adapter.py +0 -0
  224. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/tests/__init__.py +0 -0
  225. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/tests/test_default_adapter.py +0 -0
  226. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/tests/test_entity_write_hooks.py +0 -0
  227. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/tests/test_group_types.py +0 -0
  228. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/adapter/tests/test_sync_support.py +0 -0
  229. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/kernel_writes.py +0 -0
  230. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/lookups.py +0 -0
  231. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/__init__.py +0 -0
  232. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_contained_by.py +0 -0
  233. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_delete_permission.py +0 -0
  234. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_granted_to_me.py +0 -0
  235. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_integration.py +0 -0
  236. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_invites.py +0 -0
  237. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_primitives.py +0 -0
  238. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/auth/authz/tests/test_principal_creation.py +0 -0
  239. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/bootstrap/__init__.py +0 -0
  240. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/bootstrap/signals.py +0 -0
  241. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/bootstrap/tests/__init__.py +0 -0
  242. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/broadcast/__init__.py +0 -0
  243. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/broadcast/broadcaster.py +0 -0
  244. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/broadcast/channels.py +0 -0
  245. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/broadcast/tests/__init__.py +0 -0
  246. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/broadcast/tests/test_broadcaster.py +0 -0
  247. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/celery.py +0 -0
  248. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/ARCHITECTURE_PRINCIPLES.md +0 -0
  249. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/GRAPHAPI_FRONT_DOOR.md +0 -0
  250. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/RUNTIME.md +0 -0
  251. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/__init__.py +0 -0
  252. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/docs_discovery.py +0 -0
  253. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/docs/public_api.py +0 -0
  254. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/__init__.py +0 -0
  255. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/__init__.py +0 -0
  256. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/deployment/__init__.py +0 -0
  257. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/grant/__init__.py +0 -0
  258. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/group/__init__.py +0 -0
  259. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/invite/__init__.py +0 -0
  260. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/request_template/__init__.py +0 -0
  261. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/request_template/tests/__init__.py +0 -0
  262. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/request_template/tests/test_request_template.py +0 -0
  263. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/service_account/__init__.py +0 -0
  264. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/strategy_request/__init__.py +0 -0
  265. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/strategy_request/tests/__init__.py +0 -0
  266. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/strategy_request/tests/test_strategy_request_entity.py +0 -0
  267. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/tests/__init__.py +0 -0
  268. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/tests/test_entity.py +0 -0
  269. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/tests/test_grant_group_entities.py +0 -0
  270. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/tests/test_write_once_fields.py +0 -0
  271. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/user/__init__.py +0 -0
  272. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/user/tests/__init__.py +0 -0
  273. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/user/tests/test_user_entity.py +0 -0
  274. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/view/__init__.py +0 -0
  275. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/view/position.py +0 -0
  276. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/view/tests/__init__.py +0 -0
  277. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/view/tests/test_position.py +0 -0
  278. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/entity/view/tests/test_view_entity.py +0 -0
  279. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/DeploymentStrategies.py +0 -0
  280. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/GrantStrategies.py +0 -0
  281. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/RequestTemplateStrategies.py +0 -0
  282. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/ViewStrategies.py +0 -0
  283. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/__init__.py +0 -0
  284. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/BaseStrategyTest.py +0 -0
  285. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/__init__.py +0 -0
  286. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/test_grant_strategies.py +0 -0
  287. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/test_group_strategies.py +0 -0
  288. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/test_utils.py +0 -0
  289. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/domain/strategy/tests/test_view_strategies.py +0 -0
  290. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/__init__.py +0 -0
  291. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/dispatcher.py +0 -0
  292. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/environments/__init__.py +0 -0
  293. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/redis_run_events.py +0 -0
  294. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/run_events.py +0 -0
  295. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tasks.py +0 -0
  296. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/__init__.py +0 -0
  297. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/test_reconcile_runs.py +0 -0
  298. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/test_run_events.py +0 -0
  299. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/execution/tests/test_strategy_context.py +0 -0
  300. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/gateway/__init__.py +0 -0
  301. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/gateway/remote.py +0 -0
  302. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/gateway/tests/__init__.py +0 -0
  303. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/gateway/tests/test_remote.py +0 -0
  304. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/__init__.py +0 -0
  305. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/entity_cache.py +0 -0
  306. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/__init__.py +0 -0
  307. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_EntityService.py +0 -0
  308. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_EntityService_list.py +0 -0
  309. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_EntityService_model_resolution.py +0 -0
  310. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_EntityService_referrers.py +0 -0
  311. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_EntityService_routing.py +0 -0
  312. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_dependent_on.py +0 -0
  313. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_engine_is_type_agnostic.py +0 -0
  314. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_engine_resolves_read_permission.py +0 -0
  315. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_entity_cache.py +0 -0
  316. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/graph/tests/test_null_entity_cache.py +0 -0
  317. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/__init__.py +0 -0
  318. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/commands/__init__.py +0 -0
  319. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/commands/dev_reset.py +0 -0
  320. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/commands/graphcore_createadmin.py +0 -0
  321. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/commands/graphcore_policy.py +0 -0
  322. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/commands/graphcore_status.py +0 -0
  323. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/tests/__init__.py +0 -0
  324. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/tests/test_createadmin.py +0 -0
  325. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/tests/test_policy_command.py +0 -0
  326. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/management/tests/test_status_command.py +0 -0
  327. {graphcore_kernel-0.2.3/graphcore/migrations → graphcore_kernel-0.3.0/graphcore/manifest}/__init__.py +0 -0
  328. {graphcore_kernel-0.2.3/graphcore/persistence/django → graphcore_kernel-0.3.0/graphcore/manifest/tests}/__init__.py +0 -0
  329. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/migrations/0001_initial.py +0 -0
  330. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/migrations/0002_invite.py +0 -0
  331. {graphcore_kernel-0.2.3/graphcore/persistence/django/tests → graphcore_kernel-0.3.0/graphcore/migrations}/__init__.py +0 -0
  332. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/models.py +0 -0
  333. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/__init__.py +0 -0
  334. {graphcore_kernel-0.2.3/graphcore/persistence/tests → graphcore_kernel-0.3.0/graphcore/persistence/django}/__init__.py +0 -0
  335. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/backends.py +0 -0
  336. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/bindings.py +0 -0
  337. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/cache.py +0 -0
  338. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/identity.py +0 -0
  339. {graphcore_kernel-0.2.3/graphcore/registry → graphcore_kernel-0.3.0/graphcore/persistence/django/tests}/__init__.py +0 -0
  340. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/tests/test_backends.py +0 -0
  341. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/tests/test_shared_column.py +0 -0
  342. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/tests/test_threads.py +0 -0
  343. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/tests/test_update_shape.py +0 -0
  344. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/django/threads.py +0 -0
  345. {graphcore_kernel-0.2.3/graphcore/registry → graphcore_kernel-0.3.0/graphcore/persistence}/tests/__init__.py +0 -0
  346. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/tests/fixtures.py +0 -0
  347. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/persistence/tests/test_memory_repository.py +0 -0
  348. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/api.py +0 -0
  349. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/apps.py +0 -0
  350. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/__init__.py +0 -0
  351. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/grants.py +0 -0
  352. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/onboarding.py +0 -0
  353. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/perms.py +0 -0
  354. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/policy.py +0 -0
  355. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/roles.py +0 -0
  356. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/auth/subjects.py +0 -0
  357. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/persistence/django.py +0 -0
  358. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/public/scheduling.py +0 -0
  359. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/EntityDirectory.py +0 -0
  360. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/TYPE_METADATA_PLACEMENT.md +0 -0
  361. {graphcore_kernel-0.2.3/graphcore/routes/tests → graphcore_kernel-0.3.0/graphcore/registry}/__init__.py +0 -0
  362. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/app_discovery.py +0 -0
  363. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/decorators.py +0 -0
  364. {graphcore_kernel-0.2.3/graphcore/scheduling → graphcore_kernel-0.3.0/graphcore/registry/tests}/__init__.py +0 -0
  365. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_agent_frontend_discovery.py +0 -0
  366. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_discovery.py +0 -0
  367. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_entity_directory_storage.py +0 -0
  368. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_import_package.py +0 -0
  369. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_principal_flag.py +0 -0
  370. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/registry/tests/test_strategy_directory.py +0 -0
  371. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/routes/__init__.py +0 -0
  372. {graphcore_kernel-0.2.3/graphcore/scheduling → graphcore_kernel-0.3.0/graphcore/routes}/tests/__init__.py +0 -0
  373. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/routes/tests/test_routes.py +0 -0
  374. {graphcore_kernel-0.2.3/graphcore/testing → graphcore_kernel-0.3.0/graphcore/scheduling}/__init__.py +0 -0
  375. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/beat_tasks.py +0 -0
  376. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/scheduler.py +0 -0
  377. {graphcore_kernel-0.2.3/graphcore/testing → graphcore_kernel-0.3.0/graphcore/scheduling}/tests/__init__.py +0 -0
  378. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/tests/contract.py +0 -0
  379. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/tests/memory.py +0 -0
  380. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/tests/test_memory_scheduler.py +0 -0
  381. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/scheduling/tests/test_ticks.py +0 -0
  382. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tasks.py +0 -0
  383. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/test_settings.py +0 -0
  384. {graphcore_kernel-0.2.3/graphcore/tests → graphcore_kernel-0.3.0/graphcore/testing}/__init__.py +0 -0
  385. {graphcore_kernel-0.2.3/graphcore/transport → graphcore_kernel-0.3.0/graphcore/testing/live}/__init__.py +0 -0
  386. {graphcore_kernel-0.2.3/graphcore/transport → graphcore_kernel-0.3.0/graphcore/testing/live}/tests/__init__.py +0 -0
  387. {graphcore_kernel-0.2.3/graphcore/types → graphcore_kernel-0.3.0/graphcore/testing}/tests/__init__.py +0 -0
  388. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/testing/tests/agent_view_fixture.py +0 -0
  389. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/ids.py +0 -0
  390. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/runs.py +0 -0
  391. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_app_discovery.py +0 -0
  392. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_docs_discovery.py +0 -0
  393. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_no_print.py +0 -0
  394. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_public_api_contract.py +0 -0
  395. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_public_api_docs.py +0 -0
  396. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_runtime.py +0 -0
  397. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_shared_type_boundaries.py +0 -0
  398. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_shared_types.py +0 -0
  399. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/tests/test_test_settings.py +0 -0
  400. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/channel_layer.py +0 -0
  401. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/routing.py +0 -0
  402. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/tests/test_agent_client.py +0 -0
  403. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/tests/test_channel_layer.py +0 -0
  404. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/tests/test_resource_metadata.py +0 -0
  405. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/transport/urls.py +0 -0
  406. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/__init__.py +0 -0
  407. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/access.py +0 -0
  408. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/api.py +0 -0
  409. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/entities.py +0 -0
  410. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/entity_id.py +0 -0
  411. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/identity.py +0 -0
  412. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/onboarding.py +0 -0
  413. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/schedules.py +0 -0
  414. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/types/tests/test_entity_id.py +0 -0
  415. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore/urls.py +0 -0
  416. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore_kernel.egg-info/dependency_links.txt +0 -0
  417. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore_kernel.egg-info/entry_points.txt +0 -0
  418. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/graphcore_kernel.egg-info/top_level.txt +0 -0
  419. {graphcore_kernel-0.2.3 → graphcore_kernel-0.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphcore-kernel
3
- Version: 0.2.3
3
+ Version: 0.3.0
4
4
  Summary: GraphCore platform kernel (entities, strategies, transport, auth)
5
5
  Author: GraphCore
6
6
  License-Expression: Apache-2.0
@@ -30,6 +30,9 @@ Requires-Dist: django-redis<8,>=7.0; extra == "redis"
30
30
  Requires-Dist: channels-redis<5,>=4.3; extra == "redis"
31
31
  Provides-Extra: server
32
32
  Requires-Dist: uvicorn[standard]<1,>=0.34; extra == "server"
33
+ Provides-Extra: live
34
+ Requires-Dist: graphcore-kernel[redis,server]; extra == "live"
35
+ Requires-Dist: websockets<18,>=13; extra == "live"
33
36
  Dynamic: license-file
34
37
 
35
38
  # graphcore-kernel (backend)
@@ -21,6 +21,7 @@ class ToolSpec:
21
21
  schema: Optional[dict] = None
22
22
  fn: Optional[Callable] = None
23
23
  from_shell: bool = False
24
+ read_only: bool = False
24
25
 
25
26
 
26
27
  def strategy_tool(
@@ -45,11 +46,16 @@ class Image:
45
46
  media_type: str
46
47
 
47
48
 
48
- def operation(name: str, description: str, schema: dict) -> Callable[[Callable], ToolSpec]:
49
+ def operation(
50
+ name: str, description: str, schema: dict, read_only: bool = False,
51
+ ) -> Callable[[Callable], ToolSpec]:
49
52
  """A view tool that is code: `async def fn(ctx, **params)`. It returns JSON values, an
50
- `Image`, or a list mixing the two."""
53
+ `Image`, or a list mixing the two. A `read_only` operation writes nothing, so `call`
54
+ reports no change for it."""
51
55
  def wrap(fn: Callable) -> ToolSpec:
52
- return ToolSpec(name=name, description=description, schema=schema, fn=fn, takes_target=False)
56
+ return ToolSpec(
57
+ name=name, description=description, schema=schema, fn=fn, takes_target=False, read_only=read_only,
58
+ )
53
59
  return wrap
54
60
 
55
61
 
@@ -1,4 +1,4 @@
1
- """The base agent views: `home` at `/`, `entity` at `/e/{entity}`, and `view`, the default for view entities."""
1
+ """The base agent views: `home` at `/`, `entity` at an entity id, and `view`, the default for view entities."""
2
2
  from __future__ import annotations
3
3
 
4
4
  import json
@@ -6,32 +6,25 @@ from collections import defaultdict
6
6
  from typing import Any, Optional
7
7
 
8
8
  from graphcore.agent_frontend import AgentView, Context, ToolSpec, agent_view, strategy_tool
9
+ from graphcore.agent_frontend.context import MAX_FIELD_CHARS, STRUCTURAL_KEYS, clip
9
10
 
10
- # The base entity's own keys, rendered under `## Entity`; every other key is a field.
11
- STRUCTURAL_KEYS = ('entity_id', 'entity_type_id', 'owner', 'parent_id', 'sibling_position', 'version')
12
- MAX_FIELD_CHARS = 2000
13
11
  VIEW_TYPE = 'graphcore.View'
14
- _ENTITY_ID_PREFIX = 'gc://'
15
12
 
16
13
 
17
- def _value(ctx: Context, value: Any) -> str:
18
- """One line: strings bare unless empty or multi-line, everything else as JSON; an entity
19
- id gains its address, and a long value is cut with its full length."""
14
+ def _value(value: Any) -> str:
15
+ """One line: strings bare unless empty or multi-line, everything else as JSON; a long value
16
+ is cut with its full length."""
20
17
  if isinstance(value, str) and value and '\n' not in value:
21
18
  text = value
22
19
  else:
23
20
  text = json.dumps(value, default=str, ensure_ascii=False)
24
- if len(text) > MAX_FIELD_CHARS:
25
- return f"{text[:MAX_FIELD_CHARS]}… (truncated; {len(text)} characters)"
26
- if isinstance(value, str) and value.startswith(_ENTITY_ID_PREFIX):
27
- return f"{text} · {ctx.place(value).address}"
28
- return text
21
+ return clip(text) if len(text) > MAX_FIELD_CHARS else text
29
22
 
30
23
 
31
24
  def entity_fields(ctx: Context, entity: Any) -> list[str]:
32
25
  """`key: value` for every key of the entity that is not structural."""
33
26
  return [
34
- f"{key}: {_value(ctx, value)}"
27
+ f"{key}: {_value(value)}"
35
28
  for key, value in entity.to_dict().items() if key not in STRUCTURAL_KEYS
36
29
  ]
37
30
 
@@ -59,7 +52,7 @@ async def _parent(ctx: Context, parent_id: Optional[str]) -> str:
59
52
  return f"{parent_id} (not readable)"
60
53
  data = parent.to_dict()
61
54
  label = next((str(data[k]) for k in ('name', 'title', 'slug') if data.get(k)), parent_id)
62
- return f"{label} · {parent.entity_type_id} · {ctx.place(parent_id).address}"
55
+ return f"{label} · {parent.entity_type_id} · {parent_id}"
63
56
 
64
57
 
65
58
  async def children_section(ctx: Context, entity: Any, limit: int = 50) -> list:
@@ -154,7 +147,7 @@ async def view_view(ctx: Context, view: Any) -> list:
154
147
  return [note, *await entity_view(ctx, view)]
155
148
  if data.get('renders') and target is None:
156
149
  return [f"This view renders {data['renders']}, which does not exist or is not readable."]
157
- shows = ctx.place(data['renders']).address if target is not None else 'no entity'
150
+ shows = data['renders'] if target is not None else 'no entity'
158
151
  body = await (component.fn(ctx, target) if target is not None else component.fn(ctx))
159
152
  return [
160
153
  f"View `{component.name}` of {shows} · view entity {view.entity_id}",
@@ -0,0 +1,77 @@
1
+ """What a write changed, among the entities a place's render read."""
2
+ from __future__ import annotations
3
+
4
+ import json
5
+ from typing import Any
6
+
7
+ from graphcore.agent_frontend.client import GraphClient
8
+ from graphcore.agent_frontend.context import MAX_FIELD_CHARS, STRUCTURAL_KEYS, Reads, clip
9
+ from graphcore.types.entities import Tombstone
10
+ from graphcore.types.identity import Principal
11
+
12
+ _HIDDEN = frozenset(STRUCTURAL_KEYS) - {'version'}
13
+
14
+
15
+ def snapshot(reads: Reads) -> dict[str, dict]:
16
+ """Each readable entity's `to_dict()`, taken before a write: a client may hand back
17
+ the same object the write then changes."""
18
+ return {entity_id: entity.to_dict() for entity_id, entity in reads.cache.items()}
19
+
20
+
21
+ def _value(value: Any) -> Any:
22
+ text = value if isinstance(value, str) else json.dumps(value, default=str, ensure_ascii=False)
23
+ return clip(text) if len(text) > MAX_FIELD_CHARS else value
24
+
25
+
26
+ def _keys(before: dict, after: dict) -> list:
27
+ return [*after, *(key for key in before if key not in after)]
28
+
29
+
30
+ def changed_fields(before: dict, after: dict) -> dict:
31
+ """The new value of every non-structural key that differs, `version` included; a key
32
+ whose value is a dict on both sides, such as `attributes`, by its own keys."""
33
+ out: dict[str, Any] = {}
34
+ for key in _keys(before, after):
35
+ old, new = before.get(key), after.get(key)
36
+ if key in _HIDDEN or old == new:
37
+ continue
38
+ if isinstance(old, dict) and isinstance(new, dict):
39
+ out.update({
40
+ f"{key}.{sub}": _value(new.get(sub))
41
+ for sub in _keys(old, new) if old.get(sub) != new.get(sub)
42
+ })
43
+ else:
44
+ out[key] = _value(new)
45
+ return out
46
+
47
+
48
+ async def diff(
49
+ client: GraphClient, principal: Principal, before: Reads, snapshots: dict[str, dict], after: Reads,
50
+ ) -> dict:
51
+ """`changed`, `created` and `deleted`, each keyed by entity id and left out when empty.
52
+ An entity the place read before and no longer reads is fetched again, to tell one that
53
+ is gone from one the place stopped showing."""
54
+ changed: dict[str, dict] = {}
55
+ deleted: dict[str, dict] = {}
56
+ for entity_id, old in snapshots.items():
57
+ new = after.cache.get(entity_id)
58
+ if new is None and entity_id not in after.seen:
59
+ fetched = await client.get_entity(principal, entity_id)
60
+ new = None if isinstance(fetched, Tombstone) else fetched
61
+ if new is None:
62
+ deleted[entity_id] = {'entity_type_id': old.get('entity_type_id')}
63
+ elif f"v{new.version}" != before.seen.get(entity_id):
64
+ changed[entity_id] = changed_fields(old, new.to_dict())
65
+ created = {
66
+ entity_id: {'entity_type_id': entity.entity_type_id}
67
+ for entity_id, entity in after.cache.items() if entity_id not in snapshots
68
+ }
69
+ return {
70
+ key: value for key, value in (('changed', changed), ('created', created), ('deleted', deleted))
71
+ if value
72
+ }
73
+
74
+
75
+ def note(tool: str, changes: dict) -> str:
76
+ counts = [f"{len(changes[key])} {key}" for key in ('changed', 'created', 'deleted') if key in changes]
77
+ return f"ran {tool}; {', '.join(counts)}" if counts else f"ran {tool}; nothing this place shows changed"
@@ -31,4 +31,6 @@ class GraphClient(Protocol):
31
31
  def entity_types(self) -> list[str]: ...
32
32
  def type_strategies(self, entity_type_id: str) -> list[dict]: ...
33
33
  def deployment_strategies(self) -> list[dict]: ...
34
- def strategy_info(self) -> dict[str, dict]: ...
34
+ def strategy_info(self) -> dict[str, dict]:
35
+ """Every registered strategy by name: its `serialize()`, with `read_only`."""
36
+ ...
@@ -9,28 +9,63 @@ from graphcore.agent_frontend.client import GraphClient
9
9
  from graphcore.agent_frontend.errors import AgentError
10
10
  from graphcore.agent_frontend.registry import AgentRegistry
11
11
  from graphcore.types.entities import Tombstone
12
+ from graphcore.types.entity_id import ENTITY_ID_RE, is_entity_id
12
13
  from graphcore.types.identity import Principal
13
14
  from graphcore.types.query import Predicate
14
15
 
15
16
  ID_PREFIX = 'gc://'
16
17
  DEFAULT_QUERY_MAX = 1000
17
18
  _QUERY_PAGE = 100
19
+ # The base entity's own keys; every other key of `to_dict()` is a field.
20
+ STRUCTURAL_KEYS = ('entity_id', 'entity_type_id', 'owner', 'parent_id', 'sibling_position', 'version')
21
+ MAX_FIELD_CHARS = 2000
18
22
 
19
23
 
20
- def entity_address(entity_id: str) -> str:
21
- return '/e/' + entity_id.removeprefix(ID_PREFIX)
24
+ def clip(text: str) -> str:
25
+ """`text`, cut at `MAX_FIELD_CHARS` with its full length when it is longer."""
26
+ if len(text) <= MAX_FIELD_CHARS:
27
+ return text
28
+ return f"{text[:MAX_FIELD_CHARS]}… (truncated; {len(text)} characters)"
29
+
30
+
31
+ def to_route(address: str) -> str:
32
+ """The route table's form of an address an agent writes: an entity id as `/e/<backend>/<local>`,
33
+ an id inside a path as its two segments. Route-form addresses pass through unchanged."""
34
+ if is_entity_id(address):
35
+ return '/e/' + address.removeprefix(ID_PREFIX)
36
+ return ENTITY_ID_RE.sub(lambda match: f"{match.group(1)}/{match.group(2)}", address)
37
+
38
+
39
+ def to_agent(route: str, entity_id: Optional[str]) -> str:
40
+ """The agent's form of a route that resolved to `entity_id`: `/e/<backend>/<local>` is the id
41
+ itself, and in any other route the id's two segments are the id."""
42
+ if entity_id is None:
43
+ return route
44
+ pair = entity_id.removeprefix(ID_PREFIX).split('/')
45
+ parts = [part for part in route.split('/') if part]
46
+ if parts == ['e', *pair]:
47
+ return entity_id
48
+ for i in range(len(parts) - 1):
49
+ if parts[i:i + 2] == pair:
50
+ return '/' + '/'.join([*parts[:i], entity_id, *parts[i + 2:]])
51
+ return route
22
52
 
23
53
 
24
54
  def to_address(target: str) -> str:
25
- return entity_address(target) if target.startswith(ID_PREFIX) else target
55
+ """`target` in the agent's form, as far as it can be told without the route table: an
56
+ entity id is itself, and so is its `/e/` route."""
57
+ parts = [part for part in to_route(target).split('/') if part]
58
+ if len(parts) == 3 and parts[0] == 'e' and is_entity_id(f"{ID_PREFIX}{parts[1]}/{parts[2]}"):
59
+ return f"{ID_PREFIX}{parts[1]}/{parts[2]}"
60
+ return target
61
+
62
+
63
+ def normalized(route: str) -> str:
64
+ return '/' + route.strip('/') if route.strip('/') else '/'
26
65
 
27
66
 
28
67
  def label_of(entity: Any) -> str:
29
- data = entity.to_dict()
30
- for key in ('name', 'title', 'slug'):
31
- if data.get(key):
32
- return str(data[key])
33
- return entity.entity_id
68
+ return entity.display_name or entity.entity_id
34
69
 
35
70
 
36
71
  @dataclass(frozen=True)
@@ -132,8 +167,8 @@ class Context:
132
167
 
133
168
  def web_url(self, target: str) -> Optional[str]:
134
169
  """The web app's URL for an address or entity id: `GRAPHCORE_WEB_URL` plus its
135
- address, or None when the deployment sets no web URL."""
136
- return self._web_base + to_address(target) if self._web_base else None
170
+ route, or None when the deployment sets no web URL."""
171
+ return self._web_base + normalized(to_route(target)) if self._web_base else None
137
172
 
138
173
  def view(self, name: str) -> Optional[AgentView]:
139
174
  """The agent view registered as `name`: an app's, else the base one."""
@@ -154,10 +189,15 @@ class Context:
154
189
  async def execute(
155
190
  self, strategy: str, target: Optional[str] = None, params: Optional[dict] = None,
156
191
  ) -> dict:
192
+ return (await self.run(strategy, target, params)).get('ret_val') or {}
193
+
194
+ async def run(self, strategy: str, target: Optional[str] = None, params: Optional[dict] = None) -> dict:
195
+ """The strategy's whole outcome; `execute` is its `ret_val`."""
157
196
  outcome = await self._client.execute(self.principal, strategy, target, params or {})
158
197
  if outcome.get('status') == 'failed':
159
- raise AgentError('Refused', f"{strategy}: {outcome.get('error')}")
160
- return outcome.get('ret_val') or {}
198
+ request = outcome.get('strategy_request_id')
199
+ raise AgentError('Refused', f"{strategy}: {outcome.get('error')}" + (f" (request {request})" if request else ''))
200
+ return outcome
161
201
 
162
202
  def place(self, target: str, full: bool = False) -> Placement:
163
203
  return Placement(to_address(target), full)
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
 
4
4
  import importlib
5
5
  import pkgutil
6
+ from functools import lru_cache
6
7
  from types import ModuleType
7
8
  from typing import Iterable
8
9
 
@@ -52,3 +53,9 @@ def load_registry(modules: Iterable[str], base: str = BASE_VIEWS) -> AgentRegist
52
53
  for view in views_in(importlib.import_module(module)):
53
54
  registry.add(view)
54
55
  return registry
56
+
57
+
58
+ @lru_cache
59
+ def cached_registry(modules: tuple[str, ...]) -> AgentRegistry:
60
+ # Loading imports the app modules, and they stay in `sys.modules`.
61
+ return load_registry(modules)
@@ -0,0 +1,81 @@
1
+ """The MCP server: three fixed tools over a `Frontend`, whichever transport reaches it.
2
+ It holds the protocol's tool definitions and instructions, and nothing about a transport."""
3
+ from __future__ import annotations
4
+
5
+ import base64
6
+ from typing import Annotated, Any, Callable, Optional
7
+
8
+ from mcp.server.mcpserver import Context, MCPServer
9
+ from mcp.server.mcpserver.exceptions import ToolError
10
+ from mcp_types import CallToolResult, ImageContent, TextContent
11
+
12
+ from graphcore.agent_frontend import tools
13
+ from graphcore.agent_frontend.errors import AgentError
14
+ from graphcore.agent_frontend.render import Frontend
15
+ from graphcore.types.identity import Principal
16
+
17
+ INSTRUCTIONS = """\
18
+ This server presents a GraphCore deployment as addressed places. Start with open("/").
19
+ Every place is a Markdown page: its content, its address, a version, and a Tools list.
20
+ - open(at): read a place. Addresses look like /, /notes, or an entity id gc://<backend>/<local>,
21
+ which is the address of that entity's place. A route with an entity in it holds its full id:
22
+ /notes/gc://<backend>/<local>/history.
23
+ - call(at, tool, params): run a tool listed under that place's Tools. A tool the place does not
24
+ list runs too when it is a strategy of the entity at that address (or, at a place with no
25
+ entity, of the deployment), named as tools are, such as create_entity; the result then says
26
+ listed: false. Pass seen_version (the version you last read) so a write based on
27
+ out-of-date content is refused.
28
+ - find(type, predicate): list entities of a type, optionally filtered by field equality.
29
+ Reads and writes run as the user you connected as.
30
+ """
31
+ WEB_INSTRUCTIONS = """\
32
+ A place's `web:` link opens the same place in the web app. To give the user a link,
33
+ use that line, opening the place first if needed; never build one from an address.
34
+ """
35
+
36
+
37
+ def _guard(coro_fn):
38
+ async def run(*args, **kwargs):
39
+ try:
40
+ return await coro_fn(*args, **kwargs)
41
+ except AgentError as exc:
42
+ raise ToolError(f"{exc.code}: {exc.message}")
43
+ return run
44
+
45
+
46
+ def build_server(
47
+ fe: Frontend, principal_of: Callable[[Context], Principal],
48
+ execute_url_of: Callable[[Context], str] = lambda ctx: '',
49
+ ) -> MCPServer:
50
+ """``principal_of`` and ``execute_url_of`` are what a transport supplies for each
51
+ call: who is calling, and the URL a strategy token's requests go to."""
52
+ mcp = MCPServer('graphcore', instructions=INSTRUCTIONS + (WEB_INSTRUCTIONS if fe.web_url else ''))
53
+
54
+ @mcp.tool(description='Read a place. Returns Markdown with its address, version and Tools.')
55
+ async def open(at: str, ctx: Context, version: Optional[str] = None) -> str:
56
+ return await _guard(tools.open_)(fe, principal_of(ctx), at, version)
57
+
58
+ @mcp.tool(description='List entities of a type; predicate maps field to a value or a list of values.')
59
+ async def find(type: str, ctx: Context, predicate: Optional[dict[str, Any]] = None, limit: int = 25) -> str:
60
+ return await _guard(tools.find)(fe, principal_of(ctx), type, predicate, limit)
61
+
62
+ @mcp.tool(description=(
63
+ "Run a tool at a place: one its Tools list, or else a strategy of the entity it shows. "
64
+ "Pass seen_version to refuse the write if the place changed."
65
+ ))
66
+ async def call(
67
+ at: str, tool: str, ctx: Context, params: Optional[dict[str, Any]] = None,
68
+ seen_version: Optional[str] = None,
69
+ ) -> Annotated[CallToolResult, str]:
70
+ # Annotated with `str` so the output schema and structured content stay what a `-> str` tool's are.
71
+ out = await _guard(tools.call)(fe, principal_of(ctx), at, tool, params, seen_version, execute_url_of(ctx))
72
+ return CallToolResult(
73
+ content=[
74
+ TextContent(type='text', text=out.text),
75
+ *(ImageContent(type='image', data=base64.b64encode(i.data).decode(), mime_type=i.media_type)
76
+ for i in out.images),
77
+ ],
78
+ structured_content={'result': out.text},
79
+ )
80
+
81
+ return mcp
@@ -6,8 +6,11 @@ from typing import Any, Optional
6
6
 
7
7
  from graphcore.agent_frontend import signatures
8
8
  from graphcore.agent_frontend.api import AgentView, ToolSpec
9
+ from graphcore.agent_frontend.base.views import deployment_tools, type_tools
9
10
  from graphcore.agent_frontend.client import GraphClient
10
- from graphcore.agent_frontend.context import DEFAULT_QUERY_MAX, Context, Placement, Reads, label_of
11
+ from graphcore.agent_frontend.context import (
12
+ DEFAULT_QUERY_MAX, Context, Placement, Reads, label_of, normalized, to_agent, to_route,
13
+ )
11
14
  from graphcore.agent_frontend.errors import AgentError, RenderTooLarge
12
15
  from graphcore.agent_frontend.registry import AgentRegistry
13
16
  from graphcore.errors import NotFound
@@ -36,11 +39,13 @@ class ResolvedTool:
36
39
  description: Optional[str]
37
40
  schema: dict
38
41
  spec: ToolSpec
42
+ read_only: bool = False
39
43
 
40
44
  @property
41
45
  def signature(self) -> str:
42
46
  return signatures.signature(
43
47
  self.name, self.schema, self.description, target_param=self.takes_target,
48
+ read_only=self.read_only,
44
49
  )
45
50
 
46
51
  @property
@@ -63,6 +68,7 @@ class Rendered:
63
68
  version: str
64
69
  tools: list[ResolvedTool]
65
70
  entity: Any
71
+ reads: Reads
66
72
 
67
73
 
68
74
  @dataclass
@@ -71,6 +77,8 @@ class _Body:
71
77
  text: str
72
78
  tools: list[ResolvedTool]
73
79
  entity: Any
80
+ address: str
81
+ route: str
74
82
 
75
83
 
76
84
  def _one_line(description: Optional[str]) -> Optional[str]:
@@ -107,7 +115,7 @@ async def _tools(fe: Frontend, ctx: Context, view: AgentView, entity: Any) -> li
107
115
  resolved: dict[str, ResolvedTool] = {}
108
116
  for spec in specs:
109
117
  if spec.fn is not None:
110
- tool = ResolvedTool(spec.name, spec.description, spec.schema or {}, spec)
118
+ tool = ResolvedTool(spec.name, spec.description, spec.schema or {}, spec, spec.read_only)
111
119
  else:
112
120
  if spec.strategy not in info:
113
121
  continue
@@ -125,16 +133,34 @@ async def _tools(fe: Frontend, ctx: Context, view: AgentView, entity: Any) -> li
125
133
  schema = {'type': 'object', 'properties': {}}
126
134
  else:
127
135
  description, schema = strategy.get('description'), strategy.get('schema') or {}
128
- tool = ResolvedTool(spec.name, spec.description or _one_line(description), schema, spec)
136
+ tool = ResolvedTool(
137
+ spec.name, spec.description or _one_line(description), schema, spec,
138
+ bool(strategy.get('read_only')) and not spec.from_shell,
139
+ )
129
140
  resolved.setdefault(tool.name, tool)
130
141
  return list(resolved.values())
131
142
 
132
143
 
133
- async def _label_line(fe: Frontend, ctx: Context, address: str) -> Optional[str]:
144
+ async def unlisted_tools(fe: Frontend, principal: Principal, rendered: Rendered) -> list[ResolvedTool]:
145
+ """What the built-in view would list at `rendered`: every strategy of its entity's type,
146
+ or, at a place with no entity, the deployment's untargeted strategies."""
147
+ view =AgentView('unlisted', _placeholder, tools=type_tools if rendered.entity is not None else deployment_tools)
148
+ ctx = Context(principal, rendered.address, rendered.entity, fe.client, Reads(), fe.registry, fe.query_max, fe.web_url)
149
+ return await _tools(fe, ctx, view, rendered.entity)
150
+
151
+
152
+ def _resolve(fe: Frontend, address: str) -> tuple[str, str, dict]:
153
+ """`address`, in any form, as its route, as the agent writes it, and resolved."""
154
+ route = normalized(to_route(address))
134
155
  try:
135
- resolved = fe.client.resolve(address)
156
+ resolved = fe.client.resolve(route)
136
157
  except NotFound:
137
158
  raise AgentError('NotFound', f"no route matches {address!r}; start from open('/')")
159
+ return route, to_agent(route, resolved['entity_id']), resolved
160
+
161
+
162
+ async def _label_line(fe: Frontend, ctx: Context, address: str) -> Optional[str]:
163
+ _, address, resolved = _resolve(fe, address)
138
164
  if resolved['entity_id'] is None:
139
165
  return f"- {resolved['view_name']} · {address}"
140
166
  entity = await ctx.get(resolved['entity_id'])
@@ -163,9 +189,9 @@ async def _expand(
163
189
  flush()
164
190
  child = await _render_body(fe, principal, part.address, reads, stack)
165
191
  if child.entity is not None:
166
- heading = f"### {label_of(child.entity)} · {child.entity.entity_type_id} · {part.address}"
192
+ heading = f"### {label_of(child.entity)} · {child.entity.entity_type_id} · {child.address}"
167
193
  else:
168
- heading = f"### {child.title} · {part.address}"
194
+ heading = f"### {child.title} · {child.address}"
169
195
  blocks.append(f"{heading}\n{child.text}")
170
196
  else:
171
197
  flush()
@@ -178,32 +204,30 @@ async def _render_body(
178
204
  fe: Frontend, principal: Principal, address: str, reads: Reads, stack: tuple = (),
179
205
  with_tools: bool = False,
180
206
  ) -> _Body:
181
- if address in stack:
207
+ route, address, resolved = _resolve(fe, address)
208
+ if route in stack:
182
209
  raise RenderTooLarge(address, ': full placements form a cycle')
183
- try:
184
- resolved = fe.client.resolve(address)
185
- except NotFound:
186
- raise AgentError('NotFound', f"no route matches {address!r}; start from open('/')")
187
210
  ctx = Context(principal, address, None, fe.client, reads, fe.registry, fe.query_max, fe.web_url)
188
211
  view, entity = await _choose(fe, ctx, resolved['view_name'], resolved['entity_id'])
189
212
  ctx.entity = entity
190
213
  result = await (view.fn(ctx, entity) if entity is not None else view.fn(ctx))
191
214
  parts = result if isinstance(result, list) else [result]
192
- text = await _expand(fe, principal, ctx, parts, reads, stack + (address,))
215
+ text = await _expand(fe, principal, ctx, parts, reads, stack + (route,))
193
216
  title = (
194
217
  f"{label_of(entity)} · {entity.entity_type_id}" if entity is not None
195
218
  else ('Home' if resolved['view_name'] == 'home' else resolved['view_name'])
196
219
  )
197
220
  tools = await _tools(fe, ctx, view, entity) if with_tools else []
198
- return _Body(title, text, tools, entity)
221
+ return _Body(title, text, tools, entity, address, route)
199
222
 
200
223
 
201
224
  async def render(fe: Frontend, principal: Principal, address: str) -> Rendered:
202
- address = '/' + address.strip('/') if address.strip('/') else '/'
225
+ """The place at `address`: an entity id, a route, or a route with an entity id in it."""
203
226
  reads = Reads()
204
227
  body = await _render_body(fe, principal, address, reads, with_tools=True)
228
+ address = body.address
205
229
  version = reads.version()
206
- web = f"web: {fe.web_url}{address} · " if fe.web_url else ''
230
+ web = f"web: {fe.web_url}{body.route} · " if fe.web_url else ''
207
231
  out = [f"# {body.title}", f"address: {address} · {web}version: {version}"]
208
232
  if body.text:
209
233
  out.append('\n' + body.text)
@@ -212,4 +236,4 @@ async def render(fe: Frontend, principal: Principal, address: str) -> Rendered:
212
236
  text = '\n'.join(out)
213
237
  if len(text) > fe.max_chars:
214
238
  raise RenderTooLarge(address, f" ({len(text)} characters; the limit is {fe.max_chars})")
215
- return Rendered(address, text, version, body.tools, body.entity)
239
+ return Rendered(address, text, version, body.tools, body.entity, reads)
@@ -0,0 +1,66 @@
1
+ """The MCP server's HTTP transport: stateless Streamable HTTP, bearer-authenticated."""
2
+ from __future__ import annotations
3
+
4
+ from typing import Callable, Sequence
5
+
6
+ from mcp.server.mcpserver import Context
7
+ from mcp.server.transport_security import TransportSecuritySettings
8
+ from starlette.middleware.cors import CORSMiddleware
9
+ from starlette.responses import JSONResponse
10
+
11
+ from graphcore.agent_frontend.client import GraphClient
12
+ from graphcore.agent_frontend.mcp_server import build_server
13
+ from graphcore.agent_frontend.render import Frontend
14
+ from graphcore.errors import IssuerUnavailable
15
+
16
+
17
+ def _principal(ctx: Context):
18
+ return ctx.request_context.request.state.principal
19
+
20
+
21
+ class _BearerAuth:
22
+ def __init__(self, app, client: GraphClient, challenge: Callable[[dict], str]):
23
+ self.app = app
24
+ self.client = client
25
+ self.challenge = challenge
26
+
27
+ async def __call__(self, scope, receive, send):
28
+ if scope['type'] != 'http':
29
+ return await self.app(scope, receive, send)
30
+ headers = dict(scope['headers'])
31
+ value = headers.get(b'authorization', b'').decode()
32
+ scheme, _, token = value.partition(' ')
33
+ try:
34
+ principal = await self.client.authenticate(token) if scheme.lower() == 'bearer' else None
35
+ except IssuerUnavailable as exc:
36
+ response = JSONResponse(exc.to_dict(), 503, {'Retry-After': str(exc.retry_after_seconds)})
37
+ return await response(scope, receive, send)
38
+ if principal is None:
39
+ response = JSONResponse({'error': 'unauthorized'}, 401, {'WWW-Authenticate': self.challenge(scope)})
40
+ return await response(scope, receive, send)
41
+ scope.setdefault('state', {})['principal'] = principal
42
+ await self.app(scope, receive, send)
43
+
44
+
45
+ def create_app(
46
+ frontend: Frontend, path: str = '/mcp', allowed_origins: Sequence[str] = (),
47
+ challenge: Callable[[dict], str] = lambda scope: 'Bearer',
48
+ execute_url: Callable[[dict], str] = lambda scope: '',
49
+ ):
50
+ """``challenge`` builds the 401's ``WWW-Authenticate`` value from the ASGI scope;
51
+ ``execute_url`` builds, from the ASGI scope, the URL a strategy token's requests go to."""
52
+ mcp = build_server(frontend, _principal, lambda ctx: execute_url(ctx.request_context.request.scope))
53
+ app = mcp.streamable_http_app(
54
+ streamable_http_path=path, stateless_http=True, json_response=True,
55
+ # Rebinding protection is off: the SDK default allows only localhost Hosts, and the bearer token gates access. TODO: configurable allowed hosts.
56
+ transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False),
57
+ )
58
+ served = _BearerAuth(app, frontend.client, challenge)
59
+ if allowed_origins:
60
+ # Outside the bearer check: a browser's preflight carries no token.
61
+ served = CORSMiddleware(
62
+ served, allow_origins=list(allowed_origins), allow_methods=['GET', 'POST', 'DELETE'],
63
+ allow_headers=['authorization', 'mcp-protocol-version'], expose_headers=['mcp-session-id', 'www-authenticate'],
64
+ )
65
+ served.mcp_app = app
66
+ return served
@@ -30,6 +30,9 @@ def params(schema: Optional[dict], target_param: bool = False) -> str:
30
30
  return ', '.join(parts)
31
31
 
32
32
 
33
- def signature(name: str, schema: Optional[dict], description: Optional[str], target_param: bool = False) -> str:
34
- line = f"{name}({params(schema, target_param)})"
33
+ def signature(
34
+ name: str, schema: Optional[dict], description: Optional[str], target_param: bool = False,
35
+ read_only: bool = False,
36
+ ) -> str:
37
+ line = f"{name}({params(schema, target_param)})" + (' (read)' if read_only else '')
35
38
  return f"{line} — {description}" if description else line
@@ -5,13 +5,9 @@ from __future__ import annotations
5
5
 
6
6
  import json
7
7
  from dataclasses import dataclass
8
- from functools import lru_cache
9
8
  from typing import Optional
10
9
 
11
10
  from graphcore.agent_frontend import tools
12
- from graphcore.agent_frontend.context import to_address
13
- from graphcore.agent_frontend.loading import load_registry
14
- from graphcore.agent_frontend.registry import AgentRegistry
15
11
  from graphcore.agent_frontend.render import Frontend, render
16
12
  from graphcore.types.identity import Principal
17
13
 
@@ -27,14 +23,8 @@ class Place:
27
23
  tools: tuple[str, ...]
28
24
 
29
25
 
30
- @lru_cache
31
- def cached_registry(modules: tuple[str, ...]) -> AgentRegistry:
32
- # Loading imports the app modules, and they stay in `sys.modules`.
33
- return load_registry(modules)
34
-
35
-
36
26
  async def open_place(fe: Frontend, principal: Principal, at: str) -> Place:
37
- rendered = await render(fe, principal, to_address(at))
27
+ rendered = await render(fe, principal, at)
38
28
  return Place(rendered.address, rendered.text, rendered.version, tuple(t.name for t in rendered.tools))
39
29
 
40
30
 
@@ -42,5 +32,5 @@ async def call_tool(
42
32
  fe: Frontend, principal: Principal, at: str, tool: str, params: Optional[dict] = None,
43
33
  seen_version: Optional[str] = None, execute_url: str = '',
44
34
  ) -> dict:
45
- out = await tools.call(fe, principal, to_address(at), tool, params, seen_version, execute_url)
35
+ out = await tools.call(fe, principal, at, tool, params, seen_version, execute_url)
46
36
  return {**json.loads(out.text), 'images': list(out.images)}