phronomy 0.29.0 → 0.30.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 +96 -1
- data/README.md +17 -6
- data/docs/architecture/agent-configuration-and-tool-binding.md +8 -0
- data/docs/architecture/agent-iteration-budget.md +81 -0
- data/docs/architecture/dx05-agent-scope.md +9 -2
- data/docs/architecture/error-api-review.md +4 -4
- data/docs/architecture/generator-verifier-lifecycle-result.md +126 -0
- data/docs/architecture/generator-verifier-ownership.md +18 -109
- data/docs/architecture/llm-continuation-metadata.md +88 -0
- data/docs/architecture/lm-studio-output-failures.md +111 -0
- data/docs/architecture/r8-unit15.md +3 -0
- data/docs/architecture/r8-unit7.md +2 -1
- data/docs/architecture/structured-output-and-scope.md +183 -0
- data/docs/architecture/tracing.md +22 -4
- data/docs/architecture/transport-error-boundaries.md +103 -0
- data/docs/architecture/trust-acceptance-followup.md +87 -0
- data/docs/features.md +10 -1
- data/docs/migrations/r8-unit15.md +3 -0
- data/gemfiles/http_minimum.gemfile +6 -1
- data/lib/phronomy/agent/admission.rb +1 -1
- data/lib/phronomy/agent/async_event_api.rb +16 -7
- data/lib/phronomy/agent/base.rb +8 -1
- data/lib/phronomy/agent/context_importer.rb +4 -0
- data/lib/phronomy/agent/execution/agent_invocation.rb +6 -2
- data/lib/phronomy/agent/execution/dispatch_preparation.rb +6 -1
- data/lib/phronomy/agent/execution/exact_execution.rb +9 -0
- data/lib/phronomy/agent/execution/execution_cancellation.rb +1 -1
- data/lib/phronomy/agent/execution/execution_coordinator.rb +63 -5
- data/lib/phronomy/agent/execution/execution_outcome_committer.rb +24 -4
- data/lib/phronomy/agent/execution/execution_registry.rb +5 -1
- data/lib/phronomy/agent/execution/initial_preparation.rb +10 -1
- data/lib/phronomy/agent/execution/invocation_actions.rb +1 -1
- data/lib/phronomy/agent/execution/invocation_transitions.rb +4 -4
- data/lib/phronomy/agent/execution/iteration_budget.rb +35 -0
- data/lib/phronomy/agent/execution/runtime_record_encoder.rb +3 -0
- data/lib/phronomy/agent/execution_observation.rb +5 -5
- data/lib/phronomy/agent/lifecycle/scope.rb +33 -23
- data/lib/phronomy/agent/lifecycle/scope_cleanup_error.rb +4 -2
- data/lib/phronomy/agent/output_contract.rb +64 -0
- data/lib/phronomy/agent/output_error.rb +53 -0
- data/lib/phronomy/agent/recovery/recovery_coordinator/continuation.rb +3 -3
- data/lib/phronomy/agent/recovery/recovery_coordinator/installation.rb +1 -0
- data/lib/phronomy/agent/recovery/recovery_coordinator.rb +1 -1
- data/lib/phronomy/agent/recovery/recovery_support.rb +5 -1
- data/lib/phronomy/agent/runtime_binding/engine_session_builder.rb +2 -1
- data/lib/phronomy/agent/runtime_input.rb +15 -4
- data/lib/phronomy/agent/saved_context_reader.rb +2 -1
- data/lib/phronomy/agent/store.rb +10 -2
- data/lib/phronomy/common/values/immutable.rb +33 -0
- data/lib/phronomy/context/assembly.rb +7 -4
- data/lib/phronomy/embeddings/backends/ruby_llm_embeddings.rb +3 -1
- data/lib/phronomy/engine/fsm_session.rb +16 -1
- data/lib/phronomy/generation/generator_verifier/agent_operation.rb +28 -5
- data/lib/phronomy/generation/generator_verifier/agent_result_receiver.rb +14 -27
- data/lib/phronomy/generation/generator_verifier/approval.rb +30 -0
- data/lib/phronomy/generation/generator_verifier/cleanup_error.rb +15 -0
- data/lib/phronomy/generation/generator_verifier/invocation.rb +147 -0
- data/lib/phronomy/generation/generator_verifier/pipeline_state.rb +16 -0
- data/lib/phronomy/generation/generator_verifier/protocol.rb +55 -0
- data/lib/phronomy/generation/generator_verifier/result.rb +121 -0
- data/lib/phronomy/generation/generator_verifier/unaccepted_result_error.rb +14 -0
- data/lib/phronomy/generation/generator_verifier/workflow_builder.rb +13 -11
- data/lib/phronomy/generation/generator_verifier.rb +170 -85
- data/lib/phronomy/llm_adapter/backends/lm_studio.rb +139 -0
- data/lib/phronomy/llm_adapter/backends/ruby_llm.rb +134 -12
- data/lib/phronomy/llm_adapter/backends/structured_response_capture.rb +41 -0
- data/lib/phronomy/llm_adapter/message.rb +4 -0
- data/lib/phronomy/llm_adapter/request.rb +17 -2
- data/lib/phronomy/llm_adapter/response.rb +11 -4
- data/lib/phronomy/llm_adapter/structured_output_unsupported_error.rb +14 -0
- data/lib/phronomy/llm_adapter/transport_error.rb +4 -0
- data/lib/phronomy/multi_agent/shared_state.rb +1 -0
- data/lib/phronomy/output_parser/json_schema_parser.rb +113 -0
- data/lib/phronomy/output_parser/parse_error.rb +10 -1
- data/lib/phronomy/runtime_composition/agent_defaults.rb +4 -0
- data/lib/phronomy/tracing/automatic.rb +14 -8
- data/lib/phronomy/tracing/base.rb +2 -1
- data/lib/phronomy/tracing/langfuse_tracer.rb +3 -3
- data/lib/phronomy/tracing/observation.rb +2 -1
- data/lib/phronomy/tracing/open_telemetry_tracer.rb +3 -3
- data/lib/phronomy/version.rb +1 -1
- data/lib/phronomy.rb +1 -2
- data/scripts/api_snapshot.rb +3 -0
- data/scripts/migrate_generator_verifier_result.rb +18 -0
- data/sig/phronomy/agent/execution_contract.rbs +4 -3
- data/sig/phronomy/agent.rbs +20 -7
- data/sig/phronomy/extensions.rbs +8 -3
- data/sig/phronomy/generation/generator_verifier.rbs +70 -0
- data/sig/phronomy/llm_adapter/backends/lm_studio.rbs +8 -0
- data/sig/phronomy/llm_adapter/backends/ruby_llm.rbs +1 -0
- data/sig/phronomy/llm_adapter/values.rbs +8 -2
- data/sig/phronomy/tracing/observation.rbs +1 -1
- data/sig/phronomy.rbs +2 -0
- metadata +59 -8
- data/lib/phronomy/generation/generator_verifier/default_parser.rb +0 -27
- data/lib/phronomy/generation/low_confidence_error.rb +0 -14
- data/lib/phronomy/runtime_composition/generation_defaults.rb +0 -6
- data/sig/phronomy/generation/low_confidence_error.rbs +0 -6
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module Phronomy
|
|
2
|
+
class GeneratorVerifier
|
|
3
|
+
DEFAULT_CONFIDENCE_THRESHOLD: Float
|
|
4
|
+
DEFAULT_MAX_ITERATIONS: Integer
|
|
5
|
+
|
|
6
|
+
interface _ApprovalListener
|
|
7
|
+
def call: (Approval approval) -> untyped
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.open: [R] (**untyped options) { (GeneratorVerifier pipeline) -> (R | TaskResult[R]) } -> R
|
|
11
|
+
def initialize: (draft_agent: singleton(Agent::Base), review_agent: singleton(Agent::Base),
|
|
12
|
+
draft_prompt_builder: untyped, review_prompt_builder: untyped,
|
|
13
|
+
?citation_schema: Hash[String | Symbol, untyped],
|
|
14
|
+
?confidence_threshold: Numeric, ?max_iterations: Integer,
|
|
15
|
+
?raise_if_unaccepted: bool, ?on_approval: _ApprovalListener?) -> void
|
|
16
|
+
def invoke: (untyped input, ?config: Hash[Symbol, untyped]) -> Result
|
|
17
|
+
def invoke_async: (untyped input, ?config: Hash[Symbol, untyped]) -> TaskResult[Result]
|
|
18
|
+
def approval_requests: () -> Array[Approval]
|
|
19
|
+
def cancel_async: () -> TaskResult[bool]
|
|
20
|
+
def release!: () -> bool
|
|
21
|
+
|
|
22
|
+
class Approval
|
|
23
|
+
attr_reader invocation_id: String
|
|
24
|
+
attr_reader phase: (:draft | :review)
|
|
25
|
+
attr_reader request: Agent::ToolApprovalRequest
|
|
26
|
+
def respond_async: (approved: bool) -> TaskResult[nil]
|
|
27
|
+
def to_h: () -> Hash[Symbol, untyped]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class Result
|
|
31
|
+
FIELDS: Array[Symbol]
|
|
32
|
+
attr_reader output: String?
|
|
33
|
+
attr_reader confidence: Float?
|
|
34
|
+
attr_reader citations: Array[Hash[String, untyped]]
|
|
35
|
+
attr_reader iterations: Integer
|
|
36
|
+
attr_reader review_notes: Array[String]
|
|
37
|
+
attr_reader confidence_threshold: Float
|
|
38
|
+
attr_reader review_approved: bool?
|
|
39
|
+
attr_reader termination_reason: String
|
|
40
|
+
attr_reader interrupted_phase: String?
|
|
41
|
+
attr_reader failure: Hash[String, untyped]?
|
|
42
|
+
def self.accepted?: (confidence: Numeric?, confidence_threshold: Numeric, review_approved: bool?) -> bool
|
|
43
|
+
def self.from_h: (Hash[untyped, untyped]) -> Result
|
|
44
|
+
def initialize: (output: String?, confidence: Numeric?,
|
|
45
|
+
citations: Array[Hash[untyped, untyped]], iterations: Integer, review_notes: Array[String],
|
|
46
|
+
confidence_threshold: Numeric, review_approved: bool?,
|
|
47
|
+
termination_reason: String | Symbol, ?interrupted_phase: String | Symbol | nil, ?failure: Hash[String | Symbol, untyped]?) -> void
|
|
48
|
+
def accepted?: () -> bool
|
|
49
|
+
def to_h: () -> Hash[Symbol, untyped]
|
|
50
|
+
def ==: (untyped other) -> bool
|
|
51
|
+
def eql?: (untyped other) -> bool
|
|
52
|
+
def hash: () -> Integer
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
class UnacceptedResultError < Phronomy::Error
|
|
56
|
+
attr_reader result: Result
|
|
57
|
+
def initialize: (Result result, ?code: String?) -> void
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class CleanupError < Phronomy::Error
|
|
61
|
+
attr_reader pipeline: GeneratorVerifier
|
|
62
|
+
attr_reader failures: Array[{ phase: (:draft | :review | nil), error: Exception }]
|
|
63
|
+
attr_reader result: untyped
|
|
64
|
+
attr_reader primary_error: Exception?
|
|
65
|
+
def initialize: (pipeline: GeneratorVerifier,
|
|
66
|
+
failures: Array[{ phase: (:draft | :review | nil), error: Exception }],
|
|
67
|
+
?result: untyped, ?primary_error: Exception?, ?code: String?) -> void
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -6,7 +6,8 @@ module Phronomy
|
|
|
6
6
|
attr_reader messages: Array[Message]
|
|
7
7
|
attr_reader tools: Array[Hash[String, untyped]]
|
|
8
8
|
attr_reader message: String?
|
|
9
|
-
|
|
9
|
+
attr_reader response_schema: Hash[String, untyped]?
|
|
10
|
+
def initialize: (?model_config: Hash[String | Symbol, untyped], ?system: String?, ?messages: Array[Message], ?tools: Array[Hash[String, untyped]], ?message: String?, ?response_schema: Hash[String | Symbol, untyped]?) -> void
|
|
10
11
|
end
|
|
11
12
|
class Message
|
|
12
13
|
attr_reader role: Symbol
|
|
@@ -21,7 +22,9 @@ module Phronomy
|
|
|
21
22
|
end
|
|
22
23
|
class Response < Message
|
|
23
24
|
attr_reader usage: TokenUsage
|
|
24
|
-
|
|
25
|
+
attr_reader finish_reason: Symbol
|
|
26
|
+
attr_reader refusal: String?
|
|
27
|
+
def initialize: (?content: json_value, ?tool_calls: Array[Tool::CallRequest], ?usage: TokenUsage, ?metadata: Hash[String, json_value], ?role: String | Symbol, ?finish_reason: String | Symbol, ?refusal: String?) -> void
|
|
25
28
|
def self.from_h: (Hash[String | Symbol, untyped] value) -> Response
|
|
26
29
|
def to_h: () -> Hash[String, untyped]
|
|
27
30
|
end
|
|
@@ -29,6 +32,9 @@ module Phronomy
|
|
|
29
32
|
attr_reader content: String?
|
|
30
33
|
def initialize: (content: String?) -> void
|
|
31
34
|
end
|
|
35
|
+
class StructuredOutputUnsupportedError < Error
|
|
36
|
+
def initialize: (?String message) -> void
|
|
37
|
+
end
|
|
32
38
|
class InvalidResultError < Error
|
|
33
39
|
end
|
|
34
40
|
class TransportError < Error
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Phronomy
|
|
2
2
|
module Tracing
|
|
3
3
|
module Observation
|
|
4
|
-
def self.trace: [A] (String name, ?input: untyped, **untyped meta) { (untyped span) -> [A,
|
|
4
|
+
def self.trace: [A] (String name, ?input: untyped, **untyped meta) { (untyped span) -> [A, Hash[Symbol, Integer?]?] } -> A
|
|
5
5
|
end
|
|
6
6
|
end
|
|
7
7
|
end
|
data/sig/phronomy.rbs
CHANGED
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.30.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-10-
|
|
11
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ruby_llm
|
|
@@ -30,14 +30,40 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '2.
|
|
33
|
+
version: '2.14'
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: 2.14.4
|
|
34
37
|
type: :runtime
|
|
35
38
|
prerelease: false
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
40
|
requirements:
|
|
38
41
|
- - "~>"
|
|
39
42
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '2.
|
|
43
|
+
version: '2.14'
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 2.14.4
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: faraday-net_http
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '3.4'
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: 3.4.4
|
|
57
|
+
type: :runtime
|
|
58
|
+
prerelease: false
|
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
60
|
+
requirements:
|
|
61
|
+
- - "~>"
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '3.4'
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: 3.4.4
|
|
41
67
|
- !ruby/object:Gem::Dependency
|
|
42
68
|
name: schematist
|
|
43
69
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -118,6 +144,9 @@ dependencies:
|
|
|
118
144
|
name: json
|
|
119
145
|
requirement: !ruby/object:Gem::Requirement
|
|
120
146
|
requirements:
|
|
147
|
+
- - ">="
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: 2.21.2
|
|
121
150
|
- - "<"
|
|
122
151
|
- !ruby/object:Gem::Version
|
|
123
152
|
version: '3'
|
|
@@ -125,6 +154,9 @@ dependencies:
|
|
|
125
154
|
prerelease: false
|
|
126
155
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
156
|
requirements:
|
|
157
|
+
- - ">="
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: 2.21.2
|
|
128
160
|
- - "<"
|
|
129
161
|
- !ruby/object:Gem::Version
|
|
130
162
|
version: '3'
|
|
@@ -160,6 +192,7 @@ files:
|
|
|
160
192
|
- docs/architecture/agent-chat-and-state-ownership.md
|
|
161
193
|
- docs/architecture/agent-configuration-and-tool-binding.md
|
|
162
194
|
- docs/architecture/agent-context.md
|
|
195
|
+
- docs/architecture/agent-iteration-budget.md
|
|
163
196
|
- docs/architecture/agent-transition-ownership.md
|
|
164
197
|
- docs/architecture/backend-groups.md
|
|
165
198
|
- docs/architecture/before-llm-input.md
|
|
@@ -172,8 +205,11 @@ files:
|
|
|
172
205
|
- docs/architecture/execution-abstraction-review.md
|
|
173
206
|
- docs/architecture/execution-boundaries.md
|
|
174
207
|
- docs/architecture/execution-metadata-and-values.md
|
|
208
|
+
- docs/architecture/generator-verifier-lifecycle-result.md
|
|
175
209
|
- docs/architecture/generator-verifier-ownership.md
|
|
176
210
|
- docs/architecture/knowledge-and-rag.md
|
|
211
|
+
- docs/architecture/llm-continuation-metadata.md
|
|
212
|
+
- docs/architecture/lm-studio-output-failures.md
|
|
177
213
|
- docs/architecture/multi-agent-handoff.md
|
|
178
214
|
- docs/architecture/persistence-refactoring-plan.md
|
|
179
215
|
- docs/architecture/persistence.md
|
|
@@ -206,8 +242,11 @@ files:
|
|
|
206
242
|
- docs/architecture/rubyllm-2-token-ownership.md
|
|
207
243
|
- docs/architecture/security-boundaries.md
|
|
208
244
|
- docs/architecture/storage-execution-boundaries.md
|
|
245
|
+
- docs/architecture/structured-output-and-scope.md
|
|
209
246
|
- docs/architecture/tool-schema-recording-gap.md
|
|
210
247
|
- docs/architecture/tracing.md
|
|
248
|
+
- docs/architecture/transport-error-boundaries.md
|
|
249
|
+
- docs/architecture/trust-acceptance-followup.md
|
|
211
250
|
- docs/architecture/workflow-terminal-ownership-design.md
|
|
212
251
|
- docs/archive/design/archived/04_api_design.md
|
|
213
252
|
- docs/archive/design/archived/09_guardrails.md
|
|
@@ -371,6 +410,7 @@ files:
|
|
|
371
410
|
- lib/phronomy/agent/execution/initial_preparation.rb
|
|
372
411
|
- lib/phronomy/agent/execution/invocation_actions.rb
|
|
373
412
|
- lib/phronomy/agent/execution/invocation_transitions.rb
|
|
413
|
+
- lib/phronomy/agent/execution/iteration_budget.rb
|
|
374
414
|
- lib/phronomy/agent/execution/llm_operation_result.rb
|
|
375
415
|
- lib/phronomy/agent/execution/runtime_record_encoder.rb
|
|
376
416
|
- lib/phronomy/agent/execution_change.rb
|
|
@@ -394,6 +434,8 @@ files:
|
|
|
394
434
|
- lib/phronomy/agent/lifecycle/scope.rb
|
|
395
435
|
- lib/phronomy/agent/lifecycle/scope_cleanup_error.rb
|
|
396
436
|
- lib/phronomy/agent/lifecycle/unload_transition.rb
|
|
437
|
+
- lib/phronomy/agent/output_contract.rb
|
|
438
|
+
- lib/phronomy/agent/output_error.rb
|
|
397
439
|
- lib/phronomy/agent/persistence/agent_repository.rb
|
|
398
440
|
- lib/phronomy/agent/persistence/cancellation_repository.rb
|
|
399
441
|
- lib/phronomy/agent/persistence/codec.rb
|
|
@@ -522,15 +564,21 @@ files:
|
|
|
522
564
|
- lib/phronomy/generation/generator_verifier.rb
|
|
523
565
|
- lib/phronomy/generation/generator_verifier/agent_operation.rb
|
|
524
566
|
- lib/phronomy/generation/generator_verifier/agent_result_receiver.rb
|
|
525
|
-
- lib/phronomy/generation/generator_verifier/
|
|
567
|
+
- lib/phronomy/generation/generator_verifier/approval.rb
|
|
568
|
+
- lib/phronomy/generation/generator_verifier/cleanup_error.rb
|
|
569
|
+
- lib/phronomy/generation/generator_verifier/invocation.rb
|
|
526
570
|
- lib/phronomy/generation/generator_verifier/pipeline_state.rb
|
|
571
|
+
- lib/phronomy/generation/generator_verifier/protocol.rb
|
|
572
|
+
- lib/phronomy/generation/generator_verifier/result.rb
|
|
573
|
+
- lib/phronomy/generation/generator_verifier/unaccepted_result_error.rb
|
|
527
574
|
- lib/phronomy/generation/generator_verifier/workflow_builder.rb
|
|
528
|
-
- lib/phronomy/generation/low_confidence_error.rb
|
|
529
575
|
- lib/phronomy/integrations/ordered_event_delivery.rb
|
|
530
576
|
- lib/phronomy/llm_adapter.rb
|
|
531
577
|
- lib/phronomy/llm_adapter/async/async_client.rb
|
|
532
578
|
- lib/phronomy/llm_adapter/authentication_error.rb
|
|
579
|
+
- lib/phronomy/llm_adapter/backends/lm_studio.rb
|
|
533
580
|
- lib/phronomy/llm_adapter/backends/ruby_llm.rb
|
|
581
|
+
- lib/phronomy/llm_adapter/backends/structured_response_capture.rb
|
|
534
582
|
- lib/phronomy/llm_adapter/base.rb
|
|
535
583
|
- lib/phronomy/llm_adapter/context_length_error.rb
|
|
536
584
|
- lib/phronomy/llm_adapter/invalid_result_error.rb
|
|
@@ -539,6 +587,7 @@ files:
|
|
|
539
587
|
- lib/phronomy/llm_adapter/request.rb
|
|
540
588
|
- lib/phronomy/llm_adapter/response.rb
|
|
541
589
|
- lib/phronomy/llm_adapter/stream_chunk.rb
|
|
590
|
+
- lib/phronomy/llm_adapter/structured_output_unsupported_error.rb
|
|
542
591
|
- lib/phronomy/llm_adapter/token_usage.rb
|
|
543
592
|
- lib/phronomy/llm_adapter/transport_error.rb
|
|
544
593
|
- lib/phronomy/llm_context_window/token_budget.rb
|
|
@@ -572,6 +621,7 @@ files:
|
|
|
572
621
|
- lib/phronomy/output_parser.rb
|
|
573
622
|
- lib/phronomy/output_parser/base.rb
|
|
574
623
|
- lib/phronomy/output_parser/json_parser.rb
|
|
624
|
+
- lib/phronomy/output_parser/json_schema_parser.rb
|
|
575
625
|
- lib/phronomy/output_parser/parse_error.rb
|
|
576
626
|
- lib/phronomy/output_parser/structured_parser.rb
|
|
577
627
|
- lib/phronomy/persistence/content_repository.rb
|
|
@@ -590,7 +640,6 @@ files:
|
|
|
590
640
|
- lib/phronomy/runtime_composition/configuration_defaults.rb
|
|
591
641
|
- lib/phronomy/runtime_composition/evaluation_defaults.rb
|
|
592
642
|
- lib/phronomy/runtime_composition/execution_defaults.rb
|
|
593
|
-
- lib/phronomy/runtime_composition/generation_defaults.rb
|
|
594
643
|
- lib/phronomy/runtime_composition/global_configuration.rb
|
|
595
644
|
- lib/phronomy/runtime_composition/global_runtime.rb
|
|
596
645
|
- lib/phronomy/runtime_composition/multi_agent_defaults.rb
|
|
@@ -696,6 +745,7 @@ files:
|
|
|
696
745
|
- scripts/check_api_annotations.rb
|
|
697
746
|
- scripts/check_readme_ruby.rb
|
|
698
747
|
- scripts/check_readme_runnable.rb
|
|
748
|
+
- scripts/migrate_generator_verifier_result.rb
|
|
699
749
|
- scripts/migrate_spec_agent_definition.rb
|
|
700
750
|
- scripts/migrate_spec_agent_definition_pass2.rb
|
|
701
751
|
- scripts/migrate_spec_inline_pass3.rb
|
|
@@ -744,9 +794,10 @@ files:
|
|
|
744
794
|
- sig/phronomy/execution/task_result.rbs
|
|
745
795
|
- sig/phronomy/extensions.rbs
|
|
746
796
|
- sig/phronomy/filter/filter_block_error.rbs
|
|
747
|
-
- sig/phronomy/generation/
|
|
797
|
+
- sig/phronomy/generation/generator_verifier.rbs
|
|
748
798
|
- sig/phronomy/handoff.rbs
|
|
749
799
|
- sig/phronomy/integrations.rbs
|
|
800
|
+
- sig/phronomy/llm_adapter/backends/lm_studio.rbs
|
|
750
801
|
- sig/phronomy/llm_adapter/backends/ruby_llm.rbs
|
|
751
802
|
- sig/phronomy/llm_adapter/base.rbs
|
|
752
803
|
- sig/phronomy/llm_adapter/usage.rbs
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Phronomy
|
|
4
|
-
class GeneratorVerifier
|
|
5
|
-
# Boot supplies the default concrete parser. The generation algorithm owns
|
|
6
|
-
# its output interpretation and fallback, not the concrete parser selection.
|
|
7
|
-
# @api private
|
|
8
|
-
module DefaultParser
|
|
9
|
-
FACTORIES = {}
|
|
10
|
-
private_constant :FACTORIES
|
|
11
|
-
|
|
12
|
-
# Private one-time composition binding; not an application registry.
|
|
13
|
-
# @api private
|
|
14
|
-
def self.install_factory(factory)
|
|
15
|
-
raise ArgumentError, "factory must respond to call" unless factory.respond_to?(:call)
|
|
16
|
-
|
|
17
|
-
FACTORIES.replace(parser: factory).freeze
|
|
18
|
-
nil
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# @api private
|
|
22
|
-
def self.build
|
|
23
|
-
FACTORIES.fetch(:parser).call
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "../common/error"
|
|
4
|
-
|
|
5
|
-
module Phronomy
|
|
6
|
-
class LowConfidenceError < Error
|
|
7
|
-
attr_reader :result
|
|
8
|
-
|
|
9
|
-
def initialize(result, code: nil)
|
|
10
|
-
@result = result
|
|
11
|
-
super("Answer confidence #{result.confidence} is below the required threshold", code: code)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|