phronomy 0.37.0 → 0.38.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +87 -0
- data/README.md +24 -2
- data/SECURITY.md +1 -1
- data/docs/architecture/agent-approval-recovery.md +320 -0
- data/docs/architecture/agent-child-approval-recovery.md +387 -0
- data/docs/architecture/agent-child-execution-recovery.md +425 -0
- data/docs/architecture/agent-dispatch-recovery.md +308 -0
- data/docs/architecture/agent-terminal-persistence-evidence.md +360 -0
- data/docs/architecture/agent-terminal-recovery.md +298 -0
- data/docs/architecture/agent-terminal-submission-recovery.md +275 -0
- data/docs/architecture/agent-tool-child-lifetime.md +29 -0
- data/docs/architecture/agent-transition-ownership.md +24 -0
- data/docs/architecture/backend-groups.md +6 -0
- data/docs/architecture/detached-outcome-proof-projection.md +576 -0
- data/docs/architecture/execution-abstraction-review.md +5 -0
- data/docs/architecture/handoff-dispatch-recovery.md +205 -0
- data/docs/architecture/handoff-initial-terminal-application.md +321 -0
- data/docs/architecture/initial-preparation-recovery.md +308 -0
- data/docs/architecture/multi-agent-handoff.md +17 -0
- data/docs/architecture/native-outcome-preparation.md +715 -0
- data/docs/architecture/native-parent-dispatch-recovery.md +460 -0
- data/docs/architecture/native-parent-outcome-recovery.md +644 -0
- data/docs/architecture/parent-child-terminal-acknowledgement.md +297 -0
- data/docs/architecture/r8-unit12.md +6 -3
- data/docs/architecture/r8-unit4.md +11 -2
- data/docs/architecture/recovery-physical-attempt.md +88 -0
- data/docs/architecture/recovery-submission-custody.md +247 -0
- data/docs/architecture/retained-attempts.md +229 -0
- data/docs/architecture/retained-outcome-materialization.md +636 -0
- data/docs/architecture/retained-outcome-publication.md +506 -0
- data/docs/architecture/storage-execution-boundaries.md +1 -1
- data/docs/architecture/structured-output-and-scope.md +15 -0
- data/docs/architecture/synchronous-participant-application.md +397 -0
- data/docs/architecture/synchronous-participant-contract.md +195 -0
- data/docs/architecture/team-admission-rejection.md +91 -0
- data/docs/architecture/team-cancellation-delivery.md +245 -0
- data/docs/architecture/team-child-retirement.md +104 -0
- data/docs/architecture/tracing.md +26 -0
- data/docs/architecture/workflow-terminal-ownership-design.md +25 -9
- data/docs/architecture/workflow-terminal-reconciliation.md +221 -0
- data/docs/architecture.md +16 -9
- data/docs/decisions/025-process-local-agent-ownership-and-runtime-admission.md +8 -0
- data/docs/features.md +3 -3
- data/docs/mcp-client.md +138 -5
- data/docs/migrations/orchestrator-subagent-dispatch.md +89 -0
- data/docs/migrations/vector-async-clients.md +18 -3
- data/docs/persistence-backends.md +30 -4
- data/docs/runtime-and-concurrency.md +235 -11
- data/lib/phronomy/agent/admission.rb +37 -17
- data/lib/phronomy/agent/api/agent.rb +25 -0
- data/lib/phronomy/agent/approval_recovery.rb +30 -0
- data/lib/phronomy/agent/approval_recovery_api.rb +61 -0
- data/lib/phronomy/agent/approval_recovery_error.rb +39 -0
- data/lib/phronomy/agent/approval_recovery_result.rb +94 -0
- data/lib/phronomy/agent/async_event_api.rb +22 -5
- data/lib/phronomy/agent/base.rb +76 -48
- data/lib/phronomy/agent/context_preparation.rb +10 -8
- data/lib/phronomy/agent/dispatch_recovery.rb +29 -0
- data/lib/phronomy/agent/dispatch_recovery_api.rb +84 -0
- data/lib/phronomy/agent/dispatch_recovery_error.rb +36 -0
- data/lib/phronomy/agent/dispatch_recovery_result.rb +93 -0
- data/lib/phronomy/agent/execution/agent_invocation.rb +11 -3
- data/lib/phronomy/agent/execution/approval_continuation_plan.rb +131 -0
- data/lib/phronomy/agent/execution/approval_parent_evidence.rb +116 -0
- data/lib/phronomy/agent/execution/approval_persistence_evidence.rb +111 -0
- data/lib/phronomy/agent/execution/approval_recovery_operation.rb +496 -0
- data/lib/phronomy/agent/execution/approval_resume_commit.rb +174 -10
- data/lib/phronomy/agent/execution/dispatch_continuation_delivery.rb +96 -0
- data/lib/phronomy/agent/execution/dispatch_persistence_evidence.rb +147 -0
- data/lib/phronomy/agent/execution/dispatch_preparation.rb +63 -7
- data/lib/phronomy/agent/execution/dispatch_recovery_operation.rb +495 -0
- data/lib/phronomy/agent/execution/execution_coordinator.rb +724 -158
- data/lib/phronomy/agent/execution/execution_outcome_committer.rb +312 -39
- data/lib/phronomy/agent/execution/execution_registry.rb +508 -13
- data/lib/phronomy/agent/execution/initial_persistence_evidence.rb +269 -0
- data/lib/phronomy/agent/execution/initial_preparation.rb +132 -40
- data/lib/phronomy/agent/execution/initial_preparation_recovery_operation.rb +513 -0
- data/lib/phronomy/agent/execution/invocation_transitions.rb +3 -0
- data/lib/phronomy/agent/execution/outcome_planning.rb +108 -0
- data/lib/phronomy/agent/execution/outcome_preparation.rb +81 -0
- data/lib/phronomy/agent/execution/outcome_recovery_operation.rb +609 -0
- data/lib/phronomy/agent/execution/outcome_text_projection.rb +73 -0
- data/lib/phronomy/agent/execution/outcome_write_plan.rb +48 -0
- data/lib/phronomy/agent/execution/runtime_record_encoder.rb +7 -4
- data/lib/phronomy/agent/execution/terminal_persistence_evidence.rb +280 -0
- data/lib/phronomy/agent/execution/terminal_recovery_operation.rb +38 -0
- data/lib/phronomy/agent/execution_change.rb +138 -26
- data/lib/phronomy/agent/execution_environment.rb +29 -0
- data/lib/phronomy/agent/execution_rejected_error.rb +34 -0
- data/lib/phronomy/agent/initial_preparation_recovery.rb +32 -0
- data/lib/phronomy/agent/initial_preparation_recovery_api.rb +85 -0
- data/lib/phronomy/agent/initial_preparation_recovery_error.rb +41 -0
- data/lib/phronomy/agent/initial_preparation_recovery_result.rb +115 -0
- data/lib/phronomy/agent/lifecycle/hosted_approval_context.rb +86 -0
- data/lib/phronomy/agent/lifecycle/hosted_invocation.rb +42 -10
- data/lib/phronomy/agent/lifecycle/identity_write.rb +101 -0
- data/lib/phronomy/agent/lifecycle/lifetime_api.rb +28 -0
- data/lib/phronomy/agent/lifecycle/ownership_registry.rb +136 -70
- data/lib/phronomy/agent/lifecycle/scope.rb +3 -3
- data/lib/phronomy/agent/outcome_recovery.rb +47 -0
- data/lib/phronomy/agent/outcome_recovery_api.rb +114 -0
- data/lib/phronomy/agent/outcome_recovery_error.rb +36 -0
- data/lib/phronomy/agent/outcome_recovery_result.rb +92 -0
- data/lib/phronomy/agent/output_contract.rb +16 -6
- data/lib/phronomy/agent/persistence/identity_receipt_repository.rb +61 -0
- data/lib/phronomy/agent/persistence/records.rb +2 -0
- data/lib/phronomy/agent/persistence/storage_schema.rb +2 -0
- data/lib/phronomy/agent/recovery/invocation_restorer.rb +8 -5
- data/lib/phronomy/agent/recovery/recovery_coordinator/continuation.rb +6 -4
- data/lib/phronomy/agent/recovery/recovery_coordinator/installation.rb +21 -43
- data/lib/phronomy/agent/recovery/recovery_coordinator.rb +19 -6
- data/lib/phronomy/agent/runtime_binding/engine_environment.rb +12 -0
- data/lib/phronomy/agent/state_writer.rb +4 -3
- data/lib/phronomy/agent/store.rb +7 -1
- data/lib/phronomy/agent/terminal_recovery.rb +41 -0
- data/lib/phronomy/agent/terminal_recovery_api.rb +101 -0
- data/lib/phronomy/agent/terminal_recovery_error.rb +36 -0
- data/lib/phronomy/agent/terminal_recovery_result.rb +67 -0
- data/lib/phronomy/agent/tool_execution/tool_approval_request.rb +25 -1
- data/lib/phronomy/common/values/serializable.rb +37 -4
- data/lib/phronomy/engine/concurrency/offload_pool.rb +32 -4
- data/lib/phronomy/engine/concurrency/pool_registry.rb +6 -0
- data/lib/phronomy/engine/event_loop.rb +161 -11
- data/lib/phronomy/engine/execution_binding.rb +4 -2
- data/lib/phronomy/engine/execution_receiver_binding.rb +5 -0
- data/lib/phronomy/engine/runtime/shutdown_result.rb +21 -0
- data/lib/phronomy/engine/runtime/timer_queue.rb +7 -2
- data/lib/phronomy/engine/runtime.rb +119 -15
- data/lib/phronomy/execution/attempt_completion.rb +91 -0
- data/lib/phronomy/execution/concurrency/cancellation_token.rb +7 -2
- data/lib/phronomy/execution/concurrency/physical_completion_task.rb +7 -2
- data/lib/phronomy/execution/execution.rb +17 -2
- data/lib/phronomy/execution/execution_receiver.rb +27 -0
- data/lib/phronomy/execution/execution_retirement.rb +30 -0
- data/lib/phronomy/execution/invocation_controls.rb +2 -2
- data/lib/phronomy/execution/retained_attempts.rb +179 -0
- data/lib/phronomy/execution/stopped_terminal_custody.rb +99 -0
- data/lib/phronomy/llm_adapter/response.rb +7 -1
- data/lib/phronomy/multi_agent/admission_registry.rb +6 -0
- data/lib/phronomy/multi_agent/durable_subagent_coordinator.rb +175 -39
- data/lib/phronomy/multi_agent/handoff_dispatch_evidence.rb +176 -0
- data/lib/phronomy/multi_agent/handoff_finalization_error.rb +33 -0
- data/lib/phronomy/multi_agent/handoff_history_release.rb +80 -0
- data/lib/phronomy/multi_agent/handoff_participant.rb +31 -6
- data/lib/phronomy/multi_agent/handoff_runner.rb +195 -21
- data/lib/phronomy/multi_agent/handoff_terminal_finalization.rb +176 -0
- data/lib/phronomy/multi_agent/native_approval_evidence.rb +26 -0
- data/lib/phronomy/multi_agent/native_child_authority.rb +135 -0
- data/lib/phronomy/multi_agent/native_dispatch_evidence.rb +43 -0
- data/lib/phronomy/multi_agent/native_outcome_evidence.rb +46 -0
- data/lib/phronomy/multi_agent/native_persistence_plan.rb +93 -0
- data/lib/phronomy/multi_agent/orchestrator.rb +28 -52
- data/lib/phronomy/multi_agent/reserved_child_admission.rb +90 -1
- data/lib/phronomy/multi_agent/store.rb +5 -34
- data/lib/phronomy/multi_agent/subagent_history_release.rb +88 -0
- data/lib/phronomy/multi_agent/team_cancellation_delivery_error.rb +21 -0
- data/lib/phronomy/multi_agent/team_cancellation_request.rb +134 -0
- data/lib/phronomy/multi_agent/team_coordinator.rb +174 -27
- data/lib/phronomy/persistence_composition/stores.rb +10 -3
- data/lib/phronomy/runtime_composition/execution_defaults.rb +18 -0
- data/lib/phronomy/storage/backends/in_memory.rb +3 -1
- data/lib/phronomy/storage/resource.rb +10 -1
- data/lib/phronomy/tools/agent.rb +7 -1
- data/lib/phronomy/tools/mcp.rb +210 -91
- data/lib/phronomy/tools/mcp_http_close_response.rb +23 -0
- data/lib/phronomy/tools/mcp_transport_registry.rb +210 -0
- data/lib/phronomy/tools/vector_search.rb +28 -5
- data/lib/phronomy/tracing/automatic.rb +8 -1
- data/lib/phronomy/version.rb +1 -1
- data/lib/phronomy/workflow/execution/workflow.rb +34 -0
- data/lib/phronomy/workflow/execution/workflow_execution_environment.rb +1 -0
- data/lib/phronomy/workflow/execution/workflow_execution_registry.rb +106 -7
- data/lib/phronomy/workflow/execution/workflow_runner.rb +53 -108
- data/lib/phronomy/workflow/execution/workflow_terminal_operation.rb +489 -0
- data/lib/phronomy/workflow/execution/workflow_terminal_persistence.rb +81 -0
- data/lib/phronomy/workflow/execution/workflow_terminal_recovery.rb +38 -0
- data/lib/phronomy/workflow/execution/workflow_terminal_recovery_error.rb +34 -0
- data/lib/phronomy/workflow/execution/workflow_terminal_recovery_result.rb +56 -0
- data/lib/phronomy/workflow/runtime_binding/workflow_engine_environment.rb +10 -1
- data/lib/phronomy/workflow/runtime_binding/workflow_task_session.rb +3 -1
- data/lib/phronomy/workflow/runtime_binding/workflow_terminal_policy.rb +2 -1
- data/scripts/api_snapshot.rb +46 -1
- data/sig/_private/phronomy/multi_agent/team_cancellation_request.rbs +19 -0
- data/sig/phronomy/agent/approval_recovery.rbs +54 -0
- data/sig/phronomy/agent/dispatch_recovery.rbs +49 -0
- data/sig/phronomy/agent/execution_contract.rbs +4 -1
- data/sig/phronomy/agent/execution_environment.rbs +2 -0
- data/sig/phronomy/agent/initial_preparation_recovery.rbs +48 -0
- data/sig/phronomy/agent/outcome_recovery.rbs +51 -0
- data/sig/phronomy/agent/store.rbs +1 -0
- data/sig/phronomy/agent/terminal_persistence_evidence.rbs +111 -0
- data/sig/phronomy/agent/terminal_recovery.rbs +46 -0
- data/sig/phronomy/agent.rbs +36 -0
- data/sig/phronomy/engine/concurrency/timer_bindings.rbs +2 -0
- data/sig/phronomy/engine/execution_binding.rbs +2 -1
- data/sig/phronomy/engine/execution_receiver.rbs +4 -0
- data/sig/phronomy/engine/observability.rbs +22 -1
- data/sig/phronomy/execution/execution.rbs +16 -1
- data/sig/phronomy/execution/execution_receiver.rbs +12 -0
- data/sig/phronomy/execution/execution_retirement.rbs +18 -0
- data/sig/phronomy/execution/stopped_terminal_custody.rbs +19 -0
- data/sig/phronomy/handoff.rbs +1 -0
- data/sig/phronomy/multi_agent/handoff_finalization_error.rbs +18 -0
- data/sig/phronomy/multi_agent/store.rbs +1 -1
- data/sig/phronomy/multi_agent/team_cancellation_delivery_error.rbs +9 -0
- data/sig/phronomy/persistence_composition.rbs +2 -1
- data/sig/phronomy/storage/contracts.rbs +2 -1
- data/sig/phronomy/tools/mcp.rbs +27 -0
- data/sig/phronomy/workflow.rbs +42 -0
- metadata +104 -2
|
@@ -17,7 +17,9 @@ module Phronomy
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def existing_registry = WorkflowExecutionRegistry.existing_for(@runtime)
|
|
20
|
-
def executing? = @runtime.
|
|
20
|
+
def executing? = @runtime.event_loop_current?
|
|
21
|
+
|
|
22
|
+
def supports_submission_rejection? = true
|
|
21
23
|
|
|
22
24
|
def submit(**options, &operation)
|
|
23
25
|
Phronomy::Execution.submit(runtime: @runtime, **options, &operation)
|
|
@@ -43,6 +45,13 @@ module Phronomy
|
|
|
43
45
|
@runtime.event_loop.register(session, completion: completion, receiver: registry)
|
|
44
46
|
end
|
|
45
47
|
|
|
48
|
+
def retire_session(fsm_session_id:, error:)
|
|
49
|
+
@runtime.__event_loop_if_initialized&.post(Phronomy::Event.new(
|
|
50
|
+
type: :recovery_required, target_id: Phronomy::EventLoop::SYSTEM_CHANNEL_ID,
|
|
51
|
+
payload: {fsm_session_id: fsm_session_id, error: error}
|
|
52
|
+
)) || false
|
|
53
|
+
end
|
|
54
|
+
|
|
46
55
|
def subscribe_cancellation(token, &callback)
|
|
47
56
|
subscriptions = Phronomy::Concurrency::ResultSubscriptions.new
|
|
48
57
|
subscriptions.cancellation(token, &callback)
|
|
@@ -69,7 +69,9 @@ module Phronomy
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def retire_without_result!(error)
|
|
72
|
-
|
|
72
|
+
# The retained terminal operation settles observation after completion
|
|
73
|
+
# custody is accepted. A raw failure here races away the recovery handle.
|
|
74
|
+
@task_execution.close
|
|
73
75
|
super
|
|
74
76
|
end
|
|
75
77
|
end
|
|
@@ -12,7 +12,7 @@ module Phronomy
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def start(terminal_type:, context:, event_sink:)
|
|
15
|
-
@persist.call(terminal_type: terminal_type, context: context, event_sink: event_sink)
|
|
15
|
+
@operation = @persist.call(terminal_type: terminal_type, context: context, event_sink: event_sink)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def handles?(event)
|
|
@@ -21,6 +21,7 @@ module Phronomy
|
|
|
21
21
|
|
|
22
22
|
def decision_for(event)
|
|
23
23
|
result = event.payload
|
|
24
|
+
@operation.accept_terminal_result(result) if @operation.is_a?(Phronomy::WorkflowTerminalOperation)
|
|
24
25
|
case result.outcome
|
|
25
26
|
when :success
|
|
26
27
|
Phronomy::TerminalDecision.new(action: :complete, error: nil)
|
data/scripts/api_snapshot.rb
CHANGED
|
@@ -25,8 +25,14 @@ PUBLIC_API_ENTRIES = [
|
|
|
25
25
|
Phronomy::Agent::Scope,
|
|
26
26
|
Phronomy::Agent::OutputError,
|
|
27
27
|
Phronomy::Agent::ScopeCleanupError,
|
|
28
|
+
# Public management contracts
|
|
29
|
+
Phronomy::Runtime,
|
|
30
|
+
Phronomy::Runtime::ShutdownManagementResult,
|
|
31
|
+
Phronomy::StoppedTerminalCustody,
|
|
32
|
+
Phronomy::StoppedTerminalCustody::Receipt,
|
|
28
33
|
Phronomy::MultiAgent::TeamNotFoundError,
|
|
29
34
|
Phronomy::MultiAgent::TeamBusyError,
|
|
35
|
+
Phronomy::MultiAgent::TeamCancellationDeliveryError,
|
|
30
36
|
Phronomy::Embeddings::AuthenticationError,
|
|
31
37
|
Phronomy::Embeddings::RateLimitError,
|
|
32
38
|
Phronomy::Agent::Base,
|
|
@@ -34,6 +40,21 @@ PUBLIC_API_ENTRIES = [
|
|
|
34
40
|
Phronomy::Agent::ApprovalWait,
|
|
35
41
|
Phronomy::Agent::ReservedExecution,
|
|
36
42
|
Phronomy::Agent::ExecutionObservation,
|
|
43
|
+
Phronomy::Agent::TerminalRecovery,
|
|
44
|
+
Phronomy::Agent::TerminalRecoveryError,
|
|
45
|
+
Phronomy::Agent::TerminalRecoveryResult,
|
|
46
|
+
Phronomy::Agent::OutcomeRecovery,
|
|
47
|
+
Phronomy::Agent::OutcomeRecoveryError,
|
|
48
|
+
Phronomy::Agent::OutcomeRecoveryResult,
|
|
49
|
+
Phronomy::Agent::ApprovalRecovery,
|
|
50
|
+
Phronomy::Agent::ApprovalRecoveryError,
|
|
51
|
+
Phronomy::Agent::ApprovalRecoveryResult,
|
|
52
|
+
Phronomy::Agent::DispatchRecovery,
|
|
53
|
+
Phronomy::Agent::DispatchRecoveryError,
|
|
54
|
+
Phronomy::Agent::DispatchRecoveryResult,
|
|
55
|
+
Phronomy::Agent::InitialPreparationRecovery,
|
|
56
|
+
Phronomy::Agent::InitialPreparationRecoveryError,
|
|
57
|
+
Phronomy::Agent::InitialPreparationRecoveryResult,
|
|
37
58
|
Phronomy::Agent::KnowledgeItem,
|
|
38
59
|
Phronomy::Agent::Retention,
|
|
39
60
|
Phronomy::Agent::ExecutionExtensionState,
|
|
@@ -51,10 +72,16 @@ PUBLIC_API_ENTRIES = [
|
|
|
51
72
|
Phronomy::Workflow,
|
|
52
73
|
Phronomy::Workflow::Builder,
|
|
53
74
|
Phronomy::WorkflowTaskResumeError,
|
|
75
|
+
Phronomy::WorkflowTerminalRecovery,
|
|
76
|
+
Phronomy::WorkflowTerminalRecoveryError,
|
|
77
|
+
Phronomy::WorkflowTerminalRecoveryResult,
|
|
54
78
|
Phronomy::WorkflowContext,
|
|
55
79
|
Phronomy::Runnable,
|
|
56
80
|
Phronomy::Context::PromptTemplate,
|
|
57
81
|
# Beta
|
|
82
|
+
Phronomy::Agent::ExecutionRejectedError,
|
|
83
|
+
Phronomy::Agent::ExecutionChange,
|
|
84
|
+
Phronomy::MultiAgent::Store,
|
|
58
85
|
Phronomy::PersistenceComposition,
|
|
59
86
|
Phronomy::Tool::Schema,
|
|
60
87
|
Phronomy::Tool::CallRequest,
|
|
@@ -70,6 +97,7 @@ PUBLIC_API_ENTRIES = [
|
|
|
70
97
|
Phronomy::MultiAgent::Handoff,
|
|
71
98
|
Phronomy::MultiAgent::HandoffPolicy,
|
|
72
99
|
Phronomy::MultiAgent::HandoffRunner,
|
|
100
|
+
Phronomy::MultiAgent::HandoffFinalizationError,
|
|
73
101
|
Phronomy::MultiAgent::Orchestrator,
|
|
74
102
|
Phronomy::MultiAgent::Orchestrator::ChildCleanupError,
|
|
75
103
|
Phronomy::MultiAgent::TeamCoordinator,
|
|
@@ -84,6 +112,9 @@ PUBLIC_API_ENTRIES = [
|
|
|
84
112
|
Phronomy::Tracing::Base,
|
|
85
113
|
Phronomy::Tracing::NullTracer,
|
|
86
114
|
Phronomy::Tools::Mcp,
|
|
115
|
+
Phronomy::Tools::Mcp::CleanupHandle,
|
|
116
|
+
Phronomy::Tools::Mcp::CleanupTransfer,
|
|
117
|
+
Phronomy::Tools::Mcp::CleanupError,
|
|
87
118
|
Phronomy::Tools::Agent,
|
|
88
119
|
Phronomy::Tools::VectorSearch
|
|
89
120
|
].freeze
|
|
@@ -111,12 +142,26 @@ def snapshot_entry(klass)
|
|
|
111
142
|
internal_methods = case klass.name
|
|
112
143
|
when "Phronomy::InvocationContext" then %i[__bind_execution __execution_scope]
|
|
113
144
|
when "Phronomy::Tool::Schema" then %i[for_tool_instance]
|
|
145
|
+
when "Phronomy::Agent::ExecutionChange" then %i[captured_evidence perform]
|
|
146
|
+
when "Phronomy::Tools::Mcp::CleanupHandle" then %i[acquire attach check_admission! close_entry]
|
|
147
|
+
when "Phronomy::Tools::Mcp::CleanupTransfer" then %i[receiver?]
|
|
114
148
|
else []
|
|
115
149
|
end
|
|
116
150
|
instance_methods = (klass.public_instance_methods - BASELINE_INSTANCE_METHODS - internal_methods).sort
|
|
151
|
+
# Runtime exposes framework-facing Ruby methods; snapshot only its documented management boundary.
|
|
152
|
+
instance_methods &= %i[reconcile_shutdown shutdown] if klass == Phronomy::Runtime
|
|
153
|
+
instance_methods &= %i[forget_subagents] if klass == Phronomy::MultiAgent::Store
|
|
154
|
+
# Data supplies VM-dependent helpers; the receipt contract is its own named fields.
|
|
155
|
+
instance_methods &= klass.public_instance_methods(false) if klass == Phronomy::StoppedTerminalCustody::Receipt
|
|
117
156
|
# Ruby visibility does not promote a documented framework helper to API.
|
|
118
|
-
internal_class_methods =
|
|
157
|
+
internal_class_methods = case klass.name
|
|
158
|
+
when "Phronomy::MultiAgent::Orchestrator" then %i[__subagent_tool_name]
|
|
159
|
+
when "Phronomy::Agent::ExecutionChange" then %i[read_agent_evidence]
|
|
160
|
+
when "Phronomy::MultiAgent::Store" then %i[configured install_configured_provider]
|
|
161
|
+
else []
|
|
162
|
+
end
|
|
119
163
|
class_methods = (klass.public_methods(false) - BASELINE_CLASS_METHODS - internal_class_methods).sort
|
|
164
|
+
class_methods &= %i[instance reset_default!] if klass == Phronomy::Runtime
|
|
120
165
|
{
|
|
121
166
|
"name" => klass.name,
|
|
122
167
|
"type" => "class",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module MultiAgent
|
|
3
|
+
class TeamCancellationRequest
|
|
4
|
+
attr_reader team_execution_id: String
|
|
5
|
+
attr_reader token: Phronomy::Concurrency::CancellationToken
|
|
6
|
+
attr_reader observations: Hash[String, Array[Phronomy::TaskResult[untyped]]]
|
|
7
|
+
def initialize: (team_execution_id: String, admissions: untyped) -> void
|
|
8
|
+
def attach: () -> Object
|
|
9
|
+
def request: (Object registration) -> bool
|
|
10
|
+
def pending?: () -> bool
|
|
11
|
+
def failure: () -> Exception?
|
|
12
|
+
def failed: (Exception error) -> untyped
|
|
13
|
+
def confirm: (cancel: bool, ?terminal: bool) -> untyped
|
|
14
|
+
def terminal: () -> untyped
|
|
15
|
+
def detach: (Object registration) -> untyped
|
|
16
|
+
def wait: [R] (Phronomy::TaskResult[R] operation) { () -> untyped } -> R
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module Agent
|
|
3
|
+
class ApprovalRecovery
|
|
4
|
+
attr_reader agent_id: String
|
|
5
|
+
attr_reader execution_id: String
|
|
6
|
+
attr_reader approval_request_id: String
|
|
7
|
+
attr_reader recovery_id: String
|
|
8
|
+
attr_reader approved: bool
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
class ApprovalRecoveryError < Phronomy::Error
|
|
12
|
+
attr_reader recovery: ApprovalRecovery
|
|
13
|
+
attr_reader agent_id: String
|
|
14
|
+
attr_reader execution_id: String
|
|
15
|
+
attr_reader approval_request_id: String
|
|
16
|
+
attr_reader recovery_id: String
|
|
17
|
+
attr_reader approved: bool
|
|
18
|
+
attr_reader original_error: Exception?
|
|
19
|
+
def cause: () -> Exception?
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def initialize: (recovery: ApprovalRecovery, error: Exception?, ?original_error: Exception?) -> void
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class ApprovalRecoveryResult
|
|
27
|
+
attr_reader recovery: ApprovalRecovery
|
|
28
|
+
attr_reader agent_id: String
|
|
29
|
+
attr_reader execution_id: String
|
|
30
|
+
attr_reader approval_request_id: String
|
|
31
|
+
attr_reader recovery_id: String
|
|
32
|
+
attr_reader approved: bool
|
|
33
|
+
attr_reader outcome: :confirmed_pre | :confirmed_post | :unresolved | :unavailable
|
|
34
|
+
attr_reader application_state: :pending | :applied
|
|
35
|
+
attr_reader continuation_state: :pending | :restored | :resumed
|
|
36
|
+
attr_reader revision: Integer?
|
|
37
|
+
attr_reader execution_task: TaskResult[execution_result | ApprovalWait]?
|
|
38
|
+
attr_reader hosted_invocation: HostedInvocation?
|
|
39
|
+
attr_reader error: Exception?
|
|
40
|
+
def physical_complete?: () -> bool
|
|
41
|
+
def resolved?: () -> bool
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def initialize: (recovery: ApprovalRecovery,
|
|
46
|
+
outcome: :confirmed_pre | :confirmed_post | :unresolved | :unavailable,
|
|
47
|
+
application_state: :pending | :applied,
|
|
48
|
+
continuation_state: :pending | :restored | :resumed,
|
|
49
|
+
physical_complete: bool,
|
|
50
|
+
?revision: Integer?, ?execution_task: TaskResult[execution_result | ApprovalWait]?,
|
|
51
|
+
?hosted_invocation: HostedInvocation?, ?error: Exception?) -> void
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module Agent
|
|
3
|
+
class DispatchRecovery
|
|
4
|
+
attr_reader agent_id: String
|
|
5
|
+
attr_reader execution_id: String
|
|
6
|
+
attr_reader recovery_id: String
|
|
7
|
+
attr_reader dispatch_kind: :provider | :tool
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class DispatchRecoveryError < Phronomy::Error
|
|
11
|
+
attr_reader recovery: DispatchRecovery
|
|
12
|
+
attr_reader agent_id: String
|
|
13
|
+
attr_reader execution_id: String
|
|
14
|
+
attr_reader recovery_id: String
|
|
15
|
+
attr_reader dispatch_kind: :provider | :tool
|
|
16
|
+
attr_reader original_error: Exception?
|
|
17
|
+
def cause: () -> Exception?
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def initialize: (recovery: DispatchRecovery, error: Exception?, ?original_error: Exception?) -> void
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class DispatchRecoveryResult
|
|
25
|
+
attr_reader recovery: DispatchRecovery
|
|
26
|
+
attr_reader agent_id: String
|
|
27
|
+
attr_reader execution_id: String
|
|
28
|
+
attr_reader recovery_id: String
|
|
29
|
+
attr_reader dispatch_kind: :provider | :tool
|
|
30
|
+
attr_reader outcome: :confirmed_pre | :confirmed_post | :not_prepared | :unresolved | :unavailable
|
|
31
|
+
attr_reader application_state: :pending | :applied
|
|
32
|
+
attr_reader continuation_state: :pending | :resumed | :stopped
|
|
33
|
+
attr_reader revision: Integer?
|
|
34
|
+
attr_reader execution_task: TaskResult[execution_result]?
|
|
35
|
+
attr_reader error: Exception?
|
|
36
|
+
def physical_complete?: () -> bool
|
|
37
|
+
def resolved?: () -> bool
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
def initialize: (recovery: DispatchRecovery,
|
|
42
|
+
outcome: :confirmed_pre | :confirmed_post | :not_prepared | :unresolved | :unavailable,
|
|
43
|
+
application_state: :pending | :applied,
|
|
44
|
+
continuation_state: :pending | :resumed | :stopped,
|
|
45
|
+
physical_complete: bool,
|
|
46
|
+
?revision: Integer?, ?execution_task: TaskResult[execution_result]?, ?error: Exception?) -> void
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -101,8 +101,11 @@ module Phronomy
|
|
|
101
101
|
attr_reader correlation: Hash[String, json_value]?
|
|
102
102
|
attr_reader coordinator: ::Phronomy::Persistence
|
|
103
103
|
def finishing?: () -> bool
|
|
104
|
+
def captured_evidence: () -> Hash[Symbol, untyped]?
|
|
105
|
+
def self.read_agent_evidence: (store: Store, agent_id: String, execution_id: String, journal_position: Integer, scope: ::Phronomy::Persistence::Transaction) -> Array[untyped]
|
|
104
106
|
def prepare_in: (::Phronomy::Persistence::Transaction scope) -> nil
|
|
105
|
-
def
|
|
107
|
+
def prepare_approval_in: (::Phronomy::Persistence::Transaction scope) -> (:not_requested | :ready | :invalid | :unavailable)
|
|
108
|
+
def commit_in: (::Phronomy::Persistence::Transaction scope, ?state: ExecutionExtensionState?, ?transfer_receipt: Hash[String, json_value]?, ?pending: bool, ?fail_unavailable_approval: bool) -> nil
|
|
106
109
|
def transfer_context: (::Phronomy::Persistence::Transaction scope) -> TransferContext
|
|
107
110
|
end
|
|
108
111
|
|
|
@@ -6,6 +6,8 @@ module Phronomy
|
|
|
6
6
|
def self.current: () -> ExecutionEnvironment
|
|
7
7
|
def registry: () -> untyped
|
|
8
8
|
def existing_registry: () -> untyped
|
|
9
|
+
def assert_custody_query_available!: () -> void
|
|
10
|
+
def with_idle_history_owners: [R] (persistence: Store, executions: Hash[String, Array[String]], ?anchor: Base?) { () -> R } -> R
|
|
9
11
|
def ownership: () -> untyped
|
|
10
12
|
def existing_ownership: () -> untyped
|
|
11
13
|
def executing?: () -> bool
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module Agent
|
|
3
|
+
class InitialPreparationRecovery
|
|
4
|
+
attr_reader agent_id: String
|
|
5
|
+
attr_reader execution_id: String
|
|
6
|
+
attr_reader recovery_id: String
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class InitialPreparationRecoveryError < Phronomy::Error
|
|
10
|
+
attr_reader recovery: InitialPreparationRecovery
|
|
11
|
+
attr_reader agent_id: String
|
|
12
|
+
attr_reader execution_id: String
|
|
13
|
+
attr_reader recovery_id: String
|
|
14
|
+
attr_reader original_error: Exception?
|
|
15
|
+
def cause: () -> Exception?
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def initialize: (recovery: InitialPreparationRecovery, error: Exception?, ?original_error: Exception?) -> void
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class InitialPreparationRecoveryResult
|
|
23
|
+
attr_reader recovery: InitialPreparationRecovery
|
|
24
|
+
attr_reader agent_id: String
|
|
25
|
+
attr_reader execution_id: String
|
|
26
|
+
attr_reader recovery_id: String
|
|
27
|
+
attr_reader stage: :admission | :activation | :failure
|
|
28
|
+
attr_reader outcome: :confirmed_pre | :confirmed_post | :not_prepared | :unresolved | :unavailable
|
|
29
|
+
attr_reader application_state: :pending | :applied
|
|
30
|
+
attr_reader continuation_state: :pending | :resumed | :stopped
|
|
31
|
+
attr_reader revision: Integer?
|
|
32
|
+
attr_reader execution_task: TaskResult[execution_result]?
|
|
33
|
+
attr_reader error: Exception?
|
|
34
|
+
def physical_complete?: () -> bool
|
|
35
|
+
def resolved?: () -> bool
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def initialize: (recovery: InitialPreparationRecovery,
|
|
40
|
+
stage: :admission | :activation | :failure,
|
|
41
|
+
outcome: :confirmed_pre | :confirmed_post | :not_prepared | :unresolved | :unavailable,
|
|
42
|
+
application_state: :pending | :applied,
|
|
43
|
+
continuation_state: :pending | :resumed | :stopped,
|
|
44
|
+
physical_complete: bool,
|
|
45
|
+
?revision: Integer?, ?execution_task: TaskResult[execution_result]?, ?error: Exception?) -> void
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module Agent
|
|
3
|
+
class OutcomeRecovery
|
|
4
|
+
attr_reader agent_id: String
|
|
5
|
+
attr_reader execution_id: String
|
|
6
|
+
attr_reader recovery_id: String
|
|
7
|
+
attr_reader expected_execution_revision: Integer
|
|
8
|
+
def output_text_required?: () -> bool
|
|
9
|
+
def new_stopped_recipient: () -> Phronomy::StoppedTerminalCustody
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class OutcomeRecoveryError < Phronomy::Error
|
|
13
|
+
attr_reader recovery: OutcomeRecovery
|
|
14
|
+
attr_reader agent_id: String
|
|
15
|
+
attr_reader execution_id: String
|
|
16
|
+
attr_reader recovery_id: String
|
|
17
|
+
attr_reader original_error: Exception?
|
|
18
|
+
def cause: () -> Exception?
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def initialize: (recovery: OutcomeRecovery, error: Exception?, ?original_error: Exception?) -> void
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class OutcomeRecoveryResult
|
|
26
|
+
attr_reader recovery: OutcomeRecovery
|
|
27
|
+
attr_reader agent_id: String
|
|
28
|
+
attr_reader execution_id: String
|
|
29
|
+
attr_reader recovery_id: String
|
|
30
|
+
attr_reader outcome: :confirmed_post | :confirmed_pre | :unresolved | :unavailable
|
|
31
|
+
attr_reader saved_outcome: (:terminal | :coordination_wait | :approval_wait)?
|
|
32
|
+
attr_reader approval_request: ToolApprovalRequest?
|
|
33
|
+
attr_reader application_state: :pending | :applied
|
|
34
|
+
attr_reader ownership_state: :retained | :released | :transferred
|
|
35
|
+
attr_reader revision: Integer?
|
|
36
|
+
attr_reader execution: ExecutionObservation?
|
|
37
|
+
attr_reader error: Exception?
|
|
38
|
+
attr_reader submission_state: :not_admitted | :admitted | :unknown
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def initialize: (recovery: OutcomeRecovery,
|
|
43
|
+
outcome: :confirmed_post | :confirmed_pre | :unresolved | :unavailable,
|
|
44
|
+
application_state: :pending | :applied,
|
|
45
|
+
ownership_state: :retained | :released | :transferred,
|
|
46
|
+
?saved_outcome: (:terminal | :coordination_wait | :approval_wait)?,
|
|
47
|
+
?revision: Integer?, ?execution: ExecutionObservation?, ?approval_request: ToolApprovalRequest?, ?error: Exception?,
|
|
48
|
+
?submission_state: :not_admitted | :admitted | :unknown) -> void
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module Agent
|
|
3
|
+
class AgentExecution
|
|
4
|
+
attr_reader agent_id: String
|
|
5
|
+
attr_reader execution_id: String
|
|
6
|
+
attr_reader execution_revision: Integer
|
|
7
|
+
def terminal?: () -> bool
|
|
8
|
+
def to_h: () -> Hash[String, untyped]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
class AgentRoot
|
|
12
|
+
attr_reader agent_id: String
|
|
13
|
+
attr_reader agent_revision: Integer
|
|
14
|
+
attr_reader journal_position: Integer
|
|
15
|
+
def to_h: () -> Hash[String, untyped]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class JournalRecord
|
|
19
|
+
attr_reader record_id: String
|
|
20
|
+
attr_reader agent_id: String
|
|
21
|
+
attr_reader sequence: Integer?
|
|
22
|
+
def to_h: () -> Hash[String, untyped]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Private persistence building block; no live-owner lifecycle API.
|
|
26
|
+
class TerminalPersistenceEvidence
|
|
27
|
+
class ContentWrite < Data
|
|
28
|
+
attr_reader reference: String
|
|
29
|
+
attr_reader bytes: String
|
|
30
|
+
attr_reader canonicalization_version: Integer
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class Outcome < Data
|
|
34
|
+
attr_reader type: :completed | :failed | :coordination_wait | :suspended
|
|
35
|
+
attr_reader execution: AgentExecution
|
|
36
|
+
attr_reader root: AgentRoot
|
|
37
|
+
attr_reader appended_records: Array[JournalRecord]
|
|
38
|
+
attr_reader execution_observation: ExecutionObservation?
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class CapturedInput
|
|
42
|
+
attr_reader values: Hash[Symbol, untyped]
|
|
43
|
+
def materialize: (persistence: Store) -> TerminalPersistenceEvidence?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class Result < Data
|
|
47
|
+
attr_reader disposition: :committed | :not_committed | :unknown
|
|
48
|
+
attr_reader evidence: TerminalPersistenceEvidence
|
|
49
|
+
attr_reader original_error: Exception?
|
|
50
|
+
attr_reader read_error: Exception?
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
attr_reader before: Array[untyped]
|
|
54
|
+
attr_reader after: Array[untyped]
|
|
55
|
+
attr_reader outcome: Outcome
|
|
56
|
+
attr_reader content_writes: Array[ContentWrite]
|
|
57
|
+
attr_reader attempt_id: String
|
|
58
|
+
attr_reader agent_id: String
|
|
59
|
+
attr_reader execution_id: String
|
|
60
|
+
def self.capture: (ExecutionChange, Array[ContentWrite], persistence: Store, ?participant: untyped) -> instance?
|
|
61
|
+
def reconcile: (persistence: Store, ?original_error: Exception?) -> Result
|
|
62
|
+
def retry: (persistence: Store, ?original_error: Exception?) -> Result
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Private staged values; materialization returns a complete semantic input.
|
|
66
|
+
class OutcomePreparation
|
|
67
|
+
def materialize: (persistence: Store) -> TerminalPersistenceEvidence::CapturedInput
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Exact retained record prefix awaiting an independently supplied text fact.
|
|
71
|
+
class OutcomeTextProjection
|
|
72
|
+
def missing?: () -> bool
|
|
73
|
+
def materialize: (persistence: Store) -> TerminalPersistenceEvidence::CapturedInput
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Private original-owner lane for a validated native terminal subject.
|
|
77
|
+
class OutcomePlanning
|
|
78
|
+
def reconcile: (persistence: Store) -> ::Phronomy::Persistence::SaveOutcome
|
|
79
|
+
def materialize: (persistence: Store) -> TerminalPersistenceEvidence::CapturedInput
|
|
80
|
+
def materialize_in: (::Phronomy::Persistence::Transaction scope, ?recovering: bool) -> TerminalPersistenceEvidence::CapturedInput
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class ExecutionOutcomeCommitter
|
|
84
|
+
class Command < Data
|
|
85
|
+
attr_reader execution_id: String
|
|
86
|
+
attr_reader fsm_session_id: String?
|
|
87
|
+
attr_reader expected_execution_revision: Integer
|
|
88
|
+
attr_reader root: AgentRoot
|
|
89
|
+
attr_reader journal_records: Array[JournalRecord]
|
|
90
|
+
attr_reader execution: AgentExecution
|
|
91
|
+
attr_reader runtime_snapshot: Hash[Symbol, untyped]
|
|
92
|
+
attr_reader terminal_view: untyped
|
|
93
|
+
attr_reader state_required: bool
|
|
94
|
+
attr_reader wiring: Hash[Symbol, untyped]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
class Outcome < Data
|
|
98
|
+
attr_reader type: Symbol
|
|
99
|
+
attr_reader execution: AgentExecution
|
|
100
|
+
attr_reader root: AgentRoot
|
|
101
|
+
attr_reader appended_records: Array[JournalRecord]
|
|
102
|
+
attr_reader result: Hash[Symbol, untyped]?
|
|
103
|
+
attr_reader error: Exception?
|
|
104
|
+
attr_reader approval_request: ToolApprovalRequest?
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def initialize: (agent: Base, persistence: Store) -> void
|
|
108
|
+
def commit_outcome: (Command, ?on_evidence: (^(TerminalPersistenceEvidence) -> untyped)?, ?on_outcome: (^(Outcome) -> untyped)?, ?on_prepared: (^(TerminalPersistenceEvidence::CapturedInput) -> untyped)?, ?on_preparation: (^(OutcomePreparation | OutcomeTextProjection) -> untyped)?, ?on_planning: (^(OutcomePlanning) -> untyped)?, ?on_observation: (^(ExecutionObservation?, cancellation_requested: bool) -> untyped)?) -> Outcome
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
module Agent
|
|
3
|
+
class TerminalRecovery
|
|
4
|
+
def new_stopped_recipient: () -> Phronomy::StoppedTerminalCustody
|
|
5
|
+
attr_reader agent_id: String
|
|
6
|
+
attr_reader execution_id: String
|
|
7
|
+
attr_reader recovery_id: String
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class TerminalRecoveryError < Phronomy::Error
|
|
11
|
+
attr_reader recovery: TerminalRecovery
|
|
12
|
+
attr_reader agent_id: String
|
|
13
|
+
attr_reader execution_id: String
|
|
14
|
+
attr_reader recovery_id: String
|
|
15
|
+
attr_reader original_error: Exception?
|
|
16
|
+
def cause: () -> Exception?
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def initialize: (recovery: TerminalRecovery, error: Exception?, ?original_error: Exception?) -> void
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class TerminalRecoveryResult
|
|
24
|
+
attr_reader recovery: TerminalRecovery
|
|
25
|
+
attr_reader agent_id: String
|
|
26
|
+
attr_reader execution_id: String
|
|
27
|
+
attr_reader recovery_id: String
|
|
28
|
+
attr_reader outcome: :confirmed_post | :confirmed_pre | :unresolved | :unavailable
|
|
29
|
+
attr_reader application_state: :pending | :applied
|
|
30
|
+
attr_reader ownership_state: :retained | :released | :transferred
|
|
31
|
+
attr_reader revision: Integer?
|
|
32
|
+
attr_reader execution: ExecutionObservation?
|
|
33
|
+
attr_reader error: Exception?
|
|
34
|
+
attr_reader submission_state: :not_admitted | :admitted | :unknown
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def initialize: (recovery: TerminalRecovery,
|
|
39
|
+
outcome: :confirmed_post | :confirmed_pre | :unresolved | :unavailable,
|
|
40
|
+
application_state: :pending | :applied,
|
|
41
|
+
ownership_state: :retained | :released | :transferred,
|
|
42
|
+
?revision: Integer?, ?execution: ExecutionObservation?, ?error: Exception?,
|
|
43
|
+
?submission_state: :not_admitted | :admitted | :unknown) -> void
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/sig/phronomy/agent.rbs
CHANGED
|
@@ -29,6 +29,12 @@ module Phronomy
|
|
|
29
29
|
?violations: Array[Hash[String, untyped]], ?raw_output: untyped) -> void
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
class ExecutionRejectedError < Phronomy::Error
|
|
33
|
+
attr_reader agent_id: String
|
|
34
|
+
attr_reader execution_id: String
|
|
35
|
+
def initialize: (String message, agent_id: String, execution_id: String) -> void
|
|
36
|
+
end
|
|
37
|
+
|
|
32
38
|
interface _BeforeLLMInputHook
|
|
33
39
|
def call: (Phronomy::Context::LLMInputBuildContext context) -> Phronomy::Context::LLMInputPatch?
|
|
34
40
|
end
|
|
@@ -57,6 +63,7 @@ module Phronomy
|
|
|
57
63
|
def initialize: (execution_id: String, items: Array[Item], ?id: String, ?created_at: untyped) -> void
|
|
58
64
|
def self.from_h: (Hash[untyped, untyped]) -> ToolApprovalRequest
|
|
59
65
|
def to_h: () -> Hash[Symbol, untyped]
|
|
66
|
+
def persistence_payload: () -> Hash[Symbol, untyped]
|
|
60
67
|
end
|
|
61
68
|
|
|
62
69
|
class ApprovalEvaluationRequest
|
|
@@ -101,6 +108,7 @@ module Phronomy
|
|
|
101
108
|
def self.create: (?agent_id: String, ?context: untyped, ?knowledge: Array[KnowledgeItem], ?retention: Retention?, ?persistence: Store?, ?metadata: Hash[untyped, untyped], ?on_event: ^(untyped) -> void) ?{ (untyped event) -> void } -> instance
|
|
102
109
|
def self.load: (String agent_id, persistence: Store, ?execution_wiring: execution_wiring, ?on_event: ^(untyped) -> void) ?{ (untyped event) -> void } -> instance
|
|
103
110
|
def self.get: (String agent_id) -> instance?
|
|
111
|
+
def self.reconcile_identity: (String agent_id, persistence: Store) -> (:committed | :not_committed | :superseded | :unknown | nil)
|
|
104
112
|
def self.live_for_execution: (String execution_id) -> instance
|
|
105
113
|
|
|
106
114
|
def initialize: (?agent_id: String?, ?context: untyped, ?knowledge: Array[KnowledgeItem], ?retention: Retention?, ?persistence: Store?, ?metadata: Hash[untyped, untyped], ?on_event: ^(untyped) -> void) ?{ (untyped event) -> void } -> void
|
|
@@ -114,6 +122,34 @@ module Phronomy
|
|
|
114
122
|
def resume_async: (String execution_id, ?config: Hash[Symbol, Object]) -> TaskResult[execution_result]
|
|
115
123
|
def resume: (String execution_id, ?config: Hash[Symbol, Object]) -> execution_result
|
|
116
124
|
def cancel_async: (String execution_id) -> TaskResult[ExecutionObservation]
|
|
125
|
+
def pending_terminal_recovery: (execution_id: String) -> TerminalRecovery?
|
|
126
|
+
def reconcile_terminal_async: (recovery: TerminalRecovery) -> TaskResult[TerminalRecoveryResult]
|
|
127
|
+
def reconcile_terminal: (recovery: TerminalRecovery) -> TerminalRecoveryResult
|
|
128
|
+
def retry_terminal_async: (recovery: TerminalRecovery) -> TaskResult[TerminalRecoveryResult]
|
|
129
|
+
def retry_terminal: (recovery: TerminalRecovery) -> TerminalRecoveryResult
|
|
130
|
+
def retry_terminal_submission_async: (recovery: TerminalRecovery) -> TaskResult[TerminalRecoveryResult]
|
|
131
|
+
def retry_terminal_submission: (recovery: TerminalRecovery) -> TerminalRecoveryResult
|
|
132
|
+
def pending_outcome_recovery: (execution_id: String) -> OutcomeRecovery?
|
|
133
|
+
def supply_outcome_text: (recovery: OutcomeRecovery, expected_revision: Integer, text: String) -> bool
|
|
134
|
+
def reconcile_outcome_async: (recovery: OutcomeRecovery) -> TaskResult[OutcomeRecoveryResult]
|
|
135
|
+
def reconcile_outcome: (recovery: OutcomeRecovery) -> OutcomeRecoveryResult
|
|
136
|
+
def retry_outcome_async: (recovery: OutcomeRecovery) -> TaskResult[OutcomeRecoveryResult]
|
|
137
|
+
def retry_outcome: (recovery: OutcomeRecovery) -> OutcomeRecoveryResult
|
|
138
|
+
def retry_outcome_submission_async: (recovery: OutcomeRecovery) -> TaskResult[OutcomeRecoveryResult]
|
|
139
|
+
def retry_outcome_submission: (recovery: OutcomeRecovery) -> OutcomeRecoveryResult
|
|
140
|
+
def pending_approval_recovery: (execution_id: String) -> ApprovalRecovery?
|
|
141
|
+
def reconcile_approval_async: (recovery: ApprovalRecovery) -> TaskResult[ApprovalRecoveryResult]
|
|
142
|
+
def reconcile_approval: (recovery: ApprovalRecovery) -> ApprovalRecoveryResult
|
|
143
|
+
def pending_dispatch_recovery: (execution_id: String) -> DispatchRecovery?
|
|
144
|
+
def reconcile_dispatch_async: (recovery: DispatchRecovery) -> TaskResult[DispatchRecoveryResult]
|
|
145
|
+
def reconcile_dispatch: (recovery: DispatchRecovery) -> DispatchRecoveryResult
|
|
146
|
+
def retry_dispatch_async: (recovery: DispatchRecovery) -> TaskResult[DispatchRecoveryResult]
|
|
147
|
+
def retry_dispatch: (recovery: DispatchRecovery) -> DispatchRecoveryResult
|
|
148
|
+
def pending_initial_preparation_recovery: () -> InitialPreparationRecovery?
|
|
149
|
+
def reconcile_initial_preparation_async: (recovery: InitialPreparationRecovery) -> TaskResult[InitialPreparationRecoveryResult]
|
|
150
|
+
def reconcile_initial_preparation: (recovery: InitialPreparationRecovery) -> InitialPreparationRecoveryResult
|
|
151
|
+
def retry_initial_preparation_async: (recovery: InitialPreparationRecovery) -> TaskResult[InitialPreparationRecoveryResult]
|
|
152
|
+
def retry_initial_preparation: (recovery: InitialPreparationRecovery) -> InitialPreparationRecoveryResult
|
|
117
153
|
attr_accessor before_llm_input: _BeforeLLMInputHook?
|
|
118
154
|
|
|
119
155
|
# Public operation methods no longer accept per-invocation event listeners
|
|
@@ -8,6 +8,8 @@ module Phronomy
|
|
|
8
8
|
class OffloadPool
|
|
9
9
|
@timer_queue_provider: (^() -> _TimerQueue)?
|
|
10
10
|
def initialize: (?pool_size: Integer, ?queue_size: Integer, ?name: (String | Symbol)?, ?logger: untyped, ?timer_queue_provider: (^() -> _TimerQueue)?) -> void
|
|
11
|
+
def submit: [V] (?timeout: Numeric?, ?cancellation_token: CancellationToken?, ?on_full: Symbol, ?full_timeout: Numeric?, ?on_rejected: (^(Exception) -> void)?) { () -> V } -> TaskResult[V]
|
|
12
|
+
def supports_submission_rejection?: () -> bool
|
|
11
13
|
def begin_shutdown: () -> self
|
|
12
14
|
def terminated?: () -> bool
|
|
13
15
|
def shutdown: (?drain_timeout: Numeric, ?deadline: Numeric?) -> self
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module Phronomy
|
|
2
2
|
module ExecutionBinding
|
|
3
|
-
def self.
|
|
3
|
+
def self.supports_submission_rejection?: () -> bool
|
|
4
|
+
def self.submit: [V] (?pool: _ExecutionPool?, ?runtime: _ExecutionRuntime?, ?pool_name: Symbol?, ?size: Integer, ?queue_size: Integer, ?timeout: Numeric?, ?cancellation_token: Concurrency::CancellationToken?, ?on_full: Symbol, ?on_rejected: (^(Exception) -> void)?) { () -> V } -> TaskResult[V]
|
|
4
5
|
def self.after: (Numeric seconds) { () -> void } -> ^() -> untyped
|
|
5
6
|
end
|
|
6
7
|
end
|