benchling-tools 0.7.0__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.
Files changed (48) hide show
  1. benchling_tools/__init__.py +12 -0
  2. benchling_tools/api.py +221 -0
  3. benchling_tools/auth.py +133 -0
  4. benchling_tools/blob_download.py +197 -0
  5. benchling_tools/change_spec.py +568 -0
  6. benchling_tools/cli.py +1836 -0
  7. benchling_tools/commands.py +213 -0
  8. benchling_tools/config.py +65 -0
  9. benchling_tools/credentials.py +264 -0
  10. benchling_tools/environment.py +272 -0
  11. benchling_tools/errors.py +124 -0
  12. benchling_tools/export.py +670 -0
  13. benchling_tools/issues.py +340 -0
  14. benchling_tools/keychain.py +324 -0
  15. benchling_tools/listing.py +506 -0
  16. benchling_tools/mcp_server.py +395 -0
  17. benchling_tools/models.py +293 -0
  18. benchling_tools/plans/__init__.py +13 -0
  19. benchling_tools/plans/base.py +69 -0
  20. benchling_tools/plans/blobs.py +489 -0
  21. benchling_tools/plans/containers.py +171 -0
  22. benchling_tools/plans/document.py +300 -0
  23. benchling_tools/plans/entry.py +148 -0
  24. benchling_tools/plans/fields.py +314 -0
  25. benchling_tools/plans/planner.py +938 -0
  26. benchling_tools/plans/readback.py +299 -0
  27. benchling_tools/plans/repository.py +232 -0
  28. benchling_tools/plans/result_update.py +907 -0
  29. benchling_tools/plans/results.py +628 -0
  30. benchling_tools/plans/table.py +242 -0
  31. benchling_tools/redact.py +73 -0
  32. benchling_tools/runtime.py +85 -0
  33. benchling_tools/services.py +2196 -0
  34. benchling_tools/skill.py +64 -0
  35. benchling_tools/stale.py +291 -0
  36. benchling_tools/tls.py +10 -0
  37. benchling_tools-0.7.0.data/data/share/benchling-tools/SKILL.md +385 -0
  38. benchling_tools-0.7.0.data/data/share/benchling-tools/contracts/list-parameters.json +34 -0
  39. benchling_tools-0.7.0.data/data/share/benchling-tools/contracts/openapi-manifest.json +68 -0
  40. benchling_tools-0.7.0.data/data/share/benchling-tools/schemas/change-spec.schema.json +287 -0
  41. benchling_tools-0.7.0.data/data/share/benchling-tools/schemas/envelope.schema.json +30 -0
  42. benchling_tools-0.7.0.dist-info/METADATA +152 -0
  43. benchling_tools-0.7.0.dist-info/RECORD +48 -0
  44. benchling_tools-0.7.0.dist-info/WHEEL +5 -0
  45. benchling_tools-0.7.0.dist-info/entry_points.txt +2 -0
  46. benchling_tools-0.7.0.dist-info/licenses/LICENSE +202 -0
  47. benchling_tools-0.7.0.dist-info/licenses/NOTICE +2 -0
  48. benchling_tools-0.7.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,12 @@
