jayrun 0.2.0__tar.gz → 0.3.1__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.
- jayrun-0.3.1/CHANGELOG.md +173 -0
- jayrun-0.3.1/MANIFEST.in +24 -0
- jayrun-0.3.1/PKG-INFO +164 -0
- jayrun-0.3.1/README.md +131 -0
- jayrun-0.3.1/jayrun/__init__.py +59 -0
- jayrun-0.3.1/jayrun/authority.py +48 -0
- jayrun-0.3.1/jayrun/context.py +109 -0
- jayrun-0.3.1/jayrun/core/artifact/context.py +197 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/artifact/field.py +3 -2
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/artifact/properties.py +9 -1
- jayrun-0.3.1/jayrun/core/config/context.py +358 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/config/field.py +8 -20
- jayrun-0.3.1/jayrun/core/config/values.py +63 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/context/base.py +13 -0
- jayrun-0.3.1/jayrun/core/graph/_identity.py +159 -0
- jayrun-0.3.1/jayrun/core/graph/_specifier_compat.py +120 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/artifact_flow.py +59 -21
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/compiled_graph.py +3 -0
- jayrun-0.3.1/jayrun/core/graph/declaration_report.py +193 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/definition/__init__.py +2 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/definition/artifact.py +5 -1
- jayrun-0.3.1/jayrun/core/graph/definition/serializer.py +16 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/graph_definition.py +369 -62
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/graph_layout.py +29 -2
- jayrun-0.3.1/jayrun/core/graph/graph_registry.py +201 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/graph_specification.py +120 -21
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/inspection/artifact.py +20 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/inspection/graph.py +35 -17
- jayrun-0.3.1/jayrun/core/graph/inspection/registry.py +188 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/inspection/requirement.py +23 -3
- jayrun-0.3.1/jayrun/core/graph/inspection/resource.py +114 -0
- jayrun-0.3.1/jayrun/core/graph/inspection/serializer.py +76 -0
- jayrun-0.3.1/jayrun/core/graph/registry/config.py +16 -0
- jayrun-0.3.1/jayrun/core/graph/reporting.py +332 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/requirements.py +4 -12
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/operator/base.py +19 -4
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/resource/base.py +11 -2
- jayrun-0.3.1/jayrun/core/serializer/__init__.py +3 -0
- jayrun-0.3.1/jayrun/core/serializer/base.py +62 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/validation/__init__.py +2 -4
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/validation/graph.py +30 -2
- jayrun-0.3.1/jayrun/core/validation/plotting.py +7 -0
- jayrun-0.2.0/jayrun/core/validation/validator.py → jayrun-0.3.1/jayrun/core/validation/validation.py +21 -28
- jayrun-0.3.1/jayrun/dashboard/__init__.py +4 -0
- jayrun-0.3.1/jayrun/dashboard/_client.py +682 -0
- jayrun-0.3.1/jayrun/dashboard/_evidence.py +281 -0
- jayrun-0.3.1/jayrun/dashboard/_graph.py +122 -0
- jayrun-0.3.1/jayrun/dashboard/_history.py +383 -0
- jayrun-0.3.1/jayrun/dashboard/_location.py +23 -0
- jayrun-0.3.1/jayrun/dashboard/_observation.py +206 -0
- jayrun-0.3.1/jayrun/dashboard/_page.py +9 -0
- jayrun-0.3.1/jayrun/dashboard/_service.py +602 -0
- jayrun-0.3.1/jayrun/dashboard/_style.py +4 -0
- jayrun-0.3.1/jayrun/dashboard/_workspace.py +792 -0
- jayrun-0.3.1/jayrun/engine/_capture_values.py +201 -0
- jayrun-0.3.1/jayrun/engine/_history.py +712 -0
- jayrun-0.3.1/jayrun/engine/_timing.py +225 -0
- jayrun-0.3.1/jayrun/engine/api.py +463 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/artifact/result.py +3 -3
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/artifact/store.py +22 -5
- jayrun-0.3.1/jayrun/engine/base/runtime_module.py +35 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/context_manager.py +50 -6
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/context_outcome.py +2 -2
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/execution_context.py +134 -15
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/execution_proxy.py +3 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/execution_session.py +33 -1
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context_run.py +138 -59
- jayrun-0.3.1/jayrun/engine/coordinator/coordinator.py +343 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/coordinator/message_queue.py +17 -5
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/coordinator/runtime_loop.py +63 -9
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/execution/async_executor.py +30 -8
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/execution/executor_manager.py +27 -12
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/execution/thread_executor.py +1 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/gateway/engine_gateway.py +7 -0
- jayrun-0.3.1/jayrun/engine/history_budget.py +76 -0
- jayrun-0.3.1/jayrun/engine/interfaces/base.py +42 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/interfaces/context.py +11 -19
- jayrun-0.3.1/jayrun/engine/interfaces/context_record.py +142 -0
- jayrun-0.3.1/jayrun/engine/interfaces/runtime.py +258 -0
- jayrun-0.3.1/jayrun/engine/interfaces/services/accesses.py +44 -0
- jayrun-0.3.1/jayrun/engine/interfaces/services/context.py +35 -0
- jayrun-0.3.1/jayrun/engine/interfaces/services/control.py +83 -0
- jayrun-0.3.1/jayrun/engine/interfaces/services/storage.py +188 -0
- jayrun-0.3.1/jayrun/engine/limits.py +16 -0
- jayrun-0.3.1/jayrun/engine/messages/capability.py +5 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/abort_context.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/apply_snapshot.py +14 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/pause_context.py +11 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/reconcile_contexts.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/record_context.py +9 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/resume_context.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/retrieve_session.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/shutdown_runtime.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/start_context.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/stop_context.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/commands/transfer_context.py +9 -0
- jayrun-0.3.1/jayrun/engine/messages/events/context_admitted.py +8 -0
- jayrun-0.3.1/jayrun/engine/messages/events/context_registered.py +9 -0
- jayrun-0.3.1/jayrun/engine/messages/events/context_terminated.py +10 -0
- jayrun-0.3.1/jayrun/engine/messages/events/runtime_idle.py +8 -0
- jayrun-0.2.0/jayrun/engine/registry/identities.py → jayrun-0.3.1/jayrun/engine/messages/origin.py +7 -17
- jayrun-0.3.1/jayrun/engine/messages/runtime_message.py +37 -0
- jayrun-0.3.1/jayrun/engine/messages/runtime_messenger.py +566 -0
- jayrun-0.3.1/jayrun/engine/observation.py +422 -0
- jayrun-0.3.1/jayrun/engine/pressure.py +37 -0
- jayrun-0.3.1/jayrun/engine/progress.py +560 -0
- jayrun-0.3.1/jayrun/engine/progress_history.py +546 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/recorder.py +14 -2
- jayrun-0.3.1/jayrun/engine/recorders/context/recorder.py +129 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/context/report.py +5 -2
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/execution/recorder.py +25 -1
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/execution/records.py +8 -1
- jayrun-0.3.1/jayrun/engine/registry/context_id_generator.py +10 -0
- jayrun-0.3.1/jayrun/engine/registry/context_instance.py +1288 -0
- jayrun-0.3.1/jayrun/engine/registry/context_state.py +71 -0
- jayrun-0.3.1/jayrun/engine/registry/context_status.py +198 -0
- jayrun-0.3.1/jayrun/engine/registry/runtime_registry.py +2513 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/placement_controller.py +41 -15
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/resource_manager.py +2 -1
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/runtime.py +39 -5
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/scheduler/context.py +27 -29
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/scheduler/memory.py +6 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/settings/__init__.py +6 -2
- jayrun-0.3.1/jayrun/engine/settings/_instrumentation.py +42 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/settings/combined_context.py +18 -6
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/settings/context.py +31 -20
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/settings/engine.py +77 -13
- jayrun-0.3.1/jayrun/engine/snapshot.py +168 -0
- jayrun-0.3.1/jayrun/engine/submission.py +247 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/supervisor.py +214 -88
- jayrun-0.3.1/jayrun/engine/terminal_history.py +180 -0
- jayrun-0.3.1/jayrun/inspection.py +42 -0
- jayrun-0.3.1/jayrun/persistence/__init__.py +25 -0
- jayrun-0.3.1/jayrun/persistence/_database.py +1114 -0
- jayrun-0.3.1/jayrun/persistence/_sqlite.py +832 -0
- jayrun-0.3.1/jayrun/persistence/backend.py +283 -0
- jayrun-0.3.1/jayrun/persistence/errors.py +31 -0
- jayrun-0.3.1/jayrun/persistence/legacy.py +381 -0
- jayrun-0.3.1/jayrun/persistence/policy.py +96 -0
- jayrun-0.3.1/jayrun/persistence/records.py +449 -0
- jayrun-0.3.1/jayrun/persistence/values.py +465 -0
- jayrun-0.3.1/jayrun/registry.py +17 -0
- jayrun-0.3.1/jayrun/reporting/__init__.py +1 -0
- jayrun-0.3.1/jayrun/reporting/_completed.py +360 -0
- jayrun-0.3.1/jayrun/reporting/_history.py +159 -0
- jayrun-0.3.1/jayrun/serialization.py +157 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/settings.py +6 -2
- jayrun-0.3.1/jayrun/validation.py +33 -0
- jayrun-0.3.1/jayrun/visualization/__init__.py +5 -0
- jayrun-0.3.1/jayrun/visualization/_copy.js +31 -0
- jayrun-0.3.1/jayrun/visualization/_facade.py +23 -0
- jayrun-0.3.1/jayrun/visualization/_help/__init__.py +10 -0
- jayrun-0.3.1/jayrun/visualization/_help/content.js +111 -0
- jayrun-0.3.1/jayrun/visualization/_help/controller.js +208 -0
- jayrun-0.3.1/jayrun/visualization/_help/style.css +11 -0
- jayrun-0.3.1/jayrun/visualization/_legacy.py +108 -0
- jayrun-0.3.1/jayrun/visualization/_run.js +137 -0
- jayrun-0.3.1/jayrun/visualization/_segments.py +44 -0
- jayrun-0.3.1/jayrun/visualization/_theme.css +36 -0
- jayrun-0.3.1/jayrun/visualization/_workspace.css +298 -0
- jayrun-0.3.1/jayrun/visualization/_workspace.js +233 -0
- jayrun-0.3.1/jayrun/visualization/_workspace.py +22 -0
- jayrun-0.3.1/jayrun/visualization/adapters/__init__.py +1 -0
- jayrun-0.3.1/jayrun/visualization/adapters/_legacy_history.py +102 -0
- jayrun-0.3.1/jayrun/visualization/adapters/_requirements.py +54 -0
- jayrun-0.3.1/jayrun/visualization/adapters/completed.py +64 -0
- jayrun-0.3.1/jayrun/visualization/adapters/definition.py +627 -0
- jayrun-0.3.1/jayrun/visualization/adapters/history.py +105 -0
- jayrun-0.3.1/jayrun/visualization/adapters/live.py +13 -0
- jayrun-0.3.1/jayrun/visualization/adapters/registry.py +51 -0
- jayrun-0.3.1/jayrun/visualization/colors.py +11 -0
- jayrun-0.3.1/jayrun/visualization/contract.py +426 -0
- jayrun-0.3.1/jayrun/visualization/layout.py +300 -0
- jayrun-0.3.1/jayrun/visualization/renderer.py +120 -0
- jayrun-0.3.1/jayrun/visualization/viewer.css +645 -0
- jayrun-0.3.1/jayrun/visualization/viewer.js +1394 -0
- jayrun-0.3.1/jayrun.egg-info/PKG-INFO +164 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun.egg-info/SOURCES.txt +89 -6
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun.egg-info/requires.txt +1 -2
- {jayrun-0.2.0 → jayrun-0.3.1}/pyproject.toml +6 -3
- jayrun-0.2.0/MANIFEST.in +0 -7
- jayrun-0.2.0/PKG-INFO +0 -157
- jayrun-0.2.0/README.md +0 -123
- jayrun-0.2.0/jayrun/__init__.py +0 -32
- jayrun-0.2.0/jayrun/context.py +0 -16
- jayrun-0.2.0/jayrun/core/artifact/context.py +0 -161
- jayrun-0.2.0/jayrun/core/config/context.py +0 -248
- jayrun-0.2.0/jayrun/core/graph/registry/config.py +0 -7
- jayrun-0.2.0/jayrun/core/validation/plotting.py +0 -222
- jayrun-0.2.0/jayrun/core/validation/reporting.py +0 -57
- jayrun-0.2.0/jayrun/engine/api.py +0 -258
- jayrun-0.2.0/jayrun/engine/base/runtime_module.py +0 -21
- jayrun-0.2.0/jayrun/engine/coordinator/coordinator.py +0 -191
- jayrun-0.2.0/jayrun/engine/interfaces/base.py +0 -59
- jayrun-0.2.0/jayrun/engine/interfaces/runtime.py +0 -64
- jayrun-0.2.0/jayrun/engine/interfaces/services/accesses.py +0 -22
- jayrun-0.2.0/jayrun/engine/interfaces/services/context.py +0 -32
- jayrun-0.2.0/jayrun/engine/interfaces/services/control.py +0 -48
- jayrun-0.2.0/jayrun/engine/interfaces/services/storage.py +0 -29
- jayrun-0.2.0/jayrun/engine/interfaces/value_record.py +0 -26
- jayrun-0.2.0/jayrun/engine/messages/commands/abort_context.py +0 -14
- jayrun-0.2.0/jayrun/engine/messages/commands/pause_context.py +0 -27
- jayrun-0.2.0/jayrun/engine/messages/commands/reconcile_contexts.py +0 -10
- jayrun-0.2.0/jayrun/engine/messages/commands/resume_context.py +0 -14
- jayrun-0.2.0/jayrun/engine/messages/commands/retrieve_session.py +0 -20
- jayrun-0.2.0/jayrun/engine/messages/commands/shutdown_runtime.py +0 -15
- jayrun-0.2.0/jayrun/engine/messages/commands/start_context.py +0 -18
- jayrun-0.2.0/jayrun/engine/messages/commands/stop_context.py +0 -14
- jayrun-0.2.0/jayrun/engine/messages/commands/store_value.py +0 -19
- jayrun-0.2.0/jayrun/engine/messages/events/context_admitted.py +0 -20
- jayrun-0.2.0/jayrun/engine/messages/events/context_registered.py +0 -30
- jayrun-0.2.0/jayrun/engine/messages/events/context_terminated.py +0 -25
- jayrun-0.2.0/jayrun/engine/messages/events/runtime_idle.py +0 -14
- jayrun-0.2.0/jayrun/engine/messages/runtime_message.py +0 -43
- jayrun-0.2.0/jayrun/engine/messages/runtime_messenger.py +0 -83
- jayrun-0.2.0/jayrun/engine/recorders/context/recorder.py +0 -77
- jayrun-0.2.0/jayrun/engine/registry/context_id_generator.py +0 -9
- jayrun-0.2.0/jayrun/engine/registry/context_instance.py +0 -637
- jayrun-0.2.0/jayrun/engine/registry/context_state.py +0 -52
- jayrun-0.2.0/jayrun/engine/registry/context_status.py +0 -116
- jayrun-0.2.0/jayrun/engine/registry/runtime_registry.py +0 -692
- jayrun-0.2.0/jayrun/validation.py +0 -5
- jayrun-0.2.0/jayrun.egg-info/PKG-INFO +0 -157
- {jayrun-0.2.0 → jayrun-0.3.1}/LICENSE +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/NOTICE +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/artifact/base.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/base/error.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/context/runtime_data.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/declaration/field.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/definition/data.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/definition/field.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/definition/requirement.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/graph_component.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/graph_state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/inspection/field.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/operator_reference.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/registry/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/registry/artifact.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/registry/data.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/registry/field.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/graph/registry/resource.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/resource/context.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/resource/field.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/core/validation/artifact.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/artifact/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/artifact/actor.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/artifact/state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/execution_state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/execution_step.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/execution_tracker.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/resource_key.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/context/step_reference.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/coordinator/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/coordinator/batch_size_estimator.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/coordinator/state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/coordinator/timeout_estimator.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/engine_state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/execution/execution_mode.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/interfaces/execution.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/interfaces/placement.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/messages/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/messages/commands/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/messages/events/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/artifact_state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/debug_recorder.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/production_recorder.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/record.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/artifact/state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/context/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/context/debug_recorder.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/context/production_recorder.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/context/state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/execution/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/execution/debug_recorder.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/execution/production_recorder.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/recorders/execution/state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/registry/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/__init__.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/cached_resource.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/device_allocator.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/placement.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/placement_request.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/engine/resource/resource_state.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/placement.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/properties.py +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun/py.typed +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun.egg-info/dependency_links.txt +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/jayrun.egg-info/top_level.txt +0 -0
- {jayrun-0.2.0 → jayrun-0.3.1}/setup.cfg +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Jayrun are documented in this file.
|
|
4
|
+
|
|
5
|
+
Release notes describe new capabilities, compatibility changes and fixes.
|
|
6
|
+
|
|
7
|
+
## [0.3.1] - 2026-11-17
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `EngineSettings.controller_policy` with `ControllerPolicy.HOST_ONLY` (default)
|
|
12
|
+
and `ControllerPolicy.DELEGATED`, available from `jayrun.settings`.
|
|
13
|
+
- With `DELEGATED`, live Controllers can submit child Controller and Supervisor
|
|
14
|
+
workflows. Child Controllers may submit further workflows with authority.
|
|
15
|
+
- Controllers can submit newly constructed, confirmed `GraphDefinition` objects
|
|
16
|
+
directly without a graph registry, as well as registered graph identities.
|
|
17
|
+
|
|
18
|
+
- Optional graph `name` and `description`, preserved without changing structural
|
|
19
|
+
graph identity.
|
|
20
|
+
- Structured declaration reports through `graph.report.to_dict()` and
|
|
21
|
+
`graph.report.to_json()`, using schema `jayrun.declaration/1`. Reports preserve
|
|
22
|
+
authored intent, component references, bindings and construction limitations.
|
|
23
|
+
- A separate **Export declaration report** action in confirmed graph viewers,
|
|
24
|
+
including registry and captured dashboard views. The download preserves the
|
|
25
|
+
report JSON exactly, including integers outside JavaScript's safe range.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `self.runtime.submit(graph, artifacts, configs, settings=..., authority=...)`
|
|
30
|
+
now matches `Engine.submit()` arguments and validation rules. A configured
|
|
31
|
+
registry still requires submitted graph objects to be registered.
|
|
32
|
+
- Controller guides and API references explain delegated submission, child
|
|
33
|
+
lifetimes, explicit history grants, routing and capacity requirements.
|
|
34
|
+
- Engine history settings include the selected `controller_policy`.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Owned Engine startup now bounds loop initialization and cross-thread readiness
|
|
39
|
+
acknowledgement to five seconds, with bounded failure cleanup. External event
|
|
40
|
+
loop ownership is unchanged; this is not a deadline for the entire start call.
|
|
41
|
+
- Graph viewers display authored graph names/descriptions and support long
|
|
42
|
+
descriptions within their aggregate export bounds.
|
|
43
|
+
- Legacy viewer detail strings now use safe inspection metadata, avoiding raw
|
|
44
|
+
representations that could bypass sensitive-default redaction.
|
|
45
|
+
|
|
46
|
+
### Compatibility
|
|
47
|
+
|
|
48
|
+
- Replace keyword `runtime.submit(graph_key=...)` with `runtime.submit(graph=...)`.
|
|
49
|
+
Existing positional registered-identity calls continue to work.
|
|
50
|
+
- Under `HOST_ONLY`, any non-None runtime `authority` raises `PermissionError`;
|
|
51
|
+
previously the unsupported keyword raised `TypeError`. Host authority grants
|
|
52
|
+
remain available under either policy.
|
|
53
|
+
- Ordinary contexts and Supervisors still cannot submit workflows. Supervisor
|
|
54
|
+
graph scope is unchanged. Children belong to the Engine and can outlive their
|
|
55
|
+
parent; parent-issued handles and borrowed history readers keep their existing
|
|
56
|
+
authority lifetimes.
|
|
57
|
+
- Waiting parents retain execution slots. Configure sufficient `max_tasks` and
|
|
58
|
+
`max_workers` for nested workflows. Delegation does not add automatic child
|
|
59
|
+
cancellation, deadlock prevention or a process sandbox.
|
|
60
|
+
|
|
61
|
+
- Text reports and existing viewer/execution exports remain available. Declaration
|
|
62
|
+
JSON requires a confirmed graph and does not include operator implementations,
|
|
63
|
+
submitted values or execution evidence. Missing construction information and
|
|
64
|
+
redacted defaults are explicit; no automatic reconstruction or importer is added.
|
|
65
|
+
- Existing aggregate viewer and dashboard capture limits still apply. Regenerate
|
|
66
|
+
old HTML exports to include declaration reports; history-only snapshots without
|
|
67
|
+
a captured report cannot supply one.
|
|
68
|
+
|
|
69
|
+
## [0.3.0] - 2026-09-28
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- SQLite-backed execution/session history, bounded retention, explicit flush and
|
|
74
|
+
scoped historical readers through `jayrun.persistence`.
|
|
75
|
+
- Portable configuration and ContextRecord codecs through `jayrun.serialization`.
|
|
76
|
+
- Public inspection, report and lifecycle types organized into documented facades.
|
|
77
|
+
- Interactive definition, registry and completed-run viewers, plus a dashboard
|
|
78
|
+
with consistent themes and an offline documentation preview.
|
|
79
|
+
- A rebuilt manual, runnable examples and seven application tutorials with
|
|
80
|
+
matching Python sources and notebooks.
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- Graphs require explicit `graph.confirm()` after binding resources and serializers.
|
|
85
|
+
Confirmation validates and freezes preparation; invalid graphs remain inspectable.
|
|
86
|
+
- Submit with `engine.submit(graph, artifacts, configs, settings=...)`. ArtifactContext
|
|
87
|
+
and ConfigContext are value builders rather than graph-bound submission wrappers.
|
|
88
|
+
- One `EngineSettings.failure_mode` governs execution and owned persistence.
|
|
89
|
+
Standalone Database operations remain strict; use explicit flush to check settlement.
|
|
90
|
+
- Configuration accepts bounded immutable built-in values; use a string such as
|
|
91
|
+
`"float32"` instead of a Python/library object such as `torch.float32`.
|
|
92
|
+
- Settings are keyword-only. RecordingMode, engine_id, unfinished_contexts and
|
|
93
|
+
database methods with an `_async` suffix use consistent terminology.
|
|
94
|
+
- `ArtifactPolicy(retained_artifacts=None)` retains eligible exits, `()` retains
|
|
95
|
+
none, and a tuple selects declared exits. Retention does not cap total process RSS.
|
|
96
|
+
- Strengthened operator-output handling, failure-reference cleanup and lifecycle
|
|
97
|
+
qualification. Simplified public imports and updated all published examples.
|
|
98
|
+
|
|
99
|
+
### Compatibility
|
|
100
|
+
|
|
101
|
+
0.3.0 includes breaking changes from 0.2.0. For example:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
# 0.2: graph-bound builders, inferred graph at submission
|
|
105
|
+
artifacts = ArtifactContext(graph=graph)
|
|
106
|
+
configs = ConfigContext(graph=graph)
|
|
107
|
+
run = engine.submit(artifacts, configs)
|
|
108
|
+
|
|
109
|
+
# 0.3: prepare explicitly, then submit the graph and value builders
|
|
110
|
+
# Bind required resources/serializers before confirming.
|
|
111
|
+
graph.confirm()
|
|
112
|
+
artifacts = ArtifactContext({source: value})
|
|
113
|
+
configs = ConfigContext({operator.factor: 3})
|
|
114
|
+
run = engine.submit(graph, artifacts, configs)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Replace `ArtifactContext.clear_entries()` with `clear()`. Builder validation occurs
|
|
118
|
+
at submission; retired no-argument builder `validate()` methods and public compiled
|
|
119
|
+
plan/layout access are removed. BaseOperator construction is unchanged. Component
|
|
120
|
+
identity versions remain independent of the package version.
|
|
121
|
+
|
|
122
|
+
History is bounded diagnostic evidence, not automatic application checkpointing or
|
|
123
|
+
an exactly-once event archive. Concurrency, placement and cooperative shutdown retain
|
|
124
|
+
their documented limits. See the [current manual](https://jayrun.readthedocs.io/en/latest/)
|
|
125
|
+
for supported imports, complete examples and operational limits.
|
|
126
|
+
|
|
127
|
+
## [0.2.0] - 2026-09-01
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
|
|
131
|
+
- Added `ContextRun`, a stable object for observing and controlling one submitted context throughout its lifecycle.
|
|
132
|
+
- Added synchronous and asynchronous waiting through `ContextRun.wait()`, `ContextRun.wait_async()`, `Engine.wait()`, and `Engine.wait_async()`; a run can also be awaited directly.
|
|
133
|
+
- Added terminal artifact access through `ContextRun.artifact()` and terminal reporting through `ContextRun.report`.
|
|
134
|
+
- Added context-scoped stored-value access through `ContextRun.get_value()`, `get_values()`, `get_value_record()`, and `get_value_records()`.
|
|
135
|
+
- Added graph-scoped supervision with `Engine.submit(..., supervises=...)`. Supervisors see only runs belonging to the exact graph objects they are authorized to supervise.
|
|
136
|
+
- Added authorized runtime identities and a serialized messaging path for lifecycle control and context storage across thread boundaries.
|
|
137
|
+
- Added continuous-integration checks and stricter automated documentation builds.
|
|
138
|
+
|
|
139
|
+
### Changed
|
|
140
|
+
|
|
141
|
+
- `Engine.submit()` now returns a `ContextRun` and accepts graph-bound `ArtifactContext` and `ConfigContext` objects as the submission boundary.
|
|
142
|
+
- Unified external and in-graph supervision around the same `ContextRun` observation, waiting, and control API.
|
|
143
|
+
- Unified pause, resume, stop-iteration, abort, and store requests through the runtime messaging system.
|
|
144
|
+
- Completed runs are released from the engine registry while existing `ContextRun` objects remain usable for reports, retained artifacts, and stored values.
|
|
145
|
+
- Clarified lifecycle terminology: `stop()` prevents another graph iteration, while `abort()` prevents further dispatch and drains accepted work.
|
|
146
|
+
- Strengthened context finalization, executor cleanup, placement reconciliation, and graceful and forced shutdown behavior.
|
|
147
|
+
- Expanded public docstrings and generated the API Reference from the documented public API.
|
|
148
|
+
- Revised the explanatory documentation and tutorials to use the stabilized context lifecycle and supervision APIs.
|
|
149
|
+
|
|
150
|
+
### Removed
|
|
151
|
+
|
|
152
|
+
- Removed the public `ContextSnapshot` workflow in favor of the single live-to-terminal `ContextRun` abstraction.
|
|
153
|
+
- Removed legacy split context result and status pathways superseded by `ContextRun`.
|
|
154
|
+
|
|
155
|
+
## [0.1.0] - 2026-08-28
|
|
156
|
+
|
|
157
|
+
### Added
|
|
158
|
+
|
|
159
|
+
- Initial public release.
|
|
160
|
+
- Artifact-centric computational graphs with explicit configuration and artifact contexts.
|
|
161
|
+
- Iterative graph execution and repeated operator execution.
|
|
162
|
+
- Synchronous and asynchronous operators.
|
|
163
|
+
- Shared resource lifecycle management.
|
|
164
|
+
- CPU, GPU, and multi-device placement reservations.
|
|
165
|
+
- Graph validation, inspection, and interactive plotting.
|
|
166
|
+
- Context supervision, failure handling, and coordinated shutdown.
|
|
167
|
+
|
|
168
|
+
[0.2.0]: https://github.com/jayrun-project/jayrun/compare/v0.1.0...v0.2.0
|
|
169
|
+
[0.1.0]: https://github.com/jayrun-project/jayrun/releases/tag/v0.1.0
|
|
170
|
+
|
|
171
|
+
[0.3.0]: https://github.com/jayrun-project/jayrun/compare/v0.2.0...v0.3.0
|
|
172
|
+
|
|
173
|
+
[0.3.1]: https://github.com/jayrun-project/jayrun/compare/v0.3.0...v0.3.1
|
jayrun-0.3.1/MANIFEST.in
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include NOTICE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include README.md
|
|
5
|
+
prune docs
|
|
6
|
+
prune examples
|
|
7
|
+
prune tests
|
|
8
|
+
global-exclude __pycache__ *.py[cod] .DS_Store
|
|
9
|
+
|
|
10
|
+
prune _tests
|
|
11
|
+
prune _examples
|
|
12
|
+
prune _previews
|
|
13
|
+
prune _audits
|
|
14
|
+
prune _evidence
|
|
15
|
+
prune _benchmarks
|
|
16
|
+
prune _project_history
|
|
17
|
+
prune legacy_remote_automation
|
|
18
|
+
|
|
19
|
+
prune tutorials
|
|
20
|
+
prune _legacy_remote_automation
|
|
21
|
+
prune _screenshot
|
|
22
|
+
prune graphify-out
|
|
23
|
+
prune .github
|
|
24
|
+
exclude AGENTS.md reply.txt
|
jayrun-0.3.1/PKG-INFO
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jayrun
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Artifact-centric execution for iterative graphs, shared resources, and placement-aware workloads
|
|
5
|
+
Author: Masoud Yavari
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/jayrun-project/jayrun
|
|
8
|
+
Project-URL: Documentation, https://jayrun.readthedocs.io/
|
|
9
|
+
Project-URL: Repository, https://github.com/jayrun-project/jayrun
|
|
10
|
+
Project-URL: Issues, https://github.com/jayrun-project/jayrun/issues
|
|
11
|
+
Keywords: artifacts,dag,execution,orchestration,resources,scheduling,workflow
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
License-File: NOTICE
|
|
28
|
+
Requires-Dist: packaging>=25
|
|
29
|
+
Provides-Extra: yaml
|
|
30
|
+
Requires-Dist: PyYAML>=6.0; extra == "yaml"
|
|
31
|
+
Provides-Extra: plotting
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# Jayrun
|
|
35
|
+
|
|
36
|
+
**Build, run, and inspect Python computation graphs with reusable resources and a live dashboard.**
|
|
37
|
+
|
|
38
|
+
Jayrun is a Python execution framework for pipelines, iterative experiments and application services. Define each step with a synchronous or asynchronous Python method. Jayrun passes artifact values between the steps and manages execution and resource lifetimes.
|
|
39
|
+
|
|
40
|
+
**Latest release:** [0.3.1](https://pypi.org/project/jayrun/0.3.1/) · [Release notes](CHANGELOG.md#031---2026-11-17)
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/jayrun/)
|
|
43
|
+
[](https://www.python.org/)
|
|
44
|
+
[](https://github.com/jayrun-project/jayrun/actions/workflows/ci.yml)
|
|
45
|
+
[](https://github.com/jayrun-project/jayrun/actions/workflows/docs.yml)
|
|
46
|
+
[](https://github.com/jayrun-project/jayrun/blob/main/LICENSE)
|
|
47
|
+
|
|
48
|
+
[Documentation](https://jayrun.readthedocs.io/en/latest/) · [Quick start](#quick-start) · [Explore the dashboard](https://jayrun.readthedocs.io/en/latest/guides/visualization/dashboard.html) · [Tutorials](#tutorials) · [API reference](https://jayrun.readthedocs.io/en/latest/reference/imports.html)
|
|
49
|
+
|
|
50
|
+
[](https://jayrun.readthedocs.io/en/latest/guides/visualization/dashboard.html)
|
|
51
|
+
|
|
52
|
+
*Follow running and paused work in the dashboard. Click to explore the offline preview and learn how to start your own.*
|
|
53
|
+
|
|
54
|
+
## What Jayrun does
|
|
55
|
+
|
|
56
|
+
- **Reuse expensive resources.** Share models, calibration data and clients across compatible runs, with managed acquisition and teardown.
|
|
57
|
+
- **Release intermediate data automatically.** Let Jayrun release consumed artifact values when execution no longer needs them. Retention policies and application references determine what stays alive.
|
|
58
|
+
- **Inspect and control execution.** Visualize graphs before running them, follow live work in the dashboard, and inspect captured results, timings and records afterward.
|
|
59
|
+
|
|
60
|
+
Declare a graph once, then submit it with different inputs and configuration. Graphs can include branches, conditional routes and iteration. They can also act as observers or controllers for other work—the dashboard itself is built as a graph.
|
|
61
|
+
|
|
62
|
+
See [the overview](https://jayrun.readthedocs.io/en/latest/start/overview.html) for applications and [data and lifetimes](https://jayrun.readthedocs.io/en/latest/start/data-and-lifetimes.html) for how artifacts, configuration and resources fit together. The example below introduces these ideas with a single calculation.
|
|
63
|
+
|
|
64
|
+
## Quick start
|
|
65
|
+
|
|
66
|
+
Install Jayrun with Python 3.11 or later:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python -m pip install jayrun
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The only required third-party runtime dependency is `packaging`. Install `jayrun[yaml]` if you need YAML configuration support; workload libraries such as PyTorch are application dependencies.
|
|
73
|
+
|
|
74
|
+
Save this program as `first_graph.py` and run `python first_graph.py`. It declares a multiplication, confirms the graph, supplies input and configuration, and prints `21`:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from jayrun import (
|
|
78
|
+
Artifact, ArtifactContext, ArtifactField, ArtifactFlow, BaseOperator,
|
|
79
|
+
ConfigContext, ConfigField, Engine, GraphDefinition,
|
|
80
|
+
)
|
|
81
|
+
from jayrun.context import ContextState
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class Scale(BaseOperator):
|
|
85
|
+
def __init__(self, *, source, outputs):
|
|
86
|
+
super().__init__()
|
|
87
|
+
self.source = ArtifactField()
|
|
88
|
+
self.factor = ConfigField(value_type=int)
|
|
89
|
+
self.outputs = (ArtifactField(),)
|
|
90
|
+
|
|
91
|
+
def execute(self):
|
|
92
|
+
result = self.source.value * self.factor.value
|
|
93
|
+
self.context.record("scaled", result)
|
|
94
|
+
return result
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
source = Artifact(name="source")
|
|
98
|
+
result = Artifact(name="result")
|
|
99
|
+
scale = Scale(source=source, outputs=(result,))
|
|
100
|
+
flow = ArtifactFlow(scale, artifact=source)
|
|
101
|
+
graph = GraphDefinition(flow, entry_flows=flow)
|
|
102
|
+
graph.confirm()
|
|
103
|
+
|
|
104
|
+
with Engine() as engine:
|
|
105
|
+
run = engine.submit(
|
|
106
|
+
graph,
|
|
107
|
+
ArtifactContext({source: 7}),
|
|
108
|
+
ConfigContext({scale.factor: 3}),
|
|
109
|
+
)
|
|
110
|
+
run.wait(timeout=10)
|
|
111
|
+
if run.state is not ContextState.FINISHED:
|
|
112
|
+
raise RuntimeError(str(run.report.data.failure))
|
|
113
|
+
print(run.artifact(result).value) # 21
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`ArtifactContext` supplies the input value, and `ConfigContext` supplies the multiplication factor. The constructor declares fields; Jayrun automatically binds the `source` argument to `self.source` by name and the `outputs` tuple to `self.outputs` by position.
|
|
117
|
+
|
|
118
|
+
Each submission returns its own `ContextRun`. `run.wait()` waits for finalization, which can include failure, so the example checks the outcome before reading the result. Execution settings separately control policies such as retries and iteration limits.
|
|
119
|
+
|
|
120
|
+
The same confirmed graph can serve another submission. The [complete walkthrough](https://jayrun.readthedocs.io/en/latest/start/first-graph.html) explains each step, reads the recorded value and visualizes the finished run.
|
|
121
|
+
|
|
122
|
+
## Inspect your graphs and runs
|
|
123
|
+
|
|
124
|
+
Once you have a graph, save its structure with `graph.plot.save("graph.html")`. After execution, save the completed run with `run.plot.save("run.html")` to explore captured outcomes, timings, records and reports. Both create interactive HTML viewers that open in a browser.
|
|
125
|
+
|
|
126
|
+
[](https://jayrun.readthedocs.io/en/latest/guides/visualization/graphs.html)
|
|
127
|
+
|
|
128
|
+
*A split-and-join graph with two processing branches. Click to explore the interactive declaration.*
|
|
129
|
+
|
|
130
|
+
For live work, use the [dashboard](https://jayrun.readthedocs.io/en/latest/guides/visualization/dashboard.html) shown above. You can also build your own monitoring or coordination graph using `self.runtime`; see the [Controller example](https://jayrun.readthedocs.io/en/latest/guides/runtime/controller.html). The [visualization and reporting guide](https://jayrun.readthedocs.io/en/latest/guides/evidence/plots.html) covers declarations, registries, completed runs and the dashboard.
|
|
131
|
+
|
|
132
|
+
To keep diagnostic history beyond an Engine session, pass `Database("execution.sqlite")` from `jayrun.persistence` to `Engine(database=...)`. The Engine owns the database lifecycle. After computation finishes, call `engine.database.flush()` to check that pending history was stored successfully. The [Persistence and Database guide](https://jayrun.readthedocs.io/en/latest/guides/evidence/persistence.html) shows how to write history and read it after the Engine closes. Stored history is separate from application checkpoints and arbitrary artifact storage.
|
|
133
|
+
|
|
134
|
+
## Tutorials
|
|
135
|
+
|
|
136
|
+
Ready for a larger workflow? Each tutorial includes a walkthrough, Python source and a notebook, with a small offline CPU path:
|
|
137
|
+
|
|
138
|
+
| Tutorial | What it demonstrates | Run it |
|
|
139
|
+
| --- | --- | --- |
|
|
140
|
+
| [Build and validate](https://jayrun.readthedocs.io/en/latest/tutorials/build-and-validate-graph.html) | Properties, diagnostics and corrected execution | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/build_graph.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/01_build_graph.ipynb) |
|
|
141
|
+
| [Image service](https://jayrun.readthedocs.io/en/latest/tutorials/denoise-images-with-fastapi.html) | Async service, shared client and routing | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/denoise_images.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/02_denoise_images.ipynb) |
|
|
142
|
+
| [Shared model inference](https://jayrun.readthedocs.io/en/latest/tutorials/mnist-inference-and-training.html#share-a-read-only-model-for-inference) | Read-only model reuse and placement | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/mnist_inference.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/03_mnist_inference.ipynb) |
|
|
143
|
+
| [Supervised training](https://jayrun.readthedocs.io/en/latest/tutorials/mnist-inference-and-training.html#supervise-replace-and-promote) | Iteration, mutable state and scoped supervision | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/mnist_training.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/04_mnist_training.ipynb) |
|
|
144
|
+
| [Document service](https://jayrun.readthedocs.io/en/latest/tutorials/document-ingestion.html) | Long-running jobs and transactional publication | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/document_ingestion.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/05_document_ingestion.ipynb) |
|
|
145
|
+
| [Adapter checkpointing](https://jayrun.readthedocs.io/en/latest/tutorials/checkpointed-adapter-finetuning.html) | Model/optimizer/RNG checkpoints | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/adapter_finetuning.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/06_adapter_finetuning.ipynb) |
|
|
146
|
+
| [Scientific campaign](https://jayrun.readthedocs.io/en/latest/tutorials/adaptive-scientific-calibration.html) | Adaptive control and reproducibility | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/heat_calibration.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/07_heat_calibration.ipynb) |
|
|
147
|
+
|
|
148
|
+
The tutorial sources and notebooks live in the [GitHub tutorials directory](https://github.com/jayrun-project/jayrun/tree/main/tutorials); they are not included in `pip install jayrun`. Start with the [tutorial setup guide](https://jayrun.readthedocs.io/en/latest/tutorials/index.html) to get the repository, install lesson dependencies and choose a CPU or optional GPU/model workload. For a specific task, follow the guides on [graph construction](https://jayrun.readthedocs.io/en/latest/guides/workflow/index.html), [resources](https://jayrun.readthedocs.io/en/latest/guides/graphs/resources.html), [component interfaces](https://jayrun.readthedocs.io/en/latest/guides/components/index.html) or [application integration](https://jayrun.readthedocs.io/en/latest/guides/integration/index.html).
|
|
149
|
+
|
|
150
|
+
## Community
|
|
151
|
+
|
|
152
|
+
Have a question or a workflow to share? Join [GitHub Discussions](https://github.com/jayrun-project/jayrun/discussions). Report bugs and request features through [GitHub Issues](https://github.com/jayrun-project/jayrun/issues); for bugs, include a small reproducible example and your Python and Jayrun versions.
|
|
153
|
+
|
|
154
|
+
You can also help by reporting confusing examples, suggesting documentation improvements or sharing how you use Jayrun. The [documentation sources](https://github.com/jayrun-project/jayrun/blob/main/docs/index.md) are included in this repository.
|
|
155
|
+
|
|
156
|
+
## Scope and project status
|
|
157
|
+
|
|
158
|
+
Jayrun manages graph execution and ownership. Applications supply network transport, authentication, external side effects and checkpoint contents. Placement accounts for declared capacity rather than allocating devices, and cleanup releases framework references rather than guaranteeing an immediate drop in process memory. See [supported behavior and limitations](https://jayrun.readthedocs.io/en/latest/reference/limits.html).
|
|
159
|
+
|
|
160
|
+
Jayrun provides a tested foundation for graph execution, with ongoing improvements to reliability, usability and documentation. Use imports from `jayrun` and its [documented public modules](https://jayrun.readthedocs.io/en/latest/reference/imports.html); `jayrun.core` and `jayrun.engine` are implementation details.
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
[Apache License 2.0](https://github.com/jayrun-project/jayrun/blob/main/LICENSE). Copyright 2026 Masoud Yavari.
|
jayrun-0.3.1/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Jayrun
|
|
2
|
+
|
|
3
|
+
**Build, run, and inspect Python computation graphs with reusable resources and a live dashboard.**
|
|
4
|
+
|
|
5
|
+
Jayrun is a Python execution framework for pipelines, iterative experiments and application services. Define each step with a synchronous or asynchronous Python method. Jayrun passes artifact values between the steps and manages execution and resource lifetimes.
|
|
6
|
+
|
|
7
|
+
**Latest release:** [0.3.1](https://pypi.org/project/jayrun/0.3.1/) · [Release notes](CHANGELOG.md#031---2026-11-17)
|
|
8
|
+
|
|
9
|
+
[](https://pypi.org/project/jayrun/)
|
|
10
|
+
[](https://www.python.org/)
|
|
11
|
+
[](https://github.com/jayrun-project/jayrun/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/jayrun-project/jayrun/actions/workflows/docs.yml)
|
|
13
|
+
[](https://github.com/jayrun-project/jayrun/blob/main/LICENSE)
|
|
14
|
+
|
|
15
|
+
[Documentation](https://jayrun.readthedocs.io/en/latest/) · [Quick start](#quick-start) · [Explore the dashboard](https://jayrun.readthedocs.io/en/latest/guides/visualization/dashboard.html) · [Tutorials](#tutorials) · [API reference](https://jayrun.readthedocs.io/en/latest/reference/imports.html)
|
|
16
|
+
|
|
17
|
+
[](https://jayrun.readthedocs.io/en/latest/guides/visualization/dashboard.html)
|
|
18
|
+
|
|
19
|
+
*Follow running and paused work in the dashboard. Click to explore the offline preview and learn how to start your own.*
|
|
20
|
+
|
|
21
|
+
## What Jayrun does
|
|
22
|
+
|
|
23
|
+
- **Reuse expensive resources.** Share models, calibration data and clients across compatible runs, with managed acquisition and teardown.
|
|
24
|
+
- **Release intermediate data automatically.** Let Jayrun release consumed artifact values when execution no longer needs them. Retention policies and application references determine what stays alive.
|
|
25
|
+
- **Inspect and control execution.** Visualize graphs before running them, follow live work in the dashboard, and inspect captured results, timings and records afterward.
|
|
26
|
+
|
|
27
|
+
Declare a graph once, then submit it with different inputs and configuration. Graphs can include branches, conditional routes and iteration. They can also act as observers or controllers for other work—the dashboard itself is built as a graph.
|
|
28
|
+
|
|
29
|
+
See [the overview](https://jayrun.readthedocs.io/en/latest/start/overview.html) for applications and [data and lifetimes](https://jayrun.readthedocs.io/en/latest/start/data-and-lifetimes.html) for how artifacts, configuration and resources fit together. The example below introduces these ideas with a single calculation.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
Install Jayrun with Python 3.11 or later:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python -m pip install jayrun
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The only required third-party runtime dependency is `packaging`. Install `jayrun[yaml]` if you need YAML configuration support; workload libraries such as PyTorch are application dependencies.
|
|
40
|
+
|
|
41
|
+
Save this program as `first_graph.py` and run `python first_graph.py`. It declares a multiplication, confirms the graph, supplies input and configuration, and prints `21`:
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from jayrun import (
|
|
45
|
+
Artifact, ArtifactContext, ArtifactField, ArtifactFlow, BaseOperator,
|
|
46
|
+
ConfigContext, ConfigField, Engine, GraphDefinition,
|
|
47
|
+
)
|
|
48
|
+
from jayrun.context import ContextState
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class Scale(BaseOperator):
|
|
52
|
+
def __init__(self, *, source, outputs):
|
|
53
|
+
super().__init__()
|
|
54
|
+
self.source = ArtifactField()
|
|
55
|
+
self.factor = ConfigField(value_type=int)
|
|
56
|
+
self.outputs = (ArtifactField(),)
|
|
57
|
+
|
|
58
|
+
def execute(self):
|
|
59
|
+
result = self.source.value * self.factor.value
|
|
60
|
+
self.context.record("scaled", result)
|
|
61
|
+
return result
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
source = Artifact(name="source")
|
|
65
|
+
result = Artifact(name="result")
|
|
66
|
+
scale = Scale(source=source, outputs=(result,))
|
|
67
|
+
flow = ArtifactFlow(scale, artifact=source)
|
|
68
|
+
graph = GraphDefinition(flow, entry_flows=flow)
|
|
69
|
+
graph.confirm()
|
|
70
|
+
|
|
71
|
+
with Engine() as engine:
|
|
72
|
+
run = engine.submit(
|
|
73
|
+
graph,
|
|
74
|
+
ArtifactContext({source: 7}),
|
|
75
|
+
ConfigContext({scale.factor: 3}),
|
|
76
|
+
)
|
|
77
|
+
run.wait(timeout=10)
|
|
78
|
+
if run.state is not ContextState.FINISHED:
|
|
79
|
+
raise RuntimeError(str(run.report.data.failure))
|
|
80
|
+
print(run.artifact(result).value) # 21
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`ArtifactContext` supplies the input value, and `ConfigContext` supplies the multiplication factor. The constructor declares fields; Jayrun automatically binds the `source` argument to `self.source` by name and the `outputs` tuple to `self.outputs` by position.
|
|
84
|
+
|
|
85
|
+
Each submission returns its own `ContextRun`. `run.wait()` waits for finalization, which can include failure, so the example checks the outcome before reading the result. Execution settings separately control policies such as retries and iteration limits.
|
|
86
|
+
|
|
87
|
+
The same confirmed graph can serve another submission. The [complete walkthrough](https://jayrun.readthedocs.io/en/latest/start/first-graph.html) explains each step, reads the recorded value and visualizes the finished run.
|
|
88
|
+
|
|
89
|
+
## Inspect your graphs and runs
|
|
90
|
+
|
|
91
|
+
Once you have a graph, save its structure with `graph.plot.save("graph.html")`. After execution, save the completed run with `run.plot.save("run.html")` to explore captured outcomes, timings, records and reports. Both create interactive HTML viewers that open in a browser.
|
|
92
|
+
|
|
93
|
+
[](https://jayrun.readthedocs.io/en/latest/guides/visualization/graphs.html)
|
|
94
|
+
|
|
95
|
+
*A split-and-join graph with two processing branches. Click to explore the interactive declaration.*
|
|
96
|
+
|
|
97
|
+
For live work, use the [dashboard](https://jayrun.readthedocs.io/en/latest/guides/visualization/dashboard.html) shown above. You can also build your own monitoring or coordination graph using `self.runtime`; see the [Controller example](https://jayrun.readthedocs.io/en/latest/guides/runtime/controller.html). The [visualization and reporting guide](https://jayrun.readthedocs.io/en/latest/guides/evidence/plots.html) covers declarations, registries, completed runs and the dashboard.
|
|
98
|
+
|
|
99
|
+
To keep diagnostic history beyond an Engine session, pass `Database("execution.sqlite")` from `jayrun.persistence` to `Engine(database=...)`. The Engine owns the database lifecycle. After computation finishes, call `engine.database.flush()` to check that pending history was stored successfully. The [Persistence and Database guide](https://jayrun.readthedocs.io/en/latest/guides/evidence/persistence.html) shows how to write history and read it after the Engine closes. Stored history is separate from application checkpoints and arbitrary artifact storage.
|
|
100
|
+
|
|
101
|
+
## Tutorials
|
|
102
|
+
|
|
103
|
+
Ready for a larger workflow? Each tutorial includes a walkthrough, Python source and a notebook, with a small offline CPU path:
|
|
104
|
+
|
|
105
|
+
| Tutorial | What it demonstrates | Run it |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| [Build and validate](https://jayrun.readthedocs.io/en/latest/tutorials/build-and-validate-graph.html) | Properties, diagnostics and corrected execution | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/build_graph.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/01_build_graph.ipynb) |
|
|
108
|
+
| [Image service](https://jayrun.readthedocs.io/en/latest/tutorials/denoise-images-with-fastapi.html) | Async service, shared client and routing | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/denoise_images.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/02_denoise_images.ipynb) |
|
|
109
|
+
| [Shared model inference](https://jayrun.readthedocs.io/en/latest/tutorials/mnist-inference-and-training.html#share-a-read-only-model-for-inference) | Read-only model reuse and placement | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/mnist_inference.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/03_mnist_inference.ipynb) |
|
|
110
|
+
| [Supervised training](https://jayrun.readthedocs.io/en/latest/tutorials/mnist-inference-and-training.html#supervise-replace-and-promote) | Iteration, mutable state and scoped supervision | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/mnist_training.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/04_mnist_training.ipynb) |
|
|
111
|
+
| [Document service](https://jayrun.readthedocs.io/en/latest/tutorials/document-ingestion.html) | Long-running jobs and transactional publication | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/document_ingestion.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/05_document_ingestion.ipynb) |
|
|
112
|
+
| [Adapter checkpointing](https://jayrun.readthedocs.io/en/latest/tutorials/checkpointed-adapter-finetuning.html) | Model/optimizer/RNG checkpoints | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/adapter_finetuning.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/06_adapter_finetuning.ipynb) |
|
|
113
|
+
| [Scientific campaign](https://jayrun.readthedocs.io/en/latest/tutorials/adaptive-scientific-calibration.html) | Adaptive control and reproducibility | [Python](https://github.com/jayrun-project/jayrun/blob/main/tutorials/heat_calibration.py) · [Notebook](https://github.com/jayrun-project/jayrun/blob/main/tutorials/07_heat_calibration.ipynb) |
|
|
114
|
+
|
|
115
|
+
The tutorial sources and notebooks live in the [GitHub tutorials directory](https://github.com/jayrun-project/jayrun/tree/main/tutorials); they are not included in `pip install jayrun`. Start with the [tutorial setup guide](https://jayrun.readthedocs.io/en/latest/tutorials/index.html) to get the repository, install lesson dependencies and choose a CPU or optional GPU/model workload. For a specific task, follow the guides on [graph construction](https://jayrun.readthedocs.io/en/latest/guides/workflow/index.html), [resources](https://jayrun.readthedocs.io/en/latest/guides/graphs/resources.html), [component interfaces](https://jayrun.readthedocs.io/en/latest/guides/components/index.html) or [application integration](https://jayrun.readthedocs.io/en/latest/guides/integration/index.html).
|
|
116
|
+
|
|
117
|
+
## Community
|
|
118
|
+
|
|
119
|
+
Have a question or a workflow to share? Join [GitHub Discussions](https://github.com/jayrun-project/jayrun/discussions). Report bugs and request features through [GitHub Issues](https://github.com/jayrun-project/jayrun/issues); for bugs, include a small reproducible example and your Python and Jayrun versions.
|
|
120
|
+
|
|
121
|
+
You can also help by reporting confusing examples, suggesting documentation improvements or sharing how you use Jayrun. The [documentation sources](https://github.com/jayrun-project/jayrun/blob/main/docs/index.md) are included in this repository.
|
|
122
|
+
|
|
123
|
+
## Scope and project status
|
|
124
|
+
|
|
125
|
+
Jayrun manages graph execution and ownership. Applications supply network transport, authentication, external side effects and checkpoint contents. Placement accounts for declared capacity rather than allocating devices, and cleanup releases framework references rather than guaranteeing an immediate drop in process memory. See [supported behavior and limitations](https://jayrun.readthedocs.io/en/latest/reference/limits.html).
|
|
126
|
+
|
|
127
|
+
Jayrun provides a tested foundation for graph execution, with ongoing improvements to reliability, usability and documentation. Use imports from `jayrun` and its [documented public modules](https://jayrun.readthedocs.io/en/latest/reference/imports.html); `jayrun.core` and `jayrun.engine` are implementation details.
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
[Apache License 2.0](https://github.com/jayrun-project/jayrun/blob/main/LICENSE). Copyright 2026 Masoud Yavari.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Public graph construction, execution, and data-context API.
|
|
2
|
+
|
|
3
|
+
Exports are resolved on demand so the portable visualization package can be
|
|
4
|
+
imported without loading execution, declaration, or validation modules.
|
|
5
|
+
"""
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from .authority import Controller, Supervisor
|
|
11
|
+
from .core.artifact.base import Artifact
|
|
12
|
+
from .core.artifact.context import ArtifactContext
|
|
13
|
+
from .core.artifact.field import ArtifactField
|
|
14
|
+
from .core.config.context import ConfigContext
|
|
15
|
+
from .core.config.field import ConfigField
|
|
16
|
+
from .core.context.runtime_data import Data
|
|
17
|
+
from .core.graph.artifact_flow import ArtifactFlow
|
|
18
|
+
from .core.graph.graph_definition import GraphDefinition
|
|
19
|
+
from .core.operator.base import BaseOperator
|
|
20
|
+
from .core.resource.base import BaseResource
|
|
21
|
+
from .core.resource.field import ResourceField
|
|
22
|
+
from .core.serializer.base import BaseSerializer
|
|
23
|
+
from .engine.api import Engine
|
|
24
|
+
from .engine.engine_state import EngineState, RuntimeActivity
|
|
25
|
+
from .registry import GraphRegistry
|
|
26
|
+
|
|
27
|
+
__version__ = "0.3.1"
|
|
28
|
+
|
|
29
|
+
__all__ = (
|
|
30
|
+
"__version__", "Artifact", "ArtifactContext", "ArtifactField", "ArtifactFlow",
|
|
31
|
+
"BaseOperator", "BaseResource", "BaseSerializer", "ConfigContext", "ConfigField",
|
|
32
|
+
"Controller", "Data", "Engine", "EngineState", "RuntimeActivity", "GraphDefinition", "GraphRegistry",
|
|
33
|
+
"ResourceField", "Supervisor",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
_EXPORTS = {
|
|
37
|
+
"Artifact": ".core.artifact.base", "ArtifactContext": ".core.artifact.context",
|
|
38
|
+
"ArtifactField": ".core.artifact.field", "ArtifactFlow": ".core.graph.artifact_flow",
|
|
39
|
+
"BaseOperator": ".core.operator.base", "BaseResource": ".core.resource.base",
|
|
40
|
+
"BaseSerializer": ".core.serializer.base", "ConfigContext": ".core.config.context",
|
|
41
|
+
"ConfigField": ".core.config.field", "Controller": ".authority",
|
|
42
|
+
"Data": ".core.context.runtime_data", "Engine": ".engine.api",
|
|
43
|
+
"EngineState": ".engine.engine_state", "RuntimeActivity": ".engine.engine_state",
|
|
44
|
+
"GraphDefinition": ".core.graph.graph_definition", "GraphRegistry": ".registry",
|
|
45
|
+
"ResourceField": ".core.resource.field", "Supervisor": ".authority",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def __getattr__(name: str) -> object:
|
|
50
|
+
module = _EXPORTS.get(name)
|
|
51
|
+
if module is None:
|
|
52
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
53
|
+
value = getattr(import_module(module, __name__), name)
|
|
54
|
+
globals()[name] = value
|
|
55
|
+
return value
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def __dir__() -> list[str]:
|
|
59
|
+
return sorted(set(globals()) | set(__all__))
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from .core.graph.graph_definition import GraphDefinition
|
|
8
|
+
from .persistence import DatabaseReader
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True, slots=True, init=False)
|
|
12
|
+
class Supervisor:
|
|
13
|
+
"""Grant a submitted context authority over other context runs.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
*graphs: Exact graph objects whose contexts may be observed and controlled.
|
|
17
|
+
When omitted, the authority covers every graph in the engine.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
graphs: tuple[GraphDefinition, ...]
|
|
21
|
+
|
|
22
|
+
def __init__(self, *graphs: GraphDefinition) -> None:
|
|
23
|
+
object.__setattr__(self, "graphs", graphs)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True, slots=True)
|
|
27
|
+
class Controller:
|
|
28
|
+
"""Grant engine-wide observation and control to a submitted context.
|
|
29
|
+
|
|
30
|
+
A controller may also submit confirmed graphs or registered identities through
|
|
31
|
+
``self.runtime.submit(...)`` and asynchronously request engine shutdown.
|
|
32
|
+
EngineSettings.controller_policy must be DELEGATED to submit children with
|
|
33
|
+
Supervisor or Controller authority; HOST_ONLY is the default.
|
|
34
|
+
Controller contexts execute locally through supervision capacity and cannot
|
|
35
|
+
be transferred. An optional ``history`` reader explicitly grants its existing
|
|
36
|
+
session scope. The runtime lends an attenuated view for this controller
|
|
37
|
+
lifetime; it cannot close/flush the store or acquire additional live rights.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
history: DatabaseReader | None = None
|
|
41
|
+
|
|
42
|
+
def __post_init__(self) -> None:
|
|
43
|
+
# A history grant is local, explicit and independent of live authority.
|
|
44
|
+
# Default Controller() does not import persistence or reveal its store.
|
|
45
|
+
if self.history is not None:
|
|
46
|
+
from .persistence import DatabaseReader
|
|
47
|
+
if type(self.history) is not DatabaseReader:
|
|
48
|
+
raise TypeError("history must be a DatabaseReader or None")
|