simulo-interfaces 0.13.0__tar.gz → 0.15.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 (59) hide show
  1. {simulo_interfaces-0.13.0/src/simulo_interfaces.egg-info → simulo_interfaces-0.15.2}/PKG-INFO +1 -1
  2. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/pyproject.toml +1 -1
  3. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/__init__.py +16 -0
  4. simulo_interfaces-0.15.2/src/simulo/interfaces/ids.py +134 -0
  5. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/__init__.py +171 -0
  6. simulo_interfaces-0.15.2/src/simulo/interfaces/platform/_payload.py +15 -0
  7. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/artifacts.py +238 -47
  8. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/enums.py +3 -3
  9. simulo_interfaces-0.15.2/src/simulo/interfaces/platform/job_events.py +244 -0
  10. simulo_interfaces-0.15.2/src/simulo/interfaces/platform/policy_bundle.py +2100 -0
  11. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/runs.py +69 -4
  12. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/submit.py +87 -8
  13. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2/src/simulo_interfaces.egg-info}/PKG-INFO +1 -1
  14. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo_interfaces.egg-info/SOURCES.txt +3 -0
  15. simulo_interfaces-0.13.0/src/simulo/interfaces/ids.py +0 -24
  16. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/MANIFEST.in +0 -0
  17. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/PYPI.md +0 -0
  18. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/setup.cfg +0 -0
  19. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/__init__.py +0 -0
  20. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/actuator.py +0 -0
  21. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/asset.py +0 -0
  22. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/entity.py +0 -0
  23. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/light.py +0 -0
  24. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/materials.py +0 -0
  25. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/physics.py +0 -0
  26. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/pose.py +0 -0
  27. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/primitives.py +0 -0
  28. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/prop.py +0 -0
  29. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/record.py +0 -0
  30. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/robot.py +0 -0
  31. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/scene.py +0 -0
  32. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/sensor.py +0 -0
  33. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/terrain.py +0 -0
  34. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/visual.py +0 -0
  35. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/authoring/world.py +0 -0
  36. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/exceptions.py +0 -0
  37. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/app.py +0 -0
  38. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/asset.py +0 -0
  39. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/asset_catalog.py +0 -0
  40. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/callbacks.py +0 -0
  41. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/debug.py +0 -0
  42. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/domain.py +0 -0
  43. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/manifest.py +0 -0
  44. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/runtime.py +0 -0
  45. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/platform/volume.py +0 -0
  46. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/py.typed +0 -0
  47. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/__init__.py +0 -0
  48. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/anomaly.py +0 -0
  49. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/components.py +0 -0
  50. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/env.py +0 -0
  51. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/player.py +0 -0
  52. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/policy.py +0 -0
  53. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/scenario.py +0 -0
  54. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/task.py +0 -0
  55. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/tensors.py +0 -0
  56. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo/interfaces/runtime/trainer.py +0 -0
  57. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo_interfaces.egg-info/dependency_links.txt +0 -0
  58. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo_interfaces.egg-info/requires.txt +0 -0
  59. {simulo_interfaces-0.13.0 → simulo_interfaces-0.15.2}/src/simulo_interfaces.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simulo-interfaces
3
- Version: 0.13.0
3
+ Version: 0.15.2
4
4
  Summary: Type contracts for the Simulo SDK. Installed automatically as a dependency of the simulo package.
5
5
  Author-email: Simulo Team <team@simulo.ai>
6
6
  License: BSD-3-Clause
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simulo-interfaces"
7
- version = "0.13.0"
7
+ version = "0.15.2"
8
8
  description = "Type contracts for the Simulo SDK. Installed automatically as a dependency of the simulo package."
9
9
  readme = "PYPI.md"
10
10
  requires-python = ">=3.11"
@@ -31,13 +31,21 @@ from simulo.interfaces.ids import (
31
31
  CheckpointId,
32
32
  Digest,
33
33
  JobId,
34
+ JobPublicId,
35
+ ModelPublicId,
34
36
  OrganizationId,
37
+ OutputPublicId,
35
38
  PackageId,
36
39
  ProjectId,
40
+ RecordingPublicId,
37
41
  ResourceId,
38
42
  ResourceUri,
39
43
  TagId,
40
44
  TrainedModelId,
45
+ parse_job_public_id,
46
+ parse_model_public_id,
47
+ parse_output_public_id,
48
+ parse_recording_public_id,
41
49
  )
42
50
 
