harness-sdk-python 0.40.3__tar.gz → 0.40.4__tar.gz
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.
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/PKG-INFO +8 -8
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/README.md +5 -5
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/examples/runs_app.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/pyproject.toml +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/langgraph.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/run_manager.py +4 -4
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/threads.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/voice.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/run_helpers.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_admit_steer.py +5 -5
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_deepagents_approval.py +4 -4
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_deepagents_files.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_deepagents_outcome.py +4 -4
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_deepagents_thread.py +4 -4
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_deepagents_voice.py +6 -6
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_durability.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_fenced_postgres.py +8 -8
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_langgraph.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_mint_concurrency.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_prioritize.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_restore.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_run_admission.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_run_crash_sweep.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_run_eviction.py +4 -4
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_run_id_bounds.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_run_ownership.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_run_sync.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_threads.py +9 -9
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_undo.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_voice.py +1 -1
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_wire.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/voice_helpers.py +3 -3
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/.gitignore +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/examples/__init__.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/__init__.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/checkpoints.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/deepagents.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/deepagents_host.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/fenced_postgres.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/interest.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/linear_thread.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/messages.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/parts.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/prioritize.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/protocol.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/providers/__init__.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/providers/gpt_live.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/voice_thread.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/wire.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_applied_visibility.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_batches.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_branch_anchor.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_checkpoints.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_dispatching.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_edit_dispatched.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_edit_reload.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_enqueue.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_gpt_live.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_imports.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_input_required.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_interest.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_linear_thread.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_meta.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_outcomes.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_parts.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_placement.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_prepare_hooks.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_prioritize_builtins.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_rewind_during_run.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_settle.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_steer.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_stop_continue.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_stopping_window.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_voice_delegation.py +0 -0
- {harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/tests/test_voice_events.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: harness-sdk-python
|
|
3
|
-
Version: 0.40.
|
|
3
|
+
Version: 0.40.4
|
|
4
4
|
Summary: RunManager: the harness-sdk runs subsystem for Python Statewire hosts
|
|
5
5
|
Project-URL: Repository, https://github.com/assistant-ui/harness-sdk
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Requires-Python: <4.0,>=3.12
|
|
8
|
-
Requires-Dist:
|
|
9
|
-
Requires-Dist: statewire<0.24,>=0.23.
|
|
8
|
+
Requires-Dist: pinboard-sdk>=0.18.0
|
|
9
|
+
Requires-Dist: statewire<0.24,>=0.23.6
|
|
10
10
|
Provides-Extra: deepagents
|
|
11
11
|
Requires-Dist: deepagents>=0.6.12; extra == 'deepagents'
|
|
12
12
|
Requires-Dist: langchain-core>=0.3; extra == 'deepagents'
|
|
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
|
|
|
26
26
|
|
|
27
27
|
# harness-sdk-python
|
|
28
28
|
|
|
29
|
-
The runs subsystem for Python Statewire hosts: `@run_manager` turns one async method into the run executor and mounts the `run/*` command surface (send, dequeue, edit, reload, stop, continue, input), each run in its own tray. Part of [harness-sdk](https://github.com/assistant-ui/harness-sdk), with `statewire` and
|
|
29
|
+
The runs subsystem for Python Statewire hosts: `@run_manager` turns one async method into the run executor and mounts the `run/*` command surface (send, dequeue, edit, reload, stop, continue, input), each run in its own tray. Part of [harness-sdk](https://github.com/assistant-ui/harness-sdk), with `statewire` and Pinboard.
|
|
30
30
|
|
|
31
31
|
## Install
|
|
32
32
|
|
|
@@ -88,7 +88,7 @@ async def run(self, ctx: RunManager.RunContext): ...
|
|
|
88
88
|
|
|
89
89
|
## Docs
|
|
90
90
|
|
|
91
|
-
- Get started: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/get-started/chat-app/page.mdx
|
|
92
|
-
- Guide: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/guides/harness/host/page.mdx
|
|
93
|
-
- Reference: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/reference/harness-sdk-python/page.mdx
|
|
94
|
-
- Spec: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/spec/runs-protocol/page.mdx
|
|
91
|
+
- Get started: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/get-started/chat-app/page.mdx
|
|
92
|
+
- Guide: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/guides/harness/host/page.mdx
|
|
93
|
+
- Reference: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/reference/harness-sdk-python/page.mdx
|
|
94
|
+
- Spec: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/spec/runs-protocol/page.mdx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# harness-sdk-python
|
|
2
2
|
|
|
3
|
-
The runs subsystem for Python Statewire hosts: `@run_manager` turns one async method into the run executor and mounts the `run/*` command surface (send, dequeue, edit, reload, stop, continue, input), each run in its own tray. Part of [harness-sdk](https://github.com/assistant-ui/harness-sdk), with `statewire` and
|
|
3
|
+
The runs subsystem for Python Statewire hosts: `@run_manager` turns one async method into the run executor and mounts the `run/*` command surface (send, dequeue, edit, reload, stop, continue, input), each run in its own tray. Part of [harness-sdk](https://github.com/assistant-ui/harness-sdk), with `statewire` and Pinboard.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -62,7 +62,7 @@ async def run(self, ctx: RunManager.RunContext): ...
|
|
|
62
62
|
|
|
63
63
|
## Docs
|
|
64
64
|
|
|
65
|
-
- Get started: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/get-started/chat-app/page.mdx
|
|
66
|
-
- Guide: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/guides/harness/host/page.mdx
|
|
67
|
-
- Reference: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/reference/harness-sdk-python/page.mdx
|
|
68
|
-
- Spec: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/app/docs/spec/runs-protocol/page.mdx
|
|
65
|
+
- Get started: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/get-started/chat-app/page.mdx
|
|
66
|
+
- Guide: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/guides/harness/host/page.mdx
|
|
67
|
+
- Reference: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/reference/harness-sdk-python/page.mdx
|
|
68
|
+
- Spec: https://github.com/assistant-ui/harness-sdk/blob/main/apps/docs/src/app/docs/spec/runs-protocol/page.mdx
|
|
@@ -19,8 +19,8 @@ from typing import Any
|
|
|
19
19
|
|
|
20
20
|
from fastapi import FastAPI
|
|
21
21
|
from langchain_core.messages import AIMessage, HumanMessage, ToolMessage
|
|
22
|
-
from
|
|
23
|
-
from
|
|
22
|
+
from pinboard import Worker
|
|
23
|
+
from pinboard.durability import MemoryStateStore
|
|
24
24
|
from statewire import Statewire, command, plain
|
|
25
25
|
from statewire.langgraph import append_langgraph_event
|
|
26
26
|
|
|
@@ -191,6 +191,6 @@ class RunsHost(Statewire):
|
|
|
191
191
|
return await self.run.input(params, auth_result=auth_result)
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
worker =
|
|
194
|
+
worker = Worker(hosts={"/threads": RunsHost}, state_store=MemoryStateStore())
|
|
195
195
|
app = FastAPI()
|
|
196
196
|
app.include_router(worker)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "harness-sdk-python"
|
|
3
|
-
version = "0.40.
|
|
3
|
+
version = "0.40.4"
|
|
4
4
|
description = "RunManager: the harness-sdk runs subsystem for Python Statewire hosts"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
7
7
|
requires-python = ">=3.12,<4.0"
|
|
8
|
-
dependencies = ["statewire>=0.23.
|
|
8
|
+
dependencies = ["statewire>=0.23.6,<0.24", "pinboard-sdk>=0.18.0"]
|
|
9
9
|
|
|
10
10
|
[project.optional-dependencies]
|
|
11
11
|
postgres = ["langgraph-checkpoint-postgres>=2.0.0"]
|
|
@@ -25,7 +25,7 @@ Repository = "https://github.com/assistant-ui/harness-sdk"
|
|
|
25
25
|
|
|
26
26
|
[tool.uv.sources]
|
|
27
27
|
statewire = { workspace = true }
|
|
28
|
-
|
|
28
|
+
pinboard-sdk = { workspace = true }
|
|
29
29
|
|
|
30
30
|
[build-system]
|
|
31
31
|
requires = ["hatchling"]
|
|
@@ -83,10 +83,10 @@ from typing import (
|
|
|
83
83
|
Protocol,
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
-
from
|
|
87
|
-
from
|
|
88
|
-
from
|
|
89
|
-
from
|
|
86
|
+
from pinboard import EvictionRequested
|
|
87
|
+
from pinboard.durability import FenceLost
|
|
88
|
+
from pinboard.trays import Tray, TrayDescriptor, TrayCtx, TrayMapNamespace, inbox
|
|
89
|
+
from pinboard.trays import persistent, persistent_outbox, persistent_queue
|
|
90
90
|
from statepatch import observable
|
|
91
91
|
from statewire import StatewireReject
|
|
92
92
|
from statewire.api import (
|
|
@@ -8,7 +8,7 @@ from datetime import datetime, timezone
|
|
|
8
8
|
from typing import Any, Literal, NotRequired, Protocol, TypedDict, get_args
|
|
9
9
|
|
|
10
10
|
from fastapi import HTTPException, Request
|
|
11
|
-
from
|
|
11
|
+
from pinboard import Attestation, AuthRejected, attestation, route
|
|
12
12
|
from starlette.requests import HTTPConnection
|
|
13
13
|
from statewire import Statewire, StatewireReject, command
|
|
14
14
|
|
|
@@ -56,7 +56,7 @@ from time import monotonic
|
|
|
56
56
|
from typing import Any, Callable, Literal, Protocol, TypedDict
|
|
57
57
|
from uuid import uuid4
|
|
58
58
|
|
|
59
|
-
from
|
|
59
|
+
from pinboard.trays import Tray, TrayDescriptor, TrayMapNamespace
|
|
60
60
|
from statepatch import observable, plain
|
|
61
61
|
from statewire import StatewireReject
|
|
62
62
|
|
|
@@ -5,8 +5,8 @@ from dataclasses import dataclass
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
from uuid import uuid4
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
8
|
+
from pinboard import Worker
|
|
9
|
+
from pinboard.testing import MemoryStateStore
|
|
10
10
|
from statewire import Statewire, command
|
|
11
11
|
from statewire.protocol import VERSION, Offer, Protocol, VersionRange
|
|
12
12
|
from statewire.protocol import headers as protocol_headers
|
|
@@ -346,7 +346,7 @@ async def run_host(
|
|
|
346
346
|
version=version,
|
|
347
347
|
prioritize=prioritize,
|
|
348
348
|
)
|
|
349
|
-
worker =
|
|
349
|
+
worker = Worker(
|
|
350
350
|
state_store=store if store is not None else MemoryStateStore()
|
|
351
351
|
)
|
|
352
352
|
async with statewire_client(host_cls, worker=worker) as (app, client):
|
|
@@ -9,8 +9,8 @@ import copy
|
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from pinboard import Worker
|
|
13
|
+
from pinboard.testing import MemoryStateStore
|
|
14
14
|
from run_helpers import Script, add, machine, msg
|
|
15
15
|
from statewire_helpers import apply_ops, attach_of, post_frame, statewire_client
|
|
16
16
|
|
|
@@ -68,7 +68,7 @@ async def test_durable_dispatch_rejects_oversized_steer_before_mutation():
|
|
|
68
68
|
script = Script()
|
|
69
69
|
host = make_host(script)
|
|
70
70
|
host.gate.set()
|
|
71
|
-
async with statewire_client(host, worker=
|
|
71
|
+
async with statewire_client(host, worker=Worker(state_store=MemoryStateStore())) as (_app, client):
|
|
72
72
|
async with attach_of(_app, {"headers": {}}) as stream:
|
|
73
73
|
await stream.next_event()
|
|
74
74
|
frame = {"cmd": [statement(1, "run/steerDurable", {
|
|
@@ -91,7 +91,7 @@ async def test_admit_steer_admits_exactly_once_and_the_run_sees_no_tag(torn):
|
|
|
91
91
|
store = MemoryStateStore()
|
|
92
92
|
script = Script()
|
|
93
93
|
host = make_host(script)
|
|
94
|
-
async with statewire_client(host, worker=
|
|
94
|
+
async with statewire_client(host, worker=Worker(state_store=store)) as (
|
|
95
95
|
app,
|
|
96
96
|
client,
|
|
97
97
|
):
|
|
@@ -118,7 +118,7 @@ async def test_admit_steer_admits_exactly_once_and_the_run_sees_no_tag(torn):
|
|
|
118
118
|
script2 = Script()
|
|
119
119
|
host2 = make_host(script2)
|
|
120
120
|
host2.gate.set()
|
|
121
|
-
async with statewire_client(host2, worker=
|
|
121
|
+
async with statewire_client(host2, worker=Worker(state_store=store)) as (
|
|
122
122
|
app,
|
|
123
123
|
client,
|
|
124
124
|
):
|
|
@@ -11,8 +11,8 @@ import pytest
|
|
|
11
11
|
pytest.importorskip("deepagents")
|
|
12
12
|
|
|
13
13
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
14
|
-
from
|
|
15
|
-
from
|
|
14
|
+
from pinboard import Worker
|
|
15
|
+
from pinboard.testing import MemoryStateStore
|
|
16
16
|
from statewire_helpers import apply_ops, statewire_client, stream_of
|
|
17
17
|
from test_deepagents_thread import Ctx, Scripted, build, chain, run_turn, user, word_count
|
|
18
18
|
from voice_helpers import NEGOTIATION, VoiceDriver
|
|
@@ -41,7 +41,7 @@ def make_host():
|
|
|
41
41
|
|
|
42
42
|
@pytest.mark.parametrize(("decision", "is_error"), [("approve", False), ("reject", True)])
|
|
43
43
|
async def test_an_answered_approval_settles_its_part_in_the_parked_message(decision, is_error):
|
|
44
|
-
async with statewire_client(make_host(), worker=
|
|
44
|
+
async with statewire_client(make_host(), worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
45
45
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
46
46
|
snapshot = await stream.next_event()
|
|
47
47
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -56,7 +56,7 @@ async def test_an_answered_approval_settles_its_part_in_the_parked_message(decis
|
|
|
56
56
|
|
|
57
57
|
drv.post("run/input", {"requestId": request["id"], "response": {"decision": decision}})
|
|
58
58
|
await drv.wait_status("ready")
|
|
59
|
-
host = (await app.state.
|
|
59
|
+
host = (await app.state.pinboard_host.directory.get("t1")).instance
|
|
60
60
|
recorded = (await host.agent.aget_state(host.messages.config())).values["messages"]
|
|
61
61
|
result = next(m for m in recorded if m.type == "tool")
|
|
62
62
|
assert [m["id"] for m in drv.mounted()] == ["u1", parked["id"]]
|
|
@@ -17,8 +17,8 @@ from langchain_core.language_models import BaseChatModel
|
|
|
17
17
|
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
|
|
18
18
|
from langchain_core.outputs import ChatGeneration, ChatResult
|
|
19
19
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
20
|
-
from
|
|
21
|
-
from
|
|
20
|
+
from pinboard import Worker
|
|
21
|
+
from pinboard.testing import MemoryStateStore
|
|
22
22
|
from run_helpers import assert_rejected
|
|
23
23
|
from statewire_helpers import apply_ops, statewire_client, stream_of
|
|
24
24
|
from voice_helpers import NEGOTIATION, VoiceDriver
|
|
@@ -60,7 +60,7 @@ async def deepagents_host(seen: list[Any]):
|
|
|
60
60
|
|
|
61
61
|
return create_deep_agent(model=Capture(seen=seen), checkpointer=checkpointer)
|
|
62
62
|
|
|
63
|
-
async with statewire_client(Host, worker=
|
|
63
|
+
async with statewire_client(Host, worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
64
64
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
65
65
|
snapshot = await stream.next_event()
|
|
66
66
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -16,8 +16,8 @@ from langchain_core.language_models import BaseChatModel
|
|
|
16
16
|
from langchain_core.messages import AIMessageChunk, HumanMessage
|
|
17
17
|
from langchain_core.outputs import ChatGenerationChunk
|
|
18
18
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
19
|
-
from
|
|
20
|
-
from
|
|
19
|
+
from pinboard import Worker
|
|
20
|
+
from pinboard.testing import MemoryStateStore
|
|
21
21
|
from statewire_helpers import apply_ops, statewire_client, stream_of
|
|
22
22
|
from voice_helpers import NEGOTIATION, VoiceDriver
|
|
23
23
|
|
|
@@ -61,7 +61,7 @@ async def attached():
|
|
|
61
61
|
|
|
62
62
|
return create_deep_agent(model=Streamed(), checkpointer=checkpointer)
|
|
63
63
|
|
|
64
|
-
async with statewire_client(Host, worker=
|
|
64
|
+
async with statewire_client(Host, worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
65
65
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
66
66
|
snapshot = await stream.next_event()
|
|
67
67
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -84,7 +84,7 @@ def replies(drv: VoiceDriver) -> list[dict[str, Any]]:
|
|
|
84
84
|
|
|
85
85
|
async def stored(app, message_id: str) -> dict[str, Any]:
|
|
86
86
|
"""The message's persisted index row value."""
|
|
87
|
-
host = (await app.state.
|
|
87
|
+
host = (await app.state.pinboard_host.directory.get("t1")).instance
|
|
88
88
|
rows = {r["message_id"]: r["value"] for r in await host.index.read_messages("t1")}
|
|
89
89
|
assert message_id in rows, f"{message_id} is not persisted"
|
|
90
90
|
return rows[message_id]
|
|
@@ -12,8 +12,8 @@ from langchain_core.language_models import BaseChatModel
|
|
|
12
12
|
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage, ToolMessage
|
|
13
13
|
from langchain_core.outputs import ChatGeneration, ChatResult
|
|
14
14
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
15
|
-
from
|
|
16
|
-
from
|
|
15
|
+
from pinboard import Worker
|
|
16
|
+
from pinboard.testing import MemoryStateStore
|
|
17
17
|
from run_helpers import _statement, add, edit_params, msg
|
|
18
18
|
from statewire.protocol import VERSION, Offer, VersionRange, headers as protocol_headers
|
|
19
19
|
from statewire_helpers import apply_ops, post_frame, statewire_client, stream_of
|
|
@@ -310,7 +310,7 @@ def window(drv) -> list[str]:
|
|
|
310
310
|
|
|
311
311
|
|
|
312
312
|
async def test_host_send_from_a_switched_branch_grows_under_its_leaf():
|
|
313
|
-
async with statewire_client(Host, worker=
|
|
313
|
+
async with statewire_client(Host, worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
314
314
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
315
315
|
snapshot = await stream.next_event()
|
|
316
316
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -347,7 +347,7 @@ async def test_host_stale_on_branch_send_appends_at_the_leaf_from_2026_11_02(ver
|
|
|
347
347
|
index = MemoryCheckpointIndex()
|
|
348
348
|
|
|
349
349
|
headers = protocol_headers(VersionRange(VERSION), (Offer("harness-sdk", VersionRange(version)),))
|
|
350
|
-
async with statewire_client(Fresh, worker=
|
|
350
|
+
async with statewire_client(Fresh, worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
351
351
|
async with stream_of(app, client_id="c1", headers=headers) as stream:
|
|
352
352
|
snapshot = await stream.next_event()
|
|
353
353
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -17,8 +17,8 @@ from langchain_core.language_models import BaseChatModel
|
|
|
17
17
|
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
|
|
18
18
|
from langchain_core.outputs import ChatGeneration, ChatResult
|
|
19
19
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
20
|
-
from
|
|
21
|
-
from
|
|
20
|
+
from pinboard import Worker
|
|
21
|
+
from pinboard.testing import MemoryStateStore
|
|
22
22
|
from statewire_helpers import apply_ops, statewire_client, stream_of
|
|
23
23
|
from voice_helpers import NEGOTIATION, START, FakeVoiceProvider, VoiceDriver, voice_of, voice_turn_id
|
|
24
24
|
|
|
@@ -65,7 +65,7 @@ def make_host(provider: FakeVoiceProvider, release: threading.Event):
|
|
|
65
65
|
|
|
66
66
|
async def checkpoint_ids(app) -> list[str]:
|
|
67
67
|
"""Message ids in the thread's graph state."""
|
|
68
|
-
host = (await app.state.
|
|
68
|
+
host = (await app.state.pinboard_host.directory.get("t1")).instance
|
|
69
69
|
state = await host.agent.aget_state({"configurable": {"thread_id": "t1"}})
|
|
70
70
|
return [m.id for m in state.values.get("messages", [])]
|
|
71
71
|
|
|
@@ -73,7 +73,7 @@ async def checkpoint_ids(app) -> list[str]:
|
|
|
73
73
|
async def test_voice_turns_commit_around_a_live_run():
|
|
74
74
|
provider, release = FakeVoiceProvider(), threading.Event()
|
|
75
75
|
host_cls = make_host(provider, release)
|
|
76
|
-
async with statewire_client(host_cls, worker=
|
|
76
|
+
async with statewire_client(host_cls, worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
77
77
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
78
78
|
snapshot = await stream.next_event()
|
|
79
79
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -107,7 +107,7 @@ async def test_delegated_task_runs_as_a_subagent_turn_and_speaks_the_echo():
|
|
|
107
107
|
provider, release = FakeVoiceProvider(), threading.Event()
|
|
108
108
|
release.set()
|
|
109
109
|
host_cls = make_host(provider, release)
|
|
110
|
-
async with statewire_client(host_cls, worker=
|
|
110
|
+
async with statewire_client(host_cls, worker=Worker(state_store=MemoryStateStore())) as (app, client):
|
|
111
111
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
112
112
|
snapshot = await stream.next_event()
|
|
113
113
|
drv = VoiceDriver(client, stream, app, client_id="c1", protocol="harness-sdk")
|
|
@@ -125,6 +125,6 @@ async def test_delegated_task_runs_as_a_subagent_turn_and_speaks_the_echo():
|
|
|
125
125
|
assert [m["role"] for m in sub] == ["user", "assistant"] and sub[0]["id"] == "voicetask_d1"
|
|
126
126
|
assert drv.replica["threads"]["delegate:d1"]["status"] == "idle"
|
|
127
127
|
assert await checkpoint_ids(app) == []
|
|
128
|
-
host = (await app.state.
|
|
128
|
+
host = (await app.state.pinboard_host.directory.get("t1")).instance
|
|
129
129
|
rows = await host.index.read_messages("t1")
|
|
130
130
|
assert {(r["checkpoint_ns"], r["message_id"]) for r in rows} >= {("", "voicetask_d1"), ("delegate:d1", "voicetask_d1")}
|
|
@@ -10,7 +10,7 @@ Torn storage segments are swept exhaustively in test_run_crash_sweep.py.
|
|
|
10
10
|
|
|
11
11
|
import asyncio
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from pinboard.testing import BarrierStateStore, MemoryStateStore
|
|
14
14
|
from run_helpers import (
|
|
15
15
|
Script,
|
|
16
16
|
add,
|
|
@@ -15,13 +15,13 @@ from psycopg_pool import AsyncConnectionPool
|
|
|
15
15
|
|
|
16
16
|
from harness_sdk import RunManager, run_manager
|
|
17
17
|
from harness_sdk.fenced_postgres import AsyncFencedPostgresSaver, FenceLost
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
18
|
+
from pinboard.api import PinboardContext
|
|
19
|
+
from pinboard.domain import RealDomain
|
|
20
|
+
from pinboard.durability import FenceLost as TrayFenceLost
|
|
21
|
+
from pinboard.durability import InstanceDurability
|
|
22
|
+
from pinboard.worker.lease import InstanceLease, Lease
|
|
23
|
+
from pinboard.testing import MemoryStateStore
|
|
24
|
+
from pinboard.trays import activate_trays
|
|
25
25
|
from statewire import Statewire
|
|
26
26
|
|
|
27
27
|
THREAD = "thread-1"
|
|
@@ -31,7 +31,7 @@ PARTS = [{"type": "text", "text": "hi"}]
|
|
|
31
31
|
async def make_host(cls, store=None, id="i1"):
|
|
32
32
|
store = store if store is not None else MemoryStateStore()
|
|
33
33
|
domain = RealDomain()
|
|
34
|
-
ctx =
|
|
34
|
+
ctx = PinboardContext(
|
|
35
35
|
id,
|
|
36
36
|
lease=InstanceLease(Lease(domain=domain), lambda: None),
|
|
37
37
|
abort=lambda: None,
|
|
@@ -4,9 +4,9 @@ from types import SimpleNamespace
|
|
|
4
4
|
import pytest
|
|
5
5
|
from langgraph.checkpoint.base import empty_checkpoint
|
|
6
6
|
from langgraph.checkpoint.memory import InMemorySaver
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
7
|
+
from pinboard import Frontier, InstanceDurability
|
|
8
|
+
from pinboard.domain import RealDomain
|
|
9
|
+
from pinboard.testing import MemoryStateStore
|
|
10
10
|
|
|
11
11
|
from harness_sdk.langgraph import FrontierCheckpointer
|
|
12
12
|
|
|
@@ -6,8 +6,8 @@ import importlib
|
|
|
6
6
|
import logging
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from pinboard import Worker
|
|
10
|
+
from pinboard.testing import MemoryStateStore
|
|
11
11
|
from run_helpers import (
|
|
12
12
|
Script,
|
|
13
13
|
add,
|
|
@@ -702,7 +702,7 @@ async def crash_while_deciding(max_queued=50, steer_first=False):
|
|
|
702
702
|
async def reattached(crashed, seq, max_queued=50):
|
|
703
703
|
"""The restarted host's answers for ``seq`` to a gap-fill reattach, and its steer lane."""
|
|
704
704
|
host_cls = make_host(Script(), max_queued=max_queued, prioritize=Prioritizer())
|
|
705
|
-
worker =
|
|
705
|
+
worker = Worker(state_store=crashed)
|
|
706
706
|
cursor = {"res": [{"protocol": "default", "seq": seq - 1}]}
|
|
707
707
|
gap_fill = protocol_headers(
|
|
708
708
|
VersionRange(WIRE_VERSION),
|
|
@@ -4,7 +4,7 @@ snapshot, answers given before the restart survive, and the resume paths
|
|
|
4
4
|
(answer the rest, steer) run as if the park never left memory. A fresh store
|
|
5
5
|
seeds ready."""
|
|
6
6
|
|
|
7
|
-
from
|
|
7
|
+
from pinboard.testing import MemoryStateStore
|
|
8
8
|
from run_helpers import Script, add, assert_rejected, run_host
|
|
9
9
|
|
|
10
10
|
from harness_sdk import RunManager
|
|
@@ -26,7 +26,7 @@ import itertools
|
|
|
26
26
|
from dataclasses import dataclass, field
|
|
27
27
|
from typing import Any
|
|
28
28
|
|
|
29
|
-
from
|
|
29
|
+
from pinboard.testing import MemoryStateStore, instance
|
|
30
30
|
from run_helpers import Script, add, edit_params, make_host, msg
|
|
31
31
|
|
|
32
32
|
from harness_sdk import RunManager
|
|
@@ -2,8 +2,8 @@ import asyncio
|
|
|
2
2
|
import contextlib
|
|
3
3
|
|
|
4
4
|
import pytest
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from pinboard import EvictionRequested
|
|
6
|
+
from pinboard.testing import MemoryStateStore, instance
|
|
7
7
|
from run_helpers import Script, _statement, add, make_host, run_host
|
|
8
8
|
from statewire_helpers import post_frame
|
|
9
9
|
|
|
@@ -166,7 +166,7 @@ async def test_command_admitted_over_wire_during_wind_down_runs_after_restart():
|
|
|
166
166
|
assert response.status_code == 200
|
|
167
167
|
await host.live.frontier.wait()
|
|
168
168
|
await yield_run(call)
|
|
169
|
-
await asyncio.wait_for(driver._app.state.
|
|
169
|
+
await asyncio.wait_for(driver._app.state.pinboard_host.directory.wait_empty(), 2)
|
|
170
170
|
script.no_call()
|
|
171
171
|
|
|
172
172
|
resumed = Script()
|
|
@@ -225,7 +225,7 @@ async def test_forced_eviction_deadline_preserves_confirmed_run_and_queue():
|
|
|
225
225
|
assert call.outcome.cancelled()
|
|
226
226
|
assert call.ctx._manager.outbox.value is not None
|
|
227
227
|
assert call.ctx._manager.halted.value is None
|
|
228
|
-
await asyncio.wait_for(driver._app.state.
|
|
228
|
+
await asyncio.wait_for(driver._app.state.pinboard_host.directory.wait_empty(), 2)
|
|
229
229
|
script.no_call()
|
|
230
230
|
|
|
231
231
|
resumed = Script()
|
|
@@ -4,7 +4,7 @@ import asyncio
|
|
|
4
4
|
from importlib import import_module
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
|
-
from
|
|
7
|
+
from pinboard.testing import MemoryStateStore, instance
|
|
8
8
|
from run_helpers import Script, add, edit_params, make_host, msg
|
|
9
9
|
from statewire import StatewireReject
|
|
10
10
|
|
|
@@ -6,8 +6,8 @@ from contextlib import asynccontextmanager
|
|
|
6
6
|
import httpx
|
|
7
7
|
import pytest
|
|
8
8
|
from fastapi import FastAPI
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from pinboard import PinboardAPI, PinboardHost, Worker, route
|
|
10
|
+
from pinboard.testing import MemoryStateStore
|
|
11
11
|
from run_helpers import RunDriver, Script, add, make_host
|
|
12
12
|
from statewire.protocol import VERSION, Offer, VersionRange, headers as protocol_headers
|
|
13
13
|
from statewire_helpers import CLIENT_ID_HEADER, SSEStream, apply_ops, cmd_on, stream_of
|
|
@@ -24,7 +24,7 @@ NEGOTIATION = protocol_headers(VersionRange(VERSION), (Offer("harness-sdk-thread
|
|
|
24
24
|
HOST_NEGOTIATION = protocol_headers(VersionRange(VERSION), (Offer("harness-sdk", VersionRange(VERSION)),))
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class Toucher(
|
|
27
|
+
class Toucher(PinboardAPI):
|
|
28
28
|
"""A sibling host's instance touching the list at /threads/t1 through the cluster."""
|
|
29
29
|
|
|
30
30
|
@route.post("/touch")
|
|
@@ -36,9 +36,9 @@ class Toucher(PinnedAPI):
|
|
|
36
36
|
|
|
37
37
|
@asynccontextmanager
|
|
38
38
|
async def thread_list():
|
|
39
|
-
worker =
|
|
40
|
-
lists =
|
|
41
|
-
callers =
|
|
39
|
+
worker = Worker()
|
|
40
|
+
lists = PinboardHost(HarnessThreads, worker=worker, namespace="/threads")
|
|
41
|
+
callers = PinboardHost(Toucher, worker=worker, namespace="/callers")
|
|
42
42
|
app = FastAPI()
|
|
43
43
|
app.include_router(worker)
|
|
44
44
|
app.include_router(lists)
|
|
@@ -186,9 +186,9 @@ async def listed_host(script):
|
|
|
186
186
|
protocols = (HARNESS_PROTOCOL,)
|
|
187
187
|
thread_list = "/thread-lists/l1"
|
|
188
188
|
|
|
189
|
-
worker =
|
|
190
|
-
lists =
|
|
191
|
-
hosts =
|
|
189
|
+
worker = Worker(state_store=MemoryStateStore())
|
|
190
|
+
lists = PinboardHost(HarnessThreads, worker=worker, namespace="/thread-lists")
|
|
191
|
+
hosts = PinboardHost(Host, worker=worker, namespace="/threads")
|
|
192
192
|
app = FastAPI()
|
|
193
193
|
app.include_router(worker)
|
|
194
194
|
app.include_router(lists)
|
|
@@ -181,7 +181,7 @@ async def test_cancelled_provider_start_closes_provider_and_removes_session():
|
|
|
181
181
|
async with voice_host(bench) as (drv, app):
|
|
182
182
|
start = asyncio.create_task(drv.command("voice/start", START))
|
|
183
183
|
await provider.started.wait()
|
|
184
|
-
instance = (await app.state.
|
|
184
|
+
instance = (await app.state.pinboard_host.directory.get("t1")).instance
|
|
185
185
|
lane = instance._clients[drv.client_id].lanes["harness-sdk"]
|
|
186
186
|
assert len(lane.inflight) == 1
|
|
187
187
|
command = next(iter(lane.inflight.values())).task
|
|
@@ -4,8 +4,8 @@ import asyncio
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
|
-
from
|
|
8
|
-
from
|
|
7
|
+
from pinboard import Worker
|
|
8
|
+
from pinboard.testing import MemoryStateStore
|
|
9
9
|
from statewire import Statewire
|
|
10
10
|
from statewire.client import apply_ops as client_apply_ops
|
|
11
11
|
from statewire_helpers import post_frame, statewire_client, stream_of
|
|
@@ -102,7 +102,7 @@ class Wire:
|
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
async def test_interests_mount_covered_messages_follow_spawns_and_unmount_on_detach():
|
|
105
|
-
worker =
|
|
105
|
+
worker = Worker(state_store=MemoryStateStore())
|
|
106
106
|
async with statewire_client(Host, worker=worker) as (app, client):
|
|
107
107
|
async with stream_of(app, client_id="c1", headers=NEGOTIATION) as stream:
|
|
108
108
|
wire = Wire(stream)
|
|
@@ -5,8 +5,8 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
from uuid import uuid4
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
8
|
+
from pinboard import Worker
|
|
9
|
+
from pinboard.testing import MemoryStateStore
|
|
10
10
|
from run_helpers import RunDriver, _statement
|
|
11
11
|
from statewire import Statewire, command
|
|
12
12
|
from statewire.client import apply_ops as client_apply_ops
|
|
@@ -228,7 +228,7 @@ class VoiceDriver(RunDriver):
|
|
|
228
228
|
@asynccontextmanager
|
|
229
229
|
async def voice_host(bench: Bench, *, declare: bool = True):
|
|
230
230
|
host_cls = make_voice_host(bench, declare=declare)
|
|
231
|
-
worker =
|
|
231
|
+
worker = Worker(state_store=MemoryStateStore())
|
|
232
232
|
async with statewire_client(host_cls, worker=worker) as (app, client):
|
|
233
233
|
client_id = f"c-{uuid4().hex[:8]}"
|
|
234
234
|
async with stream_of(app, client_id=client_id, headers=NEGOTIATION) as stream:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/providers/__init__.py
RENAMED
|
File without changes
|
{harness_sdk_python-0.40.3 → harness_sdk_python-0.40.4}/src/harness_sdk/providers/gpt_live.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|