1
+ """Safe, auditable Benchling tools shared by the CLI and MCP server.
2
+
3
+ benchling-tools has no public Python API. Every module in this package is internal
4
+ and may change without notice; use the ``benchling-tools`` command or its MCP
5
+ server. To script Benchling from Python, use the official Benchling SDK:
6
+ https://docs.benchling.com/docs/getting-started-with-the-sdk
7
+ """
8
+
9
+ from .models import Envelope
10
+
11
+ __all__ = ["Envelope"]
12
+ __version__ = "0.7.0"
benchling_tools/api.py ADDED
@@ -0,0 +1,221 @@
1
+ """Async Benchling HTTP client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import asyncio
6
+ import random
7
+ from collections.abc import AsyncIterator
8
+ from typing import Any
9
+
10
+ import httpx
11
+
12
+ from .auth import AuthManager
13
+ from .errors import (
14
+ AccessError,
15
+ ApiDriftError,
16
+ AuthenticationError,
17
+ ConflictError,
18
+ NotFoundError,
19
+ PartialCompletionError,
20
+ UpstreamError,
21
+ ValidationError,
22
+ )
23
+ from .models import Environment
24
+ from .redact import redact_text
25
+ from .tls import verified_context
26
+
27
+
28
+ class APIPayload(dict[str, Any]):
29
+ """JSON object from Benchling, with the HTTP status kept beside the body.
30
+
31
+ The status is an attribute, not a key, so journals and callers that treat the
32
+ payload as the response body do not see it unless they read ``status_code``.
33
+ """
34
+
35
+ status_code: int
36
+
37
+ def __init__(self, body: dict[str, Any], status_code: int) -> None:
38
+ super().__init__(body)
39
+ self.status_code = status_code
40
+
41
+
42
+ class BenchlingAPI:
43
+ """Small V2/V3 client with read-only retries and normalized errors."""
44
+
45
+ def __init__(
46
+ self,
47
+ environment: Environment,
48
+ auth: AuthManager,
49
+ *,
50
+ http: httpx.AsyncClient | None = None,
51
+ download_transport: httpx.AsyncBaseTransport | None = None,
52
+ max_read_attempts: int = 3,
53
+ ) -> None:
54
+ self.environment = environment
55
+ self.auth = auth
56
+ self.http = http or httpx.AsyncClient(timeout=30.0, verify=verified_context())
57
+ self.download_transport = download_transport
58
+ self._owns_http = http is None
59
+ self.max_read_attempts = max_read_attempts
60
+
61
+ async def close(self) -> None:
62
+ """Close the HTTP client only if this instance created it."""
63
+ if self._owns_http:
64
+ await self.http.aclose()
65
+
66
+ async def request(
67
+ self,
68
+ method: str,
69
+ path: str,
70
+ *,
71
+ version: int = 3,
72
+ params: dict[str, Any] | None = None,
73
+ json: Any = None,
74
+ early_access: bool | None = None,
75
+ ) -> APIPayload:
76
+ """Send one request and return the decoded JSON object.
77
+
78
+ Only GET is retried. A non-GET with no confirmed response raises
79
+ PartialCompletionError because the write may have been applied.
80
+ """
81
+ method = method.upper()
82
+ if not path.startswith("/"):
83
+ raise ValidationError("API path must start with '/'")
84
+ base = f"{self.environment.base_url}/api/v{version}"
85
+ headers = {"Accept": "application/json", **self.auth.headers(self.environment)}
86
+ if version == 3 and early_access is not False:
87
+ headers["EARLY-ACCESS"] = "true"
88
+ attempts = self.max_read_attempts if method == "GET" else 1
89
+ response: httpx.Response | None = None
90
+ for attempt in range(attempts):
91
+ try:
92
+ response = await self.http.request(
93
+ method, f"{base}{path}", params=params, json=json, headers=headers
94
+ )
95
+ except (httpx.TimeoutException, httpx.NetworkError) as exc:
96
+ if method != "GET" or attempt + 1 >= attempts:
97
+ error_cls = PartialCompletionError if method != "GET" else UpstreamError
98
+ raise error_cls(
99
+ "Benchling request did not produce a confirmed response. Check the tenant URL.",
100
+ details={"method": method, "path": path, "reason": redact_text(str(exc))},
101
+ retryable=method == "GET",
102
+ ) from exc
103
+ await self._backoff(attempt, None)
104
+ continue
105
+ if (
106
+ method == "GET"
107
+ and response.status_code in {408, 429, 500, 502, 503, 504}
108
+ and attempt + 1 < attempts
109
+ ):
110
+ await self._backoff(attempt, response)
111
+ continue
112
+ break
113
+ assert response is not None
114
+ return self._decode(response, method=method, path=path)
115
+
116
+ async def paginate(
117
+ self,
118
+ path: str,
119
+ *,
120
+ version: int = 3,
121
+ params: dict[str, Any] | None = None,
122
+ item_key: str = "items",
123
+ max_items: int | None = None,
124
+ ) -> AsyncIterator[dict[str, Any]]:
125
+ """Yield items across nextToken pages, stopping at max_items.
126
+
127
+ Raises UpstreamError on a malformed page or a repeated token.
128
+ """
129
+ query = dict(params or {})
130
+ yielded = 0
131
+ seen_tokens: set[str] = set()
132
+ while True:
133
+ payload = await self.request("GET", path, version=version, params=query)
134
+ items = payload.get(item_key)
135
+ if not isinstance(items, list):
136
+ raise UpstreamError(
137
+ "Benchling pagination response has an unexpected shape",
138
+ details={"path": path, "expected_key": item_key, "keys": sorted(payload)},
139
+ )
140
+ for item in items:
141
+ if not isinstance(item, dict):
142
+ raise UpstreamError("Benchling returned a non-object list item")
143
+ yield item
144
+ yielded += 1
145
+ if max_items is not None and yielded >= max_items:
146
+ return
147
+ token = payload.get("nextToken")
148
+ if not token:
149
+ return
150
+ if token in seen_tokens:
151
+ raise UpstreamError(
152
+ "Benchling returned a repeated pagination token",
153
+ details={"path": path},
154
+ )
155
+ seen_tokens.add(token)
156
+ query["nextToken"] = token
157
+
158
+ async def _backoff(self, attempt: int, response: httpx.Response | None) -> None:
159
+ delay: float | None = None
160
+ if response is not None:
161
+ raw = response.headers.get("Retry-After")
162
+ try:
163
+ delay = min(float(raw), 10.0) if raw else None
164
+ except ValueError:
165
+ delay = None
166
+ if delay is None:
167
+ delay = min(0.25 * (2**attempt) + random.random() * 0.1, 2.0)
168
+ await asyncio.sleep(delay)
169
+
170
+ def _decode(self, response: httpx.Response, *, method: str, path: str) -> APIPayload:
171
+ payload: Any
172
+ if response.content:
173
+ try:
174
+ payload = response.json()
175
+ except ValueError:
176
+ payload = {"body": response.text[:2000]}
177
+ else:
178
+ payload = {}
179
+ details = {
180
+ "status": response.status_code,
181
+ "method": method,
182
+ "path": path,
183
+ "response": payload,
184
+ "request_id": response.headers.get("X-Request-ID"),
185
+ }
186
+ if response.status_code in {200, 201, 202, 204}:
187
+ if not isinstance(payload, dict):
188
+ raise UpstreamError(
189
+ "Benchling returned an unexpected response shape", details=details
190
+ )
191
+ return APIPayload(payload, response.status_code)
192
+ if response.status_code == 400:
193
+ raise ValidationError("Benchling rejected the request", details=details)
194
+ if response.status_code == 401:
195
+ raise AuthenticationError("Benchling authentication failed", details=details)
196
+ if response.status_code == 403:
197
+ raise AccessError("Benchling denied access", details=details)
198
+ if response.status_code == 404:
199
+ raise NotFoundError("Benchling resource was not found", details=details)
200
+ if response.status_code == 405:
201
+ allow = response.headers.get("Allow")
202
+ if allow:
203
+ details["allow"] = allow
204
+ raise ApiDriftError(
205
+ "This endpoint no longer supports this method. The Benchling API has drifted from this client.",
206
+ details=details,
207
+ )
208
+ if response.status_code == 409:
209
+ raise ConflictError("The Benchling resource changed since it was read", details=details)
210
+ if response.status_code == 429:
211
+ raise UpstreamError("Benchling rate limit exceeded", details=details, retryable=True)
212
+ if response.status_code >= 500 and method != "GET":
213
+ raise PartialCompletionError(
214
+ "Benchling returned a server error after receiving a write request; completion is unknown",
215
+ details=details,
216
+ )
217
+ if response.status_code >= 500:
218
+ raise UpstreamError(
219
+ "Benchling returned a server error", details=details, retryable=True
220
+ )
221
+ raise UpstreamError("Unexpected Benchling response", details=details)
@@ -0,0 +1,133 @@
1
+ """OAuth client-credentials token handling."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import threading
6
+ from collections.abc import Mapping
7
+ from datetime import UTC, datetime, timedelta
8
+ from typing import Any
9
+
10
+ import httpx
11
+
12
+ from .errors import AuthenticationError, UpstreamError
13
+ from .models import Environment, TokenBundle
14
+ from .redact import redact_text, register_secret
15
+ from .tls import verified_context
16
+
17
+
18
+ class AuthManager:
19
+ """Client-credentials auth with an in-memory, per-environment token cache."""
20
+
21
+ def __init__(
22
+ self,
23
+ secrets: Mapping[str, str],
24
+ *,
25
+ http: httpx.Client | None = None,
26
+ ) -> None:
27
+ self.secrets = dict(secrets)
28
+ for secret in self.secrets.values():
29
+ register_secret(secret)
30
+ self.http = http or httpx.Client(timeout=30.0, verify=verified_context())
31
+ self._owns_http = http is None
32
+ self._app_tokens: dict[tuple[str, str, str | None], TokenBundle] = {}
33
+ self._app_lock = threading.Lock()
34
+
35
+ def close(self) -> None:
36
+ """Close the HTTP client only if this manager created it."""
37
+ if self._owns_http:
38
+ self.http.close()
39
+
40
+ def headers(self, environment: Environment) -> dict[str, str]:
41
+ """Return a Bearer Authorization header, fetching a token if the cache is empty or expired.
42
+
43
+ Raises AuthenticationError when credentials are missing or rejected.
44
+ """
45
+ return self._app_headers(environment)
46
+
47
+ def status(self, environment: Environment) -> dict[str, Any]:
48
+ """Describe credential state without network calls or exposing secrets."""
49
+ bundle = self._app_tokens.get(
50
+ (environment.name, environment.base_url, environment.client_id)
51
+ )
52
+ secret_present = bool(self.secrets.get(environment.name))
53
+ return {
54
+ "env": environment.name,
55
+ "method": environment.auth_method.value,
56
+ "configured": bool(environment.client_id and secret_present),
57
+ "secret_present": secret_present,
58
+ "tenant_url": environment.base_url,
59
+ "client_id": environment.client_id,
60
+ "credential_source": "keyring",
61
+ "identity": "app",
62
+ "access_token_cached": bundle.usable() if bundle else False,
63
+ }
64
+
65
+ def _app_headers(self, environment: Environment) -> dict[str, str]:
66
+ # Client credentials issue no refresh token. A long-lived MCP process
67
+ # requests a new access token on expiry; each CLI has its own cache.
68
+ with self._app_lock:
69
+ cache_key = (environment.name, environment.base_url, environment.client_id)
70
+ bundle = self._app_tokens.get(cache_key)
71
+ if bundle and bundle.usable():
72
+ return {"Authorization": f"Bearer {bundle.access_token}"}
73
+ secret = self.secrets.get(environment.name)
74
+ if not secret or not environment.client_id:
75
+ raise AuthenticationError("App client credentials are missing")
76
+ payload = self._token_request(
77
+ environment,
78
+ {
79
+ "grant_type": "client_credentials",
80
+ "client_id": environment.client_id,
81
+ "client_secret": secret,
82
+ },
83
+ )
84
+ bundle = self._bundle(payload)
85
+ if bundle.token_type.lower() != "bearer":
86
+ raise UpstreamError("Benchling returned an unsupported token type")
87
+ self._app_tokens[cache_key] = bundle
88
+ return {"Authorization": f"Bearer {bundle.access_token}"}
89
+
90
+ def _token_request(self, environment: Environment, data: dict[str, str]) -> dict[str, Any]:
91
+ identity = {"env": environment.name, "tenant_url": environment.base_url}
92
+ try:
93
+ response = self.http.post(
94
+ f"{environment.base_url}/oauth/token",
95
+ data=data,
96
+ headers={"Accept": "application/json"},
97
+ )
98
+ except httpx.HTTPError as exc:
99
+ raise UpstreamError(
100
+ "Could not reach the Benchling token endpoint. Check the tenant URL.",
101
+ details={**identity, "reason": redact_text(str(exc))},
102
+ retryable=True,
103
+ ) from exc
104
+ if response.status_code == 401:
105
+ raise AuthenticationError(
106
+ f"Benchling at {environment.base_url} rejected the client ID or secret.",
107
+ details={**identity, "status": response.status_code},
108
+ )
109
+ if response.status_code >= 400:
110
+ raise AuthenticationError(
111
+ "Benchling rejected authentication",
112
+ details={**identity, "status": response.status_code},
113
+ )
114
+ try:
115
+ token_response: dict[str, Any] = response.json()
116
+ return token_response
117
+ except ValueError as exc:
118
+ raise UpstreamError("Benchling returned an invalid token response") from exc
119
+
120
+ def _bundle(self, payload: dict[str, Any]) -> TokenBundle:
121
+ if not payload.get("access_token") or not payload.get("expires_in"):
122
+ raise UpstreamError(
123
+ "Benchling returned an incomplete token response",
124
+ details={"keys": sorted(payload)},
125
+ )
126
+ access_token = str(payload["access_token"])
127
+ register_secret(access_token)
128
+ now = datetime.now(UTC)
129
+ return TokenBundle(
130
+ access_token=access_token,
131
+ token_type=payload.get("token_type", "Bearer"),
132
+ expires_at=now + timedelta(seconds=int(payload["expires_in"])),
133
+ )
@@ -0,0 +1,197 @@
1
+ """Stream and verify blob downloads before publishing a local file."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ import ipaddress
7
+ import os
8
+ import re
9
+ import tempfile
10
+ from pathlib import Path
11
+ from typing import Any
12
+ from urllib.parse import quote
13
+
14
+ import httpx
15
+
16
+ from .errors import (
17
+ ChecksumMismatchError,
18
+ ConflictError,
19
+ SizeMismatchError,
20
+ UpstreamError,
21
+ ValidationError,
22
+ )
23
+ from .services import BenchlingService
24
+ from .tls import verified_context
25
+
26
+
27
+ def _reference(path: str) -> tuple[int, str, str]:
28
+ sha256 = hashlib.sha256()
29
+ md5 = hashlib.md5(usedforsecurity=False)
30
+ size = 0
31
+ try:
32
+ with open(path, "rb") as source:
33
+ while chunk := source.read(1024 * 1024):
34
+ size += len(chunk)
35
+ sha256.update(chunk)
36
+ md5.update(chunk)
37
+ except OSError as exc:
38
+ raise ValidationError("Cannot read the comparison file", details={"path": path}) from exc
39
+ return size, sha256.hexdigest(), md5.hexdigest()
40
+
41
+
42
+ def _download_url(value: Any) -> str:
43
+ if not isinstance(value, str):
44
+ raise UpstreamError("Benchling did not provide a download URL")
45
+ try:
46
+ url = httpx.URL(value)
47
+ if (
48
+ url.scheme != "https"
49
+ or not url.host
50
+ or url.username
51
+ or url.password
52
+ or url.fragment
53
+ or url.host.lower().rstrip(".") == "localhost"
54
+ or url.host.lower().rstrip(".").endswith(".localhost")
55
+ ):
56
+ raise ValueError
57
+ try:
58
+ address = ipaddress.ip_address(url.host)
59
+ except ValueError:
60
+ address = None
61
+ if address is not None and not address.is_global:
62
+ raise ValueError
63
+ except (ValueError, httpx.InvalidURL) as exc:
64
+ raise UpstreamError("Benchling returned an unsafe download URL") from exc
65
+ return value
66
+
67
+
68
+ async def download_blob(
69
+ service: BenchlingService,
70
+ identifier: str,
71
+ output: str,
72
+ *,
73
+ expect_sha256: str | None = None,
74
+ expect_md5: str | None = None,
75
+ expect_size: int | None = None,
76
+ compare: str | None = None,
77
+ force: bool = False,
78
+ ) -> dict[str, Any]:
79
+ """Download to a temporary file and publish only after all supplied checks pass."""
80
+ for label, digest, length in (("sha256", expect_sha256, 64), ("md5", expect_md5, 32)):
81
+ if digest is not None and (
82
+ not isinstance(digest, str) or not re.fullmatch(rf"[0-9a-fA-F]{{{length}}}", digest)
83
+ ):
84
+ raise ValidationError(f"Expected {label} must be {length} hexadecimal characters")
85
+ if expect_size is not None and (
86
+ isinstance(expect_size, bool) or not isinstance(expect_size, int) or expect_size < 0
87
+ ):
88
+ raise ValidationError("Expected size must be a non-negative integer")
89
+ if not isinstance(output, str) or not output.strip():
90
+ raise ValidationError("Output path is required")
91
+ if not isinstance(force, bool):
92
+ raise ValidationError("force must be true or false")
93
+ if compare is not None and (not isinstance(compare, str) or not compare.strip()):
94
+ raise ValidationError("Comparison path must be a non-empty string")
95
+ reference = _reference(compare) if compare is not None else None
96
+ destination = Path(output)
97
+ if not force and os.path.lexists(destination):
98
+ raise ConflictError("Output file already exists", details={"path": output})
99
+
100
+ blob_id, namespace, metadata = await service._blob_metadata(identifier)
101
+ if namespace == "v3_attachment":
102
+ url = metadata.get("downloadUrl")
103
+ else:
104
+ url_response = await service.api.request(
105
+ "GET", f"/blobs/{quote(blob_id, safe='')}/download-url", version=2
106
+ )
107
+ url = url_response.get("downloadURL")
108
+ url = _download_url(url)
109
+
110
+ temp_path: str | None = None
111
+ size = 0
112
+ sha256 = hashlib.sha256()
113
+ md5 = hashlib.md5(usedforsecurity=False)
114
+ try:
115
+ with tempfile.NamedTemporaryFile(
116
+ dir=destination.parent, prefix=".benchling-tools-", delete=False
117
+ ) as temp:
118
+ temp_path = temp.name
119
+ request = httpx.Request(
120
+ "GET",
121
+ url,
122
+ headers={"Accept-Encoding": "identity"},
123
+ extensions={"timeout": dict.fromkeys(("connect", "read", "write", "pool"), 30.0)},
124
+ )
125
+ transport = service.api.download_transport or httpx.AsyncHTTPTransport(
126
+ verify=verified_context(), retries=0
127
+ )
128
+ try:
129
+ response = await transport.handle_async_request(request)
130
+ try:
131
+ if response.status_code != 200:
132
+ raise UpstreamError(
133
+ "Blob download failed", details={"status": response.status_code}
134
+ )
135
+ async for chunk in response.aiter_raw():
136
+ temp.write(chunk)
137
+ size += len(chunk)
138
+ sha256.update(chunk)
139
+ md5.update(chunk)
140
+ finally:
141
+ await response.aclose()
142
+ except httpx.HTTPError as exc:
143
+ raise UpstreamError("Blob download failed", retryable=True) from exc
144
+ finally:
145
+ if service.api.download_transport is None:
146
+ await transport.aclose()
147
+ sha = sha256.hexdigest()
148
+ md = md5.hexdigest()
149
+ sizes = [
150
+ item for item in (expect_size, reference[0] if reference else None) if item is not None
151
+ ]
152
+ if any(size != item for item in sizes):
153
+ raise SizeMismatchError("Downloaded size does not match the expected size")
154
+ for actual, expected, ref in (
155
+ (sha, expect_sha256, reference[1] if reference else None),
156
+ (md, expect_md5, reference[2] if reference else None),
157
+ ):
158
+ if any(actual != item.lower() for item in (expected, ref) if item is not None):
159
+ raise ChecksumMismatchError(
160
+ "Downloaded checksum does not match the expected checksum"
161
+ )
162
+ if force:
163
+ os.replace(temp_path, destination)
164
+ else:
165
+ try:
166
+ os.link(temp_path, destination)
167
+ except FileExistsError as exc:
168
+ raise ConflictError("Output file already exists", details={"path": output}) from exc
169
+ os.unlink(temp_path)
170
+ temp_path = None
171
+ except OSError as exc:
172
+ raise ValidationError("Cannot write the output file", details={"path": output}) from exc
173
+ finally:
174
+ if temp_path is not None:
175
+ try:
176
+ os.unlink(temp_path)
177
+ except FileNotFoundError:
178
+ pass
179
+
180
+ summary: dict[str, Any] = {
181
+ "id": blob_id,
182
+ "id_namespace": namespace,
183
+ "path": output,
184
+ "size": size,
185
+ "sha256": sha,
186
+ "md5": md,
187
+ "verified": any(
188
+ value is not None for value in (expect_sha256, expect_md5, expect_size, compare)
189
+ ),
190
+ }
191
+ if isinstance(metadata.get("blobId"), str):
192
+ summary["blob_id"] = metadata["blobId"]
193
+ if not summary["verified"]:
194
+ summary["verification_hint"] = (
195
+ "Use --expect-sha256, --expect-md5, --expect-size or --compare."
196
+ )
197
+ return summary