phronomy 0.17.0 → 0.18.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 +97 -1134
- data/README.md +68 -1280
- data/benchmark/bench_regression.rb +25 -5
- data/docs/changelog/0.14-and-earlier.md +1137 -0
- data/docs/decisions/008-orchestrator-uses-os-threads.md +46 -48
- data/docs/decisions/010-cooperative-first-concurrency.md +155 -235
- data/docs/features.md +87 -0
- data/docs/getting-started.md +351 -0
- data/docs/migrations/0.15.md +35 -0
- data/docs/migrations/0.16.md +43 -0
- data/docs/runtime-and-concurrency.md +258 -0
- data/examples/workflows/generic_task_event_mapping.rb +14 -6
- data/lib/phronomy/agent/agent_invocation_session_builder.rb +2 -2
- data/lib/phronomy/agent/async_event_api.rb +3 -3
- data/lib/phronomy/agent/base.rb +35 -19
- data/lib/phronomy/agent/context/capability/base.rb +13 -3
- data/lib/phronomy/agent/execution_coordinator.rb +6 -6
- data/lib/phronomy/agent/shared_state.rb +2 -0
- data/lib/phronomy/agent/tool_executor.rb +29 -71
- data/lib/phronomy/agent/tool_invocation.rb +97 -47
- data/lib/phronomy/agent/tool_invocation_session_builder.rb +55 -161
- data/lib/phronomy/configuration.rb +5 -29
- data/lib/phronomy/diagnostics.rb +12 -41
- data/lib/phronomy/engine/concurrency/async_queue.rb +5 -188
- data/lib/phronomy/engine/concurrency/cancellation_scope.rb +6 -7
- data/lib/phronomy/engine/concurrency/cancellation_token.rb +48 -3
- data/lib/phronomy/engine/concurrency/deadline.rb +2 -3
- data/lib/phronomy/engine/concurrency/offload_pool.rb +696 -0
- data/lib/phronomy/engine/concurrency/pool_registry.rb +5 -5
- data/lib/phronomy/engine/event_loop.rb +89 -190
- data/lib/phronomy/engine/runtime/timer_queue.rb +48 -71
- data/lib/phronomy/engine/runtime/timer_service.rb +13 -21
- data/lib/phronomy/engine/runtime.rb +45 -158
- data/lib/phronomy/engine/task.rb +136 -277
- data/lib/phronomy/llm_adapter/base.rb +14 -14
- data/lib/phronomy/llm_adapter/ruby_llm.rb +3 -4
- data/lib/phronomy/llm_adapter.rb +2 -2
- data/lib/phronomy/metrics.rb +15 -30
- data/lib/phronomy/multi_agent/fan_out_invocation.rb +146 -0
- data/lib/phronomy/multi_agent/fan_out_session_builder.rb +125 -0
- data/lib/phronomy/multi_agent/handoff.rb +1 -0
- data/lib/phronomy/multi_agent/orchestrator.rb +147 -99
- data/lib/phronomy/multi_agent/team_coordinator.rb +2 -0
- data/lib/phronomy/testing/eval/comparison.rb +23 -0
- data/lib/phronomy/testing/eval/dataset.rb +27 -0
- data/lib/phronomy/testing/eval/eval_case.rb +13 -0
- data/lib/phronomy/testing/eval/eval_result.rb +16 -0
- data/lib/phronomy/testing/eval/metrics.rb +43 -0
- data/lib/phronomy/testing/eval/runner.rb +52 -0
- data/lib/phronomy/testing/eval/scorer/base.rb +15 -0
- data/lib/phronomy/testing/eval/scorer/exact_match.rb +25 -0
- data/lib/phronomy/testing/eval/scorer/includes_scorer.rb +25 -0
- data/lib/phronomy/testing/eval/scorer/llm_judge.rb +46 -0
- data/lib/phronomy/testing/eval/scorer.rb +10 -0
- data/lib/phronomy/testing/eval.rb +9 -0
- data/lib/phronomy/testing/fake_clock.rb +6 -53
- data/lib/phronomy/testing.rb +2 -6
- data/lib/phronomy/tools/agent.rb +141 -6
- data/lib/phronomy/vector_store/async_backend.rb +21 -17
- data/lib/phronomy/vector_store/base.rb +2 -2
- data/lib/phronomy/vector_store/embeddings/base.rb +6 -5
- data/lib/phronomy/version.rb +1 -1
- data/lib/phronomy/workflow_runner.rb +2 -4
- data/lib/phronomy.rb +7 -4
- data/scripts/api_snapshot.rb +4 -4
- metadata +23 -31
- data/lib/phronomy/engine/concurrency/blocking_adapter_pool.rb +0 -561
- data/lib/phronomy/engine/runtime/deterministic_scheduler.rb +0 -439
- data/lib/phronomy/engine/runtime/fake_scheduler.rb +0 -165
- data/lib/phronomy/engine/runtime/runtime_metrics.rb +0 -116
- data/lib/phronomy/engine/runtime/scheduler.rb +0 -98
- data/lib/phronomy/engine/runtime/scheduler_timer_adapter.rb +0 -79
- data/lib/phronomy/engine/runtime/task_registry.rb +0 -95
- data/lib/phronomy/engine/runtime/thread_scheduler.rb +0 -30
- data/lib/phronomy/engine/task/backend.rb +0 -80
- data/lib/phronomy/engine/task/deferred_backend.rb +0 -73
- data/lib/phronomy/engine/task/fiber_backend.rb +0 -157
- data/lib/phronomy/engine/task/immediate_backend.rb +0 -89
- data/lib/phronomy/engine/task/mapped_backend.rb +0 -90
- data/lib/phronomy/engine/task/thread_backend.rb +0 -84
- data/lib/phronomy/engine/task_group.rb +0 -193
- data/lib/phronomy/eval/comparison.rb +0 -47
- data/lib/phronomy/eval/dataset.rb +0 -45
- data/lib/phronomy/eval/eval_case.rb +0 -17
- data/lib/phronomy/eval/eval_result.rb +0 -29
- data/lib/phronomy/eval/metrics.rb +0 -66
- data/lib/phronomy/eval/runner.rb +0 -94
- data/lib/phronomy/eval/scorer/base.rb +0 -22
- data/lib/phronomy/eval/scorer/exact_match.rb +0 -31
- data/lib/phronomy/eval/scorer/includes_scorer.rb +0 -32
- data/lib/phronomy/eval/scorer/llm_judge.rb +0 -72
- data/lib/phronomy/eval/scorer.rb +0 -9
- data/lib/phronomy/eval.rb +0 -7
- data/lib/phronomy/testing/fake_scheduler.rb +0 -104
- data/lib/phronomy/testing/scheduler_helpers.rb +0 -68
|
@@ -19,18 +19,19 @@ module Phronomy
|
|
|
19
19
|
raise NotImplementedError, "#{self.class}#embed is not implemented"
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
# Submits an {#embed} call to {
|
|
23
|
-
# {
|
|
22
|
+
# Submits an {#embed} call to {OffloadPool} and returns an
|
|
23
|
+
# {OffloadPool::PendingOperation}.
|
|
24
24
|
#
|
|
25
25
|
# @param text [String]
|
|
26
26
|
# @param cancellation_token [Phronomy::Concurrency::CancellationToken, nil]
|
|
27
27
|
# @param timeout [Numeric, nil] seconds before the operation is abandoned
|
|
28
|
-
# @return [
|
|
28
|
+
# @return [OffloadPool::PendingOperation]
|
|
29
29
|
# @api public
|
|
30
30
|
def embed_async(text, cancellation_token = nil, timeout: nil)
|
|
31
|
-
Phronomy::Runtime.instance.
|
|
31
|
+
Phronomy::Runtime.instance.offload.submit(
|
|
32
32
|
timeout: timeout,
|
|
33
|
-
cancellation_token: cancellation_token
|
|
33
|
+
cancellation_token: cancellation_token,
|
|
34
|
+
on_full: :raise
|
|
34
35
|
) do
|
|
35
36
|
embed(text, cancellation_token)
|
|
36
37
|
end
|
data/lib/phronomy/version.rb
CHANGED
|
@@ -311,13 +311,11 @@ module Phronomy
|
|
|
311
311
|
end
|
|
312
312
|
|
|
313
313
|
def complete_task(task, value)
|
|
314
|
-
task.
|
|
315
|
-
task.transition!(:completed, value: value)
|
|
314
|
+
task.complete(value)
|
|
316
315
|
end
|
|
317
316
|
|
|
318
317
|
def fail_task(task, error)
|
|
319
|
-
task.
|
|
320
|
-
task.transition!(:failed, error: error)
|
|
318
|
+
task.fail(error)
|
|
321
319
|
end
|
|
322
320
|
|
|
323
321
|
def failed_task(name, error)
|
data/lib/phronomy.rb
CHANGED
|
@@ -38,7 +38,13 @@ module Phronomy
|
|
|
38
38
|
class ContextLengthError < Error; end
|
|
39
39
|
class CancellationError < Error; end
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
# Raised when a synchronous API would block the EventLoop control thread.
|
|
42
|
+
class EventLoopReentrancyError < Error; end
|
|
43
|
+
|
|
44
|
+
# Backward-compatible error class name for callers that still rescue the old
|
|
45
|
+
# scheduler-oriented exception. New code should use EventLoopReentrancyError.
|
|
46
|
+
class SchedulerReentrancyError < EventLoopReentrancyError; end
|
|
47
|
+
|
|
42
48
|
class RuntimeShutdownError < Error; end
|
|
43
49
|
class RuntimeShutdownReentrancyError < RuntimeShutdownError; end
|
|
44
50
|
|
|
@@ -63,9 +69,6 @@ module Phronomy
|
|
|
63
69
|
class PoolShutdownError < Error; end
|
|
64
70
|
class BackpressureError < Error; end
|
|
65
71
|
|
|
66
|
-
# Raised when a WorkflowContext field is mutated from a thread that does not
|
|
67
|
-
# own the context. Deliver asynchronous updates back to the Workflow as later
|
|
68
|
-
# events via Workflow#signal instead of mutating context from worker callbacks.
|
|
69
72
|
class WorkflowContextOwnershipError < Error; end
|
|
70
73
|
|
|
71
74
|
class << self
|
data/scripts/api_snapshot.rb
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
# scripts/api_snapshot.rb
|
|
5
5
|
#
|
|
6
|
-
# Dumps the public instance methods of all Stable/Beta
|
|
7
|
-
# JSON.
|
|
8
|
-
#
|
|
6
|
+
# Dumps the public instance methods of all Stable/Beta product API classes to
|
|
7
|
+
# JSON. Testing helpers are intentionally excluded from this compatibility gate.
|
|
8
|
+
# The snapshot is stored in spec/fixtures/api_snapshot.json and is used by
|
|
9
|
+
# spec/phronomy/api_compatibility_spec.rb to detect unintended API removals.
|
|
9
10
|
#
|
|
10
11
|
# Usage:
|
|
11
12
|
# ruby scripts/api_snapshot.rb --write
|
|
@@ -33,7 +34,6 @@ PUBLIC_API_ENTRIES = [
|
|
|
33
34
|
Phronomy::VectorStore::Embeddings::Base,
|
|
34
35
|
Phronomy::Tracing::Base,
|
|
35
36
|
Phronomy::Tracing::NullTracer,
|
|
36
|
-
Phronomy::Eval::Runner,
|
|
37
37
|
Phronomy::Tools::Mcp,
|
|
38
38
|
Phronomy::Tools::Agent,
|
|
39
39
|
Phronomy::Tools::VectorSearch
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: phronomy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Raizo T.C.S
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ruby_llm
|
|
@@ -104,6 +104,7 @@ files:
|
|
|
104
104
|
- benchmark/bench_vector_store.rb
|
|
105
105
|
- benchmark/bench_workflow.rb
|
|
106
106
|
- benchmark/run_all.rb
|
|
107
|
+
- docs/changelog/0.14-and-earlier.md
|
|
107
108
|
- docs/decisions/001-rubyllm-as-provider-layer.md
|
|
108
109
|
- docs/decisions/002-workflow-context-immutability.md
|
|
109
110
|
- docs/decisions/003-event-loop-singleton.md
|
|
@@ -118,7 +119,12 @@ files:
|
|
|
118
119
|
- docs/decisions/011-delegate-transport-policy-to-adapters.md
|
|
119
120
|
- docs/decisions/012-canonical-execution-log-and-context-policy.md
|
|
120
121
|
- docs/decisions/013-journal-backed-knowledge-as-context-candidates.md
|
|
122
|
+
- docs/features.md
|
|
123
|
+
- docs/getting-started.md
|
|
121
124
|
- docs/mcp-client.md
|
|
125
|
+
- docs/migrations/0.15.md
|
|
126
|
+
- docs/migrations/0.16.md
|
|
127
|
+
- docs/runtime-and-concurrency.md
|
|
122
128
|
- examples/workflows/agent_event_mapping.rb
|
|
123
129
|
- examples/workflows/generic_task_event_mapping.rb
|
|
124
130
|
- gemfiles/mcp_1_0.gemfile
|
|
@@ -184,44 +190,18 @@ files:
|
|
|
184
190
|
- lib/phronomy/context_budget_exceeded_error.rb
|
|
185
191
|
- lib/phronomy/diagnostics.rb
|
|
186
192
|
- lib/phronomy/engine/concurrency/async_queue.rb
|
|
187
|
-
- lib/phronomy/engine/concurrency/blocking_adapter_pool.rb
|
|
188
193
|
- lib/phronomy/engine/concurrency/cancellation_scope.rb
|
|
189
194
|
- lib/phronomy/engine/concurrency/cancellation_token.rb
|
|
190
195
|
- lib/phronomy/engine/concurrency/deadline.rb
|
|
196
|
+
- lib/phronomy/engine/concurrency/offload_pool.rb
|
|
191
197
|
- lib/phronomy/engine/concurrency/pool_registry.rb
|
|
192
198
|
- lib/phronomy/engine/event_loop.rb
|
|
193
199
|
- lib/phronomy/engine/fsm_session.rb
|
|
194
200
|
- lib/phronomy/engine/runtime.rb
|
|
195
|
-
- lib/phronomy/engine/runtime/deterministic_scheduler.rb
|
|
196
|
-
- lib/phronomy/engine/runtime/fake_scheduler.rb
|
|
197
|
-
- lib/phronomy/engine/runtime/runtime_metrics.rb
|
|
198
|
-
- lib/phronomy/engine/runtime/scheduler.rb
|
|
199
|
-
- lib/phronomy/engine/runtime/scheduler_timer_adapter.rb
|
|
200
201
|
- lib/phronomy/engine/runtime/shutdown_result.rb
|
|
201
|
-
- lib/phronomy/engine/runtime/task_registry.rb
|
|
202
|
-
- lib/phronomy/engine/runtime/thread_scheduler.rb
|
|
203
202
|
- lib/phronomy/engine/runtime/timer_queue.rb
|
|
204
203
|
- lib/phronomy/engine/runtime/timer_service.rb
|
|
205
204
|
- lib/phronomy/engine/task.rb
|
|
206
|
-
- lib/phronomy/engine/task/backend.rb
|
|
207
|
-
- lib/phronomy/engine/task/deferred_backend.rb
|
|
208
|
-
- lib/phronomy/engine/task/fiber_backend.rb
|
|
209
|
-
- lib/phronomy/engine/task/immediate_backend.rb
|
|
210
|
-
- lib/phronomy/engine/task/mapped_backend.rb
|
|
211
|
-
- lib/phronomy/engine/task/thread_backend.rb
|
|
212
|
-
- lib/phronomy/engine/task_group.rb
|
|
213
|
-
- lib/phronomy/eval.rb
|
|
214
|
-
- lib/phronomy/eval/comparison.rb
|
|
215
|
-
- lib/phronomy/eval/dataset.rb
|
|
216
|
-
- lib/phronomy/eval/eval_case.rb
|
|
217
|
-
- lib/phronomy/eval/eval_result.rb
|
|
218
|
-
- lib/phronomy/eval/metrics.rb
|
|
219
|
-
- lib/phronomy/eval/runner.rb
|
|
220
|
-
- lib/phronomy/eval/scorer.rb
|
|
221
|
-
- lib/phronomy/eval/scorer/base.rb
|
|
222
|
-
- lib/phronomy/eval/scorer/exact_match.rb
|
|
223
|
-
- lib/phronomy/eval/scorer/includes_scorer.rb
|
|
224
|
-
- lib/phronomy/eval/scorer/llm_judge.rb
|
|
225
205
|
- lib/phronomy/event.rb
|
|
226
206
|
- lib/phronomy/execution_rehydration_required_error.rb
|
|
227
207
|
- lib/phronomy/filter.rb
|
|
@@ -239,6 +219,8 @@ files:
|
|
|
239
219
|
- lib/phronomy/llm_context_window/token_budget.rb
|
|
240
220
|
- lib/phronomy/llm_context_window/token_estimator.rb
|
|
241
221
|
- lib/phronomy/metrics.rb
|
|
222
|
+
- lib/phronomy/multi_agent/fan_out_invocation.rb
|
|
223
|
+
- lib/phronomy/multi_agent/fan_out_session_builder.rb
|
|
242
224
|
- lib/phronomy/multi_agent/handoff.rb
|
|
243
225
|
- lib/phronomy/multi_agent/orchestrator.rb
|
|
244
226
|
- lib/phronomy/multi_agent/parallel_tool_chat.rb
|
|
@@ -255,9 +237,19 @@ files:
|
|
|
255
237
|
- lib/phronomy/state_store/in_memory.rb
|
|
256
238
|
- lib/phronomy/stream_callback_error.rb
|
|
257
239
|
- lib/phronomy/testing.rb
|
|
240
|
+
- lib/phronomy/testing/eval.rb
|
|
241
|
+
- lib/phronomy/testing/eval/comparison.rb
|
|
242
|
+
- lib/phronomy/testing/eval/dataset.rb
|
|
243
|
+
- lib/phronomy/testing/eval/eval_case.rb
|
|
244
|
+
- lib/phronomy/testing/eval/eval_result.rb
|
|
245
|
+
- lib/phronomy/testing/eval/metrics.rb
|
|
246
|
+
- lib/phronomy/testing/eval/runner.rb
|
|
247
|
+
- lib/phronomy/testing/eval/scorer.rb
|
|
248
|
+
- lib/phronomy/testing/eval/scorer/base.rb
|
|
249
|
+
- lib/phronomy/testing/eval/scorer/exact_match.rb
|
|
250
|
+
- lib/phronomy/testing/eval/scorer/includes_scorer.rb
|
|
251
|
+
- lib/phronomy/testing/eval/scorer/llm_judge.rb
|
|
258
252
|
- lib/phronomy/testing/fake_clock.rb
|
|
259
|
-
- lib/phronomy/testing/fake_scheduler.rb
|
|
260
|
-
- lib/phronomy/testing/scheduler_helpers.rb
|
|
261
253
|
- lib/phronomy/token_usage.rb
|
|
262
254
|
- lib/phronomy/tools/agent.rb
|
|
263
255
|
- lib/phronomy/tools/mcp.rb
|