apheris-foundry-cli 2.5.0__tar.gz → 2.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.
Files changed (69) hide show
  1. {apheris_foundry_cli-2.5.0/src/apheris_foundry_cli.egg-info → apheris_foundry_cli-2.7.0}/PKG-INFO +2 -2
  2. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/README.md +1 -1
  3. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/pyproject.toml +1 -1
  4. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0/src/apheris_foundry_cli.egg-info}/PKG-INFO +2 -2
  5. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apheris_foundry_cli.egg-info/SOURCES.txt +1 -0
  6. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/foundry.py +12 -3
  7. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/main.py +3 -0
  8. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/skills/apheris-foundry-hub/SKILL.md +27 -18
  9. apheris_foundry_cli-2.7.0/src/apherisfold_cli/version.py +1 -0
  10. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_cli.py +32 -8
  11. apheris_foundry_cli-2.7.0/tests/test_foundry_execution.py +36 -0
  12. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_jobs_metadata.py +1 -0
  13. apheris_foundry_cli-2.5.0/src/apherisfold_cli/version.py +0 -1
  14. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/LICENSE +0 -0
  15. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/setup.cfg +0 -0
  16. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apheris_foundry_cli.egg-info/dependency_links.txt +0 -0
  17. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apheris_foundry_cli.egg-info/entry_points.txt +0 -0
  18. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apheris_foundry_cli.egg-info/requires.txt +0 -0
  19. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apheris_foundry_cli.egg-info/top_level.txt +0 -0
  20. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/__init__.py +0 -0
  21. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/__init__.py +0 -0
  22. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/compounds.py +0 -0
  23. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/docs.py +0 -0
  24. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/login.py +0 -0
  25. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/settings.py +0 -0
  26. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/skills.py +0 -0
  27. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/commands/weights.py +0 -0
  28. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/__init__.py +0 -0
  29. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/auth.py +0 -0
  30. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/browser.py +0 -0
  31. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/config.py +0 -0
  32. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/context.py +0 -0
  33. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/documents.py +0 -0
  34. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/errors.py +0 -0
  35. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/hub_requests.py +0 -0
  36. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/input_archive.py +0 -0
  37. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/io.py +0 -0
  38. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/limits.py +0 -0
  39. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/login_profiles.py +0 -0
  40. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/msa.py +0 -0
  41. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/pubchem.py +0 -0
  42. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/render.py +0 -0
  43. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/result_artifacts.py +0 -0
  44. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/core/transient.py +0 -0
  45. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/src/apherisfold_cli/handlers.py +0 -0
  46. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_auth.py +0 -0
  47. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_auth_lifecycle.py +0 -0
  48. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_benchmark_examples.py +0 -0
  49. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_browser.py +0 -0
  50. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_config.py +0 -0
  51. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_docs.py +0 -0
  52. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_documents.py +0 -0
  53. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_dry_run_guard.py +0 -0
  54. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_foundry_helpers.py +0 -0
  55. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_foundry_warnings.py +0 -0
  56. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_handlers.py +0 -0
  57. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_hub_requests.py +0 -0
  58. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_input_archive.py +0 -0
  59. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_io.py +0 -0
  60. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_jobs_update.py +0 -0
  61. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_login_callback.py +0 -0
  62. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_main.py +0 -0
  63. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_model_discovery.py +0 -0
  64. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_msa.py +0 -0
  65. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_pubchem.py +0 -0
  66. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_render.py +0 -0
  67. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_result_artifacts.py +0 -0
  68. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_skills.py +0 -0
  69. {apheris_foundry_cli-2.5.0 → apheris_foundry_cli-2.7.0}/tests/test_weights.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apheris-foundry-cli
3
- Version: 2.5.0
3
+ Version: 2.7.0
4
4
  Summary: Command-line interface for Apheris Foundry workflows.
5
5
  Author: Apheris
6
6
  License-Expression: LicenseRef-Apheris-Foundry-Software-License
@@ -356,7 +356,7 @@ the metadata change notification.
356
356
  | `apheris-foundry jobs logs --id <job-id>` | Print logs for a job |
357
357
  | `apheris-foundry jobs error --id <job-id>` | Print the saved error for a failed job |
358
358
  | `apheris-foundry jobs download --id <job-id>` | Download results for a completed job |
359
- | `apheris-foundry jobs cancel --id <job-id>` | Cancel a pending or running job |
359
+ | `apheris-foundry jobs cancel --id <job-id>` | Cancel a pending or running job (`--yes` skips confirmation) |
360
360
  | `apheris-foundry jobs delete --id <job-id>` | Permanently delete a terminal job and its stored data (`--yes` skips confirmation) |
