harness-sdk-python 0.23.0__tar.gz → 0.23.1__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.23.0 → harness_sdk_python-0.23.1}/PKG-INFO +1 -1
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/pyproject.toml +1 -1
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/src/harness_sdk/checkpoints.py +3 -4
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_checkpoints.py +8 -8
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/.gitignore +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/README.md +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/examples/__init__.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/examples/runs_app.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/src/harness_sdk/__init__.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/src/harness_sdk/fenced_postgres.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/src/harness_sdk/linear_thread.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/src/harness_sdk/run_manager.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/run_helpers.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_admit_steer.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_applied_visibility.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_batches.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_branch_anchor.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_dispatching.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_durability.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_edit_dispatched.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_edit_reload.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_enqueue.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_fenced_postgres.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_input_required.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_linear_thread.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_meta.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_outcomes.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_placement.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_prepare_hooks.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_restore.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_rewind_during_run.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_run_crash_sweep.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_settle.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_steer.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_stop_continue.py +0 -0
- {harness_sdk_python-0.23.0 → harness_sdk_python-0.23.1}/tests/test_stopping_window.py +0 -0
|
@@ -382,13 +382,12 @@ class CheckpointThread:
|
|
|
382
382
|
branch = b
|
|
383
383
|
return branch
|
|
384
384
|
|
|
385
|
-
def sibling_info(self, message_id: str) -> tuple[int, int]:
|
|
386
|
-
"""
|
|
385
|
+
def sibling_info(self, message_id: str) -> tuple[int, list[int]]:
|
|
386
|
+
"""``message_id``'s own branch id and its sibling fan-out's branch ids in creation order."""
|
|
387
387
|
entries = self.sibling_branches(message_id)
|
|
388
388
|
index = next(i for i, m in enumerate(self.transcript) if m["id"] == message_id)
|
|
389
389
|
branch = self._branch_at(index)
|
|
390
|
-
|
|
391
|
-
return group.index(branch) + 1, len(group)
|
|
390
|
+
return branch, sorted({e["branch_id"] for e in entries} | {branch})
|
|
392
391
|
|
|
393
392
|
async def plan(self, trigger: str, *, rollback_to: str | None = None) -> Plan:
|
|
394
393
|
"""The resumption for ``trigger``; a fork trigger names its last surviving message via ``rollback_to``."""
|
|
@@ -243,27 +243,27 @@ async def test_sibling_branches_order_by_allocation():
|
|
|
243
243
|
thread.sibling_branches("a2")
|
|
244
244
|
|
|
245
245
|
|
|
246
|
-
async def
|
|
246
|
+
async def test_sibling_info_lists_the_fan_out_ids_in_creation_order():
|
|
247
247
|
store, _, thread = await seeded()
|
|
248
248
|
for cid, reply in [("cp3", "a2b"), ("cp4", "a2c"), ("cp5", "a2d")]:
|
|
249
249
|
await thread.plan("message-reload", rollback_to="u2")
|
|
250
250
|
await thread.ingest(store.put(cid, [U1, A1, U2, msg(reply, "ai")]))
|
|
251
|
-
assert thread.sibling_info("a2d") == (3, 3)
|
|
252
|
-
assert thread.sibling_info("u2") == (
|
|
251
|
+
assert thread.sibling_info("a2d") == (3, [1, 2, 3])
|
|
252
|
+
assert thread.sibling_info("u2") == (0, [0])
|
|
253
253
|
lineage = {"branch_ids": [0, 1], "parent_checkpoint_id": None}
|
|
254
254
|
await thread.ingest(store.put("cp6", [U1, A1, U2, msg("a2b", "ai")], lineage))
|
|
255
|
-
assert thread.sibling_info("a2b") == (1, 3)
|
|
255
|
+
assert thread.sibling_info("a2b") == (1, [1, 2, 3])
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
async def test_sibling_info_counts_the_window_timeline_among_the_forks():
|
|
259
259
|
store, _, thread = await seeded()
|
|
260
260
|
await thread.plan("message-edit", rollback_to="a1")
|
|
261
261
|
await thread.ingest(store.put("cp3", [U1, A1, msg("u2c"), msg("a2c", "ai")]))
|
|
262
|
-
assert thread.sibling_info("u2c") == (1, 1)
|
|
262
|
+
assert thread.sibling_info("u2c") == (1, [1])
|
|
263
263
|
lineage = {"branch_ids": [0], "parent_checkpoint_id": None}
|
|
264
264
|
await thread.ingest(store.put("cp4", [U1, A1, U2, A2], lineage))
|
|
265
|
-
assert thread.sibling_info("u2") == (
|
|
266
|
-
assert thread.sibling_info("u1") == (
|
|
265
|
+
assert thread.sibling_info("u2") == (0, [0, 1]) # branch 0 before the edit fork
|
|
266
|
+
assert thread.sibling_info("u1") == (0, [0])
|
|
267
267
|
|
|
268
268
|
|
|
269
269
|
# ─── Switch branch ──────────────────────────────────────────
|
|
@@ -333,7 +333,7 @@ async def test_switch_state_ingest_round_trip_keeps_the_index_consistent():
|
|
|
333
333
|
assert branches[1]["last_checkpoint_id"] == "cp4"
|
|
334
334
|
assert await row(index, "a2b") == {"anchor_checkpoint_id": "cp1", "branch_id": 1}
|
|
335
335
|
assert thread.checkpoint_id == "cp5"
|
|
336
|
-
assert thread.sibling_info("a2b") == (1, 2)
|
|
336
|
+
assert thread.sibling_info("a2b") == (1, [1, 2])
|
|
337
337
|
|
|
338
338
|
|
|
339
339
|
# ─── Paging across a compaction ─────────────────────────────
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|