@tiangong-lca/foundry 0.1.16 → 0.1.18

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 (114) hide show
  1. package/README.md +23 -7
  2. package/docs/architecture.md +19 -5
  3. package/docs/foundry-task-contracts.md +27 -3
  4. package/docs/package-distribution-contract.md +47 -15
  5. package/docs/public-runtime-contract.md +77 -5
  6. package/docs/runtime-context-contract.md +21 -5
  7. package/docs/task-authorization-contract.md +15 -3
  8. package/docs/workspace-migration-contract.md +5 -3
  9. package/package-dist/assets/foundry-package-descriptor.json +351 -137
  10. package/package-dist/scripts/foundry-facade.d.ts +5 -0
  11. package/package-dist/scripts/foundry-facade.js +258 -16
  12. package/package-dist/scripts/foundry-runtime.d.ts +1 -1
  13. package/package-dist/scripts/lib/bundle-sample-utils.d.ts +4 -4
  14. package/package-dist/scripts/lib/bundle-source-context.d.ts +6 -4
  15. package/package-dist/scripts/lib/bundle-source-context.js +10 -8
  16. package/package-dist/scripts/lib/decision-owners/identity-preflight.js +16 -6
  17. package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +2 -1
  18. package/package-dist/scripts/lib/finalize-owners/post-authoring.js +28 -1
  19. package/package-dist/scripts/lib/foundry-assessment-producer.d.ts +6 -0
  20. package/package-dist/scripts/lib/foundry-assessment-producer.js +167 -0
  21. package/package-dist/scripts/lib/foundry-command-metadata.js +6 -1
  22. package/package-dist/scripts/lib/foundry-decision-owners.d.ts +1 -1
  23. package/package-dist/scripts/lib/foundry-decision-owners.js +15 -7
  24. package/package-dist/scripts/lib/foundry-execution-admission.js +4 -1
  25. package/package-dist/scripts/lib/foundry-finalize-owners.js +64 -17
  26. package/package-dist/scripts/lib/foundry-identity-stage-input.d.ts +24 -0
  27. package/package-dist/scripts/lib/foundry-identity-stage-input.js +122 -0
  28. package/package-dist/scripts/lib/foundry-identity-stage-state.d.ts +17 -0
  29. package/package-dist/scripts/lib/foundry-identity-stage-state.js +48 -0
  30. package/package-dist/scripts/lib/foundry-installed-entry.d.ts +2 -0
  31. package/package-dist/scripts/lib/foundry-installed-entry.js +173 -0
  32. package/package-dist/scripts/lib/foundry-managed-adoption.d.ts +12 -0
  33. package/package-dist/scripts/lib/foundry-managed-adoption.js +108 -0
  34. package/package-dist/scripts/lib/foundry-managed-authentication.d.ts +4 -0
  35. package/package-dist/scripts/lib/foundry-managed-authentication.js +28 -0
  36. package/package-dist/scripts/lib/foundry-managed-host.js +14 -2
  37. package/package-dist/scripts/lib/foundry-migration-transfer-io.d.ts +2 -0
  38. package/package-dist/scripts/lib/foundry-migration-transfer-io.js +27 -3
  39. package/package-dist/scripts/lib/foundry-operation-result.d.ts +1 -1
  40. package/package-dist/scripts/lib/foundry-operation-result.js +1 -0
  41. package/package-dist/scripts/lib/foundry-package-contract.d.ts +4 -4
  42. package/package-dist/scripts/lib/foundry-package-contract.js +10 -2
  43. package/package-dist/scripts/lib/foundry-preparation-cli-validation.d.ts +22 -0
  44. package/package-dist/scripts/lib/foundry-preparation-cli-validation.js +213 -0
  45. package/package-dist/scripts/lib/foundry-quality-review-context.d.ts +3 -0
  46. package/package-dist/scripts/lib/foundry-quality-review-context.js +18 -0
  47. package/package-dist/scripts/lib/foundry-quality-review-input.d.ts +48 -0
  48. package/package-dist/scripts/lib/foundry-quality-review-input.js +284 -0
  49. package/package-dist/scripts/lib/foundry-quality-review-lineage.d.ts +13 -0
  50. package/package-dist/scripts/lib/foundry-quality-review-lineage.js +123 -0
  51. package/package-dist/scripts/lib/foundry-quality-review.d.ts +112 -0
  52. package/package-dist/scripts/lib/foundry-quality-review.js +487 -0
  53. package/package-dist/scripts/lib/foundry-runtime-identity.js +3 -1
  54. package/package-dist/scripts/lib/foundry-runtime-qualification.js +2 -2
  55. package/package-dist/scripts/lib/foundry-runtime-utils.js +1 -1
  56. package/package-dist/scripts/lib/foundry-task-authorization.d.ts +2 -1
  57. package/package-dist/scripts/lib/foundry-task-authorization.js +32 -11
  58. package/package-dist/scripts/lib/foundry-task-registration.js +4 -5
  59. package/package-dist/scripts/lib/foundry-task-runtime-adoption-write.d.ts +28 -0
  60. package/package-dist/scripts/lib/foundry-task-runtime-adoption-write.js +250 -0
  61. package/package-dist/scripts/lib/foundry-task-runtime-adoption.d.ts +60 -0
  62. package/package-dist/scripts/lib/foundry-task-runtime-adoption.js +549 -0
  63. package/package-dist/scripts/lib/foundry-task-store.d.ts +4 -1
  64. package/package-dist/scripts/lib/foundry-task-store.js +113 -4
  65. package/package-dist/scripts/lib/foundry-task-types.d.ts +2 -1
  66. package/package-dist/scripts/lib/foundry-validation-reference-context.d.ts +8 -0
  67. package/package-dist/scripts/lib/foundry-validation-reference-context.js +115 -0
  68. package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +1 -0
  69. package/package-dist/scripts/lib/foundry-workflow-assessment.js +149 -18
  70. package/package-dist/scripts/lib/foundry-workflow-authorization.js +17 -4
  71. package/package-dist/scripts/lib/foundry-workflow-child-failure.d.ts +44 -0
  72. package/package-dist/scripts/lib/foundry-workflow-child-failure.js +439 -0
  73. package/package-dist/scripts/lib/foundry-workflow-context.js +37 -8
  74. package/package-dist/scripts/lib/foundry-workflow-finalize.js +37 -0
  75. package/package-dist/scripts/lib/foundry-workflow-identity-recovery.d.ts +6 -0
  76. package/package-dist/scripts/lib/foundry-workflow-identity-recovery.js +450 -0
  77. package/package-dist/scripts/lib/foundry-workflow-identity-stage.d.ts +9 -0
  78. package/package-dist/scripts/lib/foundry-workflow-identity-stage.js +676 -0
  79. package/package-dist/scripts/lib/foundry-workflow-identity.js +10 -1
  80. package/package-dist/scripts/lib/foundry-workflow-io.d.ts +7 -1
  81. package/package-dist/scripts/lib/foundry-workflow-io.js +79 -13
  82. package/package-dist/scripts/lib/foundry-workflow-semantic.js +27 -13
  83. package/package-dist/scripts/lib/foundry-workflow-state.d.ts +4 -0
  84. package/package-dist/scripts/lib/foundry-workflow-state.js +175 -22
  85. package/package-dist/scripts/lib/identity-preflight-artifacts.d.ts +4 -7
  86. package/package-dist/scripts/lib/identity-preflight-artifacts.js +18 -5
  87. package/package-dist/scripts/lib/identity-preflight-proof.d.ts +5 -0
  88. package/package-dist/scripts/lib/identity-preflight-proof.js +73 -1
  89. package/package-dist/scripts/lib/identity-preflight-recovery-proof.d.ts +78 -0
  90. package/package-dist/scripts/lib/identity-preflight-recovery-proof.js +415 -0
  91. package/package-dist/scripts/lib/import-curation/curation-cleanup.d.ts +9 -1
  92. package/package-dist/scripts/lib/import-curation/curation-cleanup.js +39 -2
  93. package/package-dist/scripts/lib/import-curation/curation-gate.d.ts +6 -1
  94. package/package-dist/scripts/lib/import-curation/curation-gate.js +48 -2
  95. package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +1 -1
  96. package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.js +11 -2
  97. package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.js +4 -1
  98. package/package-dist/scripts/lib/tidas-adapter.js +38 -15
  99. package/package-dist/scripts/lib/tidas-process-flow-context.d.ts +12 -0
  100. package/package-dist/scripts/lib/tidas-process-flow-context.js +96 -0
  101. package/package-dist/scripts/package-entry.js +2 -3
  102. package/package-dist/scripts/public-api.d.ts +5 -0
  103. package/package-dist/scripts/public-api.js +2 -0
  104. package/package-dist/scripts/runtime-entry.d.ts +2 -0
  105. package/package-dist/scripts/runtime-entry.js +42 -15
  106. package/package.json +6 -2
  107. package/specs/schemas/foundry-identity-stage-input.schema.json +47 -0
  108. package/specs/schemas/foundry-managed-adoption.schema.json +40 -0
  109. package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
  110. package/specs/schemas/foundry-operation-result.schema.json +1 -0
  111. package/specs/schemas/foundry-package-descriptor.schema.json +6 -2
  112. package/specs/schemas/foundry-quality-review-draft.schema.json +271 -0
  113. package/specs/schemas/foundry-quality-review-input.schema.json +271 -0
  114. package/specs/schemas/runtime-qualification.schema.json +1 -1
