planar 0.10.0__py3-none-any.whl → 0.12.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.
- planar/app.py +26 -6
- planar/cli.py +26 -0
- planar/data/__init__.py +1 -0
- planar/data/config.py +12 -1
- planar/data/connection.py +89 -4
- planar/data/dataset.py +13 -7
- planar/data/utils.py +145 -25
- planar/db/alembic/env.py +68 -57
- planar/db/alembic.ini +1 -1
- planar/files/storage/config.py +7 -1
- planar/routers/dataset_router.py +5 -1
- planar/routers/info.py +79 -36
- planar/scaffold_templates/pyproject.toml.j2 +1 -1
- planar/testing/fixtures.py +7 -4
- planar/testing/planar_test_client.py +8 -0
- planar/version.py +27 -0
- planar-0.12.0.dist-info/METADATA +202 -0
- {planar-0.10.0.dist-info → planar-0.12.0.dist-info}/RECORD +20 -71
- planar/ai/test_agent_serialization.py +0 -229
- planar/ai/test_agent_tool_step_display.py +0 -78
- planar/data/test_dataset.py +0 -358
- planar/files/storage/test_azure_blob.py +0 -435
- planar/files/storage/test_local_directory.py +0 -162
- planar/files/storage/test_s3.py +0 -299
- planar/files/test_files.py +0 -282
- planar/human/test_human.py +0 -385
- planar/logging/test_formatter.py +0 -327
- planar/modeling/mixins/test_auditable.py +0 -97
- planar/modeling/mixins/test_timestamp.py +0 -134
- planar/modeling/mixins/test_uuid_primary_key.py +0 -52
- planar/routers/test_agents_router.py +0 -174
- planar/routers/test_dataset_router.py +0 -429
- planar/routers/test_files_router.py +0 -49
- planar/routers/test_object_config_router.py +0 -367
- planar/routers/test_routes_security.py +0 -168
- planar/routers/test_rule_router.py +0 -470
- planar/routers/test_workflow_router.py +0 -564
- planar/rules/test_data/account_dormancy_management.json +0 -223
- planar/rules/test_data/airline_loyalty_points_calculator.json +0 -262
- planar/rules/test_data/applicant_risk_assessment.json +0 -435
- planar/rules/test_data/booking_fraud_detection.json +0 -407
- planar/rules/test_data/cellular_data_rollover_system.json +0 -258
- planar/rules/test_data/clinical_trial_eligibility_screener.json +0 -437
- planar/rules/test_data/customer_lifetime_value.json +0 -143
- planar/rules/test_data/import_duties_calculator.json +0 -289
- planar/rules/test_data/insurance_prior_authorization.json +0 -443
- planar/rules/test_data/online_check_in_eligibility_system.json +0 -254
- planar/rules/test_data/order_consolidation_system.json +0 -375
- planar/rules/test_data/portfolio_risk_monitor.json +0 -471
- planar/rules/test_data/supply_chain_risk.json +0 -253
- planar/rules/test_data/warehouse_cross_docking.json +0 -237
- planar/rules/test_rules.py +0 -1494
- planar/security/tests/test_auth_middleware.py +0 -162
- planar/security/tests/test_authorization_context.py +0 -78
- planar/security/tests/test_cedar_basics.py +0 -41
- planar/security/tests/test_cedar_policies.py +0 -158
- planar/security/tests/test_jwt_principal_context.py +0 -179
- planar/test_app.py +0 -142
- planar/test_cli.py +0 -394
- planar/test_config.py +0 -515
- planar/test_object_config.py +0 -527
- planar/test_object_registry.py +0 -14
- planar/test_sqlalchemy.py +0 -193
- planar/test_utils.py +0 -105
- planar/testing/test_memory_storage.py +0 -143
- planar/workflows/test_concurrency_detection.py +0 -120
- planar/workflows/test_lock_timeout.py +0 -140
- planar/workflows/test_serialization.py +0 -1203
- planar/workflows/test_suspend_deserialization.py +0 -231
- planar/workflows/test_workflow.py +0 -2005
- planar-0.10.0.dist-info/METADATA +0 -323
- {planar-0.10.0.dist-info → planar-0.12.0.dist-info}/WHEEL +0 -0
- {planar-0.10.0.dist-info → planar-0.12.0.dist-info}/entry_points.txt +0 -0
@@ -1,253 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"nodes": [
|
3
|
-
{
|
4
|
-
"type": "inputNode",
|
5
|
-
"content": {
|
6
|
-
"schema": ""
|
7
|
-
},
|
8
|
-
"id": "input",
|
9
|
-
"name": "request",
|
10
|
-
"position": {
|
11
|
-
"x": 110,
|
12
|
-
"y": 114
|
13
|
-
}
|
14
|
-
},
|
15
|
-
{
|
16
|
-
"type": "decisionTableNode",
|
17
|
-
"content": {
|
18
|
-
"hitPolicy": "first",
|
19
|
-
"rules": [
|
20
|
-
{
|
21
|
-
"_id": "rule1",
|
22
|
-
"supplierLocation": "'high_risk_region'",
|
23
|
-
"historicalPerformance": "< 70",
|
24
|
-
"alternativeSources": "< 2",
|
25
|
-
"riskScore": "80",
|
26
|
-
"riskCategory": "'critical'",
|
27
|
-
"mitigation": "'Immediate action required: Identify alternative suppliers'"
|
28
|
-
},
|
29
|
-
{
|
30
|
-
"_id": "rule2",
|
31
|
-
"supplierLocation": "'high_risk_region'",
|
32
|
-
"historicalPerformance": ">= 70",
|
33
|
-
"alternativeSources": "",
|
34
|
-
"riskScore": "65",
|
35
|
-
"riskCategory": "'high'",
|
36
|
-
"mitigation": "'Develop backup suppliers and increase safety stock'"
|
37
|
-
},
|
38
|
-
{
|
39
|
-
"_id": "rule3",
|
40
|
-
"supplierLocation": "'medium_risk_region'",
|
41
|
-
"historicalPerformance": "< 80",
|
42
|
-
"alternativeSources": "< 3",
|
43
|
-
"riskScore": "60",
|
44
|
-
"riskCategory": "'high'",
|
45
|
-
"mitigation": "'Implement dual-sourcing strategy'"
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"_id": "rule4",
|
49
|
-
"supplierLocation": "'medium_risk_region'",
|
50
|
-
"historicalPerformance": ">= 80",
|
51
|
-
"alternativeSources": "",
|
52
|
-
"riskScore": "40",
|
53
|
-
"riskCategory": "'medium'",
|
54
|
-
"mitigation": "'Monitor supplier performance and conduct quarterly reviews'"
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"_id": "rule5",
|
58
|
-
"supplierLocation": "'low_risk_region'",
|
59
|
-
"historicalPerformance": "< 75",
|
60
|
-
"alternativeSources": "",
|
61
|
-
"riskScore": "35",
|
62
|
-
"riskCategory": "'medium'",
|
63
|
-
"mitigation": "'Schedule regular performance reviews'"
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"_id": "rule6",
|
67
|
-
"supplierLocation": "'low_risk_region'",
|
68
|
-
"historicalPerformance": ">= 75",
|
69
|
-
"alternativeSources": ">= 3",
|
70
|
-
"riskScore": "15",
|
71
|
-
"riskCategory": "'low'",
|
72
|
-
"mitigation": "'Standard monitoring procedures'"
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"_id": "rule7",
|
76
|
-
"supplierLocation": "",
|
77
|
-
"historicalPerformance": "",
|
78
|
-
"alternativeSources": "",
|
79
|
-
"riskScore": "50",
|
80
|
-
"riskCategory": "'medium'",
|
81
|
-
"mitigation": "'Conduct detailed supplier assessment'"
|
82
|
-
}
|
83
|
-
],
|
84
|
-
"inputs": [
|
85
|
-
{
|
86
|
-
"id": "supplierLocation",
|
87
|
-
"name": "Supplier Location",
|
88
|
-
"field": "supplier.location"
|
89
|
-
},
|
90
|
-
{
|
91
|
-
"id": "historicalPerformance",
|
92
|
-
"name": "Historical Performance Score",
|
93
|
-
"field": "supplier.performanceScore"
|
94
|
-
},
|
95
|
-
{
|
96
|
-
"id": "alternativeSources",
|
97
|
-
"name": "Alternative Sources Count",
|
98
|
-
"field": "supplier.alternateSourcesCount"
|
99
|
-
}
|
100
|
-
],
|
101
|
-
"outputs": [
|
102
|
-
{
|
103
|
-
"id": "riskScore",
|
104
|
-
"name": "Risk Score",
|
105
|
-
"field": "assessment.baseRiskScore"
|
106
|
-
},
|
107
|
-
{
|
108
|
-
"id": "riskCategory",
|
109
|
-
"name": "Risk Category",
|
110
|
-
"field": "assessment.baseRiskCategory"
|
111
|
-
},
|
112
|
-
{
|
113
|
-
"id": "mitigation",
|
114
|
-
"name": "Recommended Mitigation",
|
115
|
-
"field": "assessment.recommendedAction"
|
116
|
-
}
|
117
|
-
],
|
118
|
-
"passThrough": true,
|
119
|
-
"inputField": null,
|
120
|
-
"outputPath": null,
|
121
|
-
"executionMode": "single"
|
122
|
-
},
|
123
|
-
"id": "supplierRiskEvaluation",
|
124
|
-
"name": "supplierRiskEvaluation",
|
125
|
-
"position": {
|
126
|
-
"x": 430,
|
127
|
-
"y": 114
|
128
|
-
}
|
129
|
-
},
|
130
|
-
{
|
131
|
-
"type": "expressionNode",
|
132
|
-
"content": {
|
133
|
-
"expressions": [
|
134
|
-
{
|
135
|
-
"id": "expr1",
|
136
|
-
"key": "geopoliticalFactor",
|
137
|
-
"value": "geopoliticalTensions == true ? 1.3 : 1.0"
|
138
|
-
},
|
139
|
-
{
|
140
|
-
"id": "expr2",
|
141
|
-
"key": "marketVolatilityFactor",
|
142
|
-
"value": "marketVolatility == 'high' ? 1.2 : (marketVolatility == 'medium' ? 1.1 : 1.0)"
|
143
|
-
},
|
144
|
-
{
|
145
|
-
"id": "expr3",
|
146
|
-
"key": "adjustedRiskScore",
|
147
|
-
"value": "min([round(assessment.baseRiskScore * $.geopoliticalFactor * $.marketVolatilityFactor), 100])"
|
148
|
-
}
|
149
|
-
],
|
150
|
-
"passThrough": true,
|
151
|
-
"inputField": null,
|
152
|
-
"outputPath": null,
|
153
|
-
"executionMode": "single"
|
154
|
-
},
|
155
|
-
"id": "geopoliticalRiskCalculation",
|
156
|
-
"name": "geopoliticalRiskCalculation",
|
157
|
-
"position": {
|
158
|
-
"x": 750,
|
159
|
-
"y": 114
|
160
|
-
}
|
161
|
-
},
|
162
|
-
{
|
163
|
-
"type": "decisionTableNode",
|
164
|
-
"content": {
|
165
|
-
"hitPolicy": "first",
|
166
|
-
"rules": [
|
167
|
-
{
|
168
|
-
"_id": "finalRule1",
|
169
|
-
"adjustedRiskScore": ">= 75",
|
170
|
-
"finalCategory": "'critical'",
|
171
|
-
"leadTimeImpact": "'significant'",
|
172
|
-
"priorityLevel": "'immediate'"
|
173
|
-
},
|
174
|
-
{
|
175
|
-
"_id": "finalRule2",
|
176
|
-
"adjustedRiskScore": ">= 60",
|
177
|
-
"finalCategory": "'high'",
|
178
|
-
"leadTimeImpact": "'moderate'",
|
179
|
-
"priorityLevel": "'high'"
|
180
|
-
},
|
181
|
-
{
|
182
|
-
"_id": "finalRule3",
|
183
|
-
"adjustedRiskScore": ">= 40",
|
184
|
-
"finalCategory": "'medium'",
|
185
|
-
"leadTimeImpact": "'minor'",
|
186
|
-
"priorityLevel": "'medium'"
|
187
|
-
},
|
188
|
-
{
|
189
|
-
"_id": "finalRule4",
|
190
|
-
"adjustedRiskScore": "",
|
191
|
-
"finalCategory": "'low'",
|
192
|
-
"leadTimeImpact": "'minimal'",
|
193
|
-
"priorityLevel": "'routine'"
|
194
|
-
}
|
195
|
-
],
|
196
|
-
"inputs": [
|
197
|
-
{
|
198
|
-
"id": "adjustedRiskScore",
|
199
|
-
"name": "Adjusted Risk Score",
|
200
|
-
"field": "adjustedRiskScore"
|
201
|
-
}
|
202
|
-
],
|
203
|
-
"outputs": [
|
204
|
-
{
|
205
|
-
"id": "finalCategory",
|
206
|
-
"name": "Final Risk Category",
|
207
|
-
"field": "finalAssessment.riskCategory"
|
208
|
-
},
|
209
|
-
{
|
210
|
-
"id": "leadTimeImpact",
|
211
|
-
"name": "Lead Time Impact",
|
212
|
-
"field": "finalAssessment.leadTimeImpact"
|
213
|
-
},
|
214
|
-
{
|
215
|
-
"id": "priorityLevel",
|
216
|
-
"name": "Priority Level",
|
217
|
-
"field": "finalAssessment.priorityLevel"
|
218
|
-
}
|
219
|
-
],
|
220
|
-
"passThrough": true,
|
221
|
-
"inputField": null,
|
222
|
-
"outputPath": null,
|
223
|
-
"executionMode": "single"
|
224
|
-
},
|
225
|
-
"id": "overallRiskAssessment",
|
226
|
-
"name": "overallRiskAssessment",
|
227
|
-
"position": {
|
228
|
-
"x": 1070,
|
229
|
-
"y": 114
|
230
|
-
}
|
231
|
-
}
|
232
|
-
],
|
233
|
-
"edges": [
|
234
|
-
{
|
235
|
-
"id": "edge1",
|
236
|
-
"sourceId": "input",
|
237
|
-
"targetId": "supplierRiskEvaluation",
|
238
|
-
"type": "edge"
|
239
|
-
},
|
240
|
-
{
|
241
|
-
"id": "edge2",
|
242
|
-
"sourceId": "supplierRiskEvaluation",
|
243
|
-
"targetId": "geopoliticalRiskCalculation",
|
244
|
-
"type": "edge"
|
245
|
-
},
|
246
|
-
{
|
247
|
-
"id": "edge3",
|
248
|
-
"sourceId": "geopoliticalRiskCalculation",
|
249
|
-
"targetId": "overallRiskAssessment",
|
250
|
-
"type": "edge"
|
251
|
-
}
|
252
|
-
]
|
253
|
-
}
|
@@ -1,237 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"nodes": [
|
3
|
-
{
|
4
|
-
"type": "inputNode",
|
5
|
-
"content": {
|
6
|
-
"schema": ""
|
7
|
-
},
|
8
|
-
"id": "ip1",
|
9
|
-
"name": "shipmentRequest",
|
10
|
-
"position": {
|
11
|
-
"x": 110,
|
12
|
-
"y": 173.5
|
13
|
-
}
|
14
|
-
},
|
15
|
-
{
|
16
|
-
"type": "expressionNode",
|
17
|
-
"content": {
|
18
|
-
"expressions": [
|
19
|
-
{
|
20
|
-
"id": "e1-1",
|
21
|
-
"key": "hasMatchingOutboundOrders",
|
22
|
-
"value": "len(matchingOutboundOrders) > 0"
|
23
|
-
},
|
24
|
-
{
|
25
|
-
"id": "e1-2",
|
26
|
-
"key": "timeDifferenceHours",
|
27
|
-
"value": "(date(outboundShipmentTime) - date(inboundShipmentTime)) / 3600"
|
28
|
-
},
|
29
|
-
{
|
30
|
-
"id": "e1-3",
|
31
|
-
"key": "warehouseCapacityPercentage",
|
32
|
-
"value": "(currentStorageUsed / totalStorageCapacity) * 100"
|
33
|
-
}
|
34
|
-
],
|
35
|
-
"passThrough": true,
|
36
|
-
"inputField": null,
|
37
|
-
"outputPath": null,
|
38
|
-
"executionMode": "single"
|
39
|
-
},
|
40
|
-
"id": "ex1",
|
41
|
-
"name": "calculateMetrics",
|
42
|
-
"position": {
|
43
|
-
"x": 430,
|
44
|
-
"y": 173.5
|
45
|
-
}
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"type": "decisionTableNode",
|
49
|
-
"content": {
|
50
|
-
"hitPolicy": "first",
|
51
|
-
"rules": [
|
52
|
-
{
|
53
|
-
"_id": "r1-1",
|
54
|
-
"i1-1": "true",
|
55
|
-
"i1-2": "[0..24]",
|
56
|
-
"i1-3": "<= 36",
|
57
|
-
"o1-1": "'cross-dock'",
|
58
|
-
"o1-2": "'Matching orders available within 24 hours with sufficient capacity'"
|
59
|
-
},
|
60
|
-
{
|
61
|
-
"_id": "r1-2",
|
62
|
-
"i1-1": "true",
|
63
|
-
"i1-2": "[0..48]",
|
64
|
-
"i1-3": "<= 80",
|
65
|
-
"o1-1": "'cross-dock'",
|
66
|
-
"o1-2": "'Matching orders available within 48 hours'"
|
67
|
-
},
|
68
|
-
{
|
69
|
-
"_id": "r1-3",
|
70
|
-
"i1-1": "true",
|
71
|
-
"i1-2": "> 48",
|
72
|
-
"i1-3": ">= 90",
|
73
|
-
"o1-1": "'cross-dock'",
|
74
|
-
"o1-2": "'High warehouse capacity, cross-dock to save space'"
|
75
|
-
},
|
76
|
-
{
|
77
|
-
"_id": "r1-4",
|
78
|
-
"i1-1": "true",
|
79
|
-
"i1-2": "> 72",
|
80
|
-
"i1-3": "",
|
81
|
-
"o1-1": "'store'",
|
82
|
-
"o1-2": "'Matching orders but time difference too large'"
|
83
|
-
},
|
84
|
-
{
|
85
|
-
"_id": "r1-5",
|
86
|
-
"i1-1": "false",
|
87
|
-
"i1-2": "",
|
88
|
-
"i1-3": "",
|
89
|
-
"o1-1": "'store'",
|
90
|
-
"o1-2": "'No matching outbound orders'"
|
91
|
-
}
|
92
|
-
],
|
93
|
-
"inputs": [
|
94
|
-
{
|
95
|
-
"id": "i1-1",
|
96
|
-
"name": "Has Matching Orders",
|
97
|
-
"field": "hasMatchingOutboundOrders"
|
98
|
-
},
|
99
|
-
{
|
100
|
-
"id": "i1-2",
|
101
|
-
"name": "Time Difference (hours)",
|
102
|
-
"field": "timeDifferenceHours"
|
103
|
-
},
|
104
|
-
{
|
105
|
-
"id": "i1-3",
|
106
|
-
"name": "Warehouse Capacity (%)",
|
107
|
-
"field": "warehouseCapacityPercentage"
|
108
|
-
}
|
109
|
-
],
|
110
|
-
"outputs": [
|
111
|
-
{
|
112
|
-
"id": "o1-1",
|
113
|
-
"name": "Decision",
|
114
|
-
"field": "crossDockDecision"
|
115
|
-
},
|
116
|
-
{
|
117
|
-
"id": "o1-2",
|
118
|
-
"name": "Reason",
|
119
|
-
"field": "decisionReason"
|
120
|
-
}
|
121
|
-
],
|
122
|
-
"passThrough": true,
|
123
|
-
"inputField": null,
|
124
|
-
"outputPath": null,
|
125
|
-
"executionMode": "single"
|
126
|
-
},
|
127
|
-
"id": "dt1",
|
128
|
-
"name": "crossDockingDecision",
|
129
|
-
"position": {
|
130
|
-
"x": 750,
|
131
|
-
"y": 173.5
|
132
|
-
}
|
133
|
-
},
|
134
|
-
{
|
135
|
-
"type": "switchNode",
|
136
|
-
"content": {
|
137
|
-
"hitPolicy": "first",
|
138
|
-
"statements": [
|
139
|
-
{
|
140
|
-
"id": "s1-1",
|
141
|
-
"condition": "crossDockDecision == 'cross-dock'",
|
142
|
-
"isDefault": false
|
143
|
-
},
|
144
|
-
{
|
145
|
-
"id": "s1-2",
|
146
|
-
"condition": "",
|
147
|
-
"isDefault": true
|
148
|
-
}
|
149
|
-
]
|
150
|
-
},
|
151
|
-
"id": "sw1",
|
152
|
-
"name": "handleCrossDocking",
|
153
|
-
"position": {
|
154
|
-
"x": 1070,
|
155
|
-
"y": 173.5
|
156
|
-
}
|
157
|
-
},
|
158
|
-
{
|
159
|
-
"type": "expressionNode",
|
160
|
-
"content": {
|
161
|
-
"expressions": [
|
162
|
-
{
|
163
|
-
"id": "e2-1",
|
164
|
-
"key": "dockingBay",
|
165
|
-
"value": "crossDockingBayAssignment"
|
166
|
-
},
|
167
|
-
{
|
168
|
-
"id": "e2-2",
|
169
|
-
"key": "estimatedProcessingTime",
|
170
|
-
"value": "30"
|
171
|
-
},
|
172
|
-
{
|
173
|
-
"id": "e2-3",
|
174
|
-
"key": "priority",
|
175
|
-
"value": "timeDifferenceHours < 12 ? 'high' : 'normal'"
|
176
|
-
}
|
177
|
-
],
|
178
|
-
"passThrough": true,
|
179
|
-
"inputField": null,
|
180
|
-
"outputPath": null,
|
181
|
-
"executionMode": "single"
|
182
|
-
},
|
183
|
-
"id": "ex2",
|
184
|
-
"name": "assignCrossDockingDetails",
|
185
|
-
"position": {
|
186
|
-
"x": 1390,
|
187
|
-
"y": 173.5
|
188
|
-
}
|
189
|
-
},
|
190
|
-
{
|
191
|
-
"type": "outputNode",
|
192
|
-
"content": {
|
193
|
-
"schema": ""
|
194
|
-
},
|
195
|
-
"id": "e1a7d99b-255e-47a2-929f-642fc0e7efc5",
|
196
|
-
"name": "response",
|
197
|
-
"position": {
|
198
|
-
"x": 1390,
|
199
|
-
"y": 305
|
200
|
-
}
|
201
|
-
}
|
202
|
-
],
|
203
|
-
"edges": [
|
204
|
-
{
|
205
|
-
"id": "ed1",
|
206
|
-
"sourceId": "ip1",
|
207
|
-
"targetId": "ex1",
|
208
|
-
"type": "edge"
|
209
|
-
},
|
210
|
-
{
|
211
|
-
"id": "ed2",
|
212
|
-
"sourceId": "ex1",
|
213
|
-
"targetId": "dt1",
|
214
|
-
"type": "edge"
|
215
|
-
},
|
216
|
-
{
|
217
|
-
"id": "ed3",
|
218
|
-
"sourceId": "dt1",
|
219
|
-
"targetId": "sw1",
|
220
|
-
"type": "edge"
|
221
|
-
},
|
222
|
-
{
|
223
|
-
"id": "ed4",
|
224
|
-
"sourceId": "sw1",
|
225
|
-
"targetId": "ex2",
|
226
|
-
"sourceHandle": "s1-1",
|
227
|
-
"type": "edge"
|
228
|
-
},
|
229
|
-
{
|
230
|
-
"id": "7d282229-bce6-47a6-a68d-ed867787a674",
|
231
|
-
"sourceId": "sw1",
|
232
|
-
"type": "edge",
|
233
|
-
"targetId": "e1a7d99b-255e-47a2-929f-642fc0e7efc5",
|
234
|
-
"sourceHandle": "s1-2"
|
235
|
-
}
|
236
|
-
]
|
237
|
-
}
|