@structupath/pi-steel 0.2.2 → 0.2.3

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 (47) hide show
  1. package/DATA_PROVENANCE.json +23 -0
  2. package/DATA_PROVENANCE.md +35 -0
  3. package/PUBLIC_DATA_POLICY.md +52 -0
  4. package/README.md +114 -33
  5. package/docs/assets/pi-steel-demo.gif +0 -0
  6. package/docs/assets/pi-steel-gallery.webp +0 -0
  7. package/package.json +35 -4
  8. package/pyproject.toml +28 -0
  9. package/requirements-dev.txt +5 -0
  10. package/requirements-render.txt +1 -0
  11. package/requirements-tested.txt +9 -0
  12. package/requirements.txt +7 -0
  13. package/scripts/check-data-provenance.py +140 -0
  14. package/scripts/check-public-data.py +401 -0
  15. package/scripts/doctor.py +127 -0
  16. package/skills/_shared/bootstrap.py +32 -0
  17. package/skills/_shared/pi_steel/__init__.py +47 -0
  18. package/skills/_shared/pi_steel/cli.py +167 -0
  19. package/skills/_shared/pi_steel/contracts.py +87 -0
  20. package/skills/_shared/pi_steel/geometry_verify.py +243 -0
  21. package/skills/_shared/pi_steel/parsing.py +205 -0
  22. package/skills/_shared/pi_steel/run_manifest.py +317 -0
  23. package/skills/_shared/pi_steel/validation.py +597 -0
  24. package/skills/_shared/schemas/estimate-package.schema.json +424 -0
  25. package/skills/_shared/schemas/nest-result.schema.json +443 -0
  26. package/skills/_shared/schemas/run-manifest.schema.json +145 -0
  27. package/skills/steel-estimate/SKILL.md +119 -0
  28. package/skills/steel-estimate/references/estimate-package-example.json +91 -0
  29. package/skills/steel-estimate/references/output-contract.md +47 -0
  30. package/skills/steel-estimate/scripts/acknowledge-finding.py +193 -0
  31. package/skills/steel-estimate/scripts/build-estimate-package.py +836 -0
  32. package/skills/steel-nest/SKILL.md +50 -23
  33. package/skills/steel-nest/references/FIXTURE_PROVENANCE.md +12 -0
  34. package/skills/steel-nest/references/example_job.json +21 -25
  35. package/skills/steel-nest/references/job_template.json +11 -9
  36. package/skills/steel-nest/scripts/nest.py +1276 -250
  37. package/skills/steel-rfq/SKILL.md +93 -175
  38. package/skills/steel-rfq/assets/company-profile.example.json +11 -5
  39. package/skills/steel-rfq/references/rfq-input.md +58 -0
  40. package/skills/steel-rfq/scripts/generate-rfq.py +1221 -0
  41. package/skills/steel-rfq/scripts/recalc.py +33 -10
  42. package/skills/steel-takeoff/SKILL.md +12 -8
  43. package/skills/steel-takeoff/assets/bom-template.csv +1 -1
  44. package/skills/steel-takeoff/references/takeoff-procedures.md +3 -1
  45. package/skills/steel-takeoff/scripts/calculate-weight.sh +5 -10
  46. package/skills/steel-takeoff/scripts/lookup-member.sh +2 -2
  47. package/skills/steel-takeoff/scripts/validate-bom.py +151 -196