@@ -0,0 +1,271 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Foundry Quality Review Input v1",
4
+ "$comment": "The parser additionally validates real UTC timestamps and the positive <=24h interval, unique projected row/identity/finding keys, and complete per-review evidence resolution with both kinds and no unused evidence.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema",
9
+ "binding",
10
+ "runtime_qualification_sha256",
11
+ "rows_manifest_sha256",
12
+ "assessment_sha256",
13
+ "context_sha256",
14
+ "qa_report_sha256",
15
+ "qa_findings_sha256",
16
+ "reference_inputs_sha256",
17
+ "interaction_context_sha256",
18
+ "expected_previous_sha256",
19
+ "issued_at_utc",
20
+ "expires_at_utc",
21
+ "reviews",
22
+ "evidence"
23
+ ],
24
+ "properties": {
25
+ "schema": {
26
+ "const": "tiangong-foundry.quality-review-input.v1"
27
+ },
28
+ "binding": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": [
32
+ "workspace_id",
33
+ "actor_id",
34
+ "project_ref",
35
+ "user_id",
36
+ "profile_id",
37
+ "task_id",
38
+ "profile_sha256",
39
+ "input_scope_sha256"
40
+ ],
41
+ "properties": {
42
+ "workspace_id": {
43
+ "type": "string",
44
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
45
+ },
46
+ "actor_id": {
47
+ "type": "string",
48
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
49
+ },
50
+ "project_ref": {
51
+ "type": "string",
52
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
53
+ },
54
+ "user_id": {
55
+ "type": "string",
56
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
57
+ },
58
+ "profile_id": {
59
+ "type": "string",
60
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
61
+ },
62
+ "task_id": {
63
+ "type": "string",
64
+ "pattern": "^task-[0-9a-f]{64}-r[0-9]{4}$"
65
+ },
66
+ "profile_sha256": {
67
+ "type": "string",
68
+ "pattern": "^[0-9a-f]{64}$"
69
+ },
70
+ "input_scope_sha256": {
71
+ "type": "string",
72
+ "pattern": "^[0-9a-f]{64}$"
73
+ }
74
+ }
75
+ },
76
+ "runtime_qualification_sha256": {
77
+ "type": "string",
78
+ "pattern": "^[0-9a-f]{64}$"
79
+ },
80
+ "rows_manifest_sha256": {
81
+ "type": "string",
82
+ "pattern": "^[0-9a-f]{64}$"
83
+ },
84
+ "assessment_sha256": {
85
+ "type": "string",
86
+ "pattern": "^[0-9a-f]{64}$"
87
+ },
88
+ "context_sha256": {
89
+ "type": "string",
90
+ "pattern": "^[0-9a-f]{64}$"
91
+ },
92
+ "qa_report_sha256": {
93
+ "type": "string",
94
+ "pattern": "^[0-9a-f]{64}$"
95
+ },
96
+ "qa_findings_sha256": {
97
+ "type": "string",
98
+ "pattern": "^[0-9a-f]{64}$"
99
+ },
100
+ "reference_inputs_sha256": {
101
+ "anyOf": [
102
+ {
103
+ "type": "string",
104
+ "pattern": "^[0-9a-f]{64}$"
105
+ },
106
+ {
107
+ "type": "null"
108
+ }
109
+ ]
110
+ },
111
+ "expected_previous_sha256": {
112
+ "anyOf": [
113
+ {
114
+ "type": "string",
115
+ "pattern": "^[0-9a-f]{64}$"
116
+ },
117
+ {
118
+ "type": "null"
119
+ }
120
+ ]
121
+ },
122
+ "issued_at_utc": {
123
+ "type": "string",
124
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
125
+ },
126
+ "expires_at_utc": {
127
+ "type": "string",
128
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
129
+ },
130
+ "reviews": {
131
+ "type": "array",
132
+ "minItems": 1,
133
+ "maxItems": 128,
134
+ "uniqueItems": true,
135
+ "items": {
136
+ "$ref": "#/$defs/review"
137
+ }
138
+ },
139
+ "evidence": {
140
+ "type": "array",
141
+ "minItems": 1,
142
+ "maxItems": 100,
143
+ "uniqueItems": true,
144
+ "items": {
145
+ "$ref": "#/$defs/evidence"
146
+ },
147
+ "allOf": [
148
+ {
149
+ "contains": {
150
+ "type": "object",
151
+ "properties": {
152
+ "kind": {
153
+ "const": "user-decision"
154
+ }
155
+ },
156
+ "required": ["kind"]
157
+ }
158
+ },
159
+ {
160
+ "contains": {
161
+ "type": "object",
162
+ "properties": {
163
+ "kind": {
164
+ "const": "source-model"
165
+ }
166
+ },
167
+ "required": ["kind"]
168
+ }
169
+ }
170
+ ]
171
+ },
172
+ "interaction_context_sha256": {
173
+ "anyOf": [
174
+ {
175
+ "type": "string",
176
+ "pattern": "^[0-9a-f]{64}$"
177
+ },
178
+ {
179
+ "type": "null"
180
+ }
181
+ ]
182
+ }
183
+ },
184
+ "$defs": {
185
+ "review": {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": [
189
+ "row_index",
190
+ "id",
191
+ "version",
192
+ "payload_sha256",
193
+ "finding_sha256",
194
+ "code",
195
+ "evidence_ids",
196
+ "rationale"
197
+ ],
198
+ "properties": {
199
+ "row_index": {
200
+ "type": "integer",
201
+ "minimum": 0,
202
+ "maximum": 9007199254740991
203
+ },
204
+ "id": {
205
+ "type": "string",
206
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
207
+ },
208
+ "version": {
209
+ "type": "string",
210
+ "pattern": "^[0-9]{2}\\.[0-9]{2}\\.[0-9]{3}$"
211
+ },
212
+ "payload_sha256": {
213
+ "type": "string",
214
+ "pattern": "^[0-9a-f]{64}$"
215
+ },
216
+ "finding_sha256": {
217
+ "type": "string",
218
+ "pattern": "^[0-9a-f]{64}$"
219
+ },
220
+ "code": {
221
+ "const": "process_material_balance_deviation"
222
+ },
223
+ "evidence_ids": {
224
+ "type": "array",
225
+ "minItems": 1,
226
+ "maxItems": 100,
227
+ "uniqueItems": true,
228
+ "items": {
229
+ "type": "string",
230
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
231
+ }
232
+ },
233
+ "rationale": {
234
+ "type": "string",
235
+ "minLength": 1,
236
+ "maxLength": 8192,
237
+ "pattern": "\\S"
238
+ }
239
+ }
240
+ },
241
+ "evidence": {
242
+ "type": "object",
243
+ "additionalProperties": false,
244
+ "required": ["id", "kind", "file", "sha256"],
245
+ "properties": {
246
+ "id": {
247
+ "type": "string",
248
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,255}$"
249
+ },
250
+ "kind": {
251
+ "enum": ["user-decision", "source-model"]
252
+ },
253
+ "file": {
254
+ "type": "string",
255
+ "minLength": 1,
256
+ "maxLength": 4096,
257
+ "pattern": "^[^\\u0000\\r\\n]+$",
258
+ "allOf": [
259
+ {
260
+ "pattern": "\\S"
261
+ }
262
+ ]
263
+ },
264
+ "sha256": {
265
+ "type": "string",
266
+ "pattern": "^[0-9a-f]{64}$"
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
@@ -14,7 +14,7 @@
14
14
  "additionalProperties": false,
15
15
  "required": ["package_version", "platform", "content_sha256", "node_version", "node_sha256"],
16
16
  "properties": {
17
- "package_version": { "const": "0.1.26" },
17
+ "package_version": { "const": "0.1.28" },
18
18
  "platform": {
19
19
  "enum": ["linux-x64", "linux-arm64", "darwin-arm64", "win32-x64"]
20
20
  },