adopt-model 0.3.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.
@@ -0,0 +1,224 @@
1
+ """GENERATED typed models, one per table, enum and wire shape.
2
+
3
+ Never hand-edited: CI regenerates this package and compares, and a hand
4
+ edit is `SCHEMA_GENERATED_DRIFT`. This package imports only `pydantic`,
5
+ enforced by the `generated-purity` contract, and holds no business logic.
6
+
7
+ The error registry is **not** here -- it lives in `adopt_obs.errors`,
8
+ because it is needed before this package is first generated (CR-21).
9
+ """
10
+
11
+ # GENERATED FROM schema/canonical.yaml -- DO NOT EDIT.
12
+ # Regenerate with `adopt-schema generate`. A hand edit is SCHEMA_GENERATED_DRIFT
13
+ # and CI fails on it, because a hand-edited realization means the manifest has
14
+ # silently stopped being the single source of truth.
15
+
16
+ from typing import Final
17
+
18
+ from pydantic import BaseModel
19
+
20
+ from adopt_model._enums import (
21
+ ApprovalSubject,
22
+ Archetype,
23
+ AssignmentReason,
24
+ AuthorityClass,
25
+ BindingStatus,
26
+ ChangeSource,
27
+ ConfidenceLabel,
28
+ ConnectorMode,
29
+ ConnectorStatus,
30
+ ControlPlane,
31
+ DeathCause,
32
+ DecidedBy,
33
+ DeploymentMode,
34
+ DiffMethod,
35
+ Disposition,
36
+ EscalationBranch,
37
+ EscalationChannel,
38
+ EscalationStatus,
39
+ FreshnessState,
40
+ HeartbeatOutcome,
41
+ IdentityKind,
42
+ IdentityStatus,
43
+ ImpactClass,
44
+ ItemKind,
45
+ KnowledgePlane,
46
+ LifecycleState,
47
+ LocatorRung,
48
+ OwnershipScope,
49
+ ProbeDefinitionStatus,
50
+ ProbeOutcome,
51
+ ReviewResolution,
52
+ SafePath,
53
+ SensorHealth,
54
+ SensorKind,
55
+ SilentRepairState,
56
+ SourceType,
57
+ Tier,
58
+ ValueEventType,
59
+ Verification,
60
+ )
61
+ from adopt_model._tables import (
62
+ Approval,
63
+ AudienceTag,
64
+ AuditEvent,
65
+ BaselineVersion,
66
+ Binding,
67
+ BindingRevision,
68
+ ChangeEvent,
69
+ Classification,
70
+ ClassifierVersion,
71
+ Conflict,
72
+ Connector,
73
+ DeathCondition,
74
+ Engagement,
75
+ Environment,
76
+ Escalation,
77
+ Firm,
78
+ Identity,
79
+ IdentityRevision,
80
+ KnowledgeItem,
81
+ KnowledgeRevision,
82
+ ObservabilityBoundary,
83
+ OwnershipAssignment,
84
+ ProbeDefinition,
85
+ ProbeDefinitionRevision,
86
+ ProbeObservation,
87
+ ProbeRun,
88
+ Provenance,
89
+ ReviewBatch,
90
+ ReviewItem,
91
+ SchemaMeta,
92
+ Sensor,
93
+ SensorHeartbeat,
94
+ SilentRepairEligibility,
95
+ System,
96
+ SystemLifecycleEvent,
97
+ ValueBaseline,
98
+ ValueEvent,
99
+ )
100
+
101
+ __all__ = [
102
+ "MODEL_FOR_TABLE",
103
+ "Approval",
104
+ "ApprovalSubject",
105
+ "Archetype",
106
+ "AssignmentReason",
107
+ "AudienceTag",
108
+ "AuditEvent",
109
+ "AuthorityClass",
110
+ "BaselineVersion",
111
+ "Binding",
112
+ "BindingRevision",
113
+ "BindingStatus",
114
+ "ChangeEvent",
115
+ "ChangeSource",
116
+ "Classification",
117
+ "ClassifierVersion",
118
+ "ConfidenceLabel",
119
+ "Conflict",
120
+ "Connector",
121
+ "ConnectorMode",
122
+ "ConnectorStatus",
123
+ "ControlPlane",
124
+ "DeathCause",
125
+ "DeathCondition",
126
+ "DecidedBy",
127
+ "DeploymentMode",
128
+ "DiffMethod",
129
+ "Disposition",
130
+ "Engagement",
131
+ "Environment",
132
+ "Escalation",
133
+ "EscalationBranch",
134
+ "EscalationChannel",
135
+ "EscalationStatus",
136
+ "Firm",
137
+ "FreshnessState",
138
+ "HeartbeatOutcome",
139
+ "Identity",
140
+ "IdentityKind",
141
+ "IdentityRevision",
142
+ "IdentityStatus",
143
+ "ImpactClass",
144
+ "ItemKind",
145
+ "KnowledgeItem",
146
+ "KnowledgePlane",
147
+ "KnowledgeRevision",
148
+ "LifecycleState",
149
+ "LocatorRung",
150
+ "ObservabilityBoundary",
151
+ "OwnershipAssignment",
152
+ "OwnershipScope",
153
+ "ProbeDefinition",
154
+ "ProbeDefinitionRevision",
155
+ "ProbeDefinitionStatus",
156
+ "ProbeObservation",
157
+ "ProbeOutcome",
158
+ "ProbeRun",
159
+ "Provenance",
160
+ "ReviewBatch",
161
+ "ReviewItem",
162
+ "ReviewResolution",
163
+ "SafePath",
164
+ "SchemaMeta",
165
+ "Sensor",
166
+ "SensorHealth",
167
+ "SensorHeartbeat",
168
+ "SensorKind",
169
+ "SilentRepairEligibility",
170
+ "SilentRepairState",
171
+ "SourceType",
172
+ "System",
173
+ "SystemLifecycleEvent",
174
+ "Tier",
175
+ "ValueBaseline",
176
+ "ValueEvent",
177
+ "ValueEventType",
178
+ "Verification",
179
+ ]
180
+
181
+ #: Canonical table name -> the model that validates one of its rows.
182
+ #: Generated because the correspondence is the manifest's, not a
183
+ #: convention a caller should re-derive from a class name: the export
184
+ #: writer, the importer and the store all need it, and three
185
+ #: reconstructions of one mapping are three places for it to drift.
186
+ MODEL_FOR_TABLE: Final[dict[str, type[BaseModel]]] = {
187
+ "approval": Approval,
188
+ "audience_tag": AudienceTag,
189
+ "audit_event": AuditEvent,
190
+ "baseline_version": BaselineVersion,
191
+ "binding": Binding,
192
+ "binding_revision": BindingRevision,
193
+ "change_event": ChangeEvent,
194
+ "classification": Classification,
195
+ "classifier_version": ClassifierVersion,
196
+ "conflict": Conflict,
197
+ "connector": Connector,
198
+ "death_condition": DeathCondition,
199
+ "engagement": Engagement,
200
+ "environment": Environment,
201
+ "escalation": Escalation,
202
+ "firm": Firm,
203
+ "identity": Identity,
204
+ "identity_revision": IdentityRevision,
205
+ "knowledge_item": KnowledgeItem,
206
+ "knowledge_revision": KnowledgeRevision,
207
+ "observability_boundary": ObservabilityBoundary,
208
+ "ownership_assignment": OwnershipAssignment,
209
+ "probe_definition": ProbeDefinition,
210
+ "probe_definition_revision": ProbeDefinitionRevision,
211
+ "probe_observation": ProbeObservation,
212
+ "probe_run": ProbeRun,
213
+ "provenance": Provenance,
214
+ "review_batch": ReviewBatch,
215
+ "review_item": ReviewItem,
216
+ "schema_meta": SchemaMeta,
217
+ "sensor": Sensor,
218
+ "sensor_heartbeat": SensorHeartbeat,
219
+ "silent_repair_eligibility": SilentRepairEligibility,
220
+ "system": System,
221
+ "system_lifecycle_event": SystemLifecycleEvent,
222
+ "value_baseline": ValueBaseline,
223
+ "value_event": ValueEvent,
224
+ }
adopt_model/_enums.py ADDED
@@ -0,0 +1,308 @@
1
+ """Enum vocabularies, generated from the canonical manifest."""
2
+
3
+ # GENERATED FROM schema/canonical.yaml -- DO NOT EDIT.
4
+ # Regenerate with `adopt-schema generate`. A hand edit is SCHEMA_GENERATED_DRIFT
5
+ # and CI fails on it, because a hand-edited realization means the manifest has
6
+ # silently stopped being the single source of truth.
7
+
8
+ from typing import Literal
9
+
10
+ __all__ = [
11
+ "ApprovalSubject",
12
+ "Archetype",
13
+ "AssignmentReason",
14
+ "AuthorityClass",
15
+ "BindingStatus",
16
+ "ChangeSource",
17
+ "ConfidenceLabel",
18
+ "ConnectorMode",
19
+ "ConnectorStatus",
20
+ "ControlPlane",
21
+ "DeathCause",
22
+ "DecidedBy",
23
+ "DeploymentMode",
24
+ "DiffMethod",
25
+ "Disposition",
26
+ "EscalationBranch",
27
+ "EscalationChannel",
28
+ "EscalationStatus",
29
+ "FreshnessState",
30
+ "HeartbeatOutcome",
31
+ "IdentityKind",
32
+ "IdentityStatus",
33
+ "ImpactClass",
34
+ "ItemKind",
35
+ "KnowledgePlane",
36
+ "LifecycleState",
37
+ "LocatorRung",
38
+ "OwnershipScope",
39
+ "ProbeDefinitionStatus",
40
+ "ProbeOutcome",
41
+ "ReviewResolution",
42
+ "SafePath",
43
+ "SensorHealth",
44
+ "SensorKind",
45
+ "SilentRepairState",
46
+ "SourceType",
47
+ "Tier",
48
+ "ValueEventType",
49
+ "Verification",
50
+ ]
51
+
52
+ ApprovalSubject = Literal[
53
+ "knowledge_revision",
54
+ "probe_revision",
55
+ "binding_revision",
56
+ ]
57
+ Archetype = Literal[
58
+ "web",
59
+ "platform",
60
+ "lowcode",
61
+ "data",
62
+ "ai",
63
+ ]
64
+ AssignmentReason = Literal[
65
+ "handover",
66
+ "departure",
67
+ "escalation",
68
+ "policy",
69
+ ]
70
+ AuthorityClass = Literal[
71
+ "artifact_observed",
72
+ "behavior_observed",
73
+ "human_confirmed",
74
+ ]
75
+ BindingStatus = Literal[
76
+ "active",
77
+ "moved",
78
+ "retired",
79
+ ]
80
+ ChangeSource = Literal[
81
+ "artifact",
82
+ "provider",
83
+ "data",
84
+ ]
85
+ ConfidenceLabel = Literal[
86
+ "measured",
87
+ "buyer_reported",
88
+ "modelled",
89
+ "low_confidence",
90
+ ]
91
+ ConnectorMode = Literal[
92
+ "outbound_relay",
93
+ "local_only",
94
+ ]
95
+ ConnectorStatus = Literal[
96
+ "active",
97
+ "degraded",
98
+ "revoked",
99
+ ]
100
+ ControlPlane = Literal[
101
+ "vendor",
102
+ "customer",
103
+ ]
104
+ DeathCause = Literal[
105
+ "referent_retired",
106
+ "contradicted_by_observation",
107
+ "unused_past_threshold",
108
+ ]
109
+ DecidedBy = Literal[
110
+ "cascade_step_1",
111
+ "cascade_step_2",
112
+ "cascade_step_3",
113
+ "cascade_step_4",
114
+ "model",
115
+ ]
116
+ DeploymentMode = Literal[
117
+ "mode_1",
118
+ "mode_2",
119
+ "mode_3",
120
+ ]
121
+ DiffMethod = Literal[
122
+ "exact",
123
+ "embedding_sim",
124
+ "llm_judge",
125
+ "contract_delta",
126
+ ]
127
+ Disposition = Literal[
128
+ "open",
129
+ "defect_filed",
130
+ "drift_accepted",
131
+ ]
132
+ EscalationBranch = Literal[
133
+ "ungrounded",
134
+ "stale",
135
+ "bug_report",
136
+ ]
137
+ EscalationChannel = Literal[
138
+ "slack",
139
+ "teams",
140
+ "servicenow",
141
+ "jsm",
142
+ "portal",
143
+ "email",
144
+ ]
145
+ EscalationStatus = Literal[
146
+ "open",
147
+ "answered",
148
+ "promoted",
149
+ "reassigned",
150
+ ]
151
+ FreshnessState = Literal[
152
+ "fresh",
153
+ "stale",
154
+ "unverified",
155
+ "retired",
156
+ "observation_stale",
157
+ ]
158
+ HeartbeatOutcome = Literal[
159
+ "success",
160
+ "empty",
161
+ "failure",
162
+ "skipped",
163
+ ]
164
+ IdentityKind = Literal[
165
+ "endpoint",
166
+ "db_field",
167
+ "state_transition",
168
+ "symbol",
169
+ "metadata_component",
170
+ "prompt",
171
+ "tool_schema",
172
+ "model_pin",
173
+ "retrieval_config",
174
+ "flag",
175
+ "job",
176
+ "config_key",
177
+ "ui_component",
178
+ ]
179
+ IdentityStatus = Literal[
180
+ "active",
181
+ "moved",
182
+ "dead",
183
+ ]
184
+ ImpactClass = Literal[
185
+ "BINDING_INTACT_RENDER_ONLY",
186
+ "BINDING_INTACT_SEMANTICS_CHANGED",
187
+ "BINDING_MOVED",
188
+ "BINDING_DEAD",
189
+ "UNBOUND_NEW",
190
+ ]
191
+ ItemKind = Literal[
192
+ "answer",
193
+ "procedure",
194
+ "rationale",
195
+ "surface",
196
+ "recipe",
197
+ ]
198
+ KnowledgePlane = Literal[
199
+ "customer",
200
+ "firm",
201
+ "vendor_isolated",
202
+ ]
203
+ LifecycleState = Literal[
204
+ "DISCOVERED",
205
+ "SETUP",
206
+ "PILOT",
207
+ "LIVE",
208
+ "PAUSED",
209
+ "DEGRADED",
210
+ "ARCHIVED",
211
+ "DISCONNECTED",
212
+ ]
213
+ LocatorRung = Literal[
214
+ 1, # const-sync: ok -- manifest enum value, not a tunable.
215
+ 2, # const-sync: ok -- manifest enum value, not a tunable.
216
+ 3, # const-sync: ok -- manifest enum value, not a tunable.
217
+ 4, # const-sync: ok -- manifest enum value, not a tunable.
218
+ 5, # const-sync: ok -- manifest enum value, not a tunable.
219
+ ]
220
+ OwnershipScope = Literal[
221
+ "system",
222
+ "engagement",
223
+ "practice",
224
+ "pooled",
225
+ ]
226
+ ProbeDefinitionStatus = Literal[
227
+ "active",
228
+ "retired",
229
+ ]
230
+ ProbeOutcome = Literal[
231
+ "success",
232
+ "diff",
233
+ "failure",
234
+ "blocked_by_manifest",
235
+ ]
236
+ ReviewResolution = Literal[
237
+ "confirmed",
238
+ "corrected",
239
+ "rejected",
240
+ ]
241
+ SafePath = Literal[
242
+ "mock",
243
+ "sandbox",
244
+ "shadow",
245
+ ]
246
+ SensorHealth = Literal[
247
+ "HEALTHY",
248
+ "DEGRADED",
249
+ "STALE",
250
+ "FAILED",
251
+ "DISABLED",
252
+ "UNVERIFIED",
253
+ ]
254
+ SensorKind = Literal[
255
+ "webhook",
256
+ "ci",
257
+ "audit_trail",
258
+ "probe",
259
+ "trace",
260
+ "contract",
261
+ ]
262
+ SilentRepairState = Literal[
263
+ "DISABLED",
264
+ "DETECTION_ONLY",
265
+ "REVIEW_REQUIRED",
266
+ "SILENT_ELIGIBLE",
267
+ "SUSPENDED",
268
+ ]
269
+ SourceType = Literal[
270
+ "commit",
271
+ "pr",
272
+ "ticket",
273
+ "adr",
274
+ "probe_output",
275
+ "trace",
276
+ "human",
277
+ ]
278
+ Tier = Literal[
279
+ "T0",
280
+ "T1",
281
+ "T2",
282
+ "T3",
283
+ "T4",
284
+ ]
285
+ ValueEventType = Literal[
286
+ "question.received",
287
+ "question.grounded",
288
+ "question.reused_confirmed_canon",
289
+ "question.escalated",
290
+ "question.reopened",
291
+ "correction.confirmed",
292
+ "correction.minutes_spent",
293
+ "change.detected",
294
+ "knowledge.marked_stale",
295
+ "content.regenerated",
296
+ "content.reviewed",
297
+ "content.retired",
298
+ "review.minutes_spent",
299
+ "handover.generated",
300
+ "handover.correction_minutes",
301
+ "sensor_unavailable",
302
+ "fde_reengagement_required",
303
+ ]
304
+ Verification = Literal[
305
+ "verified",
306
+ "unverified",
307
+ "conflicted",
308
+ ]