@@ -0,0 +1,424 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://structupath.ai/schemas/pi-steel/estimate-package-1.0.0.json",
4
+ "title": "pi-steel canonical estimate package",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "project",
9
+ "unit_system",
10
+ "items",
11
+ "stock",
12
+ "commercial_basis",
13
+ "review",
14
+ "lineage"
15
+ ],
16
+ "properties": {
17
+ "schema_version": { "const": "1.0.0" },
18
+ "project": { "$ref": "#/$defs/project" },
19
+ "unit_system": { "const": "imperial" },
20
+ "items": {
21
+ "type": "array",
22
+ "items": { "$ref": "#/$defs/item" }
23
+ },
24
+ "stock": {
25
+ "type": "array",
26
+ "items": { "$ref": "#/$defs/stock" }
27
+ },
28
+ "commercial_basis": { "$ref": "#/$defs/commercialBasis" },
29
+ "assumptions": {
30
+ "type": "array",
31
+ "items": { "$ref": "#/$defs/assumption" },
32
+ "default": []
33
+ },
34
+ "review": { "$ref": "#/$defs/review" },
35
+ "lineage": { "$ref": "#/$defs/lineage" }
36
+ },
37
+ "additionalProperties": false,
38
+ "$defs": {
39
+ "project": {
40
+ "type": "object",
41
+ "required": ["project_id", "revision"],
42
+ "properties": {
43
+ "project_id": { "type": "string", "minLength": 1 },
44
+ "name": { "type": "string" },
45
+ "estimator": { "type": "string", "minLength": 1 },
46
+ "estimate_as_of": { "type": "string", "format": "date" },
47
+ "revision": {
48
+ "type": "object",
49
+ "required": ["revision_id"],
50
+ "properties": {
51
+ "revision_id": { "type": "string", "minLength": 1 },
52
+ "source_document": { "type": "string" },
53
+ "issued_date": { "type": "string", "format": "date" }
54
+ },
55
+ "additionalProperties": false
56
+ }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ "evidence": {
61
+ "type": "object",
62
+ "required": ["source", "locator"],
63
+ "properties": {
64
+ "source": { "type": "string", "minLength": 1 },
65
+ "locator": { "type": "string", "minLength": 1 },
66
+ "sheet": { "type": "string", "minLength": 1 },
67
+ "detail": { "type": "string", "minLength": 1 },
68
+ "source_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
69
+ },
70
+ "additionalProperties": false
71
+ },
72
+ "hole": {
73
+ "oneOf": [
74
+ {
75
+ "type": "object",
76
+ "required": ["kind", "diameter", "x", "y"],
77
+ "properties": {
78
+ "kind": { "const": "round" },
79
+ "diameter": { "type": "number", "exclusiveMinimum": 0 },
80
+ "x": { "type": "number" },
81
+ "y": { "type": "number" }
82
+ },
83
+ "additionalProperties": false
84
+ },
85
+ {
86
+ "type": "object",
87
+ "required": ["kind", "width", "height", "x", "y"],
88
+ "properties": {
89
+ "kind": { "const": "rect" },
90
+ "width": { "type": "number", "exclusiveMinimum": 0 },
91
+ "height": { "type": "number", "exclusiveMinimum": 0 },
92
+ "x": { "type": "number" },
93
+ "y": { "type": "number" }
94
+ },
95
+ "additionalProperties": false
96
+ }
97
+ ]
98
+ },
99
+ "geometry": {
100
+ "type": "object",
101
+ "required": ["shape", "width", "height", "thickness"],
102
+ "properties": {
103
+ "shape": { "type": "string" },
104
+ "width": { "type": "number", "exclusiveMinimum": 0 },
105
+ "height": { "type": "number", "exclusiveMinimum": 0 },
106
+ "thickness": { "type": "number", "exclusiveMinimum": 0 },
107
+ "area": { "type": "number", "exclusiveMinimum": 0 },
108
+ "holes": {
109
+ "type": "array",
110
+ "items": { "$ref": "#/$defs/hole" },
111
+ "default": []
112
+ },
113
+ "rotatable": { "type": "boolean", "default": true }
114
+ },
115
+ "additionalProperties": false
116
+ },
117
+ "itemBase": {
118
+ "type": "object",
119
+ "required": ["intent", "source_id", "item_id", "quantity"],
120
+ "properties": {
121
+ "intent": {
122
+ "enum": [
123
+ "fabricated_part",
124
+ "purchased_stock",
125
+ "hardware",
126
+ "allowance",
127
+ "exclusion",
128
+ "by_others"
129
+ ]
130
+ },
131
+ "source_id": { "type": "string", "minLength": 1 },
132
+ "item_id": { "type": "string", "minLength": 1 },
133
+ "quantity": { "type": "integer", "minimum": 1 },
134
+ "quantity_basis": { "$ref": "#/$defs/quantityBasis" },
135
+ "mark": { "type": "string" },
136
+ "description": { "type": "string" },
137
+ "source_evidence": {
138
+ "type": "array",
139
+ "items": { "$ref": "#/$defs/evidence" }
140
+ }
141
+ }
142
+ },
143
+ "fabricatedPart": {
144
+ "allOf": [
145
+ { "$ref": "#/$defs/itemBase" },
146
+ {
147
+ "type": "object",
148
+ "required": ["intent"],
149
+ "properties": {
150
+ "intent": { "const": "fabricated_part" },
151
+ "material": { "type": "string" },
152
+ "grade": { "type": "string" },
153
+ "geometry": { "$ref": "#/$defs/geometry" },
154
+ "designation": { "type": "string" },
155
+ "length_ft": { "type": "number", "exclusiveMinimum": 0 },
156
+ "unit_weight_plf": { "type": "number", "exclusiveMinimum": 0 },
157
+ "total_weight_lbs": { "type": "number", "exclusiveMinimum": 0 },
158
+ "connections": { "type": "string" },
159
+ "notes": { "type": "string" },
160
+ "identity_warning": { "type": "boolean" }
161
+ }
162
+ }
163
+ ],
164
+ "unevaluatedProperties": false
165
+ },
166
+ "purchased": {
167
+ "allOf": [
168
+ { "$ref": "#/$defs/itemBase" },
169
+ {
170
+ "type": "object",
171
+ "required": ["intent"],
172
+ "properties": {
173
+ "intent": { "enum": ["purchased_stock", "hardware"] },
174
+ "material": { "type": "string" },
175
+ "grade": { "type": "string" },
176
+ "specification": { "type": "string" },
177
+ "dimensions": { "$ref": "#/$defs/purchaseDimensions" }
178
+ }
179
+ }
180
+ ],
181
+ "unevaluatedProperties": false
182
+ },
183
+ "allowance": {
184
+ "allOf": [
185
+ { "$ref": "#/$defs/itemBase" },
186
+ {
187
+ "type": "object",
188
+ "required": ["intent", "allowance_basis"],
189
+ "properties": {
190
+ "intent": { "const": "allowance" },
191
+ "allowance_basis": {
192
+ "type": "object",
193
+ "required": ["kind", "value", "applies_to"],
194
+ "properties": {
195
+ "kind": { "enum": ["percent", "fixed_weight"] },
196
+ "value": { "type": "number", "exclusiveMinimum": 0 },
197
+ "applies_to": { "type": "string", "minLength": 1 },
198
+ "source": { "type": "string", "minLength": 1 },
199
+ "effective_date": { "type": "string", "format": "date" },
200
+ "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }
201
+ },
202
+ "additionalProperties": false
203
+ }
204
+ }
205
+ }
206
+ ],
207
+ "unevaluatedProperties": false
208
+ },
209
+ "nonSupply": {
210
+ "allOf": [
211
+ { "$ref": "#/$defs/itemBase" },
212
+ {
213
+ "type": "object",
214
+ "required": ["intent", "reason"],
215
+ "properties": {
216
+ "intent": { "enum": ["exclusion", "by_others"] },
217
+ "reason": { "type": "string", "minLength": 1 }
218
+ }
219
+ }
220
+ ],
221
+ "unevaluatedProperties": false
222
+ },
223
+ "item": {
224
+ "oneOf": [
225
+ { "$ref": "#/$defs/fabricatedPart" },
226
+ { "$ref": "#/$defs/purchased" },
227
+ { "$ref": "#/$defs/allowance" },
228
+ { "$ref": "#/$defs/nonSupply" }
229
+ ]
230
+ },
231
+ "stock": {
232
+ "type": "object",
233
+ "required": [
234
+ "stock_kind",
235
+ "material",
236
+ "grade",
237
+ "width",
238
+ "height",
239
+ "thickness",
240
+ "quantity"
241
+ ],
242
+ "properties": {
243
+ "stock_kind": { "enum": ["on_hand", "purchasable"] },
244
+ "inventory_id": { "type": "string", "minLength": 1 },
245
+ "material": { "type": "string", "minLength": 1 },
246
+ "grade": { "type": "string", "minLength": 1 },
247
+ "width": { "type": "number", "exclusiveMinimum": 0 },
248
+ "height": { "type": "number", "exclusiveMinimum": 0 },
249
+ "thickness": { "type": "number", "exclusiveMinimum": 0 },
250
+ "quantity": { "type": "integer", "minimum": 1 },
251
+ "status": { "enum": ["available", "reserved", "unavailable"] },
252
+ "measured_at": { "type": "string", "format": "date" },
253
+ "source": { "type": "string" },
254
+ "reviewer_confirmation": {
255
+ "type": "object",
256
+ "required": ["actor", "timestamp", "estimate_hash"],
257
+ "properties": {
258
+ "actor": { "type": "string", "minLength": 1 },
259
+ "timestamp": { "type": "string", "format": "date-time" },
260
+ "estimate_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
261
+ },
262
+ "additionalProperties": false
263
+ }
264
+ },
265
+ "additionalProperties": false
266
+ },
267
+ "commercialBasis": {
268
+ "type": "object",
269
+ "required": ["currency", "costs"],
270
+ "properties": {
271
+ "currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
272
+ "costs": {
273
+ "type": "array",
274
+ "items": {
275
+ "type": "object",
276
+ "required": [
277
+ "cost_id",
278
+ "amount",
279
+ "currency",
280
+ "unit_basis",
281
+ "effective_date",
282
+ "source"
283
+ ],
284
+ "properties": {
285
+ "cost_id": { "type": "string", "minLength": 1 },
286
+ "amount": { "type": "number", "exclusiveMinimum": 0 },
287
+ "currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
288
+ "unit_basis": { "type": "string", "minLength": 1 },
289
+ "effective_date": { "type": "string", "format": "date" },
290
+ "source": { "type": "string", "minLength": 1 },
291
+ "synthetic": { "type": "boolean" }
292
+ },
293
+ "additionalProperties": false
294
+ }
295
+ }
296
+ },
297
+ "additionalProperties": false
298
+ },
299
+ "quantityBasis": {
300
+ "type": "object",
301
+ "required": ["method"],
302
+ "properties": {
303
+ "method": { "type": "string", "minLength": 1 },
304
+ "description": { "type": "string", "minLength": 1 },
305
+ "source_evidence": {
306
+ "type": "array",
307
+ "items": { "$ref": "#/$defs/evidence" }
308
+ }
309
+ },
310
+ "additionalProperties": false
311
+ },
312
+ "purchaseDimensions": {
313
+ "type": "object",
314
+ "properties": {
315
+ "category": { "type": "string", "minLength": 1 },
316
+ "size": { "type": "string", "minLength": 1 },
317
+ "purchase_weight_lbs": {
318
+ "type": "number",
319
+ "exclusiveMinimum": 0
320
+ },
321
+ "stock_length": { "type": "number", "exclusiveMinimum": 0 },
322
+ "thickness": { "type": "number", "exclusiveMinimum": 0 },
323
+ "width": { "type": "number", "exclusiveMinimum": 0 },
324
+ "height": { "type": "number", "exclusiveMinimum": 0 },
325
+ "replaces_item_ids": {
326
+ "type": "array",
327
+ "items": { "type": "string", "minLength": 1 },
328
+ "uniqueItems": true
329
+ },
330
+ "inventory_id": { "type": "string", "minLength": 1 },
331
+ "stock_id": { "type": "string", "minLength": 1 }
332
+ },
333
+ "additionalProperties": false
334
+ },
335
+ "assumption": {
336
+ "type": "object",
337
+ "required": ["assumption_id", "text", "status"],
338
+ "properties": {
339
+ "assumption_id": { "type": "string", "minLength": 1 },
340
+ "text": { "type": "string", "minLength": 1 },
341
+ "status": { "enum": ["unresolved", "confirmed", "rejected"] },
342
+ "source_evidence": {
343
+ "type": "array",
344
+ "items": { "$ref": "#/$defs/evidence" }
345
+ }
346
+ },
347
+ "additionalProperties": false
348
+ },
349
+ "finding": {
350
+ "type": "object",
351
+ "required": [
352
+ "finding_id",
353
+ "code",
354
+ "severity",
355
+ "path",
356
+ "message",
357
+ "relevant_hash"
358
+ ],
359
+ "properties": {
360
+ "finding_id": { "type": "string", "minLength": 1 },
361
+ "code": { "type": "string", "minLength": 1 },
362
+ "severity": { "enum": ["blocker", "warning", "info"] },
363
+ "path": { "type": "string", "minLength": 1 },
364
+ "message": { "type": "string", "minLength": 1 },
365
+ "relevant_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
366
+ },
367
+ "additionalProperties": false
368
+ },
369
+ "review": {
370
+ "type": "object",
371
+ "required": ["status", "findings", "acknowledgements"],
372
+ "properties": {
373
+ "status": {
374
+ "enum": ["draft", "review_required", "validated", "invalid"]
375
+ },
376
+ "findings": {
377
+ "type": "array",
378
+ "items": { "$ref": "#/$defs/finding" }
379
+ },
380
+ "acknowledgements": {
381
+ "type": "array",
382
+ "items": {
383
+ "type": "object",
384
+ "required": [
385
+ "finding_id",
386
+ "actor",
387
+ "timestamp",
388
+ "disposition",
389
+ "input_hash"
390
+ ],
391
+ "properties": {
392
+ "finding_id": { "type": "string", "minLength": 1 },
393
+ "actor": { "type": "string", "minLength": 1 },
394
+ "timestamp": { "type": "string", "format": "date-time" },
395
+ "disposition": {
396
+ "enum": ["accepted", "rejected", "deferred"]
397
+ },
398
+ "input_hash": {
399
+ "type": "string",
400
+ "pattern": "^[0-9a-f]{64}$"
401
+ }
402
+ },
403
+ "additionalProperties": false
404
+ }
405
+ }
406
+ },
407
+ "additionalProperties": false
408
+ },
409
+ "lineage": {
410
+ "type": "object",
411
+ "required": ["source_type", "source_hash", "configuration_hash"],
412
+ "properties": {
413
+ "source_type": { "type": "string", "minLength": 1 },
414
+ "source_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
415
+ "configuration_hash": {
416
+ "type": "string",
417
+ "pattern": "^[0-9a-f]{64}$"
418
+ },
419
+ "generated_at": { "type": "string", "format": "date-time" }
420
+ },
421
+ "additionalProperties": false
422
+ }
423
+ }
424
+ }