envloop-cli 2.4.1__py3-none-any.whl → 2.4.2__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: envloop-cli
3
- Version: 2.4.1
3
+ Version: 2.4.2
4
4
  Summary: EnvLoop CLI and Python SDK for jobs, training, checkpoints and inference
5
5
  Project-URL: Homepage, https://envloop.ai
6
6
  Project-URL: Documentation, https://docs.envloop.ai
@@ -10,7 +10,7 @@ Project-URL: Agent instructions, https://docs.envloop.ai/skill.md
10
10
  Requires-Python: >=3.12
11
11
  Provides-Extra: asset
12
12
  Requires-Dist: boto3==1.44.3; extra == 'asset'
13
- Requires-Dist: envloop-envhub==2.4.1; extra == 'asset'
13
+ Requires-Dist: envloop-envhub==2.4.2; extra == 'asset'
14
14
  Provides-Extra: chat
15
15
  Requires-Dist: openai==3.55.1; extra == 'chat'
16
16
  Provides-Extra: default
@@ -429,3 +429,25 @@ Trial Artifact publication is `el trial artifact create --file manifest.json --d
429
429
  `trial artifact download --ref URI --output DIR --content-digest SHA256` downloads one fixed
430
430
  ANS directory; `trial artifact download TRIAL_ID --output DIR` downloads all uploaded Trial files.
431
431
  These execution-owned records are excluded from Assets.
432
+
433
+
434
+ ### Update Loop metadata
435
+
436
+ ```bash
437
+ el loop update LOOP_ID --spec loop.json
438
+ el loop update LOOP_ID --spec '{"schema":"envloop.loop/v1","name":"Carry research"}'
439
+ ```
440
+
441
+ ```json
442
+ {
443
+ "schema": "envloop.loop/v1",
444
+ "name": "Carry research",
445
+ "description": "Compare candidate methods on a fixed evaluation set."
446
+ }
447
+ ```
448
+
449
+ Supplied fields replace their current values; omitted fields stay unchanged.
450
+ Set `"description": ""` to clear it. Pass a JSON file path or a quoted JSON object to `--spec`. Updating metadata needs
451
+ `training.run` and keeps the Loop ID, execution settings and recorded research.
452
+ Use `client.loops.update(loop_id, spec)` from Python and read the effective `spec`
453
+ with `client.loops.get(loop_id)`. See the [Loop guide](https://docs.envloop.ai/guides/rsi-loops#update-metadata).
@@ -71,11 +71,11 @@ envloop_experiment/train_progress.py,sha256=9YO6CkTc7-LCpUpY8juf6GPF58kCU2rxc4iZ
71
71
  envloop_experiment/train_runner_cli.py,sha256=XJ-woz80M6ngsArlyP-dVT4CeTeT-O2PXKP5vcSQriE,3811
72
72
  envloop_experiment/training/__init__.py,sha256=IEQWbCHe-zZ2e7JQxOrFOdYlSQxMfOceCZUf_KeszBk,221
73
73
  envloop_rsi_loop/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
74
- envloop_rsi_loop/cli.py,sha256=egat_Keygh9V1VAYgfEmqBKDmntCWe7ES_SFjhh26Yg,4102
75
- envloop_rsi_loop/cli_output.py,sha256=o5XzAkcddBOZ2h_AQ-pUPqJIWUOIMfZPWaPxqm0AtUM,4840
76
- envloop_rsi_loop/loop_cli.py,sha256=V_LEyWTsps2G1UNuMiWhrDDRdO0H4Z1bXGuWsYTOo0c,4491
77
- envloop_rsi_loop/loops.py,sha256=MGVe3uXxGlnzT_Sc7OHU97kyYA_FSFpXIUtlpXQ8ha0,8924
78
- envloop_cli-2.4.1.dist-info/METADATA,sha256=h0R86zLzNKX9JyZrmAs0j9BeDqbufr7Q2umasva75JA,22479
79
- envloop_cli-2.4.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
80
- envloop_cli-2.4.1.dist-info/entry_points.txt,sha256=8aXOpgtVk4GndhChA4XNecShkb1w0xGHBHrKla78ofI,67
81
- envloop_cli-2.4.1.dist-info/RECORD,,
74
+ envloop_rsi_loop/cli.py,sha256=6TuphjApmse3B5qmCfMaAmgN4o8Jr7lUMEXl2vOLJNY,4489
75
+ envloop_rsi_loop/cli_output.py,sha256=2gnvPyYbIkKKDys6n0Epo_WZoE62dK-pAfBEshnCgTk,4935
76
+ envloop_rsi_loop/loop_cli.py,sha256=jzR0a0yW2rPRvwEixeUNCvwtsI3Aahvf3NKlEyma8Pc,5044
77
+ envloop_rsi_loop/loops.py,sha256=XPrAThXrSeXZVfkXyj5FHK99dxXaIdtINSrzP88jmUs,9387
78
+ envloop_cli-2.4.2.dist-info/METADATA,sha256=h5yfltedWno6yAIwfRkSC_0lC8Ma6MClBUjPLOcbFuA,23267
79
+ envloop_cli-2.4.2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
80
+ envloop_cli-2.4.2.dist-info/entry_points.txt,sha256=8aXOpgtVk4GndhChA4XNecShkb1w0xGHBHrKla78ofI,67
81
+ envloop_cli-2.4.2.dist-info/RECORD,,
envloop_rsi_loop/cli.py CHANGED
@@ -21,6 +21,10 @@ def add_commands(groups: "argparse._SubParsersAction[argparse.ArgumentParser]"):
21
21
  get = loops.add_parser("get", help="Show a Loop's state, Iterations and Train Jobs")
22
22
  get.add_argument("loop_id", metavar="LOOP_ID", help=LOOP_ID_HELP)
23
23
  get.add_argument("--json", action="store_true", help="Output the complete Loop as JSON (default: summary and tables)")
24
+ update = loops.add_parser("update", help="Update Loop metadata from a spec (needs training.run)")
25
+ update.add_argument("loop_id", metavar="LOOP_ID", help=LOOP_ID_HELP)
26
+ update.add_argument("--spec", required=True, metavar="FILE|JSON",
27
+ help="JSON file path or inline envloop.loop/v1 JSON object; supplied name/description override, omitted fields stay")
24
28
  iteration = loops.add_parser("iteration", help="Read one Iteration of a Loop").add_subparsers(
25
29
  dest="iteration_action", required=True)
26
30
  iteration_get = iteration.add_parser("get", help="Show one Iteration's decision, summary and audits")
@@ -70,7 +70,9 @@ def loop_output(loop: dict[str, Any], jobs: dict[str, Any]) -> str:
70
70
  """A Loop's summary, its Iterations, then the Train Jobs it launched."""
71
71
  spent = loop.get("spend") if isinstance(loop.get("spend"), dict) else {}
72
72
  fields = (
73
- ("Loop ID", loop.get("loop_id")), ("Name", loop.get("name")), ("State", state_text(loop.get("state"))),
73
+ ("Loop ID", loop.get("loop_id")), ("Name", loop.get("name")),
74
+ *((("Description", loop["description"]),) if loop.get("description") else ()),
75
+ ("State", state_text(loop.get("state"))),
74
76
  ("Iteration", iteration_text(loop)), ("Best version", loop.get("best_version")),
75
77
  ("Spend", spend(loop)), ("Model cost cap", usd(spent.get("max_model_cost_usd"))),
76
78
  ("Updated at", timestamp(loop.get("updated_at"))),
@@ -4,6 +4,7 @@ import argparse
4
4
  import json
5
5
  import sys
6
6
  import time
7
+ from pathlib import Path
7
8
  from typing import TYPE_CHECKING, Any
8
9
 
9
10
  from envloop.terminal import safe_text, status_text, style
@@ -22,6 +23,16 @@ def validate(args: argparse.Namespace) -> None:
22
23
  loop_path(args.loop_id)
23
24
  if getattr(args, "iteration", None) is not None:
24
25
  valid_iteration(args.iteration)
26
+ if args.action == "update":
27
+ try:
28
+ spec = json.loads(args.spec)
29
+ except json.JSONDecodeError:
30
+ if args.spec.lstrip().startswith(("{", "[", '"')):
31
+ raise
32
+ spec = json.loads(Path(args.spec).read_text(encoding="utf-8"))
33
+ if not isinstance(spec, dict):
34
+ raise ValueError("Loop spec must be a JSON object")
35
+ args.loop_spec = spec
25
36
 
26
37
 
27
38
  def _brief(args: argparse.Namespace) -> str:
@@ -59,7 +70,7 @@ def loop_jobs(client: Any, detail: dict[str, Any]) -> dict[str, Any]:
59
70
  """The Loop's Train Jobs for the detail view; a failed lookup is shown, not raised."""
60
71
  from envloop.http import RemoteError
61
72
  from envloop_rsi_loop.loops import LoopError, train_jobs
62
- name = detail.get("name")
73
+ name = detail.get("legacy_name", detail.get("name"))
63
74
  try:
64
75
  return train_jobs(client.training_jobs, detail.get("loop_id") or "", name=name if isinstance(name, str) else None)
65
76
  except (RemoteError, LoopError) as error:
@@ -81,6 +92,8 @@ def _run(args: argparse.Namespace, client: Any) -> dict[str, Any] | None:
81
92
  action = args.action
82
93
  if action == "list":
83
94
  return loops.list()
95
+ if action == "update":
96
+ return loops.update(args.loop_id, args.loop_spec)
84
97
  if action == "get":
85
98
  detail = loops.get(args.loop_id)
86
99
  if not args.json:
envloop_rsi_loop/loops.py CHANGED
@@ -127,6 +127,14 @@ class Loops:
127
127
  """One Loop: state, latest ``iteration``, ``target_iterations``, versions, ``iterations[]``, spend."""
128
128
  return self._request("GET", loop_path(loop_id))
129
129
 
130
+ def update(self, loop_id: str, spec: dict[str, Any]) -> dict[str, Any]:
131
+ """Apply an ``envloop.loop/v1`` metadata spec (needs training.run).
132
+
133
+ Supplied ``name`` and ``description`` replace their current values; omitted fields stay.
134
+ Execution settings and recorded research are unchanged. Returns the effective ``spec``.
135
+ """
136
+ return self._request("PATCH", loop_path(loop_id), spec)
137
+
130
138
  def get_iteration(self, loop_id: str, iteration: int) -> dict[str, Any]:
131
139
  """One Iteration (numbered from 1): its plan, interventions, audits, decision and summary."""
132
140
  return self._request("GET", f"{loop_path(loop_id)}/iterations/{valid_iteration(iteration)}")
@@ -166,7 +174,7 @@ def train_jobs(resource: TrainJobs, loop_id: str, *, name: str | None = None) ->
166
174
  """The Train Jobs this Loop launched, grouped by Iteration, from the newest visible Train Jobs.
167
175
 
168
176
  Matches ``tags.rsi_loop == loop_id``; Jobs from before the rename match ``tags.rsi_run == name``
169
- (pass the Loop's ``name``). Reads at most ``MAX_PAGES`` pages; ``complete`` is False when older
177
+ (pass ``legacy_name`` when present, otherwise the Loop's ``name``). Reads at most ``MAX_PAGES`` pages; ``complete`` is False when older
170
178
  Train Jobs were not read.
171
179
  """
172
180
  loop_path(loop_id)