43
51
  __all__ = [
@@ -56,6 +64,14 @@ __all__ = [
56
64
  "ProjectId",
57
65
  "PackageId",
58
66
  "JobId",
67
+ "JobPublicId",
68
+ "ModelPublicId",
69
+ "RecordingPublicId",
70
+ "OutputPublicId",
71
+ "parse_job_public_id",
72
+ "parse_model_public_id",
73
+ "parse_recording_public_id",
74
+ "parse_output_public_id",
59
75
  "ResourceId",
60
76
  "CheckpointId",
61
77
  "TrainedModelId",
@@ -0,0 +1,134 @@
1
+ """Strongly-typed string identifiers for the platform domain model (Part B).
2
+
3
+ ``NewType`` aliases — zero runtime cost (each is the underlying ``str`` at
4
+ runtime) but distinct to the type checker, so a ``ProjectId`` can never be
5
+ passed where a ``JobId`` is expected.
6
+
7
+ The ``*PublicId`` aliases identify grammar-validated human-facing references.
8
+ Their parsers normalize only outer ASCII whitespace and ASCII letter case;
9
+ Unicode whitespace, Unicode case folding, wildcards, and partial IDs are
10
+ deliberately rejected.
11
+ """
12
+
13
+ import re
14
+ from typing import NewType
15
+
16
+ OrganizationId = NewType("OrganizationId", str)
17
+ ProjectId = NewType("ProjectId", str)
18
+ PackageId = NewType("PackageId", str)
19
+ JobId = NewType("JobId", str)
20
+ ResourceId = NewType("ResourceId", str)
21
+ CheckpointId = NewType("CheckpointId", str)
22
+ TrainedModelId = NewType("TrainedModelId", str)
23
+ TagId = NewType("TagId", str)
24
+ ResourceUri = NewType("ResourceUri", str) # e.g. "robot/so-arm-100:v3"
25
+ Digest = NewType("Digest", str) # content-addressed package source digest
26
+ RecordingId = NewType("RecordingId", str) # a job-produced MCAP recording (PR-0 wire contract)
27
+ WorkerId = NewType("WorkerId", str) # a claiming worker process (PR-0 wire contract)
28
+ AssetId = NewType("AssetId", str) # a catalog asset (USD Asset Catalogs wire contract, PR-1)
29
+ AssetVersionId = NewType("AssetVersionId", str) # one immutable asset version (PR-1)
30
+ ArtifactId = NewType("ArtifactId", str) # a job-produced output in the /artifacts projection (Plan B)
31
+
32
+ JobPublicId = NewType("JobPublicId", str)
33
+ ModelPublicId = NewType("ModelPublicId", str)
34
+ RecordingPublicId = NewType("RecordingPublicId", str)
35
+ OutputPublicId = NewType("OutputPublicId", str)
36
+
37
+ _ASCII_WHITESPACE = " \t\n\r\v\f"
38
+ _ASCII_LOWERCASE_TRANSLATION = str.maketrans(
39
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
40
+ "abcdefghijklmnopqrstuvwxyz",
41
+ )
42
+ _JOB_STEM_PATTERN = r"[a-z]{3,10}-[a-z]{3,10}-[0-9a-hjkmnp-tv-z]{6}"
43
+ _CANONICAL_CHILD_COUNTER_PATTERN = r"(?:(?!0000)[0-9]{4}|[1-9][0-9]{4,})"
44
+ _JOB_PUBLIC_ID_RE = re.compile(rf"job_{_JOB_STEM_PATTERN}\Z")
45
+ _MODEL_PUBLIC_ID_RE = re.compile(rf"mdl_{_JOB_STEM_PATTERN}-{_CANONICAL_CHILD_COUNTER_PATTERN}\Z")
46
+ _RECORDING_PUBLIC_ID_RE = re.compile(rf"rec_{_JOB_STEM_PATTERN}-{_CANONICAL_CHILD_COUNTER_PATTERN}\Z")
47
+ _OUTPUT_PUBLIC_ID_RE = re.compile(rf"out_{_JOB_STEM_PATTERN}-{_CANONICAL_CHILD_COUNTER_PATTERN}\Z")
48
+ _MAX_JOB_PUBLIC_ID_LENGTH = 32
49
+ _MAX_CHILD_PUBLIC_ID_LENGTH = 64
50
+
51
+
52
+ def _normalize_public_id(value: str, *, parser: str) -> str:
53
+ if not isinstance(value, str):
54
+ raise TypeError(f"{parser}() requires a str, got {type(value).__name__}.")
55
+ return value.strip(_ASCII_WHITESPACE).translate(_ASCII_LOWERCASE_TRANSLATION)
56
+
57
+
58
+ def _parse_public_id(value: str, *, parser: str, pattern: re.Pattern[str], max_length: int) -> str:
59
+ normalized = _normalize_public_id(value, parser=parser)
60
+ if len(normalized) > max_length or pattern.fullmatch(normalized) is None:
61
+ raise ValueError(f"{parser}() received a non-canonical public ID.")
62
+ return normalized
63
+
64
+
65
+ def parse_job_public_id(value: str) -> JobPublicId:
66
+ """Return a canonical Job ID such as ``job_quiet-cedar-7k3m4q``.
67
+
68
+ Only outer ASCII whitespace is trimmed and only ASCII ``A-Z`` is
69
+ lowercased. Matching is exact: prefixes, partial values, wildcards, and
70
+ non-ASCII input are rejected.
71
+ """
72
+
73
+ return JobPublicId(
74
+ _parse_public_id(
75
+ value,
76
+ parser="parse_job_public_id",
77
+ pattern=_JOB_PUBLIC_ID_RE,
78
+ max_length=_MAX_JOB_PUBLIC_ID_LENGTH,
79
+ )
80
+ )
81
+
82
+
83
+ def parse_model_public_id(value: str) -> ModelPublicId:
84
+ """Return a canonical Model ID such as ``mdl_quiet-cedar-7k3m4q-0001``.
85
+
86
+ Only outer ASCII whitespace is trimmed and only ASCII ``A-Z`` is
87
+ lowercased. Matching is exact and non-ASCII input is rejected. Counters
88
+ use exactly four digits through ``9999`` and expand unpadded at ``10000``.
89
+ """
90
+
91
+ return ModelPublicId(
92
+ _parse_public_id(
93
+ value,
94
+ parser="parse_model_public_id",
95
+ pattern=_MODEL_PUBLIC_ID_RE,
96
+ max_length=_MAX_CHILD_PUBLIC_ID_LENGTH,
97
+ )
98
+ )
99
+
100
+
101
+ def parse_recording_public_id(value: str) -> RecordingPublicId:
102
+ """Return a Recording ID such as ``rec_quiet-cedar-7k3m4q-0001``.
103
+
104
+ Only outer ASCII whitespace is trimmed and only ASCII ``A-Z`` is
105
+ lowercased. Matching is exact and non-ASCII input is rejected. Counters
106
+ use exactly four digits through ``9999`` and expand unpadded at ``10000``.
107
+ """
108
+
109
+ return RecordingPublicId(
110
+ _parse_public_id(
111
+ value,
112
+ parser="parse_recording_public_id",
113
+ pattern=_RECORDING_PUBLIC_ID_RE,
114
+ max_length=_MAX_CHILD_PUBLIC_ID_LENGTH,
115
+ )
116
+ )
117
+
118
+
119
+ def parse_output_public_id(value: str) -> OutputPublicId:
120
+ """Return an Output ID such as ``out_quiet-cedar-7k3m4q-0001``.
121
+
122
+ Only outer ASCII whitespace is trimmed and only ASCII ``A-Z`` is
123
+ lowercased. Matching is exact and non-ASCII input is rejected. Counters
124
+ use exactly four digits through ``9999`` and expand unpadded at ``10000``.
125
+ """
126
+
127
+ return OutputPublicId(
128
+ _parse_public_id(
129
+ value,
130
+ parser="parse_output_public_id",
131
+ pattern=_OUTPUT_PUBLIC_ID_RE,
132
+ max_length=_MAX_CHILD_PUBLIC_ID_LENGTH,
133
+ )
134
+ )
@@ -16,7 +16,10 @@ from simulo.interfaces.platform.artifacts import (
16
16
  MAX_OUTPUT_FLAG_CODE_CHARS,
17
17
  MAX_OUTPUT_FLAG_DETAIL_CHARS,
18
18
  MAX_OUTPUTS_BYTES,
19
+ OUTPUT_DROPPED_DETAILS,
19
20
  OUTPUT_FLAG_ANOMALY,
21
+ OUTPUT_FLAG_OUTPUT_DROPPED,
22
+ OUTPUTS_UNDELIVERED_CODE,
20
23
  WORKER_JOB_ARTIFACTS_PRESIGN_ROUTE_TEMPLATE,
21
24
  WORKER_JOB_ARTIFACTS_ROUTE_TEMPLATE,
22
25
  Artifact,
@@ -97,6 +100,34 @@ from simulo.interfaces.platform.callbacks import JobCallbackProtocol
97
100
  from simulo.interfaces.platform.debug import DebugSessionProtocol, ReplaySessionProtocol, VisualizationSessionProtocol
98
101
  from simulo.interfaces.platform.domain import Checkpoint, Job, Package, Project, Resource, Tag, TrainedModel
99
102
  from simulo.interfaces.platform.enums import ArtifactKind
103
+ from simulo.interfaces.platform.job_events import (
104
+ MAX_PUBLIC_ASSET_FINDING_COUNT,
105
+ MAX_PUBLIC_JOB_EVENT_ATTEMPT,
106
+ MAX_PUBLIC_JOB_EVENT_BYTES,
107
+ MAX_PUBLIC_JOB_EVENT_ENTRIES,
108
+ MAX_PUBLIC_JOB_EVENT_QUIET_SECONDS,
109
+ MAX_PUBLIC_JOB_EVENT_WIRE_BYTES,
110
+ PUBLIC_JOB_EVENT_ATTEMPT_MISMATCH_CODE,
111
+ PUBLIC_JOB_EVENT_OFFSET_CONFLICT_CODE,
112
+ PUBLIC_JOB_EVENT_OFFSET_GAP_CODE,
113
+ PUBLIC_JOB_EVENT_SCHEMA_VERSION,
114
+ PUBLIC_JOB_SUPPORT_ID_HEX_CHARS,
115
+ PUBLIC_JOB_SUPPORT_ID_PREFIX,
116
+ WORKER_JOB_EVENTS_ROUTE_TEMPLATE,
117
+ JobAssetFindingData,
118
+ JobAssetFindingEvent,
119
+ JobPreparingData,
120
+ JobPreparingEvent,
121
+ JobRunningData,
122
+ JobRunningEvent,
123
+ JobStillWorkingData,
124
+ JobStillWorkingEvent,
125
+ PublicAssetFindingReason,
126
+ PublicJobEvent,
127
+ PublicJobEventCode,
128
+ PublicJobEventSeverity,
129
+ PublicJobPreparationPhase,
130
+ )
100
131
  from simulo.interfaces.platform.manifest import (
101
132
  FINDING_CLASSIFICATIONS,
102
133
  MAX_PREFLIGHT_BODY_BYTES,
@@ -109,6 +140,60 @@ from simulo.interfaces.platform.manifest import (
109
140
  PreflightResponse,
110
141
  RuntimeManifest,
111
142
  )
143
+ from simulo.interfaces.platform.policy_bundle import (
144
+ EXPORT_VALIDATION_JOB_TYPE,
145
+ JOB_EXPORTS_ROUTE_TEMPLATE,
146
+ MAX_POLICY_BUNDLE_UNCOMPRESSED_BYTES,
147
+ MAX_POLICY_NAME_TOKEN_CHARS,
148
+ POLICY_BUNDLE_ACTION_SCHEMA_FILE,
149
+ POLICY_BUNDLE_ARCHIVE_NAME_TEMPLATE,
150
+ POLICY_BUNDLE_ARTIFACT_KIND,
151
+ POLICY_BUNDLE_FILES,
152
+ POLICY_BUNDLE_MANIFEST_FILE,
153
+ POLICY_BUNDLE_MODEL_ONNX_FILE,
154
+ POLICY_BUNDLE_MODEL_PT_FILE,
155
+ POLICY_BUNDLE_NORMALIZATION_FILE,
156
+ POLICY_BUNDLE_OBSERVATION_SCHEMA_FILE,
157
+ POLICY_BUNDLE_OPTIONAL_FILES,
158
+ POLICY_BUNDLE_README_FILE,
159
+ POLICY_BUNDLE_REQUIRED_FILES,
160
+ POLICY_BUNDLE_REQUIREMENTS_FILE,
161
+ POLICY_BUNDLE_ROOT_DIR_TEMPLATE,
162
+ POLICY_BUNDLE_SCHEMA_VERSION,
163
+ POLICY_BUNDLE_TEST_VECTORS_FILE,
164
+ POLICY_BUNDLE_VERIFY_FILE,
165
+ POLICY_EQUIVALENCE_ABS_TOLERANCE,
166
+ POLICY_EQUIVALENCE_REL_TOLERANCE,
167
+ POLICY_GOLDEN_VECTOR_COUNT,
168
+ POLICY_NAME_TOKEN_FALLBACK,
169
+ POLICY_TENSOR_DTYPES,
170
+ POLICY_TEST_VECTOR_EXPECTED_OUTPUTS_KEY,
171
+ POLICY_TEST_VECTOR_INPUTS_KEY,
172
+ SUPPORTED_POLICY_BUNDLE_SCHEMA_MAJORS,
173
+ UNKNOWN,
174
+ PolicyActionComponent,
175
+ PolicyActionSchema,
176
+ PolicyBounds,
177
+ PolicyBundleManifest,
178
+ PolicyEquivalenceSpec,
179
+ PolicyExportFailureReason,
180
+ PolicyExportFormat,
181
+ PolicyExportValidation,
182
+ PolicyExportVerdict,
183
+ PolicyHistorySpec,
184
+ PolicyNormalization,
185
+ PolicyObservationComponent,
186
+ PolicyObservationSchema,
187
+ PolicySourceSpec,
188
+ PolicyTensorSpec,
189
+ Unknown,
190
+ is_supported_policy_bundle_schema,
191
+ policy_bundle_archive_name,
192
+ policy_bundle_root_dir,
193
+ policy_bundle_schema_major,
194
+ policy_name_token,
195
+ validate_policy_bundle,
196
+ )
112
197
  from simulo.interfaces.platform.runs import (
113
198
  JOB_CANCEL_ROUTE_TEMPLATE,
114
199
  JOB_LIST_SCOPES,
@@ -164,6 +249,33 @@ from simulo.interfaces.platform.volume import VolumeProtocol
164
249
  __all__ = [
165
250
  # enums
166
251
  "ArtifactKind",
252
+ # closed public job-event contract (#656)
253
+ "PUBLIC_JOB_EVENT_SCHEMA_VERSION",
254
+ "WORKER_JOB_EVENTS_ROUTE_TEMPLATE",
255
+ "MAX_PUBLIC_JOB_EVENT_BYTES",
256
+ "MAX_PUBLIC_JOB_EVENT_WIRE_BYTES",
257
+ "MAX_PUBLIC_JOB_EVENT_ENTRIES",
258
+ "MAX_PUBLIC_JOB_EVENT_ATTEMPT",
259
+ "MAX_PUBLIC_JOB_EVENT_QUIET_SECONDS",
260
+ "MAX_PUBLIC_ASSET_FINDING_COUNT",
261
+ "PUBLIC_JOB_SUPPORT_ID_PREFIX",
262
+ "PUBLIC_JOB_SUPPORT_ID_HEX_CHARS",
263
+ "PUBLIC_JOB_EVENT_OFFSET_GAP_CODE",
264
+ "PUBLIC_JOB_EVENT_OFFSET_CONFLICT_CODE",
265
+ "PUBLIC_JOB_EVENT_ATTEMPT_MISMATCH_CODE",
266
+ "PublicJobEventSeverity",
267
+ "PublicJobEventCode",
268
+ "PublicJobPreparationPhase",
269
+ "PublicAssetFindingReason",
270
+ "JobPreparingData",
271
+ "JobRunningData",
272
+ "JobStillWorkingData",
273
+ "JobAssetFindingData",
274
+ "JobPreparingEvent",
275
+ "JobRunningEvent",
276
+ "JobStillWorkingEvent",
277
+ "JobAssetFindingEvent",
278
+ "PublicJobEvent",
167
279
  # domain dataclasses
168
280
  "Tag",
169
281
  "Project",
@@ -201,6 +313,9 @@ __all__ = [
201
313
  "MAX_OUTPUT_FLAG_CODE_CHARS",
202
314
  "MAX_OUTPUT_FLAG_DETAIL_CHARS",
203
315
  "OUTPUT_FLAG_ANOMALY",
316
+ "OUTPUT_FLAG_OUTPUT_DROPPED",
317
+ "OUTPUT_DROPPED_DETAILS",
318
+ "OUTPUTS_UNDELIVERED_CODE",
204
319
  "DECLARED_OUTPUT_MISSING_CODE",
205
320
  # job-run contract (run record schema + jobs HTTP API shape)
206
321
  "TERMINAL_JOB_STATUSES",
@@ -322,6 +437,62 @@ __all__ = [
322
437
  "ConvertedArchive",
323
438
  "AssetValidationFinalize",
324
439
  "AssetPublishOptions",
440
+ # portable policy export bundle contract (issue #654) — schema version,
441
+ # bundle layout, naming rule, export routes/job type, equivalence
442
+ # defaults, enums, explicit-unknown marker, manifest dataclasses, the
443
+ # export-validation result, and the cross-file coherence check
444
+ "POLICY_BUNDLE_SCHEMA_VERSION",
445
+ "SUPPORTED_POLICY_BUNDLE_SCHEMA_MAJORS",
446
+ "policy_bundle_schema_major",
447
+ "is_supported_policy_bundle_schema",
448
+ "POLICY_BUNDLE_MODEL_ONNX_FILE",
449
+ "POLICY_BUNDLE_MODEL_PT_FILE",
450
+ "POLICY_BUNDLE_MANIFEST_FILE",
451
+ "POLICY_BUNDLE_OBSERVATION_SCHEMA_FILE",
452
+ "POLICY_BUNDLE_ACTION_SCHEMA_FILE",
453
+ "POLICY_BUNDLE_NORMALIZATION_FILE",
454
+ "POLICY_BUNDLE_TEST_VECTORS_FILE",
455
+ "POLICY_BUNDLE_VERIFY_FILE",
456
+ "POLICY_BUNDLE_REQUIREMENTS_FILE",
457
+ "POLICY_BUNDLE_README_FILE",
458
+ "POLICY_BUNDLE_FILES",
459
+ "POLICY_BUNDLE_REQUIRED_FILES",
460
+ "POLICY_BUNDLE_OPTIONAL_FILES",
461
+ "MAX_POLICY_BUNDLE_UNCOMPRESSED_BYTES",
462
+ "POLICY_TEST_VECTOR_INPUTS_KEY",
463
+ "POLICY_TEST_VECTOR_EXPECTED_OUTPUTS_KEY",
464
+ "POLICY_BUNDLE_ARTIFACT_KIND",
465
+ "POLICY_BUNDLE_ROOT_DIR_TEMPLATE",
466
+ "POLICY_BUNDLE_ARCHIVE_NAME_TEMPLATE",
467
+ "MAX_POLICY_NAME_TOKEN_CHARS",
468
+ "POLICY_NAME_TOKEN_FALLBACK",
469
+ "policy_name_token",
470
+ "policy_bundle_root_dir",
471
+ "policy_bundle_archive_name",
472
+ "JOB_EXPORTS_ROUTE_TEMPLATE",
473
+ "EXPORT_VALIDATION_JOB_TYPE",
474
+ "POLICY_EQUIVALENCE_ABS_TOLERANCE",
475
+ "POLICY_EQUIVALENCE_REL_TOLERANCE",
476
+ "POLICY_GOLDEN_VECTOR_COUNT",
477
+ "POLICY_TENSOR_DTYPES",
478
+ "PolicyExportFormat",
479
+ "PolicyExportVerdict",
480
+ "PolicyExportFailureReason",
481
+ "PolicyExportValidation",
482
+ "Unknown",
483
+ "UNKNOWN",
484
+ "PolicyTensorSpec",
485
+ "PolicyBounds",
486
+ "PolicyHistorySpec",
487
+ "PolicySourceSpec",
488
+ "PolicyEquivalenceSpec",
489
+ "PolicyObservationComponent",
490
+ "PolicyActionComponent",
491
+ "PolicyBundleManifest",
492
+ "PolicyObservationSchema",
493
+ "PolicyActionSchema",
494
+ "PolicyNormalization",
495
+ "validate_policy_bundle",
325
496
  # protocols
326
497
  "RuntimeProtocol",
327
498
  "AssetProtocol",
@@ -0,0 +1,15 @@
1
+ """Internal helpers for tolerant response-record reconstruction."""
2
+
3
+ from collections.abc import Mapping
4
+ from dataclasses import fields
5
+ from typing import Any
6
+
7
+
8
+ def known_payload_fields(record_type: Any, payload: Mapping[str, Any], *, owner: str) -> dict[str, Any]:
9
+ """Copy only fields declared by ``record_type`` from one response mapping."""
10
+
11
+ if not isinstance(payload, Mapping):
12
+ raise TypeError(f"{owner} requires a mapping, got {type(payload).__name__}.")
13
+ return {
14
+ definition.name: payload[definition.name] for definition in fields(record_type) if definition.name in payload
15
+ }