361
361
 
362
362
  Use `--help` on any command for the full option reference and examples:
@@ -330,7 +330,7 @@ the metadata change notification.
330
330
  | `apheris-foundry jobs logs --id <job-id>` | Print logs for a job |
331
331
  | `apheris-foundry jobs error --id <job-id>` | Print the saved error for a failed job |
332
332
  | `apheris-foundry jobs download --id <job-id>` | Download results for a completed job |
333
- | `apheris-foundry jobs cancel --id <job-id>` | Cancel a pending or running job |
333
+ | `apheris-foundry jobs cancel --id <job-id>` | Cancel a pending or running job (`--yes` skips confirmation) |
334
334
  | `apheris-foundry jobs delete --id <job-id>` | Permanently delete a terminal job and its stored data (`--yes` skips confirmation) |
335
335
 
336
336
  Use `--help` on any command for the full option reference and examples:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "apheris-foundry-cli"
7
- version = "2.5.0"
7
+ version = "2.7.0"
8
8
  description = "Command-line interface for Apheris Foundry workflows."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apheris-foundry-cli
3
- Version: 2.5.0
3
+ Version: 2.7.0
4
4
  Summary: Command-line interface for Apheris Foundry workflows.
5
5
  Author: Apheris
6
6
  License-Expression: LicenseRef-Apheris-Foundry-Software-License
@@ -356,7 +356,7 @@ the metadata change notification.
356
356
  | `apheris-foundry jobs logs --id <job-id>` | Print logs for a job |
357
357
  | `apheris-foundry jobs error --id <job-id>` | Print the saved error for a failed job |
358
358
  | `apheris-foundry jobs download --id <job-id>` | Download results for a completed job |
359
- | `apheris-foundry jobs cancel --id <job-id>` | Cancel a pending or running job |
359
+ | `apheris-foundry jobs cancel --id <job-id>` | Cancel a pending or running job (`--yes` skips confirmation) |
360
360
  | `apheris-foundry jobs delete --id <job-id>` | Permanently delete a terminal job and its stored data (`--yes` skips confirmation) |
361
361
 
362
362
  Use `--help` on any command for the full option reference and examples:
@@ -46,6 +46,7 @@ tests/test_config.py
46
46
  tests/test_docs.py
47
47
  tests/test_documents.py
48
48
  tests/test_dry_run_guard.py
49
+ tests/test_foundry_execution.py
49
50
  tests/test_foundry_helpers.py
50
51
  tests/test_foundry_warnings.py
51
52
  tests/test_handlers.py
@@ -86,10 +86,9 @@ def _run_table(runs: list[dict[str, Any]], *, show_workflow: bool = False) -> Ta
86
86
  ]
87
87
  if show_workflow:
88
88
  row.append(str(run.get("workflow", "")))
