Skip to content

Commit 3152a6c

Browse files
committed
feat(ledger): list_event_handlers, with approval state
The read the app's event-handler screen needs: every handler on the graph, highest priority first, with awaiting_approval for an AI client's suggestion that a person has not approved (robosystems #1918). The regen also drops the removed rollforward block arm's generated models (robosystems #1915); the information-block facades now type their bodies with the forecast arm in its place. Claude-Session: https://claude.ai/code/session_01VPxBBHkqhwkZ6Eq8EXSBR6
1 parent 39c2de7 commit 3152a6c

29 files changed

Lines changed: 458 additions & 1302 deletions

‎robosystems_client/api/robo_ledger_information_blocks/create_information_block.py‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from ...client import AuthenticatedClient, Client
99
from ...models.create_forecast_arm import CreateForecastArm
1010
from ...models.create_legacy_arm import CreateLegacyArm
11-
from ...models.create_rollforward_arm import CreateRollforwardArm
1211
from ...models.create_schedule_arm import CreateScheduleArm
1312
from ...models.error_response import ErrorResponse
1413
from ...models.operation_envelope_information_block_envelope import (
@@ -20,7 +19,7 @@
2019
def _get_kwargs(
2120
graph_id: str,
2221
*,
23-
body: CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm,
22+
body: CreateForecastArm | CreateLegacyArm | CreateScheduleArm,
2423
idempotency_key: None | str | Unset = UNSET,
2524
) -> dict[str, Any]:
2625
headers: dict[str, Any] = {}
@@ -36,8 +35,6 @@ def _get_kwargs(
3635

3736
if isinstance(body, CreateScheduleArm):
3837
_kwargs["json"] = body.to_dict()
39-
elif isinstance(body, CreateRollforwardArm):
40-
_kwargs["json"] = body.to_dict()
4138
elif isinstance(body, CreateForecastArm):
4239
_kwargs["json"] = body.to_dict()
4340
else:
@@ -118,7 +115,7 @@ def sync_detailed(
118115
graph_id: str,
119116
*,
120117
client: AuthenticatedClient,
121-
body: CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm,
118+
body: CreateForecastArm | CreateLegacyArm | CreateScheduleArm,
122119
idempotency_key: None | str | Unset = UNSET,
123120
) -> Response[ErrorResponse | OperationEnvelopeInformationBlockEnvelope]:
124121
"""Create Information Block
@@ -136,8 +133,8 @@ def sync_detailed(
136133
Args:
137134
graph_id (str):
138135
idempotency_key (None | str | Unset):
139-
body (CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm):
140-
Create an Information Block. The body is a discriminated union on
136+
body (CreateForecastArm | CreateLegacyArm | CreateScheduleArm): Create an Information
137+
Block. The body is a discriminated union on
141138
`block_type`: pick the arm matching the block type you want to
142139
create. The schedule arm carries a fully typed payload; statement
143140
and metric arms accept an untyped payload but currently return HTTP
@@ -169,7 +166,7 @@ def sync(
169166
graph_id: str,
170167
*,
171168
client: AuthenticatedClient,
172-
body: CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm,
169+
body: CreateForecastArm | CreateLegacyArm | CreateScheduleArm,
173170
idempotency_key: None | str | Unset = UNSET,
174171
) -> ErrorResponse | OperationEnvelopeInformationBlockEnvelope | None:
175172
"""Create Information Block
@@ -187,8 +184,8 @@ def sync(
187184
Args:
188185
graph_id (str):
189186
idempotency_key (None | str | Unset):
190-
body (CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm):
191-
Create an Information Block. The body is a discriminated union on
187+
body (CreateForecastArm | CreateLegacyArm | CreateScheduleArm): Create an Information
188+
Block. The body is a discriminated union on
192189
`block_type`: pick the arm matching the block type you want to
193190
create. The schedule arm carries a fully typed payload; statement
194191
and metric arms accept an untyped payload but currently return HTTP
@@ -215,7 +212,7 @@ async def asyncio_detailed(
215212
graph_id: str,
216213
*,
217214
client: AuthenticatedClient,
218-
body: CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm,
215+
body: CreateForecastArm | CreateLegacyArm | CreateScheduleArm,
219216
idempotency_key: None | str | Unset = UNSET,
220217
) -> Response[ErrorResponse | OperationEnvelopeInformationBlockEnvelope]:
221218
"""Create Information Block
@@ -233,8 +230,8 @@ async def asyncio_detailed(
233230
Args:
234231
graph_id (str):
235232
idempotency_key (None | str | Unset):
236-
body (CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm):
237-
Create an Information Block. The body is a discriminated union on
233+
body (CreateForecastArm | CreateLegacyArm | CreateScheduleArm): Create an Information
234+
Block. The body is a discriminated union on
238235
`block_type`: pick the arm matching the block type you want to
239236
create. The schedule arm carries a fully typed payload; statement
240237
and metric arms accept an untyped payload but currently return HTTP
@@ -264,7 +261,7 @@ async def asyncio(
264261
graph_id: str,
265262
*,
266263
client: AuthenticatedClient,
267-
body: CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm,
264+
body: CreateForecastArm | CreateLegacyArm | CreateScheduleArm,
268265
idempotency_key: None | str | Unset = UNSET,
269266
) -> ErrorResponse | OperationEnvelopeInformationBlockEnvelope | None:
270267
"""Create Information Block
@@ -282,8 +279,8 @@ async def asyncio(
282279
Args:
283280
graph_id (str):
284281
idempotency_key (None | str | Unset):
285-
body (CreateForecastArm | CreateLegacyArm | CreateRollforwardArm | CreateScheduleArm):
286-
Create an Information Block. The body is a discriminated union on
282+
body (CreateForecastArm | CreateLegacyArm | CreateScheduleArm): Create an Information
283+
Block. The body is a discriminated union on
287284
`block_type`: pick the arm matching the block type you want to
288285
create. The schedule arm carries a fully typed payload; statement
289286
and metric arms accept an untyped payload but currently return HTTP

‎robosystems_client/api/robo_ledger_information_blocks/delete_information_block.py‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from ...client import AuthenticatedClient, Client
99
from ...models.delete_forecast_arm import DeleteForecastArm
1010
from ...models.delete_legacy_arm import DeleteLegacyArm
11-
from ...models.delete_rollforward_arm import DeleteRollforwardArm
1211
from ...models.delete_schedule_arm import DeleteScheduleArm
1312
from ...models.error_response import ErrorResponse
1413
from ...models.operation_envelope_delete_information_block_response import (
@@ -20,7 +19,7 @@
2019
def _get_kwargs(
2120
graph_id: str,
2221
*,
23-
body: DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm,
22+
body: DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm,
2423
idempotency_key: None | str | Unset = UNSET,
2524
) -> dict[str, Any]:
2625
headers: dict[str, Any] = {}
@@ -36,8 +35,6 @@ def _get_kwargs(
3635

3736
if isinstance(body, DeleteScheduleArm):
3837
_kwargs["json"] = body.to_dict()
39-
elif isinstance(body, DeleteRollforwardArm):
40-
_kwargs["json"] = body.to_dict()
4138
elif isinstance(body, DeleteForecastArm):
4239
_kwargs["json"] = body.to_dict()
4340
else:
@@ -120,7 +117,7 @@ def sync_detailed(
120117
graph_id: str,
121118
*,
122119
client: AuthenticatedClient,
123-
body: DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm,
120+
body: DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm,
124121
idempotency_key: None | str | Unset = UNSET,
125122
) -> Response[ErrorResponse | OperationEnvelopeDeleteInformationBlockResponse]:
126123
"""Delete Information Block
@@ -135,8 +132,8 @@ def sync_detailed(
135132
Args:
136133
graph_id (str):
137134
idempotency_key (None | str | Unset):
138-
body (DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm):
139-
Delete an Information Block. The body is a discriminated union on
135+
body (DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm): Delete an Information
136+
Block. The body is a discriminated union on
140137
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
141138
arm carries a fully typed delete payload; statement and metric arms
142139
return HTTP 501.
@@ -166,7 +163,7 @@ def sync(
166163
graph_id: str,
167164
*,
168165
client: AuthenticatedClient,
169-
body: DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm,
166+
body: DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm,
170167
idempotency_key: None | str | Unset = UNSET,
171168
) -> ErrorResponse | OperationEnvelopeDeleteInformationBlockResponse | None:
172169
"""Delete Information Block
@@ -181,8 +178,8 @@ def sync(
181178
Args:
182179
graph_id (str):
183180
idempotency_key (None | str | Unset):
184-
body (DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm):
185-
Delete an Information Block. The body is a discriminated union on
181+
body (DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm): Delete an Information
182+
Block. The body is a discriminated union on
186183
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
187184
arm carries a fully typed delete payload; statement and metric arms
188185
return HTTP 501.
@@ -207,7 +204,7 @@ async def asyncio_detailed(
207204
graph_id: str,
208205
*,
209206
client: AuthenticatedClient,
210-
body: DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm,
207+
body: DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm,
211208
idempotency_key: None | str | Unset = UNSET,
212209
) -> Response[ErrorResponse | OperationEnvelopeDeleteInformationBlockResponse]:
213210
"""Delete Information Block
@@ -222,8 +219,8 @@ async def asyncio_detailed(
222219
Args:
223220
graph_id (str):
224221
idempotency_key (None | str | Unset):
225-
body (DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm):
226-
Delete an Information Block. The body is a discriminated union on
222+
body (DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm): Delete an Information
223+
Block. The body is a discriminated union on
227224
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
228225
arm carries a fully typed delete payload; statement and metric arms
229226
return HTTP 501.
@@ -251,7 +248,7 @@ async def asyncio(
251248
graph_id: str,
252249
*,
253250
client: AuthenticatedClient,
254-
body: DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm,
251+
body: DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm,
255252
idempotency_key: None | str | Unset = UNSET,
256253
) -> ErrorResponse | OperationEnvelopeDeleteInformationBlockResponse | None:
257254
"""Delete Information Block
@@ -266,8 +263,8 @@ async def asyncio(
266263
Args:
267264
graph_id (str):
268265
idempotency_key (None | str | Unset):
269-
body (DeleteForecastArm | DeleteLegacyArm | DeleteRollforwardArm | DeleteScheduleArm):
270-
Delete an Information Block. The body is a discriminated union on
266+
body (DeleteForecastArm | DeleteLegacyArm | DeleteScheduleArm): Delete an Information
267+
Block. The body is a discriminated union on
271268
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
272269
arm carries a fully typed delete payload; statement and metric arms
273270
return HTTP 501.

‎robosystems_client/api/robo_ledger_information_blocks/update_information_block.py‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
)
1313
from ...models.update_forecast_arm import UpdateForecastArm
1414
from ...models.update_legacy_arm import UpdateLegacyArm
15-
from ...models.update_rollforward_arm import UpdateRollforwardArm
1615
from ...models.update_schedule_arm import UpdateScheduleArm
1716
from ...types import UNSET, Response, Unset
1817

1918

2019
def _get_kwargs(
2120
graph_id: str,
2221
*,
23-
body: UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm,
22+
body: UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm,
2423
idempotency_key: None | str | Unset = UNSET,
2524
) -> dict[str, Any]:
2625
headers: dict[str, Any] = {}
@@ -36,8 +35,6 @@ def _get_kwargs(
3635

3736
if isinstance(body, UpdateScheduleArm):
3837
_kwargs["json"] = body.to_dict()
39-
elif isinstance(body, UpdateRollforwardArm):
40-
_kwargs["json"] = body.to_dict()
4138
elif isinstance(body, UpdateForecastArm):
4239
_kwargs["json"] = body.to_dict()
4340
else:
@@ -118,7 +115,7 @@ def sync_detailed(
118115
graph_id: str,
119116
*,
120117
client: AuthenticatedClient,
121-
body: UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm,
118+
body: UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm,
122119
idempotency_key: None | str | Unset = UNSET,
123120
) -> Response[ErrorResponse | OperationEnvelopeInformationBlockEnvelope]:
124121
"""Update Information Block
@@ -133,8 +130,8 @@ def sync_detailed(
133130
Args:
134131
graph_id (str):
135132
idempotency_key (None | str | Unset):
136-
body (UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm):
137-
Update an Information Block. The body is a discriminated union on
133+
body (UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm): Update an Information
134+
Block. The body is a discriminated union on
138135
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
139136
arm carries a fully typed update payload; statement and metric arms
140137
return HTTP 501 (statements are library-seeded; metric updates are
@@ -165,7 +162,7 @@ def sync(
165162
graph_id: str,
166163
*,
167164
client: AuthenticatedClient,
168-
body: UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm,
165+
body: UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm,
169166
idempotency_key: None | str | Unset = UNSET,
170167
) -> ErrorResponse | OperationEnvelopeInformationBlockEnvelope | None:
171168
"""Update Information Block
@@ -180,8 +177,8 @@ def sync(
180177
Args:
181178
graph_id (str):
182179
idempotency_key (None | str | Unset):
183-
body (UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm):
184-
Update an Information Block. The body is a discriminated union on
180+
body (UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm): Update an Information
181+
Block. The body is a discriminated union on
185182
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
186183
arm carries a fully typed update payload; statement and metric arms
187184
return HTTP 501 (statements are library-seeded; metric updates are
@@ -207,7 +204,7 @@ async def asyncio_detailed(
207204
graph_id: str,
208205
*,
209206
client: AuthenticatedClient,
210-
body: UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm,
207+
body: UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm,
211208
idempotency_key: None | str | Unset = UNSET,
212209
) -> Response[ErrorResponse | OperationEnvelopeInformationBlockEnvelope]:
213210
"""Update Information Block
@@ -222,8 +219,8 @@ async def asyncio_detailed(
222219
Args:
223220
graph_id (str):
224221
idempotency_key (None | str | Unset):
225-
body (UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm):
226-
Update an Information Block. The body is a discriminated union on
222+
body (UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm): Update an Information
223+
Block. The body is a discriminated union on
227224
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
228225
arm carries a fully typed update payload; statement and metric arms
229226
return HTTP 501 (statements are library-seeded; metric updates are
@@ -252,7 +249,7 @@ async def asyncio(
252249
graph_id: str,
253250
*,
254251
client: AuthenticatedClient,
255-
body: UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm,
252+
body: UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm,
256253
idempotency_key: None | str | Unset = UNSET,
257254
) -> ErrorResponse | OperationEnvelopeInformationBlockEnvelope | None:
258255
"""Update Information Block
@@ -267,8 +264,8 @@ async def asyncio(
267264
Args:
268265
graph_id (str):
269266
idempotency_key (None | str | Unset):
270-
body (UpdateForecastArm | UpdateLegacyArm | UpdateRollforwardArm | UpdateScheduleArm):
271-
Update an Information Block. The body is a discriminated union on
267+
body (UpdateForecastArm | UpdateLegacyArm | UpdateScheduleArm): Update an Information
268+
Block. The body is a discriminated union on
272269
`block_type` mirroring `CreateInformationBlockRequest`. The schedule
273270
arm carries a fully typed update payload; statement and metric arms
274271
return HTTP 501 (statements are library-seeded; metric updates are

‎robosystems_client/api/robo_ledger_ledger_events/create_event_handler.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def sync_detailed(
116116
Define a rule that fires GL transactions when a matching event block is created with
117117
apply_handlers=True. Match criteria (event_type, event_category, match_source, match_agent_type,
118118
etc.) act as AND-joined filters — null fields match anything. The highest-priority matching handler
119-
wins. AI-suggested handlers (suggested_by='ai') require approval before they are eligible for
120-
matching.
119+
wins. A handler created through an AI client is the AI's suggestion (suggested_by='ai'): it takes no
120+
part in matching until a person approves it in the app or the API.
121121
122122
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
123123
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -172,8 +172,8 @@ def sync(
172172
Define a rule that fires GL transactions when a matching event block is created with
173173
apply_handlers=True. Match criteria (event_type, event_category, match_source, match_agent_type,
174174
etc.) act as AND-joined filters — null fields match anything. The highest-priority matching handler
175-
wins. AI-suggested handlers (suggested_by='ai') require approval before they are eligible for
176-
matching.
175+
wins. A handler created through an AI client is the AI's suggestion (suggested_by='ai'): it takes no
176+
part in matching until a person approves it in the app or the API.
177177
178178
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
179179
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -223,8 +223,8 @@ async def asyncio_detailed(
223223
Define a rule that fires GL transactions when a matching event block is created with
224224
apply_handlers=True. Match criteria (event_type, event_category, match_source, match_agent_type,
225225
etc.) act as AND-joined filters — null fields match anything. The highest-priority matching handler
226-
wins. AI-suggested handlers (suggested_by='ai') require approval before they are eligible for
227-
matching.
226+
wins. A handler created through an AI client is the AI's suggestion (suggested_by='ai'): it takes no
227+
part in matching until a person approves it in the app or the API.
228228
229229
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
230230
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -277,8 +277,8 @@ async def asyncio(
277277
Define a rule that fires GL transactions when a matching event block is created with
278278
apply_handlers=True. Match criteria (event_type, event_category, match_source, match_agent_type,
279279
etc.) act as AND-joined filters — null fields match anything. The highest-priority matching handler
280-
wins. AI-suggested handlers (suggested_by='ai') require approval before they are eligible for
281-
matching.
280+
wins. A handler created through an AI client is the AI's suggestion (suggested_by='ai'): it takes no
281+
part in matching until a person approves it in the app or the API.
282282
283283
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
284284
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

0 commit comments

Comments
 (0)