@tiangong-lca/foundry 0.1.6 → 0.1.7
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/package-distribution-contract.md +8 -4
- package/docs/public-runtime-contract.md +4 -4
- package/docs/runtime-context-contract.md +5 -3
- package/package-dist/assets/foundry-package-descriptor.json +33 -23
- package/package-dist/scripts/lib/foundry-managed-actions.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-managed-actions.js +56 -0
- package/package-dist/scripts/lib/foundry-managed-host.d.ts +2 -2
- package/package-dist/scripts/lib/foundry-managed-host.js +2 -0
- 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/runtime-entry.d.ts +5 -1
- package/package-dist/scripts/runtime-entry.js +2 -0
- package/package.json +1 -1
- package/specs/schemas/foundry-package-descriptor.schema.json +1 -1
package/README.md
CHANGED
|
@@ -157,9 +157,9 @@ checkPaths:
|
|
|
157
157
|
- test/unit/lint-suppression-audit.test.mts
|
|
158
158
|
- test/unit/zero-javascript-ratchet.test.mts
|
|
159
159
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
160
|
-
lastReviewedAt: 2026-09-
|
|
161
|
-
lastReviewedCommit:
|
|
162
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
160
|
+
lastReviewedAt: 2026-09-10
|
|
161
|
+
lastReviewedCommit: 063016979fec5d4879f562c417b42b73b158aafe
|
|
162
|
+
lastReviewedNote: "Reviewed for Foundry #153: strict0.1.7 version projection from qualified managed-action source0630169 and unchanged verified CLI0.1.13/toolchain/dependency inputs. All source/native action gates passed before preparation; complete owning release and independent public successor verification remain required."
|
|
163
163
|
---
|
|
164
164
|
|
|
165
165
|
# TianGong LCA Data Foundry
|
package/docs/architecture.md
CHANGED
|
@@ -151,9 +151,9 @@ checkPaths:
|
|
|
151
151
|
- test/unit/foundry-runtime-environment.test.mts
|
|
152
152
|
- test/unit/lint-suppression-audit.test.mts
|
|
153
153
|
- docs/incremental-change-set-contract.md
|
|
154
|
-
lastReviewedAt: 2026-09-
|
|
155
|
-
lastReviewedCommit:
|
|
156
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
154
|
+
lastReviewedAt: 2026-09-10
|
|
155
|
+
lastReviewedCommit: 063016979fec5d4879f562c417b42b73b158aafe
|
|
156
|
+
lastReviewedNote: "Reviewed for Foundry #153: strict0.1.7 version projection from qualified managed-action source0630169 and unchanged verified CLI0.1.13/toolchain/dependency inputs. All source/native action gates passed before preparation; complete owning release and independent public successor verification remain required."
|
|
157
157
|
---
|
|
158
158
|
|
|
159
159
|
# Architecture
|
|
@@ -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-10
|
|
38
|
+
lastReviewedCommit: 063016979fec5d4879f562c417b42b73b158aafe
|
|
39
|
+
lastReviewedNote: "Reviewed for Foundry #153: strict0.1.7 version projection from qualified managed-action source0630169 and unchanged verified CLI0.1.13/toolchain/dependency inputs. All source/native action gates passed before preparation; complete owning release and independent public successor verification remain required."
|
|
40
40
|
related:
|
|
41
41
|
- docs/public-runtime-contract.md
|
|
42
42
|
- docs/runtime-context-contract.md
|
|
@@ -70,7 +70,7 @@ The selected launch must use the current managed Node and exactly one declared a
|
|
|
70
70
|
|
|
71
71
|
The host additionally validates relationships that the structural schema cannot prove: every policy uses the declared Node and installed package entry, the installed CLI/Node match their independent expectation, and the selected TIDAS file matches its declared size/hash/executable mode. Existing runtime qualification owns the TIDAS version/protocol/assets handshake when an operation requests qualification. A read policy never grants writes; explicit runtime selection still requires a qualified current writer and actor/request intent. The CLI-owned component cache and its descendants/ancestors cannot become a workspace, including migration destinations.
|
|
72
72
|
|
|
73
|
-
The public command adapter accepts an optional trusted asynchronous host initializer so signal handling and the single-result envelope cover admission as well as the operation. Pre-observed cancellation skips initialization. Cancellation while waiting for IPC closes that channel and preserves the interrupted result. Unsupported managed metadata versions return `blocked`; invalid bindings return `failed` before workspace effects. The initializer cannot replace the adapter's output handlers or cancellation signal.
|
|
73
|
+
The public command adapter accepts an optional trusted asynchronous host initializer so signal handling and the single-result envelope cover admission as well as the operation. Pre-observed cancellation skips initialization. Cancellation while waiting for IPC closes that channel and preserves the interrupted result. Unsupported managed metadata versions return `blocked`; invalid bindings return `failed` before workspace effects. The initializer cannot replace the adapter's output handlers or cancellation signal. Its package-owned result projector binds executable next actions to the same verified CLI manager launch, so a new process receives fresh IPC context rather than falling back to an unqualified direct bin. The original launch id retains read/write and rollback-target policy; application argv, CWD and purpose remain unchanged, and the complete command binding is recomputed.
|
|
74
74
|
|
|
75
75
|
Installed-process tests use real Node, the packed Foundry candidate, public CLI APIs and genuine IPC, with separate application/native fixture components. TIDAS and predecessor-release metadata remain explicit fixtures. These tests qualify the admission mechanism; final production component assembly, real native inputs, immutable publication and complete F1 startup qualification remain separate W08 work.
|
|
76
76
|
|
|
@@ -315,3 +315,7 @@ The W10 planning extension adds the shared pure attempt leaf and bounded migrati
|
|
|
315
315
|
The W10 transfer extension ships bounded transfer I/O and staging/audit owners plus pending-marker and receipt schemas. It still has no install lifecycle effects, no business mutation dispatcher and no automatic activation; source-free consumers can explicitly stage and audit the same v2 plans.
|
|
316
316
|
|
|
317
317
|
The adoption extension ships migration planning/application/authority/scope guards, explicit read/write access, runtime selection and their strict schemas. The package descriptor lists both supported read and write schemas while retaining v1 as the default initialization schema; v2 writes additionally require the trusted host feature selection. Public CLI apply/runtime-use remain separate explicit actions, never install hooks. Source and installed packages must qualify the same behaviors; managed component publication/bootstrap remains W08.
|
|
318
|
+
|
|
319
|
+
Managed continuations retain the trusted manifest bytes in an exclusive content-addressed `foundry-manifests/<sha256>.json` cache snapshot. The digest comes from verified IPC, not that file or the workspace. Existing different or linked cache bytes are rejected; no installed component is changed. Results without command actions create no snapshot. The existing CLI manager reloads the independent digest, verifies components and creates the next managed host context.
|
|
320
|
+
|
|
321
|
+
Copied bootstrap qualification additionally starts a credential-free task and executes its exact returned action in a fresh process. That process must retain both the task id and ready runtime qualification. Source/recovery capsules and final public qualification require the `task-start` and `returned-action` phases on every supported platform, alongside the existing cold/warm, developer-command and tamper checks.
|
|
@@ -32,9 +32,9 @@ checkPaths:
|
|
|
32
32
|
- test/scenarios/foundry-facade-request-store.test.mts
|
|
33
33
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
34
34
|
- docs/public-runtime-contract.md
|
|
35
|
-
lastReviewedAt: 2026-09-
|
|
36
|
-
lastReviewedCommit:
|
|
37
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
35
|
+
lastReviewedAt: 2026-09-10
|
|
36
|
+
lastReviewedCommit: 063016979fec5d4879f562c417b42b73b158aafe
|
|
37
|
+
lastReviewedNote: "Reviewed for Foundry #153: strict0.1.7 version projection from qualified managed-action source0630169 and unchanged verified CLI0.1.13/toolchain/dependency inputs. All source/native action gates passed before preparation; complete owning release and independent public successor verification remain required."
|
|
38
38
|
related:
|
|
39
39
|
- docs/runtime-context-contract.md
|
|
40
40
|
- docs/task-authorization-contract.md
|
|
@@ -86,7 +86,7 @@ After local semantic work is ready, a further resume performs process/flow ident
|
|
|
86
86
|
|
|
87
87
|
Preflight reuses the existing request builder, query audit, receipt-bound runner and index merger. Requests target current unwrapped payloads and retain source trace context. Remote reads finish before a local transaction registers their immutable evidence; that transaction cannot replay a remote operation. Registration rechecks current rows under the task lock. Failed reads remain visible as `needs_input` and a later resume may retry the read-only stage. Status never performs a search. Successful preflight invalidates the earlier assessment, and the next resume re-runs curation against its exact identity index. Manual review becomes dedicated identity work even for the generic profile. This read evidence supplies decision context; submitting a bound identity decision remains separate from write authorization.
|
|
88
88
|
|
|
89
|
-
An executable next action
|
|
89
|
+
An executable next action preserves `cwd=workspaceRoot`, the application arguments and purpose. An unmanaged source/emitted host retains its direct Node/package entry. A verified managed host instead selects its exact CLI `runtime exec` command with the original trusted manifest digest, component cache and launch id before the unchanged Foundry arguments. Its verified binding digest covers every executable field; workspace, task and actor are explicit argv values, while task lookup revalidates the immutable revision fingerprint and current runtime/input facts before work. It has no `display` authority. A final restricted data CommandSpec still requires the W04 execution-context/identity/authorization gate; Owner execution validates it immediately before the first dispatch.
|
|
90
90
|
|
|
91
91
|
After ready assessment and required identity preflight, resume invokes the existing finalize owner. It preserves reference/source/contact/canonical repair, cleanup, native schema, deterministic QA, location audit, curation, dry-run, remote reference verification and mutation/handoff report ordering. Each dataset type uses its own contract pack; Unit Group and Flow Property rows use the owner's support mode separately. Finalization dispatch accepts only local checks, explicit `--dry-run` operations and read-only remote verification, never `--commit`.
|
|
92
92
|
|
|
@@ -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-10
|
|
44
|
+
lastReviewedCommit: 063016979fec5d4879f562c417b42b73b158aafe
|
|
45
|
+
lastReviewedNote: "Reviewed for Foundry #153: strict0.1.7 version projection from qualified managed-action source0630169 and unchanged verified CLI0.1.13/toolchain/dependency inputs. All source/native action gates passed before preparation; complete owning release and independent public successor verification remain required."
|
|
46
46
|
related:
|
|
47
47
|
- docs/architecture.md
|
|
48
48
|
- docs/task-authorization-contract.md
|
|
@@ -136,3 +136,5 @@ Prepared-support finalization explicitly selects the approved input file for its
|
|
|
136
136
|
Workflow generation and scratch directories use task-confined cryptographic names with exclusive `mkdir`, rather than `mkdtemp` under deep task paths. This preserves distinct immutable generations on Windows when a registered task plus operation digest exceeds the Windows `mkdtemp` path limit. Workspace write access and path confinement are checked before creation; existing directories are never adopted.
|
|
137
137
|
|
|
138
138
|
The native validation adapter also allocates a cryptographically named exclusive staging directory beside its selected output. This keeps atomic same-filesystem replacement and cancellation cleanup available at deep Windows task paths. Failed or cancelled validation preserves the previous output; successful validation publishes the complete new report set.
|
|
139
|
+
|
|
140
|
+
Managed command continuations retain the original verified launch id through the CLI manager, preserving its workspace access and runtime-target policy in the next process. The content-addressed public manifest snapshot is recomputable cache data outside runtime/workspace roots; its path grants no trust or task permission. The existing digest, inventory, qualification, current identity, authorization and no-replay checks run again before qualified owner execution.
|
|
@@ -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.7",
|
|
6
6
|
"cli_dependency": {
|
|
7
7
|
"name": "@tiangong-lca/cli",
|
|
8
8
|
"version": "0.1.13"
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "README.md",
|
|
61
|
-
"bytes":
|
|
62
|
-
"sha256": "
|
|
61
|
+
"bytes": 66259,
|
|
62
|
+
"sha256": "c0b5f90b4ae733e75e904c107f14697b8547298d4ac381847a8ca97567dc0fa2"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"path": "docs/architecture.md",
|
|
66
|
-
"bytes":
|
|
67
|
-
"sha256": "
|
|
66
|
+
"bytes": 57099,
|
|
67
|
+
"sha256": "e38afcc47e3943931ed3e2b3d95648381fa83964043df1c42c99ce2dbc04151a"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"path": "docs/foundry-task-contracts.md",
|
|
@@ -118,18 +118,18 @@
|
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"path": "docs/package-distribution-contract.md",
|
|
121
|
-
"bytes":
|
|
122
|
-
"sha256": "
|
|
121
|
+
"bytes": 69012,
|
|
122
|
+
"sha256": "b23c4b05aa72b4b5d4c0311d9cd4094a4766c7991e8b8d6099f5ec9e66f6b787"
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"path": "docs/public-runtime-contract.md",
|
|
126
|
-
"bytes":
|
|
127
|
-
"sha256": "
|
|
126
|
+
"bytes": 37166,
|
|
127
|
+
"sha256": "629187110e4b9fc226434afc7e604ad1edfcd3fbf86cb8ca794fbfa1bfec28d7"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"path": "docs/runtime-context-contract.md",
|
|
131
|
-
"bytes":
|
|
132
|
-
"sha256": "
|
|
131
|
+
"bytes": 19274,
|
|
132
|
+
"sha256": "c7b215685dd063ba603022763e066c935a8d4db05adc5d256409133317fe1e59"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"path": "docs/safety-policy.md",
|
|
@@ -481,15 +481,25 @@
|
|
|
481
481
|
"bytes": 2842,
|
|
482
482
|
"sha256": "b366f1c3e17ab96de097734a12d44f36ececb8587ea5ab911c78e50b6c0a93cc"
|
|
483
483
|
},
|
|
484
|
+
{
|
|
485
|
+
"path": "package-dist/scripts/lib/foundry-managed-actions.d.ts",
|
|
486
|
+
"bytes": 462,
|
|
487
|
+
"sha256": "ec04b6fbd3884126689769262ffdb3b2fc1cd89144ffdd539e01cdaa823602e6"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"path": "package-dist/scripts/lib/foundry-managed-actions.js",
|
|
491
|
+
"bytes": 2699,
|
|
492
|
+
"sha256": "d7df041dee8a5ff5ec08a1ef269413a9184c257348979f30283b3e8425dd76a9"
|
|
493
|
+
},
|
|
484
494
|
{
|
|
485
495
|
"path": "package-dist/scripts/lib/foundry-managed-host.d.ts",
|
|
486
|
-
"bytes":
|
|
487
|
-
"sha256": "
|
|
496
|
+
"bytes": 490,
|
|
497
|
+
"sha256": "caf56f4926bdb77205bd84b13c4f0e090dd5104c288bc064657bb6d6f1ec73ae"
|
|
488
498
|
},
|
|
489
499
|
{
|
|
490
500
|
"path": "package-dist/scripts/lib/foundry-managed-host.js",
|
|
491
|
-
"bytes":
|
|
492
|
-
"sha256": "
|
|
501
|
+
"bytes": 9913,
|
|
502
|
+
"sha256": "9b7b35e6a6d56d407e66b8ed8aaba56c8d4c8d7af4a85daace0bf2888bb8886f"
|
|
493
503
|
},
|
|
494
504
|
{
|
|
495
505
|
"path": "package-dist/scripts/lib/foundry-migration-adoption-plan.d.ts",
|
|
@@ -624,12 +634,12 @@
|
|
|
624
634
|
{
|
|
625
635
|
"path": "package-dist/scripts/lib/foundry-package-contract.d.ts",
|
|
626
636
|
"bytes": 5556,
|
|
627
|
-
"sha256": "
|
|
637
|
+
"sha256": "c1fe3cea79fbd4f289e871b2cf4e8b32405545eff443a0a0eddcbce048e09711"
|
|
628
638
|
},
|
|
629
639
|
{
|
|
630
640
|
"path": "package-dist/scripts/lib/foundry-package-contract.js",
|
|
631
641
|
"bytes": 18452,
|
|
632
|
-
"sha256": "
|
|
642
|
+
"sha256": "67426f71da88ffcffd2be4b256f43aab19903446843f9c0e760eac994b2a4e5d"
|
|
633
643
|
},
|
|
634
644
|
{
|
|
635
645
|
"path": "package-dist/scripts/lib/foundry-private-path.d.ts",
|
|
@@ -1533,13 +1543,13 @@
|
|
|
1533
1543
|
},
|
|
1534
1544
|
{
|
|
1535
1545
|
"path": "package-dist/scripts/runtime-entry.d.ts",
|
|
1536
|
-
"bytes":
|
|
1537
|
-
"sha256": "
|
|
1546
|
+
"bytes": 1768,
|
|
1547
|
+
"sha256": "134a084b1169e588af06a4c630042eb96d9a87666cfc1c22ca4786697406fdae"
|
|
1538
1548
|
},
|
|
1539
1549
|
{
|
|
1540
1550
|
"path": "package-dist/scripts/runtime-entry.js",
|
|
1541
|
-
"bytes":
|
|
1542
|
-
"sha256": "
|
|
1551
|
+
"bytes": 20947,
|
|
1552
|
+
"sha256": "205e444b7327cdb08112e588e6e4610522ce53e711e9a14819722240ad4099db"
|
|
1543
1553
|
},
|
|
1544
1554
|
{
|
|
1545
1555
|
"path": "specs/canonical-support/flow-properties-unit-groups.json",
|
|
@@ -1604,7 +1614,7 @@
|
|
|
1604
1614
|
{
|
|
1605
1615
|
"path": "specs/schemas/foundry-package-descriptor.schema.json",
|
|
1606
1616
|
"bytes": 4141,
|
|
1607
|
-
"sha256": "
|
|
1617
|
+
"sha256": "2b7107cf9198a5647cdb74f39d2a331e4e9d3e95e88efc02e3f52bbd6172c647"
|
|
1608
1618
|
},
|
|
1609
1619
|
{
|
|
1610
1620
|
"path": "specs/schemas/foundry-runtime-selection.schema.json",
|
|
@@ -1657,5 +1667,5 @@
|
|
|
1657
1667
|
"sha256": "3d22fcc572f9a0f192ccb699d01fb32574287ed2bbd2aca70fb4b792b7aed487"
|
|
1658
1668
|
}
|
|
1659
1669
|
],
|
|
1660
|
-
"files_sha256": "
|
|
1670
|
+
"files_sha256": "f4adc65ec0e15ed6ee9b381c3f76e54a4c6fad255e8af0ba514007ee172f9415"
|
|
1661
1671
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CliRuntimeDescriptor, type RuntimeHostContext } from "@tiangong-lca/cli/runtime";
|
|
2
|
+
import { type FoundryOperationResult } from "./foundry-operation-result.ts";
|
|
3
|
+
/** Retain the verified host's launch policy when a caller executes a returned action. */
|
|
4
|
+
export declare function createManagedFoundryActionProjector(context: RuntimeHostContext, cli: CliRuntimeDescriptor, packageEntry: string): (result: FoundryOperationResult) => FoundryOperationResult;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { copyTrustedRuntimeManifestBytes, } from "@tiangong-lca/cli/runtime";
|
|
3
|
+
import { assertFoundryOperationResult, commandNextActionBindingSha256, } from "./foundry-operation-result.js";
|
|
4
|
+
import { FoundryContextError } from "./foundry-runtime-error.js";
|
|
5
|
+
import { transferPath, transferWriteOnce } from "./foundry-migration-transfer-io.js";
|
|
6
|
+
/** Retain the verified host's launch policy when a caller executes a returned action. */
|
|
7
|
+
export function createManagedFoundryActionProjector(context, cli, packageEntry) {
|
|
8
|
+
return (result) => {
|
|
9
|
+
assertFoundryOperationResult(result);
|
|
10
|
+
if (!result.next_actions.some((action) => action.kind === "command"))
|
|
11
|
+
return result;
|
|
12
|
+
for (const action of result.next_actions) {
|
|
13
|
+
if (action.kind !== "command")
|
|
14
|
+
continue;
|
|
15
|
+
if (action.executable !== process.execPath ||
|
|
16
|
+
!action.argv[0] ||
|
|
17
|
+
fs.realpathSync(action.argv[0]) !== packageEntry)
|
|
18
|
+
throw new FoundryContextError("managed_action_invalid", "A managed action must continue through the verified Foundry package entry.");
|
|
19
|
+
}
|
|
20
|
+
const bytes = Buffer.from(copyTrustedRuntimeManifestBytes(context.manifest));
|
|
21
|
+
const relative = `foundry-manifests/${context.manifest.sha256}.json`;
|
|
22
|
+
// A content-bound cache copy carries bytes, never authority from workspace state.
|
|
23
|
+
transferWriteOnce(context.cacheDir, relative, bytes);
|
|
24
|
+
const manifestFile = transferPath(context.cacheDir, relative);
|
|
25
|
+
const nextActions = result.next_actions.map((action) => {
|
|
26
|
+
if (action.kind !== "command")
|
|
27
|
+
return action;
|
|
28
|
+
const projected = {
|
|
29
|
+
kind: action.kind,
|
|
30
|
+
code: action.code,
|
|
31
|
+
cwd: action.cwd,
|
|
32
|
+
purpose: action.purpose,
|
|
33
|
+
executable: cli.command.executable,
|
|
34
|
+
argv: [
|
|
35
|
+
...cli.command.argv,
|
|
36
|
+
"runtime",
|
|
37
|
+
"exec",
|
|
38
|
+
"--manifest",
|
|
39
|
+
manifestFile,
|
|
40
|
+
"--manifest-sha256",
|
|
41
|
+
context.manifest.sha256,
|
|
42
|
+
"--cache-dir",
|
|
43
|
+
context.cacheDir,
|
|
44
|
+
"--entry",
|
|
45
|
+
context.entry,
|
|
46
|
+
"--cwd",
|
|
47
|
+
action.cwd,
|
|
48
|
+
"--",
|
|
49
|
+
...action.argv.slice(1),
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
return { ...projected, binding_sha256: commandNextActionBindingSha256(projected) };
|
|
53
|
+
});
|
|
54
|
+
return assertFoundryOperationResult({ ...result, next_actions: nextActions });
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreparedFoundryRuntimeHost } from "../runtime-entry.ts";
|
|
2
2
|
export declare const FOUNDRY_MANAGED_RUNTIME_SCHEMA: "tiangong-foundry.managed-runtime.v1";
|
|
3
3
|
export declare const FOUNDRY_MANAGED_RUNTIME_PATH: "metadata/foundry-runtime.json";
|
|
4
|
-
type PreparedHost =
|
|
4
|
+
type PreparedHost = PreparedFoundryRuntimeHost;
|
|
5
5
|
/** Package-owned initializer; it accepts no task, environment or argv trust anchors. */
|
|
6
6
|
export declare function receiveFoundryManagedHost(signal: AbortSignal): Promise<PreparedHost>;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { RUNTIME_HOST_CONTEXT_PROTOCOL, assertCliRuntimeMatches, inspectRuntimeComponents, receiveRuntimeHostContext, trustRuntimeManifest, } from "@tiangong-lca/cli/runtime";
|
|
4
|
+
import { createManagedFoundryActionProjector } from "./foundry-managed-actions.js";
|
|
4
5
|
import { FoundryContextError } from "./foundry-runtime-error.js";
|
|
5
6
|
import { describeFoundryRuntime } from "./foundry-runtime-paths.js";
|
|
6
7
|
import { assertFoundryPackage } from "./foundry-package-contract.js";
|
|
@@ -134,6 +135,7 @@ function prepare(context) {
|
|
|
134
135
|
if (target.manifest.product.id !== "tiangong-foundry")
|
|
135
136
|
fail("Runtime selection targets must be Foundry manifests.");
|
|
136
137
|
return Object.freeze({
|
|
138
|
+
projectNextActions: createManagedFoundryActionProjector(context, observedCli, runtime.entryPath),
|
|
137
139
|
workspaceAccess: Object.freeze({ manifest: context.manifest, access: policy.access }),
|
|
138
140
|
runtimeSelection: Object.freeze({
|
|
139
141
|
cliExpectation: Object.freeze(cli),
|
|
@@ -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-authorization-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.7";
|
|
6
6
|
declare const cliPackageName = "@tiangong-lca/cli";
|
|
7
7
|
declare const cliPackageVersion = "0.1.13";
|
|
8
8
|
declare const packageBin = "package-dist/scripts/package-entry.js";
|
|
@@ -51,7 +51,7 @@ export const foundryPackageStaticFiles = Object.freeze([
|
|
|
51
51
|
"LICENSE",
|
|
52
52
|
]);
|
|
53
53
|
const packageName = "@tiangong-lca/foundry";
|
|
54
|
-
const packageVersion = "0.1.
|
|
54
|
+
const packageVersion = "0.1.7";
|
|
55
55
|
const packageDescription = "Control plane for TianGong LCA external dataset import and TIDAS authoring work.";
|
|
56
56
|
const cliPackageName = "@tiangong-lca/cli";
|
|
57
57
|
const cliPackageVersion = "0.1.13";
|
|
@@ -4,6 +4,7 @@ import type { FoundryRuntimeManagerOptions } from "./lib/foundry-runtime-selecti
|
|
|
4
4
|
import type { FoundryAuthentication } from "./lib/foundry-runtime-identity.ts";
|
|
5
5
|
import { type FoundryFacadeRuntimeSelection } from "./foundry-facade.ts";
|
|
6
6
|
import { type FoundryWorkspaceAccess, type FoundryAccountIntent } from "./lib/foundry-runtime-context.ts";
|
|
7
|
+
import { type FoundryOperationResult } from "./lib/foundry-operation-result.ts";
|
|
7
8
|
export interface FoundryRuntimeCommandHost {
|
|
8
9
|
readonly runtimeSelection?: FoundryFacadeRuntimeSelection;
|
|
9
10
|
readonly workspaceAccess?: FoundryWorkspaceAccess;
|
|
@@ -16,7 +17,10 @@ export interface FoundryRuntimeCommandHost {
|
|
|
16
17
|
readonly writeStdout?: (text: string) => void;
|
|
17
18
|
readonly setExitCode?: (code: number) => void;
|
|
18
19
|
}
|
|
19
|
-
type
|
|
20
|
+
export type PreparedFoundryRuntimeHost = Omit<FoundryRuntimeCommandHost, "signal" | "writeStdout" | "setExitCode"> & {
|
|
21
|
+
readonly projectNextActions?: (result: FoundryOperationResult) => FoundryOperationResult;
|
|
22
|
+
};
|
|
23
|
+
type PrepareRuntimeHost = (signal: AbortSignal) => Promise<PreparedFoundryRuntimeHost>;
|
|
20
24
|
export declare function runFoundryRuntimeCommand(argv?: string[], host?: FoundryRuntimeCommandHost, prepareHost?: PrepareRuntimeHost): Promise<void>;
|
|
21
25
|
/** Package bin boundary: never fall back to repository/developer commands. */
|
|
22
26
|
export declare function runFoundryPublicCommand(argv?: string[], host?: FoundryRuntimeCommandHost, prepareHost?: PrepareRuntimeHost): Promise<void>;
|
|
@@ -385,6 +385,8 @@ export async function runFoundryRuntimeCommand(argv = process.argv, host = {}, p
|
|
|
385
385
|
...prepared,
|
|
386
386
|
signal: effectiveHost.signal,
|
|
387
387
|
});
|
|
388
|
+
if (prepared.projectNextActions)
|
|
389
|
+
result = prepared.projectNextActions(result);
|
|
388
390
|
}
|
|
389
391
|
catch (error) {
|
|
390
392
|
result = effectiveHost.signal?.aborted
|
package/package.json
CHANGED