sequence-ai 0.34.0__tar.gz → 0.34.2__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 (103) hide show
  1. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/PKG-INFO +5 -4
  2. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/README.md +4 -3
  3. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/pyproject.toml +1 -1
  4. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_deploy_gateway.py +49 -4
  5. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/cli.py +11 -5
  6. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/deploy_cli.py +40 -8
  7. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/.gitignore +0 -0
  8. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/LICENSE +0 -0
  9. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/eval.md +0 -0
  10. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/observability.md +0 -0
  11. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/__init__.py +0 -0
  12. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/__main__.py +0 -0
  13. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_account.py +0 -0
  14. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_eval_gateway.py +0 -0
  15. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_gateway.py +0 -0
  16. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_mock.py +0 -0
  17. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_observe_gateway.py +0 -0
  18. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/_partial.py +0 -0
  19. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/adapter.py +0 -0
  20. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/adapter_check.py +0 -0
  21. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/adapter_cli.py +0 -0
  22. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/audit_cli.py +0 -0
  23. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/base.py +0 -0
  24. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/benchmark.py +0 -0
  25. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/benchmark_registry.py +0 -0
  26. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/benchmark_rm.py +0 -0
  27. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/capacity_cli.py +0 -0
  28. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/cli_json.py +0 -0
  29. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/cli_parser.py +0 -0
  30. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/code_bundle.py +0 -0
  31. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/data_cli.py +0 -0
  32. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/deploy.py +0 -0
  33. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/deployments_cli.py +0 -0
  34. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/errors.py +0 -0
  35. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/eval.py +0 -0
  36. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/eval_cli.py +0 -0
  37. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/eval_engine.py +0 -0
  38. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/image.py +0 -0
  39. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/kinds.py +0 -0
  40. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/listing.py +0 -0
  41. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/loading.py +0 -0
  42. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/observe.py +0 -0
  43. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/ops_cli.py +0 -0
  44. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/params.py +0 -0
  45. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/policy.py +0 -0
  46. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/__init__.py +0 -0
  47. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/check.py +0 -0
  48. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/cli.py +0 -0
  49. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/compare.py +0 -0
  50. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/errors.py +0 -0
  51. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/export.py +0 -0
  52. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/motion.py +0 -0
  53. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/mujoco.py +0 -0
  54. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/sapien.py +0 -0
  55. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/port/scaffold.py +0 -0
  56. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/presets/__init__.py +0 -0
  57. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/presets/robot_arm.py +0 -0
  58. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/registry.py +0 -0
  59. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/robot_cli.py +0 -0
  60. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/run_logs.py +0 -0
  61. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/safety.py +0 -0
  62. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/secret.py +0 -0
  63. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/storage_cli.py +0 -0
  64. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/template_fetch.py +0 -0
  65. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/tf.py +0 -0
  66. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/usage_hist.py +0 -0
  67. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/volume.py +0 -0
  68. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/volume_upload.py +0 -0
  69. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq/weights.py +0 -0
  70. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/seq_launch.py +0 -0
  71. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/__init__.py +0 -0
  72. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/__init__.py +0 -0
  73. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/_mock_assets/worker.cert.pem +0 -0
  74. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/_mock_assets/worker.key.pem +0 -0
  75. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/capacity.py +0 -0
  76. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/catalogue.py +0 -0
  77. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/diagnostics.py +0 -0
  78. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/direct.py +0 -0
  79. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/encode.py +0 -0
  80. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/error_codes.py +0 -0
  81. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/logsource.py +0 -0
  82. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/mock_direct.py +0 -0
  83. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/names.py +0 -0
  84. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/reporting.py +0 -0
  85. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/rid.py +0 -0
  86. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/_core/transport.py +0 -0
  87. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/act/__init__.py +0 -0
  88. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/act/frames.py +0 -0
  89. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/act/observation.py +0 -0
  90. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/act/policy.py +0 -0
  91. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/act/run_loop.py +0 -0
  92. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/act/types.py +0 -0
  93. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/chat/__init__.py +0 -0
  94. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/chat/content.py +0 -0
  95. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/chat/conversation.py +0 -0
  96. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/chat/infer.py +0 -0
  97. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/chat/types.py +0 -0
  98. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/decide/__init__.py +0 -0
  99. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/decide/infer.py +0 -0
  100. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/decide/types.py +0 -0
  101. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/errors.py +0 -0
  102. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/py.typed +0 -0
  103. {sequence_ai-0.34.0 → sequence_ai-0.34.2}/sequence_ai/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sequence-ai
