deepsieve-cli 0.6.0__tar.gz → 0.7.0__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.
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/PKG-INFO +1 -1
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/pyproject.toml +1 -1
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/src/deepsieve_cli/main.py +19 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/tests/test_cli.py +55 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/.gitignore +0 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/README.md +0 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/src/deepsieve_cli/__init__.py +0 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/src/deepsieve_cli/__main__.py +0 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/src/deepsieve_cli/client.py +0 -0
- {deepsieve_cli-0.6.0 → deepsieve_cli-0.7.0}/src/deepsieve_cli/config.py +0 -0
|
@@ -262,11 +262,28 @@ def cmd_runs_get(args) -> int:
|
|
|
262
262
|
print(f"blueprint {bp.get('name')} ({bp.get('id')})")
|
|
263
263
|
if body.get("error"):
|
|
264
264
|
print(f"error {body['error'].get('message')}")
|
|
265
|
+
for line in _recheck_lines(body):
|
|
266
|
+
print(f"result {line}")
|
|
265
267
|
if not body.get("done"):
|
|
266
268
|
return EXIT_PENDING
|
|
267
269
|
return EXIT_OK if body.get("status") == "completed" else EXIT_FAIL
|
|
268
270
|
|
|
269
271
|
|
|
272
|
+
def _recheck_lines(body: dict) -> list[str]:
|
|
273
|
+
"""gh #2781 — what a re-check run found (`check_results`, one line per checked value) or what
|
|
274
|
+
a follow-up search found (`update_result`), in the sentences the API wrote for a person."""
|
|
275
|
+
lines = []
|
|
276
|
+
for entry in body.get("check_results") or []:
|
|
277
|
+
line = str(entry.get("message") or "")
|
|
278
|
+
if entry.get("followup_run_id"):
|
|
279
|
+
line += f" (follow-up run {entry['followup_run_id']})"
|
|
280
|
+
lines.append(line)
|
|
281
|
+
update = body.get("update_result") or {}
|
|
282
|
+
if update.get("message"):
|
|
283
|
+
lines.append(str(update["message"]))
|
|
284
|
+
return lines
|
|
285
|
+
|
|
286
|
+
|
|
270
287
|
def _folded_text(folds: list[dict]) -> str:
|
|
271
288
|
"""gh #2716 — the seeds a request counted once, in one line (the first 4, then a count)."""
|
|
272
289
|
if not folds:
|
|
@@ -387,6 +404,8 @@ def _wait(client: Client, run_id: str, args) -> int:
|
|
|
387
404
|
print(f"run {run_id} finished: {body.get('status')}")
|
|
388
405
|
if body.get("error"):
|
|
389
406
|
print(f" {body['error'].get('message')}")
|
|
407
|
+
for line in _recheck_lines(body):
|
|
408
|
+
print(f" {line}")
|
|
390
409
|
return EXIT_OK if body.get("status") == "completed" else EXIT_FAIL
|
|
391
410
|
if not args.json and _tty():
|
|
392
411
|
print(f" status: {body.get('status')}…", end="\r", flush=True)
|
|
@@ -820,6 +820,61 @@ def test_runs_get_and_whoami_name_the_blueprint(monkeypatch, capsys):
|
|
|
820
820
|
assert "blueprint Widgets (bp-a)" in printed and "workspace ws_x" in printed
|
|
821
821
|
|
|
822
822
|
|
|
823
|
+
# ── a re-check's result (#2781) ─────────────────────────────────────────────
|
|
824
|
+
|
|
825
|
+
_RECHECK = {
|
|
826
|
+
"id": "rc_1", "status": "completed", "done": True, "run_type": "reverify",
|
|
827
|
+
"check_results": [
|
|
828
|
+
{"evidence_id": "e1", "outcome": "confirmed",
|
|
829
|
+
"message": "Checked: the value is still correct.", "followup_run_id": None},
|
|
830
|
+
{"evidence_id": "e2", "outcome": "looking",
|
|
831
|
+
"message": "Checked: the value looks out of date. Looking for the current one.",
|
|
832
|
+
"followup_run_id": "fu_1"},
|
|
833
|
+
],
|
|
834
|
+
"update_result": None,
|
|
835
|
+
}
|
|
836
|
+
_FOLLOWUP = {
|
|
837
|
+
"id": "fu_1", "status": "completed", "done": True, "run_type": "research_update",
|
|
838
|
+
"check_results": None,
|
|
839
|
+
"update_result": {"outcome": "updated",
|
|
840
|
+
"message": "Found the current value and updated the cell."},
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
@pytest.mark.parametrize("command", [["runs", "get"], ["runs", "wait", "--interval", "0"]],
|
|
845
|
+
ids=["get", "wait"])
|
|
846
|
+
def test_a_recheck_says_what_it_found_and_names_the_followup(monkeypatch, capsys, command):
|
|
847
|
+
"""The human view printed only id/status/error, so a person could not see what a re-check
|
|
848
|
+
found without --json. The follow-up id it prints is the one the next command takes."""
|
|
849
|
+
cfg.save_profile(cfg.Profile(name="default", origin="https://x.test", api_key="k"))
|
|
850
|
+
runs = {"rc_1": _RECHECK, "fu_1": _FOLLOWUP}
|
|
851
|
+
|
|
852
|
+
def handler(request: httpx.Request) -> httpx.Response:
|
|
853
|
+
return httpx.Response(200, json=runs[request.url.path.rsplit("/", 1)[-1]])
|
|
854
|
+
|
|
855
|
+
monkeypatch.setattr(httpx, "Client", _mock(handler))
|
|
856
|
+
assert main([*command, "rc_1"]) == 0
|
|
857
|
+
out = capsys.readouterr().out
|
|
858
|
+
print(out)
|
|
859
|
+
assert "Checked: the value is still correct." in out
|
|
860
|
+
assert "Looking for the current one. (follow-up run fu_1)" in out
|
|
861
|
+
assert out.count("follow-up run") == 1, "only the entry that started a search names one"
|
|
862
|
+
|
|
863
|
+
assert main([*command, "fu_1"]) == 0
|
|
864
|
+
out = capsys.readouterr().out
|
|
865
|
+
print(out)
|
|
866
|
+
assert "Found the current value and updated the cell." in out
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
def test_a_run_with_no_recheck_result_prints_no_extra_lines(monkeypatch, capsys):
|
|
870
|
+
cfg.save_profile(cfg.Profile(name="default", origin="https://x.test", api_key="k"))
|
|
871
|
+
body = {"id": "r", "status": "completed", "done": True,
|
|
872
|
+
"check_results": None, "update_result": None}
|
|
873
|
+
monkeypatch.setattr(httpx, "Client", _mock(lambda r: httpx.Response(200, json=body)))
|
|
874
|
+
assert main(["runs", "get", "r"]) == 0
|
|
875
|
+
assert "result" not in capsys.readouterr().out
|
|
876
|
+
|
|
877
|
+
|
|
823
878
|
# ── chat changes (#2187) ────────────────────────────────────────────────────
|
|
824
879
|
|
|
825
880
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|