@tiangong-lca/foundry 0.1.10 → 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 +6 -6
- package/docs/architecture.md +6 -6
- package/docs/foundry-task-contracts.md +9 -3
- package/docs/package-distribution-contract.md +6 -4
- package/docs/public-runtime-contract.md +17 -5
- package/docs/runtime-context-contract.md +5 -3
- package/docs/task-authorization-contract.md +5 -3
- package/package-dist/assets/foundry-package-descriptor.json +120 -64
- package/package-dist/scripts/foundry-facade.d.ts +1 -0
- package/package-dist/scripts/foundry-facade.js +165 -31
- package/package-dist/scripts/foundry-runtime.d.ts +2 -1
- package/package-dist/scripts/foundry-runtime.js +2 -2
- 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.js +34 -2
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +3 -3
- package/package-dist/scripts/lib/foundry-package-contract.js +3 -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-task-start-spec.d.ts +11 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.js +36 -0
- package/package-dist/scripts/lib/foundry-task-store.d.ts +1 -1
- 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-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-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 +173 -21
- 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 +2 -1
- package/specs/schemas/foundry-interaction-input.schema.json +173 -0
- package/specs/schemas/foundry-package-descriptor.schema.json +2 -1
- package/specs/schemas/foundry-semantic-input.schema.json +12 -1
- package/specs/schemas/foundry-task-start.schema.json +75 -0
package/README.md
CHANGED
|
@@ -158,15 +158,17 @@ 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-09-
|
|
162
|
-
lastReviewedCommit:
|
|
163
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
161
|
+
lastReviewedAt: 2026-09-23
|
|
162
|
+
lastReviewedCommit: a836ddaa380a36c8b1466669c1716f6201e9d919
|
|
163
|
+
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."
|
|
164
164
|
---
|
|
165
165
|
|
|
166
166
|
# TianGong LCA Data Foundry
|
|
167
167
|
|
|
168
168
|
The ordinary user entry is the independently installed [TianGong Foundry skill](https://github.com/tiangong-lca/agent-skills/tree/main/foundry-tidas-import). Its qualified release lock selects the managed runtime for a separate user workspace. The internal authoring role is maintained in the same Skills repository and loads for current semantic work items. This source checkout retains the developer commands and runtime owners described below; it carries no second maintained copy of either skill.
|
|
169
169
|
|
|
170
|
+
The public task protocol can retain a short goal and scope, register evidence-bound questions and raw answers, reassess only affected dataset types, and present a derived decision recap with the completed result. The entry skill explains human decisions in plain language and accepts natural answers; Foundry preserves the exact task evidence and the CLI keeps scientific validation and write permission separate. A source checkout implementing this protocol does not itself update the independently qualified installed skill/runtime lock.
|
|
171
|
+
|
|
170
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.
|
|
171
173
|
|
|
172
174
|
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.
|
|
@@ -214,9 +216,7 @@ Public project/client settings may be blank for the official Production profile;
|
|
|
214
216
|
|
|
215
217
|
Foundry is a pnpm-only, non-JSX Node.js 24 project. The reproducible toolchain is `pnpm@11.24.0`, TypeScript `7.0.2` as the only compiler anywhere in the dependency graph, Oxlint for linting, and Prettier for formatting; tracked `.jsx`/`.tsx` are rejected. TypeScript enforces erasable-only runtime syntax; root lint ignores nested Oxlint configs, bans TypeScript error-suppression comments, runs a comment-aware tracked-source audit that rejects native disable directives without treating strings as directives, and reconciles every Git-enumerated `.ts`/`.mts`/`.cts` file against intentional first-party includes. The audit clears inherited repository-local Git bindings before inspecting its target, preventing pre-push hook state from redirecting temporary fixtures into the parent index. Builds use the Node-native safe cleaner to remove stale `dist` output before `tsc`; `noEmitOnError` guarantees that TypeScript diagnostics emit no replacement JavaScript, without claiming arbitrary I/O failure atomicity. Source and built commands resolve one trusted repository root and their active `.ts`/`.js` entry independently of CWD. The repository keeps one root `pnpm-workspace.yaml` and `pnpm-lock.yaml`; npm/Yarn lockfiles, TypeScript 5/6 aliases, `@typescript-eslint`, and TypeScript-compiler-backed formatting plugins are outside the supported graph.
|
|
216
218
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Issue #63 began with a historical baseline of 160 tracked JavaScript artifacts: 95 runtime `.mjs` files, 64 `.mjs` tests, and one Prettier `.cjs` config. That monotonic migration is complete. `test/unit/zero-javascript-ratchet.test.mts` now permanently enforces zero tracked first-party JavaScript, native TypeScript configuration, and TS-only compiler/test/lint globs; characterization and real-case TDD remain mandatory for later changes.
|
|
219
|
+
The permanent `test/unit/zero-javascript-ratchet.test.mts` requires zero tracked first-party JavaScript and a TypeScript-only compiler, lint, and test graph.
|
|
220
220
|
|
|
221
221
|
The first completed CLI-spine slice migrates `scripts/lib/foundry-args.ts` and `scripts/lib/foundry-command-registry.ts`. Its focused test fixes parser coercion, exact help JSON and command order, exit-code families, and all static consumer imports before later entrypoint and dispatcher slices proceed.
|
|
222
222
|
|
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-09-
|
|
156
|
-
lastReviewedCommit:
|
|
157
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
155
|
+
lastReviewedAt: 2026-09-23
|
|
156
|
+
lastReviewedCommit: a836ddaa380a36c8b1466669c1716f6201e9d919
|
|
157
|
+
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."
|
|
158
158
|
---
|
|
159
159
|
|
|
160
160
|
# Architecture
|
|
@@ -167,6 +167,8 @@ Migration transfer planning is governed by [the workspace migration contract](wo
|
|
|
167
167
|
|
|
168
168
|
The v2 task store persists registered job/source/profile identity, account intent, producer receipts and artifact lineage; deterministic local retries reuse verified results. Exact C1/TIDAS qualification, all-command disposition, derived authorization and child admission form the W04 authority boundary. The W05 hierarchical facade adds strict result/task schemas, deterministic request revisions, actor-bound status/resume, local preparation and read-only migration inventory. W06 compiles that facade into the descriptor-bound `@tiangong-lca/foundry` candidate; W08 still owns F1 publication and platform components. See `docs/public-runtime-contract.md`, `docs/runtime-context-contract.md`, `docs/package-distribution-contract.md`, `docs/task-authorization-contract.md` and `docs/foundry-task-contracts.md`.
|
|
169
169
|
|
|
170
|
+
Task-local interaction is a small owner over the existing facade and artifact transaction. The optional brief stays in the immutable request revision; question, raw-answer, interpreted-decision and AI-assumption events are indexed under the task lock. A graph-leaf interaction type module lets assessment read applicable projections without depending back on the input/store owner. Assessment projects one dataset type per resume, retains unchanged set reports through exact row/context/queue/applicable-decision bindings and exposes incomplete coverage immediately. Current user decisions and AI assumptions enter the type's authoring context; semantic apply binds the exact current decision ids before invoking the existing owner. Foundry derives a readable recap source from actual task/completion evidence, while Skills writes the human-facing wording. These records supply context, not scientific data or remote write authority.
|
|
171
|
+
|
|
170
172
|
The explicit workspace runtime is defined by `docs/runtime-context-contract.md`: package layout comes from `package.json.foundryRuntime`, emitted execution needs no source TypeScript or Git, and selected inputs/task outputs are bound to an immutable runtime context. `scripts/runtime-entry.ts` now implements workspace init/migration, consumer doctor and task start/status/resume as the separate hierarchical facade. All 63 flat owner commands retain explicit public/internal/excluded, path, child, qualification and authorization dispositions; the facade reaches them only through registered task state and never falls back to the developer runner.
|
|
171
173
|
|
|
172
174
|
`createFoundryApplication` constructs the existing command factories for one explicit root and optional injected runtime utilities. Its `execute` method uses the same `createFoundryCommandDispatcher` registry as the CLI and returns a promise without the dispatcher printing or exiting the host. Construction does not load `.env` or discover operator state; independent applications retain independent root bindings. The developer `main(argv)` alone loads its environment and chooses the process adapter under `import.meta.main`. Consumer commands still require individual task/I/O admission through `runtime-entry.ts`; this internal composition API does not make every legacy owner safe for an installed consumer or authorize a write.
|
|
@@ -238,9 +240,7 @@ profiles
|
|
|
238
240
|
|
|
239
241
|
Foundry's non-JSX Node runtime is standardized on Node.js 24, `pnpm@11.24.0`, TypeScript `7.0.2`, Oxlint, and Prettier. pnpm is the sole dependency manager and owns the only root workspace and lockfile. The compiler graph must contain TypeScript 7.0.2 only and enforce erasable-only runtime syntax; tracked `.jsx`/`.tsx`, TypeScript 5/6 aliases, `@typescript-eslint`, and formatting plugins that load the TypeScript compiler API are not compatibility paths. Git inventory is reconciled against intentional first-party Oxlint and typecheck file lists; root lint disables nested configs, bans TypeScript suppression comments, and runs a comment-aware tracked-TypeScript native-disable audit before Oxlint. Repository-local Git environment is stripped before that audit or its fixture commands target another root, keeping hook state out of the parent index. The build removes the exact stale `dist` tree before compilation, and `noEmitOnError` prevents TypeScript diagnostics from emitting replacement JavaScript; arbitrary I/O failures are outside that guarantee. Emitted and source runtimes use one trusted-root/active-entry resolver rather than deriving repository state from an output directory or CWD.
|
|
240
242
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
The historical Issue #63 baseline contained 160 tracked JavaScript artifacts: 95 runtime files, 64 tests, and one Prettier config. The migration is complete. A permanent zero-JavaScript ratchet and TS-only compiler/test/lint graph now replace the retired migration ledger. The typed spine was introduced in dependency order:
|
|
243
|
+
The permanent zero-JavaScript ratchet and TypeScript-only compiler, test, and lint graph define the current typed spine:
|
|
244
244
|
|
|
245
245
|
```text
|
|
246
246
|
entrypoint + args
|
|
@@ -28,9 +28,9 @@ checkPaths:
|
|
|
28
28
|
- specs/schemas/execution-context.schema.json
|
|
29
29
|
- specs/import-profiles.json
|
|
30
30
|
- tasks/**
|
|
31
|
-
lastReviewedAt: 2026-09-
|
|
32
|
-
lastReviewedCommit:
|
|
33
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
31
|
+
lastReviewedAt: 2026-09-23
|
|
32
|
+
lastReviewedCommit: 649385e48ad75e91031efec4b592ad55d18cf121
|
|
33
|
+
lastReviewedNote: "Reviewed for Foundry #190: indexed answer history, current per-type assessment coverage and derived recap preserve task provenance and attempt safety."
|
|
34
34
|
related:
|
|
35
35
|
- AGENTS.md
|
|
36
36
|
- WORKFLOW.md
|
|
@@ -76,10 +76,16 @@ Installing or verifying `@tiangong-lca/foundry` does not create, migrate or rela
|
|
|
76
76
|
|
|
77
77
|
Workspace registration retains the complete intended job/source/profile/seed metadata and a content digest. The task-local copies must match it. Account intent and approved grants also have separate immutable workspace registrations. These records contain no passwords, access tokens or session contents.
|
|
78
78
|
|
|
79
|
+
The optional task-start brief belongs to the immutable facade request revision. It keeps bounded original user wording, goal, intended use, scope, deliverables, user constraints and distinct AI assumptions. An absent brief remains absent in older v1 fingerprints. It is projected for the caller and semantic authoring as task context, but it is not a selected data source, a scientific proof, or an authorization grant.
|
|
80
|
+
|
|
79
81
|
Local native-import and CLI context-pack stages use the existing operation plan, receipt and artifact index. A successful repeated stage reuses its checked receipt. Native output is inspected before registration; CLI context runs in a fresh task-contained generation so its file references remain valid. Interrupted unindexed generations are not accepted as completed stages. Neither conversion nor context readiness supplies content acceptance, identity or write authority.
|
|
80
82
|
|
|
81
83
|
Row materialization and assessment also use this local transaction. Materialized rows preserve domain payloads and row metadata, normalize typed API payload wrappers to the CLI-compatible `json` slot, and retain a producer chain to the original selected seed or primary native dataset. Original wrappers remain in the frozen source; bundled copies are excluded from row selection. Assessment reads only selected indexed rows/context, then registers native validation, local QA, queue, curation and authoring outputs. Its report records the owner's resolution base for relative references. Pending work is a current artifact state, not permission to execute a rendered command or dispatch a remote write.
|
|
82
84
|
|
|
85
|
+
The public assessment advances one dataset type per resume and records cumulative coverage. A prior set is reusable only while its row file, schema/QA/curation/authoring artifacts, contract pack, process closure queue and applicable interaction digest still match current registered facts. A changed applicable answer or assumption makes only affected sets due for re-assessment; a task-wide item affects every set. Each new generation binds the previous report and retains source receipts for reused outputs. An `in_progress` report is visible for prompt human follow-up and independent work, but cannot prove finalization or completion.
|
|
86
|
+
|
|
87
|
+
`dataset-workflow-interaction` uses the same metadata lock, immutable output generation and hash-chained index. Its selected input descriptor binds task, actor and current interaction-state SHA; question, raw answer, interpreted decision and AI assumption events are append-only. Its evidence hashes must name frozen sources or indexed task artifacts. A duplicate accepted descriptor reuses its result; stale compare-and-swap or changed selected bytes fail. The current `interaction-state.json` is a task-scoped decision source for assessment and semantic work. It does not mutate the frozen source manifest, grant write authority or clear a consumed attempt. The user-facing `decision_recap` is derived from that state for current and partial results, with `completion_proven` true only after current completion evidence; it is not a second task truth source.
|
|
88
|
+
|
|
83
89
|
Identity preflight runs its qualified, account-bound remote reads before a local transaction captures the resulting files. Each capture has a distinct invocation identity and rechecks current rows under the task lock; the receipt cannot replay a query. A completed identity report binds the current row manifest and its combined preflight index, invalidating earlier assessments until curation consumes that index. Failed reads retain diagnostics and can be retried by a later resume; status remains read-only over stored files. Current-account write admission still requires fresh identity and separate authorization.
|
|
84
90
|
|
|
85
91
|
Facade request indexes map one explicit request id to retained task revisions. The request key binds workspace id plus request id; a revision fingerprint binds the strict task-start spec and ordered canonical source path/bytes/SHA facts. Task ids include the complete request SHA-256 plus the revision ordinal, avoiding a shorter cross-request namespace. A changed source path or content, actor/account, lane/profile/entity scope, seed or preparation creates a predecessor-bound task rather than editing the prior job. Same-fingerprint concurrent starts serialize through the CLI-owned lock and return the same task bytes. The immutable task pointer names one exact revision record; status never locates authority by scanning task directories. If a host stops after publishing a task but before appending its request revision, only the original spec can complete that interrupted registration; a different retry returns `facade_crash_recovery_conflict` and identifies the deterministic task id.
|
|
@@ -34,9 +34,9 @@ checkPaths:
|
|
|
34
34
|
- test/commands/foundry-release-*.test.mts
|
|
35
35
|
- test/unit/runtime-layout.test.mts
|
|
36
36
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
37
|
-
lastReviewedAt: 2026-09-
|
|
38
|
-
lastReviewedCommit:
|
|
39
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
37
|
+
lastReviewedAt: 2026-09-23
|
|
38
|
+
lastReviewedCommit: a836ddaa380a36c8b1466669c1716f6201e9d919
|
|
39
|
+
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."
|
|
40
40
|
related:
|
|
41
41
|
- docs/public-runtime-contract.md
|
|
42
42
|
- docs/runtime-context-contract.md
|
|
@@ -58,6 +58,8 @@ The package depends exactly on public `@tiangong-lca/cli@0.1.19`. Ajv remains a
|
|
|
58
58
|
|
|
59
59
|
`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.
|
|
60
60
|
|
|
61
|
+
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.
|
|
62
|
+
|
|
61
63
|
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.
|
|
62
64
|
|
|
63
65
|
## Managed process admission
|
|
@@ -312,7 +314,7 @@ Native handshake success is not minimum-host or clean-machine qualification. Cur
|
|
|
312
314
|
|
|
313
315
|
`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.
|
|
314
316
|
|
|
315
|
-
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.19 runtime identity, shebang/bin, source/installed operation equivalence, arbitrary Unicode CWD, read-only package bytes, isolated workspace writes and all six facade operations. It also proves that internal commands, modified/extra/linked files, a lifecycle-bearing manifest, a `darwin-x64` descriptor and a package copied without C1 fail closed.
|
|
317
|
+
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.19 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.
|
|
316
318
|
|
|
317
319
|
These checks qualify a local candidate tarball. They do not prove registry provenance, public component download, native TIDAS availability on every host or a complete Node+CLI+Foundry+TIDAS component. Those are W08 release gates.
|
|
318
320
|
|
|
@@ -32,9 +32,9 @@ checkPaths:
|
|
|
32
32
|
- test/scenarios/foundry-facade-request-store.test.mts
|
|
33
33
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
34
34
|
- docs/public-runtime-contract.md
|
|
35
|
-
lastReviewedAt: 2026-09-
|
|
36
|
-
lastReviewedCommit:
|
|
37
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
35
|
+
lastReviewedAt: 2026-09-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.
|
|
@@ -68,6 +68,8 @@ Input changes create an explicit new revision with retained history. A new revis
|
|
|
68
68
|
|
|
69
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
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.
|
|
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
|
|
|
73
75
|
Status and resume resolve a task only through its immutable task pointer and request revision, then apply the W04 task-store checks. Wrong actor and missing task return non-leaking envelopes. Files merely placed under a task directory are not artifacts or completion proof. An explicit local preparation retains the deterministic cleanup owner. Without that preparation, a packaged-import request first invokes qualified native conversion, then the exact CLI's contract-context preparation; a source-evidence request begins with contract context. Each resume advances one registered preparation, execution, or readback stage. Other work remains an ordered human action or a separately registered trusted command action; the facade does not invent or discover CommandSpecs by scanning files.
|
|
@@ -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.
|
|
@@ -146,6 +150,14 @@ Finalization exposes per-scope `authorization_inputs` with independently compute
|
|
|
146
150
|
|
|
147
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.
|
|
148
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
|
+
|
|
149
161
|
## Single-result envelope
|
|
150
162
|
|
|
151
163
|
### Semantic input
|
|
@@ -40,9 +40,9 @@ checkPaths:
|
|
|
40
40
|
- test/scenarios/runtime-workspace.test.mts
|
|
41
41
|
- test/scenarios/foundry-execution-admission.test.mts
|
|
42
42
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
43
|
-
lastReviewedAt: 2026-09-
|
|
44
|
-
lastReviewedCommit:
|
|
45
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
43
|
+
lastReviewedAt: 2026-09-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
|
|
@@ -74,6 +74,8 @@ The TIDAS expectation admits only `linux-x64`, `linux-arm64`, `darwin-arm64` and
|
|
|
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 Foundry #
|
|
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
|