@tiangong-lca/foundry 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -7
- package/docs/architecture.md +15 -3
- package/docs/foundry-task-contracts.md +27 -3
- package/docs/package-distribution-contract.md +45 -13
- package/docs/public-runtime-contract.md +73 -5
- package/docs/runtime-context-contract.md +20 -4
- package/docs/task-authorization-contract.md +15 -3
- package/docs/workspace-migration-contract.md +5 -3
- package/package-dist/assets/foundry-package-descriptor.json +333 -139
- package/package-dist/scripts/foundry-facade.d.ts +5 -0
- package/package-dist/scripts/foundry-facade.js +258 -16
- package/package-dist/scripts/foundry-runtime.d.ts +1 -1
- package/package-dist/scripts/lib/bundle-sample-utils.d.ts +4 -4
- package/package-dist/scripts/lib/bundle-source-context.d.ts +6 -4
- package/package-dist/scripts/lib/bundle-source-context.js +10 -8
- package/package-dist/scripts/lib/decision-owners/identity-preflight.js +16 -6
- package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +2 -1
- package/package-dist/scripts/lib/finalize-owners/post-authoring.js +28 -1
- package/package-dist/scripts/lib/foundry-assessment-producer.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-assessment-producer.js +167 -0
- package/package-dist/scripts/lib/foundry-command-metadata.js +6 -1
- package/package-dist/scripts/lib/foundry-decision-owners.d.ts +1 -1
- package/package-dist/scripts/lib/foundry-decision-owners.js +15 -7
- package/package-dist/scripts/lib/foundry-execution-admission.js +4 -1
- package/package-dist/scripts/lib/foundry-finalize-owners.js +64 -17
- package/package-dist/scripts/lib/foundry-identity-stage-input.d.ts +24 -0
- package/package-dist/scripts/lib/foundry-identity-stage-input.js +122 -0
- package/package-dist/scripts/lib/foundry-identity-stage-state.d.ts +17 -0
- package/package-dist/scripts/lib/foundry-identity-stage-state.js +48 -0
- package/package-dist/scripts/lib/foundry-installed-entry.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-installed-entry.js +173 -0
- package/package-dist/scripts/lib/foundry-managed-adoption.d.ts +12 -0
- package/package-dist/scripts/lib/foundry-managed-adoption.js +108 -0
- package/package-dist/scripts/lib/foundry-managed-authentication.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-managed-authentication.js +28 -0
- package/package-dist/scripts/lib/foundry-managed-host.js +14 -2
- package/package-dist/scripts/lib/foundry-migration-transfer-io.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-migration-transfer-io.js +27 -3
- package/package-dist/scripts/lib/foundry-operation-result.d.ts +1 -1
- package/package-dist/scripts/lib/foundry-operation-result.js +1 -0
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +4 -4
- package/package-dist/scripts/lib/foundry-package-contract.js +10 -2
- package/package-dist/scripts/lib/foundry-preparation-cli-validation.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-preparation-cli-validation.js +25 -3
- package/package-dist/scripts/lib/foundry-quality-review-context.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-quality-review-context.js +18 -0
- package/package-dist/scripts/lib/foundry-quality-review-input.d.ts +48 -0
- package/package-dist/scripts/lib/foundry-quality-review-input.js +284 -0
- package/package-dist/scripts/lib/foundry-quality-review-lineage.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-quality-review-lineage.js +123 -0
- package/package-dist/scripts/lib/foundry-quality-review.d.ts +112 -0
- package/package-dist/scripts/lib/foundry-quality-review.js +487 -0
- package/package-dist/scripts/lib/foundry-runtime-identity.js +3 -1
- 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-authorization.d.ts +2 -1
- package/package-dist/scripts/lib/foundry-task-authorization.js +32 -11
- package/package-dist/scripts/lib/foundry-task-registration.js +4 -5
- package/package-dist/scripts/lib/foundry-task-runtime-adoption-write.d.ts +28 -0
- package/package-dist/scripts/lib/foundry-task-runtime-adoption-write.js +250 -0
- package/package-dist/scripts/lib/foundry-task-runtime-adoption.d.ts +60 -0
- package/package-dist/scripts/lib/foundry-task-runtime-adoption.js +549 -0
- package/package-dist/scripts/lib/foundry-task-store.d.ts +4 -1
- package/package-dist/scripts/lib/foundry-task-store.js +113 -4
- package/package-dist/scripts/lib/foundry-task-types.d.ts +2 -1
- package/package-dist/scripts/lib/foundry-validation-reference-context.d.ts +8 -0
- package/package-dist/scripts/lib/foundry-validation-reference-context.js +115 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +1 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.js +115 -22
- package/package-dist/scripts/lib/foundry-workflow-authorization.js +17 -4
- package/package-dist/scripts/lib/foundry-workflow-child-failure.d.ts +44 -0
- package/package-dist/scripts/lib/foundry-workflow-child-failure.js +439 -0
- package/package-dist/scripts/lib/foundry-workflow-context.js +37 -8
- package/package-dist/scripts/lib/foundry-workflow-finalize.js +37 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-recovery.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-recovery.js +450 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-stage.d.ts +9 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-stage.js +676 -0
- package/package-dist/scripts/lib/foundry-workflow-identity.js +10 -1
- package/package-dist/scripts/lib/foundry-workflow-io.d.ts +7 -1
- package/package-dist/scripts/lib/foundry-workflow-io.js +76 -11
- package/package-dist/scripts/lib/foundry-workflow-semantic.js +27 -13
- package/package-dist/scripts/lib/foundry-workflow-state.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-workflow-state.js +165 -22
- package/package-dist/scripts/lib/identity-preflight-artifacts.d.ts +4 -7
- package/package-dist/scripts/lib/identity-preflight-artifacts.js +18 -5
- package/package-dist/scripts/lib/identity-preflight-proof.d.ts +5 -0
- package/package-dist/scripts/lib/identity-preflight-proof.js +73 -1
- package/package-dist/scripts/lib/identity-preflight-recovery-proof.d.ts +78 -0
- package/package-dist/scripts/lib/identity-preflight-recovery-proof.js +415 -0
- package/package-dist/scripts/lib/import-curation/curation-cleanup.d.ts +9 -1
- package/package-dist/scripts/lib/import-curation/curation-cleanup.js +39 -2
- package/package-dist/scripts/lib/import-curation/curation-gate.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/curation-gate.js +19 -1
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +1 -1
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.js +11 -2
- package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.js +4 -1
- package/package-dist/scripts/package-entry.js +2 -3
- package/package-dist/scripts/public-api.d.ts +5 -0
- package/package-dist/scripts/public-api.js +2 -0
- package/package-dist/scripts/runtime-entry.d.ts +2 -0
- package/package-dist/scripts/runtime-entry.js +42 -15
- package/package.json +6 -2
- package/specs/schemas/foundry-identity-stage-input.schema.json +47 -0
- package/specs/schemas/foundry-managed-adoption.schema.json +40 -0
- package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
- package/specs/schemas/foundry-operation-result.schema.json +1 -0
- package/specs/schemas/foundry-package-descriptor.schema.json +6 -2
- package/specs/schemas/foundry-quality-review-draft.schema.json +271 -0
- package/specs/schemas/foundry-quality-review-input.schema.json +271 -0
- package/specs/schemas/runtime-qualification.schema.json +1 -1
package/README.md
CHANGED
|
@@ -158,16 +158,16 @@ checkPaths:
|
|
|
158
158
|
- test/unit/lint-suppression-audit.test.mts
|
|
159
159
|
- test/unit/zero-javascript-ratchet.test.mts
|
|
160
160
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
161
|
-
lastReviewedAt: 2026-
|
|
162
|
-
lastReviewedCommit:
|
|
163
|
-
lastReviewedNote: "
|
|
161
|
+
lastReviewedAt: 2026-11-15
|
|
162
|
+
lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
|
|
163
|
+
lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
|
|
164
164
|
---
|
|
165
165
|
|
|
166
166
|
# TianGong LCA Data Foundry
|
|
167
167
|
|
|
168
|
-
The ordinary user entry is the independently installed [TianGong Foundry skill](https://github.com/tiangong-lca/agent-skills/tree/main/foundry-tidas-import).
|
|
168
|
+
The ordinary user entry is the independently installed [TianGong Foundry skill](https://github.com/tiangong-lca/agent-skills/tree/main/foundry-tidas-import). It uses the environment-selected managed runtime for a separate user workspace; deployment owns the verified release selection. 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.
|
|
169
169
|
|
|
170
|
-
The public task protocol can retain a short goal and scope, register evidence-bound questions and raw answers, and distinguish task-wide, dataset-type-wide and exact registered-object choices. An object choice carries a versioned identity and current row hash; independent Process work can continue while another Process awaits an answer. Semantic results record only applicable decision IDs and their indexed before/after row hashes, while a concise recap points back to full evidence. The entry skill explains human decisions in plain language and accepts natural answers; Foundry presents the question, impact and next step before the exact record locator while preserving full evidence in indexed artifacts. The CLI keeps scientific validation and write permission separate. A source checkout implementing this protocol does not itself update the independently qualified installed
|
|
170
|
+
The public task protocol can retain a short goal and scope, register evidence-bound questions and raw answers, and distinguish task-wide, dataset-type-wide and exact registered-object choices. An object choice carries a versioned identity and current row hash; independent Process work can continue while another Process awaits an answer. Semantic results record only applicable decision IDs and their indexed before/after row hashes, while a concise recap points back to full evidence. The entry skill explains human decisions in plain language and accepts natural answers; Foundry presents the question, impact and next step before the exact record locator while preserving full evidence in indexed artifacts. The CLI keeps scientific validation and write permission separate. A source checkout implementing this protocol does not itself update the independently qualified installed runtime selection.
|
|
171
171
|
|
|
172
172
|
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.
|
|
173
173
|
|
|
@@ -342,9 +342,9 @@ pnpm case:production:contact-draft -- \
|
|
|
342
342
|
|
|
343
343
|
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.
|
|
344
344
|
|
|
345
|
-
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.
|
|
345
|
+
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.28 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.
|
|
346
346
|
|
|
347
|
-
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.
|
|
347
|
+
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.28, 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.
|
|
348
348
|
|
|
349
349
|
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.
|
|
350
350
|
|
|
@@ -534,3 +534,19 @@ Installed shared runtime skills such as `.agents/skills/tiangong-kb-sci-search/`
|
|
|
534
534
|
Remote writes are never ungated. A task must pass schema, QA, curation, cleanup, dry-run, mutation-manifest/reference-closure, commit handoff, and post-write verification gates before any database mutation. When deterministic source/contact rewrites create a writable shared contact or source dependency, Foundry may prepare a separate support finalize/handoff artifact, but dependent process/flow/lifecyclemodel scopes remain blocked until that support row is committed through the published CLI and verified. When the task write policy permits automated batch commit, ready scopes may commit without per-row human approval; human input is reserved for policy changes, exceptional waivers, and support gaps not already covered by a frozen profile's explicit account-local policy.
|
|
535
535
|
|
|
536
536
|
Tasks may set `account_intent.account_mode` to `production-test` for strict payload verification. Ordinary tasks retain the narrowly proven import-trace `traceHash` normalization path. See [public verification policy](docs/public-runtime-contract.md#account-verification-mode).
|
|
537
|
+
|
|
538
|
+
Same-task compatibility and retained identity diagnostics now have an explicit [public runtime contract](docs/public-runtime-contract.md#same-task-compatibility-and-retained-identity-diagnostics). Multilingual names preserve their valid language nodes; Process-only read-only dependencies reach initial queue/QA/CLI validation without changing scientific payloads or mutation targets. Supported manual-review diagnostics become semantic work, while incomplete historical provenance remains UNKNOWN. Local candidate qualification, original-consumer validation and release adoption are distinct facts.
|
|
539
|
+
|
|
540
|
+
A reviewed Process mass-screening observation can be handled before finalization through the [preparation quality-review contract](docs/public-runtime-contract.md#preparation-quality-review). The explicit input preserves the raw observation and exact inventory while ordinary write authorization remains separate.
|
|
541
|
+
|
|
542
|
+
## Use an installed managed runtime
|
|
543
|
+
|
|
544
|
+
Install the public Foundry package and retain a verified Foundry release manifest and its independently verified digest. Configure `TIANGONG_FOUNDRY_MANIFEST` and `TIANGONG_FOUNDRY_MANIFEST_SHA256` in the deployment environment. Optional `TIANGONG_FOUNDRY_CACHE_DIR` selects the absolute component cache. Install the release's components through the existing CLI `runtime ensure` command.
|
|
545
|
+
|
|
546
|
+
```bash
|
|
547
|
+
tiangong-foundry --help
|
|
548
|
+
tiangong-foundry runtime describe --json \
|
|
549
|
+
--require-protocol tiangong-foundry.task-start.v1
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
Use normal public workspace/task arguments after configuration. For an upgrade, install and inspect the successor, then change the environment's manifest/digest pair together. Keep the preceding pair and components for rollback and task recovery. Existing tasks continue their exact returned commands. The same Skill can use compatible successor releases without editing its own release lock. See [the public runtime contract](docs/public-runtime-contract.md#environment-selected-installed-entry) for status and error behavior.
|
package/docs/architecture.md
CHANGED
|
@@ -152,9 +152,9 @@ checkPaths:
|
|
|
152
152
|
- test/unit/foundry-runtime-environment.test.mts
|
|
153
153
|
- test/unit/lint-suppression-audit.test.mts
|
|
154
154
|
- docs/incremental-change-set-contract.md
|
|
155
|
-
lastReviewedAt: 2026-
|
|
156
|
-
lastReviewedCommit:
|
|
157
|
-
lastReviewedNote: "
|
|
155
|
+
lastReviewedAt: 2026-11-15
|
|
156
|
+
lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
|
|
157
|
+
lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
|
|
158
158
|
---
|
|
159
159
|
|
|
160
160
|
# Architecture
|
|
@@ -191,6 +191,8 @@ Foundry selects a private session reference and exact project/user intent, then
|
|
|
191
191
|
|
|
192
192
|
## Public facade composition
|
|
193
193
|
|
|
194
|
+
Preparation quality review is a Foundry-owned local policy decision over retained CLI QA evidence. `foundry-quality-review-input.ts` selects strict descriptors; `foundry-quality-review.ts` registers and rehydrates task-indexed evidence; `foundry-quality-review-lineage.ts` verifies the existing cleanup producer's exact validation-context derivation. Assessment, curation, finalization and execution admission consume the same narrow receipt. The CLI continues to own numerical QA, existing reference owners continue to own closure, and ordinary task authorization continues to own write permission. No separate task/state store or dataset writer is introduced.
|
|
195
|
+
|
|
194
196
|
`foundry-facade.ts` is the public orchestration boundary. `foundry-operation-result.ts` owns the strict single-result envelope and exits; `foundry-task-start-spec.ts` owns bounded user intent; `foundry-facade-store.ts` owns deterministic request/revision indexes and task pointers; `foundry-migration-inventory.ts` owns the read-only W10 input plan. The facade calls `createFoundryRuntime` for task creation, inspection, deterministic cleanup, qualified native conversion and CLI contract-context preparation. Each local stage uses the existing task transaction. It does not instantiate the legacy command graph for public requests.
|
|
195
197
|
|
|
196
198
|
`foundry-workflow-decisions.ts` prepares classification/location work through the reusable factories in `lib/decision-owners/`; the original flat command modules remain thin adapters. `foundry-decision-owners.ts` composes these factories with installed CLI schemas, canonical row helpers and isolated local CLI execution. Semantic submission dispatches the selected owner against its exact current task context, publishes successful rows and requires reassessment before another owner consumes them.
|
|
@@ -456,3 +458,13 @@ The public traceHash adapter delegates normalization to `remote-verification-acc
|
|
|
456
458
|
The prepared-approval adapter can bridge cleanup byte changes for an otherwise valid support scope by using the existing registered grant derivation, then re-running the finalize owner on the bound descendant. Eligibility is limited to the support-permission blocker with complete scoped write/mint actions. It preserves completed dependency generations and stops on unchanged blocked authorization state. No profile hash check or write admission guard is relaxed.
|
|
457
459
|
|
|
458
460
|
Source CI execution is separate from the consumer runtime: complete isolated test partitions and exact version-only PR classification are owned by CI tooling. One verified package snapshot may be reused across native qualification and signing through independently supplied artifact digests and exact source/toolchain/run binding. Downloaded manifests and serialized receipts cannot issue snapshot authority. The final release always performs full four-platform qualification; consumer credentials, task state, authorization and no-replay behavior are unchanged.
|
|
461
|
+
|
|
462
|
+
## Qualified original-task continuation
|
|
463
|
+
|
|
464
|
+
Foundry owns the same-task compatibility receipt chain and retained report interpretation described in [the public runtime contract](public-runtime-contract.md#same-task-compatibility-and-retained-identity-diagnostics). It keeps historical producer locators separate from current context/assessment coverage. The narrow identity diagnostic validator admits supported manual review without making a semantic decision; CLI continues to own authentication and identity search.
|
|
465
|
+
|
|
466
|
+
Read-only reference transport supplies the existing queue/QA/CLI-validation owners, using an unchanged-payload validation wrapper. Authorization freshness is refreshed only through the explicit same-CLI host callback after locked metadata validation. These changes do not create another data writer, task ledger or scientific validator.
|
|
467
|
+
|
|
468
|
+
Managed qualification remains Foundry-owned: the existing generic CLI v1 IPC transports the independently reviewed carrier L. Foundry admits only L=S+K with identical complete executing runtime records and no executable control files; Q binds sealed complete S. Workspace/runtime identity S and launch carrier L are explicit verified roles, not interchangeable targets. No CLI protocol fork, alternate business caller or scientific writer is added.
|
|
469
|
+
|
|
470
|
+
The installed package entry selects a deployment-owned verified manifest before delegating to the public CLI runtime manager. Its read-only `runtime describe` reports selected identity, declared protocols and cache readiness. Once IPC admission begins, the managed host and exact task binding retain authority. Skills depend on the public interface rather than a release-specific bootstrap lock.
|
|
@@ -28,14 +28,14 @@ checkPaths:
|
|
|
28
28
|
- specs/schemas/execution-context.schema.json
|
|
29
29
|
- specs/import-profiles.json
|
|
30
30
|
- tasks/**
|
|
31
|
-
lastReviewedAt: 2026-10-
|
|
32
|
-
lastReviewedCommit:
|
|
33
|
-
lastReviewedNote: "Reviewed Foundry #223 preparation consuming complete owning CLI 0.1.27 validation, exact candidate/Flow bindings and published Toolkit 0.3.4 applicable coverage; authorization and no-replay boundaries remain unchanged. Foundry source version stays 0.1.16 pending a separate release."
|
|
31
|
+
lastReviewedAt: 2026-10-11
|
|
32
|
+
lastReviewedCommit: 2d5cbf38f4e44b4b4d30bba52abd38ef8947bed3
|
|
34
33
|
related:
|
|
35
34
|
- AGENTS.md
|
|
36
35
|
- WORKFLOW.md
|
|
37
36
|
- docs/runtime-skill-management.md
|
|
38
37
|
- specs/import-profiles.json
|
|
38
|
+
lastReviewedNote: "Reviewed current-main integration of explicit preparation review, payload-bound context and diagnostic-only failures, plus native candidate generation and independently reviewed managed adoption; original Task eligibility and data acceptance remain separate."
|
|
39
39
|
---
|
|
40
40
|
|
|
41
41
|
# Foundry Task Contracts
|
|
@@ -126,6 +126,10 @@ The first admitted transaction is deterministic local `dataset-curation-cleanup`
|
|
|
126
126
|
|
|
127
127
|
An operation id binds job bytes, command, exact selected input facts and normalized options. Its immutable plan retains a fixed operation time, so interrupted deterministic preparation can reproduce its artifacts without overwriting prior bytes. A successful operation records all output facts and the exact returned report, then atomically updates `artifact-index.jsonl`. Repeating the same request reads only the matching completed local receipt and revalidates outputs; it does not rerun the command or append duplicate records.
|
|
128
128
|
|
|
129
|
+
Existing CLI-generated stage files use an internal transaction capability that records their facts without creating or replacing file bytes. One returned identity-stage report collects only each accepted target's original run directory and exact registered output directory, in target/root order, and captures that complete roster once. The retained owner report's self-path must resolve to its fixed original run report; a substituted locator remains UNKNOWN without requery and cannot select another directory. UNKNOWN, orphan and unrelated parent-tree outputs remain unselected. The existing sorted-child, depth-first walk retains containment, regular-file/link checks and the 9,998-file limit across the selected roster. Capture requires an active transaction, current workspace writer selection, matching Task/job/runtime/profile and current source/input lineage at its verification boundaries. Every selected output is resolved and freshly read twice; only a complete matching batch updates the operation's output map, in the original roster order. Task control and consumed-marker paths are excluded. Ordinary `writeText`/`writeJson` retain their per-write admission and immutable-byte behavior, and only `writeJson` can register the exact returned JSON report. Final input verification, receipt replay and index-prefix/CAS publication are unchanged.
|
|
130
|
+
|
|
131
|
+
This capture phase executes no business command. Runtime inventories are checked before, between and after the fresh file passes, rather than before each existing file; no facts or hashes are reused across operations. Task/job/runtime/writer bindings and current inputs are checked again before publishing a new completed receipt, including when a callback wrote its JSON report before capture or caught a capture failure. Those samples do not guarantee observation of a transient change restored between them or an atomic snapshot against arbitrary same-user filesystem mutation. Persistent writer/runtime/input drift and differences between the fresh output captures refuse completion and retain unindexed stage files.
|
|
132
|
+
|
|
129
133
|
A completed _operation receipt_ means its local invocation produced recorded output. It does not mean the business task is completed or that a blocked cleanup report passed its gates. The facade must interpret the actual result and required completion/readback evidence.
|
|
130
134
|
|
|
131
135
|
## Artifact lineage
|
|
@@ -159,3 +163,23 @@ The public facade projects preparation, sealed approval, owner execution and ind
|
|
|
159
163
|
The request store revalidates every predecessor's retained job against its publication and indexed identity before admitting a new revision or returning a descendant for status/resume. A nonempty predecessor attempt directory blocks the descendant and directs recovery to the original owner; its declared success/unknown state never clears the guard. Missing or altered predecessor state is an audit condition, not permission to reconstruct an empty history. This facade guard does not by itself establish complete migration history, cross-request inheritance or restricted execution admission.
|
|
160
164
|
|
|
161
165
|
Explicit migration preserves original records and creates current registrations only for independently admitted local preparation. The adoption callback remains pending and expires after preparation; activation anchors the archive and immutable current registrations. Read-only inspection can validate retained runtime/profile bytes without matching current write rules and without taking a write lock. Mutation admission rechecks retained dataset scope independently of new request/path/runtime labels; terminal or unresolved work is not a new executable task. Subsequent migration retains origin ids and rechecks later attempts. See the workspace migration contract for scope limitations and original-owner recovery.
|
|
166
|
+
|
|
167
|
+
## Compatibility history and initial reference evidence
|
|
168
|
+
|
|
169
|
+
Same-task adoption uses `state/task-runtime-adoptions/<task>.json` as its immutable first anchor and `workspaces/<task>/runtime-adoptions/<plan-sha>.json` as receipt storage. v2 successor links are created once under `state/task-runtime-adoptions/<task>/successors/<preceding-plan-sha>.json`. Plans bind the preceding digest, original registration/job, current witness, writer stop and independent compatibility evidence. They append to the existing Task protocol, not another task ledger. Complete descriptor/CLI inventories distinguish changed code whose legacy summary fields are identical. Original finalization/authorization/attempt history cannot be cleared by a transition.
|
|
170
|
+
|
|
171
|
+
Verified retained assessment views preserve old relative-locator meaning. They are distinct from current machine-gate coverage after adoption. Per-set authoring locators follow their registered assessment producer, while current contract/row/reference/interaction facts determine reusable current gates.
|
|
172
|
+
|
|
173
|
+
A Process-only `reference-input` selection reaches the initial queue and QA. Queue interfaces require every referenced version's complete Flow body UUID/version; wrapper metadata cannot invent one. Existing Flow/property/unit documents remain read-only. Current CLI validation receives a deterministic wrapper with selected semantic-context references, while native validation and authored rows retain the original Process payload. The receipt and status reader bind original rows, derived wrapper, selection and reference facts; byte drift or a changed selection invalidates affected coverage.
|
|
174
|
+
|
|
175
|
+
The retained identity recovery contract is in [the public runtime contract](public-runtime-contract.md#same-task-compatibility-and-retained-identity-diagnostics). Its original raw receipt, producer and independent CLI-inventory facts are mandatory; missing proof remains read-only UNKNOWN without a new query or original-record rewrite.
|
|
176
|
+
|
|
177
|
+
Explicit new read-only identity preparation and claims use `dataset-workflow-identity-stage-prepare` and `dataset-workflow-identity-stage-dispatch` through the existing native Task plan/receipt/index. Each target retains a version-bound directory and exact single-envelope owner snapshot while binding its original registered row group. Partial unindexed admission is retained as an orphan observation and never promoted into authenticated proof. The selected identity result remains `dataset-workflow-identity`; later ordinary assessment consumes its new index, while a blocked explicit stage cannot fall through into an ordinary random-nonce query. See the public explicit-stage contract.
|
|
178
|
+
|
|
179
|
+
The original CLI-managed package entry admits runtime adoption through an independently reviewed L=S+K carrier. Full executing component/launch/workspace equality establishes S ownership before unchanged native manifest and Task admission checks. Q references remain inventory-bound and branded in the executing package. Original job, registration, source/profile/seed/science, stopped-writer witness and consumed/UNKNOWN state are unchanged; no alternate business caller can substitute for original managed-entry acceptance.
|
|
180
|
+
|
|
181
|
+
The deterministic local `dataset-workflow-quality-review` stage uses the existing metadata lock, operation receipt and artifact index. It appends the selected descriptor/evidence, `foundry-quality-review.json`, a reviewed-finding ledger and reader report without changing row bytes or write policy. Assessment/finalization reuse binds the latest applicable review digest. Expiry or scope drift invalidates acceptance; authorization/attempt history freezes replacement. See [preparation quality review](public-runtime-contract.md#preparation-quality-review).
|
|
182
|
+
|
|
183
|
+
The local CLI failure path appends a failed operation receipt and a single `dataset-workflow-failure` artifact to the same hash-chained index. Its plan retains the original command, job and input scope. Failed receipts are never valid completed producers or successful cache entries. Task status verifies the original plan/receipt/artifact bytes without rerunning the child; partial stage output is not indexed as success. This forward diagnostic path neither reconstructs historical missing producers nor permits a mutation or UNKNOWN replay.
|
|
184
|
+
|
|
185
|
+
A retained failed diagnostic is not a complete original producer for runtime adoption. The current strict adoption lineage reader rejects that history; status/readback support does not clear it or infer a recovery capability.
|
|
@@ -34,38 +34,42 @@ 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-10-08
|
|
38
|
-
lastReviewedCommit: d07ac492a3a5891502039a6cc83ef30b9fbba50b
|
|
39
|
-
lastReviewedNote: "Reviewed Foundry #237 exact three-field 0.1.16 to 0.1.17 release projection from eligible PR236 Main d07ac492; CLI/native pins, lock closure, authorization and all business source remain unchanged. Official publication and final managed qualification remain pending."
|
|
40
37
|
related:
|
|
41
38
|
- docs/public-runtime-contract.md
|
|
42
39
|
- docs/runtime-context-contract.md
|
|
43
40
|
- docs/task-authorization-contract.md
|
|
44
41
|
- docs/safety-policy.md
|
|
42
|
+
lastReviewedAt: 2026-11-15
|
|
43
|
+
lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
|
|
44
|
+
lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
|
|
45
45
|
---
|
|
46
46
|
|
|
47
47
|
# Foundry package distribution
|
|
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
|
+
`specs/release/runtime-inputs.json` selects the exact public CLI source and version used by default preparation; the current source pins CLI 0.1.28 at `49c4ac555d35666e4a6ab8ad701338a45c345147`. The public production path verifies registry integrity and cryptographic provenance against that selection. An explicitly selected local CLI source candidate retains its own complete source, lock, archive and runtime facts and must match the fixed dependency version. Equal version strings do not identify equal programs. Package-specific minimum-release-age exceptions remain scoped; the default policy is unchanged.
|
|
52
52
|
|
|
53
53
|
Historically, Foundry #215 adopted CLI 0.1.23 in source while retaining package version 0.1.13; the then-published Foundry 0.1.13 bundled CLI 0.1.22. That adoption required a separate version-only release and qualified final runtime manifest/lock. The already merged #210 terminal decision-recap characterization changed only two test files and added no runtime behavior.
|
|
54
54
|
|
|
55
|
-
The package depends exactly on public `@tiangong-lca/cli@0.1.
|
|
55
|
+
The package depends exactly on public `@tiangong-lca/cli@0.1.28`. Ajv remains a development dependency for internal commands and release-side SPDX validation; Saxes 6.0.0 is a development dependency used only by the offline final-delivery workbook reader for namespace-aware OOXML parsing. Sigstore 5.0.0, YAML 2.9.1, 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.
|
|
56
56
|
|
|
57
57
|
The development verification chain from Sigstore through minimatch 10.2.6 now locks brace-expansion 5.0.12, a compatible patch within its existing range. Bounded isolated regressions cover both stack-exhaustion advisories while retaining ordinary expansion behavior. The sixteen-package production closure is unchanged. The high-severity audit threshold, default 1,440-minute release age and all package/native input versions remain unchanged; no advisory ignore or new dependency override is added.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Historically, the source adoption of CLI 0.1.27 kept Foundry's package version at 0.1.15. The existing public Foundry 0.1.15 and its final runtime manifest still contain CLI 0.1.24. A separately qualified version-only Foundry release and final four-platform publication must precede deployment adoption; this source change does not replace any immutable published package or runtime component.
|
|
60
60
|
|
|
61
61
|
## Public surface
|
|
62
62
|
|
|
63
|
+
The descriptor inventory includes `foundry-quality-review-input.schema.json`, `foundry-quality-review-draft.schema.json` and their `tiangong-foundry.quality-review-input.v1` / `tiangong-foundry.quality-review-draft.v1` protocols. Its sole consumer entry is the existing `task.resume` operation's `--quality-review-input` selector. The source/compiler graph includes the review admission and lineage verifier; task stores and curation owner factories remain internal. A new local candidate must be rebuilt and independently qualified; adding the schema never changes an installed package or grants data authority.
|
|
64
|
+
|
|
63
65
|
`scripts/package-entry.ts` is the only bin source. It calls `runFoundryPublicCommand`, which routes the six operations in `public-runtime-contract.md` and converts every other name into the stable unknown-operation envelope. It never falls back to `scripts/foundry.ts`, the repository doctor, 63-command dispatcher, production case runner or maintenance owners.
|
|
64
66
|
|
|
65
67
|
`scripts/public-api.ts` binds the facade's module identity internally. A consumer supplies workspace, optional runtime selection/account intent and host controls; it cannot redirect package discovery through its own `moduleUrl`. The root and `./runtime` exports expose only the facade, public command host, result/task/migration protocol types and validators, next-action binding verifier, and package descriptor verifier. Internal command factories, mutation dispatch and raw runtime/task stores are not package exports.
|
|
66
68
|
|
|
67
69
|
The public package includes `foundry-interaction-input.schema.json` and advertises `tiangong-foundry.interaction-input.v1` beside the existing task-start and semantic protocols. Its source graph exposes only the strict interaction input/state types through `scripts/public-api.ts`; the task-local store and assessment implementation remain internal. Package validation checks the schema, descriptor protocol list and sanitized file inventory together.
|
|
68
70
|
|
|
71
|
+
The explicit new read-only identity stage ships `foundry-identity-stage-input.schema.json` and the matching `tiangong-foundry.identity-stage-input.v1` descriptor protocol. It uses the existing public resume option; its strict input selection, native admission/claim projection and published identity-owner adapter remain internal to the emitted graph. Source, packed and installed qualification must preserve original evidence and validate duplicate/interrupted intents without retrying queries. Exact candidate CLI bytes and dependency closure require separate evidence from equal version labels; local candidate tests do not establish managed publication or original-consumer acceptance.
|
|
72
|
+
|
|
69
73
|
The installed `runtimeUse` facade can retain a CLI-managed cache containing its own package after the package descriptor and independently trusted current component set both verify that ownership. The source-free consumer test exercises that behavior from real installed application bytes, including rollback, restoration, retained leases and rejected cache drift. Its surrounding component metadata is explicitly a fixture; it does not establish F1 provenance, native launch qualification or publication.
|
|
70
74
|
|
|
71
75
|
## Managed process admission
|
|
@@ -84,7 +88,11 @@ Installed-process tests use real Node, the packed Foundry candidate, public CLI
|
|
|
84
88
|
|
|
85
89
|
## Complete runtime component preparation
|
|
86
90
|
|
|
87
|
-
`pnpm release:prepare-runtime --output <new-absolute-directory>` builds a source candidate from its own clean physical checkout. `--published` selects the independently verified public Foundry package at that same version/source and compares its exact tarball bytes with the source package. It is a read-only publication-input selection, not an upload command.
|
|
91
|
+
`pnpm release:prepare-runtime --output <new-absolute-directory>` builds a source candidate from its own clean physical checkout. `--published` selects the independently verified public Foundry package at that same version/source and compares its exact tarball bytes with the source package. It is a read-only publication-input selection, not an upload command. The Foundry source remains its own clean checkout; neither mode accepts alternate Foundry roots, versions, platforms, URLs or serialized preparation receipts.
|
|
92
|
+
|
|
93
|
+
Source-candidate mode additionally accepts `--cli-source <absolute-clean-cli-checkout> --cli-commit <exact-commit>`. Both arguments are required together and are rejected with `--published`. The selected canonical CLI checkout must have that exact HEAD and the same CLI version as the owning Foundry dependency. Preparation checks its complete tracked Git blob bytes and modes, copies regular files into an owned isolated build, installs the frozen source lock without dependency lifecycle scripts, invokes the CLI owner build, and packs without lifecycle scripts. The original checkout and installed runtime are preserved. Its own source lock supplies the production dependency closure; Foundry retains its original lock evidence separately. No candidate version or dependency range is resolved from a floating lookup.
|
|
94
|
+
|
|
95
|
+
Local CLI candidate metadata retains the source commit/tree/date, complete source inventory, source-lock hash, exact packed archive hashes and the publicly inspected runtime content hash. The application and Node bootstrap components consume those same package bytes and licenses. Source-candidate provenance and SPDX use `NOASSERTION` for its unavailable package download; no registry attestation is invented or reused for changed bytes. The local combination retains `local_cli_candidate_not_registry_verified` as a release blocker while remaining eligible for isolated native qualification; it cannot pass four-platform publication aggregation. The public-package mode keeps its independent registry and attestation verification. CLI source authority is checked again before assembly and native qualification; neither serialized metadata nor a modified source tree can restore the process-local qualification authority.
|
|
88
96
|
|
|
89
97
|
Production and native preparation now expose frozen process-local inputs for the assembler. Their existing standalone commands retain their output and source boundaries. Production payloads also retain the original verified CLI registry metadata and attestation bytes. Component copying checks the complete declared source inventory before copying, rejects changed/unlisted/linked files, rechecks copied bytes and modes, and never replaces an existing destination. Native subsets are selected only after their complete preparation input has been checked.
|
|
90
98
|
|
|
@@ -94,10 +102,22 @@ Native component identities and metadata use the selected upstream versions, sou
|
|
|
94
102
|
|
|
95
103
|
Minimum-host data is frozen in `specs/release/runtime-inputs.json`. [The pinned Node source platform table](https://github.com/nodejs/node/blob/cdc1b38d40cb567b7ad0b39c86addf830a0af0ae/BUILDING.md) supplies Linux kernel4.18, macOS13.5 and Windows10/Server2016 ABI floors. The manifest represents those as Linux4.18.0, Darwin22.6.0 and Windows10.0.0; the independently observed TIDAS GNU requirement raises the combined GLIBC floor to2.38. Only the four approved platform tuples are included.
|
|
96
104
|
|
|
97
|
-
The source-side qualifier receives the in-process prepared authority. It executes the actual packaged Node/Foundry/TIDAS combination with an empty tool PATH, no supplied credentials, an empty component cache seeded from the verified local archives, and then a warm cache with no manager downloads. It checks public init/doctor/task lifecycle, read selection/restoration and rejection of developer commands. Diagnostic timings and results live outside hashed component payloads. This proves native execution from the prepared archives; published URL download/copy-bootstrap and final four-platform publication remain distinct gates.
|
|
105
|
+
The source-side qualifier receives the in-process prepared authority. It executes the actual packaged Node/Foundry/TIDAS combination with an empty tool PATH, no supplied credentials, an empty component cache seeded from the verified local archives, and then a warm cache with no manager downloads. It checks public init/doctor/task lifecycle, read selection/restoration and rejection of developer commands. Diagnostic timings and results live outside hashed component payloads. When the public `release:prepare-runtime` command explicitly selects a local CLI source, it retains the actually qualified cold-to-warm cache in its new output's exclusive `consumer-cache/` and emits `candidate-entry.json`. Ordinary source-candidate and published-release commands retain their original temporary-cache output layout, including the existing CI capsule inventory contract, and emit no consumer cache or candidate entry. That entry binds exact local manifest/archive paths and hashes, complete component inventories, the actual qualification report path/hash, and a shell-free command prefix using the verified base Node and public CLI. Callers append only `--cwd <consumer-cwd> -- <public-operation-argv>`; no archive seed map, manifest rewriting or qualification substitution is needed. Before generating the entry, preparation rechecks the cache's original physical path/inode and complete public-manager inventory. A moved, replaced, linked or stale cache is rejected. The entry is selection material: its serialized report conveys no authority, and the existing public CLI independently revalidates the selected manifest digest and cache on every launch. Library qualification keeps its temporary-cache default unless retention is explicitly requested; CI source and published release command paths use that default. This proves native execution from the prepared archives; published URL download/copy-bootstrap and final four-platform publication remain distinct gates.
|
|
98
106
|
|
|
99
107
|
The qualified TIDAS0.3.3 archive includes distribution manifest v2 and a complete executable/source-bound native notice inventory. Preparation verifies the nested manifest digest, every retained file and Cargo/native/Rust evidence before reporting `owner-inventory-verified`. The assembler still refuses published mode when this verified coverage is absent. All original notice texts and source evidence remain in the TIDAS component, and its SPDX license references include every retained notice text. The component manifest points to the existing project LICENSE, upstream notice README and notice-manifest.json. These three entrypoints stay within the published CLI limit of64, while the nested inventory identifies every original text and its package/source role. No additional concatenated copy is generated. The four Toolkit 0.3.3 component URLs are published release locations verified by archive digest and source-bound attestation. The source CI performs candidate assembly/qualification but does not publish its binaries.
|
|
100
108
|
|
|
109
|
+
## Native preparation for managed task adoption
|
|
110
|
+
|
|
111
|
+
Use the existing `release:prepare-runtime` source-candidate path when a retained Task needs a reviewed successor. Add `--adoption-original <absolute-selection-file> --adoption-original-sha256 <digest>` to select the original complete runtime manifest by absolute path, byte count and SHA-256, plus its retained cache directory. That small input uses `{ "manifest": { "path": "...", "bytes": 123, "sha256": "..." }, "cache_dir": "..." }`; it selects evidence and creates no host authority. Published-release mode rejects adoption inputs. The owning Foundry source and fixed CLI version remain unchanged by the selector.
|
|
112
|
+
|
|
113
|
+
Preparation seals successor S and the qualified retained consumer cache, then writes `adoption-review-request.json`. It reopens the selected original and successor manifests, complete component records, current-platform physical inventories, Foundry descriptors and package files, public CLI observations, Node and Toolkit bytes, and managed launch access policies. Other platforms retained in a complete manifest are declared facts, not claims of installation or qualification on this host. Node/Toolkit bytes and launch access ceilings must match. Only this explicitly selected adoption path uses the existing `cli-auth` launch channel; ordinary source/published preparation remains isolated. Credential files and original Task state are not preparation inputs.
|
|
114
|
+
|
|
115
|
+
An independent technical reviewer assesses those exact complete programs and records an explicit `tiangong-foundry.runtime-adoption-compatibility-review.v1` input. It binds the review-request file fact, both complete runtime-facts digests, reviewer, compatible conclusion, `allowed_changes: ["foundry", "cli"]` and nonempty retained review evidence. The producer never fills a compatible conclusion or treats its component qualification as adoption qualification. A changed program, input, review request, evidence file or access policy invalidates this selection.
|
|
116
|
+
|
|
117
|
+
Complete through the same native entry: `pnpm release:prepare-runtime --complete-adoption <prepared-output> --adoption-review <absolute-review-file> --adoption-review-sha256 <digest>`. It freshly verifies the reviewed programs, derives the existing owner qualification Q, seals a non-executable inventory-bound control K and writes carrier L as the exact S plus K. Q keeps stable external manifest/review/evidence locators. Every ordinary S field, launch and component remains identical in L; there is no manifest digest cycle. An explicit public-manager carrier lease and retained local archives preserve K availability without claiming publication.
|
|
118
|
+
|
|
119
|
+
Before exposing `adoption-entry.json`, completion runs the actual public CLI managed launch and installed owner in a fresh credential-free workspace. The resulting `adoption-carrier-qualification.json` records the checked entry and exact runtime; an ordinary constructed context object cannot replace the CLI's branded host. This checks package admission, S/Q/K/L binding and local startup. The original writer still supplies its exact Task registration, stopped-writer handoff and existing authorization evidence through native plan/apply/audit. This technical review grants no scientific acceptance, account access, data write permission, Task eligibility, consumer adoption or release approval.
|
|
120
|
+
|
|
101
121
|
## Build and staging roots
|
|
102
122
|
|
|
103
123
|
Three roots have distinct ownership:
|
|
@@ -154,7 +174,7 @@ The released C1 bootstrap installs one complete base component containing both N
|
|
|
154
174
|
|
|
155
175
|
`metadata/bootstrap-sha256.txt` lists every other base file in stable path order with its actual SHA256. The checksum file is itself included in the component inventory and independently bound by the adjacent lock. Missing, extra, aliased, unsafe or changed files fail. Bootstrap file_count excludes the checksum file, so archive entries equal file_count+1.
|
|
156
176
|
|
|
157
|
-
Four-platform aggregation generates bootstrap-lock.json using the public manager's component keys, the exact complete manifest, reviewed C1 script digests and existing Node/CLI entry paths. The lock has the flat field layout expected by C1 and accepts only the source-bound candidate or final Foundry manifest URL. It adds no source-version, task, credential or arbitrary trust-anchor override. Component publication retains the candidate lock separately;
|
|
177
|
+
Four-platform aggregation generates bootstrap-lock.json using the public manager's component keys, the exact complete manifest, reviewed C1 script digests and existing Node/CLI entry paths. The lock has the flat field layout expected by C1 and accepts only the source-bound candidate or final Foundry manifest URL. It adds no source-version, task, credential or arbitrary trust-anchor override. Component publication retains the candidate lock separately; any distributed standalone bootstrap data must select the qualified final manifest.
|
|
158
178
|
|
|
159
179
|
The source script pins refer to C1's immutable Git source at the same verified public release commit. They are copied unchanged for bootstrap qualification; they are not imports of CLI private runtime modules. Public-download and copied-script native qualification remain separate required gates.
|
|
160
180
|
|
|
@@ -174,7 +194,9 @@ Source CI preserves each successful native result under a run-attempt-specific a
|
|
|
174
194
|
|
|
175
195
|
## CI qualification and verified build reuse
|
|
176
196
|
|
|
177
|
-
The local `pnpm prepush:gate` remains the complete developer gate. Full source CI partitions the complete test-file inventory into four duration-balanced groups on each Linux/macOS platform and
|
|
197
|
+
The local `pnpm prepush:gate` remains the complete developer gate. Full source CI partitions the complete test-file inventory into four duration-balanced groups on each Linux/macOS platform and ten on Windows x64. The plan digest binds the complete platform-to-shard mapping; aggregation requires all 22 receipts and every test file exactly once per platform. Test files execute in isolated Node processes; shared environment and process mocks never require concurrent tests within one process. New unprofiled files remain included. Successful per-file summaries from prior timed-out Windows runs provide measured weights; other-platform managed/adoption/identity timings retain explicit provisional estimates with the documented 1.4x hosted slowdown margin until successful native measurement. Partial event logs supply timing evidence only, never a passing shard receipt. The 40-minute job limit remains unchanged. Every shard binds the exact clean source and global plan digest, records Node-owned counters and per-file execution evidence, and hashes its event report. A separate native TAP diagnostic file retains assertion details before the complete run finishes; its payload is excluded from the machine event report and passing-receipt checks. Missing, duplicate, failed, platform-mismatched or stale results block qualification.
|
|
198
|
+
|
|
199
|
+
Foundry #260 keeps LPT, two test workers, matrix concurrency 16, the 40-minute job limit and the 20% plus 90-second planning allowance. Its source-bound Windows timing refresh selects ten shards from measured complete-file summaries while retaining labelled prior weights for changed test sources. The profile records durable source/artifact/event and selection hashes; partial/failed execution remains timing evidence only. The added indices require the current native platform's declared partition. Source commit/tree and the complete global plan hash change capsule identity, so previous source/native/bootstrap successes cannot substitute for a fresh complete candidate qualification.
|
|
178
200
|
|
|
179
201
|
Only a pull request whose exact ancestor-related diff passes `inspectFoundryRelease` may use the version-only lane. It allows the same three version fields and permitted single-line review metadata, then runs type/lint/toolchain, build/surface/audit, release/package contracts and the real packed consumer. Mixed source, dependencies, lock changes, document bodies or invalid Git evidence cannot select this lane. Every final release `workflow_call` supplies its exact source SHA and requires complete four-platform tests, native qualification, aggregation and copied bootstrap, either freshly executed or restored from a verified complete source capsule. Tests and the complete read-only native path run in parallel after the shared package build. Native aggregation and copied-bootstrap checks do not wait for tests; the final qualification gate joins all test and native-path results before signing. Required platform checks run their dependency guard even after a failed or skipped prerequisite. Full aggregation and bootstrap use explicit cancellation/result guards so an intentionally skipped version-only job cannot suppress them transitively. An always-running terminal gate requires every stage selected by the mode to succeed; missing or skipped full-qualification stages fail the workflow. Publication continuations likewise require successful prerequisites and respect cancellation.
|
|
180
202
|
|
|
@@ -206,7 +228,7 @@ Benchmark targets are at most 18 minutes for full qualification and 5 minutes fo
|
|
|
206
228
|
|
|
207
229
|
Published CLI versions through 0.1.14 retain `tiangong-lca/tiangong-cli` and `.github/workflows/publish.yml`; later versions bind `tiangong-lca/cli` at the exact `cli-v<version>` tag. The current Foundry verifier accepts only `.github/workflows/publish.yml` for every requested version. The previously used `.github/workflows/publish-foundry.yml` signer is intentionally retired by the owner decision on 2026-09-13, including for legacy package versions; it is not an accepted rollback or verification exception. Existing published files and signatures remain immutable, but historical artifacts signed by that workflow are outside this verifier's admission policy. Repository/owner identity remains independently version-bound; later Foundry versions use `tiangong-lca/foundry`. Normal publication originates from a main push, and recovery from `workflow_dispatch` on the exact `foundry-v<version>` tag. Every case requires its expected source digest and numeric repository/owner identity.
|
|
208
230
|
|
|
209
|
-
`--output <new-absolute-directory>` preserves the verified tarball, raw registry metadata/attestations and the digest-bound verification report only after verification succeeds. It never replaces an existing directory. Reports are verification evidence, not independent trust anchors: component consumers still require the separately trusted product manifest
|
|
231
|
+
`--output <new-absolute-directory>` preserves the verified tarball, raw registry metadata/attestations and the digest-bound verification report only after verification succeeds. It never replaces an existing directory. Reports are verification evidence, not independent trust anchors: component consumers still require the separately trusted product manifest and independent digest. The tool cannot publish, tag, configure a publisher, read `.env` or supply a registry token. Sigstore uses an owned temporary trust cache that is removed after verification.
|
|
210
232
|
|
|
211
233
|
## Workflow source qualification
|
|
212
234
|
|
|
@@ -294,7 +316,7 @@ The final release contains the identical qualified runtime-manifest.json, bootst
|
|
|
294
316
|
|
|
295
317
|
## Frozen production payload and metadata
|
|
296
318
|
|
|
297
|
-
`pnpm release:prepare-production --output <new-absolute-directory>` is the source-only entrypoint for this input. It requires its own clean checkout, the pinned Node/pnpm source toolchain declaration and a supported host. Output must be outside the source checkout or under ignored `package-artifacts/`; existing destinations are preserved. `specs/release/runtime-inputs.json` binds the exact public CLI version, source commit, repository and tag, and must agree with the public Foundry dependency. The command independently verifies that public CLI release before assembling locked package bytes, runs C1's public runtime inspection from the isolated tree, and uses C1's public writer to produce the archive. It rechecks source before returning the receipt and readable report.
|
|
319
|
+
`pnpm release:prepare-production --output <new-absolute-directory>` is the source-only entrypoint for this input. It requires its own clean checkout, the pinned Node/pnpm source toolchain declaration and a supported host. Output must be outside the source checkout or under ignored `package-artifacts/`; existing destinations are preserved. `specs/release/runtime-inputs.json` binds the exact public CLI version, source commit, repository and tag, and must agree with the public Foundry dependency. The command independently verifies that public CLI release before assembling locked package bytes, runs C1's public runtime inspection from the isolated tree, and uses C1's public writer to produce the archive. It rechecks source before returning the receipt and readable report. The runtime assembler may pass its explicit local CLI source selection to this shared production owner; that path retains candidate source facts in place of registry metadata and uses the CLI source frozen closure. The standalone command has no source/version/registry/publish override. Its `npm-production-input` result is a prepared assembly input, not a complete runtime or released F1.
|
|
298
320
|
|
|
299
321
|
`projectFoundryProductionLock` reads the sole owning pnpm lock and the exact direct dependency declaration from the public package. It requires the pnpm 9.0 lock format, one root importer and coherent exact root versions. Strict YAML parsing rejects duplicate keys, aliases, multiple documents and invalid UTF-8. The projection follows every required snapshot edge, binds canonical SHA-512 package integrities and default public-registry tarball locations, and excludes development-only nodes. Its source byte count/hash refer to the original lock, including its development graph; the derived JSON is release evidence, not a second authoritative package-manager lock.
|
|
300
322
|
|
|
@@ -320,7 +342,7 @@ Native handshake success is not minimum-host or clean-machine qualification. Cur
|
|
|
320
342
|
|
|
321
343
|
`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.
|
|
322
344
|
|
|
323
|
-
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.
|
|
345
|
+
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.28 runtime identity, shebang/bin, source/installed operation equivalence, arbitrary Unicode CWD, read-only package bytes, isolated workspace writes and all six facade operations. The installed bin additionally preserves a task brief, a human question, an investigation reply and its corrected answer across fresh processes; the recap remains partial and keeps the raw answer in the indexed task state. 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.
|
|
324
346
|
|
|
325
347
|
The allocation consumer scenario exercises Product and Waste Flow targets in both Input and Output directions through the actual installed public CLI in the verified component cache. It checks the versioned semantic profile, exact candidate and original Flow hashes, profile/tolerance options hash, Elementary exclusion, missing-context status and immutable input bytes. This direct CLI launch is separate from genuine Foundry IPC. A Process source-evidence task then selects the validated Input Waste wrapper and its CLI report, binds both source hashes to the registered actor/task/runtime, follows returned IPC actions through local row materialization, and preserves the Process payload and exact semantic context. The report is recorded as selected evidence; it is not a Foundry semantic admission decision or remote write authority. Native TIDAS and predecessor runtime metadata in this scenario remain fixtures. Existing registered tasks require explicit reviewed runtime adoption; dependency/source delivery never migrates or replays them automatically.
|
|
326
348
|
|
|
@@ -337,3 +359,13 @@ The adoption extension ships migration planning/application/authority/scope guar
|
|
|
337
359
|
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.
|
|
338
360
|
|
|
339
361
|
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.
|
|
362
|
+
|
|
363
|
+
The managed adoption extension ships `foundry-managed-adoption.schema.json` and its descriptor protocol alongside the unchanged managed-runtime v1 metadata. The control component belongs to the separately reviewed managed launch, not the npm payload or a task. It binds a sealed complete S and independently reviewed Q without inserting Q into S. Package qualification must exercise actual CLI `runtime exec` → direct package entry → managed host; a separately constructed public API host is supporting coverage only. Current source pins CLI 0.1.28; exact local CLI418 package and published/retained packages stay distinct frozen inputs.
|
|
364
|
+
|
|
365
|
+
## Stable installed selection and upgrade ownership
|
|
366
|
+
|
|
367
|
+
The existing public bin now also hosts installation-owned default selection and local `runtime describe`. `scripts/lib/foundry-installed-entry.ts` delegates manifest verification, component inspection and managed execution to the published CLI runtime API. Its input is the deployment-selected manifest/digest and optional cache/launch settings. Its compiler graph remains rooted at `scripts/package-entry.ts`. The selected runtime may have a different product version from the launcher package; each managed child validates its own package against its own complete manifest.
|
|
368
|
+
|
|
369
|
+
Skill instructions depend on the installed entry and public protocols. Deployment can change the selected complete release without changing skill files. The exact package dependency graph, runtime assets and task/attempt records remain version-bound. Historical standalone bootstrap locks remain reproducible release assets and have no precedence over an explicit deployment selection.
|
|
370
|
+
|
|
371
|
+
CLI candidate updates enter through the existing Dependabot proposals and complete source/native/package CI. Release owners update the reviewed CLI source/provenance facts and run the existing release preparation and publication chain. An accepted dependency change produces a new immutable combination. Deployment verifies it, checks required protocols with `runtime describe`, installs the selected components, and updates its manifest/digest pair together. Restoring the preceding pair restores the prior default for new calls; existing tasks retain original returned actions. A new public protocol requires caller compatibility work; an unchanged protocol permits reuse of the same skill.
|
|
@@ -34,13 +34,13 @@ checkPaths:
|
|
|
34
34
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
35
35
|
- test/scenarios/foundry-interaction-workflow.test.mts
|
|
36
36
|
- docs/public-runtime-contract.md
|
|
37
|
-
lastReviewedAt: 2026-10-08
|
|
38
|
-
lastReviewedCommit: d07ac492a3a5891502039a6cc83ef30b9fbba50b
|
|
39
|
-
lastReviewedNote: "Reviewed Foundry #237 exact three-field 0.1.16 to 0.1.17 release projection from eligible PR236 Main d07ac492; CLI/native pins, lock closure, authorization and all business source remain unchanged. Official publication and final managed qualification remain pending."
|
|
40
37
|
related:
|
|
41
38
|
- docs/runtime-context-contract.md
|
|
42
39
|
- docs/task-authorization-contract.md
|
|
43
40
|
- docs/package-distribution-contract.md
|
|
41
|
+
lastReviewedAt: 2026-11-15
|
|
42
|
+
lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
|
|
43
|
+
lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
|
|
44
44
|
---
|
|
45
45
|
|
|
46
46
|
# Public runtime protocol
|
|
@@ -55,7 +55,7 @@ This is the implemented v1 facade protocol for `@tiangong-lca/foundry` and its `
|
|
|
55
55
|
| `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. |
|
|
56
56
|
| `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. |
|
|
57
57
|
| `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. |
|
|
58
|
-
| `tiangong-foundry task resume --workspace <path> --task <id> --actor <id> [--semantic-input <file> | --interaction-input <file> | --authorization-input <file> | --reference-input <file>] --json` | Continue registered preparation, capture one bound interaction/semantic/reference/approval input, or execute and verify a sealed owner scope. Input kinds are mutually exclusive. Consumed/ambiguous mutation state is readback-only and never replayed. |
|
|
58
|
+
| `tiangong-foundry task resume --workspace <path> --task <id> --actor <id> [--semantic-input <file> | --interaction-input <file> | --authorization-input <file> | --reference-input <file> | --identity-stage-input <file> | --quality-review-input <file>] --json` | Continue registered preparation, capture one bound interaction/semantic/reference/quality-review/approval input, explicitly admit a new read-only identity stage, or execute and verify a sealed owner scope. Input kinds are mutually exclusive. Consumed/ambiguous mutation state is readback-only and never replayed. |
|
|
59
59
|
| `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. |
|
|
60
60
|
|
|
61
61
|
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.
|
|
@@ -88,6 +88,8 @@ Process assessment also invokes the qualified published CLI's local `dataset val
|
|
|
88
88
|
|
|
89
89
|
Native Process batches preserve the original row's explicit `semantic_context.flow_documents` as supplemental documents. One exact Flow identity cannot have conflicting canonical content across primary or supplemental documents. Supplemental native failures invalidate their owning Process rows and retain context pointers; primary row counts remain unchanged while augmented manifest hashes, document counts, fingerprints and semantic coverage remain visible. Incomplete or mismatched Process coverage cannot become a valid preparation report.
|
|
90
90
|
|
|
91
|
+
Mutation-manifest and owner-readback reference closure use the same unwrapped business payload as the write candidate. References nested only in row-envelope validation documents do not add write dependency requirements or writable support rows. The complete row and supplemental documents remain bound to their original artifact facts; missing or wrong-version references inside the business payload still block closure.
|
|
92
|
+
|
|
91
93
|
The compatibility report retains native diagnostic fields and supplies curation's `code` and JSON-pointer `path` from the native issue code/location. Row normalization uses the canonical `json` payload slot for typed API wrappers so native validation, curation and CLI patch application address the same domain payload while preserving row metadata and source lineage.
|
|
92
94
|
|
|
93
95
|
When qualified native row validation exits outside success/data-issues, the assessment retains its authentic bounded TIDAS operation report in `native-validation-failure.json`, including exit code/class, all native diagnostics, bounded stderr, the exact selected row file/hash/count and current row-manifest binding. A separate registered assessment-failure result points to that evidence; no schema/QA/curation set is marked complete. Fresh status and unchanged resume expose a plain-language blocker with the affected dataset type, native diagnostic code, I/O or other failure, what remains unassessed and the indexed evidence path. They do not silently rerun the failed local operation or advance toward identity, approval or write. The full task-local report remains available when the default message is shortened. Malformed, oversized or changed failure evidence is refused rather than relabeled as a data issue or success. A replacement qualified runtime requires an explicitly reviewed task revision; this evidence does not authorize one.
|
|
@@ -100,6 +102,8 @@ After local semantic work is ready, a further resume performs process/flow ident
|
|
|
100
102
|
|
|
101
103
|
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.
|
|
102
104
|
|
|
105
|
+
Source-context files accept JSON objects/arrays and JSONL, including current multi-row JSONL emitted by semantic identity apply. Format selection preserves the existing trace collector and exact per-row target/version/hash bindings. Malformed source content returns `source_trace_invalid` without parser excerpts or source contents; retained evidence is unchanged and request preparation dispatches no identity query.
|
|
106
|
+
|
|
103
107
|
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.
|
|
104
108
|
|
|
105
109
|
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`.
|
|
@@ -150,6 +154,18 @@ Sealing obtains a fresh qualified CLI identity after local handoff preparation a
|
|
|
150
154
|
|
|
151
155
|
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.
|
|
152
156
|
|
|
157
|
+
## Preparation quality review
|
|
158
|
+
|
|
159
|
+
`task resume --quality-review-input <file>` selects a strict `tiangong-foundry.quality-review-input.v1` descriptor or a completed generated `tiangong-foundry.quality-review-draft.v1` independently of semantic, interaction, reference and write-authorization inputs. It can record an explicit reviewed interpretation of the current `process_material_balance_deviation` warning before finalization. It does not edit the inventory or the CLI's mass calculation. Ordinary unreviewed inventories, other QA findings, validation failures and incomplete or contradictory evidence stay blocking.
|
|
160
|
+
|
|
161
|
+
The read-only `quality_review_scope` artifact exposes the current bindings and candidate observations; it is not approval. The accompanying `quality_review_input_template` already contains the exact bindings, finding identities and a one-hour UTC validity interval. Save that generated draft, retain only the observations actually reviewed, set their explicit `disposition: accept-interpretation`, and fill the actual rationale, evidence IDs and `{id, kind, file}` selections. Submit through the same `--quality-review-input` entry. The owner captures evidence hashes and stores the derived strict input with the original selected draft and evidence snapshots; callers do not copy binding fields or compute evidence hashes. An untouched template, null disposition, blank rationale or absent evidence is rejected. The existing maximum 24-hour interval still applies; template generation creates no decision, task operation or approval. The [input schema](../specs/schemas/foundry-quality-review-input.schema.json) binds workspace/task/actor, project/user intent, profile and rule hash, the complete current Process rows file, row manifest, assessment, qualified runtime, contract context, reference selection and QA report/findings. `interaction_context_sha256` also binds broad and object-scoped questions, decisions and assumptions for the complete Process roster; a changed applicable interpretation invalidates prior acceptance even when row bytes and numerical QA are unchanged. Each selected warning additionally binds its row index, UUID/version, canonical TIDAS payload and complete finding digest. Ambiguous duplicate Process IDs are not eligible. The input names the expected previous receipt digest (null initially), a current UTC issuance/expiry interval of at most 24 hours, a rationale, and explicitly selected content-bound evidence. Every object must reference both applicable `user-decision` and `source-model` evidence. The trusted caller must establish that the actual user authority covers this particular interpretation; a task brief, standing draft-write permission, arbitrary methodological prose, a source-model file or a scientific-review label does not automatically authorize it. v1 evidence is strict UTF-8, with 8 MiB per file and 64 MiB for the selection, including the descriptor. Missing, linked, private/session, changed or unreferenced evidence is refused.
|
|
162
|
+
|
|
163
|
+
The task transaction snapshots the descriptor and evidence and appends `foundry-quality-review.json`, `reviewed-findings.jsonl` and `quality-review-report.md`. The receipt has `grants_permission: false`. Reassessment preserves raw QA and emits separate `reviewed_findings`; only the exact accepted observation stops generating an authoring action. It does not populate profile waivers or accept the same code on another Process. Receipt replacement uses the task metadata lock and an explicit predecessor; indexed authorization, native contracts, prepared/executed scopes or attempt history freeze review changes. Identical current submissions reuse the indexed result only when both the descriptor bytes and the fully materialized input, including selected evidence hashes, match the accepted receipt. Resubmitting unchanged draft bytes after a selected evidence file changes is rejected; the original receipt is retained. The latest stale or expired receipt cannot fall back to an older decision.
|
|
164
|
+
|
|
165
|
+
Reassessment and finalization recheck the complete observation, rows, context, references and evidence. Reviewed finalization reuses the original registered QA reference-file sequence, including local Flow/property/unit rows, and verifies each file hash. The cleanup projection and final QA consume that same sequence. Known QA run timestamps/output locations may change; numerical results, units, reference content, findings and all other report fields remain bound. Raw row-file identity and canonical scientific payload identity are separate. Changed scientific JSON or arbitrary wrapper metadata invalidates acceptance. A finalizer's derived `semantic_context.flow_documents` can be accepted only with the existing cleanup producer's exact `process_validation_references` proof: unchanged ordered payloads and pre-existing metadata/context, matching input/output files and payload hashes, and the complete ordered projection of unchanged selected exact-version Flow bodies. Unknown, missing, conflicting or extra projections fail closed. This verifier neither constructs validation context nor changes reference-closure ownership.
|
|
166
|
+
|
|
167
|
+
The review digest participates in assessment and finalization freshness. Final write authorization and execution admission remain independent and recheck any quality review required by the final rows. A review creates no grant, capsule, owner request, dispatch or attempt, changes no `allowed_actions`, and cannot recover or replay an existing attempt.
|
|
168
|
+
|
|
153
169
|
## Authorization input
|
|
154
170
|
|
|
155
171
|
`--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.
|
|
@@ -225,7 +241,7 @@ Every facade revision also rechecks all retained predecessors in its request cha
|
|
|
225
241
|
|
|
226
242
|
## Runtime selection and migration seam
|
|
227
243
|
|
|
228
|
-
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.
|
|
244
|
+
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.28 constraint remains explicit rather than silently accepting a future version.
|
|
229
245
|
|
|
230
246
|
`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.
|
|
231
247
|
|
|
@@ -261,6 +277,58 @@ A managed launch policy can supply a target manifest as a file already bound by
|
|
|
261
277
|
|
|
262
278
|
`createFoundryWorkspaceAccess({ manifestBytes, expectedSha256, access })` is the public host bridge when bootstrap and Foundry load separate CLI SDK instances. It verifies the independently selected digest again with Foundry's own CLI instance. The host must obtain that expected digest from its trusted release/skill configuration; it must not derive it from workspace data or the bytes being checked. The bridge is not exposed through ordinary argv or task specifications.
|
|
263
279
|
|
|
280
|
+
Local CLI context-pack, workflow and qualified read-only finalization child failures retain a task-bound `workflow-child-failure.json` artifact under the original operation plan. It records dispatch identity, executable and CLI hashes captured before dispatch, argv digest and sanitized bounded argv, real exit/signal/error class, and UTF-8 bounded sanitized stdout/stderr previews with captured byte counts and digests. The writer and reader share a 64 KiB whole-artifact bound, including JSON escaping and task metadata. Full argv count/digest remain available when its display preview is truncated; additional cropped fields retain original byte counts/digests and explicit truncation markers. Normal executable/CWD/short argv values are preserved. Spawn, nonadmitted exit, signal, empty output, malformed JSON and invalid stage reports cannot become successful producers. A failed operation receipt and `dataset-workflow-failure` index entry retain only the diagnostic, excluding partial stage outputs. The failing response and subsequent status expose that evidence; unchanged resume does not dispatch the child again. These failures require an explicitly reviewed input/runtime revision through existing supported rules; no new recovery permission or historical receipt is inferred. Finalization records its current captured failure using the original nonce, inputs and execution identity; the metadata callback cannot dispatch a child. Its plan timestamp is the actual registration time, and it does not reconstruct an earlier missing producer. Mutation attempts and UNKNOWN remain under their original no-replay owners. Missing or altered retained evidence fails closed.
|
|
281
|
+
|
|
264
282
|
Unexpected runtime failures retain the generic failure code and safe message; recognized filesystem/Node error codes may be included without raw exception text, paths or user data. This helps identify host failures while preserving the non-leaking error envelope.
|
|
265
283
|
|
|
266
284
|
Context, assessment and semantic stages allocate new task-contained directories with exclusive creation, including long Windows task paths. A prior generation is retained rather than reused after interruption.
|
|
285
|
+
|
|
286
|
+
## Same-task compatibility and retained identity diagnostics
|
|
287
|
+
|
|
288
|
+
The optional public `task adopt-runtime` operation supplements start/status/resume without creating another Task. Its modes are `--dry-run --selection <file>`, `--apply --plan <file>`, and `--audit`. All retain `--workspace`, `--task`, `--actor` and `--json`. The typed host uses `createFoundryRuntimeAdoptionQualification` with independently reviewed bytes and digest, then passes that branded qualification to `createFoundryFacade` or `runFoundryPublicCommand`. An ordinary selection file cannot grant compatibility.
|
|
289
|
+
|
|
290
|
+
Plan/apply verify the exact old/new installed descriptors, all CLI inventory files, Node/platform equality, identical selected Toolkit bytes, original source snapshots and registered producer lineage. The stopped-writer handoff names the original registration and, for a subsequent transition, the preceding plan digest. Under owner and task locks, apply compares the complete witness and publishes an immutable receipt. The first anchor and original registration/job remain unchanged. Further v2 receipts are linked once from the preceding digest in the same native adoption store; all old receipts/context facts remain checked. Descriptor/CLI inventory differences matter even when the four historical package-summary fields and version numbers are equal. Current continuation verifies the full tip. An unpatched earlier reader cannot interpret successor links: stopping its writer and selecting the qualified host remain required.
|
|
291
|
+
|
|
292
|
+
Adoption is not authentication, a grant, a new attempt, or authorization to retry a write. Finalization, active approval, consumed or UNKNOWN owner history retains the original recovery boundary. The protocol permits a local preparation continuation only where that boundary is absent. Prior assessment reports remain inspectable with their verified producer locator bases; new runtime context and machine gates are assessed afresh. Any indexed finalization, including a blocked read-only finalization, selects the inspection-only `original_owner_recovery` continuation. Applying that transition makes the successor the current tip without enabling ordinary write-access resume; the earlier tip cannot continue through this protocol, and later transitions retain the restriction. There is no public preparation reset or rollback exception. Keep the current owner selected when it still needs preparation after finalization; any broader recovery capability needs separate owner scope and qualification.
|
|
293
|
+
|
|
294
|
+
A fully bound current CLI 0.1.28 or retained 0.1.27 `needs_review/manual_review` report may legitimately exit 1. Foundry validates report/status/action, request and raw target hash, object/version, exact CLI/receipt identity, invocation arguments, output paths, timestamp, stdout/disk canonical equality and separate original bytes, before registering execution evidence. A reported path must equal its selected path or the native absolute form resolved from that same selected path; report paths and bytes are never normalized or case-folded to invent a match. This accommodates the CLI's native Windows path output while preserving POSIX backslash filenames and rejection of foreign files. Signals, stderr, errors, malformed/stale/mismatched reports or unsupported exits remain failures. Scientific identity is still unresolved; the registered authoring work belongs to the Agent's normal semantic decision stage.
|
|
295
|
+
|
|
296
|
+
For an older stopped diagnostic, resume first verifies retained report/request/results, native producer plan/receipt/index, executable and full independent current/predecessor CLI inventory. It requires the original raw authenticated receipt to be registered in that same producer's outputs; a receipt digest or account summary alone cannot supply its preimage. Recovery emits a separate `identity-preflight-recovery.v1` proof and bound index, never an absent original execution manifest. The reader pins the CLI inventory to the independent index field `recovery_cli_content_sha256`; it cannot infer that expectation from the proof it checks. Historical receipt validation preserves the original read-only owner's 300-second policy and original timestamp. New permission admission retains its independent 60-second rule.
|
|
297
|
+
|
|
298
|
+
A successful recovery performs no new identity query and does not alter original files, scientific rows, Task/revision or attempt. Missing original authentication, results, decisions, producer facts, executable bytes or inventory leaves `identity_preflight_recovery_unproven`/needs_input with `verify_original_identity_recovery`. This UNKNOWN concerns incomplete retained read-only proof; it does not imply an unknown remote write. Such a Task is not recovered merely because a stronger synthetic fixture passed. A new read-only query, if needed, is a separately reviewed scope extension and is not enabled by recovery.
|
|
299
|
+
|
|
300
|
+
## Explicit new read-only identity stage
|
|
301
|
+
|
|
302
|
+
An original source-evidence Task may submit `task resume --identity-stage-input <file> --json` with the same Task/actor. The strict `foundry-identity-stage-input.schema.json` selects one stable intent, the registered current row-report digest, blocked predecessor identity digest, and all current Flow/Process identities with `sha256Json` hashes of their complete row envelopes. Source rows are excluded. This is a visibly NEW authenticated read-only stage, not historical recovery or a write grant; engineering assignment generations are not runtime inputs. Ordinary status/resume without the descriptor cannot use this path.
|
|
303
|
+
|
|
304
|
+
The existing owner-scope locks exclude native dispatch and adoption. Short native Task operations durably index preparation and one claim per exact target before the published identity owner runs. The source snapshot, non-secret account receipt, request/audit/roster and exact qualified runtime/CLI facts are retained. Output roots are stable by Task/actor/intent and target/version. Duplicate or reformatted/relocated equivalent intent reads its original admission; changed intent content or another pending stage cannot create another dispatch. The original artifact-index prefix and old reports remain, with compliant append-only registration.
|
|
305
|
+
|
|
306
|
+
A claimed target cannot invoke the owner again through retries or cache shortcuts. Complete retained execution evidence may be validated and captured; absent stdout/outcome, orphaned admission, real errors or drift remains visibly UNKNOWN without automatic requery. Selected request, output and report paths are resolved to native absolute paths before owner dispatch, so retained argv and CommandSpec are exactly the command executed on that host. Exact target/path/argv/account/runtime/time/stdout/disk/exit checks apply to every accepted result. Native finalization, authorization, consumed or UNKNOWN write history blocks this entry. Existing evidence is checked before dispatch and result acceptance.
|
|
307
|
+
|
|
308
|
+
Each newly claimed query starts the existing owner in a fresh private OS temporary directory, removed after success or failure. This keeps digest-based evidence paths out of the child working directory and prevents the published CLI from loading the user workspace's `.env`. Request, authentication receipt, output and retained execution evidence remain at their absolute task-bound paths. The working directory changes no command, account, attempt, timeout or acceptance rule.
|
|
309
|
+
|
|
310
|
+
Indexed preparation and dispatch remain visible to status and ordinary resume even if result capture was interrupted. They block replacement queries, finalization and write admission. Current questions/investigations must be resolved before dispatch and acceptance; an interaction answer can still be recorded on the same Task, after which an explicit duplicate may accept its retained execution without another query. The admitted OAuth/headless mode is retained and cannot change on a duplicate. `new_cli_execution` is true only for proven execution and stays null for an unproven claim; underlying retrieval counts remain unknown.
|
|
311
|
+
|
|
312
|
+
The explicit call returns immediately after its identity stage, without entering finalization, authorization or owner execution. A complete manual-review report feeds the existing later assessment and Agent semantic work, not scientific acceptance. Stage totals and `this_invocation.cli_invocations` distinguish historical and current-call dispatches; underlying retrieval count stays null when the CLI does not report it. No Task/UUID replacement, scientific rewrite, Source dependency replay or default-runtime switch is implied.
|
|
313
|
+
|
|
314
|
+
## Qualification through the original managed entry
|
|
315
|
+
|
|
316
|
+
The package-owned host also recognizes a non-executable control component advertising `tiangong-foundry.managed-adoption.v1`. Its fixed `metadata/foundry-adoption.json` contains an inventory-bound complete successor manifest and per-launch qualification references. It is selected only by the existing CLI-managed, independently reviewed launch manifest; ordinary application arguments, environment variables, task JSON and standalone cached files cannot select this authority. The original application managed metadata v1 remains unchanged.
|
|
317
|
+
|
|
318
|
+
The carrier L is exactly the complete successor runtime S plus that control component K. All non-component manifest fields and all complete S component records are identical, including workspace schema/features, launch Node/entry/arguments/isolation, product and minimum hosts. K contains no executable files, is never referenced by a launch, and is absent from S. The host verifies L and its executing package first, then the inventory-bound S/Q files and S's full installed component inventory. It creates the existing qualification brand within this package using Q's raw digest from independently reviewed L inventory; Q must still bind the exact complete S digest. It uses S as the explicitly verified executing runtime identity for workspace access and the existing native checks; the original application's read/write policy remains the upper bound. No native manifest, history, stop/CAS, account or scientific guard is relaxed.
|
|
319
|
+
|
|
320
|
+
This separates launch authority from runtime identity without a digest cycle: S is sealed before Q, then K and L are sealed. Stable external original/successor manifest and review evidence files referenced by Q remain retained; rewriting those paths into K's own content-key directory can create another cycle and is unsupported. Current-host rollback targets cannot be mixed with this carrier. Returned actions retain L through public CLI `runtime exec`, preserving admission on every process. Immutable K archive availability or an existing explicit carrier lease must cover later cache pruning; the workspace's S lease alone does not retain K.
|
|
321
|
+
|
|
322
|
+
A legacy or `isolated` managed launch keeps its existing OAuth/cache behavior and consumes no ambient authentication. An admitted carrier may explicitly use the existing CLI `cli-auth` launch channel. Only then does the package map the CLI-whitelisted explicit authentication mode/public configuration/process-only token into the existing typed host seam. It never replaces registered task account/session intent, copies credentials to metadata or treats authentication as compatibility/write authority. Headless mode requires an explicit public target and token and remains cache-disabled; every managed child must obtain its own fresh intent-bound CLI receipt. The parent role receipt is separate evidence.
|
|
323
|
+
|
|
324
|
+
Source qualification now selects published compatible CLI 0.1.28, whose owner-token/access-token save-path correction is relevant to the eventual Process endpoint. The sixteen transitive production packages and selected Node/Toolkit remain separate exact inputs. A local CLI418 QA candidate at that version is selected and inventoried independently for combination testing; equal version labels do not make it the published package or the retained 0.1.27 candidate. Old candidate/manifest/task evidence remains immutable, and actual original DATA managed-entry acceptance still precedes PR delivery.
|
|
325
|
+
|
|
326
|
+
## Environment-selected installed entry
|
|
327
|
+
|
|
328
|
+
The public `tiangong-foundry` bin supports `--help` and `runtime describe --json [--require-protocol <schema>]` before workspace operations. Deployment configures an absolute `TIANGONG_FOUNDRY_MANIFEST` and independently verified `TIANGONG_FOUNDRY_MANIFEST_SHA256` together. Optional `TIANGONG_FOUNDRY_CACHE_DIR` selects an absolute component cache; `TIANGONG_FOUNDRY_ENTRY` selects a declared managed launch and defaults to `foundry`. These values are process configuration supplied by the installation owner.
|
|
329
|
+
|
|
330
|
+
Description uses the public CLI manifest verification and component inspection APIs without authentication, downloads or workspace creation. The `tiangong-foundry.runtime-description.v1` result exposes selected product/version, bundled CLI version, manifest digest, platform, entry, component readiness and inventory-bound package protocol schemas. `ready` exits 0; missing/blocked installation or unsupported required protocols exit 4. Missing components retain `protocol_assessment=not_checked`. Protocol availability describes the published schemas; callers inspect the current schema/work item for optional field support. Errors include a code and recovery guidance; a descriptor/hash failure cannot produce readiness.
|
|
331
|
+
|
|
332
|
+
Configured business commands retain their original argument array and use CLI `executeRuntimeLaunch`, which supplies genuine IPC and the selected installed Node/package entry. The launcher checks installed readiness before execution. Install missing components explicitly with the existing `tiangong-lca runtime ensure` interface. Native stdout, stderr and exit status are forwarded with one dispatch. Direct calls without configured selection retain the existing local facade.
|
|
333
|
+
|
|
334
|
+
Managed IPC entry has precedence over environment default selection. It continues the original admission path and returned-action binding. Changing a deployment default affects subsequent new entry calls; existing task recovery uses its returned executable, argv and cwd. Deployment retains earlier manifests/components required by live tasks. Explicit native adoption remains the task-upgrade mechanism.
|