validibot-shared 0.4.2__tar.gz → 0.4.4__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.
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/PKG-INFO +18 -16
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/README.md +16 -14
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/pyproject.toml +2 -2
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/validations/envelopes.py +23 -19
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/.gitignore +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/LICENSE +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/NOTICE +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/__init__.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/test_energyplus_envelopes.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/test_energyplus_models.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/test_fmu_envelopes.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/test_fmu_models.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/test_package_init.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/tests/test_validations_envelopes.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/__init__.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/energyplus/__init__.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/energyplus/envelopes.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/energyplus/models.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/fmu/__init__.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/fmu/envelopes.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/fmu/models.py +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/py.typed +0 -0
- {validibot_shared-0.4.2 → validibot_shared-0.4.4}/validibot_shared/validations/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: validibot-shared
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Shared library for data interchange between Validibot and validator containers
|
|
5
5
|
Project-URL: Homepage, https://validibot.com
|
|
6
6
|
Project-URL: Documentation, https://docs.validibot.com
|
|
@@ -24,7 +24,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
24
24
|
Classifier: Topic :: Scientific/Engineering
|
|
25
25
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
26
|
Requires-Python: >=3.10
|
|
27
|
-
Requires-Dist: pydantic==2.
|
|
27
|
+
Requires-Dist: pydantic==2.13.3
|
|
28
28
|
Provides-Extra: dev
|
|
29
29
|
Requires-Dist: pytest==9.0.2; extra == 'dev'
|
|
30
30
|
Requires-Dist: ruff==0.14.8; extra == 'dev'
|
|
@@ -50,7 +50,7 @@ Description-Content-Type: text/markdown
|
|
|
50
50
|
---
|
|
51
51
|
|
|
52
52
|
> [!NOTE]
|
|
53
|
-
> This library is part of the [Validibot](https://github.com/danielmcquillen/validibot) open-source data validation platform. It defines the data interchange contract between the core platform and
|
|
53
|
+
> This library is part of the [Validibot](https://github.com/danielmcquillen/validibot) open-source data validation platform. It defines the data interchange contract between the core platform and validator backends.
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
@@ -60,21 +60,23 @@ Description-Content-Type: text/markdown
|
|
|
60
60
|
|------------|-------------|
|
|
61
61
|
| **[validibot](https://github.com/danielmcquillen/validibot)** | Core platform — web UI, REST API, workflow engine |
|
|
62
62
|
| **[validibot-cli](https://github.com/danielmcquillen/validibot-cli)** | Command-line interface |
|
|
63
|
-
| **[validibot-
|
|
63
|
+
| **[validibot-validator-backends](https://github.com/danielmcquillen/validibot-validator-backends)** | Validator backends for advanced validators (EnergyPlus™, FMU) |
|
|
64
64
|
| **[validibot-shared](https://github.com/danielmcquillen/validibot-shared)** (this repo) | Shared Pydantic models for data interchange |
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
68
|
## What is Validibot Shared?
|
|
69
69
|
|
|
70
|
-
Validibot Shared provides the Pydantic models that define how the Validibot core platform communicates with
|
|
70
|
+
Validibot Shared provides the Pydantic models that define how the Validibot core platform communicates with validator backends. When Validibot needs to run a complex validation (like an EnergyPlus™ simulation or FMU probe), it:
|
|
71
71
|
|
|
72
72
|
1. **Creates an input envelope** containing the files to validate and configuration
|
|
73
|
-
2. **Launches a validator
|
|
73
|
+
2. **Launches a validator backend** with the envelope as input
|
|
74
74
|
3. **Receives an output envelope** with validation results, metrics, and artifacts
|
|
75
75
|
|
|
76
76
|
This library ensures both sides speak the same language with full type safety and runtime validation.
|
|
77
77
|
|
|
78
|
+
Terminology note: in the core `validibot` codebase, `AdvancedValidator` is the Django-side validator class that prepares and launches external work. A validator backend, or future `ValidatorBackend` protocol, is the external implementation it delegates to, usually a container or cloud job. This package defines the envelope boundary between that trusted Django-side validator and the external validator backend. The backend does not receive the full Django submission, workflow, permissions, billing, or credential state unless the parent validator intentionally includes specific data in the envelope.
|
|
79
|
+
|
|
78
80
|
## Features
|
|
79
81
|
|
|
80
82
|
- **Type-safe envelopes** — Pydantic models with full IDE autocomplete and type checking
|
|
@@ -85,7 +87,7 @@ This library ensures both sides speak the same language with full type safety an
|
|
|
85
87
|
## Disclaimer
|
|
86
88
|
|
|
87
89
|
> [!NOTE]
|
|
88
|
-
> This library defines data interchange models only — it does not process, store, or transmit user data. However, the models are used by validator
|
|
90
|
+
> This library defines data interchange models only — it does not process, store, or transmit user data. However, the models are used by validator backends that execute user-supplied files. See the [LICENSE](LICENSE) for full warranty disclaimer. The authors accept no liability for the behaviour of systems built using these models.
|
|
89
91
|
|
|
90
92
|
## Installation
|
|
91
93
|
|
|
@@ -249,7 +251,7 @@ envelope = EnergyPlusInputEnvelope(
|
|
|
249
251
|
),
|
|
250
252
|
)
|
|
251
253
|
|
|
252
|
-
# Serialize to JSON for the validator
|
|
254
|
+
# Serialize to JSON for the validator backend
|
|
253
255
|
json_payload = envelope.model_dump_json()
|
|
254
256
|
```
|
|
255
257
|
|
|
@@ -369,7 +371,7 @@ This library is one component of the Validibot open-source data validation platf
|
|
|
369
371
|
|------------|-------------|
|
|
370
372
|
| **[validibot](https://github.com/danielmcquillen/validibot)** | Core platform — web UI, REST API, workflow engine |
|
|
371
373
|
| **[validibot-cli](https://github.com/danielmcquillen/validibot-cli)** | Command-line interface |
|
|
372
|
-
| **[validibot-
|
|
374
|
+
| **[validibot-validator-backends](https://github.com/danielmcquillen/validibot-validator-backends)** | Validator backends for advanced validators (EnergyPlus™, FMU) |
|
|
373
375
|
| **[validibot-shared](https://github.com/danielmcquillen/validibot-shared)** (this repo) | Shared Pydantic models for data interchange |
|
|
374
376
|
|
|
375
377
|
### How It Fits Together
|
|
@@ -392,13 +394,13 @@ This library is one component of the Validibot open-source data validation platf
|
|
|
392
394
|
│
|
|
393
395
|
┌──────────────────────────┼──────────────────────────┐
|
|
394
396
|
▼ ▼ ▼
|
|
395
|
-
┌─────────────────┐
|
|
396
|
-
│ validibot-cli │ │ validibot-
|
|
397
|
-
│ │ │
|
|
398
|
-
│ Terminal access │ │ EnergyPlus™, FMU
|
|
399
|
-
│ to API │ │ containers
|
|
400
|
-
│ │ │
|
|
401
|
-
└─────────────────┘
|
|
397
|
+
┌─────────────────┐ ┌──────────────────────────────┐ ┌─────────────────────┐
|
|
398
|
+
│ validibot-cli │ │ validibot-validator-backends │ │ validibot-shared │
|
|
399
|
+
│ │ │ │ │ (this repo) │
|
|
400
|
+
│ Terminal access │ │ EnergyPlus™, FMU │ │ │
|
|
401
|
+
│ to API │ │ containers │ │ Pydantic models │
|
|
402
|
+
│ │ │ │ │ │ (shared contract) │
|
|
403
|
+
└─────────────────┘ └──────────────┼───────────────┘ └─────────────────────┘
|
|
402
404
|
│ ▲
|
|
403
405
|
└──────────────────────────┘
|
|
404
406
|
validators import shared
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
> [!NOTE]
|
|
21
|
-
> This library is part of the [Validibot](https://github.com/danielmcquillen/validibot) open-source data validation platform. It defines the data interchange contract between the core platform and
|
|
21
|
+
> This library is part of the [Validibot](https://github.com/danielmcquillen/validibot) open-source data validation platform. It defines the data interchange contract between the core platform and validator backends.
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -28,21 +28,23 @@
|
|
|
28
28
|
|------------|-------------|
|
|
29
29
|
| **[validibot](https://github.com/danielmcquillen/validibot)** | Core platform — web UI, REST API, workflow engine |
|
|
30
30
|
| **[validibot-cli](https://github.com/danielmcquillen/validibot-cli)** | Command-line interface |
|
|
31
|
-
| **[validibot-
|
|
31
|
+
| **[validibot-validator-backends](https://github.com/danielmcquillen/validibot-validator-backends)** | Validator backends for advanced validators (EnergyPlus™, FMU) |
|
|
32
32
|
| **[validibot-shared](https://github.com/danielmcquillen/validibot-shared)** (this repo) | Shared Pydantic models for data interchange |
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
36
|
## What is Validibot Shared?
|
|
37
37
|
|
|
38
|
-
Validibot Shared provides the Pydantic models that define how the Validibot core platform communicates with
|
|
38
|
+
Validibot Shared provides the Pydantic models that define how the Validibot core platform communicates with validator backends. When Validibot needs to run a complex validation (like an EnergyPlus™ simulation or FMU probe), it:
|
|
39
39
|
|
|
40
40
|
1. **Creates an input envelope** containing the files to validate and configuration
|
|
41
|
-
2. **Launches a validator
|
|
41
|
+
2. **Launches a validator backend** with the envelope as input
|
|
42
42
|
3. **Receives an output envelope** with validation results, metrics, and artifacts
|
|
43
43
|
|
|
44
44
|
This library ensures both sides speak the same language with full type safety and runtime validation.
|
|
45
45
|
|
|
46
|
+
Terminology note: in the core `validibot` codebase, `AdvancedValidator` is the Django-side validator class that prepares and launches external work. A validator backend, or future `ValidatorBackend` protocol, is the external implementation it delegates to, usually a container or cloud job. This package defines the envelope boundary between that trusted Django-side validator and the external validator backend. The backend does not receive the full Django submission, workflow, permissions, billing, or credential state unless the parent validator intentionally includes specific data in the envelope.
|
|
47
|
+
|
|
46
48
|
## Features
|
|
47
49
|
|
|
48
50
|
- **Type-safe envelopes** — Pydantic models with full IDE autocomplete and type checking
|
|
@@ -53,7 +55,7 @@ This library ensures both sides speak the same language with full type safety an
|
|
|
53
55
|
## Disclaimer
|
|
54
56
|
|
|
55
57
|
> [!NOTE]
|
|
56
|
-
> This library defines data interchange models only — it does not process, store, or transmit user data. However, the models are used by validator
|
|
58
|
+
> This library defines data interchange models only — it does not process, store, or transmit user data. However, the models are used by validator backends that execute user-supplied files. See the [LICENSE](LICENSE) for full warranty disclaimer. The authors accept no liability for the behaviour of systems built using these models.
|
|
57
59
|
|
|
58
60
|
## Installation
|
|
59
61
|
|
|
@@ -217,7 +219,7 @@ envelope = EnergyPlusInputEnvelope(
|
|
|
217
219
|
),
|
|
218
220
|
)
|
|
219
221
|
|
|
220
|
-
# Serialize to JSON for the validator
|
|
222
|
+
# Serialize to JSON for the validator backend
|
|
221
223
|
json_payload = envelope.model_dump_json()
|
|
222
224
|
```
|
|
223
225
|
|
|
@@ -337,7 +339,7 @@ This library is one component of the Validibot open-source data validation platf
|
|
|
337
339
|
|------------|-------------|
|
|
338
340
|
| **[validibot](https://github.com/danielmcquillen/validibot)** | Core platform — web UI, REST API, workflow engine |
|
|
339
341
|
| **[validibot-cli](https://github.com/danielmcquillen/validibot-cli)** | Command-line interface |
|
|
340
|
-
| **[validibot-
|
|
342
|
+
| **[validibot-validator-backends](https://github.com/danielmcquillen/validibot-validator-backends)** | Validator backends for advanced validators (EnergyPlus™, FMU) |
|
|
341
343
|
| **[validibot-shared](https://github.com/danielmcquillen/validibot-shared)** (this repo) | Shared Pydantic models for data interchange |
|
|
342
344
|
|
|
343
345
|
### How It Fits Together
|
|
@@ -360,13 +362,13 @@ This library is one component of the Validibot open-source data validation platf
|
|
|
360
362
|
│
|
|
361
363
|
┌──────────────────────────┼──────────────────────────┐
|
|
362
364
|
▼ ▼ ▼
|
|
363
|
-
┌─────────────────┐
|
|
364
|
-
│ validibot-cli │ │ validibot-
|
|
365
|
-
│ │ │
|
|
366
|
-
│ Terminal access │ │ EnergyPlus™, FMU
|
|
367
|
-
│ to API │ │ containers
|
|
368
|
-
│ │ │
|
|
369
|
-
└─────────────────┘
|
|
365
|
+
┌─────────────────┐ ┌──────────────────────────────┐ ┌─────────────────────┐
|
|
366
|
+
│ validibot-cli │ │ validibot-validator-backends │ │ validibot-shared │
|
|
367
|
+
│ │ │ │ │ (this repo) │
|
|
368
|
+
│ Terminal access │ │ EnergyPlus™, FMU │ │ │
|
|
369
|
+
│ to API │ │ containers │ │ Pydantic models │
|
|
370
|
+
│ │ │ │ │ │ (shared contract) │
|
|
371
|
+
└─────────────────┘ └──────────────┼───────────────┘ └─────────────────────┘
|
|
370
372
|
│ ▲
|
|
371
373
|
└──────────────────────────┘
|
|
372
374
|
validators import shared
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "validibot-shared"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.4"
|
|
8
8
|
description = "Shared library for data interchange between Validibot and validator containers"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -32,7 +32,7 @@ classifiers = [
|
|
|
32
32
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
33
33
|
"Topic :: Scientific/Engineering",
|
|
34
34
|
]
|
|
35
|
-
dependencies = ["pydantic==2.
|
|
35
|
+
dependencies = ["pydantic==2.13.3"]
|
|
36
36
|
|
|
37
37
|
[project.optional-dependencies]
|
|
38
38
|
dev = ["pytest==9.0.2", "ruff==0.14.8"]
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Pydantic schemas for
|
|
2
|
+
Pydantic schemas for validator backend execution envelopes.
|
|
3
3
|
|
|
4
|
-
These schemas define the contract between Django
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
These schemas define the contract between Django-side advanced validators and
|
|
5
|
+
external validator backends. In the core ``validibot`` codebase,
|
|
6
|
+
``AdvancedValidator`` is the trusted Django-side class that prepares the run,
|
|
7
|
+
builds the envelope, launches external work through an execution backend, and
|
|
8
|
+
processes the output. A validator backend, or future ``ValidatorBackend``
|
|
9
|
+
protocol, is the external implementation it delegates to, usually a container
|
|
10
|
+
or cloud job. The backend receives only this envelope boundary, not the full
|
|
11
|
+
Django submission, workflow, permissions, or billing state.
|
|
8
12
|
|
|
9
|
-
This library is used by both the Django app and
|
|
10
|
-
type safety and contract consistency across the
|
|
13
|
+
This library is used by both the Django app and validator backends
|
|
14
|
+
to ensure type safety and contract consistency across the execution boundary.
|
|
11
15
|
|
|
12
16
|
## Deployment Modes
|
|
13
17
|
|
|
@@ -22,11 +26,11 @@ actual storage handling is done by the validators' storage_client module.
|
|
|
22
26
|
## Architecture Overview
|
|
23
27
|
|
|
24
28
|
This module provides a type-safe interface for communication between the Django
|
|
25
|
-
app and
|
|
29
|
+
app and validator backends:
|
|
26
30
|
|
|
27
31
|
**GCP Mode (async with callbacks):**
|
|
28
32
|
1. Django creates input.json with files, config, callback URL
|
|
29
|
-
2. Django uploads to GCS and triggers validator
|
|
33
|
+
2. Django uploads to GCS and triggers validator backend runtime
|
|
30
34
|
3. Validator downloads inputs, runs validation, uploads outputs
|
|
31
35
|
4. Validator POSTs minimal callback to Django when complete
|
|
32
36
|
5. Django receives callback and loads full output.json from GCS
|
|
@@ -93,7 +97,7 @@ Django deserializes using the correct subclass based on validator.type.
|
|
|
93
97
|
|
|
94
98
|
## Why ValidationCallback?
|
|
95
99
|
|
|
96
|
-
The callback is a minimal async notification sent from the validator
|
|
100
|
+
The callback is a minimal async notification sent from the validator backend
|
|
97
101
|
back to the Django app when work completes. It contains only:
|
|
98
102
|
- run_id: Which job finished
|
|
99
103
|
- status: success/failed_validation/failed_runtime/cancelled
|
|
@@ -130,7 +134,7 @@ class Severity(str, Enum):
|
|
|
130
134
|
|
|
131
135
|
class ValidatorType(str, Enum):
|
|
132
136
|
"""
|
|
133
|
-
Canonical validator types used across Django and validator
|
|
137
|
+
Canonical validator types used across Django and validator backends.
|
|
134
138
|
|
|
135
139
|
These values align with Django's ValidationType TextChoices and should be
|
|
136
140
|
used anywhere we serialize validator identifiers in envelopes.
|
|
@@ -227,9 +231,9 @@ class ValidatorInfo(BaseModel):
|
|
|
227
231
|
"""
|
|
228
232
|
Information about the validator being executed.
|
|
229
233
|
|
|
230
|
-
This identifies which validator
|
|
234
|
+
This identifies which validator backend to run and which version.
|
|
231
235
|
The 'type' field determines:
|
|
232
|
-
1. Which validator
|
|
236
|
+
1. Which validator backend to run (e.g., 'validibot-validator-backend-energyplus')
|
|
233
237
|
2. Which envelope subclass Django uses for deserialization
|
|
234
238
|
(EnergyPlusInputEnvelope, FMUInputEnvelope, etc.)
|
|
235
239
|
|
|
@@ -287,7 +291,7 @@ class ExecutionContext(BaseModel):
|
|
|
287
291
|
"""
|
|
288
292
|
Execution context and callback information.
|
|
289
293
|
|
|
290
|
-
This provides the validator
|
|
294
|
+
This provides the validator backend with everything it needs to:
|
|
291
295
|
1. Download input files from storage (execution_bundle_uri)
|
|
292
296
|
2. Upload output files to storage (execution_bundle_uri)
|
|
293
297
|
3. Notify Django when complete (callback_url)
|
|
@@ -331,10 +335,10 @@ class ExecutionContext(BaseModel):
|
|
|
331
335
|
|
|
332
336
|
class ValidationInputEnvelope(BaseModel):
|
|
333
337
|
"""
|
|
334
|
-
Base input envelope for validator jobs (validibot.input.v1).
|
|
338
|
+
Base input envelope for validator backend jobs (validibot.input.v1).
|
|
335
339
|
|
|
336
340
|
This is written to storage as input.json by Django before triggering
|
|
337
|
-
the validator
|
|
341
|
+
the validator backend.
|
|
338
342
|
|
|
339
343
|
## How Subclassing Works
|
|
340
344
|
|
|
@@ -524,9 +528,9 @@ class ValidationTiming(BaseModel):
|
|
|
524
528
|
|
|
525
529
|
class ValidationOutputEnvelope(BaseModel):
|
|
526
530
|
"""
|
|
527
|
-
Base output envelope for validator jobs (validibot.output.v1).
|
|
531
|
+
Base output envelope for validator backend jobs (validibot.output.v1).
|
|
528
532
|
|
|
529
|
-
This is written to storage as output.json by the validator
|
|
533
|
+
This is written to storage as output.json by the validator backend
|
|
530
534
|
after completion.
|
|
531
535
|
|
|
532
536
|
## How Subclassing Works
|
|
@@ -622,7 +626,7 @@ class ValidationOutputEnvelope(BaseModel):
|
|
|
622
626
|
|
|
623
627
|
class ValidationCallback(BaseModel):
|
|
624
628
|
"""
|
|
625
|
-
Callback payload POSTed from validator
|
|
629
|
+
Callback payload POSTed from validator backend to Django.
|
|
626
630
|
|
|
627
631
|
Minimal payload to avoid duplication - Django loads the full output.json
|
|
628
632
|
from storage after receiving this callback.
|
|
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
|
|
File without changes
|
|
File without changes
|