3
- Version: 0.34.0
3
+ Version: 0.34.2
4
4
  Summary: The inference and benchmark platform for physical AI: deploy a robot policy, run it on your robot, score it.
5
5
  Project-URL: Homepage, https://generalsequences.com
6
6
  Project-URL: Documentation, https://generalsequences.com/docs/
@@ -936,12 +936,13 @@ seq validate my-pi05/policy.py # or a class in a file: seq validate my_po
936
936
  ```
937
937
 
938
938
  `seq validate` reads the policy's declaration — it never runs `load` or `infer` — into the deployment request,
939
- validates it against the platform's contract, and echoes back exactly what will be installed, where the
940
- weights mount and which files are uploaded — with **nothing built, run or sent**:
939
+ validates it against this SDK's copy of the platform's contract (the platform checks it again when you deploy),
940
+ and echoes back exactly what will be installed, where the weights mount and which files are uploaded — with
941
+ **nothing built, run or sent**:
941
942
 
942
943
  ```
943
944
  policy my-pi05
944
- platform accepted (validated against deployment contract 0.4.17)
945
+ contract valid for this SDK's deployment contract 0.5.0 (the platform checks it again when you deploy)
945
946
  image nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04
946
947
  apt-get install git, git-lfs, build-essential, clang, linux-headers-generic, libgl1, libglib2.0-0
947
948
  run pip install --no-cache-dir uv
@@ -893,12 +893,13 @@ seq validate my-pi05/policy.py # or a class in a file: seq validate my_po
893
893
  ```
894
894
 
895
895
  `seq validate` reads the policy's declaration — it never runs `load` or `infer` — into the deployment request,
896
- validates it against the platform's contract, and echoes back exactly what will be installed, where the
897
- weights mount and which files are uploaded — with **nothing built, run or sent**:
896
+ validates it against this SDK's copy of the platform's contract (the platform checks it again when you deploy),
897
+ and echoes back exactly what will be installed, where the weights mount and which files are uploaded — with
898
+ **nothing built, run or sent**:
898
899
 
899
900
  ```
900
901
  policy my-pi05
901
- platform accepted (validated against deployment contract 0.4.17)
902
+ contract valid for this SDK's deployment contract 0.5.0 (the platform checks it again when you deploy)
902
903
  image nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04
903
904
  apt-get install git, git-lfs, build-essential, clang, linux-headers-generic, libgl1, libglib2.0-0
904
905
  run pip install --no-cache-dir uv
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sequence-ai"
7
- version = "0.34.0"
7
+ version = "0.34.2"
8
8
  description = "The inference and benchmark platform for physical AI: deploy a robot policy, run it on your robot, score it."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -72,6 +72,11 @@ class DeploymentsClient:
72
72
 
73
73
  return self._backend.submit(request, replace=replace)
74
74
 
75
+ def validate(self, request: DeploymentRequest, *, replace: bool = False) -> Optional[dict]:
76
+
77
+
78
+ return self._backend.validate(request, replace=replace)
79
+
75
80
  def status(self, deployment_id: str) -> DeploymentStatusResponse:
76
81
  return self._backend.status(deployment_id)
77
82
 
@@ -150,6 +155,28 @@ class _GatewayDeployBackend:
150
155
 
151
156
  raise InternalError("gateway accepted the deployment but returned a malformed body") from None
152
157
 
158
+ def validate(self, request: DeploymentRequest, *, replace: bool = False) -> Optional[dict]:
159
+ """POST /v1/deployments/validate: what the deploy of this body would answer, without the deploy - the same
160
+ refusals as submit()'s, raised by the same mapping, and on acceptance its answer {"ok", "name", "state",
161
+ "contract"}. None when it cannot be asked: no answer, or a platform from before the check, which answers 405
162
+ (the path matches its GET and DELETE of a deployment) - never a 404 of its own, which is a refusal (a volume
163
+ not uploaded)."""
164
+ import httpx
165
+
166
+ try:
167
+ with self._client() as c:
168
+ r = c.post("/v1/deployments/validate", content=request.model_dump_json(exclude_none=True),
169
+ params={"replace": "true"} if replace else None)
170
+ except httpx.TransportError:
171
+ return None
172
+ if r.status_code == 405 or (r.status_code == 404 and _unrouted(r)):
173
+ return None
174
+ raise_for(r)
175
+ try:
176
+ return dict(r.json())
177
+ except Exception:
178
+ return None
179
+
153
180
  def status(self, deployment_id: str) -> DeploymentStatusResponse:
154
181
  """GET /v1/deployments/{id} → DeploymentStatusResponse (building | ready | failed, + error when
155
182
  failed). A 404 or any non-2xx is surfaced, never read as a silent success."""
