@tiangong-lca/foundry 0.1.11 → 0.1.12
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.
- package/README.md +3 -3
- package/docs/architecture.md +3 -3
- package/docs/foundry-task-contracts.md +6 -4
- package/docs/package-distribution-contract.md +3 -3
- package/docs/public-runtime-contract.md +8 -4
- package/docs/runtime-context-contract.md +5 -3
- package/package-dist/assets/foundry-package-descriptor.json +21 -21
- package/package-dist/scripts/foundry-facade.js +105 -14
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +1 -1
- package/package-dist/scripts/lib/foundry-package-contract.js +1 -1
- package/package-dist/scripts/lib/foundry-workflow-assessment.js +174 -2
- package/package.json +1 -1
- package/specs/schemas/foundry-package-descriptor.schema.json +1 -1
package/README.md
CHANGED
|
@@ -158,9 +158,9 @@ checkPaths:
|
|
|
158
158
|
- test/unit/lint-suppression-audit.test.mts
|
|
159
159
|
- test/unit/zero-javascript-ratchet.test.mts
|
|
160
160
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
161
|
-
lastReviewedAt: 2026-09-
|
|
162
|
-
lastReviewedCommit:
|
|
163
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
161
|
+
lastReviewedAt: 2026-09-24
|
|
162
|
+
lastReviewedCommit: 05e4bd11b08276d092d10051b3f4f376c2af52ef
|
|
163
|
+
lastReviewedNote: "Reviewed for Foundry #197: release-only 0.1.12 identity projection from exact merged #200 main 05e4bd11b08276d092d10051b3f4f376c2af52ef; #196 early-question continuation and #200 indexed, human-readable blocked-queue behavior are already in the base. This projection changes no runtime behavior, CLI pin, dependencies, scientific or permission gates. Signed publication and installed qualification remain separate release gates."
|
|
164
164
|
---
|
|
165
165
|
|
|
166
166
|
# TianGong LCA Data Foundry
|
package/docs/architecture.md
CHANGED
|
@@ -152,9 +152,9 @@ checkPaths:
|
|
|
152
152
|
- test/unit/foundry-runtime-environment.test.mts
|
|
153
153
|
- test/unit/lint-suppression-audit.test.mts
|
|
154
154
|
- docs/incremental-change-set-contract.md
|
|
155
|
-
lastReviewedAt: 2026-09-
|
|
156
|
-
lastReviewedCommit:
|
|
157
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
155
|
+
lastReviewedAt: 2026-09-24
|
|
156
|
+
lastReviewedCommit: 05e4bd11b08276d092d10051b3f4f376c2af52ef
|
|
157
|
+
lastReviewedNote: "Reviewed for Foundry #197: release-only 0.1.12 identity projection from exact merged #200 main 05e4bd11b08276d092d10051b3f4f376c2af52ef; #196 early-question continuation and #200 indexed, human-readable blocked-queue behavior are already in the base. This projection changes no runtime behavior, CLI pin, dependencies, scientific or permission gates. Signed publication and installed qualification remain separate release gates."
|
|
158
158
|
---
|
|
159
159
|
|
|
160
160
|
# Architecture
|
|
@@ -28,9 +28,9 @@ checkPaths:
|
|
|
28
28
|
- specs/schemas/execution-context.schema.json
|
|
29
29
|
- specs/import-profiles.json
|
|
30
30
|
- tasks/**
|
|
31
|
-
lastReviewedAt: 2026-09-
|
|
32
|
-
lastReviewedCommit:
|
|
33
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
31
|
+
lastReviewedAt: 2026-09-24
|
|
32
|
+
lastReviewedCommit: abd80f28c1eff58c19ae40c929cf130b8b7d2431
|
|
33
|
+
lastReviewedNote: "Reviewed for Foundry #200: blocked CLI queue manifest and exact missing-reference rows are registered with current assessment while unchanged resume cannot re-run exhausted local stages."
|
|
34
34
|
related:
|
|
35
35
|
- AGENTS.md
|
|
36
36
|
- WORKFLOW.md
|
|
@@ -82,7 +82,9 @@ Local native-import and CLI context-pack stages use the existing operation plan,
|
|
|
82
82
|
|
|
83
83
|
Row materialization and assessment also use this local transaction. Materialized rows preserve domain payloads and row metadata, normalize typed API payload wrappers to the CLI-compatible `json` slot, and retain a producer chain to the original selected seed or primary native dataset. Original wrappers remain in the frozen source; bundled copies are excluded from row selection. Assessment reads only selected indexed rows/context, then registers native validation, local QA, queue, curation and authoring outputs. Its report records the owner's resolution base for relative references. Pending work is a current artifact state, not permission to execute a rendered command or dispatch a remote write.
|
|
84
84
|
|
|
85
|
-
The public assessment advances one dataset type per resume and records cumulative coverage. A prior set is reusable only while its row file, schema/QA/curation/authoring artifacts, contract pack, process closure queue and applicable interaction digest still match current registered facts. A changed applicable answer or assumption makes only affected sets due for re-assessment; a task-wide item affects every set. Each new generation binds the previous report and retains source receipts for reused outputs. An `in_progress` report is visible for prompt human follow-up and independent work, but cannot prove finalization or completion.
|
|
85
|
+
The public assessment advances one dataset type per resume and records cumulative coverage. A prior set is reusable only while its row file, schema/QA/curation/authoring artifacts, contract pack, process closure queue and applicable interaction digest still match current registered facts. A changed applicable answer or assumption makes only affected sets due for re-assessment; a task-wide item affects every set. Each new generation binds the previous report and retains source receipts for reused outputs. An `in_progress` report is visible for prompt human follow-up and independent work, but cannot prove finalization or completion. A pending question before rows exist still permits independently registered native import, contract context and row materialization; a pending question before explicit cleanup permits that one local preparation. Repeated resume after local work is exhausted retains the same indexed evidence and cannot enter account or owner-write stages.
|
|
86
|
+
|
|
87
|
+
A valid CLI curation queue may be `blocked` with exit 1. Assessment binds that report to the current registered row paths and hashes, verifies the bounded queue output tree, then indexes its manifest, blocker JSONL and closure files before projecting a concise missing-reference explanation. Schema, QA and curation may still record other local findings; blocked queue closure and its full Flow IDs remain visible evidence, never permission, waiver or completion. Changed selected source files create a new request revision rather than editing the frozen task, while independent row types can retain their assessed receipts.
|
|
86
88
|
|
|
87
89
|
`dataset-workflow-interaction` uses the same metadata lock, immutable output generation and hash-chained index. Its selected input descriptor binds task, actor and current interaction-state SHA; question, raw answer, interpreted decision and AI assumption events are append-only. Its evidence hashes must name frozen sources or indexed task artifacts. A duplicate accepted descriptor reuses its result; stale compare-and-swap or changed selected bytes fail. The current `interaction-state.json` is a task-scoped decision source for assessment and semantic work. It does not mutate the frozen source manifest, grant write authority or clear a consumed attempt. The user-facing `decision_recap` is derived from that state for current and partial results, with `completion_proven` true only after current completion evidence; it is not a second task truth source.
|
|
88
90
|
|
|
@@ -34,9 +34,9 @@ checkPaths:
|
|
|
34
34
|
- test/commands/foundry-release-*.test.mts
|
|
35
35
|
- test/unit/runtime-layout.test.mts
|
|
36
36
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
37
|
-
lastReviewedAt: 2026-09-
|
|
38
|
-
lastReviewedCommit:
|
|
39
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
37
|
+
lastReviewedAt: 2026-09-24
|
|
38
|
+
lastReviewedCommit: 05e4bd11b08276d092d10051b3f4f376c2af52ef
|
|
39
|
+
lastReviewedNote: "Reviewed for Foundry #197: release-only 0.1.12 identity projection from exact merged #200 main 05e4bd11b08276d092d10051b3f4f376c2af52ef; #196 early-question continuation and #200 indexed, human-readable blocked-queue behavior are already in the base. This projection changes no runtime behavior, CLI pin, dependencies, scientific or permission gates. Signed publication and installed qualification remain separate release gates."
|
|
40
40
|
related:
|
|
41
41
|
- docs/public-runtime-contract.md
|
|
42
42
|
- docs/runtime-context-contract.md
|
|
@@ -10,6 +10,7 @@ whenToUse:
|
|
|
10
10
|
- when implementing the Foundry facade or consuming its next actions
|
|
11
11
|
whenToUpdate:
|
|
12
12
|
- when public command names, result envelopes or exit semantics change
|
|
13
|
+
- when task next-action availability or local continuation rules change
|
|
13
14
|
checkPaths:
|
|
14
15
|
- scripts/runtime-entry.ts
|
|
15
16
|
- scripts/foundry-runtime.ts
|
|
@@ -31,10 +32,11 @@ checkPaths:
|
|
|
31
32
|
- test/scenarios/foundry-public-facade.test.mts
|
|
32
33
|
- test/scenarios/foundry-facade-request-store.test.mts
|
|
33
34
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
35
|
+
- test/scenarios/foundry-interaction-workflow.test.mts
|
|
34
36
|
- docs/public-runtime-contract.md
|
|
35
|
-
lastReviewedAt: 2026-09-
|
|
36
|
-
lastReviewedCommit:
|
|
37
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
37
|
+
lastReviewedAt: 2026-09-24
|
|
38
|
+
lastReviewedCommit: 05e4bd11b08276d092d10051b3f4f376c2af52ef
|
|
39
|
+
lastReviewedNote: "Reviewed for Foundry #197: release-only 0.1.12 identity projection from exact merged #200 main 05e4bd11b08276d092d10051b3f4f376c2af52ef; #196 early-question continuation and #200 indexed, human-readable blocked-queue behavior are already in the base. This projection changes no runtime behavior, CLI pin, dependencies, scientific or permission gates. Signed publication and installed qualification remain separate release gates."
|
|
38
40
|
related:
|
|
39
41
|
- docs/runtime-context-contract.md
|
|
40
42
|
- docs/task-authorization-contract.md
|
|
@@ -80,11 +82,13 @@ After context preparation, the facade materializes typed row arrays from the sel
|
|
|
80
82
|
|
|
81
83
|
The public facade assesses one current dataset type per resume. It registers a cumulative report with explicit `in_progress` or `completed` coverage, so the first actionable blocker can be returned before the remaining types finish; an independent type retains its continuation command. Every generation binds the previous indexed assessment, current rows, relevant context and task-interaction digest. Existing current set reports may be reused only when their row, context, queue closure, applicable interaction digest and registered artifact facts still match. A process/flow assessment builds its complete CLI-owned closure queue inside its own generation. A partial assessment is usable for current semantic work but cannot enter identity preflight, finalization, approval or completion. Direct internal callers that omit the bounded-set options retain their original full-batch operation.
|
|
82
84
|
|
|
85
|
+
The qualified CLI returns exit 1 with a valid `blocked` curation-queue report when selected Process references lack local Flow rows or declared external evidence. Foundry accepts that pair only after checking the report schema, current input paths and hashes, bounded output paths and matching manifest/task/lock/blocker files. It indexes the complete queue evidence and continues local validation, QA and curation; their blockers still prevent scientific completion and write handoff. The default result counts unresolved Flow reference occurrences, says what Process review cannot yet establish and what evidence to provide, and links the indexed blocker file with every exact ID and exchange path. A pending human question remains visible beside this gap. Once independent types have been assessed, unchanged resume does not repeat the blocked queue; adding selected source files requires a new task revision.
|
|
86
|
+
|
|
83
87
|
The compatibility report retains native diagnostic fields and supplies curation's `code` and JSON-pointer `path` from the native issue code/location. Row normalization uses the canonical `json` payload slot for typed API wrappers so native validation, curation and CLI patch application address the same domain payload while preserving row metadata and source lineage.
|
|
84
88
|
|
|
85
89
|
Curation blockers or authoring tasks produce `needs_input` with references to the registered reports and task manifests. Active row, schema, QA, curation and authoring files are checked before presenting that state; changed bytes block continuation. Public authoring artifacts omit developer-runner execution commands and retain full source/context evidence plus the required English guidance. Assessment readiness is distinct from semantic input acceptance, write authorization and final completion.
|
|
86
90
|
|
|
87
|
-
When a current blocker truly needs a person, the entry skill turns its evidence into one plain-language question: what is missing, what it affects, what is recommended, and what decision is needed. The result exposes the exact pending question and its few choices while retaining full evidence in indexed artifacts. An answered question is not repeated. An `investigate` answer remains unresolved and directs investigation rather than silently accepting the recommendation.
|
|
91
|
+
When a current blocker truly needs a person, the entry skill turns its evidence into one plain-language question: what is missing, what it affects, what is recommended, and what decision is needed. The result exposes the exact pending question and its few choices while retaining full evidence in indexed artifacts. An answered question is not repeated. An `investigate` answer remains unresolved and directs investigation rather than silently accepting the recommendation. While waiting, the result retains a bound continuation for independent native conversion, contract context, row materialization, an unattempted explicit cleanup, or due dataset assessment. Once those local steps are exhausted, it returns only the pending human action. The question still blocks identity preflight, finalization, approval and owner execution; consumed owner attempts retain readback priority and cannot be replayed.
|
|
88
92
|
|
|
89
93
|
After local semantic work is ready, a further resume performs process/flow identity preflight through the qualified CLI. The task spec must already identify the intended project and user; otherwise the result is `needs_auth`. The host may supply explicit OAuth public configuration or process-only headless authentication through `FoundryFacadeOptions.authentication`. Initialization and task start remain credential-free. The facade never inherits ambient tokens, CLI overrides, Node options or preflight result caches.
|
|
90
94
|
|
|
@@ -40,9 +40,9 @@ checkPaths:
|
|
|
40
40
|
- test/scenarios/runtime-workspace.test.mts
|
|
41
41
|
- test/scenarios/foundry-execution-admission.test.mts
|
|
42
42
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
43
|
-
lastReviewedAt: 2026-09-
|
|
44
|
-
lastReviewedCommit:
|
|
45
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
43
|
+
lastReviewedAt: 2026-09-24
|
|
44
|
+
lastReviewedCommit: 05e4bd11b08276d092d10051b3f4f376c2af52ef
|
|
45
|
+
lastReviewedNote: "Reviewed for Foundry #197: release-only 0.1.12 identity projection from exact merged #200 main 05e4bd11b08276d092d10051b3f4f376c2af52ef; #196 early-question continuation and #200 indexed, human-readable blocked-queue behavior are already in the base. This projection changes no runtime behavior, CLI pin, dependencies, scientific or permission gates. Signed publication and installed qualification remain separate release gates."
|
|
46
46
|
related:
|
|
47
47
|
- docs/architecture.md
|
|
48
48
|
- docs/task-authorization-contract.md
|
|
@@ -64,6 +64,8 @@ The public task facade delegates sealed owner execution to `foundry-workflow-exe
|
|
|
64
64
|
|
|
65
65
|
The public workflow selects derived row/context facts from the current verified task index before assessment. `runFoundryTaskOperation` rechecks their producer ancestry and original sources. Native validation and the exact CLI's local QA/queue commands use the qualified runtime and isolated environment; curation and authoring write only to a fresh task-owned generation. Runtime assets and source-owner reference bases remain separate from user workspace paths.
|
|
66
66
|
|
|
67
|
+
For queue build alone, the exact CLI's exit 1 can carry a valid `blocked` data report. Foundry verifies its schema/status pair, current selected row paths and SHA-256 values, and the complete regular-file queue output tree before indexing those artifacts. Other CLI exits retain their existing fail-closed treatment. A blocked closure is a local evidence gap; it cannot grant authorization, finalization or a replay of any owner attempt.
|
|
68
|
+
|
|
67
69
|
`qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.19` runtime descriptor. It also compares a strict TIDAS expectation with the selected platform, executable bytes, compatible 0.2.x or 0.3.x version, validation protocols, event schemas and asset fingerprint. The selected TIDAS executable is copied into a private temporary directory, rehashed there and invoked with the credential-free child environment; both handshake calls must be silent. Qualification uses a process-local brand. The portable identity described by `runtime-qualification.schema.json` is diagnostic evidence and cannot be deserialized into authority.
|
|
68
70
|
|
|
69
71
|
The TIDAS expectation admits only `linux-x64`, `linux-arm64`, `darwin-arm64` and `win32-x64`; `darwin-x64` cannot enter the schema or runtime context. `tidas-runtime-expectation.schema.json` is the reviewed machine shape. Qualification creation performs the isolated version/protocol/assets handshake once. Every later assertion reopens and hashes the selected executable and rejects any byte drift before child admission; identical immutable bytes do not replay the handshake. This keeps the original observed behavior bound to exact content while avoiding repeated child-process creation inside one admission call.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": "tiangong-foundry.package-descriptor.v1",
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@tiangong-lca/foundry",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.12",
|
|
6
6
|
"cli_dependency": {
|
|
7
7
|
"name": "@tiangong-lca/cli",
|
|
8
8
|
"version": "0.1.19"
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "README.md",
|
|
63
|
-
"bytes":
|
|
64
|
-
"sha256": "
|
|
63
|
+
"bytes": 67434,
|
|
64
|
+
"sha256": "8d875b2a97b2c7dce55ffe07aa9592e6952c822798d1db4f77a47d010d327dee"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "docs/architecture.md",
|
|
68
|
-
"bytes":
|
|
69
|
-
"sha256": "
|
|
68
|
+
"bytes": 58412,
|
|
69
|
+
"sha256": "ef9a9aa3a5b7158edae522e3732cf87553b297aa59da006b357fe2f39ccced1e"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"path": "docs/foundry-task-contracts.md",
|
|
73
|
-
"bytes":
|
|
74
|
-
"sha256": "
|
|
73
|
+
"bytes": 25768,
|
|
74
|
+
"sha256": "1c80b921eccb95e072fa5884d7d8990ebcdf2712bd3c27e32030d1a4c594cfe9"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"path": "docs/import-profiles/bafu/constraints.md",
|
|
@@ -120,18 +120,18 @@
|
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"path": "docs/package-distribution-contract.md",
|
|
123
|
-
"bytes":
|
|
124
|
-
"sha256": "
|
|
123
|
+
"bytes": 72205,
|
|
124
|
+
"sha256": "f2ab27d946782c916d1c827fe44a6b2c83bfd52c1d487812ad3c4912ee50cb8e"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"path": "docs/public-runtime-contract.md",
|
|
128
|
-
"bytes":
|
|
129
|
-
"sha256": "
|
|
128
|
+
"bytes": 52605,
|
|
129
|
+
"sha256": "f8f9ee0d39bdf7a99a52a1e6ef566a6098d27715d7473971cad839b220c0c322"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
"path": "docs/runtime-context-contract.md",
|
|
133
|
-
"bytes":
|
|
134
|
-
"sha256": "
|
|
133
|
+
"bytes": 22340,
|
|
134
|
+
"sha256": "ec465e8303c8fba20e1bce727b38bf0e478573c03ed2b537f1a6ac43e76cf3d6"
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
"path": "docs/safety-policy.md",
|
|
@@ -160,8 +160,8 @@
|
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
"path": "package-dist/scripts/foundry-facade.js",
|
|
163
|
-
"bytes":
|
|
164
|
-
"sha256": "
|
|
163
|
+
"bytes": 90191,
|
|
164
|
+
"sha256": "b39c09f42a76ea6fd4bc0ef37e84d6da701a6416486b13f86c0eb28704b4a8b1"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"path": "package-dist/scripts/foundry-runtime.d.ts",
|
|
@@ -716,12 +716,12 @@
|
|
|
716
716
|
{
|
|
717
717
|
"path": "package-dist/scripts/lib/foundry-package-contract.d.ts",
|
|
718
718
|
"bytes": 5745,
|
|
719
|
-
"sha256": "
|
|
719
|
+
"sha256": "a65049ec32c4a03ef79394c92c82406aea163531594eb4dbab032ffe0c5cf49d"
|
|
720
720
|
},
|
|
721
721
|
{
|
|
722
722
|
"path": "package-dist/scripts/lib/foundry-package-contract.js",
|
|
723
723
|
"bytes": 18642,
|
|
724
|
-
"sha256": "
|
|
724
|
+
"sha256": "9461b0c1e12ae908fb47667d37f6729cdd153308ddce7f2d96c3cd4ddf971ce9"
|
|
725
725
|
},
|
|
726
726
|
{
|
|
727
727
|
"path": "package-dist/scripts/lib/foundry-private-path.d.ts",
|
|
@@ -1040,8 +1040,8 @@
|
|
|
1040
1040
|
},
|
|
1041
1041
|
{
|
|
1042
1042
|
"path": "package-dist/scripts/lib/foundry-workflow-assessment.js",
|
|
1043
|
-
"bytes":
|
|
1044
|
-
"sha256": "
|
|
1043
|
+
"bytes": 27567,
|
|
1044
|
+
"sha256": "2ea218485b87613068d6175f1953ed8e108e89754a471e924e9d547a56d28056"
|
|
1045
1045
|
},
|
|
1046
1046
|
{
|
|
1047
1047
|
"path": "package-dist/scripts/lib/foundry-workflow-authorization.d.ts",
|
|
@@ -1821,7 +1821,7 @@
|
|
|
1821
1821
|
{
|
|
1822
1822
|
"path": "specs/schemas/foundry-package-descriptor.schema.json",
|
|
1823
1823
|
"bytes": 4246,
|
|
1824
|
-
"sha256": "
|
|
1824
|
+
"sha256": "3bc90ce6a6b1ba5fa2e30b2e03935441bd1870d62b5d4f39bd92b904ecec52cd"
|
|
1825
1825
|
},
|
|
1826
1826
|
{
|
|
1827
1827
|
"path": "specs/schemas/foundry-reference-input.schema.json",
|
|
@@ -1879,5 +1879,5 @@
|
|
|
1879
1879
|
"sha256": "3d22fcc572f9a0f192ccb699d01fb32574287ed2bbd2aca70fb4b792b7aed487"
|
|
1880
1880
|
}
|
|
1881
1881
|
],
|
|
1882
|
-
"files_sha256": "
|
|
1882
|
+
"files_sha256": "8f64fd4f5da987dddc143602259d35d522b707096dddcebe6c57e6af5a0817ce"
|
|
1883
1883
|
}
|
|
@@ -34,6 +34,7 @@ import { authorizeFoundryWorkflow } from "./lib/foundry-workflow-authorization.j
|
|
|
34
34
|
import { continueFoundryPreparedApproval } from "./lib/foundry-workflow-approval-continuation.js";
|
|
35
35
|
const maxSpecBytes = 1024 * 1024;
|
|
36
36
|
const maxSeedBytes = 8 * 1024 * 1024;
|
|
37
|
+
const maxQueueBytes = 32 * 1024 * 1024;
|
|
37
38
|
function readCaptured(fact, maxBytes, code) {
|
|
38
39
|
if (fact.bytes > maxBytes)
|
|
39
40
|
throw new FoundryContextError(code, "Selected facade input exceeds its byte limit.");
|
|
@@ -368,6 +369,84 @@ function completionProven(context, record, inspected) {
|
|
|
368
369
|
}
|
|
369
370
|
return false;
|
|
370
371
|
}
|
|
372
|
+
function independentLocalPreparationPending(record, workflow, entries) {
|
|
373
|
+
if (record.spec.repair)
|
|
374
|
+
return false;
|
|
375
|
+
if (record.spec.preparation)
|
|
376
|
+
return !entries.some((entry) => entry.command === "dataset-curation-cleanup");
|
|
377
|
+
return !workflow.rows || workflow.assessmentRemainingTypes.length > 0;
|
|
378
|
+
}
|
|
379
|
+
function currentIndexedQueueBlockers(context, workflow, entries) {
|
|
380
|
+
const blockers = [];
|
|
381
|
+
const actions = [];
|
|
382
|
+
const seenBlockerSha256 = new Set();
|
|
383
|
+
const queueExpected = workflow.rows?.value.sets.some((set) => set.type === "process") ?? false;
|
|
384
|
+
for (const set of workflow.assessment?.value.sets ?? []) {
|
|
385
|
+
if (typeof set.curation_report !== "string")
|
|
386
|
+
continue;
|
|
387
|
+
const curation = entries.find((entry) => entry.command === "dataset-workflow-assessment" &&
|
|
388
|
+
path.join(context.taskRoot, entry.path) === set.curation_report);
|
|
389
|
+
if (!curation)
|
|
390
|
+
continue;
|
|
391
|
+
// Artifact-index paths use '/' on every platform, including Windows.
|
|
392
|
+
const manifest = entries.find((entry) => entry.operation_id === curation.operation_id &&
|
|
393
|
+
entry.path.endsWith("/queue/outputs/curation-queue-manifest.json"));
|
|
394
|
+
if (!manifest) {
|
|
395
|
+
if (queueExpected && ["flow", "process"].includes(String(set.type)))
|
|
396
|
+
throw new FoundryContextError("workflow_queue_invalid", "The registered assessment is missing its curation queue evidence.");
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
const blockerFile = entries.find((entry) => entry.operation_id === curation.operation_id &&
|
|
400
|
+
entry.path.endsWith("/queue/outputs/curation-queue-blockers.jsonl"));
|
|
401
|
+
if (!blockerFile)
|
|
402
|
+
throw new FoundryContextError("workflow_queue_invalid", "The registered curation queue is missing its complete blocker evidence.");
|
|
403
|
+
const manifestFile = path.join(context.taskRoot, manifest.path);
|
|
404
|
+
const detailsFile = path.join(context.taskRoot, blockerFile.path);
|
|
405
|
+
const report = workflowObject(JSON.parse(readCaptured({ path: manifestFile, bytes: manifest.bytes, sha256: manifest.sha256 }, maxQueueBytes, "workflow_queue_invalid").toString("utf8")));
|
|
406
|
+
if (report.status !== "blocked")
|
|
407
|
+
continue;
|
|
408
|
+
const reportFiles = workflowObject(report.files);
|
|
409
|
+
const reportCounts = workflowObject(report.counts);
|
|
410
|
+
if (report.schema_version !== 1 ||
|
|
411
|
+
reportFiles.manifest !== manifestFile ||
|
|
412
|
+
reportFiles.blockers !== detailsFile ||
|
|
413
|
+
!Array.isArray(report.blockers) ||
|
|
414
|
+
!report.blockers.length ||
|
|
415
|
+
reportCounts.blockers !== report.blockers.length)
|
|
416
|
+
throw new FoundryContextError("workflow_queue_invalid", "The registered curation queue blocker manifest is invalid.");
|
|
417
|
+
const recorded = report.blockers;
|
|
418
|
+
let blockerRows;
|
|
419
|
+
try {
|
|
420
|
+
blockerRows = readCaptured({ path: detailsFile, bytes: blockerFile.bytes, sha256: blockerFile.sha256 }, maxQueueBytes, "workflow_queue_invalid")
|
|
421
|
+
.toString("utf8")
|
|
422
|
+
.split(/\r?\n/u)
|
|
423
|
+
.filter((line) => line.length > 0)
|
|
424
|
+
.map((line) => JSON.parse(line));
|
|
425
|
+
}
|
|
426
|
+
catch {
|
|
427
|
+
throw new FoundryContextError("workflow_queue_invalid", "The registered curation queue blocker file is invalid or changed.");
|
|
428
|
+
}
|
|
429
|
+
if (JSON.stringify(blockerRows) !== JSON.stringify(recorded))
|
|
430
|
+
throw new FoundryContextError("workflow_queue_invalid", "The registered curation queue blocker file does not match its manifest.");
|
|
431
|
+
if (seenBlockerSha256.has(blockerFile.sha256))
|
|
432
|
+
continue;
|
|
433
|
+
seenBlockerSha256.add(blockerFile.sha256);
|
|
434
|
+
const missing = recorded
|
|
435
|
+
.map(workflowObject)
|
|
436
|
+
.filter((item) => item.code === "process_flow_reference_unresolved")
|
|
437
|
+
.reduce((total, item) => {
|
|
438
|
+
const refs = workflowObject(item.details).missing_flow_refs;
|
|
439
|
+
return total + (Array.isArray(refs) ? refs.length : 0);
|
|
440
|
+
}, 0);
|
|
441
|
+
const scope = missing ? "process" : String(set.type);
|
|
442
|
+
const message = missing
|
|
443
|
+
? `Selected Process data has ${missing} unresolved Flow reference occurrence${missing === 1 ? "" : "s"}: the cited Flow evidence is absent from the selected inputs and has no verified external declaration. Process review is blocked; unrelated records can continue. Provide the cited Flow evidence or verified references, or keep the gap open. Adding selected sources requires a new task revision because this task's inputs are frozen. Full IDs and paths: ${detailsFile}.`
|
|
444
|
+
: `The selected ${scope} dependency queue has ${recorded.length} blocker${recorded.length === 1 ? "" : "s"}. Independent types can continue. Review the exact registered evidence at ${detailsFile} before revising the source or closure.`;
|
|
445
|
+
blockers.push({ code: "curation_queue_blocked", message, scope });
|
|
446
|
+
actions.push(human("review_queue_blockers", message));
|
|
447
|
+
}
|
|
448
|
+
return { blockers, actions };
|
|
449
|
+
}
|
|
371
450
|
function taskProjection(operation, context, record, inspected, identity) {
|
|
372
451
|
const artifacts = taskArtifacts(context, inspected);
|
|
373
452
|
const interaction = currentFoundryInteractionState(context, inspected.artifacts);
|
|
@@ -497,6 +576,7 @@ function taskProjection(operation, context, record, inspected, identity) {
|
|
|
497
576
|
});
|
|
498
577
|
}
|
|
499
578
|
const workflow = currentWorkflowState(context, inspected.artifacts);
|
|
579
|
+
const queueIssues = currentIndexedQueueBlockers(context, workflow, inspected.artifacts);
|
|
500
580
|
if (record.spec.repair && execution.verified.size) {
|
|
501
581
|
if (execution.requests.length !== 1 || execution.verified.size !== 1)
|
|
502
582
|
throw new FoundryContextError("repair_execution_mismatch", "A repair task must retain one exact verified execution scope.");
|
|
@@ -566,16 +646,22 @@ function taskProjection(operation, context, record, inspected, identity) {
|
|
|
566
646
|
status: "needs_input",
|
|
567
647
|
taskId: record.task_id,
|
|
568
648
|
artifacts,
|
|
569
|
-
blockers: [
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
649
|
+
blockers: [
|
|
650
|
+
...[...pendingQuestions, ...investigations].map((question) => ({
|
|
651
|
+
code: investigationIds.has(String(question.id))
|
|
652
|
+
? "interaction_investigation_pending"
|
|
653
|
+
: "interaction_decision_pending",
|
|
654
|
+
message: `${String(question.missing)} ${String(question.impact)}`,
|
|
655
|
+
scope: String(question.dataset_type ?? record.task_id),
|
|
656
|
+
})),
|
|
657
|
+
...queueIssues.blockers,
|
|
658
|
+
],
|
|
576
659
|
nextActions: [
|
|
577
660
|
...askActions,
|
|
578
|
-
...
|
|
661
|
+
...queueIssues.actions,
|
|
662
|
+
...(independentLocalPreparationPending(record, workflow, inspected.artifacts)
|
|
663
|
+
? [resumeCommand(context, record)]
|
|
664
|
+
: []),
|
|
579
665
|
],
|
|
580
666
|
runtimeIdentity: identity,
|
|
581
667
|
permissions: noPermission(),
|
|
@@ -772,12 +858,16 @@ function taskProjection(operation, context, record, inspected, identity) {
|
|
|
772
858
|
status: "needs_input",
|
|
773
859
|
taskId: record.task_id,
|
|
774
860
|
artifacts,
|
|
775
|
-
blockers:
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
861
|
+
blockers: [
|
|
862
|
+
...queueIssues.blockers,
|
|
863
|
+
...pending.map((set) => ({
|
|
864
|
+
code: "curation_requires_input",
|
|
865
|
+
message: `Resolve the current ${set.type} curation and authoring work before a write handoff.`,
|
|
866
|
+
scope: record.task_id,
|
|
867
|
+
})),
|
|
868
|
+
],
|
|
780
869
|
nextActions: [
|
|
870
|
+
...queueIssues.actions,
|
|
781
871
|
...pending.flatMap((set) => [
|
|
782
872
|
human("review_semantic_work", `Read the registered curation report ${set.curation_report} and authoring manifest ${set.authoring_manifest}. Use their bound source/context evidence; no write permission is implied.`),
|
|
783
873
|
...(set.decisions ?? []).map((work) => human(`review_${work.kind}_decisions`, `Read registered ${work.kind} task ${work.task} (${work.status}). Complete its bound decision template and submit it with semantic-input kind=${work.kind}.`)),
|
|
@@ -1310,7 +1400,8 @@ export function createFoundryFacade(options) {
|
|
|
1310
1400
|
const preparation = record.spec.preparation;
|
|
1311
1401
|
const workflow = currentWorkflowState(context, before.artifacts);
|
|
1312
1402
|
if (hasUnresolvedInteraction &&
|
|
1313
|
-
(workflow.authorization ||
|
|
1403
|
+
(workflow.authorization ||
|
|
1404
|
+
!independentLocalPreparationPending(record, workflow, before.artifacts)))
|
|
1314
1405
|
return existing;
|
|
1315
1406
|
if (record.spec.repair && !workflow.authorization && !execution.completed.size) {
|
|
1316
1407
|
if (!qualified)
|
|
@@ -2,7 +2,7 @@ export declare const FOUNDRY_PACKAGE_DESCRIPTOR_SCHEMA: "tiangong-foundry.packag
|
|
|
2
2
|
export declare const foundryPackageDescriptorPath: "package-dist/assets/foundry-package-descriptor.json";
|
|
3
3
|
export declare const foundryPackageStaticFiles: readonly ["package-dist/", "specs/import-profiles.json", "specs/prewrite-content-policy.json", "specs/canonical-support/flow-properties-unit-groups.json", "specs/schemas/authorization-derivation.schema.json", "specs/schemas/execution-context.schema.json", "specs/schemas/foundry-facade-request-index.schema.json", "specs/schemas/foundry-operation-result.schema.json", "specs/schemas/foundry-package-descriptor.schema.json", "specs/schemas/foundry-task-start.schema.json", "specs/schemas/foundry-semantic-input.schema.json", "specs/schemas/foundry-interaction-input.schema.json", "specs/schemas/foundry-authorization-input.schema.json", "specs/schemas/foundry-reference-input.schema.json", "specs/schemas/foundry-workspace-migration-plan.schema.json", "specs/schemas/foundry-workspace-migration-transfer-plan.schema.json", "specs/schemas/foundry-migration-transfer-receipt.schema.json", "specs/schemas/foundry-workspace-migration-pending.schema.json", "specs/schemas/foundry-migration-adoption-plan.schema.json", "specs/schemas/foundry-migration-activation.schema.json", "specs/schemas/foundry-workspace-v2.schema.json", "specs/schemas/foundry-runtime-selection.schema.json", "specs/schemas/foundry-managed-runtime.schema.json", "specs/schemas/runtime-qualification.schema.json", "specs/schemas/task-authorization.schema.json", "specs/schemas/tidas-runtime-expectation.schema.json", "docs/architecture.md", "docs/package-distribution-contract.md", "docs/foundry-task-contracts.md", "docs/public-runtime-contract.md", "docs/runtime-context-contract.md", "docs/workspace-migration-contract.md", "docs/safety-policy.md", "docs/task-authorization-contract.md", "docs/import-profiles/bafu/constraints.md", "docs/import-profiles/bafu/leaf-process-classification-authoring.md", "docs/import-profiles/bafu/profile.md", "docs/import-profiles/uslci/constraints.md", "docs/import-profiles/uslci/profile.md", "docs/uslci-import-runbook.md", "docs/import-profiles/worldsteel/constraints.md", "docs/import-profiles/worldsteel/import-coverage.md", "docs/import-profiles/worldsteel/import-plan.md", "docs/import-profiles/worldsteel/profile.md", "README.md", "LICENSE"];
|
|
4
4
|
declare const packageName = "@tiangong-lca/foundry";
|
|
5
|
-
declare const packageVersion = "0.1.
|
|
5
|
+
declare const packageVersion = "0.1.12";
|
|
6
6
|
declare const cliPackageName = "@tiangong-lca/cli";
|
|
7
7
|
declare const cliPackageVersion = "0.1.19";
|
|
8
8
|
declare const packageBin = "package-dist/scripts/package-entry.js";
|
|
@@ -53,7 +53,7 @@ export const foundryPackageStaticFiles = Object.freeze([
|
|
|
53
53
|
"LICENSE",
|
|
54
54
|
]);
|
|
55
55
|
const packageName = "@tiangong-lca/foundry";
|
|
56
|
-
const packageVersion = "0.1.
|
|
56
|
+
const packageVersion = "0.1.12";
|
|
57
57
|
const packageDescription = "Control plane for TianGong LCA external dataset import and TIDAS authoring work.";
|
|
58
58
|
const cliPackageName = "@tiangong-lca/cli";
|
|
59
59
|
const cliPackageVersion = "0.1.19";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
3
4
|
import { FoundryContextError, readFoundryInput, resolveFoundryAsset, resolveFoundryOutput, captureFoundryInput, } from "./foundry-runtime-context.js";
|
|
4
5
|
import { assertQualifiedFoundryRuntime, } from "./foundry-runtime-qualification.js";
|
|
5
6
|
import { copyFoundryIsolatedExecutable } from "./foundry-runtime-environment.js";
|
|
@@ -13,12 +14,183 @@ import { prepareFoundryDecisionWork } from "./foundry-workflow-decisions.js";
|
|
|
13
14
|
import { currentWorkflowState, workflowAssessmentQueueScopeSha256, } from "./foundry-workflow-state.js";
|
|
14
15
|
import { currentFoundryInteractionState } from "./foundry-interaction-input.js";
|
|
15
16
|
import { applicableFoundryInteractionDigest, applicableFoundryInteractionProjection, } from "./foundry-interaction-projection.js";
|
|
16
|
-
import { createWorkflowStageDirectory, createWorkflowDirectory, registerWorkflowStageFiles, runWorkflowLocalCli, } from "./foundry-workflow-io.js";
|
|
17
|
+
import { createWorkflowStageDirectory, createWorkflowDirectory, registerWorkflowStageFiles, runWorkflowLocalCli, runWorkflowLocalCliResult, } from "./foundry-workflow-io.js";
|
|
17
18
|
function record(value) {
|
|
18
19
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
19
20
|
throw new FoundryContextError("workflow_report_invalid", "Stage metadata must be an object.");
|
|
20
21
|
return value;
|
|
21
22
|
}
|
|
23
|
+
function assertCurrentQueueBuild(context, queueDir, result, sets) {
|
|
24
|
+
const invalid = () => {
|
|
25
|
+
throw new FoundryContextError("workflow_queue_invalid", "The local curation queue report does not match current rows and bounded output files.");
|
|
26
|
+
};
|
|
27
|
+
const object = (value) => value && typeof value === "object" && !Array.isArray(value)
|
|
28
|
+
? value
|
|
29
|
+
: invalid();
|
|
30
|
+
const exactJson = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
31
|
+
const expectedPath = (value, expected) => value === expected;
|
|
32
|
+
const outputFile = (value, expected) => {
|
|
33
|
+
if (!expectedPath(value, expected))
|
|
34
|
+
return invalid();
|
|
35
|
+
try {
|
|
36
|
+
const fact = captureFoundryInput(expected);
|
|
37
|
+
if (fact.path !== expected || fact.bytes > 32 * 1024 * 1024)
|
|
38
|
+
return invalid();
|
|
39
|
+
const bytes = fs.readFileSync(expected);
|
|
40
|
+
if (bytes.length !== fact.bytes ||
|
|
41
|
+
createHash("sha256").update(bytes).digest("hex") !== fact.sha256)
|
|
42
|
+
return invalid();
|
|
43
|
+
return bytes.toString("utf8");
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return invalid();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const jsonFile = (value, expected) => {
|
|
50
|
+
try {
|
|
51
|
+
return JSON.parse(outputFile(value, expected));
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return invalid();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const jsonLines = (value, expected) => {
|
|
58
|
+
try {
|
|
59
|
+
return outputFile(value, expected)
|
|
60
|
+
.split(/\r?\n/u)
|
|
61
|
+
.filter((line) => line.length > 0)
|
|
62
|
+
.map((line) => JSON.parse(line));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return invalid();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
try {
|
|
69
|
+
if (fs.realpathSync(queueDir) !== queueDir)
|
|
70
|
+
invalid();
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
invalid();
|
|
74
|
+
}
|
|
75
|
+
const report = result.report;
|
|
76
|
+
if (report.schema_version !== 1 ||
|
|
77
|
+
!((result.exit === 0 && report.status === "ready") ||
|
|
78
|
+
(result.exit === 1 && report.status === "blocked")) ||
|
|
79
|
+
!expectedPath(report.out_dir, queueDir))
|
|
80
|
+
invalid();
|
|
81
|
+
const typedSets = sets.map((set) => {
|
|
82
|
+
if (typeof set.type !== "string" ||
|
|
83
|
+
typeof set.file !== "string" ||
|
|
84
|
+
typeof set.count !== "number" ||
|
|
85
|
+
!Number.isSafeInteger(set.count) ||
|
|
86
|
+
set.count < 0)
|
|
87
|
+
return invalid();
|
|
88
|
+
return { type: set.type, file: set.file, count: set.count };
|
|
89
|
+
});
|
|
90
|
+
const processes = typedSets.find((set) => set.type === "process");
|
|
91
|
+
const flows = typedSets.find((set) => set.type === "flow");
|
|
92
|
+
const support = typedSets.filter((set) => ["contact", "source", "unitgroup", "flowproperty"].includes(set.type));
|
|
93
|
+
if (!processes)
|
|
94
|
+
return invalid();
|
|
95
|
+
const selected = [processes, ...(flows ? [flows] : []), ...support];
|
|
96
|
+
const inputs = object(report.inputs);
|
|
97
|
+
const supportPaths = support.map((set) => set.file);
|
|
98
|
+
if (!expectedPath(inputs.processes, processes.file) ||
|
|
99
|
+
(flows ? !expectedPath(inputs.flows, flows.file) : inputs.flows !== null) ||
|
|
100
|
+
!exactJson(inputs.support, supportPaths) ||
|
|
101
|
+
!exactJson(inputs.external_flow_refs, []))
|
|
102
|
+
invalid();
|
|
103
|
+
const expectedHashes = new Map(selected.map((set) => {
|
|
104
|
+
const file = set.file;
|
|
105
|
+
readFoundryInput(context, file);
|
|
106
|
+
return [file, captureFoundryInput(file).sha256];
|
|
107
|
+
}));
|
|
108
|
+
const hashes = object(object(report.hashes).inputs);
|
|
109
|
+
const taskRecords = Array.isArray(report.tasks) ? report.tasks.map(object) : invalid();
|
|
110
|
+
const taskIds = taskRecords.map((task) => {
|
|
111
|
+
if (typeof task.task_id !== "string" || !task.task_id)
|
|
112
|
+
return invalid();
|
|
113
|
+
return task.task_id;
|
|
114
|
+
});
|
|
115
|
+
if (!exactJson(Object.keys(hashes).sort(), [...expectedHashes.keys()].sort()) ||
|
|
116
|
+
[...expectedHashes].some(([file, sha256]) => hashes[file] !== sha256) ||
|
|
117
|
+
object(report.hashes).task_order !==
|
|
118
|
+
createHash("sha256").update(taskIds.join("\n")).digest("hex"))
|
|
119
|
+
invalid();
|
|
120
|
+
const counts = object(report.counts);
|
|
121
|
+
const supportCount = support.reduce((total, set) => total + set.count, 0);
|
|
122
|
+
// This call supplies no process filters; the CLI emits one task and lock per selected row.
|
|
123
|
+
const expectedTasks = processes.count + (flows?.count ?? 0) + supportCount;
|
|
124
|
+
const blockers = report.blockers;
|
|
125
|
+
const tasks = report.tasks;
|
|
126
|
+
if (!Array.isArray(blockers) || !Array.isArray(tasks))
|
|
127
|
+
return invalid();
|
|
128
|
+
for (const candidate of blockers) {
|
|
129
|
+
const blocker = object(candidate);
|
|
130
|
+
if (blocker.schema_version !== 1 ||
|
|
131
|
+
blocker.severity !== "blocker" ||
|
|
132
|
+
typeof blocker.code !== "string" ||
|
|
133
|
+
!blocker.code ||
|
|
134
|
+
typeof blocker.message !== "string" ||
|
|
135
|
+
!blocker.message)
|
|
136
|
+
invalid();
|
|
137
|
+
if (blocker.code === "process_flow_reference_unresolved") {
|
|
138
|
+
const refs = object(blocker.details).missing_flow_refs;
|
|
139
|
+
if (!Array.isArray(refs) || !refs.length)
|
|
140
|
+
return invalid();
|
|
141
|
+
for (const candidateRef of refs) {
|
|
142
|
+
const ref = object(candidateRef);
|
|
143
|
+
if (typeof ref.id !== "string" ||
|
|
144
|
+
!ref.id ||
|
|
145
|
+
!(ref.version === null || (typeof ref.version === "string" && ref.version)) ||
|
|
146
|
+
typeof ref.path !== "string" ||
|
|
147
|
+
!ref.path)
|
|
148
|
+
invalid();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (counts.process_rows !== processes.count ||
|
|
153
|
+
counts.flow_rows !== (flows?.count ?? 0) ||
|
|
154
|
+
counts.support_rows !== supportCount ||
|
|
155
|
+
counts.external_flow_refs !== 0 ||
|
|
156
|
+
counts.tasks !== expectedTasks ||
|
|
157
|
+
counts.blockers !== blockers.length ||
|
|
158
|
+
tasks.length !== expectedTasks ||
|
|
159
|
+
(report.status === "blocked") !== blockers.length > 0)
|
|
160
|
+
invalid();
|
|
161
|
+
const files = object(report.files);
|
|
162
|
+
const outputs = path.join(queueDir, "outputs");
|
|
163
|
+
const manifest = jsonFile(files.manifest, path.join(outputs, "curation-queue-manifest.json"));
|
|
164
|
+
const taskRows = jsonLines(files.tasks, path.join(outputs, "curation-queue-tasks.jsonl"));
|
|
165
|
+
const blockerRows = jsonLines(files.blockers, path.join(outputs, "curation-queue-blockers.jsonl"));
|
|
166
|
+
const locks = object(jsonFile(files.locks, path.join(outputs, "curation-queue-locks.json")));
|
|
167
|
+
if (!Array.isArray(locks.locks))
|
|
168
|
+
return invalid();
|
|
169
|
+
if (!exactJson(manifest, report) ||
|
|
170
|
+
!exactJson(taskRows, tasks) ||
|
|
171
|
+
!exactJson(blockerRows, blockers) ||
|
|
172
|
+
locks.schema_version !== 1 ||
|
|
173
|
+
locks.locks.length !== tasks.length)
|
|
174
|
+
invalid();
|
|
175
|
+
for (let index = 0; index < taskRecords.length; index += 1) {
|
|
176
|
+
const task = taskRecords[index], lock = object(locks.locks[index]);
|
|
177
|
+
for (const key of ["task_id", "entity_type", "entity_id", "version", "lock_key"])
|
|
178
|
+
if (task[key] !== lock[key])
|
|
179
|
+
invalid();
|
|
180
|
+
}
|
|
181
|
+
for (const candidate of tasks) {
|
|
182
|
+
const task = object(candidate);
|
|
183
|
+
for (const key of ["input_rows_file", "closure_file", "run_plan_file"]) {
|
|
184
|
+
const file = task[key];
|
|
185
|
+
if (typeof file !== "string" || file !== path.resolve(file))
|
|
186
|
+
return invalid();
|
|
187
|
+
const resolved = path.resolve(file);
|
|
188
|
+
if (!resolved.startsWith(`${queueDir}${path.sep}`))
|
|
189
|
+
invalid();
|
|
190
|
+
outputFile(file, resolved);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
22
194
|
export function assessFoundryWorkflowRows(context, qualified, rowsReport, contextReports, identityReport, options = {}) {
|
|
23
195
|
assertQualifiedFoundryRuntime(context, qualified);
|
|
24
196
|
resolveFoundryAsset(context, "specs/prewrite-content-policy.json");
|
|
@@ -178,7 +350,7 @@ export function assessFoundryWorkflowRows(context, qualified, rowsReport, contex
|
|
|
178
350
|
else if (["contact", "source", "unitgroup", "flowproperty"].includes(String(set.type)))
|
|
179
351
|
args.push("--support", set.file);
|
|
180
352
|
}
|
|
181
|
-
|
|
353
|
+
assertCurrentQueueBuild(context, queueDir, runWorkflowLocalCliResult(context, qualified, temporary, args), selectedSets);
|
|
182
354
|
}
|
|
183
355
|
const assessed = previousSets.map(record);
|
|
184
356
|
const toAssess = options.scopeType
|
package/package.json
CHANGED