89
- params = run.get("params") if isinstance(run.get("params"), dict) else {}
90
89
  row += [
91
- Text(str(params.get("model") or "")),
92
- Text(str(params.get("weight") or "")),
90
+ Text(_execution_label(run, "modelId")),
91
+ Text(_execution_label(run, "weight")),
93
92
  Text(status, style=style),
94
93
  Text(_steps_display(run), overflow="ellipsis"),
95
94
  _format_run_duration(run),
@@ -99,6 +98,14 @@ def _run_table(runs: list[dict[str, Any]], *, show_workflow: bool = False) -> Ta
99
98
  return table
100
99
 
101
100
 
101
+ def _execution_label(run: dict[str, Any], field: str) -> str:
102
+ """Display saved execution identity, including defaults resolved by Hub."""
103
+ execution = run.get("execution")
104
+ tasks = execution.get("tasks", []) if isinstance(execution, dict) else []
105
+ values = [task.get(field) for task in tasks if isinstance(task, dict)] if isinstance(tasks, list) else []
106
+ return ", ".join(dict.fromkeys(value for value in values if isinstance(value, str) and value)) or "—"
107
+
108
+
102
109
  def _run_tags_display(run: dict[str, Any]) -> str:
103
110
  tags = run.get("tags") if isinstance(run.get("tags"), list) else []
104
111
  return ", ".join(str(tag) for tag in tags) or "—"
@@ -359,6 +366,8 @@ def _run_detail_renderable(
359
366
  detail.add_row("NAME", Text(str(run.get("name") or "—")))
360
367
  detail.add_row("TAGS", Text(_run_tags_display(run)))
361
368
  detail.add_row("WORKFLOW", str(run.get("workflow", "")))
369
+ detail.add_row("MODEL", Text(_execution_label(run, "modelId")))
370
+ detail.add_row("WEIGHT", Text(_execution_label(run, "weight")))
362
371
  steps = _step_display_names(run)
363
372
  if steps:
364
373
  detail.add_row("STEPS" if len(steps) > 1 else "STEP", Text(", ".join(steps)))
@@ -337,9 +337,12 @@ def error_cmd(
337
337
  @jobs_app.command("cancel", help="Cancel a pending or running Foundry job.")
338
338
  def cancel_cmd(
339
339
  run_id: Annotated[str, typer.Option("--id", help="Foundry job identifier.")],
340
+ yes: Annotated[bool, typer.Option("--yes", "-y", help="Skip the confirmation prompt.")] = False,
340
341
  wait: Annotated[bool, typer.Option("--wait", help="Poll until the job reaches cancelled.")] = False,
341
342
  json_output: Annotated[bool, typer.Option("--json", help="Render as JSON.")] = False,
342
343
  ) -> None:
344
+ if not yes and not get_ctx().dry_run and not typer.confirm(f"Cancel Foundry job {run_id}?"):
345
+ raise typer.Abort()
343
346
  foundry_cancel(run_id, json_output=json_output, wait=wait)
344
347
 
345
348
 
@@ -252,7 +252,7 @@ Lifecycle of an enabled weight (changes are owner-only):
252
252
  `weights deploy`, which is no longer supported; update existing scripts.
253
253
 
254
254
  Private is the default and visibility cannot change later, so un-sharing means
255
- delete. `jobs delete` on the producing job also deletes its weights: warn first.
255
+ deleting the weight.
256
256
  Details and error handling are in step 3 of the fine-tune hand-off below.
257
257
 
258
258
  ### Fine-tune → hand off the checkpoint → predict
@@ -366,8 +366,8 @@ apheris-foundry weights enable --name <unique-weight-name> --run-id <training-jo
366
366
  export is not automatically a resumable training checkpoint.
367
367
  - Capture the returned weight `id`, producing model/version and artifact
368
368
  path. Enabling weights copies job artifacts into independent managed storage; it
369
- does not run prediction or upload local weights. On Hub versions containing
370
- hub#3142, enabled weights survive deletion of the producing job.
369
+ does not run prediction or upload local weights. Enabled weights survive
370
+ deletion of the producing job.
371
371
 
372
372
  Hub copies and verifies the checkpoint before replying, so large weights may
373
373
  need several minutes. `weights enable --timeout SECONDS` controls the CLI's
@@ -391,8 +391,8 @@ tags). Inspect one weight with `weights get --id <id>`. Delete only on explicit
391
391
  request with `weights delete --id <id> --yes`: it stops selection and sharing,
392
392
  and jobs already running keep working. Checkpoint files remain until explicitly
393
393
  removed with `weights delete --id <id> --delete-files --yes`. Use that option
394
- only when permanent file removal is requested and Hub contains hub#3142; older
395
- Hubs may ignore it. The record and provenance remain. A 409 means the weight
394
+ only when permanent file removal is requested. The record and provenance remain.
395
+ A 409 means the weight
396
396
  was soft-deleted but active jobs blocked file removal; report this partial
397
397
  outcome and retry only after those jobs finish. File removal can follow a
398
398
  previous soft delete. `--dry-run true` previews the selected mode without
@@ -442,19 +442,28 @@ report the gap rather than stitching artifacts together speculatively.
442
442
 
443
443
  ### Cancel versus delete
444
444
 
445
- Use `jobs cancel --id <id> --wait --json` to stop the identified active job and
446
- confirm its terminal state. Cancellation preserves the job and available logs
447
- and artifacts. A request such as “cap this run at four epochs” means explain the
448
- restart, cancel that active run, confirm cancellation, then submit its prepared
449
- replacement; never claim the original run was edited. If it finished before
450
- cancellation, report that race and inspect results before deciding on replacement.
451
-
452
- `jobs delete --id <id>` removes the job and its backing files; it is cleanup,
453
- not the normal way to stop computation. Use it only when deletion is requested,
454
- and explain that enabled weights have independent storage on Hub versions
455
- containing hub#3142. Do not delete cancelled
456
- trial jobs or failed evidence automatically. A failed cancellation is not a
457
- reason to fall back to deletion.
445
+ Cancel stops a job and keeps its logs and artifacts. When the user has asked
446
+ to stop a specific job, run:
447
+
448
+ ```sh
449
+ apheris-foundry jobs cancel --id <id> --yes --wait --json
450
+ ```
451
+
452
+ `--yes` skips the confirmation prompt; `--wait` waits for the job to finish
453
+ stopping. `--json` alone still prompts. Dry runs never prompt.
454
+
455
+ Changing an active run requires a replacement, not an edit. Explain the restart
456
+ and confirm cancellation before submitting the replacement. If the original job
457
+ finished first, inspect its results before deciding whether to replace it.
458
+
459
+ Delete removes the job and its files. Only when the user asks for deletion, run:
460
+
461
+ ```sh
462
+ apheris-foundry jobs delete --id <id> --yes --json
463
+ ```
464
+
465
+ Never delete as a fallback when cancellation fails. Enabled weights survive job
466
+ deletion.
458
467
 
459
468
  ### Public compound resolution
460
469
 
@@ -0,0 +1 @@
1
+ __version__ = "2.7.0"
@@ -1128,7 +1128,8 @@ def test_foundry_list_shows_explicit_name_tags_model_and_weight(monkeypatch, wor
1128
1128
  "status": "running",
1129
1129
  # Hub rejects "weights" in create requests but stores the resolved path in
1130
1130
  # run params, so list responses include it; the table must not show it.
1131
- "params": {"model": "openfold3", "weight": "0.3.0", "weights": "/app/weights/model.pt"},
1131
+ "params": {"model": "wrong", "weight": "wrong", "weights": "/app/weights/model.pt"},
1132
+ "execution": {"tasks": [{"modelId": "openfold3", "weight": "0.3.0"}]},
1132
1133
  "tags": ["cli-pr210-e2e"],
1133
1134
  "observability": {"steps": [], "outputs": []},
1134
1135
  }
@@ -1171,7 +1172,13 @@ def test_foundry_list_tolerates_missing_model_and_weight(monkeypatch, run_fields
1171
1172
  def test_foundry_list_renders_model_and_weight_literally_and_preserves_json(monkeypatch) -> None:
1172
1173
  payload = {
1173
1174
  "total": 1,
1174
- "runs": [{"id": "job", "tags": ["cli"], "params": {"model": "[red]model", "weight": "[bold]weight"}}],
1175
+ "runs": [
1176
+ {
1177
+ "id": "job",
1178
+ "tags": ["cli"],
1179
+ "execution": {"tasks": [{"modelId": "[red]model", "weight": "[bold]weight"}]},
1180
+ }
1181
+ ],
1175
1182
  }
1176
1183
  monkeypatch.setattr("apherisfold_cli.commands.foundry.list_foundry_runs", lambda **kwargs: payload)
1177
1184
 
@@ -2478,7 +2485,7 @@ def test_foundry_workflows_run_dry_run_still_rejects_invalid_dataset(hub_api_fix
2478
2485
  ],
2479
2486
  )
2480
2487
  def test_foundry_job_actions_dry_run_do_not_call_hub(hub_api_fixture, args, expected) -> None:
2481
- # delete omits --yes: a dry run must not prompt for a deletion it will not perform.
2488
+ # Both actions omit --yes: a dry run must not prompt for an action it will not perform.
2482
2489
  result = runner.invoke(app, ["--dry-run", "true", *args, "--json"])
2483
2490
 
2484
2491
  assert result.exit_code == 0, result.output
@@ -3011,8 +3018,9 @@ def test_foundry_delete_renders_json(hub_api_fixture) -> None:
3011
3018
  assert hub_api_fixture["delete_foundry_run"] == ["foundry_test_001"]
3012
3019
 
3013
3020
 
3014
- def test_workflows_cancel_cancels_run(hub_api_fixture) -> None:
3015
- result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001"])
3021
+ @pytest.mark.parametrize("flag", ["--yes", "-y"])
3022
+ def test_workflows_cancel_cancels_run(hub_api_fixture, flag) -> None:
3023
+ result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001", flag])
3016
3024
 
3017
3025
  assert result.exit_code == 0
3018
3026
  assert "foundry_cancelling_001" in result.stdout
@@ -3020,8 +3028,24 @@ def test_workflows_cancel_cancels_run(hub_api_fixture) -> None:
3020
3028
  assert hub_api_fixture["cancel_foundry_run"] == ["foundry_cancelling_001"]
3021
3029
 
3022
3030
 
3031
+ def test_jobs_cancel_prompts_and_confirms(hub_api_fixture) -> None:
3032
+ result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001"], input="y\n")
3033
+
3034
+ assert result.exit_code == 0
3035
+ assert "Cancel Foundry job foundry_cancelling_001?" in result.stdout
3036
+ assert hub_api_fixture["cancel_foundry_run"] == ["foundry_cancelling_001"]
3037
+
3038
+
3039
+ @pytest.mark.parametrize("answer", ["n\n", "\n", ""])
3040
+ def test_jobs_cancel_aborts_without_confirmation(hub_api_fixture, answer) -> None:
3041
+ result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001"], input=answer)
3042
+
3043
+ assert result.exit_code != 0
3044
+ assert hub_api_fixture["cancel_foundry_run"] == []
3045
+
3046
+
3023
3047
  def test_workflows_cancel_renders_json(hub_api_fixture) -> None:
3024
- result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001", "--json"])
3048
+ result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001", "--yes", "--json"])
3025
3049
 
3026
3050
  assert result.exit_code == 0
3027
3051
  payload = json.loads(result.stdout)
@@ -3031,7 +3055,7 @@ def test_workflows_cancel_renders_json(hub_api_fixture) -> None:
3031
3055
 
3032
3056
 
3033
3057
  def test_jobs_cancel_wait_polls_until_cancelled(hub_api_fixture) -> None:
3034
- result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelled_001", "--wait"])
3058
+ result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelled_001", "--yes", "--wait"])
3035
3059
 
3036
3060
  assert result.exit_code == 0
3037
3061
  assert "foundry_cancelled_001" in result.stdout
@@ -3050,7 +3074,7 @@ def test_workflows_cancel_surfaces_api_error(hub_api_fixture, monkeypatch) -> No
3050
3074
 
3051
3075
  monkeypatch.setattr("apherisfold_cli.commands.foundry.cancel_foundry_run", raise_not_cancellable)
3052
3076
 
3053
- result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001"])
3077
+ result = runner.invoke(app, ["jobs", "cancel", "--id", "foundry_cancelling_001", "--yes"])
3054
3078
 
3055
3079
  assert result.exit_code != 0
3056
3080
  assert hub_api_fixture["cancel_foundry_run"] == []
@@ -0,0 +1,36 @@
1
+ from io import StringIO
2
+
3
+ import pytest
4
+ from rich.console import Console
5
+
6
+ from apherisfold_cli.commands.foundry import _execution_label, _run_detail_renderable, _run_table
7
+
8
+
9
+ @pytest.mark.parametrize("params", [{}, {"model": "wrong-request", "weight": "wrong-weight"}])
10
+ @pytest.mark.parametrize("view", ["list", "detail"])
11
+ def test_displays_saved_execution_even_without_parameters(params, view):
12
+ run = {
13
+ "id": "foundry_example",
14
+ "params": params,
15
+ "execution": {"tasks": [{"modelId": "openfold3", "weight": "checkpoint-v1"}]},
16
+ }
17
+ output = StringIO()
18
+ Console(file=output, width=240, color_system=None).print(
19
+ _run_table([run]) if view == "list" else _run_detail_renderable(run)
20
+ )
21
+ assert "openfold3" in output.getvalue()
22
+ assert "checkpoint-v1" in output.getvalue()
23
+ assert "wrong-request" not in output.getvalue()
24
+ assert "wrong-weight" not in output.getvalue()
25
+
26
+
27
+ @pytest.mark.parametrize("view", ["list", "detail"])
28
+ def test_does_not_reconstruct_missing_execution_from_parameters(view):
29
+ run = {"id": "foundry_old", "params": {"model": "requested-model", "weight": "requested-weight"}}
30
+ output = StringIO()
31
+ Console(file=output, width=240, color_system=None).print(
32
+ _run_table([run]) if view == "list" else _run_detail_renderable(run)
33
+ )
34
+ assert _execution_label(run, "modelId") == _execution_label(run, "weight") == "—"
35
+ assert "requested-model" not in output.getvalue()
36
+ assert "requested-weight" not in output.getvalue()
@@ -27,6 +27,7 @@ def test_list_metadata_columns_preserve_api_fields_and_full_ids(width, show_work
27
27
  run = {
28
28
  "id": "foundry_a1b2c3d4e5f67890",
29
29
  "workflow": "predict",
30
+ "execution": {"tasks": [{"modelId": "openfold3", "weight": "of3ob"}]},
30
31
  "params": {"model": "openfold3", "weight": "of3ob", "requestSubpath": "unrelated-input.json"},
31
32
  "observability": {"outputs": [{"type": "metadata", "path": "invented-name_sample_1.json"}]},
32
33
  **metadata,
@@ -1 +0,0 @@
1
- __version__ = "2.5.0"