@@ -167,6 +194,14 @@ class _GatewayDeployBackend:
167
194
  raise InternalError(f"gateway returned a malformed status for deployment {deployment_id!r}") from None
168
195
 
169
196
 
197
+ def _unrouted(r: Any) -> bool:
198
+ """A 404 the router gave (no such path), not the platform refusing something it found missing."""
199
+ try:
200
+ return (r.json() or {}).get("detail") == "Not Found"
201
+ except ValueError:
202
+ return True
203
+
204
+
170
205
  def _api_key(api_key: str | None) -> str:
171
206
  """The caller's SDK API key: explicit arg, else SEQUENCES_API_KEY. Missing → fail closed BEFORE any
172
207
  request (goal 11 / 12), pointing at where to create one."""
@@ -265,10 +300,7 @@ class MockDeploymentsBackend:
265
300
  return set()
266
301
  return {s.name for s in infos}
267
302
 
268
-
269
- def submit(self, request: DeploymentRequest, *, replace: bool = False) -> DeploymentAccepted:
270
- """Record the deployment as `building` and return its id (= the name, the route key). Same-name
271
- re-deploy → a new version (goal 25). An unknown/foreign secret ref → a submit-time 400 (goal 10)."""
303
+ def _check_secrets(self, request: DeploymentRequest) -> None:
272
304
 
273
305
 
274
306
  known = self._known_secret_names()
@@ -280,6 +312,19 @@ class MockDeploymentsBackend:
280
312
  hint="create them first: seq secret set <name> --env KEY",
281
313
  )
282
314
 
315
+ def validate(self, request: DeploymentRequest, *, replace: bool = False) -> dict:
316
+ """submit()'s check with nothing recorded: what the mock tier would answer the deploy."""
317
+ from sequence_base.constants.version import CONTRACT_VERSION
318
+
319
+ self._check_secrets(request)
320
+ prior = self._bucket(self._load()).get(request.name)
321
+ return {"ok": True, "name": request.name, "state": "version" if prior else "new", "contract": CONTRACT_VERSION}
322
+
323
+
324
+ def submit(self, request: DeploymentRequest, *, replace: bool = False) -> DeploymentAccepted:
325
+ """Record the deployment as `building` and return its id (= the name, the route key). Same-name
326
+ re-deploy → a new version (goal 25). An unknown/foreign secret ref → a submit-time 400 (goal 10)."""
327
+ self._check_secrets(request)
283
328
  name = request.name
284
329
  data = self._load()
285
330
  bucket = self._bucket(data)
@@ -472,13 +472,19 @@ def _cmd_deploy(args: argparse.Namespace) -> int:
472
472
  print(request.model_dump_json(indent=2))
473
473
  return 0
474
474
  _print_request(kind, request)
475
+ checked = None
475
476
  if kind == "policy":
476
- from seq.deploy_cli import claim_line, name_claim, refuse_claim
477
+ from seq import deploy_cli
477
478
 
478
- claim = name_claim(request.name, request.policy.handler_ref, args.base_url)
479
- print(claim_line(request.name, claim))
480
- refuse_claim(claim)
481
- print("\n--dry-run: nothing was sent; without it, `seq deploy` submits this request.")
479
+ claim = deploy_cli.name_claim(request.name, request.policy.handler_ref, args.base_url)
480
+ print(deploy_cli.claim_line(request.name, claim))
481
+ deploy_cli.refuse_claim(claim)
482
+
483
+ checked = deploy_cli.platform_check(request, replace=bool(getattr(args, "replace", False)),
484
+ base_url=args.base_url)
485
+ print(deploy_cli.platform_line(checked))
486
+ print("\n--dry-run: " + ("the platform checked it and nothing was built" if checked else "nothing was sent")
487
+ + "; without it, `seq deploy` submits this request.")
482
488
  return 0
483
489
  _print_code(request.code)
484
490
  return (_deploy_benchmark if kind == "benchmark" else _deploy_policy)(args, request)
@@ -19,7 +19,7 @@ from typing import Any, Callable
19
19
  from seq.cli_json import _print_json
20
20
  from seq.errors import SeqAuthoringError, build_failed, still_building
21
21
  from sequence_ai._core.names import segment
22
- from sequence_ai.errors import Conflict, InvalidRequest, NotFound, SequencesError
22
+ from sequence_ai.errors import AuthError, Conflict, InvalidRequest, NotFound, SequencesError
23
23
 
24
24
 
25
25
 
