@tiangong-lca/foundry 0.1.5 → 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 +5 -5
- package/docs/architecture.md +5 -5
- package/docs/foundry-task-contracts.md +4 -4
- package/docs/import-profiles/worldsteel/constraints.md +3 -3
- package/docs/import-profiles/worldsteel/import-coverage.md +3 -3
- package/docs/import-profiles/worldsteel/import-plan.md +4 -4
- package/docs/import-profiles/worldsteel/profile.md +3 -3
- package/docs/package-distribution-contract.md +14 -6
- package/docs/public-runtime-contract.md +5 -5
- package/docs/runtime-context-contract.md +6 -4
- package/docs/task-authorization-contract.md +3 -3
- package/package-dist/assets/foundry-package-descriptor.json +52 -42
- 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 +2 -2
- package/package-dist/scripts/lib/foundry-package-contract.js +2 -2
- package/package-dist/scripts/lib/foundry-runtime-qualification.js +2 -2
- package/package-dist/scripts/lib/foundry-runtime-utils.js +1 -1
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.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 +2 -2
- package/specs/import-profiles.json +1 -1
- package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
- package/specs/schemas/foundry-package-descriptor.schema.json +2 -2
- package/specs/schemas/runtime-qualification.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
|
|
@@ -339,9 +339,9 @@ pnpm case:production:contact-draft -- \
|
|
|
339
339
|
|
|
340
340
|
The runner accepts no API key or alternate CLI path on argv. It reads only `TIANGONG_LCA_API_BASE_URL`, `TIANGONG_LCA_SUPABASE_PUBLISHABLE_KEY`, and `TIANGONG_LCA_TEST_API_KEY`; the test key exists only in the child environment. The env file must be a regular non-symlink file with POSIX mode `0600` or stricter and, when it is inside this repository, must be git-ignored. The new output directory must also be inside this repository, git-ignored, and reached without a symlinked parent.
|
|
341
341
|
|
|
342
|
-
This production lane is POSIX-only. Windows execution fails closed until the runner can verify a user-exclusive ACL; Windows CI covers that refusal rather than a live case. On POSIX, the runner snapshots the exact installed CLI 0.1.
|
|
342
|
+
This production lane is POSIX-only. Windows execution fails closed until the runner can verify a user-exclusive ACL; Windows CI covers that refusal rather than a live case. On POSIX, the runner snapshots the exact installed CLI 0.1.13 package inside its pnpm dependency island, hashes and rechecks the full pnpm installation plus Foundry source/build/lock facts before every child boundary, executes from a clean directory with `shell=false`, fsyncs create-only private evidence, and publishes a content-addressed case manifest only after the runtime snapshot is removed. Any detected secret in stdout, a report, or a sidecar artifact fails the case and leaves only redacted failure evidence. The created contact remains isolated, unreviewed, and unpublished under the authenticated test account for later case evidence; the lane never performs review/publish transitions or mutates foreign/public/shared rows.
|
|
343
343
|
|
|
344
|
-
Credential-scoped commands use `pnpm account:run -- <profile> -- <executable> [args...]`. The ignored profile supplies both the expected Supabase project ref and canonical user UUID. The wrapper resolves the installed CLI 0.1.
|
|
344
|
+
Credential-scoped commands use `pnpm account:run -- <profile> -- <executable> [args...]`. The ignored profile supplies both the expected Supabase project ref and canonical user UUID. The wrapper resolves the installed CLI 0.1.13, obtains a fresh intent-bound `auth identity-receipt`, and then executes the requested argv without a shell and without inheriting unrelated parent environment variables. Authentication bypass flags are unsupported.
|
|
345
345
|
|
|
346
346
|
Issue #70 consumes CLI 0.1.3 through its supported `./batch` and `./auth-identity-receipt` subpaths. The production identity-preflight path uses the public strict parser; deterministic receipt construction exists only in a local test fixture, and the toolchain ratchet rejects every `@tiangong-lca/cli/dist/src/**` import. pnpm's 1,440-minute maturity gate remains enabled; the exact 0.1.3 exception is bound to the release already verified by tag, Sigstore/Rekor provenance, registry integrity, and clean public consumers.
|
|
347
347
|
|
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
|
|
@@ -174,7 +174,7 @@ The public task facade delegates sealed owner execution to `foundry-workflow-exe
|
|
|
174
174
|
|
|
175
175
|
## OAuth identity boundary
|
|
176
176
|
|
|
177
|
-
Foundry selects a private session reference and exact project/user intent, then calls the published CLI for a fresh server-verified identity receipt. It validates TTL, canonical hash, expected identity and current OAuth session metadata without owning login, password decoding, token exchange or refresh. Candidate Golden execution uses an isolated Git-visible source snapshot so ignored operator state cannot change qualification. Support-cache transport is owned by the public CLI export. Foundry validates the fresh identity, project, public-state scope, completion marker, artifact paths and hashes, then summarizes rows and atomically replaces only the requested local cache. The CLI runs in a private temporary cwd with an allowlisted OAuth environment; the operator checkout .env and unrelated secrets cannot enter that child. Exact public CLI 0.1.
|
|
177
|
+
Foundry selects a private session reference and exact project/user intent, then calls the published CLI for a fresh server-verified identity receipt. It validates TTL, canonical hash, expected identity and current OAuth session metadata without owning login, password decoding, token exchange or refresh. Candidate Golden execution uses an isolated Git-visible source snapshot so ignored operator state cannot change qualification. Support-cache transport is owned by the public CLI export. Foundry validates the fresh identity, project, public-state scope, completion marker, artifact paths and hashes, then summarizes rows and atomically replaces only the requested local cache. The CLI runs in a private temporary cwd with an allowlisted OAuth environment; the operator checkout .env and unrelated secrets cannot enter that child. Exact public CLI 0.1.13 and reviewed TIDAS 0.2.x/0.3.x expectations are independently selected and re-observed through the W04 qualification boundary. F1 component provenance and package qualification remain W06/W08 gates.
|
|
178
178
|
|
|
179
179
|
## Qualified execution boundary
|
|
180
180
|
|
|
@@ -341,7 +341,7 @@ Build and test resolution must be worktree-local. A clean arbitrary Git worktree
|
|
|
341
341
|
|
|
342
342
|
Cross-platform characterization is also explicit: the Golden harness compares normalized outputs to a non-`HEAD` merge-base, performs recursive comparison in Node rather than calling an external Unix utility, and uses full Git history in CI. Script-backed executable overrides are represented as an executable plus argv prefix and run through Node on macOS, Linux, and Windows. The root `.gitattributes` fixes text files to LF while allowing Windows launcher exceptions, preventing checkout policy from masquerading as format drift.
|
|
343
343
|
|
|
344
|
-
The first credential-bearing entrypoint on that spine is `scripts/with-lca-account.ts`. It does not authenticate against Supabase itself. It resolves the exact installed CLI 0.1.
|
|
344
|
+
The first credential-bearing entrypoint on that spine is `scripts/with-lca-account.ts`. It does not authenticate against Supabase itself. It resolves the exact installed CLI 0.1.13, requests `auth identity-receipt` with both expected project and user assertions, accepts only a fresh intent-bound forced signin, and then launches the requested executable plus argv with `shell:false` and a restricted environment. The CLI owns session and live identity behavior; Foundry owns the profile/thread intent checks and safe process boundary.
|
|
345
345
|
|
|
346
346
|
`scripts/lib/identity-preflight-proof.ts` imports the strict parser from the public `@tiangong-lca/cli/auth-identity-receipt` subpath. `test/fixtures/auth-identity-receipt.ts` is the sole test-only wire-fixture owner and produces bytes that must pass that public parser. No production module or fixture may load CLI `dist/src/**`; the installed-package contract also exercises public batch scheduling/run-lock behavior and proves the private path remains closed.
|
|
347
347
|
|
|
@@ -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-09
|
|
32
|
+
lastReviewedCommit: fa219ecc833c0aad9bb6a3661265a57f8f24a814
|
|
33
|
+
lastReviewedNote: "Reviewed for Foundry #147: adopt independently verified CLI 0.1.13 at b5e2092 with original permission-preserving bootstrap scripts. Exact runtime/schema/package/release expectations advance together; other dependencies, TIDAS, profile rules, task authorization and private no-replay evidence remain unchanged."
|
|
34
34
|
related:
|
|
35
35
|
- AGENTS.md
|
|
36
36
|
- WORKFLOW.md
|
|
@@ -132,7 +132,7 @@ Account registration optionally stores `account_mode` from explicit task/host in
|
|
|
132
132
|
|
|
133
133
|
An expected account may be selected after local preparation. The first selection is registered as project/user intent; subsequent disagreement is rejected. A missing task-local account file may only be restored from its existing workspace registration. This is intent, not proof of authentication.
|
|
134
134
|
|
|
135
|
-
`verifyFoundryRuntimeIdentity` invokes the exact installed CLI through executable/argv in a fresh private CWD with a restricted environment. The CLI owns OAuth/session refresh and server identity verification. Returned proof is immutable, process-local and bound to workspace/task/actor/runtime, with a 60-second freshness check at permission admission. Serialized proof is not reusable authority. Headless mode uses the CLI's existing explicit target and process-only access token, with cache disabled and no token persistence. CLI 0.1.
|
|
135
|
+
`verifyFoundryRuntimeIdentity` invokes the exact installed CLI through executable/argv in a fresh private CWD with a restricted environment. The CLI owns OAuth/session refresh and server identity verification. Returned proof is immutable, process-local and bound to workspace/task/actor/runtime, with a 60-second freshness check at permission admission. Serialized proof is not reusable authority. Headless mode uses the CLI's existing explicit target and process-only access token, with cache disabled and no token persistence. CLI 0.1.13 reports no token-expiry timestamp for that mode; Foundry does not invent one or claim a separately verified token lifetime.
|
|
136
136
|
|
|
137
137
|
`registerFoundryTaskAuthorization` is an explicit host approval operation. It requires fresh identity, current task/input lineage, a valid W03 grant, and independently selected evidence facts supplied by the trusted caller. The grant cannot select its own evidence paths. Each original evidence file is rechecked and copied into an immutable task snapshot; the grant and selection are registered in workspace state. Updating `authorization.json` uses compare-and-swap against its prior digest and preserves historical grants. Unknown legacy authorization files are not overwritten.
|
|
138
138
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
2
|
+
lastReviewedAt: 2026-09-09
|
|
3
|
+
lastReviewedCommit: fa219ecc833c0aad9bb6a3661265a57f8f24a814
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #147: adopt independently verified CLI 0.1.13 at b5e2092 with original permission-preserving bootstrap scripts. Exact runtime/schema/package/release expectations advance together; other dependencies, TIDAS, profile rules, task authorization and private no-replay evidence remain unchanged."
|
|
5
5
|
title: worldsteel Import Constraints
|
|
6
6
|
docType: constraints
|
|
7
7
|
scope: import-profile
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
2
|
+
lastReviewedAt: 2026-09-09
|
|
3
|
+
lastReviewedCommit: fa219ecc833c0aad9bb6a3661265a57f8f24a814
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #147: adopt independently verified CLI 0.1.13 at b5e2092 with original permission-preserving bootstrap scripts. Exact runtime/schema/package/release expectations advance together; other dependencies, TIDAS, profile rules, task authorization and private no-replay evidence remain unchanged."
|
|
5
5
|
title: worldsteel EF3.1 Import Coverage Evidence
|
|
6
6
|
docType: report
|
|
7
7
|
scope: import-profile/worldsteel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
2
|
+
lastReviewedAt: 2026-09-09
|
|
3
|
+
lastReviewedCommit: fa219ecc833c0aad9bb6a3661265a57f8f24a814
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #147: adopt independently verified CLI 0.1.13 at b5e2092 with original permission-preserving bootstrap scripts. Exact runtime/schema/package/release expectations advance together; other dependencies, TIDAS, profile rules, task authorization and private no-replay evidence remain unchanged."
|
|
5
5
|
title: worldsteel EF3.1 ILCD Import Plan
|
|
6
6
|
docType: plan
|
|
7
7
|
scope: import-profile/worldsteel
|
|
@@ -331,7 +331,7 @@ The vast majority of those exchanges point at EF3.1 reference flows that will re
|
|
|
331
331
|
|
|
332
332
|
## 9. Risk register (consolidated gotchas)
|
|
333
333
|
|
|
334
|
-
- **Use the project-installed CLI** — leave `TIANGONG_LCA_CLI_BIN` blank so Foundry resolves exact `@tiangong-lca/cli@0.1.
|
|
334
|
+
- **Use the project-installed CLI** — leave `TIANGONG_LCA_CLI_BIN` blank so Foundry resolves exact `@tiangong-lca/cli@0.1.13`; an override is only for an explicit local test binary. Credential-scoped execution still goes through the receipt-gated `pnpm account:run` wrapper.
|
|
335
335
|
- **Don't copy BAFU/USLCI profile wholesale** — Worldsteel reuses every canonical row by UUID, caps the R3 elementary tail, and enables R5 only for materialized FP/UG canonical-cache misses behind the full account-local support gates.
|
|
336
336
|
- **`databaseFallbackSourceConfig` silently inherits BAFU** for any unknown profile → ✅ worldsteel branch added.
|
|
337
337
|
- **`source_contact_rewrites` gated to bafu/uslci** → ✅ widened to include `worldsteel`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
2
|
+
lastReviewedAt: 2026-09-09
|
|
3
|
+
lastReviewedCommit: fa219ecc833c0aad9bb6a3661265a57f8f24a814
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #147: adopt independently verified CLI 0.1.13 at b5e2092 with original permission-preserving bootstrap scripts. Exact runtime/schema/package/release expectations advance together; other dependencies, TIDAS, profile rules, task authorization and private no-replay evidence remain unchanged."
|
|
5
5
|
title: worldsteel Import Profile
|
|
6
6
|
docType: profile
|
|
7
7
|
scope: import-profile
|
|
@@ -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
|
|
@@ -48,7 +48,9 @@ related:
|
|
|
48
48
|
|
|
49
49
|
The npm identity is `@tiangong-lca/foundry`; the public bin is `tiangong-foundry`. W06 establishes the installable `0.1.0` candidate and its production dependency closure. It does not publish a registry version or call this candidate F1. W08 owns the release-only workflow, Trusted Publishing/provenance, immutable tag, platform components, SBOM/license bundle and product compatibility manifest.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
CLI 0.1.13 is independently verified at source/tag `b5e209259d3bb06205b9af131b1c0edc3fba6da2`. Its original POSIX bootstrap preserves verified archive modes under the private umask; its PowerShell bytes are unchanged. The exact source/script digests in `specs/release/runtime-inputs.json` and runtime descriptor/schema expectations advance with the single CLI lock entry. All other 134 locked packages and the sixteen-package production closure remain unchanged.
|
|
52
|
+
|
|
53
|
+
The package depends exactly on public `@tiangong-lca/cli@0.1.13`. Ajv remains a development dependency for internal commands and release-side SPDX validation. Sigstore 5.0.0, YAML 2.9.0, tar 7.5.22 and fflate 0.8.3 are also development-only release tools for signing/verification, lock parsing and bounded upstream archive selection. None enters the public compiler/dependency closure. TIDAS is an independently verified native component selected later by the CLI manager, not an npm dependency or bundled binary.
|
|
52
54
|
|
|
53
55
|
## Public surface
|
|
54
56
|
|
|
@@ -68,7 +70,7 @@ The selected launch must use the current managed Node and exactly one declared a
|
|
|
68
70
|
|
|
69
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.
|
|
70
72
|
|
|
71
|
-
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.
|
|
72
74
|
|
|
73
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.
|
|
74
76
|
|
|
@@ -172,6 +174,8 @@ Native source qualification, published-input assembly and npm signing may consum
|
|
|
172
174
|
|
|
173
175
|
For resumable publication, start a new dispatch of the exact immutable release tag and set `resume_run_id` to the retained qualification run. Keep that original run intact. GitHub can remove artifacts belonging to jobs selected by **Re-run all jobs**; an attempt suffix does not preserve them. Re-running the original qualification run can therefore require full qualification again. A recovery run with an explicit retained origin can itself be rerun: it re-verifies the origin's proof if its own relay artifact disappeared. Failed-job retries may consume surviving successful-stage proofs, but missing or expired prerequisites never count as success. Record the exact selected origin before starting recovery; do not rerun or delete its producer while relying on those artifacts.
|
|
174
176
|
|
|
177
|
+
Public bootstrap qualification keeps its disposable home, runtime cache, copied scripts and test workspace in `foundry-bootstrap-public-work`. Only the completed `bootstrap-qualification.json` bytes are copied into a new `foundry-bootstrap-public-qualification` evidence directory before semantic validation, capsule inventory and signing. Empty temporary directories and cached component files are not stage evidence; the generic capsule still rejects empty directories, hidden paths and unregistered payloads. Existing proof directories are never overwritten. Restored signed bootstrap capsules follow the unchanged validation path and do not rerun qualification or proof staging.
|
|
178
|
+
|
|
175
179
|
The reusable stages are complete source qualification, published-native qualification per platform, component-publication metadata and public bootstrap per platform. Source qualification is one complete stage: failure before its capsule is sealed still needs source requalification. Native archive attestations remain mandatory and are verified against the original receipt's source/ref. Source package consumers verify the signed capsule, then the original build manifest and archive inventory; `FOUNDRY_QUALIFICATION_CAPSULE` cannot be combined with the older three-variable selection. No restored receipt becomes installed-runtime or business authorization.
|
|
176
180
|
|
|
177
181
|
Only the final source sealing job receives OIDC/attestation-write permission; test and native source checks remain read-only. Fork PRs run the complete checks without signing or reuse. Final guards reject failed, skipped or missing required stages, including failed sealing. During publication, existing npm/tag/component/final-manifest state is still independently revalidated; reuse does not bypass immutable-asset consistency checks or authorize another upload.
|
|
@@ -300,7 +304,7 @@ Native handshake success is not minimum-host or clean-machine qualification. Cur
|
|
|
300
304
|
|
|
301
305
|
`pnpm package:build` rebuilds both output roots from scratch and verifies the staged package. `pnpm package:check` compares the stage with the descriptor, runs a pack dry-run, and verifies the installed C1 descriptor. `pnpm package:pack` packs only `package-stage/` into an owned temporary directory, derives the versioned archive name from the verified staged descriptor, then installs it with an exclusive hardlink. The repository manifest, compiled verifier version and descriptor JSON Schema version remain coherent release projections; the verifier never takes its expected identity from the installed manifest it is checking. An identical existing archive is reused; a link, invalid file or different existing bytes are preserved and rejected rather than overwritten.
|
|
302
306
|
|
|
303
|
-
The package scenario rebuilds twice, packs twice byte-identically, and installs the same tarball into two clean consumers; the second install is offline from the first consumer's isolated public cache. The scenario first verifies the source-pinned pnpm version. Corepack, when used, stores that tool in a fresh scenario-local cache shared across the isolated tool homes; later packing runs with Corepack networking disabled and latest-version lookup disabled. Tool bootstrap and the first public-registry install have bounded five-minute deadlines for cold network downloads; the offline install and local commands retain their two-minute deadlines. It verifies the exact import surface and declarations, public CLI 0.1.
|
|
307
|
+
The package scenario rebuilds twice, packs twice byte-identically, and installs the same tarball into two clean consumers; the second install is offline from the first consumer's isolated public cache. The scenario first verifies the source-pinned pnpm version. Corepack, when used, stores that tool in a fresh scenario-local cache shared across the isolated tool homes; later packing runs with Corepack networking disabled and latest-version lookup disabled. Tool bootstrap and the first public-registry install have bounded five-minute deadlines for cold network downloads; the offline install and local commands retain their two-minute deadlines. It verifies the exact import surface and declarations, public CLI 0.1.13 runtime identity, shebang/bin, source/installed operation equivalence, arbitrary Unicode CWD, read-only package bytes, isolated workspace writes and all six facade operations. It also proves that internal commands, modified/extra/linked files, a lifecycle-bearing manifest, a `darwin-x64` descriptor and a package copied without C1 fail closed.
|
|
304
308
|
|
|
305
309
|
These checks qualify a local candidate tarball. They do not prove registry provenance, public component download, native TIDAS availability on every host or a complete Node+CLI+Foundry+TIDAS component. Those are W08 release gates.
|
|
306
310
|
|
|
@@ -311,3 +315,7 @@ The W10 planning extension adds the shared pure attempt leaf and bounded migrati
|
|
|
311
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.
|
|
312
316
|
|
|
313
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
|
|
|
@@ -177,7 +177,7 @@ Every facade revision also rechecks all retained predecessors in its request cha
|
|
|
177
177
|
|
|
178
178
|
## Runtime selection and migration seam
|
|
179
179
|
|
|
180
|
-
The public facade accepts CLI/TIDAS expectations only through its process-local host interface. Ordinary argv, task specs, `.env` and ambient `TIDAS_BIN`/expectation variables cannot select trust anchors. Without a host selection, doctor, start, status and local resume work and report `qualification.required`; child-required work must return the runtime qualification action. The managed bin now obtains this selection from the CLI IPC context and its verified component metadata. The final immutable production product manifest remains a W08 deliverable. The current exact CLI 0.1.
|
|
180
|
+
The public facade accepts CLI/TIDAS expectations only through its process-local host interface. Ordinary argv, task specs, `.env` and ambient `TIDAS_BIN`/expectation variables cannot select trust anchors. Without a host selection, doctor, start, status and local resume work and report `qualification.required`; child-required work must return the runtime qualification action. The managed bin now obtains this selection from the CLI IPC context and its verified component metadata. The final immutable production product manifest remains a W08 deliverable. The current exact CLI 0.1.13 constraint remains explicit rather than silently accepting a future version.
|
|
181
181
|
|
|
182
182
|
`workspace migrate --dry-run` recursively inventories only regular files/directories, rejects links and returns `tiangong-foundry.workspace-migration-plan.v1` as an inline content-bound artifact. It classifies control, local-preparation, terminal-success, attempted/unknown, authorization/account and unclassified paths. The public envelope is bounded to 10,000 entries and 64 directory levels. The total hashed inventory is bounded to 256 MiB. Files larger than 64 MiB and recognized credential/session files retain path/size/classification facts with `sha256=null`; their contents are not read by this inventory. The tree digest binds this observational inventory, not an atomic filesystem snapshot, so W10 must re-read and verify every selected source immediately before apply. It writes nothing. W10 owns application, rollback and detailed old-schema mapping.
|
|
183
183
|
|
|
@@ -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
|
|
@@ -64,7 +64,7 @@ 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
|
-
`qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.
|
|
67
|
+
`qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.13` 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
68
|
|
|
69
69
|
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.
|
|
70
70
|
|
|
@@ -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.
|
|
@@ -29,9 +29,9 @@ checkPaths:
|
|
|
29
29
|
- test/unit/task-authorization.test.mts
|
|
30
30
|
- test/unit/task-profile-authority.test.mts
|
|
31
31
|
- test/scenarios/foundry-execution-admission.test.mts
|
|
32
|
-
lastReviewedAt: 2026-09-
|
|
33
|
-
lastReviewedCommit:
|
|
34
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
32
|
+
lastReviewedAt: 2026-09-09
|
|
33
|
+
lastReviewedCommit: fa219ecc833c0aad9bb6a3661265a57f8f24a814
|
|
34
|
+
lastReviewedNote: "Reviewed for Foundry #147: adopt independently verified CLI 0.1.13 at b5e2092 with original permission-preserving bootstrap scripts. Exact runtime/schema/package/release expectations advance together; other dependencies, TIDAS, profile rules, task authorization and private no-replay evidence remain unchanged."
|
|
35
35
|
related:
|
|
36
36
|
- docs/architecture.md
|
|
37
37
|
- docs/safety-policy.md
|
|
@@ -2,10 +2,10 @@
|
|
|
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
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.13"
|
|
9
9
|
},
|
|
10
10
|
"bin": "package-dist/scripts/package-entry.js",
|
|
11
11
|
"public_api": "package-dist/scripts/public-api.js",
|
|
@@ -58,18 +58,18 @@
|
|
|
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",
|
|
71
|
-
"bytes":
|
|
72
|
-
"sha256": "
|
|
71
|
+
"bytes": 19995,
|
|
72
|
+
"sha256": "33ad2d0e2d7aa15346ffdf83d1240afc0559b3f635308319ca50412d5e93efcc"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"path": "docs/import-profiles/bafu/constraints.md",
|
|
@@ -98,38 +98,38 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"path": "docs/import-profiles/worldsteel/constraints.md",
|
|
101
|
-
"bytes":
|
|
102
|
-
"sha256": "
|
|
101
|
+
"bytes": 7842,
|
|
102
|
+
"sha256": "a5a0a3c8d6a38b8050b60c8c88054da73c7a335211990f84047165d000d6f2d4"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"path": "docs/import-profiles/worldsteel/import-coverage.md",
|
|
106
|
-
"bytes":
|
|
107
|
-
"sha256": "
|
|
106
|
+
"bytes": 6702,
|
|
107
|
+
"sha256": "cfb3879fafa662f8ea2f36108f8fe8148045b930629bee8a3250567104ebcf9c"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"path": "docs/import-profiles/worldsteel/import-plan.md",
|
|
111
|
-
"bytes":
|
|
112
|
-
"sha256": "
|
|
111
|
+
"bytes": 46797,
|
|
112
|
+
"sha256": "f1b46092a6eeb653fd95adfc781536354f516982c4af160be92d657bca159270"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"path": "docs/import-profiles/worldsteel/profile.md",
|
|
116
|
-
"bytes":
|
|
117
|
-
"sha256": "
|
|
116
|
+
"bytes": 8158,
|
|
117
|
+
"sha256": "5d7f119a729930d4a745abe2d171d78bddd78872b141c46fa154ba2fb2b51a1f"
|
|
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",
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"path": "docs/task-authorization-contract.md",
|
|
141
|
-
"bytes":
|
|
142
|
-
"sha256": "
|
|
141
|
+
"bytes": 17347,
|
|
142
|
+
"sha256": "a578d89b5dcbee8d06aa378c59dbbd29fa697fcef636ba0b99c251f52873af8c"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
"path": "docs/uslci-import-runbook.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",
|
|
@@ -729,7 +739,7 @@
|
|
|
729
739
|
{
|
|
730
740
|
"path": "package-dist/scripts/lib/foundry-runtime-qualification.js",
|
|
731
741
|
"bytes": 12065,
|
|
732
|
-
"sha256": "
|
|
742
|
+
"sha256": "1e3542fe176cc82d4e8c2ab0c7e1fbe804b3ce96ca24172d4ce657fe3e456144"
|
|
733
743
|
},
|
|
734
744
|
{
|
|
735
745
|
"path": "package-dist/scripts/lib/foundry-runtime-selection-record.d.ts",
|
|
@@ -759,7 +769,7 @@
|
|
|
759
769
|
{
|
|
760
770
|
"path": "package-dist/scripts/lib/foundry-runtime-utils.js",
|
|
761
771
|
"bytes": 23278,
|
|
762
|
-
"sha256": "
|
|
772
|
+
"sha256": "5ed9a1dbd07eb374c88dc5a66913b3b4c3ee7923a5f133b3b413b4f5551217f0"
|
|
763
773
|
},
|
|
764
774
|
{
|
|
765
775
|
"path": "package-dist/scripts/lib/foundry-semantic-input.d.ts",
|
|
@@ -1089,7 +1099,7 @@
|
|
|
1089
1099
|
{
|
|
1090
1100
|
"path": "package-dist/scripts/lib/import-curation/internal/context-inputs.js",
|
|
1091
1101
|
"bytes": 8791,
|
|
1092
|
-
"sha256": "
|
|
1102
|
+
"sha256": "4ad85987669c6f901342553d558393487c7b008370eae09e658e7705f566f285"
|
|
1093
1103
|
},
|
|
1094
1104
|
{
|
|
1095
1105
|
"path": "package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.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",
|
|
@@ -1549,7 +1559,7 @@
|
|
|
1549
1559
|
{
|
|
1550
1560
|
"path": "specs/import-profiles.json",
|
|
1551
1561
|
"bytes": 6781,
|
|
1552
|
-
"sha256": "
|
|
1562
|
+
"sha256": "a8047bd54cb765daab1207e3dc6b24c9ea3fbe59549aeb06e6aeecc18f62fa4f"
|
|
1553
1563
|
},
|
|
1554
1564
|
{
|
|
1555
1565
|
"path": "specs/prewrite-content-policy.json",
|
|
@@ -1579,7 +1589,7 @@
|
|
|
1579
1589
|
{
|
|
1580
1590
|
"path": "specs/schemas/foundry-managed-runtime.schema.json",
|
|
1581
1591
|
"bytes": 3278,
|
|
1582
|
-
"sha256": "
|
|
1592
|
+
"sha256": "9e2d81669dee71a8486829665f02eb59bba2e735c4a4e8529cb75c7a34783698"
|
|
1583
1593
|
},
|
|
1584
1594
|
{
|
|
1585
1595
|
"path": "specs/schemas/foundry-migration-activation.schema.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",
|
|
@@ -1644,7 +1654,7 @@
|
|
|
1644
1654
|
{
|
|
1645
1655
|
"path": "specs/schemas/runtime-qualification.schema.json",
|
|
1646
1656
|
"bytes": 2261,
|
|
1647
|
-
"sha256": "
|
|
1657
|
+
"sha256": "5dfef13465309730ea1cd8398a35d7a7c1f7a13eb85c9b529055ed55e127b1cd"
|
|
1648
1658
|
},
|
|
1649
1659
|
{
|
|
1650
1660
|
"path": "specs/schemas/task-authorization.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,9 +2,9 @@ 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
|
-
declare const cliPackageVersion = "0.1.
|
|
7
|
+
declare const cliPackageVersion = "0.1.13";
|
|
8
8
|
declare const packageBin = "package-dist/scripts/package-entry.js";
|
|
9
9
|
declare const packageApi = "package-dist/scripts/public-api.js";
|
|
10
10
|
declare const packageTypes = "package-dist/scripts/public-api.d.ts";
|
|
@@ -51,10 +51,10 @@ 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
|
-
const cliPackageVersion = "0.1.
|
|
57
|
+
const cliPackageVersion = "0.1.13";
|
|
58
58
|
const packageBin = "package-dist/scripts/package-entry.js";
|
|
59
59
|
const packageApi = "package-dist/scripts/public-api.js";
|
|
60
60
|
const packageTypes = "package-dist/scripts/public-api.d.ts";
|
|
@@ -157,8 +157,8 @@ export function qualifyFoundryRuntime(context, options) {
|
|
|
157
157
|
catch {
|
|
158
158
|
return fail("runtime_cli_unqualified", "CLI runtime bytes do not match the independently selected C1 expectation.");
|
|
159
159
|
}
|
|
160
|
-
if (cli.package.version !== "0.1.
|
|
161
|
-
fail("runtime_cli_unqualified", "Foundry requires the exact CLI 0.1.
|
|
160
|
+
if (cli.package.version !== "0.1.13" || cli.platform !== context.platform)
|
|
161
|
+
fail("runtime_cli_unqualified", "Foundry requires the exact CLI 0.1.13 C1 runtime on the selected platform.");
|
|
162
162
|
const cliExpectation = Object.freeze({ ...options.cliExpectation });
|
|
163
163
|
if (cliExpectation.schema !== CLI_RUNTIME_EXPECTATION_SCHEMA)
|
|
164
164
|
fail("runtime_cli_unqualified", "CLI runtime expectation is not the supported schema.");
|
|
@@ -8,7 +8,7 @@ import { runtimeEnvFilePolicyDisabled, runtimeEnvFilePolicyKey, } from "./foundr
|
|
|
8
8
|
import { resolveFoundryRuntimePaths } from "./foundry-runtime-paths.js";
|
|
9
9
|
const require = createRequire(import.meta.url);
|
|
10
10
|
const tiangongLcaCliPackageName = "@tiangong-lca/cli";
|
|
11
|
-
const tiangongLcaCliPackageVersion = "0.1.
|
|
11
|
+
const tiangongLcaCliPackageVersion = "0.1.13";
|
|
12
12
|
const tiangongLcaCliBinName = "tiangong-lca";
|
|
13
13
|
const { repoRoot: foundryRepoRoot } = resolveFoundryRuntimePaths(import.meta.url);
|
|
14
14
|
function isRecord(value) {
|
|
@@ -6,7 +6,7 @@ import { asText, directoryExists, ensureArray, fileExists, readJson, readText, r
|
|
|
6
6
|
function asJsonRecord(value) {
|
|
7
7
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
8
8
|
}
|
|
9
|
-
export const tidasSchemaSearchRoots = ["@tiangong-lca/cli@0.1.
|
|
9
|
+
export const tidasSchemaSearchRoots = ["@tiangong-lca/cli@0.1.13/assets/tidas-schemas"];
|
|
10
10
|
export function tidasSchemaPath(repoRoot, schemaFile) {
|
|
11
11
|
void repoRoot;
|
|
12
12
|
const candidate = path.join(resolveInstalledTiangongLcaCliPackage().schemaDir, schemaFile);
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiangong-lca/foundry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Control plane for TianGong LCA external dataset import and TIDAS authoring work.",
|
|
6
6
|
"repository": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"license": "MIT",
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@tiangong-lca/cli": "0.1.
|
|
83
|
+
"@tiangong-lca/cli": "0.1.13"
|
|
84
84
|
},
|
|
85
85
|
"foundryRuntime": {
|
|
86
86
|
"schema": "tiangong-foundry.runtime-layout.v2",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"const": "@tiangong-lca/foundry"
|
|
19
19
|
},
|
|
20
20
|
"version": {
|
|
21
|
-
"const": "0.1.
|
|
21
|
+
"const": "0.1.7"
|
|
22
22
|
},
|
|
23
23
|
"cli_dependency": {
|
|
24
24
|
"type": "object",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"const": "@tiangong-lca/cli"
|
|
30
30
|
},
|
|
31
31
|
"version": {
|
|
32
|
-
"const": "0.1.
|
|
32
|
+
"const": "0.1.13"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -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.
|
|
17
|
+
"package_version": { "const": "0.1.13" },
|
|
18
18
|
"platform": {
|
|
19
19
|
"enum": ["linux-x64", "linux-arm64", "darwin-arm64", "win32-x64"]
|
|
20
20
|
},
|