@tiangong-lca/foundry 0.1.6 → 0.1.8
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 +7 -5
- package/docs/architecture.md +7 -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 +1 -1
- package/docs/import-profiles/worldsteel/profile.md +3 -3
- package/docs/package-distribution-contract.md +11 -7
- package/docs/public-runtime-contract.md +23 -7
- package/docs/runtime-context-contract.md +11 -5
- package/docs/task-authorization-contract.md +8 -4
- package/package-dist/assets/foundry-package-descriptor.json +166 -90
- package/package-dist/scripts/foundry-facade.d.ts +1 -0
- package/package-dist/scripts/foundry-facade.js +35 -4
- package/package-dist/scripts/lib/finalize-owners/commit-handoff.js +65 -10
- package/package-dist/scripts/lib/finalize-owners/finalize-reference-inputs.d.ts +12 -0
- package/package-dist/scripts/lib/finalize-owners/finalize-reference-inputs.js +57 -0
- package/package-dist/scripts/lib/finalize-owners/handoff-reference-intent.d.ts +28 -0
- package/package-dist/scripts/lib/finalize-owners/handoff-reference-intent.js +115 -0
- package/package-dist/scripts/lib/finalize-owners/native-insert-closeout.d.ts +13 -0
- package/package-dist/scripts/lib/finalize-owners/native-insert-closeout.js +99 -0
- package/package-dist/scripts/lib/finalize-owners/native-insert-handoff.d.ts +47 -0
- package/package-dist/scripts/lib/finalize-owners/native-insert-handoff.js +146 -0
- package/package-dist/scripts/lib/finalize-owners/post-authoring.js +13 -0
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.d.ts +8 -2
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.js +48 -2
- package/package-dist/scripts/lib/finalize-owners/reference-intent-closeout.d.ts +12 -0
- package/package-dist/scripts/lib/finalize-owners/reference-intent-closeout.js +77 -0
- package/package-dist/scripts/lib/foundry-authorization-input.d.ts +8 -0
- package/package-dist/scripts/lib/foundry-authorization-input.js +68 -1
- package/package-dist/scripts/lib/foundry-command-metadata.js +15 -1
- package/package-dist/scripts/lib/foundry-execution-admission.js +82 -5
- 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-owner-execution-store.js +25 -2
- package/package-dist/scripts/lib/foundry-owner-readback.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-owner-readback.js +65 -14
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +4 -4
- package/package-dist/scripts/lib/foundry-package-contract.js +4 -2
- package/package-dist/scripts/lib/foundry-reference-input.d.ts +28 -0
- package/package-dist/scripts/lib/foundry-reference-input.js +235 -0
- 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/foundry-task-store.d.ts +1 -1
- package/package-dist/scripts/lib/foundry-workflow-authorization.d.ts +2 -1
- package/package-dist/scripts/lib/foundry-workflow-authorization.js +38 -2
- package/package-dist/scripts/lib/foundry-workflow-execution.js +7 -1
- package/package-dist/scripts/lib/foundry-workflow-finalize.js +43 -1
- package/package-dist/scripts/lib/foundry-workflow-state.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-workflow-state.js +31 -2
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +1 -1
- package/package-dist/scripts/public-api.d.ts +1 -0
- package/package-dist/scripts/runtime-entry.d.ts +5 -1
- package/package-dist/scripts/runtime-entry.js +4 -1
- package/package.json +3 -2
- package/specs/import-profiles.json +1 -1
- package/specs/prewrite-content-policy.json +1 -1
- package/specs/schemas/foundry-authorization-input.schema.json +38 -1
- package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
- package/specs/schemas/foundry-package-descriptor.schema.json +3 -2
- package/specs/schemas/foundry-reference-input.schema.json +137 -0
- package/specs/schemas/runtime-qualification.schema.json +1 -1
package/README.md
CHANGED
|
@@ -157,13 +157,15 @@ 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
|
|
160
|
+
lastReviewedAt: 2026-09-11
|
|
161
|
+
lastReviewedCommit: abedf975f3a0e3b11fe6714dcd8d9d6b192db904
|
|
162
|
+
lastReviewedNote: "Reviewed for #159: Foundry 0.1.8 changes only the three version projections after merged #119/#122/#126. CLI 0.1.14, Node/TIDAS, dependency locks, runtime/permission behavior and release workflow stay unchanged; public qualification and consumer/root completion remain required."
|
|
163
163
|
---
|
|
164
164
|
|
|
165
165
|
# TianGong LCA Data Foundry
|
|
166
166
|
|
|
167
|
+
The ordinary user entry is the independently installed [TianGong Foundry skill](https://github.com/tiangong-lca/skills/tree/main/foundry-tidas-import). Its qualified release lock selects the managed runtime for a separate user workspace. The internal authoring role is maintained in the same Skills repository and loads for current semantic work items. This source checkout retains the developer commands and runtime owners described below; it carries no second maintained copy of either skill.
|
|
168
|
+
|
|
167
169
|
The package candidate now supports CLI-managed execution with verified runtime components and separate read/write workspace access. F1 publication and complete production qualification remain in progress; see `docs/package-distribution-contract.md` for the current release boundary.
|
|
168
170
|
|
|
169
171
|
Migration transfer planning is governed by [the workspace migration contract](docs/workspace-migration-contract.md). W10 provides explicit source/queue/input staging, current-owner task adoption, audited v2 activation and separate runtime read/write selection. Preserved history blocks replay across requests and migrations; none of these records grants business permission. Operational qualification and release integration remain tracked in #108/#980.
|
|
@@ -339,9 +341,9 @@ pnpm case:production:contact-draft -- \
|
|
|
339
341
|
|
|
340
342
|
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
343
|
|
|
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.
|
|
344
|
+
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.14 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
345
|
|
|
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.
|
|
346
|
+
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.14, 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
347
|
|
|
346
348
|
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
349
|
|
package/docs/architecture.md
CHANGED
|
@@ -151,13 +151,15 @@ 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
|
|
154
|
+
lastReviewedAt: 2026-09-11
|
|
155
|
+
lastReviewedCommit: abedf975f3a0e3b11fe6714dcd8d9d6b192db904
|
|
156
|
+
lastReviewedNote: "Reviewed for #159: Foundry 0.1.8 changes only the three version projections after merged #119/#122/#126. CLI 0.1.14, Node/TIDAS, dependency locks, runtime/permission behavior and release workflow stay unchanged; public qualification and consumer/root completion remain required."
|
|
157
157
|
---
|
|
158
158
|
|
|
159
159
|
# Architecture
|
|
160
160
|
|
|
161
|
+
The ordinary Foundry entry and its on-demand semantic authoring package are maintained in `tiangong-lca-skills`. This repository owns the runtime task protocol and deterministic stages; its skill inventory resolves canonical installed packages and keeps local copies untracked. The import-orchestration capability identifies Skills as the entry owner while completion/runtime capabilities retain Foundry ownership.
|
|
162
|
+
|
|
161
163
|
Managed process admission is a Foundry adapter over the public CLI host context. CLI owns IPC, component verification and leases; Foundry binds its installed package, CLI/TIDAS expectations, workspace access and target manifest before public operations. The shared runtime-cache path guard excludes workspace and migration roots from the manager cache. This adds no authentication, installer or business-write owner.
|
|
162
164
|
|
|
163
165
|
Migration transfer planning is governed by [the workspace migration contract](workspace-migration-contract.md). W10 provides explicit source/queue/input staging, current-owner task adoption, audited v2 activation and separate runtime read/write selection. Preserved history blocks replay across requests and migrations; none of these records grants business permission. Operational qualification and release integration remain tracked in #108/#980.
|
|
@@ -174,7 +176,7 @@ The public task facade delegates sealed owner execution to `foundry-workflow-exe
|
|
|
174
176
|
|
|
175
177
|
## OAuth identity boundary
|
|
176
178
|
|
|
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.
|
|
179
|
+
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.14 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
180
|
|
|
179
181
|
## Qualified execution boundary
|
|
180
182
|
|
|
@@ -341,7 +343,7 @@ Build and test resolution must be worktree-local. A clean arbitrary Git worktree
|
|
|
341
343
|
|
|
342
344
|
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
345
|
|
|
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.
|
|
346
|
+
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.14, 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
347
|
|
|
346
348
|
`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
349
|
|
|
@@ -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-11
|
|
32
|
+
lastReviewedCommit: fd348f2c0d4391974f2fd894e2939f677cae618d
|
|
33
|
+
lastReviewedNote: "Reviewed for Foundry #119: explicit native insert selection, indexed control snapshot, exact command/report bindings and no-replay recovery. CLI retains native execution ownership; existing authorization and environment boundaries remain mandatory."
|
|
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.14 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
|
|
2
|
+
lastReviewedAt: 2026-09-11
|
|
3
|
+
lastReviewedCommit: abc7672f3b3a806caa4219ab5b797f1d92421926
|
|
4
|
+
lastReviewedNote: "Reviewed for #122: explicit task reference snapshots, CLI 0.1.14 QA/intent transport, sealed admission/readback evidence and no-replay recovery. Existing profile, permission, environment and historical delivery boundaries remain enforced."
|
|
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
|
|
2
|
+
lastReviewedAt: 2026-09-11
|
|
3
|
+
lastReviewedCommit: abc7672f3b3a806caa4219ab5b797f1d92421926
|
|
4
|
+
lastReviewedNote: "Reviewed for #122: explicit task reference snapshots, CLI 0.1.14 QA/intent transport, sealed admission/readback evidence and no-replay recovery. Existing profile, permission, environment and historical delivery boundaries remain enforced."
|
|
5
5
|
title: worldsteel EF3.1 Import Coverage Evidence
|
|
6
6
|
docType: report
|
|
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.14`; 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
|
|
2
|
+
lastReviewedAt: 2026-09-11
|
|
3
|
+
lastReviewedCommit: abc7672f3b3a806caa4219ab5b797f1d92421926
|
|
4
|
+
lastReviewedNote: "Reviewed for #122: explicit task reference snapshots, CLI 0.1.14 QA/intent transport, sealed admission/readback evidence and no-replay recovery. Existing profile, permission, environment and historical delivery boundaries remain enforced."
|
|
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
|
|
37
|
+
lastReviewedAt: 2026-09-11
|
|
38
|
+
lastReviewedCommit: abedf975f3a0e3b11fe6714dcd8d9d6b192db904
|
|
39
|
+
lastReviewedNote: "Reviewed for #159: Foundry 0.1.8 changes only the three version projections after merged #119/#122/#126. CLI 0.1.14, Node/TIDAS, dependency locks, runtime/permission behavior and release workflow stay unchanged; public qualification and consumer/root completion remain required."
|
|
40
40
|
related:
|
|
41
41
|
- docs/public-runtime-contract.md
|
|
42
42
|
- docs/runtime-context-contract.md
|
|
@@ -48,9 +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
|
-
CLI 0.1.
|
|
51
|
+
CLI 0.1.14 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
52
|
|
|
53
|
-
The package depends exactly on public `@tiangong-lca/cli@0.1.
|
|
53
|
+
The package depends exactly on public `@tiangong-lca/cli@0.1.14`. 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.
|
|
54
54
|
|
|
55
55
|
## Public surface
|
|
56
56
|
|
|
@@ -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
|
|
|
@@ -304,7 +304,7 @@ Native handshake success is not minimum-host or clean-machine qualification. Cur
|
|
|
304
304
|
|
|
305
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.
|
|
306
306
|
|
|
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.
|
|
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.14 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.
|
|
308
308
|
|
|
309
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.
|
|
310
310
|
|
|
@@ -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
|
|
35
|
+
lastReviewedAt: 2026-09-11
|
|
36
|
+
lastReviewedCommit: abedf975f3a0e3b11fe6714dcd8d9d6b192db904
|
|
37
|
+
lastReviewedNote: "Reviewed for #159: Foundry 0.1.8 changes only the three version projections after merged #119/#122/#126. CLI 0.1.14, Node/TIDAS, dependency locks, runtime/permission behavior and release workflow stay unchanged; public qualification and consumer/root completion remain required."
|
|
38
38
|
related:
|
|
39
39
|
- docs/runtime-context-contract.md
|
|
40
40
|
- docs/task-authorization-contract.md
|
|
@@ -53,7 +53,7 @@ This is the implemented v1 facade protocol for `@tiangong-lca/foundry` and its `
|
|
|
53
53
|
| `tiangong-foundry doctor --workspace <path> [--expected-project-ref <ref> --expected-user-id <uuid> [--session-reference <path>]] --json` | Read-only runtime, asset, workspace and account-readiness diagnostics. It checks only bounded reference metadata, never session contents, repository maintenance, Git, login or download. |
|
|
54
54
|
| `tiangong-foundry task start --workspace <path> --spec <file> --json` | Validate the strict `task-start.v1` spec and independently capture its selected sources/optional seed. A relative spec path resolves from the selected workspace root. Request ID, actor, lane, profile, account intent and preparation live in the reviewed spec. |
|
|
55
55
|
| `tiangong-foundry task status --workspace <path> --task <id> --actor <id> --json` | Reconstruct the exact registered request revision and inspect its current task/index/attempt state. Actor intent is supplied independently on every call. |
|
|
56
|
-
| `tiangong-foundry task resume --workspace <path> --task <id> --actor <id> [--semantic-input <file> | --authorization-input <file>] --json` | Continue registered preparation, accept bound semantic input/approval, or execute and verify a sealed owner scope through the qualified CLI. Consumed/ambiguous mutation state is readback-only and never replayed. |
|
|
56
|
+
| `tiangong-foundry task resume --workspace <path> --task <id> --actor <id> [--semantic-input <file> | --authorization-input <file> | --reference-input <file>] --json` | Continue registered preparation, accept bound semantic input/approval, or execute and verify a sealed owner scope through the qualified CLI. Consumed/ambiguous mutation state is readback-only and never replayed. |
|
|
57
57
|
| `tiangong-foundry workspace migrate --workspace <path> --dry-run --json` | Inventory old state and produce a content-bound migration plan. Applying that plan is a separately explicit operation defined by W10. |
|
|
58
58
|
|
|
59
59
|
The CLI-owned `tiangong-lca runtime ensure/status` manages qualified components only; it does not initialize a Foundry job or grant data permissions. Skills invoke the Foundry facade and its next actions rather than rebuilding its task state machine.
|
|
@@ -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
|
|
|
@@ -100,7 +100,9 @@ Before the first dispatch, the batch attempt-start event durably registers an im
|
|
|
100
100
|
|
|
101
101
|
Each owner command is dispatched once as executable plus argv with explicit authentication and `shell=false`. Commit stdout must match its contained report. A confirmed success requires the existing closeout checks and fresh independent root, owner, state, payload and reference verification. Lost or unknown responses and narrowly recognized same-identity conflicts use independent readback; known business failures remain unresolved. Recovery does not require the old write grant to remain unexpired and cannot change the original request. The CLI batch item's verified/recovered result determines success; aggregate batch completion alone is insufficient.
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
Explicit native insert handoffs additionally require a matching CLI v2 execution report: exact contract canonical digest, execution id, ordered action/row identities and desired payload digests, consumed insert attempts, and successful exact readback for every action. Failed, unknown, blocked, replayed or incomplete rows cannot close the scope. After a lost response, recovery may read the original bound output's `outputs/dataset-save-draft/summary.json`; absent or invalid native evidence remains unresolved even when roots match. Recovery never dispatches another mutation or retrofits a legacy report into native consumption.
|
|
104
|
+
|
|
105
|
+
Every readback gets a fresh output directory. A verified result binds the exact input, report and JSONL check hashes, plus the native execution report when selected; later status checks rehash each fact. Completed scopes preserve their final rows while dependent scopes are finalized again after new verified progress. Reference-only partitions use the separate canonical verification stage below; semantic changes cannot replace consumed scope rows.
|
|
104
106
|
|
|
105
107
|
## Canonical reference verification
|
|
106
108
|
|
|
@@ -112,10 +114,24 @@ Success requires matching fresh stdout/report bytes and exactly one successful J
|
|
|
112
114
|
|
|
113
115
|
Status performs local evidence verification only. Failed verification exposes `reference_verification_required` and a bound resume action for another read. A successful current result is reused without another remote query. Completion also requires every remaining write scope to have its independent owner readback. Changing an indexed report, query or check invalidates the proof and cannot preserve completed status.
|
|
114
116
|
|
|
117
|
+
## Reference input
|
|
118
|
+
|
|
119
|
+
`task resume --reference-input <file>` selects `tiangong-foundry.reference-input.v1` separately from semantic input or approval. The CLI and direct JavaScript facade both reject an explicitly supplied empty reference path before task preparation or execution; only an omitted/undefined option means no new selection. The strict descriptor contains `task_id`, `actor_id`, current `rows_manifest_sha256`, `dataset_type`, `qa_reference_rows` (file/SHA-256 pairs), `intent` (one file/SHA-256 pair or null), and `review_files` (file/SHA-256 pairs). At least QA input or an intent is required. QA references apply only to Process; an intent requires its complete independently selected review-file set. Each list is bounded to 128 files, each file to 8 MiB, and the entire selection to 64 MiB. Credential paths, linked files, wrong task/actor, stale manifests, changed bytes and unused/missing review selections fail before snapshot publication.
|
|
120
|
+
|
|
121
|
+
The existing task artifact transaction records a fresh immutable generation. QA and review bytes are copied exactly; the original descriptor/intent bytes are retained. The derived intent rewrites only review file locators to the independently checked task snapshots. That derived file has its own raw SHA-256 and is the file the qualified CLI verifies. It grants no permission. Identical submissions reuse the current selection. Concurrent replacement is checked under the task lock; prepared, consumed and completed owner scopes cannot replace their reference evidence. Removing the original selected files does not remove the snapshots needed for execution/recovery.
|
|
122
|
+
|
|
123
|
+
Selection invalidates prior finalization/approval projection through the recorded reference-selection digest. Finalization uses only current indexed snapshots and requires the selected dataset's current row bytes to match its original control binding; changed rows require fresh selection. Process QA receives explicit repeated `--reference-rows-file` arguments. Precommit verification receives exactly the derived `--reference-intent-file`; default canonical-reference and root policies remain owned by the CLI. Its [exact-reference protocol](https://github.com/tiangong-lca/tiangong-cli/blob/main/docs/agents/exact-reference-intent-contract.md) owns consumer/actor/content/review eligibility. Foundry does not infer units, discover sibling files or create a reference exception itself.
|
|
124
|
+
|
|
125
|
+
Sealing obtains a fresh qualified CLI identity after local handoff preparation and performs complete capsule admission against the current grant and evidence. Before an unconsumed write, the workflow obtains a new current identity between initial rehydration and the final complete admission pass, so prior local work does not age that receipt. Both passes and the existing 60-second identity bound remain enforced before the attempt is consumed.
|
|
126
|
+
|
|
127
|
+
A passing precommit selection is carried automatically into both handoff CommandSpecs as final-row, intent, precommit and review artifact facts (plus the native contract when selected). The write command receives no unsupported reference flag. Admission rechecks the complete independently selected evidence set. Every readback, including unknown-response recovery with no commit report, requires the same current intent/consumer/review binding and still passes independent root/owner/state/payload checks. Completed-scope checks rehash retained reference facts. Missing or changed evidence never permits a mutation replay or a root-only completion shortcut.
|
|
128
|
+
|
|
115
129
|
## Authorization input
|
|
116
130
|
|
|
117
131
|
`--authorization-input` selects a strict `tiangong-foundry.authorization-input.v1` descriptor separately from semantic input. It binds task, actor, current finalization SHA-256, dataset type, `input_kind` (`current_rows` or `final_rows`), input SHA-256 and expected previous authorization-pointer SHA-256 (null for initial registration). It separately selects a grant file and unique user-decision/source-model evidence files with hashes. At least one user-decision item is required; each file is bounded to 8 MiB and the selection to 64 MiB. Credential and linked-file inputs are rejected. The grant's evidence references must use the selected canonical absolute paths, as required by the existing registration contract.
|
|
118
132
|
|
|
133
|
+
For `input_kind=final_rows` with Flow, Process or Source, the descriptor may also select `execution_contract: { "file": "<path>", "sha256": "<64 lowercase hex>" }`. This is the CLI's `dataset-save-draft-execution-contract.v1` insert-only contract, with owner draft state 0, the current project/account, and exactly the ordered final rows and desired payload digests. It grants no permission. The runtime captures a content-addressed task-owned snapshot through the existing artifact transaction before admission; later execution uses that indexed snapshot even if the original selected file is removed. The contract shares the descriptor's file/privacy/size checks. Both command bindings retain final rows and contract bytes; the CLI's canonical parsed-contract digest is recorded separately from the raw file hash. Invalid explicit selection never falls back to a legacy writer. Other dataset types and prepared-row selection cannot use this field.
|
|
134
|
+
|
|
119
135
|
Finalization exposes per-scope `authorization_inputs` with independently computed bindings and input digests. These are review metadata, not grants. The trusted caller must select approval evidence from actual current user authorization; task output or grant text alone cannot supply approval. The existing validator checks the grant, current CLI identity and scope; registration rechecks current finalization while holding the task lock and uses the existing compare-and-swap pointer. Concurrent distinct initial grants cannot both activate.
|
|
120
136
|
|
|
121
137
|
For a ready `final_rows` scope, the runtime rebuilds the original owner handoff under the validated grant, binds CommandSpec artifacts to absolute final-row paths, and creates the existing execution capsule. It registers a `foundry-authorization.json` result; identical current submissions reuse it without re-authentication or another capsule. Projection requires the matching current finalization, active pointer digest and unexpired record. A sealed result is explicitly pending execution and never dispatches a mutation. `current_rows` registration records preparation approval. Subsequent resume re-finalizes the selected type under that current grant, then proves final-row lineage and derives/activates the exact successor before sealing. Actions, evidence, account/profile binding and expiry are unchanged. Equal-byte derived files reuse the original grant only after lineage proof. A capture interruption after activation resumes from the retained preparation approval and verifies the active grant is its exact derivation; it does not request another approval. Blocked re-finalization retains its reports without repeating remote reads. Existing authorization, capsule and no-replay rules remain authoritative for subsequent execution.
|
|
@@ -177,7 +193,7 @@ Every facade revision also rechecks all retained predecessors in its request cha
|
|
|
177
193
|
|
|
178
194
|
## Runtime selection and migration seam
|
|
179
195
|
|
|
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.
|
|
196
|
+
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.14 constraint remains explicit rather than silently accepting a future version.
|
|
181
197
|
|
|
182
198
|
`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
199
|
|
|
@@ -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
|
|
43
|
+
lastReviewedAt: 2026-09-11
|
|
44
|
+
lastReviewedCommit: abedf975f3a0e3b11fe6714dcd8d9d6b192db904
|
|
45
|
+
lastReviewedNote: "Reviewed for #159: Foundry 0.1.8 changes only the three version projections after merged #119/#122/#126. CLI 0.1.14, Node/TIDAS, dependency locks, runtime/permission behavior and release workflow stay unchanged; public qualification and consumer/root completion remain required."
|
|
46
46
|
related:
|
|
47
47
|
- docs/architecture.md
|
|
48
48
|
- docs/task-authorization-contract.md
|
|
@@ -64,11 +64,11 @@ 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.14` 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
|
|
|
71
|
-
`execution-context.schema.json` describes the content-addressed child handoff stored under `evidence/executions/`. It is distinct from the older offline `foundry-execution-capsule-stage.v1` admission ledger: the older contract proves immutable staged evidence and attempt state, while `tiangong-foundry.execution-context.v1` binds a current task invocation. Rehydration requires a fresh process-local context, qualification and identity; exact workspace/task/actor, approved source ancestry, current final-row bytes, active authorization and QA waivers, installed owner CLI, owner-draft argv semantics, task-contained output root and CommandSpec digest are rechecked. The action list must match the CLI operation. Serialized admissions, unrelated CLI commands and changed capsule/spec/input bytes fail closed.
|
|
71
|
+
`execution-context.schema.json` describes the content-addressed child handoff stored under `evidence/executions/`. It is distinct from the older offline `foundry-execution-capsule-stage.v1` admission ledger: the older contract proves immutable staged evidence and attempt state, while `tiangong-foundry.execution-context.v1` binds a current task invocation. Rehydration requires a fresh process-local context, qualification and identity; exact workspace/task/actor, approved source ancestry, current final-row bytes, active authorization and QA waivers, installed owner CLI, owner-draft argv semantics, task-contained output root and CommandSpec digest are rechecked. The action list must match the CLI operation. A native insert selection admits exactly the final-row and execution-contract artifacts, with the contract independently selected from the current task index. The internal `dataset-workflow-native-contract` operation records the control snapshot without changing source-row ancestry. Native Flow/Process/Source admission revalidates the contract against the current owner, project, state 0 and ordered rows before invoking the public CLI `dataset save-draft --execution-contract`; arbitrary extra artifacts remain invalid. An explicit reference selection additionally binds exactly one intent, its passing precommit report and the complete review artifact set. Each must be independently selected by the current host and retain its indexed bytes; admission rechecks current consumer content, actor/project and evidence correspondence through the existing handoff adapter. This transport adds no eligibility policy or write authority. Serialized admissions, unrelated CLI commands and changed capsule/spec/input bytes fail closed.
|
|
72
72
|
|
|
73
73
|
## Root ownership
|
|
74
74
|
|
|
@@ -136,3 +136,9 @@ 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.
|
|
141
|
+
|
|
142
|
+
Public reference selection uses the internal `dataset-workflow-reference-input` task operation. It preserves selected source evidence, publishes indexed QA/review snapshots and a derived intent with only file locators changed. Current row and reference-selection digests fence finalization; snapshot files remain selected inputs for authorization, execution and readback. The selected package/CLI/TIDAS trust anchors and account authority are unchanged.
|
|
143
|
+
|
|
144
|
+
The public execution owner verifies current identity separately for initial rehydration and the final complete pre-dispatch admission pass. Local work between them cannot reuse the earlier receipt as fresh authority. Both passes retain current runtime, account, grant, input and CommandSpec verification before the existing attempt-consumption boundary; no replay or additional grant is introduced.
|
|
@@ -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
|
|
32
|
+
lastReviewedAt: 2026-09-11
|
|
33
|
+
lastReviewedCommit: abc7672f3b3a806caa4219ab5b797f1d92421926
|
|
34
|
+
lastReviewedNote: "Reviewed for #122: explicit task reference snapshots, CLI 0.1.14 QA/intent transport, sealed admission/readback evidence and no-replay recovery. Existing profile, permission, environment and historical delivery boundaries remain enforced."
|
|
35
35
|
related:
|
|
36
36
|
- docs/architecture.md
|
|
37
37
|
- docs/safety-policy.md
|
|
@@ -56,7 +56,7 @@ The extended public workflow may authenticate for read-only identity preflight a
|
|
|
56
56
|
|
|
57
57
|
The public facade accepts explicit approval selection through `--authorization-input`, whose descriptor/schema is owned by `public-runtime-contract.md`. Finalization supplies reviewable bindings and current input digests, never an issued grant. Registration uses an internal current-state check under its metadata lock before activation, so an approval for an older finalization cannot replace current state. The existing expected-previous-pointer compare-and-swap remains mandatory.
|
|
58
58
|
|
|
59
|
-
Ready final-row approval rebuilds the existing commit handoff and seals a capsule without dispatching it. Host evidence selections remain independent of grant text, and evidence paths are canonical. Prepared-row approval is continued through current-grant re-finalization and the existing derived-grant helper. Activation uses its returned pointer guard; sealing retains the original approved ancestor. Interrupted post-activation capture verifies the active grant against that original approval before recovering. A registered or sealed report does not relax fresh identity/admission checks or clear consumed attempts.
|
|
59
|
+
Ready final-row approval rebuilds the existing commit handoff and seals a capsule without dispatching it. Host evidence selections remain independent of grant text, and evidence paths are canonical. Prepared-row approval is continued through current-grant re-finalization and the existing derived-grant helper. Activation uses its returned pointer guard; sealing retains the original approved ancestor. Interrupted post-activation capture verifies the active grant against that original approval before recovering. A registered or sealed report does not relax fresh identity/admission checks or clear consumed attempts. An optional native execution contract selected for final Flow, Process or Source rows is an independently hashed control input, not a grant. Handoff and admission bind its immutable task snapshot alongside final rows and recheck insert-only owner/project/state/action intent. The qualified CLI retains native attempt and transaction ownership; completion requires its matching execution receipt plus independent root verification.
|
|
60
60
|
|
|
61
61
|
The exact v1 binding contains `workspace_id`, `task_id`, `actor_id`, `project_ref`, `user_id`, `profile_id`, `profile_sha256`, and `input_scope_sha256`. The profile digest is the stable, key-sorted JSON digest of the selected raw rule profile. Input scope is independently frozen by the task host; it must prove current source bytes and downstream lineage, rather than copying the digest from the grant. At a row-consuming permission boundary it is the SHA-256 of that exact input file; commit handoff checks the final-row artifact bytes again. A transformed row file needs a newly bound grant supported by the retained task approval and verified lineage, never silent reuse of the old digest. A binding mismatch invalidates every exception in that grant.
|
|
62
62
|
|
|
@@ -129,3 +129,7 @@ This contract does not edit old locks, task inputs, checkpoints, sealed attempts
|
|
|
129
129
|
Read-only or pending workspace contexts cannot register/derive authorization or admit a business command. After activation, preserved migration scope is checked at execution-capsule creation and before/after admission revalidation. A fresh grant does not reset retained attempt authority. Original profile/account/approval files remain archived evidence, while new permission still needs the independently selected current identity, exact input lineage and reviewed scope.
|
|
130
130
|
|
|
131
131
|
For public prepared FP/UG input, a captured finalization blocked solely by the support permission gate may derive the existing complete support approval through registered input lineage, then rerun local finalization on those exact approved bytes. Missing write/mint actions and unrelated blockers remain pending. This adds no permission, extends no expiry and cannot replay a consumed scope.
|
|
132
|
+
|
|
133
|
+
Explicit reference inputs and their review files are control evidence, not authorization or QA waivers. A new selection invalidates the finalization projection; prepared/consumed scopes cannot replace it. Admission requires the same independently selected intent, passing precommit report and review-file facts in both CommandSpecs, alongside final rows and any native contract. Readback rechecks this evidence even when the mutation response is unavailable.
|
|
134
|
+
|
|
135
|
+
After local handoff preparation, the public workflow validates the earlier identity context and obtains a fresh identity from the same qualified CLI and explicit authentication context before capsule creation. Age expiry of the earlier receipt is tolerated at this boundary; context or runtime mismatches propagate. An unconsumed execution also obtains a fresh identity after initial rehydration and before its second complete pre-dispatch admission. Both full admission passes remain required, and the attempt is not consumed until they pass. Capsule/admission checks independently revalidate the active grant, task/account binding, lineage and evidence. New identity receipts do not extend grant lifetime or reset attempts; the 60-second freshness bound is unchanged.
|