@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
package/README.md
CHANGED
|
@@ -151,21 +151,24 @@ checkPaths:
|
|
|
151
151
|
- docs/foundry-task-contracts.md
|
|
152
152
|
- docs/incremental-change-set-contract.md
|
|
153
153
|
- docs/topology-convergence-contract.md
|
|
154
|
+
- docs/final-delivery-promotion-contract.md
|
|
154
155
|
- specs/import-profiles.json
|
|
155
156
|
- test/unit/foundry-entry-closure-migration.test.mts
|
|
156
157
|
- test/unit/foundry-runtime-environment.test.mts
|
|
157
158
|
- test/unit/lint-suppression-audit.test.mts
|
|
158
159
|
- test/unit/zero-javascript-ratchet.test.mts
|
|
159
160
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
160
|
-
lastReviewedAt:
|
|
161
|
-
lastReviewedCommit:
|
|
162
|
-
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."
|
|
163
164
|
---
|
|
164
165
|
|
|
165
166
|
# TianGong LCA Data Foundry
|
|
166
167
|
|
|
167
168
|
The ordinary user entry is the independently installed [TianGong Foundry skill](https://github.com/tiangong-lca/agent-skills/tree/main/foundry-tidas-import). Its qualified release lock selects the managed runtime for a separate user workspace. The internal authoring role is maintained in the same Skills repository and loads for current semantic work items. This source checkout retains the developer commands and runtime owners described below; it carries no second maintained copy of either skill.
|
|
168
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
|
+
|
|
169
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.
|
|
170
173
|
|
|
171
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.
|
|
@@ -213,9 +216,7 @@ Public project/client settings may be blank for the official Production profile;
|
|
|
213
216
|
|
|
214
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.
|
|
215
218
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
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.
|
|
219
220
|
|
|
220
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.
|
|
221
222
|
|
|
@@ -243,7 +244,7 @@ The runtime wave migrates `foundry-runtime-utils.ts`, the high-fan-in helper use
|
|
|
243
244
|
|
|
244
245
|
The location wave migrates `location-quality-utils.ts`, which feeds bundle sampling and location/finalize authoring through the Foundry entrypoint. Characterization pins classification/location command strings and artifacts, installed schema code loading, fallback and recursive location target discovery, depth-first/array order, valid/blocker counts, queue context, blocker envelopes and invalid-input errors. It remains fail-closed and zero-any; inventory moves from 127 to 126.
|
|
245
246
|
|
|
246
|
-
The prewrite wave migrated `prewrite-cleanup.ts` as a deterministic evidence boundary and initially froze the inherited `Date.parse` behavior. Issue #69 supersedes that rollover: eight runtime consumers now share one strict metadata contract. Full timezone-qualified timestamps keep prior UTC bytes for valid inputs; valid offsets that would cross outside the four-digit UTC year grammar keep exact source bytes. Impossible Gregorian dates, invalid clocks, partial/sentinel/non-string values, or invalid offsets block the entire cleanup before any
|
|
247
|
+
The prewrite wave migrated `prewrite-cleanup.ts` as a deterministic evidence boundary and initially froze the inherited `Date.parse` behavior. Issue #69 supersedes that rollover: eight runtime consumers now share one strict metadata contract. Full timezone-qualified timestamps keep prior UTC bytes for valid inputs; valid offsets that would cross outside the four-digit UTC year grammar keep exact source bytes. Impossible Gregorian dates, invalid clocks, partial/sentinel/non-string values, or invalid offsets block the entire cleanup before any annual-supply/proof/trace/redaction transform or cleaned-row output. Bundle materialization preserves invalid and timezone-less values for that gate, the CLI exits nonzero, and post-authoring finalize completes parent cleanup before nested support finalization. On failure, cleanup/finalize never delete a pre-existing artifact: retained default/downstream paths become blockers, explicit outputs remain untouched and unreferenced, the blocked ledger is written, and no CommandSpec is emitted. A repaired rerun uses a new output path or deliberate operator-managed archival.
|
|
247
248
|
|
|
248
249
|
The queue-context wave migrates `import-curation/internal/workflow-queue-context.ts`, a five-consumer authoring-evidence boundary. Characterization pins annual-supply action envelopes, manifest task order and duplicate-map behavior, exact-identity then id-only selection, queue-relative paths, closure dependency/support order, JSONL filtering and last-row binding, identity-preflight path precedence, and native filesystem/parse/invalid-dependency errors. It remains zero-any and fail-closed; inventory moves from 125 to 124.
|
|
249
250
|
|
|
@@ -267,7 +268,7 @@ Wave 22 follows the real dependency topology rather than treating connected modu
|
|
|
267
268
|
|
|
268
269
|
Wave 23 migrates the authoring facade and runner layer above that SCC. `authoring-task-workflow.ts` and `authoring-patch-workflow.ts` remain pure live-reference facades; `authoring-packages.ts` preserves gate-entry/task order, content-addressed snapshot names, original package bytes, task directories and exact manifest/JSONL output; `patch-collect.ts` preserves task/blocker classification, patch-file/set/operation order, exact ready batch bytes and native manifest errors. Only a blocker-free collection writes a fresh batch. Inventory moves 105→101 without changing help, profiles, Golden artifacts or remote-write authority.
|
|
269
270
|
|
|
270
|
-
Wave 24 B3 migrates the curation planning boundary in topology order. `curation-gate-workflow.ts` remains a pure live-reference aggregate; `curation-gate.ts` preserves blocked entity, schema/QA/context/action ordering, authoring-package hashes and report/process aliases; `curation-cleanup.ts` preserves deep-cloned row order, exact JSONL/report bytes, annual
|
|
271
|
+
Wave 24 B3 migrates the curation planning boundary in topology order. `curation-gate-workflow.ts` remains a pure live-reference aggregate; `curation-gate.ts` preserves blocked entity, schema/QA/context/action ordering, authoring-package hashes and report/process aliases; `curation-cleanup.ts` preserves deep-cloned row order, exact JSONL/report bytes, annual-supply evidence and trace transforms, source-only-output proof, redaction counts and native failures. Inventory moves 101→98 without changing profiles, command help, Golden artifacts, Worldsteel semantics or remote-write authority.
|
|
271
272
|
|
|
272
273
|
Wave 24 migrates five command factories in three RED/GREEN families. `tasks.ts` and `import-completion.ts` preserve queue/file order, full-context completion gates, task moves and exact Markdown/JSON bytes. `commit-handoff.ts` and `identity-decision-task.ts` preserve final-row artifact SHA/bytes, authoritative CommandSpec argv, package snapshots, action encounter/dedupe order and fail-closed blockers. `support-cache.ts` preserves auth-then-read request order, pagination, public cache row order, unit mapping/manual-block order and native errors; tests stub HTTP locally and read no credentials. Inventory moves 101→96 without changing help, remote-write mode, profiles, or production authority.
|
|
273
274
|
|
|
@@ -341,9 +342,9 @@ pnpm case:production:contact-draft -- \
|
|
|
341
342
|
|
|
342
343
|
The runner accepts no API key or alternate CLI path on argv. It reads only `TIANGONG_LCA_API_BASE_URL`, `TIANGONG_LCA_SUPABASE_PUBLISHABLE_KEY`, and `TIANGONG_LCA_TEST_API_KEY`; the test key exists only in the child environment. The env file must be a regular non-symlink file with POSIX mode `0600` or stricter and, when it is inside this repository, must be git-ignored. The new output directory must also be inside this repository, git-ignored, and reached without a symlinked parent.
|
|
343
344
|
|
|
344
|
-
This production lane is POSIX-only. Windows execution fails closed until the runner can verify a user-exclusive ACL; Windows CI covers that refusal rather than a live case. On POSIX, the runner snapshots the exact installed CLI 0.1.
|
|
345
|
+
This production lane is POSIX-only. Windows execution fails closed until the runner can verify a user-exclusive ACL; Windows CI covers that refusal rather than a live case. On POSIX, the runner snapshots the exact installed CLI 0.1.19 package inside its pnpm dependency island, hashes and rechecks the full pnpm installation plus Foundry source/build/lock facts before every child boundary, executes from a clean directory with `shell=false`, fsyncs create-only private evidence, and publishes a content-addressed case manifest only after the runtime snapshot is removed. Any detected secret in stdout, a report, or a sidecar artifact fails the case and leaves only redacted failure evidence. The created contact remains isolated, unreviewed, and unpublished under the authenticated test account for later case evidence; the lane never performs review/publish transitions or mutates foreign/public/shared rows.
|
|
345
346
|
|
|
346
|
-
Credential-scoped commands use `pnpm account:run -- <profile> -- <executable> [args...]`. The ignored profile supplies both the expected Supabase project ref and canonical user UUID. The wrapper resolves the installed CLI 0.1.
|
|
347
|
+
Credential-scoped commands use `pnpm account:run -- <profile> -- <executable> [args...]`. The ignored profile supplies both the expected Supabase project ref and canonical user UUID. The wrapper resolves the installed CLI 0.1.19, obtains a fresh intent-bound `auth identity-receipt`, and then executes the requested argv without a shell and without inheriting unrelated parent environment variables. Authentication bypass flags are unsupported.
|
|
347
348
|
|
|
348
349
|
Issue #70 consumes CLI 0.1.3 through its supported `./batch` and `./auth-identity-receipt` subpaths. The production identity-preflight path uses the public strict parser; deterministic receipt construction exists only in a local test fixture, and the toolchain ratchet rejects every `@tiangong-lca/cli/dist/src/**` import. pnpm's 1,440-minute maturity gate remains enabled; the exact 0.1.3 exception is bound to the release already verified by tag, Sigstore/Rekor provenance, registry integrity, and clean public consumers.
|
|
349
350
|
|
|
@@ -468,7 +469,7 @@ node scripts/foundry.ts dataset-process-scope-run \
|
|
|
468
469
|
|
|
469
470
|
`dataset-library-decisions-apply` writes `<run-dir>/library-resolution/blocked-scope-report.json` every time it evaluates scope closure. `dataset-process-scope-run` writes `<run-dir>/process-scope-run/blocked-scope-report.json` for runner-level deferrals such as non-ready scopes.
|
|
470
471
|
|
|
471
|
-
`annualSupplyOrProductionVolume` remains a required process field. When source data does not provide it,
|
|
472
|
+
`annualSupplyOrProductionVolume` remains a required process field. Foundry preserves real evidence — a single object or a language array — byte-semantically and in original element order, and never invents a quantity from a reference flow or a default unit. When source data does not provide it, deterministic cleanup normalizes the field to the supported empty array `[]` and records a row-level evidence gap in `annual_supply_evidence_gaps` rather than AI trace deferral; the historical `9999 missing-data-sentinel/year` value survives only as a read-only recognition marker for rows written by earlier rounds. Downstream schema, authoring, curation, and write gates own rejecting or repairing what cleanup leaves non-importable.
|
|
472
473
|
|
|
473
474
|
For process rows whose source exchange list is truly output-only, pass the original converted source rows to cleanup with `--source-rows-file`. Foundry may then write deterministic `sourceExchangeCompleteness` proof only when the source row is output-only and the final row preserves the non-flow-reference exchange signature; otherwise AI `source_trace_verified` evidence or exchange repair is still required.
|
|
474
475
|
|
|
@@ -524,6 +525,7 @@ Installed shared runtime skills such as `.agents/skills/tiangong-kb-sci-search/`
|
|
|
524
525
|
- `specs/import-profiles.json`: data-driven import profiles.
|
|
525
526
|
- `docs/foundry-task-contracts.md`: minimal task, source, seed, checkpoint, and artifact ledger contracts.
|
|
526
527
|
- `docs/execution-capsule-contract.md`: reusable offline stage, exact predecessor lineage, content-addressed boundary admission, CAS evidence, and immutable seal contract.
|
|
528
|
+
- `docs/final-delivery-promotion-contract.md`: reusable final-delivery content, algebra, workbook, redaction, independent-review, and detached-seal contract.
|
|
527
529
|
- `docs/runtime-skill-management.md`: `pnpm dlx skills` runtime dependency contract.
|
|
528
530
|
- `docs/import-profiles/bafu/`: BAFU profile context and constraints.
|
|
529
531
|
- `tasks/`: lightweight task queue and task templates.
|
package/docs/architecture.md
CHANGED
|
@@ -15,6 +15,7 @@ checkPaths:
|
|
|
15
15
|
- docs/architecture.md
|
|
16
16
|
- docs/foundry-ai-navigation.md
|
|
17
17
|
- docs/foundry-command-surface.md
|
|
18
|
+
- docs/final-delivery-promotion-contract.md
|
|
18
19
|
- AGENTS.md
|
|
19
20
|
- README.md
|
|
20
21
|
- WORKFLOW.md
|
|
@@ -151,9 +152,9 @@ checkPaths:
|
|
|
151
152
|
- test/unit/foundry-runtime-environment.test.mts
|
|
152
153
|
- test/unit/lint-suppression-audit.test.mts
|
|
153
154
|
- docs/incremental-change-set-contract.md
|
|
154
|
-
lastReviewedAt:
|
|
155
|
-
lastReviewedCommit:
|
|
156
|
-
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."
|
|
157
158
|
---
|
|
158
159
|
|
|
159
160
|
# Architecture
|
|
@@ -166,6 +167,8 @@ Migration transfer planning is governed by [the workspace migration contract](wo
|
|
|
166
167
|
|
|
167
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`.
|
|
168
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
|
+
|
|
169
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.
|
|
170
173
|
|
|
171
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.
|
|
@@ -176,7 +179,7 @@ The public task facade delegates sealed owner execution to `foundry-workflow-exe
|
|
|
176
179
|
|
|
177
180
|
## OAuth identity boundary
|
|
178
181
|
|
|
179
|
-
Foundry selects a private session reference and exact project/user intent, then calls the published CLI for a fresh server-verified identity receipt. It validates TTL, canonical hash, expected identity and current OAuth session metadata without owning login, password decoding, token exchange or refresh. Candidate Golden execution uses an isolated Git-visible source snapshot so ignored operator state cannot change qualification. Support-cache transport is owned by the public CLI export. Foundry validates the fresh identity, project, public-state scope, completion marker, artifact paths and hashes, then summarizes rows and atomically replaces only the requested local cache. The CLI runs in a private temporary cwd with an allowlisted OAuth environment; the operator checkout .env and unrelated secrets cannot enter that child. Exact public CLI 0.1.
|
|
182
|
+
Foundry selects a private session reference and exact project/user intent, then calls the published CLI for a fresh server-verified identity receipt. It validates TTL, canonical hash, expected identity and current OAuth session metadata without owning login, password decoding, token exchange or refresh. Candidate Golden execution uses an isolated Git-visible source snapshot so ignored operator state cannot change qualification. Support-cache transport is owned by the public CLI export. Foundry validates the fresh identity, project, public-state scope, completion marker, artifact paths and hashes, then summarizes rows and atomically replaces only the requested local cache. The CLI runs in a private temporary cwd with an allowlisted OAuth environment; the operator checkout .env and unrelated secrets cannot enter that child. Exact public CLI 0.1.19 and reviewed TIDAS 0.2.x/0.3.x expectations are independently selected and re-observed through the W04 qualification boundary. F1 component provenance and package qualification remain W06/W08 gates.
|
|
180
183
|
|
|
181
184
|
## Qualified execution boundary
|
|
182
185
|
|
|
@@ -237,9 +240,7 @@ profiles
|
|
|
237
240
|
|
|
238
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.
|
|
239
242
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
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:
|
|
243
244
|
|
|
244
245
|
```text
|
|
245
246
|
entrypoint + args
|
|
@@ -269,7 +270,7 @@ The high-fan-in runtime utility boundary is native TypeScript and owns only Foun
|
|
|
269
270
|
|
|
270
271
|
The typed location-quality boundary reads the installed CLI location vocabulary and discovers only schema/fallback-declared location fields. It creates local authoring commands, queue context and blockers; the CLI owns classification lookup/apply and the schema package owns valid codes. Missing schema evidence yields an empty valid-code map rather than approving unknown values, and invalid targets remain blocking before finalize.
|
|
271
272
|
|
|
272
|
-
The typed prewrite-cleanup boundary performs deterministic transformations only after authoring evidence exists. It first plans datetime handling across the complete batch: full timezone-qualified syntax, Gregorian calendar, clock, and offset components must validate before any update is applied. A single invalid value returns ordered blockers, no cleaned rows, and zero sentinel/proof/trace/namespace/redaction counts. Only a blocker-free plan may proceed to required-field
|
|
273
|
+
The typed prewrite-cleanup boundary performs deterministic transformations only after authoring evidence exists. It first plans datetime handling across the complete batch: full timezone-qualified syntax, Gregorian calendar, clock, and offset components must validate before any update is applied. A single invalid value returns ordered blockers, no cleaned rows, and zero sentinel/proof/trace/namespace/redaction counts. Only a blocker-free plan may proceed to required-field annual-supply evidence preservation and unknown-evidence normalization, UTC normalization, source/final exchange proof, import-only trace externalization, namespace repair and local locator redaction; four-digit year-boundary offset values remain byte-preserved when a UTC projection would require an extended year. Source and final exchange signatures exclude only permitted flow-reference rewrites; their array and object order remains content-addressed. It cannot invent source evidence or grant write authority.
|
|
273
274
|
|
|
274
275
|
The typed workflow-queue-context boundary reads local queue manifests, task rows, closure dependencies and optional authoring JSONL indexes without changing their encounter order or evidence bytes. It attaches that evidence to curation packages using exact-version then id-only lookup and retains native missing, malformed and invalid-dependency failures; it does not execute queue work or expand remote-write authority.
|
|
275
276
|
|
|
@@ -293,7 +294,7 @@ The typed decision-full-context boundary evaluates existing classification, loca
|
|
|
293
294
|
|
|
294
295
|
The typed authoring facades expose that SCC without wrapping or duplicating it. The package runner copies immutable content-addressed authoring snapshots and writes ordered local task manifests; the patch runner classifies local task outputs and writes an ordered batch only after every blocker check passes. Both are filesystem-only Foundry adapters and neither applies patches, invokes the CLI, or grants mutation authority.
|
|
295
296
|
|
|
296
|
-
The typed curation planning boundary follows those authoring layers. `curation-gate-workflow.ts` is a live-reference aggregate; `curation-gate.ts` reads local rows and evidence into ordered blockers, authoring packages and reports; `curation-cleanup.ts` deep-clones rows, runs the batch-wide strict datetime plan, and only then performs deterministic
|
|
297
|
+
The typed curation planning boundary follows those authoring layers. `curation-gate-workflow.ts` is a live-reference aggregate; `curation-gate.ts` reads local rows and evidence into ordered blockers, authoring packages and reports; `curation-cleanup.ts` deep-clones rows, runs the batch-wide strict datetime plan, and only then performs deterministic annual-supply, trace, proof and redaction transforms. Its blocked report carries a null cleaned path and never deletes pre-existing bytes; retained default output becomes an explicit blocker, while explicit output remains untouched and unreferenced. Their byte/order contracts are local Foundry evidence only and do not execute or authorize a database mutation.
|
|
297
298
|
|
|
298
299
|
The typed command-owner layer now includes filesystem task/completion aggregation, commit handoff and identity task preparation, and canonical support-cache refresh/autofill. These factories keep their injected/local orchestration boundaries: task/report bytes and order remain content-stable, handoff only emits artifact-bound CommandSpecs, identity tasks only snapshot and package local evidence, and support refresh performs authenticated read-only queries. No factory implements CLI mutation, database semantics, review, or publication.
|
|
299
300
|
|
|
@@ -343,7 +344,7 @@ Build and test resolution must be worktree-local. A clean arbitrary Git worktree
|
|
|
343
344
|
|
|
344
345
|
Cross-platform characterization is also explicit: the Golden harness compares normalized outputs to a non-`HEAD` merge-base, performs recursive comparison in Node rather than calling an external Unix utility, and uses full Git history in CI. Script-backed executable overrides are represented as an executable plus argv prefix and run through Node on macOS, Linux, and Windows. The root `.gitattributes` fixes text files to LF while allowing Windows launcher exceptions, preventing checkout policy from masquerading as format drift.
|
|
345
346
|
|
|
346
|
-
The first credential-bearing entrypoint on that spine is `scripts/with-lca-account.ts`. It does not authenticate against Supabase itself. It resolves the exact installed CLI 0.1.
|
|
347
|
+
The first credential-bearing entrypoint on that spine is `scripts/with-lca-account.ts`. It does not authenticate against Supabase itself. It resolves the exact installed CLI 0.1.19, requests `auth identity-receipt` with both expected project and user assertions, accepts only a fresh intent-bound forced signin, and then launches the requested executable plus argv with `shell:false` and a restricted environment. The CLI owns session and live identity behavior; Foundry owns the profile/thread intent checks and safe process boundary.
|
|
347
348
|
|
|
348
349
|
`scripts/lib/identity-preflight-proof.ts` imports the strict parser from the public `@tiangong-lca/cli/auth-identity-receipt` subpath. `test/fixtures/auth-identity-receipt.ts` is the sole test-only wire-fixture owner and produces bytes that must pass that public parser. No production module or fixture may load CLI `dist/src/**`; the installed-package contract also exercises public batch scheduling/run-lock behavior and proves the private path remains closed.
|
|
349
350
|
|
|
@@ -377,6 +378,7 @@ The handoff execution boundary is typed and content-addressed. `scripts/lib/foun
|
|
|
377
378
|
- verify artifacts point to the same rows scope
|
|
378
379
|
- accept identity/classification/location evidence across deterministic row transforms such as source/contact rewrites, canonical support rewrites, identity reference rewrites, unresolved-exchange externalization, and cleanup
|
|
379
380
|
- reconcile deterministic source-only-output exchange proofs from cleanup against final-row `sourceExchangeCompleteness` traces
|
|
381
|
+
- validate completed delivery packages against manifest-bound content, row algebra, workbook, redaction, and independent-review contracts, then emit an offline detached seal only when every finding is zero
|
|
380
382
|
- generate completion reports
|
|
381
383
|
|
|
382
384
|
6. Whole-library scope orchestration
|
|
@@ -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.
|
|
@@ -132,12 +138,18 @@ Account registration optionally stores `account_mode` from explicit task/host in
|
|
|
132
138
|
|
|
133
139
|
An expected account may be selected after local preparation. The first selection is registered as project/user intent; subsequent disagreement is rejected. A missing task-local account file may only be restored from its existing workspace registration. This is intent, not proof of authentication.
|
|
134
140
|
|
|
135
|
-
`verifyFoundryRuntimeIdentity` invokes the exact installed CLI through executable/argv in a fresh private CWD with a restricted environment. The CLI owns OAuth/session refresh and server identity verification. Returned proof is immutable, process-local and bound to workspace/task/actor/runtime, with a 60-second freshness check at permission admission. Serialized proof is not reusable authority. Headless mode uses the CLI's existing explicit target and process-only access token, with cache disabled and no token persistence. CLI 0.1.
|
|
141
|
+
`verifyFoundryRuntimeIdentity` invokes the exact installed CLI through executable/argv in a fresh private CWD with a restricted environment. The CLI owns OAuth/session refresh and server identity verification. Returned proof is immutable, process-local and bound to workspace/task/actor/runtime, with a 60-second freshness check at permission admission. Serialized proof is not reusable authority. Headless mode uses the CLI's existing explicit target and process-only access token, with cache disabled and no token persistence. CLI 0.1.17 reports no token-expiry timestamp for that mode; Foundry does not invent one or claim a separately verified token lifetime.
|
|
136
142
|
|
|
137
143
|
`registerFoundryTaskAuthorization` is an explicit host approval operation. It requires fresh identity, current task/input lineage, a valid W03 grant, and independently selected evidence facts supplied by the trusted caller. The grant cannot select its own evidence paths. Each original evidence file is rechecked and copied into an immutable task snapshot; the grant and selection are registered in workspace state. Updating `authorization.json` uses compare-and-swap against its prior digest and preserves historical grants. Unknown legacy authorization files are not overwritten.
|
|
138
144
|
|
|
139
145
|
`loadFoundryTaskAuthorization` rechecks live identity, task registration, input lineage, active pointer/registration, grant expiry/scope and both evidence snapshots and originals. A previous grant cannot be relabeled for changed or derived inputs. Reusing its approval requires a qualified, process-local derivation that proves ancestry, changes only the input digest, retains authority bounds and records `authorization-derivation.v1` evidence. The active parent pointer is checked around preparation and captured for later compare-and-swap. A separately reviewed approval may instead register the exact derived bytes directly. Login, task creation, local preparation and an empty grant never grant publication, deletion or restricted write actions.
|
|
140
146
|
|
|
147
|
+
A repair scope (`input_kind: repair_rows`) has no finalization: its authority is the registered preparation report. The approval descriptor names that report digest, carries the selected native execution contract, and is admitted only for Process rows of the locked `generic` profile. Activation re-reads the exact registered report entry, requires one prepared dispatching-write-free scope (`status: prepared`, zero remote writes, not publication ready), re-derives the native contract's canonical digest over the unchanged candidate rows, matches every reported action against the signed contract, and binds the grant to the candidate bytes as the approved input scope. The sealed stage writes a repair handoff plan whose commit and post-write-verify CommandSpecs bind the candidate rows and that contract, then seals the execution capsule for the reviewed commit-handoff command. State projection keeps such an approval current only while the same preparation entry, active pointer and expiry hold, and a no-change or blocked preparation never reaches authorization. Owner execution request preparation, dispatch and closeout remain separate stages. Repair execution re-admits the registered preparation before dispatch and readback. Its verified result binds the same preparation, the consumed native contract receipt and exact root/reference proof, preserving false publication readiness. The source candidate may remain an independently captured selected input; only that exact input fact can use the source-input verification path, while receipt, readback and all other result files remain task-contained outputs.
|
|
148
|
+
|
|
149
|
+
Repair reference proofs bind complete before/candidate payload hashes and every reference occurrence to the CLI JSONL checks. Exact existing historical references may be retained with their raw freshness blockers and a separately indexed integrity proof; a newer version never authorizes reference retargeting. Both preflight and closeout preserve false publication readiness, exact input-path binding and strict root owner/state/content checks. Normal authoring reference-quality policy is unchanged.
|
|
150
|
+
|
|
151
|
+
A repair revision may follow an attempted predecessor only through the bounded no-dispatch successor rule: the successor names the predecessor task and the exact digest of that predecessor's producer-registered terminal CLI report, and the predecessor's own hash-chained evidence must prove an unresolved definite failure with zero executed actions, zero consumed CLI attempts, no unknown outcome, only definite failed or blocked rows, one consumed scope bound to that report, and the same request, actor, account, lane, generic profile and entity identities/versions. The successor must submit genuinely different candidate bytes on new immutable paths, inherits no grant, and is re-derived on every start, status and resume read, so a descendant can never be admitted by one path and refused by another. Every other predecessor state keeps the original readback-required refusal.
|
|
152
|
+
|
|
141
153
|
Before a restricted child handoff, the runtime stores a content-addressed `execution-context.v1` under task evidence. A new process must reconstruct the context, qualification and identity, then recheck source ancestry, final bytes, current authorization/QA exceptions, owner CLI path and CommandSpec operation semantics. Only the verified spec is returned to the existing no-replay executor. The execution context never carries credentials and never clears or retries an attempt.
|
|
142
154
|
|
|
143
155
|
The public facade projects preparation, sealed approval, owner execution and independent readback through the result envelope. Before dispatch, the dedicated execution-consume operation registers an immutable `attempts/owner-v1/<scope>/consumed.json` output with producer evidence; other local operations cannot write task-control paths. Recognized consumed requests resume readback only, while unknown attempts remain blocked. Completion requires a current producer-backed completion report or verified current write scopes plus independent verification of all current canonical reference partitions. Inspect revalidates completion, execution requests, consumed markers, observations, owner results and canonical reference verification results against their exact producer plans, receipts and current bytes. A forged index entry borrowing another operation receipt cannot prove completion. No child command is inferred from a directory name.
|
|
@@ -228,7 +228,7 @@ related:
|
|
|
228
228
|
- 可见业务字段不得保留导入占位或源系统噪声:`xx`、`{GLO}` 这类未拆分 name token、`Not declared in source package`、`Not specified by the BAFU ecoSpold1 source.`、`No ... BAFU ecoSpold1 source.`、本地路径、zip 内路径等必须进入 Foundry AI authoring action item。若字段确实未知,用户可见文本只写 `Not specified` 或按 schema 省略;BAFU/ecoSpold 只作为 provenance/evidence,不作为业务字段 filler。
|
|
229
229
|
- BAFU 的 full-context AI completion 要求写入规划前完成内容字段饱和。`tidasimport:sourceTrace`、TIDAS schema/YAML、分类/location schema 或 profile context 能证明正式字段值时,必须在同一次 AI authoring package 中尽量补全,不能先写库再靠人工巡检补。典型字段包括 process `common:synonyms`、`percentageSupplyOrProductionCovered`、`uncertaintyAdjustments`,flow `locationOfSupply`、`name.flowProperties`、source-backed `common:generalComment`,source `sourceDescriptionOrComment` 中的作者/年份/标题/出版地/出版社/卷号,以及 FOEN/BAFU contact 的官网、邮箱、电话、地址和 central contact point。无法证明或候选冲突时才 block/review;可证明字段缺失时 curation gate 必须阻断。
|
|
230
230
|
- Flow `locationOfSupply` 的证据不只来自 flow 自身已有 geography 字段。`name.mixAndLocationTypes` 中的明确 location code、引用该 flow 的 process `locationOfOperationSupplyOrProduction.@location`、exchange `location` 以及 source trace 中的地理字段都必须进入 flow authoring context;能证明为 TIDAS/ILCD location code 时必须补齐,候选冲突或非 code 描述才进入 location authoring/review。
|
|
231
|
-
- `common:other` 只能保存不能安全推断的 provenance/trace,不得替代 schema 必填字段或正式名称、functional unit、classification、reference flow 等业务字段。只有 action item 的 `allowed_resolution_modes` 明确包含 `deferred_to_common_other` 时,才允许延期;functional unit / classification / reference flow 这类正式字段必须补 evidence-backed 真值或保持阻塞。`annualSupplyOrProductionVolume` 是 schema 必填项,不得转入 `common:other
|
|
231
|
+
- `common:other` 只能保存不能安全推断的 provenance/trace,不得替代 schema 必填字段或正式名称、functional unit、classification、reference flow 等业务字段。只有 action item 的 `allowed_resolution_modes` 明确包含 `deferred_to_common_other` 时,才允许延期;functional unit / classification / reference flow 这类正式字段必须补 evidence-backed 真值或保持阻塞。`annualSupplyOrProductionVolume` 是 schema 必填项,不得转入 `common:other`;真实值(单对象或语言数组)按字节语义与原始顺序保留,不得因数值与历史标记相同而改写,也不得从 reference flow 或默认 unit 造量;若原始数据确实缺少年供应量,Foundry deterministic cleanup 将其规范为受支持的未知表示 `[]`,并在 `annual_supply_evidence_gaps` 中写入绑定了行身份、字段与前后 payload SHA 的证据缺口,绝不再写入伪造数量。历史值 `9999 missing-data-sentinel/year` 仅作为只读历史识别标记,用于规范化早期写入的行。允许 `resolution.mode=deferred_to_common_other` 的 action item 必须写入 `common:other.tiangongfoundry:unresolvedTrace`,且包含 `status`、`action_item_code`、`blocked_path`、`reason`、结构化 `evidence` 和 `next_action`;`evidence` 必须包含 source 以及 quote / trace / path / citation 等可追踪指针。
|
|
232
232
|
- 最终 rows 中的 `common:other.tiangongfoundry:unresolvedTrace` 和 `common:other.tiangongfoundry:sourceExchangeCompleteness` 必须由同一行的 AI patch evidence,或由 cleanup report 为同一 final row 生成的确定性 proof 放行;手工预置或 identity/classification/location 决策不能替代该证据。其中 unresolved trace 使用 `resolution.mode=deferred_to_common_other` 并关闭匹配 action item;source-only-output 接受使用 `resolution.mode=source_trace_verified`,或由 `dataset-curation-cleanup --source-rows-file <source rows>` 证明源 process row 本身 Output-only 且最终 row 保留非 `referenceToFlowDataSet` exchange signature。Commit handoff 必须先从最终 rows 推导这些 trace,并逐条匹配 mutation/finalize 保留的 trace queue JSONL;stale/extra/missing trace 都不能生成可执行 commit 命令。Post-write closeout 必须在读回验证后复核同一覆盖关系。
|
|
233
233
|
- process / flow / lifecycle model 的 `name` 子字段是名称片段,不是 provenance 或字段缺失说明,不得写入 `源数据未声明...`、`no separate ... was declared...` 这类句子。若源数据未单独给出某个 name 子字段,应从源全名、分类、地理代码、技术描述和来源字段中做可辩护拆分;仍无法确定时形成 review blocker,或在非 name 的 provenance 字段说明,不得用说明句占位。
|
|
234
234
|
- 所有 `name.*` LangText 中不得出现 `xx` / `xxx` / `XX` 等源数据标记或导入标记,不得出现 `TIDAS_IMPORT_PLACEHOLDER`、trace-only 文本、本地路径,也不得出现中文分号 `;` 或英文分号 `;`。TIDAS/ILCD name 子字段应使用逗号分隔的技术短语,不能使用分号连接说明句。
|
|
@@ -160,7 +160,7 @@ Flow curation must include identity matching, classification, source-language na
|
|
|
160
160
|
|
|
161
161
|
### 6. Process Curation
|
|
162
162
|
|
|
163
|
-
Process curation must consume finalized flow and support records. It must refresh global references before validation instead of failing late on stale refs. Required process fields such as reference year and annual supply/production must be filled from traceable source evidence or an explicitly documented package-level fallback rule. For `annualSupplyOrProductionVolume`, missing source evidence
|
|
163
|
+
Process curation must consume finalized flow and support records. It must refresh global references before validation instead of failing late on stale refs. Required process fields such as reference year and annual supply/production must be filled from traceable source evidence or an explicitly documented package-level fallback rule. For `annualSupplyOrProductionVolume`, real source evidence — a single object or a language array — is preserved byte-semantically and in original element order, and no quantity is ever invented from a reference flow or a default unit. Genuinely missing source evidence is normalized by Foundry's deterministic cleanup to the supported empty array `[]` with a bound row-level evidence gap rather than `common:other` deferral or a fabricated placeholder; the historical `9999 missing-data-sentinel/year` value remains only as a read-only recognition marker for rows written by earlier rounds.
|
|
164
164
|
|
|
165
165
|
CLI process/flow/lifecyclemodel QA is a deterministic QA report, not the profile policy decision point. Foundry owns dataset curation, AI authoring packages, deterministic prewrite cleanup, waiver decisions, and final prewrite status. The BAFU full-context gate applies to flow/process/lifecyclemodel scopes; contact and true-source rows remain governed by source/contact policy, while task-authorized account-local FP/UG require a separate candidate registry with exact owner/state, unit-scale, closure, immutable-plan, audit, and readback proof. Curation must still use SDK schema/YAML, classification/location tasks, exact-payload identity preflight, and deterministic patch/cleanup lineage. Before commit, the mutation manifest must prove the exact reference closure: public support resolves through the public canonical cache; account-local FP/UG resolve through the same-owner `state_code=0` candidate registry and remote verify; mixed visibility or cross-owner closure blocks. Data-format, compliance, or placeholder sources remain invalid as true source rows. Profile-specific QA waivers are allowed only when named in `docs/import-profiles/bafu/constraints.md`; `process_material_balance_deviation` remains an account-level observation and all other schema/content issues remain action items unless explicitly updated.
|
|
166
166
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for #
|
|
2
|
+
lastReviewedAt: 2026-09-21
|
|
3
|
+
lastReviewedCommit: 208f520f0771f2aacdde9422133255a76f0cc2fb
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #171: CLI 0.1.19 consumer adoption does not change Worldsteel profile constraints, permissions or source evidence."
|
|
5
5
|
title: worldsteel Import Constraints
|
|
6
6
|
docType: constraints
|
|
7
7
|
scope: import-profile
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for #
|
|
2
|
+
lastReviewedAt: 2026-09-21
|
|
3
|
+
lastReviewedCommit: 208f520f0771f2aacdde9422133255a76f0cc2fb
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #171: CLI 0.1.19 adoption does not change retained Worldsteel coverage or account-local support policy."
|
|
5
5
|
title: worldsteel EF3.1 Import Coverage Evidence
|
|
6
6
|
docType: report
|
|
7
7
|
scope: import-profile/worldsteel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for Foundry #
|
|
2
|
+
lastReviewedAt: 2026-09-21
|
|
3
|
+
lastReviewedCommit: 208f520f0771f2aacdde9422133255a76f0cc2fb
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #171: CLI 0.1.19 the operator instruction advances to exact CLI 0.1.19; Worldsteel profile, authorization and private no-replay rules remain unchanged."
|
|
5
5
|
title: worldsteel EF3.1 ILCD Import Plan
|
|
6
6
|
docType: plan
|
|
7
7
|
scope: import-profile/worldsteel
|
|
@@ -331,7 +331,7 @@ The vast majority of those exchanges point at EF3.1 reference flows that will re
|
|
|
331
331
|
|
|
332
332
|
## 9. Risk register (consolidated gotchas)
|
|
333
333
|
|
|
334
|
-
- **Use the project-installed CLI** — leave `TIANGONG_LCA_CLI_BIN` blank so Foundry resolves exact `@tiangong-lca/cli@0.1.
|
|
334
|
+
- **Use the project-installed CLI** — leave `TIANGONG_LCA_CLI_BIN` blank so Foundry resolves exact `@tiangong-lca/cli@0.1.19`; an override is only for an explicit local test binary. Credential-scoped execution still goes through the receipt-gated `pnpm account:run` wrapper.
|
|
335
335
|
- **Don't copy BAFU/USLCI profile wholesale** — Worldsteel reuses every canonical row by UUID, caps the R3 elementary tail, and enables R5 only for materialized FP/UG canonical-cache misses behind the full account-local support gates.
|
|
336
336
|
- **`databaseFallbackSourceConfig` silently inherits BAFU** for any unknown profile → ✅ worldsteel branch added.
|
|
337
337
|
- **`source_contact_rewrites` gated to bafu/uslci** → ✅ widened to include `worldsteel`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastReviewedAt: 2026-09-
|
|
3
|
-
lastReviewedCommit:
|
|
4
|
-
lastReviewedNote: "Reviewed for #
|
|
2
|
+
lastReviewedAt: 2026-09-21
|
|
3
|
+
lastReviewedCommit: 208f520f0771f2aacdde9422133255a76f0cc2fb
|
|
4
|
+
lastReviewedNote: "Reviewed for Foundry #171: CLI 0.1.19 leaves Worldsteel selection, authorization and write gates unchanged."
|
|
5
5
|
title: worldsteel Import Profile
|
|
6
6
|
docType: profile
|
|
7
7
|
scope: import-profile
|
|
@@ -34,9 +34,9 @@ checkPaths:
|
|
|
34
34
|
- test/commands/foundry-release-*.test.mts
|
|
35
35
|
- test/unit/runtime-layout.test.mts
|
|
36
36
|
- test/scenarios/foundry-package-consumer.test.mts
|
|
37
|
-
lastReviewedAt:
|
|
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
|
|
@@ -48,9 +48,9 @@ related:
|
|
|
48
48
|
|
|
49
49
|
The npm identity is `@tiangong-lca/foundry`; the public bin is `tiangong-foundry`. W06 establishes the installable `0.1.0` candidate and its production dependency closure. It does not publish a registry version or call this candidate F1. W08 owns the release-only workflow, Trusted Publishing/provenance, immutable tag, platform components, SBOM/license bundle and product compatibility manifest.
|
|
50
50
|
|
|
51
|
-
CLI 0.1.
|
|
51
|
+
CLI 0.1.19 is independently verified at source/tag `7f7b313cebc30c96154860df30f5d666963bc0b7` with signed provenance and an immutable npm integrity. Its POSIX bootstrap preserves verified archive modes under the private umask; both its POSIX and PowerShell bytes are unchanged from 0.1.18 and were re-hashed at the new tag. The exact source/script digests in `specs/release/runtime-inputs.json` and runtime descriptor/schema expectations advance with the CLI lock entry while its transitive SDK 0.3.0 entry and native Toolkit 0.3.2 inputs stay unchanged. The sixteen-package production closure retains its shape; its CLI identity and hashes advance.
|
|
52
52
|
|
|
53
|
-
The package depends exactly on public `@tiangong-lca/cli@0.1.
|
|
53
|
+
The package depends exactly on public `@tiangong-lca/cli@0.1.19`. Ajv remains a development dependency for internal commands and release-side SPDX validation; Saxes 6.0.0 is a development dependency used only by the offline final-delivery workbook reader for namespace-aware OOXML parsing. Sigstore 5.0.0, YAML 2.9.0, tar 7.5.22 and fflate 0.8.3 are also development-only release tools for signing/verification, lock parsing and bounded upstream archive selection. None enters the public compiler/dependency closure. TIDAS is an independently verified native component selected later by the CLI manager, not an npm dependency or bundled binary.
|
|
54
54
|
|
|
55
55
|
## Public surface
|
|
56
56
|
|
|
@@ -58,6 +58,8 @@ The package depends exactly on public `@tiangong-lca/cli@0.1.14`. 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
|
|
@@ -88,7 +90,7 @@ Minimum-host data is frozen in `specs/release/runtime-inputs.json`. [The pinned
|
|
|
88
90
|
|
|
89
91
|
The source-side qualifier receives the in-process prepared authority. It executes the actual packaged Node/Foundry/TIDAS combination with an empty tool PATH, no supplied credentials, an empty component cache seeded from the verified local archives, and then a warm cache with no manager downloads. It checks public init/doctor/task lifecycle, read selection/restoration and rejection of developer commands. Diagnostic timings and results live outside hashed component payloads. This proves native execution from the prepared archives; published URL download/copy-bootstrap and final four-platform publication remain distinct gates.
|
|
90
92
|
|
|
91
|
-
The qualified TIDAS0.3.
|
|
93
|
+
The qualified TIDAS0.3.2 archive includes distribution manifest v2 and a complete executable/source-bound native notice inventory. Preparation verifies the nested manifest digest, every retained file and Cargo/native/Rust evidence before reporting `owner-inventory-verified`. The assembler still refuses published mode when this verified coverage is absent. All original notice texts and source evidence remain in the TIDAS component, and its SPDX license references include every retained notice text. The component manifest points to the existing project LICENSE, upstream notice README and notice-manifest.json. These three entrypoints stay within the published CLI limit of64, while the nested inventory identifies every original text and its package/source role. No additional concatenated copy is generated. The four Toolkit 0.3.2 component URLs are published release locations verified by archive digest and source-bound attestation. The source CI performs candidate assembly/qualification but does not publish its binaries.
|
|
92
94
|
|
|
93
95
|
## Build and staging roots
|
|
94
96
|
|
|
@@ -304,15 +306,15 @@ The production dependency payload is an input to complete runtime-component asse
|
|
|
304
306
|
|
|
305
307
|
`pnpm release:prepare-native --output <new-absolute-directory>` binds its clean source and current supported host to the reviewed Node/TIDAS entries in `specs/release/runtime-inputs.json`. It offers no platform, version, source or registry override. Native downloads use a bounded HTTPS transfer through official artifact hosts, verify the pinned SHA-256 before parsing, and select the declared Node files or the complete TIDAS v2 inventory. The TIDAS reader checks the exact release version/target/source, binary and nested notice hashes, complete file inventory, Cargo-lock/package evidence, native XML notice coverage and Rust compiler/source notice bindings. Missing, extra, changed, linked, duplicated, unsafe or oversized files fail before output creation. The tar reader only streams regular selected entries; complete ZIP inputs additionally check ordinary single-disk central records for file types before development-only fflate decompression. Output paths come from the verified bounded inventory, and all files are written as regular files.
|
|
306
308
|
|
|
307
|
-
The current Node input is24.19.0 at source `cdc1b38d40cb567b7ad0b39c86addf830a0af0ae`; its official SHASUMS256 entries pin the four targets. The source LICENSE is byte-identical to the selected macOS release LICENSE. Windows uses the official `win-x64/node.exe` plus that checksum-bound source license. TIDAS 0.3.
|
|
309
|
+
The current Node input is24.19.0 at source `cdc1b38d40cb567b7ad0b39c86addf830a0af0ae`; its official SHASUMS256 entries pin the four targets. The source LICENSE is byte-identical to the selected macOS release LICENSE. Windows uses the official `win-x64/node.exe` plus that checksum-bound source license. TIDAS 0.3.2 is pinned to actual release target `d38448e7372baa84c50b20a8dbd501656b764d63`, as recorded by the immutable release request and source-bound SLSA/SPDX attestations for all four public archives. The tag target owns the binary source identity. The command checks the TIDAS distribution manifest, executes the downloaded Node to verify version/architecture, and uses the existing TIDAS version/validation handshake in an isolated home. It records native observations, selected file hashes, upstream sources, licenses and SPDX data as assembly inputs.
|
|
308
310
|
|
|
309
|
-
Native handshake success is not minimum-host or clean-machine qualification. Current binary inspection finds Node macOS minimum13.5 and TIDAS minimum11.0; both TIDAS GNU Linux targets require GLIBC2.38. The public Windows TIDAS 0.3.
|
|
311
|
+
Native handshake success is not minimum-host or clean-machine qualification. Current binary inspection finds Node macOS minimum13.5 and TIDAS minimum11.0; both TIDAS GNU Linux targets require GLIBC2.38. The public Windows TIDAS 0.3.2 executable uses static CRT linkage: independent LLVM PE inspection finds only Windows OS imports, and the exact-tag native workflow passed packaged smoke. The reviewed input profile records an empty external-runtime DLL list and the actual public executable hash. [TIDAS #181](https://github.com/tiangong-lca/tidas-toolkit/issues/181) and [release #187](https://github.com/tiangong-lca/tidas-toolkit/issues/187) retain the correction and publication evidence. Complete Node/CLI/Foundry/TIDAS cold-start qualification remains a further F1 gate.
|
|
310
312
|
|
|
311
313
|
## Qualification
|
|
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.
|
|
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
|
|