apheris-foundry-cli 2.0.0__tar.gz → 2.1.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 (64) hide show
  1. {apheris_foundry_cli-2.0.0/src/apheris_foundry_cli.egg-info → apheris_foundry_cli-2.1.0}/PKG-INFO +12 -1
  2. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/README.md +11 -0
  3. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/pyproject.toml +1 -1
  4. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0/src/apheris_foundry_cli.egg-info}/PKG-INFO +12 -1
  5. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/foundry.py +16 -3
  6. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/main.py +16 -11
  7. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/skills/apheris-foundry-hub/SKILL.md +15 -0
  8. apheris_foundry_cli-2.1.0/src/apherisfold_cli/version.py +1 -0
  9. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_benchmark_examples.py +1 -0
  10. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_cli.py +103 -10
  11. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_input_archive.py +5 -2
  12. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_msa.py +4 -0
  13. apheris_foundry_cli-2.0.0/src/apherisfold_cli/version.py +0 -1
  14. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/LICENSE +0 -0
  15. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/setup.cfg +0 -0
  16. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apheris_foundry_cli.egg-info/SOURCES.txt +0 -0
  17. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apheris_foundry_cli.egg-info/dependency_links.txt +0 -0
  18. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apheris_foundry_cli.egg-info/entry_points.txt +0 -0
  19. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apheris_foundry_cli.egg-info/requires.txt +0 -0
  20. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apheris_foundry_cli.egg-info/top_level.txt +0 -0
  21. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/__init__.py +0 -0
  22. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/__init__.py +0 -0
  23. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/compounds.py +0 -0
  24. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/login.py +0 -0
  25. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/settings.py +0 -0
  26. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/skills.py +0 -0
  27. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/commands/weights.py +0 -0
  28. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/__init__.py +0 -0
  29. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/auth.py +0 -0
  30. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/config.py +0 -0
  31. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/context.py +0 -0
  32. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/documents.py +0 -0
  33. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/errors.py +0 -0
  34. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/hub_requests.py +0 -0
  35. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/input_archive.py +0 -0
  36. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/io.py +0 -0
  37. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/limits.py +0 -0
  38. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/login_profiles.py +0 -0
  39. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/msa.py +0 -0
  40. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/pubchem.py +0 -0
  41. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/render.py +0 -0
  42. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/result_artifacts.py +0 -0
  43. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/core/transient.py +0 -0
  44. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/src/apherisfold_cli/handlers.py +0 -0
  45. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_auth.py +0 -0
  46. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_auth_lifecycle.py +0 -0
  47. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_config.py +0 -0
  48. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_documents.py +0 -0
  49. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_dry_run_guard.py +0 -0
  50. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_foundry_helpers.py +0 -0
  51. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_foundry_warnings.py +0 -0
  52. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_handlers.py +0 -0
  53. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_hub_requests.py +0 -0
  54. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_io.py +0 -0
  55. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_jobs_metadata.py +0 -0
  56. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_jobs_update.py +0 -0
  57. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_login_callback.py +0 -0
  58. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_main.py +0 -0
  59. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_model_discovery.py +0 -0
  60. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_pubchem.py +0 -0
  61. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_render.py +0 -0
  62. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_result_artifacts.py +0 -0
  63. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.0}/tests/test_skills.py +0 -0
  64. {apheris_foundry_cli-2.0.0 → apheris_foundry_cli-2.1.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.0.0
3
+ Version: 2.1.0
4
4
  Summary: Command-line interface for Apheris Foundry workflows.
5
5
  Author: Apheris
6
6
  License-Expression: LicenseRef-Apheris-Foundry-Software-License
@@ -532,3 +532,14 @@ that fewer rows were returned.
532
532
 
533
533
  See [the usage guide](docs/usage.md#find-jobs)
534
534
  for model, date, duration, and sorting options, which are hidden from default help.
535
+
536
+ ### Research previews
537
+
538
+ Workflow and model listings mark early releases as **Research preview**. Workflow
539
+ and model details explain that features may be incomplete or contain bugs and
540
+ results may vary. Running a preview prints the notice to stderr, including with
541
+ `--json`, so stdout remains machine-readable. The Hub's `researchPreview` boolean
542
+ is preserved in workflow/model JSON output; missing or false shows no label.
543
+ CLI-only access and preview status are independent.
544
+ Workflow discovery shows Hub's categories, tags, and UI mode. Local dry-runs do
545
+ not fetch preview metadata or print a preview notice.
@@ -506,3 +506,14 @@ that fewer rows were returned.
506
506
 
507
507
  See [the usage guide](docs/usage.md#find-jobs)
508
508
  for model, date, duration, and sorting options, which are hidden from default help.
509
+
510
+ ### Research previews
511
+
512
+ Workflow and model listings mark early releases as **Research preview**. Workflow
513
+ and model details explain that features may be incomplete or contain bugs and
514
+ results may vary. Running a preview prints the notice to stderr, including with
515
+ `--json`, so stdout remains machine-readable. The Hub's `researchPreview` boolean
516
+ is preserved in workflow/model JSON output; missing or false shows no label.
517
+ CLI-only access and preview status are independent.
518
+ Workflow discovery shows Hub's categories, tags, and UI mode. Local dry-runs do
519
+ not fetch preview metadata or print a preview notice.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "apheris-foundry-cli"
7
- version = "2.0.0"
7
+ version = "2.1.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.0.0
3
+ Version: 2.1.0
4
4
  Summary: Command-line interface for Apheris Foundry workflows.
5
5
  Author: Apheris
6
6
  License-Expression: LicenseRef-Apheris-Foundry-Software-License
@@ -532,3 +532,14 @@ that fewer rows were returned.
532
532
 
533
533
  See [the usage guide](docs/usage.md#find-jobs)
534
534
  for model, date, duration, and sorting options, which are hidden from default help.
535
+
536
+ ### Research previews
537
+
538
+ Workflow and model listings mark early releases as **Research preview**. Workflow
539
+ and model details explain that features may be incomplete or contain bugs and
540
+ results may vary. Running a preview prints the notice to stderr, including with
541
+ `--json`, so stdout remains machine-readable. The Hub's `researchPreview` boolean
542
+ is preserved in workflow/model JSON output; missing or false shows no label.
543
+ CLI-only access and preview status are independent.
544
+ Workflow discovery shows Hub's categories, tags, and UI mode. Local dry-runs do
545
+ not fetch preview metadata or print a preview notice.
@@ -40,6 +40,11 @@ from apherisfold_cli.core.render import command_examples
40
40
  from apherisfold_cli.core.result_artifacts import extract_results_archive, validate_result_view
41
41
  from apherisfold_cli.handlers import get_ctx, run_simple_listing
42
42
 
43
+ RESEARCH_PREVIEW_NOTICE = (
44
+ "Research preview: An early release for exploration and feedback. "
45
+ "Features may be incomplete or contain bugs, and results may vary."
46
+ )
47
+
43
48
  _CONSOLE = Console()
44
49
  _TERMINAL_STATUSES = {"succeeded", "failed", "cancelled"}
45
50
  _POLL_INTERVAL = 3.0
@@ -660,6 +665,9 @@ def foundry_run(
660
665
  extra = {"upload": [str(path) for path in upload_sources]} if upload is not None else {}
661
666
  _render_dry_run(body, title="Foundry Job Preview", json_output=json_output, **extra)
662
667
  return
668
+ metadata = get_foundry_workflow(workflow)
669
+ if metadata.get("researchPreview") is True:
670
+ typer.echo(RESEARCH_PREVIEW_NOTICE, err=True)
663
671
  resp = upload_foundry_run(body, upload) if upload is not None else create_foundry_run(body)
664
672
  except CLIError as exc:
665
673
  hint = msa_failure_hint(exc.message)
@@ -842,7 +850,7 @@ def _weight_label(weight: dict[str, Any]) -> str:
842
850
 
843
851
  def _models_table(models: list[dict[str, Any]]) -> Table:
844
852
  table = Table(box=box.SIMPLE_HEAD, show_header=True, padding=(0, 1), expand=True)
845
- table.add_column("MODEL", no_wrap=True, style="cyan")
853
+ table.add_column("MODEL", overflow="fold", style="cyan")
846
854
  table.add_column("WEIGHT", no_wrap=True, style="cyan")
847
855
  table.add_column("SOURCE", no_wrap=True)
848
856
  table.add_column("CAPABILITIES", overflow="fold")
@@ -852,7 +860,9 @@ def _models_table(models: list[dict[str, Any]]) -> Table:
852
860
  if not weights:
853
861
  note = model.get("metadataError") or "No selectable weights advertised."
854
862
  table.add_row(
855
- str(model.get("id", "")),
863
+ Text(
864
+ str(model.get("id", "")) + (" (Research preview)" if model.get("researchPreview") is True else "")
865
+ ),
856
866
  "",
857
867
  "",
858
868
  ", ".join(_weight_capabilities(model, None)),
@@ -862,7 +872,9 @@ def _models_table(models: list[dict[str, Any]]) -> Table:
862
872
  default_weight = default_model_weight(model)
863
873
  for weight in weights:
864
874
  table.add_row(
865
- str(model.get("id", "")),
875
+ Text(
876
+ str(model.get("id", "")) + (" (Research preview)" if model.get("researchPreview") is True else "")
877
+ ),
866
878
  Text(f"{weight.get('version', '')}{' *' if weight is default_weight else ''}"),
867
879
  _weight_source(weight),
868
880
  ", ".join(_weight_capabilities(model, weight)),
@@ -879,6 +891,7 @@ def _weight_detail(model: dict[str, Any], weight: dict[str, Any]) -> Table:
879
891
  details.add_column("VALUE", overflow="fold")
880
892
  for label, value in (
881
893
  ("MODEL", model.get("id")),
894
+ ("STATUS", RESEARCH_PREVIEW_NOTICE if model.get("researchPreview") is True else None),
882
895
  ("WEIGHT", weight.get("version")),
883
896
  ("DEFAULT", "yes" if weight is default_weight else "no"),
884
897
  ("NAME", weight.get("name")),
@@ -21,6 +21,7 @@ from apherisfold_cli.commands import login
21
21
  from apherisfold_cli.commands.compounds import app as compounds_app
22
22
  from apherisfold_cli.commands.foundry import (
23
23
  _DEFAULT_LIST_LIMIT,
24
+ RESEARCH_PREVIEW_NOTICE,
24
25
  default_model_weight,
25
26
  foundry_cancel,
26
27
  foundry_delete,
@@ -366,18 +367,21 @@ def workflows_list_cmd(
366
367
  table = Table(box=box.SIMPLE_HEAD, show_header=True, padding=(0, 1), expand=True)
367
368
  table.add_column("WORKFLOW", style="cyan", no_wrap=True)
368
369
  table.add_column("TITLE", overflow="fold")
369
- table.add_column("INPUT", overflow="fold")
370
- table.add_column("OUTPUT", overflow="fold")
371
- table.add_column("PROFILES", overflow="fold")
370
+ table.add_column("CATEGORIES", overflow="fold")
371
+ table.add_column("TAGS", overflow="fold")
372
+ table.add_column("UI MODE", no_wrap=True)
372
373
  for workflow in workflows:
373
374
  if not isinstance(workflow, dict):
374
375
  continue
375
376
  table.add_row(
376
377
  str(workflow.get("id", "")),
377
- str(workflow.get("title") or workflow.get("description") or ""),
378
- str(workflow.get("input") or ""),
379
- str(workflow.get("output") or ""),
380
- ", ".join(str(item) for item in workflow.get("profiles", []) if item),
378
+ Text(
379
+ str(workflow.get("title") or workflow.get("description") or "")
380
+ + (" (Research preview)" if workflow.get("researchPreview") is True else "")
381
+ ),
382
+ ", ".join(workflow.get("categories") or []),
383
+ ", ".join(workflow.get("tags") or []),
384
+ str(workflow.get("uiMode") or ""),
381
385
  )
382
386
 
383
387
  examples = Table(box=box.SIMPLE_HEAD, show_header=False, padding=(0, 1), expand=False)
@@ -410,10 +414,11 @@ def workflows_get_cmd(
410
414
  info.add_row("ID", str(payload.get("id", "")))
411
415
  info.add_row("Title", str(payload.get("title") or ""))
412
416
  info.add_row("Description", str(payload.get("description") or ""))
413
- info.add_row("Summary", str(payload.get("summary") or ""))
414
- info.add_row("Input", str(payload.get("input") or ""))
415
- info.add_row("Output", str(payload.get("output") or ""))
416
- info.add_row("Profiles", ", ".join(str(item) for item in payload.get("profiles", []) if item))
417
+ if payload.get("researchPreview") is True:
418
+ info.add_row("Status", RESEARCH_PREVIEW_NOTICE)
419
+ info.add_row("Categories", ", ".join(payload.get("categories") or []))
420
+ info.add_row("Tags", ", ".join(payload.get("tags") or []))
421
+ info.add_row("UI mode", str(payload.get("uiMode") or ""))
417
422
 
418
423
  models_value = payload.get("models")
419
424
  models = models_value if isinstance(models_value, list) else []
@@ -69,6 +69,21 @@ Hub package deployment, not choosing one arbitrarily.
69
69
  actual settings, artifact locations, and limitations; execution success alone
70
70
  does not demonstrate a scientific improvement.
71
71
 
72
+ ### Research previews
73
+
74
+ Workflow and model JSON may include `researchPreview: true`. When the selected
75
+ workflow or model has this flag, tell the user it is a research preview: an early
76
+ release for exploration and feedback whose features may be incomplete or contain
77
+ bugs, and whose results may vary. Carry that context into result summaries.
78
+ Missing or false means no preview label; it does not establish scientific validity.
79
+ Preview status is independent of `uiMode: "cli-only"` and is not a submission gate.
80
+ Continue within the user's authorized request without an extra confirmation.
81
+
82
+ The CLI labels previews in human-readable discovery output and prints a notice to
83
+ stderr when submitting a preview workflow, including with `--json`; stdout remains
84
+ machine-readable. Use the workflow/model JSON flag when interpreting structured
85
+ output. Local dry-runs skip the preview lookup and notice.
86
+
72
87
  ### MSA settings
73
88
 
74
89
  Use `apheris-foundry settings msa list --json` to discover the current Hub's
@@ -0,0 +1 @@
1
+ __version__ = "2.1.0"
@@ -34,6 +34,7 @@ def submissions(monkeypatch):
34
34
  "models": [{"id": "openfold3", "weights": [{"version": "0.3.0", "default": True}]}],
35
35
  },
36
36
  )
37
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
37
38
  return calls
38
39
 
39
40
 
@@ -324,9 +324,9 @@ def hub_api_fixture(monkeypatch):
324
324
  "id": "predict",
325
325
  "description": "Predict structures",
326
326
  "title": "Predict",
327
- "input": "Request JSON or CIF",
328
- "output": "Structure predictions",
329
- "profiles": ["local", "k8s"],
327
+ "categories": ["prediction"],
328
+ "tags": ["OpenFold3"],
329
+ "uiMode": "full",
330
330
  "graph": {
331
331
  "nodes": [
332
332
  {"id": "v1", "label": "PREDICT_PREPROCESS"},
@@ -343,9 +343,9 @@ def hub_api_fixture(monkeypatch):
343
343
  "id": "fragment-analysis",
344
344
  "description": "Fragment analysis",
345
345
  "title": "Fragment Analysis",
346
- "input": "Molecule CSV",
347
- "output": "Fragment frequency and property summaries",
348
- "profiles": ["local", "k8s"],
346
+ "categories": ["analysis"],
347
+ "tags": ["Fragment Model"],
348
+ "uiMode": "cli-only",
349
349
  "graph": {
350
350
  "nodes": [
351
351
  {"id": "v1", "label": "FRAGMENT_PREPROCESS"},
@@ -494,8 +494,8 @@ def test_foundry_workflows_list_shows_mounted_workflows(hub_api_fixture) -> None
494
494
  assert "Foundry Workflows" in result.stdout
495
495
  assert "predict" in result.stdout
496
496
  assert "fragment-analysis" in result.stdout
497
- assert "Molecule CSV" in result.stdout
498
- assert "Fragment frequency" in result.stdout
497
+ assert "Fragment Model" in result.stdout
498
+ assert "cli-only" in result.stdout
499
499
  assert hub_api_fixture["list_foundry_workflows"] == [True]
500
500
 
501
501
 
@@ -505,8 +505,8 @@ def test_foundry_workflows_get_shows_workflow_contract(hub_api_fixture) -> None:
505
505
  assert result.exit_code == 0
506
506
  assert "Foundry Workflow" in result.stdout
507
507
  assert "fragment-analysis" in result.stdout
508
- assert "Molecule CSV" in result.stdout
509
- assert "Fragment frequency" in result.stdout
508
+ assert "Fragment Model" in result.stdout
509
+ assert "cli-only" in result.stdout
510
510
  assert "--param key=value" in result.stdout
511
511
  assert "--model-params" not in result.stdout
512
512
  assert hub_api_fixture["get_foundry_workflow"] == ["fragment-analysis"]
@@ -3058,3 +3058,96 @@ def test_foundry_workflows_run_points_to_possibly_created_job_after_5xx(
3058
3058
  assert result.exception.code == 75
3059
3059
  assert "The job may already exist" in result.exception.message
3060
3060
  assert expected in result.exception.message
3061
+
3062
+
3063
+ @pytest.mark.parametrize("preview", [True, False, None])
3064
+ @pytest.mark.parametrize("with_weights", [True, False])
3065
+ def test_research_preview_in_workflow_and_model_discovery(hub_api_fixture, preview, with_weights) -> None:
3066
+ model = {"id": "example", "weights": [{"version": "base", "default": True}] if with_weights else []}
3067
+ workflow = {
3068
+ "id": "example",
3069
+ "title": "Example",
3070
+ "description": "Example workflow from the Hub catalog.",
3071
+ "categories": ["design"],
3072
+ "tags": ["RFD4-Proteina"],
3073
+ "models": [model],
3074
+ "uiMode": "cli-only",
3075
+ }
3076
+ if preview is not None:
3077
+ workflow["researchPreview"] = preview
3078
+ model["researchPreview"] = preview
3079
+ with (
3080
+ patch("apherisfold_cli.main.list_foundry_workflows", return_value={"workflows": [workflow]}),
3081
+ patch("apherisfold_cli.main.get_foundry_workflow", return_value=workflow),
3082
+ patch("apherisfold_cli.commands.foundry.get_foundry_workflow", return_value=workflow),
3083
+ ):
3084
+ for args in (
3085
+ ["list"],
3086
+ ["get", "--workflow", "example"],
3087
+ ["models", "--workflow", "example"],
3088
+ ["models", "--workflow", "example", "--weight", "base"],
3089
+ ):
3090
+ if "--weight" in args and not with_weights:
3091
+ continue
3092
+ result = runner.invoke(app, ["workflows", *args], env={"COLUMNS": "200"})
3093
+ assert result.exit_code == 0, result.output
3094
+ assert ("Research preview" in result.stdout) is (preview is True)
3095
+ if args[0] in {"list", "get"}:
3096
+ assert "design" in result.stdout
3097
+ assert "RFD4-Proteina" in result.stdout
3098
+ assert "cli-only" in result.stdout
3099
+ assert "PROFILES" not in result.stdout and "Profiles" not in result.stdout
3100
+ structured = runner.invoke(app, ["workflows", *args, "--json"])
3101
+ assert structured.exit_code == 0, structured.output
3102
+ payload = json.loads(structured.stdout)
3103
+ entry = payload["workflows"][0] if args[0] == "list" else payload
3104
+ if args[0] == "models":
3105
+ entry = entry["model"] if "--weight" in args else entry["models"][0]
3106
+ expected = model if args[0] == "models" else workflow
3107
+ if "--weight" in args:
3108
+ expected = {key: value for key, value in model.items() if key != "weights"}
3109
+ assert payload["weight"] == model["weights"][0]
3110
+ assert entry == expected
3111
+ assert entry.get("researchPreview") is preview
3112
+
3113
+
3114
+ @pytest.mark.parametrize("preview", [True, False, None])
3115
+ def test_research_preview_run_notice_keeps_json_stdout_clean(hub_api_fixture, preview) -> None:
3116
+ workflow = {"id": "example"}
3117
+ if preview is not None:
3118
+ workflow["researchPreview"] = preview
3119
+ with (
3120
+ patch("apherisfold_cli.commands.foundry.get_foundry_workflow", return_value=workflow),
3121
+ patch("apherisfold_cli.main.get_foundry_workflow", return_value=workflow),
3122
+ ):
3123
+ result = runner.invoke(app, ["workflows", "run", "--workflow", "example", "--json"])
3124
+ assert result.exit_code == 0, result.output
3125
+ assert json.loads(result.stdout)["runId"]
3126
+ assert ("Research preview" in result.stderr) is (preview is True)
3127
+ assert len(hub_api_fixture["create_foundry_run"]) == 1
3128
+
3129
+
3130
+ @pytest.mark.parametrize("folder", [False, True])
3131
+ def test_local_dry_run_does_not_fetch_preview_metadata(hub_api_fixture, tmp_path, folder) -> None:
3132
+ request = tmp_path / "request.json"
3133
+ request.write_text("{}")
3134
+ with patch("apherisfold_cli.commands.foundry.get_foundry_workflow") as metadata:
3135
+ result = runner.invoke(
3136
+ app,
3137
+ [
3138
+ "--dry-run",
3139
+ "true",
3140
+ "workflows",
3141
+ "run",
3142
+ "--workflow",
3143
+ "example",
3144
+ "--input",
3145
+ str(tmp_path if folder else request),
3146
+ "--json",
3147
+ ],
3148
+ )
3149
+ assert result.exit_code == 0, result.output
3150
+ json.loads(result.stdout)
3151
+ metadata.assert_not_called()
3152
+ assert hub_api_fixture["create_foundry_run"] == []
3153
+ assert hub_api_fixture["upload_foundry_run"] == []
@@ -59,7 +59,8 @@ def test_rejects_symlink_in_folder(tmp_path):
59
59
  assert "links" in captured.value.message
60
60
 
61
61
 
62
- def test_workflows_run_packages_folder(tmp_path):
62
+ def test_workflows_run_packages_folder(tmp_path, monkeypatch):
63
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
63
64
  (tmp_path / "data.parquet").write_bytes(b"\xff\x00")
64
65
 
65
66
  def upload(body, path):
@@ -101,7 +102,8 @@ def test_upload_body_can_be_replayed_after_auth_refresh(tmp_path, monkeypatch):
101
102
  assert len(bodies) == 2
102
103
 
103
104
 
104
- def test_zip_root_stripping_is_explicit(tmp_path):
105
+ def test_zip_root_stripping_is_explicit(tmp_path, monkeypatch):
106
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
105
107
  path = tmp_path / "input.zip"
106
108
  with zipfile.ZipFile(path, "w") as archive:
107
109
  archive.writestr("expression/sample:treated.parquet", b"PAR1")
@@ -166,6 +168,7 @@ def test_old_timestamps_are_clamped(tmp_path):
166
168
 
167
169
 
168
170
  def test_wait_removes_temporary_archive_before_polling(tmp_path, monkeypatch):
171
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
169
172
  from apherisfold_cli.commands import foundry
170
173
 
171
174
  (tmp_path / "data.bin").write_bytes(b"data")
@@ -184,6 +184,7 @@ def test_list_accepts_empty_catalog(monkeypatch, transport, raw):
184
184
 
185
185
  @pytest.mark.parametrize("select_first", [False, True])
186
186
  def test_run_leaves_msa_resolution_to_hub(monkeypatch, servers, tmp_path, select_first):
187
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
187
188
  selections = []
188
189
  submissions = []
189
190
  monkeypatch.setattr(settings, "select_msa_server", selections.append)
@@ -253,6 +254,7 @@ def test_submission_preserves_hub_error_and_adds_msa_recovery(
253
254
  calls.append(args)
254
255
  raise error
255
256
 
257
+ monkeypatch.setattr(foundry, "get_foundry_workflow", lambda *_: {"id": "predict"})
256
258
  monkeypatch.setattr(foundry, "upload_foundry_run" if upload else "create_foundry_run", reject)
257
259
  monkeypatch.setattr(settings, "select_msa_server", lambda *_: pytest.fail("must not change settings"))
258
260
  monkeypatch.setattr(msa, "list_msa_servers", lambda: pytest.fail("must not add a preflight request"))
@@ -273,6 +275,7 @@ def test_submission_preserves_hub_error_and_adds_msa_recovery(
273
275
 
274
276
 
275
277
  def test_unrelated_submission_error_is_unchanged(monkeypatch, tmp_path):
278
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
276
279
  error = CLIError(code=2, category="usage", message="Invalid request JSON.", task="foundry.runs.create")
277
280
 
278
281
  def reject(*_):
@@ -332,6 +335,7 @@ def test_failed_job_diagnostics_offer_msa_recovery_only_when_relevant(monkeypatc
332
335
 
333
336
  @pytest.mark.parametrize("json_output", [False, True])
334
337
  def test_wait_for_missing_msa_failure_preserves_exit_and_json(monkeypatch, tmp_path, json_output):
338
+ monkeypatch.setattr("apherisfold_cli.commands.foundry.get_foundry_workflow", lambda workflow: {"id": workflow})
335
339
  final = {"id": "failed-run", "status": "failed", "exitCode": 3, "error": "Missing required MSA files"}
336
340
  monkeypatch.setattr(
337
341
  "apherisfold_cli.commands.foundry.create_foundry_run", lambda _: {"runId": "failed-run", "status": "pending"}
@@ -1 +0,0 @@
1
- __version__ = "2.0.0"