phronomy 0.29.0 → 0.30.1
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 +107 -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-unit1.md +68 -68
- data/docs/architecture/r8-unit15.md +3 -0
- data/docs/architecture/r8-unit2.md +34 -34
- 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/decisions/029-semantic-completion-and-application-effect-boundary.md +1 -1
- data/docs/design/durable-semantic-coordination/CHANGELOG_V2_REVISION_2.md +23 -23
- data/docs/design/durable-semantic-coordination/IMPLEMENTATION_REPORT.md +99 -99
- data/docs/design/durable-semantic-coordination/RECOVERY_CONTRACT_CLARIFICATIONS.md +135 -136
- 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
|
@@ -6,107 +6,107 @@
|
|
|
6
6
|
> [ADR-034](../../decisions/034-handoff-runner-coordination-ownership.md).
|
|
7
7
|
> Handoff and HandoffPolicy remain in Agent at this stage.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
Created: 2026-09-07. Design approved: 2026-09-06.
|
|
10
|
+
Baseline: `5472116cd99a63ec27875024c955ea82be612d6b`.
|
|
11
|
+
This is a new implementation of the approved ADR-029/030/031 and RC-01 through RC-05.
|
|
12
|
+
It does not use the old Complete Durability overlay, existing work ZIPs, or synthetic fan-out executions.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Implementation scope
|
|
15
15
|
|
|
16
|
-
|
|
|
16
|
+
| Area | Implemented behavior |
|
|
17
17
|
|---|---|
|
|
18
|
-
| Persistence | root
|
|
19
|
-
| Handoff | Agent-domain API
|
|
20
|
-
| Orchestrator |
|
|
21
|
-
| Team | TeamRoot/TeamExecution
|
|
22
|
-
| Team
|
|
23
|
-
| Aggregate |
|
|
24
|
-
| Runtime |
|
|
25
|
-
| Recovery | framework-owned
|
|
26
|
-
|
|
|
27
|
-
|
|
28
|
-
Handoff graph
|
|
29
|
-
|
|
30
|
-
Runtime
|
|
31
|
-
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
|
|
|
18
|
+
| Persistence | Eight repositories in both root and transaction views; the three new records use current format `0.1`. Backend handles opaque DurableRecords and explicit identity/revision/index metadata |
|
|
19
|
+
| Handoff | Moved to the Agent-domain API. Source terminal state, Context, exact Target reservation, and responsibility transfer are persisted in one transaction. Target terminal state and routing stabilization also share one transaction |
|
|
20
|
+
| Orchestrator | Stores child ID/input/knowledge/config/outcome for static subagent Tools in the existing parent AgentExecution. Direct `dispatch_parallel`/`fan_out` calls do not create synthetic parents |
|
|
21
|
+
| Team | Persists TeamRoot/TeamExecution, tasks, worker slots, and exact assignments/outcomes using CAS. Coordinators/workers use the existing Agent engine. Scheduling retains the existing sequential approach |
|
|
22
|
+
| Internal Team operations | Applies persisted authorized Tool batches in Provider order. Retains the result of each `tool_invocation_id` and automatically reconciles `enqueue_task`/`finalize` |
|
|
23
|
+
| Aggregate | Pure/replay-safe computation. Commits canonical JSON results or errors as terminal outcomes. Recalculation is possible after a crash before persistence, but not for a persisted terminal outcome |
|
|
24
|
+
| Runtime | Adds process-local Team ownership, admission, and draining. Does not add a new Team FSM/Workflow engine |
|
|
25
|
+
| Recovery | Resumes framework-owned operations from exact facts. In batches mixed with external Tools, only external facts are resolved through the existing Recovery API |
|
|
26
|
+
| Termination and deletion | Retains cancellation/reconciliation information for exact children. `purge!` on an idle main Agent also deletes the Handoff anchor; deleting an anchor for an incomplete turn is rejected |
|
|
27
|
+
|
|
28
|
+
A Handoff graph uses the same Persistence **instance**. The original main Agent ID is the routing anchor.
|
|
29
|
+
Persisted Context is not reprojected using a new policy, and persisted worker assignments are not reselected using the current scheduler.
|
|
30
|
+
Runtime Classes/Procs, listeners, Tasks, and CancellationTokens are not persisted.
|
|
31
|
+
|
|
32
|
+
## Public entry points
|
|
33
|
+
|
|
34
|
+
| Purpose | API / return value |
|
|
35
35
|
|---|---|
|
|
36
|
-
| Agent
|
|
37
|
-
| Handoff
|
|
38
|
-
| Agent
|
|
39
|
-
| Team
|
|
40
|
-
| Team
|
|
41
|
-
| Handoff
|
|
42
|
-
|
|
|
43
|
-
| Team
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Agent
|
|
50
|
-
|
|
51
|
-
`class`/`message
|
|
52
|
-
|
|
53
|
-
Handoff
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
`Team.load
|
|
59
|
-
Agent
|
|
60
|
-
Team
|
|
61
|
-
`Team.stream
|
|
62
|
-
|
|
63
|
-
## RC
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`spec/phronomy/multi_agent/durable_coordination_spec.rb
|
|
67
|
-
|
|
68
|
-
|
|
|
36
|
+
| Agent result access | `store.execution_result(execution_id)`; a frozen Hash containing owner, status, phase, result/error, and reference IDs |
|
|
37
|
+
| Handoff result access | `store.handoff_result(source_execution_id)`; follows the exact Target of that turn. No graph/Agent hydration is required |
|
|
38
|
+
| Agent execution discovery | `store.list_executions(agent_id, after: nil, limit: 100)`; immutable execution records, both active and terminal |
|
|
39
|
+
| Team result access | `store.team_execution_result(run_id)` or `team.result(run_id)` |
|
|
40
|
+
| Team execution discovery | `store.list_team_executions(team_id, after: nil, limit: 100)` or `team.executions(...)` |
|
|
41
|
+
| Handoff execution/recovery | `Agent::HandoffRunner.new(main_agent:, handoffs:).invoke(input, config: {})`; uses the persisted reservation and input if an incomplete turn exists |
|
|
42
|
+
| Static child recovery | `Orchestrator#resume(execution_id, config: {})` |
|
|
43
|
+
| Team creation/recovery | `team_definition id:, version:`, `create(team_id:, persistence:)`, `load(team_id, persistence:, on_event:)`, `resume(run_id)` |
|
|
44
|
+
| Explicit cancellation | `team.cancel(run_id)` / `handoff_runner.cancel(execution_id)`; existing Agent operations, including Orchestrator, use `config[:cancellation_token]` |
|
|
45
|
+
|
|
46
|
+
Lists are ordered lexicographically by semantic ID; `after` is an exclusive ID cursor, and `limit` is a positive integer.
|
|
47
|
+
This does not imply chronological ordering or unique correspondence to a request. Applications match candidates against their own correlation information.
|
|
48
|
+
|
|
49
|
+
Agent result status uses existing Symbols; Team result status uses canonical Strings.
|
|
50
|
+
The default Team aggregate result is also canonical JSON: Hash keys are Strings, and errors are data such as
|
|
51
|
+
`class`/`message`, not exception objects. Top-level assignment keys and task keys passed to aggregate are Symbols.
|
|
52
|
+
|
|
53
|
+
An unstarted Handoff Target reservation is identified by `status: :active, phase: :target_pending, reserved: true`.
|
|
54
|
+
Explicit cancellation of an unstarted Target preserves its reserved ID; a later turn never substitutes for the result of an earlier turn.
|
|
55
|
+
Absence produces `Persistence::NotFoundError`; read/decode failures produce their actual errors.
|
|
56
|
+
No facility to restore deleted results or retain them indefinitely has been added.
|
|
57
|
+
|
|
58
|
+
`Team.load` hydrates Team facts only. Child execution/recovery starts through `resume`.
|
|
59
|
+
Agent `load` retains its existing Recovery contract. Use the Persistence access APIs above when only results are needed.
|
|
60
|
+
Team's `on_event` is passed to hidden Agents to receive required Recovery/approval events.
|
|
61
|
+
`Team.stream` provides Runtime notifications of committed assignments; it adds no notification-delivery guarantee.
|
|
62
|
+
|
|
63
|
+
## RC mapping
|
|
64
|
+
|
|
65
|
+
Paths are relative to the repository root. The shared additional fault specs are in
|
|
66
|
+
`spec/phronomy/multi_agent/durable_coordination_spec.rb`.
|
|
67
|
+
|
|
68
|
+
| Requirement | Main implementation | Validation evidence |
|
|
69
69
|
|---|---|---|
|
|
70
|
-
| RC-01-A/B | `Persistence#execution_result` / `list_executions
|
|
71
|
-
| RC-01-C | `Persistence#handoff_result
|
|
72
|
-
| RC-02-A |
|
|
73
|
-
| RC-02-B/C |
|
|
74
|
-
| RC-03-A | Team definition
|
|
75
|
-
| RC-03-B |
|
|
76
|
-
| RC-04-A |
|
|
77
|
-
| RC-04-B/C/D | Team
|
|
78
|
-
| RC-04-E | Source terminal link
|
|
79
|
-
| RC-05 |
|
|
80
|
-
|
|
81
|
-
`lib/phronomy/testing/persistence_contract/coordination_repositories.rb
|
|
82
|
-
|
|
83
|
-
raw SPI/API
|
|
84
|
-
logical-operation tracing
|
|
85
|
-
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
InMemory
|
|
99
|
-
-
|
|
100
|
-
durable
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
callback outbox/ACK
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
##
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
70
|
+
| RC-01-A/B | `Persistence#execution_result` / `list_executions`, and corresponding Team APIs | Reads active/terminal candidates, pagination, and results in a reconstructed environment without loading the owner; does not invoke Providers or add ownership registrations |
|
|
71
|
+
| RC-01-C | `Persistence#handoff_result`, read-only materialization | Reservation access without graph/owner, read failures, and NotFound for purged results. Callback policy is also covered by the existing `stream_callback_error_policy_spec.rb` |
|
|
72
|
+
| RC-02-A | Existing F1 readback during Agent preparation, `reconcile_terminal_error`, Team `admit`/`update` | Lost acknowledgements immediately after each Team revision commit and Source transfer; reuse of committed worker/child outcomes |
|
|
73
|
+
| RC-02-B/C | Exact reservation reconciliation, atomic admission/CAS, bounded readback | Distinguishes read failure from absence. No dispatch after a failed readback following Team admission. Backend contracts check stale CAS, duplicate active records, and rollback across eight repositories |
|
|
74
|
+
| RC-03-A | Team definition snapshots, static child slot definitions, Handoff graph/Target matching | Fails closed on worker-version mismatch or missing Target/graph. Existing Handoff integration specs reject a different Persistence instance |
|
|
75
|
+
| RC-03-B | Immutable Context/input/knowledge/assignment/outcome | Uses persisted HandoffContext even when the current policy changes. Preserves worker results, static child results, and knowledge metadata |
|
|
76
|
+
| RC-04-A | Existing Task waiting/Runtime shutdown contracts | `task_spec.rb`, `agent/acs16_task_quiescence_spec.rb`, and Runtime/admission specs. Runtime reconstruction tests introduce no implicit cancellation |
|
|
77
|
+
| RC-04-B/C/D | Team cancellation flags, exact Handoff cancellation, Agent child-admission conditions, existing terminal barriers | Preserves reserved worker/Target IDs without starting them. A parent with an active child awaiting external facts remains active, persists cancellation information, and retains it after restart. Checked together with existing admission/physical-quiescence specs |
|
|
78
|
+
| RC-04-E | Source terminal link and Target cancellation; responsibility remains with Target | Cancellation after transfer, restart, and a later turn do not return responsibility to Source; historical reserved IDs and cancellation results are preserved |
|
|
79
|
+
| RC-05 | Separation of callbacks/external effects from semantic records | Mixed external/framework Tool batches resolve only external facts and do not rerun completed children. Application is not asked to determine facts about internal `finalize` |
|
|
80
|
+
|
|
81
|
+
The new shared examples in `lib/phronomy/testing/persistence_contract/coordination_repositories.rb`
|
|
82
|
+
run through `phronomy/testing/persistence_contract`, which is also exposed to external backends.
|
|
83
|
+
Existing guards for raw SPI/API snapshots/RBS, removal of old Handoff constants, the EventLoop single writer/causal barrier,
|
|
84
|
+
and logical-operation tracing are preserved.
|
|
85
|
+
|
|
86
|
+
## Validation scope and limitations
|
|
87
|
+
|
|
88
|
+
The measured environment is Ruby 3.3.6. Gem versions are recorded in the distribution ZIP's `verification/gems.txt`.
|
|
89
|
+
See the accompanying verification records for commands, results, and logs measured against the distributed files.
|
|
90
|
+
|
|
91
|
+
- Ordinary RSpec runs exclude integration tags requiring connections to external LLMs.
|
|
92
|
+
- Selected Handoff/Orchestrator/Team integration tests run with WebMock.
|
|
93
|
+
- Added F4 tests model recovery by copying committed DurableRecords and using a new Backend and Runtime.
|
|
94
|
+
They do not demonstrate forced termination of a real OS process or fsync to physical storage.
|
|
95
|
+
- Separate suites using live LLMs, Redis, PostgreSQL, OpenTelemetry, and similar dependencies are outside this measurement.
|
|
96
|
+
There are 61 pending cases: 59 with optional dependencies/services unconfigured and two existing obsolete cases.
|
|
97
|
+
- F4 durability and exclusion across multiple processes for external backends depend on the backend and deployment contracts.
|
|
98
|
+
InMemory itself does not guarantee persistence after process termination.
|
|
99
|
+
- Semantic cancellation does not roll back external effects. Token objects are Runtime-only.
|
|
100
|
+
Committed durable cancellation flags/facts are retained, and uncertain external operations are reconciled through existing Recovery.
|
|
101
|
+
Waiting for facts/approval is not converted into failure that forgets a child; control returns through `ExecutionRehydrationRequiredError`.
|
|
102
|
+
|
|
103
|
+
The framework reuses committed outcomes and recovers incomplete executions with the same semantic identity.
|
|
104
|
+
It adds no callback outbox/ACK, global generic class registry, Proc/Class persistence, distributed transaction,
|
|
105
|
+
or second execution engine dedicated to Team.
|
|
106
|
+
|
|
107
|
+
## Package
|
|
108
|
+
|
|
109
|
+
The package includes complete files and a deletion manifest. Application checks the baseline and pre/post-application hashes.
|
|
110
|
+
New Class locations follow Zeitwerk naming conventions; the old overlay's decorator ignore is unnecessary.
|
|
111
|
+
The old `MultiAgent::Handoff*`, `Runner`, `Coordinator`, and `CoordinationState` implementations are removed.
|
|
112
|
+
See `README_APPLY_JA.md` at the distribution root for application, dependencies, and VERIFY procedures.
|
|
@@ -1,179 +1,178 @@
|
|
|
1
|
-
# V2
|
|
1
|
+
# V2 Recovery Contract Clarifications - Approved Addendum
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Updated: 2026-09-06 / Document revision: V2 revision 2
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0. Purpose and authority
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
ADR-029/030/031
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
This addendum is a normative implementation contract reflecting the user's approval of five additions to V2.
|
|
8
|
+
Apply it together with ADR-029/030/031 and Implementation Design V2.
|
|
9
|
+
It preserves the original V2 responsibility boundaries while clarifying result access, unknown persistence outcomes, wiring compatibility, cancellation, and guarantee wording.
|
|
10
|
+
Where an earlier statement on the same issue differs, these clarifications take precedence. They do not otherwise replace existing ADR contracts.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
The baseline remains `5472116cd99a63ec27875024c955ea82be612d6b`.
|
|
13
|
+
This is specification approval, not evidence of implementation completion or successful tests.
|
|
14
|
+
Public method names, exception names, and mappings to the existing cancellation implementation will be finalized after inspecting the baseline.
|
|
15
|
+
Requirement IDs in this document are for traceability; they are not new Runtime IDs, persistent IDs, or APIs.
|
|
16
16
|
|
|
17
|
-
## 1. RC-01
|
|
17
|
+
## 1. RC-01: Accessing final results and discovering executions
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Required contract
|
|
20
20
|
|
|
21
|
-
- Application
|
|
22
|
-
-
|
|
23
|
-
- Handoff
|
|
24
|
-
- admission
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
21
|
+
- Application can obtain the owner identity, execution state, and committed result or error by semantic execution ID through read-only access.
|
|
22
|
+
- This covers AgentExecution and TeamExecution. Handoff/Orchestrator use existing routing anchors, parent executions, and reserved child/Target IDs; they do not create a new execution entity just for result access.
|
|
23
|
+
- Handoff identifies the Target outcome associated with the specified execution. The latest active Agent result from a later turn must not substitute for an earlier invocation's result.
|
|
24
|
+
- Provide a public path to discover execution candidates from a known agent_id/team_id, covering an interruption after admission commits but before Application receives the execution ID. Include terminal as well as active executions.
|
|
25
|
+
- Result access and candidate enumeration must not invoke Providers/Tools, continue Agent execution, redeliver callbacks, or acquire ownership. Distinguish these operations from operations that initiate recovery.
|
|
26
|
+
- Distinguish an unresolved result, absence, and inability to read. Do not translate Persistence failures or result-materialization failures into no execution, in progress, or successful completion without a result.
|
|
27
|
+
- Read basic state and committed results from persisted records. Do not require the graph/Procs needed for continuation merely to access results. Preserve existing codec/schema compatibility requirements.
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### Scope limitations
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Application
|
|
31
|
+
Candidate discovery does not guarantee automatic unique correspondence to an Application request or exactly-once submission.
|
|
32
|
+
When multiple candidates exist, do not select one merely because it has the latest timestamp; Application must match its own correlation information.
|
|
33
|
+
Application-specific request IDs, outboxes, and deduplication remain Application responsibilities. Do not add generic idempotency infrastructure solely to meet result-access requirements.
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Preserve existing retention/deletion contracts. Restoring deleted results, indefinite retention, and a new history-management service are not required.
|
|
36
|
+
Inspect existing API/SPI behavior and map list scope, ordering, pagination, and similar concerns to the smallest necessary public path.
|
|
37
|
+
Add only capabilities that existing APIs cannot provide; do not expose internal repositories directly as the public contract.
|
|
38
38
|
|
|
39
|
-
## 2. RC-02
|
|
39
|
+
## 2. RC-02: Distinguishing absence, conflicts, and unknown persistence outcomes
|
|
40
40
|
|
|
41
|
-
###
|
|
41
|
+
### Shared decision rules
|
|
42
42
|
|
|
43
|
-
|
|
|
43
|
+
| Observation | Permitted decision or action |
|
|
44
44
|
|---|---|
|
|
45
|
-
|
|
|
46
|
-
| exact ID
|
|
47
|
-
| exact ID
|
|
48
|
-
|
|
|
49
|
-
| write
|
|
50
|
-
|
|
|
45
|
+
| A successful authoritative read confirms that the reserved ID is absent | Check the parent's latest state, reservation, and cancellation conditions, then attempt admission with the same reserved ID |
|
|
46
|
+
| The exact ID is confirmed nonterminal | Follow the existing Recovery contract for the same execution |
|
|
47
|
+
| The exact ID is confirmed terminal | Use the persisted outcome; do not create a replacement execution |
|
|
48
|
+
| Read timeout / I/O failure / record decode failure | Preserve state and follow existing error/retry contracts; do not treat the failure as absence |
|
|
49
|
+
| Commit outcome is unknown, for example after a lost write acknowledgement | Retain the same operation identity and reserved ID for readback; do not create another ID or assignment before confirmation |
|
|
50
|
+
| A definite revision/admission conflict | Reread the latest authoritative facts and validate consistency with the reservation, owner, and input; do not treat the conflict as success by itself |
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
Readback consistency must satisfy the existing Persistence contract that protects admission/CAS.
|
|
53
|
+
Cache/index discrepancies and read failures must not justify new admission.
|
|
54
|
+
Use existing atomic admission/CAS to prevent races between confirming absence and admission.
|
|
55
|
+
Start external semantic work only after admission success is confirmed.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
Team admission/enqueue/finalize/assignment/worker outcome/terminal
|
|
59
|
-
Team-owned enqueue/finalize
|
|
57
|
+
Scope: Source Handoff transfer, Target admission/stabilization, parent child reservation/outcome,
|
|
58
|
+
and Team admission/enqueue/finalize/assignment/worker outcome/terminal state.
|
|
59
|
+
Team-owned enqueue/finalize retain the existing policy of fact reconciliation using a stable tool_invocation_id.
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
While an unknown outcome remains unresolved, do not advance to the next semantic operation based on unconfirmed local assumptions.
|
|
62
|
+
Return control through existing Persistence error/retry paths instead of waiting synchronously without a bound.
|
|
63
|
+
Do not add manual resolution that requires Application to invent storage facts.
|
|
64
|
+
Reuse existing Agent/Persistence handling of unknown outcomes; do not create a second transaction engine dedicated to coordination.
|
|
65
65
|
|
|
66
|
-
## 3. RC-03
|
|
66
|
+
## 3. RC-03: Minimum wiring compatibility for recovery
|
|
67
67
|
|
|
68
|
-
###
|
|
68
|
+
### Required checks
|
|
69
69
|
|
|
70
|
-
|
|
|
70
|
+
| Subject | Checks required before continuation |
|
|
71
71
|
|---|---|
|
|
72
|
-
| Agent/Team
|
|
73
|
-
| Orchestrator child |
|
|
74
|
-
| Handoff | original main anchor
|
|
75
|
-
| Team worker/coordinator | Team lineage
|
|
72
|
+
| Agent/Team definition | Compare the persisted definition id/version with the current definition; require equality unless an existing explicit compatibility/migration contract permits otherwise |
|
|
73
|
+
| Orchestrator child | Match the persisted slot, the definition resolved from static subagent registration, reserved agent_id/execution_id, and owner |
|
|
74
|
+
| Handoff | Match the original main anchor, persisted active/Target IDs, required graph connections, and the same Persistence instance/domain |
|
|
75
|
+
| Team worker/coordinator | Match Team lineage, the persisted worker slot and definition, reserved Agent/execution IDs, and the persisted assignment |
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
If a required registration or Target is missing, a definition is incompatible, or the Persistence boundary differs, fail closed without starting semantic work.
|
|
78
|
+
Use existing configuration/rehydration error contracts and make the affected identity and type of missing/inconsistent information clear from the error.
|
|
79
|
+
Do not require execution wiring unnecessary for read-only result access (RC-01).
|
|
80
80
|
|
|
81
|
-
###
|
|
81
|
+
### Committed facts take precedence
|
|
82
82
|
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
83
|
+
- Do not reproject committed HandoffContext using the current HandoffPolicy.
|
|
84
|
+
- Do not replace committed child input/config with current defaults.
|
|
85
|
+
- Do not reselect committed assignments using the current scheduler.
|
|
86
|
+
- Do not recompute committed child/worker/final aggregate outcomes.
|
|
87
|
+
- Uncommitted scheduler/aggregate computations may rerun under the existing V2 replay-safe contract. Application must preserve semantic compatibility with the persisted inputs.
|
|
88
88
|
|
|
89
|
-
Phronomy
|
|
90
|
-
|
|
91
|
-
version
|
|
92
|
-
Proc/Class
|
|
89
|
+
Phronomy can check declared identity/version and structure, not semantic equivalence of Ruby code.
|
|
90
|
+
Application is responsible for not introducing incompatible implementations under an unchanged version.
|
|
91
|
+
Increasing a version alone does not automatically enable recovery of old executions; the corresponding definition or an existing explicit migration contract is required.
|
|
92
|
+
Do not add Proc/Class persistence, source hashes, policy descriptors, or a global generic class registry.
|
|
93
93
|
|
|
94
|
-
## 4. RC-04
|
|
94
|
+
## 4. RC-04: Ending observation and semantic cancellation
|
|
95
95
|
|
|
96
|
-
###
|
|
96
|
+
### Distinguish operations
|
|
97
97
|
|
|
98
|
-
|
|
|
98
|
+
| Operation or state | Contract |
|
|
99
99
|
|---|---|
|
|
100
|
-
| Application
|
|
101
|
-
| Runtime shutdown / process loss |
|
|
102
|
-
|
|
|
103
|
-
| recovery resolution / approval
|
|
100
|
+
| Application stops waiting, a connection is lost, or observation times out | This alone is not semantic cancellation of the durable execution |
|
|
101
|
+
| Runtime shutdown / process loss | This alone does not establish semantic cancellation; preserve execution and recoverability under existing shutdown/draining contracts |
|
|
102
|
+
| Explicit semantic cancellation request | Map it to the target owner/run and reserved executions under the existing Agent cancellation contract |
|
|
103
|
+
| Waiting for recovery resolution / approval | Preserve existing V2 rehydration paths; do not convert waiting into failure or automatic cancellation |
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
APIs that already request semantic cancellation, such as explicit cancellation of an existing Task, retain that contract.
|
|
106
|
+
Do not treat them as equivalent to merely ending observation. Record concrete public API mappings when inspecting the baseline.
|
|
107
107
|
|
|
108
|
-
###
|
|
108
|
+
### Applying cancellation to child executions
|
|
109
109
|
|
|
110
|
-
|
|
|
110
|
+
| Child state | Behavior after semantic cancellation of the parent run is accepted |
|
|
111
111
|
|---|---|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
112
|
+
| Reserved, not started | Stop new dispatch owned by the current parent run; retain reservation information and do not start a child just to cancel it |
|
|
113
|
+
| Running, or racing with admission | Check the exact reserved ID's state and apply existing Agent cancellation; discarding a local Task alone does not complete cancellation handling |
|
|
114
|
+
| Terminal | Preserve the durable outcome; do not rewrite historical success/failure as cancellation or rerun it for compensation |
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
restart
|
|
121
|
-
|
|
116
|
+
Handle races between parent cancellation and child admission using the latest parent-run state and existing admission contracts.
|
|
117
|
+
Reconcile an already admitted child under the running-child rules; do not create a child with a different ID.
|
|
118
|
+
Map the ordering of parent terminalization and child settlement to existing Agent cancellation/terminal-barrier contracts.
|
|
119
|
+
If a child is incomplete, retain its exact ID and required cancellation/reconciliation state.
|
|
120
|
+
Require rediscovery through existing recovery paths after restart; do not claim that all parent work is complete while forgetting an unhandled child.
|
|
121
|
+
Do not add a new public terminal status or a separate cancellation scheduler solely for this addendum.
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
Handoff
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
Limit cancellation to children owned by the affected parent run; it must not affect other executions of a shared Agent or later Team runs.
|
|
124
|
+
A Handoff Source is handed_off after transfer commits. Cancelling Source later must not be treated as reversing the transfer.
|
|
125
|
+
Map explicit cancellation of the current Handoff turn to the relevant Target execution using persisted routing/reservations.
|
|
126
|
+
Do not return active responsibility to the original main Agent because observation ends or cancellation occurs.
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
Cancellation of external Providers/Tools does not guarantee reversal of side effects. Resolve uncertain outcomes through the existing Agent Recovery contract.
|
|
129
|
+
If existing mechanisms cannot satisfy the required ordering and rediscovery without a second execution engine or similar addition, report a Stop Condition.
|
|
130
130
|
|
|
131
|
-
## 5. RC-05
|
|
131
|
+
## 5. RC-05: Consistent durability guarantee wording
|
|
132
132
|
|
|
133
|
-
>
|
|
134
|
-
>
|
|
133
|
+
> Reuse committed durable outcomes. Recover incomplete executions with the same semantic identity.
|
|
134
|
+
> Resolve uncertain outcomes of external Provider/Tool operations under the existing Agent Recovery contract.
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
callback
|
|
136
|
+
Starting only when execution is confirmed not to have started refers to framework-owned execution admission.
|
|
137
|
+
It does not mean that no request ever reached an external system, nor does it guarantee exactly-once external side effects.
|
|
138
|
+
Recovering an incomplete execution with the same ID also does not mean unconditionally resending every internal Provider/Tool call.
|
|
139
|
+
Loss of a callback or local Task, or an observation timeout, must not justify rerunning semantic work.
|
|
140
140
|
|
|
141
|
-
## 6.
|
|
141
|
+
## 6. Validation conditions and implementation mapping
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
The following are behavioral validation conditions, not a required count of new spec files.
|
|
144
|
+
Where existing specs verify a contract, record that evidence and add only missing cases.
|
|
145
145
|
|
|
146
|
-
| ID |
|
|
146
|
+
| ID | Validation scenario | Required outcome |
|
|
147
147
|
|---|---|---|
|
|
148
|
-
| RC-01-A | terminal commit
|
|
149
|
-
| RC-01-B | admission
|
|
150
|
-
| RC-01-C | graph/listener
|
|
151
|
-
| RC-02-A |
|
|
152
|
-
| RC-02-B | read
|
|
153
|
-
| RC-02-C |
|
|
154
|
-
| RC-03-A | subagent
|
|
155
|
-
| RC-03-B |
|
|
156
|
-
| RC-04-A |
|
|
157
|
-
| RC-04-B |
|
|
158
|
-
| RC-04-C |
|
|
159
|
-
| RC-04-D |
|
|
160
|
-
| RC-04-E | Handoff transfer
|
|
161
|
-
| RC-05-A |
|
|
162
|
-
|
|
163
|
-
baseline
|
|
164
|
-
|
|
165
|
-
focused
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
## 7.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
Proc/Class serialization
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
## 8.
|
|
176
|
-
|
|
177
|
-
2026-09-07
|
|
178
|
-
|
|
179
|
-
本追補の責務境界と必須契約は変更しない。
|
|
148
|
+
| RC-01-A | Process loss after terminal commit and before callback | Read the same result by exact ID without rerunning semantic work or callbacks |
|
|
149
|
+
| RC-01-B | Caller is lost before the admission acknowledgement; execution later becomes terminal | Discover candidates from owner identity; do not arbitrarily choose one when multiple candidates exist |
|
|
150
|
+
| RC-01-C | Access results without a graph/listener, or inject result read/decode failure | Require no unnecessary wiring; do not disguise an access failure as success or absence |
|
|
151
|
+
| RC-02-A | Lose the acknowledgement immediately after each successful semantic commit | Adopt the existing fact through readback; create neither another ID nor duplicate assignments |
|
|
152
|
+
| RC-02-B | Independently inject read failure, authoritative absence, and CAS conflict | Keep the states distinct; execute only after admission success is confirmed |
|
|
153
|
+
| RC-02-C | Readback also fails after an unknown outcome | Preserve state and return control; do not wait synchronously without a bound or create a new execution |
|
|
154
|
+
| RC-03-A | Remove subagent registration, mismatch definition version, or omit Target | Fail closed before continuation; do not substitute another definition or Target |
|
|
155
|
+
| RC-03-B | Recover with compatible current wiring | Do not recompute committed Context/input/assignment/outcome |
|
|
156
|
+
| RC-04-A | End waiting, shut down Runtime, or lose the process | Do not establish implicit semantic cancellation |
|
|
157
|
+
| RC-04-B | Parent cancellation with an unstarted/active/terminal child | Follow state-specific rules and preserve exact IDs and committed outcomes |
|
|
158
|
+
| RC-04-C | Race parent cancellation against child admission/terminal state | Do not lose the child; remain consistent with existing cancellation/terminal barriers |
|
|
159
|
+
| RC-04-D | Lose the process at each commit boundary after a cancellation request | Rediscover and reconcile incomplete children of the same run through recovery paths |
|
|
160
|
+
| RC-04-E | End observation or explicitly cancel after Handoff transfer | Do not roll responsibility back to Source; apply cancellation only to the relevant Target execution |
|
|
161
|
+
| RC-05-A | Independently inject an uncertain external Tool effect and a lost callback | Use existing Recovery for the former and committed-result access for the latter; never rerun blindly |
|
|
162
|
+
|
|
163
|
+
When integrating with the baseline, record the public API/SPI, implementation locations, and existing/additional specs for each RC ID in a mapping table.
|
|
164
|
+
In particular, do not mark result-discovery APIs, compatible-version handling, or cancellation/terminal barriers complete using unverified method names.
|
|
165
|
+
Successful focused, backend, fault, and full-suite runs require actual measurement on the target checkout.
|
|
166
|
+
They have not been run at the time of this document revision.
|
|
167
|
+
|
|
168
|
+
## 7. Responsibilities that remain out of scope
|
|
169
|
+
|
|
170
|
+
Callback outbox/ACK, a terminal-delivery index, synthetic executions for standalone fan-out,
|
|
171
|
+
Proc/Class serialization, a global generic registry, distributed transactions across independent Persistence instances,
|
|
172
|
+
and a second execution engine dedicated to Team remain out of scope.
|
|
173
|
+
Public result access does not replace Application notification delivery or deduplication of external effects.
|
|
174
|
+
|
|
175
|
+
## 8. Implementation mapping
|
|
176
|
+
|
|
177
|
+
See [IMPLEMENTATION_REPORT.md](IMPLEMENTATION_REPORT.md) for the implementation, public API/SPI, and validation scope as of 2026-09-07.
|
|
178
|
+
The responsibility boundaries and required contracts in this addendum remain unchanged.
|