@tiangong-lca/foundry 0.1.9 → 0.1.11
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 +13 -11
- package/docs/architecture.md +12 -10
- package/docs/foundry-task-contracts.md +16 -4
- package/docs/import-profiles/bafu/constraints.md +1 -1
- package/docs/import-profiles/bafu/profile.md +1 -1
- package/docs/import-profiles/worldsteel/constraints.md +3 -3
- package/docs/import-profiles/worldsteel/import-coverage.md +3 -3
- package/docs/import-profiles/worldsteel/import-plan.md +4 -4
- package/docs/import-profiles/worldsteel/profile.md +3 -3
- package/docs/package-distribution-contract.md +11 -9
- package/docs/public-runtime-contract.md +31 -9
- package/docs/runtime-context-contract.md +7 -5
- package/docs/task-authorization-contract.md +5 -3
- package/package-dist/assets/foundry-package-descriptor.json +300 -154
- package/package-dist/scripts/foundry-facade.d.ts +1 -0
- package/package-dist/scripts/foundry-facade.js +233 -28
- package/package-dist/scripts/foundry-runtime.d.ts +14 -3
- package/package-dist/scripts/foundry-runtime.js +2 -2
- package/package-dist/scripts/lib/finalize-owners/commit-handoff.js +3 -3
- package/package-dist/scripts/lib/finalize-owners/{native-insert-closeout.d.ts → native-draft-closeout.d.ts} +1 -1
- package/package-dist/scripts/lib/finalize-owners/{native-insert-closeout.js → native-draft-closeout.js} +10 -6
- package/package-dist/scripts/lib/finalize-owners/{native-insert-handoff.d.ts → native-draft-handoff.d.ts} +7 -5
- package/package-dist/scripts/lib/finalize-owners/{native-insert-handoff.js → native-draft-handoff.js} +30 -11
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.js +2 -2
- package/package-dist/scripts/lib/foundry-authorization-input.d.ts +10 -1
- package/package-dist/scripts/lib/foundry-authorization-input.js +27 -3
- package/package-dist/scripts/lib/foundry-command-metadata.js +25 -2
- package/package-dist/scripts/lib/foundry-command-registry.d.ts +4 -4
- package/package-dist/scripts/lib/foundry-command-registry.js +3 -0
- package/package-dist/scripts/lib/foundry-execution-admission.js +3 -3
- package/package-dist/scripts/lib/foundry-facade-store.js +56 -6
- package/package-dist/scripts/lib/foundry-interaction-input.d.ts +19 -0
- package/package-dist/scripts/lib/foundry-interaction-input.js +327 -0
- package/package-dist/scripts/lib/foundry-interaction-projection.d.ts +22 -0
- package/package-dist/scripts/lib/foundry-interaction-projection.js +81 -0
- package/package-dist/scripts/lib/foundry-interaction-types.d.ts +17 -0
- package/package-dist/scripts/lib/foundry-interaction-types.js +4 -0
- package/package-dist/scripts/lib/foundry-owner-execution-store.d.ts +33 -16
- package/package-dist/scripts/lib/foundry-owner-execution-store.js +66 -5
- package/package-dist/scripts/lib/foundry-owner-readback.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-owner-readback.js +101 -27
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +4 -4
- package/package-dist/scripts/lib/foundry-package-contract.js +4 -2
- package/package-dist/scripts/lib/foundry-repair-execution.d.ts +11 -0
- package/package-dist/scripts/lib/foundry-repair-execution.js +70 -0
- package/package-dist/scripts/lib/foundry-repair-handoff.d.ts +16 -0
- package/package-dist/scripts/lib/foundry-repair-handoff.js +108 -0
- package/package-dist/scripts/lib/foundry-repair-preflight.d.ts +96 -0
- package/package-dist/scripts/lib/foundry-repair-preflight.js +313 -0
- package/package-dist/scripts/lib/foundry-repair-reference-binding.d.ts +26 -0
- package/package-dist/scripts/lib/foundry-repair-reference-binding.js +120 -0
- package/package-dist/scripts/lib/foundry-repair-reference-proof.d.ts +63 -0
- package/package-dist/scripts/lib/foundry-repair-reference-proof.js +329 -0
- package/package-dist/scripts/lib/foundry-repair-scope.d.ts +76 -0
- package/package-dist/scripts/lib/foundry-repair-scope.js +304 -0
- package/package-dist/scripts/lib/foundry-runtime-command-policy.js +1 -0
- package/package-dist/scripts/lib/foundry-runtime-qualification.js +2 -2
- package/package-dist/scripts/lib/foundry-runtime-utils.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-runtime-utils.js +6 -1
- package/package-dist/scripts/lib/foundry-semantic-input.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-semantic-input.js +29 -2
- package/package-dist/scripts/lib/foundry-semantic-interaction.d.ts +12 -0
- package/package-dist/scripts/lib/foundry-semantic-interaction.js +38 -0
- package/package-dist/scripts/lib/foundry-successor-predecessor.d.ts +36 -0
- package/package-dist/scripts/lib/foundry-successor-predecessor.js +399 -0
- package/package-dist/scripts/lib/foundry-task-registration.js +64 -3
- package/package-dist/scripts/lib/foundry-task-start-spec.d.ts +14 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.js +60 -1
- package/package-dist/scripts/lib/foundry-task-store.d.ts +13 -1
- package/package-dist/scripts/lib/foundry-task-store.js +23 -12
- package/package-dist/scripts/lib/foundry-task-types.d.ts +22 -1
- package/package-dist/scripts/lib/foundry-tidas-source.d.ts +15 -0
- package/package-dist/scripts/lib/foundry-tidas-source.js +90 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +7 -1
- package/package-dist/scripts/lib/foundry-workflow-assessment.js +127 -6
- package/package-dist/scripts/lib/foundry-workflow-authorization.d.ts +2 -1
- package/package-dist/scripts/lib/foundry-workflow-authorization.js +194 -26
- package/package-dist/scripts/lib/foundry-workflow-context.js +4 -0
- package/package-dist/scripts/lib/foundry-workflow-execution.js +6 -1
- package/package-dist/scripts/lib/foundry-workflow-finalize.js +7 -4
- package/package-dist/scripts/lib/foundry-workflow-interaction.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-workflow-interaction.js +63 -0
- package/package-dist/scripts/lib/foundry-workflow-repair.d.ts +36 -0
- package/package-dist/scripts/lib/foundry-workflow-repair.js +580 -0
- package/package-dist/scripts/lib/foundry-workflow-semantic.js +21 -1
- package/package-dist/scripts/lib/foundry-workflow-state.d.ts +9 -1
- package/package-dist/scripts/lib/foundry-workflow-state.js +239 -39
- package/package-dist/scripts/lib/import-curation/curation-cleanup.js +39 -8
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +1 -1
- package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.d.ts +13 -2
- package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.js +100 -29
- package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.js +1 -2
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.js +2 -3
- package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.js +8 -8
- package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.js +12 -2
- package/package-dist/scripts/public-api.d.ts +2 -0
- package/package-dist/scripts/public-api.js +1 -0
- package/package-dist/scripts/runtime-entry.js +9 -1
- package/package.json +3 -2
- package/specs/import-profiles.json +1 -1
- package/specs/schemas/foundry-authorization-input.schema.json +45 -2
- package/specs/schemas/foundry-interaction-input.schema.json +173 -0
- package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
- package/specs/schemas/foundry-package-descriptor.schema.json +3 -2
- package/specs/schemas/foundry-semantic-input.schema.json +12 -1
- package/specs/schemas/foundry-task-start.schema.json +275 -19
- package/specs/schemas/runtime-qualification.schema.json +1 -1
|
@@ -32,9 +32,9 @@ checkPaths:
|
|
|
32
32
|
- test/scenarios/foundry-facade-request-store.test.mts
|
|
33
33
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
34
34
|
- docs/public-runtime-contract.md
|
|
35
|
-
lastReviewedAt:
|
|
36
|
-
lastReviewedCommit:
|
|
37
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
35
|
+
lastReviewedAt: 2026-09-23
|
|
36
|
+
lastReviewedCommit: a836ddaa380a36c8b1466669c1716f6201e9d919
|
|
37
|
+
lastReviewedNote: "Reviewed for Foundry #192: release-only 0.1.11 identity projection from exact merged #193 main a836ddaa380a36c8b1466669c1716f6201e9d919; #190/#193 public interaction behavior, CLI pin, dependencies, permission and scientific gates remain unchanged. Signed publication and native/installed qualification remain separate release gates."
|
|
38
38
|
related:
|
|
39
39
|
- docs/runtime-context-contract.md
|
|
40
40
|
- docs/task-authorization-contract.md
|
|
@@ -53,7 +53,7 @@ This is the implemented v1 facade protocol for `@tiangong-lca/foundry` and its `
|
|
|
53
53
|
| `tiangong-foundry doctor --workspace <path> [--expected-project-ref <ref> --expected-user-id <uuid> [--session-reference <path>]] --json` | Read-only runtime, asset, workspace and account-readiness diagnostics. It checks only bounded reference metadata, never session contents, repository maintenance, Git, login or download. |
|
|
54
54
|
| `tiangong-foundry task start --workspace <path> --spec <file> --json` | Validate the strict `task-start.v1` spec and independently capture its selected sources/optional seed. A relative spec path resolves from the selected workspace root. Request ID, actor, lane, profile, account intent and preparation live in the reviewed spec. |
|
|
55
55
|
| `tiangong-foundry task status --workspace <path> --task <id> --actor <id> --json` | Reconstruct the exact registered request revision and inspect its current task/index/attempt state. Actor intent is supplied independently on every call. |
|
|
56
|
-
| `tiangong-foundry task resume --workspace <path> --task <id> --actor <id> [--semantic-input <file> | --authorization-input <file> | --reference-input <file>] --json` | Continue registered preparation,
|
|
56
|
+
| `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. |
|
|
57
57
|
| `tiangong-foundry workspace migrate --workspace <path> --dry-run --json` | Inventory old state and produce a content-bound migration plan. Applying that plan is a separately explicit operation defined by W10. |
|
|
58
58
|
|
|
59
59
|
The CLI-owned `tiangong-lca runtime ensure/status` manages qualified components only; it does not initialize a Foundry job or grant data permissions. Skills invoke the Foundry facade and its next actions rather than rebuilding its task state machine.
|
|
@@ -66,7 +66,9 @@ Input changes create an explicit new revision with retained history. A new revis
|
|
|
66
66
|
|
|
67
67
|
## Task start and request revisions
|
|
68
68
|
|
|
69
|
-
`tiangong-foundry.task-start.v1` contains exact request and actor ids, one of the
|
|
69
|
+
`tiangong-foundry.task-start.v1` contains exact request and actor ids, one of the three lanes, profile, ordered target entity types, selected source paths, optional account intent, an optional selected JSON seed and at most one current local preparation (`dataset-curation-cleanup`). The source-evidence lane requires its seed to be one of the selected sources. Task start performs no authentication and stores no identity receipt.
|
|
70
|
+
|
|
71
|
+
An optional inline `brief` keeps the task's original user wording (or `null` when the caller retains that evidence elsewhere), a concise goal, optional intended use and scope, expected deliverables, user constraints and separately identified AI assumptions. The field is omitted for older task-start v1 specs; parsing does not add a default, so their serialized shape and revision fingerprints stay unchanged. Changing a registered brief through task start creates a retained request revision under the ordinary predecessor and no-replay rules. The current brief is projected as a task artifact; it is task-local context, not source-data proof or write authority.
|
|
70
72
|
|
|
71
73
|
The workspace request index key is the SHA-256 of workspace id plus request id. Task ids are deterministic `task-<complete-request-sha256>-rNNNN` values. A revision fingerprint binds the normalized spec and ordered canonical input path/bytes/SHA facts. Same request plus latest fingerprint is byte-idempotent, including concurrent starts. Any selected path, content, actor/account, lane/profile/entity or preparation change creates a predecessor-bound revision and preserves every earlier task directory and attempt. Interrupted creation recovers the same deterministic task before the index is published; a different spec returns an actionable recovery conflict until the original spec completes that index record.
|
|
72
74
|
|
|
@@ -76,12 +78,14 @@ Native conversion uses the selected qualified TIDAS executable with an isolated
|
|
|
76
78
|
|
|
77
79
|
After context preparation, the facade materializes typed row arrays from the selected seed or the primary native dataset tree. Process-bundle copies remain evidence and are not counted as additional source rows. Derived inputs must have a verified producer in the same task index. Context preparation includes the converted dependency types as well as the requested types.
|
|
78
80
|
|
|
79
|
-
The
|
|
81
|
+
The public facade assesses one current dataset type per resume. It registers a cumulative report with explicit `in_progress` or `completed` coverage, so the first actionable blocker can be returned before the remaining types finish; an independent type retains its continuation command. Every generation binds the previous indexed assessment, current rows, relevant context and task-interaction digest. Existing current set reports may be reused only when their row, context, queue closure, applicable interaction digest and registered artifact facts still match. A process/flow assessment builds its complete CLI-owned closure queue inside its own generation. A partial assessment is usable for current semantic work but cannot enter identity preflight, finalization, approval or completion. Direct internal callers that omit the bounded-set options retain their original full-batch operation.
|
|
80
82
|
|
|
81
83
|
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.
|
|
82
84
|
|
|
83
85
|
Curation blockers or authoring tasks produce `needs_input` with references to the registered reports and task manifests. Active row, schema, QA, curation and authoring files are checked before presenting that state; changed bytes block continuation. Public authoring artifacts omit developer-runner execution commands and retain full source/context evidence plus the required English guidance. Assessment readiness is distinct from semantic input acceptance, write authorization and final completion.
|
|
84
86
|
|
|
87
|
+
When a current blocker truly needs a person, the entry skill turns its evidence into one plain-language question: what is missing, what it affects, what is recommended, and what decision is needed. The result exposes the exact pending question and its few choices while retaining full evidence in indexed artifacts. An answered question is not repeated. An `investigate` answer remains unresolved and directs investigation rather than silently accepting the recommendation. The task may still assess independent dataset types while waiting.
|
|
88
|
+
|
|
85
89
|
After local semantic work is ready, a further resume performs process/flow identity preflight through the qualified CLI. The task spec must already identify the intended project and user; otherwise the result is `needs_auth`. The host may supply explicit OAuth public configuration or process-only headless authentication through `FoundryFacadeOptions.authentication`. Initialization and task start remain credential-free. The facade never inherits ambient tokens, CLI overrides, Node options or preflight result caches.
|
|
86
90
|
|
|
87
91
|
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.
|
|
@@ -100,10 +104,20 @@ Before the first dispatch, the batch attempt-start event durably registers an im
|
|
|
100
104
|
|
|
101
105
|
Each owner command is dispatched once as executable plus argv with explicit authentication and `shell=false`. Commit stdout must match its contained report. A confirmed success requires the existing closeout checks and fresh independent root, owner, state, payload and reference verification. Lost or unknown responses and narrowly recognized same-identity conflicts use independent readback; known business failures remain unresolved. Recovery does not require the old write grant to remain unexpired and cannot change the original request. The CLI batch item's verified/recovered result determines success; aggregate batch completion alone is insufficient.
|
|
102
106
|
|
|
103
|
-
Explicit native
|
|
107
|
+
Explicit native draft handoffs additionally require a matching CLI v2 execution report: exact contract canonical digest, execution id, ordered action/row identities, per-action operation/before binding and desired payload digests, consumed attempts, and successful exact readback for every action. A row recovered from an ambiguous dispatch may close only with that same consumed-attempt, non-replayed, desired-exact evidence. Failed, forged, unknown, blocked, replayed or incomplete rows cannot close the scope. After a lost response, recovery may read the original bound output's `outputs/dataset-save-draft/summary.json`; absent or invalid native evidence remains unresolved even when roots match. Recovery never dispatches another mutation or retrofits a legacy report into native consumption.
|
|
104
108
|
|
|
105
109
|
Every readback gets a fresh output directory. A verified result binds the exact input, report and JSONL check hashes, plus the native execution report when selected; later status checks rehash each fact. Completed scopes preserve their final rows while dependent scopes are finalized again after new verified progress. Reference-only partitions use the separate canonical verification stage below; semantic changes cannot replace consumed scope rows.
|
|
106
110
|
|
|
111
|
+
## Existing owner-draft metadata repair
|
|
112
|
+
|
|
113
|
+
The `existing-owner-draft-repair` lane selects exactly three distinct source files: a native execution contract, complete before rows and candidate rows. It currently accepts Process rows, stable identity/version and existing ownership/source-reference description text only. Scientific values, references, language structure and annual-volume content cannot change. Registration and status are offline. Resume uses the qualified installed CLI for contract dry-run and exact current-owner/state-0 before readback; producer-indexed raw owner reports and per-root JSONL proofs must agree with the complete selected content. Summaries alone do not prove readback. A no-change scope completes only after validation and exact readback of both selections, without an execution request or mutation attempt.
|
|
114
|
+
|
|
115
|
+
For this metadata-only lane, reference integrity is distinct from reference freshness. Expectations are derived from the complete selected before/candidate payloads and every unchanged reference occurrence. An exact historical reference may remain only when the CLI proves that requested version exists, its sole finding is a newer version, all blocker/count/check records agree, and every root has exact current owner/state/content readback. The raw blocked CLI report and freshness findings remain unchanged; the preparation and closeout retain a separate proof and `publication_ready: false`. A missing exact version, changed reference, mismatched input path, unexpected failure or incomplete check set blocks repair. Ordinary authoring and canonical-reference quality gates keep their existing latest-version requirements.
|
|
116
|
+
|
|
117
|
+
A changed scope requires `input_kind: repair_rows` authorization, an explicit `repair_preparation` reference and the matching native contract. The existing descriptor's `finalization_sha256` binds that preparation digest for this explicit kind; no generic finalization report is manufactured. Only the locked generic profile is currently admitted for repair writes. The grant/capsule/owner-request stores are shared with ordinary execution. Dispatch rechecks the immutable preparation, account, candidate and native contract, then uses the same CLI-owned attempt ledger and guarded save path. Unknown annual volume retains its failed authoring-evidence layer and false publication readiness.
|
|
118
|
+
|
|
119
|
+
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.
|
|
120
|
+
|
|
107
121
|
## Canonical reference verification
|
|
108
122
|
|
|
109
123
|
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.
|
|
@@ -120,7 +134,7 @@ Status performs local evidence verification only. Failed verification exposes `r
|
|
|
120
134
|
|
|
121
135
|
The existing task artifact transaction records a fresh immutable generation. QA and review bytes are copied exactly; the original descriptor/intent bytes are retained. The derived intent rewrites only review file locators to the independently checked task snapshots. That derived file has its own raw SHA-256 and is the file the qualified CLI verifies. It grants no permission. Identical submissions reuse the current selection. Concurrent replacement is checked under the task lock; prepared, consumed and completed owner scopes cannot replace their reference evidence. Removing the original selected files does not remove the snapshots needed for execution/recovery.
|
|
122
136
|
|
|
123
|
-
Selection invalidates prior finalization/approval projection through the recorded reference-selection digest. Finalization uses only current indexed snapshots and requires the selected dataset's current row bytes to match its original control binding; changed rows require fresh selection. Process QA receives explicit repeated `--reference-rows-file` arguments. Precommit verification receives exactly the derived `--reference-intent-file`; default canonical-reference and root policies remain owned by the CLI. Its [exact-reference protocol](https://github.com/tiangong-lca/
|
|
137
|
+
Selection invalidates prior finalization/approval projection through the recorded reference-selection digest. Finalization uses only current indexed snapshots and requires the selected dataset's current row bytes to match its original control binding; changed rows require fresh selection. Process QA receives explicit repeated `--reference-rows-file` arguments. Precommit verification receives exactly the derived `--reference-intent-file`; default canonical-reference and root policies remain owned by the CLI. Its [exact-reference protocol](https://github.com/tiangong-lca/cli/blob/main/docs/agents/exact-reference-intent-contract.md) owns consumer/actor/content/review eligibility. Foundry does not infer units, discover sibling files or create a reference exception itself.
|
|
124
138
|
|
|
125
139
|
Sealing obtains a fresh qualified CLI identity after local handoff preparation and performs complete capsule admission against the current grant and evidence. Before an unconsumed write, the workflow obtains a new current identity between initial rehydration and the final complete admission pass, so prior local work does not age that receipt. Both passes and the existing 60-second identity bound remain enforced before the attempt is consumed.
|
|
126
140
|
|
|
@@ -136,6 +150,14 @@ Finalization exposes per-scope `authorization_inputs` with independently compute
|
|
|
136
150
|
|
|
137
151
|
For a ready `final_rows` scope, the runtime rebuilds the original owner handoff under the validated grant, binds CommandSpec artifacts to absolute final-row paths, and creates the existing execution capsule. It registers a `foundry-authorization.json` result; identical current submissions reuse it without re-authentication or another capsule. Projection requires the matching current finalization, active pointer digest and unexpired record. A sealed result is explicitly pending execution and never dispatches a mutation. `current_rows` registration records preparation approval. Subsequent resume re-finalizes the selected type under that current grant, then proves final-row lineage and derives/activates the exact successor before sealing. Actions, evidence, account/profile binding and expiry are unchanged. Equal-byte derived files reuse the original grant only after lineage proof. A capture interruption after activation resumes from the retained preparation approval and verifies the active grant is its exact derivation; it does not request another approval. Blocked re-finalization retains its reports without repeating remote reads. Existing authorization, capsule and no-replay rules remain authoritative for subsequent execution.
|
|
138
152
|
|
|
153
|
+
## Task interaction input
|
|
154
|
+
|
|
155
|
+
`task resume --interaction-input <file>` selects a bounded `tiangong-foundry.interaction-input.v1` descriptor with exact `task_id`, `actor_id`, `expected_state_sha256` and 1–16 `events`. The first submission uses `expected_state_sha256: null`; later submissions name the current indexed `interaction-state.json` artifact SHA-256. A question event records a stable id, task-wide or dataset-type scope, what is missing, result impact, recommendation, the actual short question, up to four choices, registered evidence hashes and an optional superseded question id. A `support` scope applies to its concrete contact/source/unitgroup/flowproperty sets. An answer records the question id, a unique decision id, `supersedes_decision_id` (`null` first, then the exact previous decision id), the raw reply, its interpreted decision or `null`, `decided` or `investigate`, and registered evidence hashes. An AI assumption records its own id, scope, statement, impact, evidence and optional superseded assumption id in the same scope. Required nullable/list fields are explicit, as defined in `specs/schemas/foundry-interaction-input.schema.json`.
|
|
156
|
+
|
|
157
|
+
The descriptor and exact raw reply are captured as immutable task artifacts under the existing lock and hash-chained index, with a bounded state-file size. Duplicate identical submissions are idempotent; a stale state digest, altered input, unknown question, invented evidence hash, duplicate id, or out-of-task dataset scope is refused. Corrected answers append a new decision with an explicit predecessor while retaining the original reply; `investigate` does not become consent. New question text is supplied by the entry skill from current evidence, and Foundry projects it immediately in a human-readable `next_action` with decision-critical missing facts, impact, recommendation and response choices. The full evidence remains available as indexed artifacts. A pending question or investigation prevents write approval and completion while independent local assessment continues. Once an owner execution request is registered, new interaction events require a separately reviewed task revision; the request and consumed attempt remain bound to their original evidence.
|
|
158
|
+
|
|
159
|
+
The interaction state is separate from `semantic-input`, scientific source facts and write authorization. Each assessed set may register `interaction-context.json` containing only applicable questions, user choices and AI assumptions; task-wide items apply to every set. A set-level digest controls reuse, so changing a Process choice does not invalidate an unrelated Flow assessment. Semantic submissions after an interaction exists name its current state SHA-256 and exactly the applicable `decision_ids` for each selected work item. The runtime verifies these bindings before applying a patch or decision, then records them with the existing owner result; a user choice still cannot replace evidence required by the CLI and scientific gates. Tasks with a brief or interaction state project a concise derived `decision_recap` source at every stage, including partial local results; it carries a raw-answer hash and points back to the indexed full state instead of repeating long private text in the default result. `completion_proven` becomes true only on verified completion. The entry skill turns that source into short prose with actual completion limits. Legacy tasks without new context retain their prior result shape, and the recap adds no approval or completion gate.
|
|
160
|
+
|
|
139
161
|
## Single-result envelope
|
|
140
162
|
|
|
141
163
|
### Semantic input
|
|
@@ -193,7 +215,7 @@ Every facade revision also rechecks all retained predecessors in its request cha
|
|
|
193
215
|
|
|
194
216
|
## Runtime selection and migration seam
|
|
195
217
|
|
|
196
|
-
The public facade accepts CLI/TIDAS expectations only through its process-local host interface. Ordinary argv, task specs, `.env` and ambient `TIDAS_BIN`/expectation variables cannot select trust anchors. Without a host selection, doctor, start, status and local resume work and report `qualification.required`; child-required work must return the runtime qualification action. The managed bin now obtains this selection from the CLI IPC context and its verified component metadata. The final immutable production product manifest remains a W08 deliverable. The current exact CLI 0.1.
|
|
218
|
+
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.19 constraint remains explicit rather than silently accepting a future version.
|
|
197
219
|
|
|
198
220
|
`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.
|
|
199
221
|
|
|
@@ -40,9 +40,9 @@ checkPaths:
|
|
|
40
40
|
- test/scenarios/runtime-workspace.test.mts
|
|
41
41
|
- test/scenarios/foundry-execution-admission.test.mts
|
|
42
42
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
43
|
-
lastReviewedAt:
|
|
44
|
-
lastReviewedCommit:
|
|
45
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
43
|
+
lastReviewedAt: 2026-09-23
|
|
44
|
+
lastReviewedCommit: a836ddaa380a36c8b1466669c1716f6201e9d919
|
|
45
|
+
lastReviewedNote: "Reviewed for Foundry #192: release-only 0.1.11 identity projection from exact merged #193 main a836ddaa380a36c8b1466669c1716f6201e9d919; #190/#193 public interaction behavior, CLI pin, dependencies, permission and scientific gates remain unchanged. Signed publication and native/installed qualification remain separate release gates."
|
|
46
46
|
related:
|
|
47
47
|
- docs/architecture.md
|
|
48
48
|
- docs/task-authorization-contract.md
|
|
@@ -64,16 +64,18 @@ The public task facade delegates sealed owner execution to `foundry-workflow-exe
|
|
|
64
64
|
|
|
65
65
|
The public workflow selects derived row/context facts from the current verified task index before assessment. `runFoundryTaskOperation` rechecks their producer ancestry and original sources. Native validation and the exact CLI's local QA/queue commands use the qualified runtime and isolated environment; curation and authoring write only to a fresh task-owned generation. Runtime assets and source-owner reference bases remain separate from user workspace paths.
|
|
66
66
|
|
|
67
|
-
`qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.
|
|
67
|
+
`qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.19` runtime descriptor. It also compares a strict TIDAS expectation with the selected platform, executable bytes, compatible 0.2.x or 0.3.x version, validation protocols, event schemas and asset fingerprint. The selected TIDAS executable is copied into a private temporary directory, rehashed there and invoked with the credential-free child environment; both handshake calls must be silent. Qualification uses a process-local brand. The portable identity described by `runtime-qualification.schema.json` is diagnostic evidence and cannot be deserialized into authority.
|
|
68
68
|
|
|
69
69
|
The TIDAS expectation admits only `linux-x64`, `linux-arm64`, `darwin-arm64` and `win32-x64`; `darwin-x64` cannot enter the schema or runtime context. `tidas-runtime-expectation.schema.json` is the reviewed machine shape. Qualification creation performs the isolated version/protocol/assets handshake once. Every later assertion reopens and hashes the selected executable and rejects any byte drift before child admission; identical immutable bytes do not replay the handshake. This keeps the original observed behavior bound to exact content while avoiding repeated child-process creation inside one admission call.
|
|
70
70
|
|
|
71
|
-
`execution-context.schema.json` describes the content-addressed child handoff stored under `evidence/executions/`. It is distinct from the older offline `foundry-execution-capsule-stage.v1` admission ledger: the older contract proves immutable staged evidence and attempt state, while `tiangong-foundry.execution-context.v1` binds a current task invocation. Rehydration requires a fresh process-local context, qualification and identity; exact workspace/task/actor, approved source ancestry, current final-row bytes, active authorization and QA waivers, installed owner CLI, owner-draft argv semantics, task-contained output root and CommandSpec digest are rechecked. The action list must match the CLI operation. A native
|
|
71
|
+
`execution-context.schema.json` describes the content-addressed child handoff stored under `evidence/executions/`. It is distinct from the older offline `foundry-execution-capsule-stage.v1` admission ledger: the older contract proves immutable staged evidence and attempt state, while `tiangong-foundry.execution-context.v1` binds a current task invocation. Rehydration requires a fresh process-local context, qualification and identity; exact workspace/task/actor, approved source ancestry, current final-row bytes, active authorization and QA waivers, installed owner CLI, owner-draft argv semantics, task-contained output root and CommandSpec digest are rechecked. The action list must match the CLI operation. A native draft selection admits exactly the final-row and execution-contract artifacts, with the contract independently selected from the current task index. The internal `dataset-workflow-native-contract` operation records the control snapshot without changing source-row ancestry. Native Flow/Process/Source admission revalidates every action's operation and before binding against the current owner, project, state 0 and ordered rows before invoking the public CLI `dataset save-draft --execution-contract`: insert requires an absent before state, save_draft requires the exact lowercase before hash, and arbitrary extra artifacts remain invalid. An explicit reference selection additionally binds exactly one intent, its passing precommit report and the complete review artifact set. Each must be independently selected by the current host and retain its indexed bytes; admission rechecks current consumer content, actor/project and evidence correspondence through the existing handoff adapter. This transport adds no eligibility policy or write authority. Serialized admissions, unrelated CLI commands and changed capsule/spec/input bytes fail closed.
|
|
72
72
|
|
|
73
73
|
## Root ownership
|
|
74
74
|
|
|
75
75
|
Public semantic input remains separate from frozen task source selection and runtime trust. The invocation checks task/actor/current-assessment/work-item bindings, captures explicit non-credential input files, and registers immutable snapshots. Existing indexed work provides the collector context; submitted files provide candidate data only. Repaired rows retain source ancestry, and the next assessment must match the newest row manifest. No semantic data or local apply result is authorization for a remote action.
|
|
76
76
|
|
|
77
|
+
Public interaction input is another explicit, bounded, credential-free file selection. It checks task/actor/current interaction digest, rejects session/credential paths and changed bytes, and stores the raw question/answer and interpreted decision under the task's indexed output root. Only hashes of frozen sources or already indexed artifacts can be cited as evidence. Current applicable decisions are projected into the authoring context and semantic input binding, without changing `source-manifest.json`, runtime qualification, authorization or the CLI's independent scientific proof.
|
|
78
|
+
|
|
77
79
|
| Root | Meaning and authority |
|
|
78
80
|
| --- | --- |
|
|
79
81
|
| `runtimeRoot` | Immutable executing package. No user outputs or state may be written here. |
|
|
@@ -29,9 +29,9 @@ checkPaths:
|
|
|
29
29
|
- test/unit/task-authorization.test.mts
|
|
30
30
|
- test/unit/task-profile-authority.test.mts
|
|
31
31
|
- test/scenarios/foundry-execution-admission.test.mts
|
|
32
|
-
lastReviewedAt: 2026-09-
|
|
33
|
-
lastReviewedCommit:
|
|
34
|
-
lastReviewedNote: "Reviewed for #
|
|
32
|
+
lastReviewedAt: 2026-09-23
|
|
33
|
+
lastReviewedCommit: 649385e48ad75e91031efec4b592ad55d18cf121
|
|
34
|
+
lastReviewedNote: "Reviewed for Foundry #190: human choices guide semantic work but are not QA waivers or write grants; owner attempt consumption rechecks current decision state."
|
|
35
35
|
related:
|
|
36
36
|
- docs/architecture.md
|
|
37
37
|
- docs/safety-policy.md
|
|
@@ -50,6 +50,8 @@ The runtime host revalidates persisted authorization through its explicit loader
|
|
|
50
50
|
|
|
51
51
|
The public facade does not authenticate during workspace initialization or task start. A request revision may retain non-secret account intent, but login/session readiness and task permission remain separate. Local preparation and read-only identity preflight report `permissions.not_required`. Any restricted action must first register its requested actions and approval reference, then rehydrate current qualification, identity and this authorization before exposing a child CommandSpec.
|
|
52
52
|
|
|
53
|
+
A task brief, question, raw answer, interpreted decision, AI assumption or decision recap is not user authorization. The separate interaction input can influence semantic authoring only in its registered scope and cannot approve a QA waiver, mint missing support data, or dispatch a remote write. Pending questions prevent write approval until the current assessment and relevant decision work are complete; independent local assessment can continue. Existing grant, account, content, capsule, readback and no-replay checks still run independently after the question is resolved.
|
|
54
|
+
|
|
53
55
|
The extended public workflow may authenticate for read-only identity preflight after local semantic preparation. Its task account intent and fresh CLI receipt select the read scope. Host authentication is explicit; OAuth configuration is public and headless tokens stay process-only. Query receipts and current-row identity reports are evidence, never an action grant. Preflight does not consume, reset or dispatch a mutation attempt; subsequent permission admission still requires its own current identity and approval checks.
|
|
54
56
|
|
|
55
57
|
## Required binding and evidence
|