@tiangong-lca/foundry 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/docs/architecture.md +5 -3
- package/docs/foundry-task-contracts.md +2 -0
- package/docs/package-distribution-contract.md +5 -3
- package/docs/public-runtime-contract.md +41 -3
- package/docs/runtime-context-contract.md +5 -3
- package/docs/task-authorization-contract.md +2 -0
- package/package-dist/assets/foundry-package-descriptor.json +142 -74
- package/package-dist/scripts/foundry-facade.d.ts +6 -0
- package/package-dist/scripts/foundry-facade.js +35 -0
- package/package-dist/scripts/foundry-runtime.d.ts +2 -1
- package/package-dist/scripts/lib/final-delivery-manifest.d.ts +40 -0
- package/package-dist/scripts/lib/final-delivery-manifest.js +145 -0
- package/package-dist/scripts/lib/final-delivery-review.d.ts +37 -0
- package/package-dist/scripts/lib/final-delivery-review.js +108 -0
- package/package-dist/scripts/lib/finalize-owners/native-draft-handoff.js +4 -3
- package/package-dist/scripts/lib/foundry-edge-repair-preparation.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-edge-repair-preparation.js +90 -1
- package/package-dist/scripts/lib/foundry-edge-session.d.ts +18 -1
- package/package-dist/scripts/lib/foundry-edge-session.js +137 -3
- package/package-dist/scripts/lib/foundry-edge-support.d.ts +1 -1
- package/package-dist/scripts/lib/foundry-interaction-input.js +2 -2
- 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-owner-readback.d.ts +3 -2
- package/package-dist/scripts/lib/foundry-owner-readback.js +21 -2
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +3 -3
- package/package-dist/scripts/lib/foundry-package-contract.js +7 -1
- package/package-dist/scripts/lib/foundry-repair-census.d.ts +82 -0
- package/package-dist/scripts/lib/foundry-repair-census.js +574 -0
- package/package-dist/scripts/lib/foundry-repair-scope.d.ts +15 -2
- package/package-dist/scripts/lib/foundry-repair-scope.js +62 -10
- package/package-dist/scripts/lib/foundry-scientific-repair.d.ts +38 -0
- package/package-dist/scripts/lib/foundry-scientific-repair.js +438 -0
- package/package-dist/scripts/lib/foundry-semantic-input.js +1 -1
- package/package-dist/scripts/lib/foundry-task-input-preparation.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-task-input-preparation.js +160 -0
- package/package-dist/scripts/lib/foundry-task-registration.js +19 -1
- package/package-dist/scripts/lib/foundry-task-types.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-workflow-execution.js +3 -0
- package/package-dist/scripts/lib/foundry-workflow-repair.d.ts +5 -0
- package/package-dist/scripts/lib/foundry-workflow-repair.js +151 -0
- package/package-dist/scripts/public-api.d.ts +6 -0
- package/package-dist/scripts/runtime-entry.js +15 -6
- package/package.json +4 -1
- package/specs/schemas/foundry-interaction-draft.schema.json +323 -0
- package/specs/schemas/foundry-operation-result.schema.json +1 -0
- package/specs/schemas/foundry-package-descriptor.schema.json +4 -1
- package/specs/schemas/foundry-scientific-repair.schema.json +66 -0
- package/specs/schemas/foundry-semantic-draft.schema.json +50 -0
- package/specs/schemas/foundry-task-start.schema.json +10 -2
package/README.md
CHANGED
|
@@ -158,9 +158,9 @@ checkPaths:
|
|
|
158
158
|
- test/unit/lint-suppression-audit.test.mts
|
|
159
159
|
- test/unit/zero-javascript-ratchet.test.mts
|
|
160
160
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
161
|
-
lastReviewedAt: 2026-11-
|
|
162
|
-
lastReviewedCommit:
|
|
163
|
-
lastReviewedNote: "Foundry #
|
|
161
|
+
lastReviewedAt: 2026-11-19
|
|
162
|
+
lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
|
|
163
|
+
lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
|
|
164
164
|
---
|
|
165
165
|
|
|
166
166
|
# TianGong LCA Data Foundry
|
|
@@ -169,6 +169,8 @@ The ordinary user entry is the independently installed [TianGong Foundry skill](
|
|
|
169
169
|
|
|
170
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
|
+
Use `task prepare-input` to bind an interaction or semantic submission to current task evidence. An existing owner draft can enter the scientific repair workflow with a reviewed before/candidate pair, field-level sources and a Worker provider-impact report. The [public task contract](docs/public-runtime-contract.md) describes the required files and recovery behavior.
|
|
173
|
+
|
|
172
174
|
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
175
|
|
|
174
176
|
Migration transfer planning is governed by [the workspace migration contract](docs/workspace-migration-contract.md). W10 provides explicit source/queue/input staging, current-owner task adoption, audited v2 activation and separate runtime read/write selection. Preserved history blocks replay across requests and migrations; none of these records grants business permission. Operational qualification and release integration remain tracked in #108/#980.
|
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-11-
|
|
156
|
-
lastReviewedCommit:
|
|
157
|
-
lastReviewedNote: "Foundry #
|
|
155
|
+
lastReviewedAt: 2026-11-19
|
|
156
|
+
lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
|
|
157
|
+
lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
|
|
158
158
|
---
|
|
159
159
|
|
|
160
160
|
# Architecture
|
|
@@ -189,6 +189,8 @@ Foundry selects a private session reference and exact project/user intent, then
|
|
|
189
189
|
|
|
190
190
|
`foundry-runtime-qualification.ts` binds current Foundry package identity to exact public CLI and independently selected native TIDAS bytes/protocols. `foundry-execution-admission.ts` then binds the current source lineage, derived final rows, active grant/actions/QA evidence and owner CLI CommandSpec. Rehydration in a new process reconstructs every process-local proof and checks the exact owner-draft argv shape before returning the spec. Mutation dispatch, attempt transitions and readback remain with the existing CLI/orchestration owners.
|
|
191
191
|
|
|
192
|
+
The local descriptor preparer in `foundry-task-input-preparation.ts` derives digests from indexed task state. The scientific repair path in `foundry-scientific-repair.ts` binds the field sources, reviewer and native comparison. `foundry-repair-census.ts` independently observes visible identities and dependencies for preparation and original-attempt verification. [Public repair workflow](public-runtime-contract.md#scientific-process-repair)
|
|
193
|
+
|
|
192
194
|
## Public facade composition
|
|
193
195
|
|
|
194
196
|
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.
|
|
@@ -183,3 +183,5 @@ The deterministic local `dataset-workflow-quality-review` stage uses the existin
|
|
|
183
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
184
|
|
|
185
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.
|
|
186
|
+
|
|
187
|
+
Preparing an interaction or semantic descriptor reads the current task index and returns a local result. Submitting it through `task resume` rechecks the state and selected files under the existing task contract. Scientific draft repair additionally retains the field-change evidence, Worker comparison and two-pass visible census behind its preparation receipt. The consumed write attempt continues through its original readback action. [Public inputs and outputs](public-runtime-contract.md)
|
|
@@ -39,9 +39,9 @@ related:
|
|
|
39
39
|
- docs/runtime-context-contract.md
|
|
40
40
|
- docs/task-authorization-contract.md
|
|
41
41
|
- docs/safety-policy.md
|
|
42
|
-
lastReviewedAt: 2026-11-
|
|
43
|
-
lastReviewedCommit:
|
|
44
|
-
lastReviewedNote: "Foundry #
|
|
42
|
+
lastReviewedAt: 2026-11-19
|
|
43
|
+
lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
|
|
44
|
+
lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
|
|
45
45
|
---
|
|
46
46
|
|
|
47
47
|
# Foundry package distribution
|
|
@@ -369,3 +369,5 @@ The existing public bin now also hosts installation-owned default selection and
|
|
|
369
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
370
|
|
|
371
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.
|
|
372
|
+
|
|
373
|
+
The scientific Process repair protocol packages its own selection schema. For that workflow the installation owner also supplies a qualified Worker `snapshot_builder` and the independently verified SHA-256 of the installed executable. Build from the reviewed Worker source with `cargo build --locked --release -p solver-worker --bin snapshot_builder` in a supported Worker build environment, or use a deployment artifact qualified for the same diagnostic. Keep its native libraries available in its deployed layout. Check the selected installation with the public provider-impact fixture before binding its digest in the host configuration. The [scientific repair contract](public-runtime-contract.md#scientific-process-repair) specifies the protocol marker, input evidence and task recovery.
|
|
@@ -38,9 +38,9 @@ related:
|
|
|
38
38
|
- docs/runtime-context-contract.md
|
|
39
39
|
- docs/task-authorization-contract.md
|
|
40
40
|
- docs/package-distribution-contract.md
|
|
41
|
-
lastReviewedAt: 2026-11-
|
|
42
|
-
lastReviewedCommit:
|
|
43
|
-
lastReviewedNote: "Foundry #
|
|
41
|
+
lastReviewedAt: 2026-11-19
|
|
42
|
+
lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
|
|
43
|
+
lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
|
|
44
44
|
---
|
|
45
45
|
|
|
46
46
|
# Public runtime protocol
|
|
@@ -54,6 +54,7 @@ This is the implemented v1 facade protocol for `@tiangong-lca/foundry` and its `
|
|
|
54
54
|
| `tiangong-foundry workspace init --workspace <path> --json` | Atomically initialize/verify the versioned workspace; preserve existing records and reject unversioned state requiring migration. No login or business write. |
|
|
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
|
+
| `tiangong-foundry task prepare-input --workspace <path> --task <id> --actor <id> --kind interaction\|semantic --input <draft.json> --json` | Read current indexed task evidence and return a strict `prepared_task_input` descriptor with derived SHA-256 bindings. No task registration, authentication or stage dispatch. |
|
|
57
58
|
| `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
59
|
| `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
60
|
| `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. |
|
|
@@ -138,6 +139,28 @@ A changed scope requires `input_kind: repair_rows` authorization, an explicit `r
|
|
|
138
139
|
|
|
139
140
|
Repair closeout requires the matching consumed native execution receipt plus independent exact owner/state/payload and reference-closure readback. It binds the same preparation report, never claims generic authoring/QA/location checks ran, and never accepts trace-normalized equality. A missing receipt or wrong readback remains unresolved; resume performs readback only and cannot repeat the mutation. Status rehashes retained proof and may complete a verified repair without a generic row-authoring finalization. An explicitly linked successor may proceed only when the predecessor has a producer-verified terminal CLI failure proving zero executed actions and zero consumed CLI attempts. It preserves the same request/account/identities, uses new immutable input paths and a genuinely changed desired payload, and requires a fresh preflight and grant. A fresh before image is permitted; old evidence remains immutable. Unknown or dispatched predecessors remain blocked.
|
|
140
141
|
|
|
142
|
+
## Scientific Process repair
|
|
143
|
+
|
|
144
|
+
Use `runtime describe --json --require-protocol tiangong-foundry.scientific-repair.v1` to check the selected Foundry installation. The installation owner also provides a qualified `snapshot_builder` built from the Worker provider-impact implementation and configures its verified binary digest as described in the [host configuration contract](env-surface-policy.md). The [Worker provider-impact contract](https://github.com/tiangong-lca/worker/blob/e1e36d195701d8da61f2868e44a0eed4fc558e71/docs/provider-impact-diagnostic-contract.md) describes the input, invocation and matrix-only report.
|
|
145
|
+
|
|
146
|
+
Scientific and Exchanges edits submitted through the metadata selection fail offline with `repair_provider_impact_diagnostics_missing`. The diagnostic names affected paths and the Worker-owned before/candidate provider-impact evidence. The separate `existing-owner-draft-scientific` selection uses the same repair lane, contract, before/candidate and predecessor fields and adds a `scientific` descriptor path. Every referenced file must be an independently selected task source under its canonical absolute path. Scientific edits are bounded to Process exchanges, quantitative reference, mathematical relations, time, geography, technology, name, synonyms, general comment, classification, LCI method and source-treatment/representativeness fields. Dataset identity, administrative ownership/permissions, technical headers and opaque `common:other` fields remain protected. The existing metadata description-text allowance also applies.
|
|
147
|
+
|
|
148
|
+
The strict `tiangong-foundry.scientific-repair.v1` descriptor contains `author_id`, `worker_input`, `worker_report`, `changes`, `sources` and `review`. File selections use `{file, sha256}`. The author must equal the task actor. The native input is `worker.provider-impact.input.v1` in `matrix_only` mode and binds the same actor-owned state0 Process identities and complete selected before/candidate bodies. Its overlays cover exactly the changed Process rows. The independently reviewed full native report is recomputed by Foundry using the trusted deployed Worker and must match byte for byte. Its required `scope.frozen_selection_contract` is `worker.provider-impact.frozen-census.v1`, including on indexed-evidence reuse. Required provider/consumer closure and native-selection validation belong to that producer. [Worker #288](https://github.com/tiangong-lca/worker/issues/288)
|
|
149
|
+
|
|
150
|
+
The changes file uses `tiangong-foundry.scientific-repair-changes.v1` with a `changes` array. Each entry binds `id`, `version`, a JSON Pointer `path`, `before_sha256`, `after_sha256`, `basis` and structured `evidence`. Value hashes cover `{present: true, value}` or `{present: false}`. Every changed value appears exactly once. Added and removed array occurrences require their own entries. Each evidence item names its selected `source` and `source_sha256`, plus a quote present in those exact source bytes, or a JSON Pointer `path` and `value_sha256` covering its located `{present, value}`. The independent review follows the existing final-delivery reviewer contract with a distinct `reviewer_id`, `scope: scientific-content-and-provider-impact`, `status: PASS`, zero P0/P1 findings and exact `reviewed_artifacts` coverage. Required artifact IDs are `before`, `candidate`, `worker_input`, `worker_report`, `changes` and `source_0` through the last selected source. Review, source and candidate changes invalidate the scope.
|
|
151
|
+
|
|
152
|
+
Preparation scans the complete public100 and actor-owned0 Process, Model and Flow dependency directories twice through the authenticated public read interface. The directory requests identity/visibility and the JSON subtrees needed to project Flow references, Model result/component references and exact declared Flow types. Retained directory evidence contains compact identity projections, each original response hash and its redacted current identity receipt. A long read renews the same account/project/runtime receipt through the existing CLI owner under its original freshness rules.
|
|
153
|
+
|
|
154
|
+
A conservative undirected identity component separates the supplied family from all visible peers. Shared Product/Waste, Other and unknown Flow UUIDs connect Processes across every visible revision. Only a reference whose exact visible Flow revision explicitly declares `Elementary flow` can be excluded from this connection proof. Model associations and every visible Model revision's result/component identities also connect the family. Candidate Process references participate before any write. Signs, weights, geography and provider choices remain Worker-owned. Missing connected Process/Model members, omitted visible historical revisions and uncertain relevant references reject. An isolated unrelated missing dependency can remain outside the proved family.
|
|
155
|
+
|
|
156
|
+
Only the complete selected family and its exact supporting bodies are read twice and compared with the frozen Worker input. Versionless Flow choices must match the latest eligible revision in the full visible Flow directory. Public state200 supporting Source/Contact/FlowProperty/UnitGroup data retain their existing admission, while numeric Flows keep the state100/owner0 predicate. Each directory type is bounded to 100000 combined visible rows, the complete read to 1 GiB of transferred response bytes, and the retained compact projections and exact family evidence to separate 64 MiB budgets across both passes. Worker retains its own 10000-total-document and 64 MiB request bounds. A larger or inseparable family fails explicitly.
|
|
157
|
+
|
|
158
|
+
The proof distinguishes `directory_complete` from `body_scope: closed_conservative_family`, records global-directory and selected-family counts/digests, and retains `transaction_snapshot: false` and `double_scan: true`. Pagination/count/identity drift, changed projections or family bodies, unknown ownership and unproved separation fail closed. The native report retains its `supplied_finite_universe` and unverified-online scope flags. Foundry records these separate authenticated observations and rechecks the current family before the first consumed mutation attempt.
|
|
159
|
+
|
|
160
|
+
The published CLI applies every proposed field edit to the exact before payload and its output must equal the complete reviewed candidate. Scientific repair currently admits the generic profile with every typed validation layer, native TIDAS schema and existing curation gate passing. Complete census-verified Flow, FlowProperty and UnitGroup bodies supply local QA. Native schema validation uses the existing exact Flow-context wrapper projection and verifies that every write payload stays equal to the reviewed candidate. Deterministic cleanup must preserve the selected candidate content, otherwise the revised complete candidate requires a new immutable scope. The resulting preparation binds source review, native provider-impact, census, patch, validation, cleanup and curation evidence through the task producer index. Authorization uses the existing `repair_rows` descriptor and seals that exact preparation. Existing owner/state/preimage CAS, single-dispatch attempt consumption and exact readback apply.
|
|
161
|
+
|
|
162
|
+
After root and dependency readback, scientific repair observes the complete census again with the approved overlays applied. A changed peer, incomplete observation or lineage/dependency mismatch retains an unresolved consumed attempt and readback-only recovery. Successful readback records `concurrent_interval_atomicity: unproven` because the complete scans and the target CAS use separate transactions. It establishes the recorded before/after observations and exact target write, while concurrent changes between those observations retain that explicit limit. Later readback can resolve an original attempt only against the same reviewed overlay and peer evidence.
|
|
163
|
+
|
|
141
164
|
## Canonical reference verification
|
|
142
165
|
|
|
143
166
|
Identity reuse retains original source rows in the reference partition and selects different canonical targets in its rewrite evidence. After current finalization, resume verifies those selected table/id/version targets through the qualified CLI `dataset verify-remote --root-policy existing`. Its generated query contains only reference descriptors. It does not compare the source payload with the reused dataset or construct a write candidate.
|
|
@@ -172,6 +195,21 @@ Reassessment and finalization recheck the complete observation, rows, context, r
|
|
|
172
195
|
|
|
173
196
|
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.
|
|
174
197
|
|
|
198
|
+
## Preparing interaction and semantic inputs
|
|
199
|
+
|
|
200
|
+
Use the public `task prepare-input` command to derive the exact current bindings before `task resume`. The same API is `facade.prepareInput({ taskId, actorId, kind, draftFile })`. Preparation reads task evidence and selected local files and returns the descriptor as the inline `prepared_task_input` artifact. Save that artifact's `value` as a JSON file, then submit it with `--interaction-input` or `--semantic-input`. Preparation does not register an event or execute a task stage. Submission still rechecks current state, task locks, scientific evidence, authorization and consumed attempts.
|
|
201
|
+
|
|
202
|
+
An [interaction draft](../specs/schemas/foundry-interaction-draft.schema.json) has `schema: "tiangong-foundry.interaction-draft.v1"` and `events`. Events retain the strict interaction fields but select `evidence_files: ["<registered-source-or-artifact-path>"]` in place of digest strings. An optional narrow `object_scope` selects `{ "entity_id": "<id>", "version": "<version>" }`. Preparation verifies a unique current registered row and computes `row_sha256`. It also derives task/actor, current `expected_state_sha256` and registered evidence byte hashes. A single events array may contain a question followed by its already-confirmed answer and explicit `decision_id`.
|
|
203
|
+
|
|
204
|
+
A [semantic draft](../specs/schemas/foundry-semantic-draft.schema.json) has `schema: "tiangong-foundry.semantic-draft.v1"` and `submissions`. Each submission selects `{ "kind": "patch", "authoring_task": "<current-task.json>", "file": "<completed-patch.json>" }`, with optional explicit `decision_ids`. Other supported kinds are `classification`, `location` and `identity`. Preparation proves the authoring task belongs to the current assessment and derives `assessment_sha256`, current `interaction_sha256`, `authoring_task_sha256`, and each selected file's raw byte `sha256`. Paths resolve against the explicit workspace and output file selections are absolute.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
tiangong-foundry task prepare-input --workspace /absolute/workspace --task "$TASK_ID" --actor "$ACTOR_ID" --kind interaction --input /absolute/interaction-draft.json --json
|
|
208
|
+
tiangong-foundry task prepare-input --workspace /absolute/workspace --task "$TASK_ID" --actor "$ACTOR_ID" --kind semantic --input /absolute/semantic-draft.json --json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The descriptor binds one observed state. A concurrent event or changed file requires fresh preparation and review. Strict descriptors continue to be accepted directly, and stale submitted digests remain rejected. File-reference `sha256` values always hash exact file bytes, including whitespace and newlines. `object_scope.row_sha256` uses the canonical entire registered row object. CLI native `payload_sha256` uses its canonical TIDAS payload digest. These fields bind different objects, and their values must come from their corresponding producers.
|
|
212
|
+
|
|
175
213
|
## Authorization input
|
|
176
214
|
|
|
177
215
|
`--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.
|
|
@@ -45,9 +45,9 @@ related:
|
|
|
45
45
|
- docs/task-authorization-contract.md
|
|
46
46
|
- docs/public-runtime-contract.md
|
|
47
47
|
- docs/package-distribution-contract.md
|
|
48
|
-
lastReviewedAt: 2026-11-
|
|
49
|
-
lastReviewedCommit:
|
|
50
|
-
lastReviewedNote: "Foundry #
|
|
48
|
+
lastReviewedAt: 2026-11-19
|
|
49
|
+
lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
|
|
50
|
+
lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
|
|
51
51
|
---
|
|
52
52
|
|
|
53
53
|
# Runtime context
|
|
@@ -60,6 +60,8 @@ The runtime entry now exposes the six W05 hierarchical operations described in `
|
|
|
60
60
|
|
|
61
61
|
The public task facade delegates sealed owner execution to `foundry-workflow-execution.ts`, request/attempt state to `foundry-owner-execution-store.ts`, and independent owner verification to `foundry-owner-readback.ts`. The existing closeout factory lives under `lib/finalize-owners` with its developer-command re-export preserved. Local operation receipts capture evidence only; the CLI batch boundary owns one-shot mutation and readback recovery. `foundry-workflow-reference-verify.ts` separately binds current semantic canonical targets to qualified CLI reference checks, using an explicit authentication environment and fresh output generation. See [public execution and recovery](public-runtime-contract.md#owner-execution-and-recovery).
|
|
62
62
|
|
|
63
|
+
A scientific repair pins its deployment-selected Worker executable separately from the CLI and TIDAS runtime qualification. Its public result binds the frozen input, native report and the observed visible directory. The original task keeps those input and execution identities across preparation, approval and recovery. [Scientific repair](public-runtime-contract.md#scientific-process-repair)
|
|
64
|
+
|
|
63
65
|
## Runtime qualification and child admission
|
|
64
66
|
|
|
65
67
|
The installed CLI contract test exercises the package's actual executable without credentials. It checks command and option availability for authoring context, identity preflight, exact reference/readback verification, and execution-contract draft writes. A dependency candidate can retain the public TypeScript exports while removing these executable routes. When migrating the Foundry callers, update the test alongside those callers and qualify behavior with the candidate's real package.
|
|
@@ -147,3 +147,5 @@ The explicit public authorization workflow supplies an internal trusted `refresh
|
|
|
147
147
|
Current state, selected rows/evidence and active pointer are rechecked under the lock. Registration checks grant expiry after its final current-state check; loading verifies pointer equality again before returning. Fresh identity does not extend grant lifetime, alter the 60-second rule, clear attempts, change native insert-only contracts, or retain credentials in another store. Same-task runtime adoption supplies no authorization and preserves original owner-recovery barriers.
|
|
148
148
|
|
|
149
149
|
The L=S+K carrier binds compatibility through independently reviewed component inventory and full executing-runtime equality. Its same-package Q brand supplies no account or write grant; all original source/profile/registration/CAS/stop/consumed/UNKNOWN checks remain. An explicit cli-auth policy projects process-only credentials into current identity verification while task account/session intent remains authoritative; a parent receipt cannot replace the fresh child receipt.
|
|
150
|
+
|
|
151
|
+
A scientific Process repair uses `input_kind=repair_rows` and the existing scoped grant. The Worker comparison, field sources, reviewer report and observed census qualify the candidate for approval. A consumed attempt with unresolved peer or root evidence remains eligible only for readback. The target compare-and-swap and the independent census observations have separate transaction boundaries. [Scientific Process repair](public-runtime-contract.md#scientific-process-repair)
|