@@ -46,7 +46,7 @@ def _request_of(kind: str, cls: type, *, name: str | None = None, max_gpus: int
46
46
  update={"autoscaler": request.autoscaler.model_copy(update={"max_gpus": max_gpus})})
47
47
  if require_cap:
48
48
  _require_gpu_cap(request)
49
- _platform_accept(request)
49
+ _contract_check(request)
50
50
  except ValidationError as exc:
51
51
  raise SeqAuthoringError("; ".join(f"{'.'.join(map(str, e['loc'])) or 'request'}: {e['msg']}"
52
52
  for e in exc.errors())) from None
@@ -74,10 +74,12 @@ def _require_gpu_cap(request: Any) -> None:
74
74
  raise InvalidRequest(max_gpus_required_message())
75
75
 
76
76
 
77
- def _platform_accept(request: Any) -> None:
78
- """Re-validate the assembled request against its own contract type — the schema the gateway enforces, where every
79
- sub-shape forbids unknown fields and pins its types. A round trip that holds is the platform accepting it, checked
80
- here with no network and no build."""
77
+ def _contract_check(request: Any) -> None:
78
+ """Re-validate the assembled request against its own contract type — this SDK's copy of the schema the platform
79
+ enforces, where every sub-shape forbids unknown fields and pins its types — here with no network and no build. A
80
+ round trip that holds is valid for THIS SDK's contract, not the platform's verdict: the platform checks it again,
81
+ against its own and its newer rules, when it is sent.
82
+ """
81
83
  type(request).model_validate(json.loads(request.model_dump_json()))
82
84
 
83
85
 
@@ -91,7 +93,8 @@ def _print_echo(request: Any) -> None:
91
93
  from sequence_base.constants.version import CONTRACT_VERSION
92
94
 
93
95
  print(f"policy {request.name}")
94
- print(f"platform accepted (validated against deployment contract {CONTRACT_VERSION})")
96
+ print(f"contract valid for this SDK's deployment contract {CONTRACT_VERSION} (the platform checks it again "
97
+ "when you deploy)")
95
98
  _print_image(request.image)
96
99
  w = request.weights
97
100
  if w is None:
@@ -120,7 +123,8 @@ def _print_benchmark_echo(req: Any) -> None:
120
123
  from sequence_base.constants.version import CONTRACT_VERSION
121
124
 
122
125
  print(f"benchmark {req.name}")
123
- print(f"platform accepted (validated against contract {CONTRACT_VERSION})")
126
+ print(f"contract valid for this SDK's contract {CONTRACT_VERSION} (the platform checks it again when you "
127
+ "deploy)")
124
128
  _print_image(req.image)
125
129
  envs = getattr(req, "envs", None)
126
130
  if req.gpu == "cpu":
@@ -252,6 +256,34 @@ def refuse_claim(claim: dict | None) -> None:
252
256
  raise Conflict((claim or {}).get("detail") or "another account holds this name")
253
257
 
254
258
 
259
+ def platform_check(request: Any, *, replace: bool, base_url: str | None) -> dict | None:
260
+ """The platform's own check of the request, with nothing built (POST /v1/deployments/validate): its refusal raised
261
+ as the deploy's would be - the same error and exit code - its answer {"ok", "name", "state", "contract"} on
262
+ acceptance, None when it cannot be asked (no key, offline, a platform from before the check). Before it a dry run
263
+ said "platform accepted" from this SDK's own contract, and a platform with newer rules refused the same file at
264
+ deploy."""
265
+ from seq._deploy_gateway import DeploymentsClient
266
+
267
+ try:
268
+ client = DeploymentsClient(api_key=None, base_url=base_url or os.environ.get("SEQUENCES_BASE_URL"))
269
+ except AuthError:
270
+ return None
271
+ try:
272
+ return client.validate(request, replace=replace)
273
+ except AuthError:
274
+ return None
275
+
276
+
277
+ def platform_line(verdict: dict | None) -> str:
278
+ """The line `seq deploy --dry-run` prints about the platform's check."""
279
+ if verdict is None:
280
+ return ("platform not checked: the platform could not be asked (no key, offline, or a platform from before "
281
+ "the check); it checks this when you deploy")
282
+ contract = verdict.get("contract")
283
+ return ("platform accepted (checked by the platform"
284
+ + (f" against its contract {contract}" if contract else "") + "; nothing was built)")
285
+
286
+
255
287
  def _deploy_policy(args: argparse.Namespace, request: Any) -> int:
256
288
  """POST /v1/deployments, then (by default) poll building → ready | failed. A submit-time refusal (bad payload,
257
289
  unknown or foreign secret), an auth failure, a network error, a conflict and a failed build all raise with the
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