@tiangong-lca/foundry 0.1.8 → 0.1.10
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 +11 -9
- package/docs/architecture.md +9 -7
- package/docs/foundry-task-contracts.md +10 -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 +24 -16
- package/docs/public-runtime-contract.md +17 -7
- package/docs/runtime-context-contract.md +5 -5
- package/docs/task-authorization-contract.md +3 -3
- package/package-dist/assets/foundry-package-descriptor.json +218 -128
- package/package-dist/scripts/foundry-facade.js +71 -0
- package/package-dist/scripts/foundry-runtime.d.ts +12 -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-owner-execution-store.d.ts +33 -16
- package/package-dist/scripts/lib/foundry-owner-execution-store.js +32 -3
- 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 +2 -2
- package/package-dist/scripts/lib/foundry-package-contract.js +5 -5
- 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-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 +3 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.js +24 -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-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-repair.d.ts +36 -0
- package/package-dist/scripts/lib/foundry-workflow-repair.js +580 -0
- package/package-dist/scripts/lib/foundry-workflow-state.js +66 -18
- 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.json +5 -5
- package/specs/import-profiles.json +1 -1
- package/specs/schemas/foundry-authorization-input.schema.json +45 -2
- package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
- package/specs/schemas/foundry-package-descriptor.schema.json +2 -2
- package/specs/schemas/foundry-task-start.schema.json +200 -19
- package/specs/schemas/runtime-qualification.schema.json +1 -1
package/README.md
CHANGED
|
@@ -151,20 +151,21 @@ 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: 2026-09-
|
|
161
|
-
lastReviewedCommit:
|
|
162
|
-
lastReviewedNote: "Reviewed for #
|
|
161
|
+
lastReviewedAt: 2026-09-21
|
|
162
|
+
lastReviewedCommit: 5f848dab3c680c7ad5f5d768d9f1585e26f2427c
|
|
163
|
+
lastReviewedNote: "Reviewed for Foundry #185: release-only 0.1.10 identity projection from qualified main 5f848dab3c680c7ad5f5d768d9f1585e26f2427c changes no runtime behavior, dependency, permission or command contract. Signed publication and native/bootstrap qualification remain required release gates."
|
|
163
164
|
---
|
|
164
165
|
|
|
165
166
|
# TianGong LCA Data Foundry
|
|
166
167
|
|
|
167
|
-
The ordinary user entry is the independently installed [TianGong Foundry skill](https://github.com/tiangong-lca/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
|
+
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
|
|
|
169
170
|
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
171
|
|
|
@@ -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: 2026-09-
|
|
155
|
-
lastReviewedCommit:
|
|
156
|
-
lastReviewedNote: "Reviewed for #
|
|
155
|
+
lastReviewedAt: 2026-09-21
|
|
156
|
+
lastReviewedCommit: 5f848dab3c680c7ad5f5d768d9f1585e26f2427c
|
|
157
|
+
lastReviewedNote: "Reviewed for Foundry #185: release-only 0.1.10 identity projection from qualified main 5f848dab3c680c7ad5f5d768d9f1585e26f2427c changes no runtime behavior, dependency, permission or command contract. Signed publication and native/bootstrap qualification remain required release gates."
|
|
157
158
|
---
|
|
158
159
|
|
|
159
160
|
# Architecture
|
|
@@ -176,7 +177,7 @@ The public task facade delegates sealed owner execution to `foundry-workflow-exe
|
|
|
176
177
|
|
|
177
178
|
## OAuth identity boundary
|
|
178
179
|
|
|
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.
|
|
180
|
+
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
181
|
|
|
181
182
|
## Qualified execution boundary
|
|
182
183
|
|
|
@@ -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-21
|
|
32
|
+
lastReviewedCommit: f059e4703438d661aa823d33c7cff0a9582645bc
|
|
33
|
+
lastReviewedNote: "Reviewed for Foundry #171: metadata repair preserves exact historical references only with payload-derived occurrence and owner/state/content proof, retains raw CLI freshness blockers and false publication readiness, and changes no ordinary authoring, credential or publication authority. Producer-verified zero-dispatch successors require fresh scope and grant."
|
|
34
34
|
related:
|
|
35
35
|
- AGENTS.md
|
|
36
36
|
- WORKFLOW.md
|
|
@@ -132,12 +132,18 @@ Account registration optionally stores `account_mode` from explicit task/host in
|
|
|
132
132
|
|
|
133
133
|
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
134
|
|
|
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.
|
|
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.17 reports no token-expiry timestamp for that mode; Foundry does not invent one or claim a separately verified token lifetime.
|
|
136
136
|
|
|
137
137
|
`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
138
|
|
|
139
139
|
`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
140
|
|
|
141
|
+
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.
|
|
142
|
+
|
|
143
|
+
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.
|
|
144
|
+
|
|
145
|
+
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.
|
|
146
|
+
|
|
141
147
|
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
148
|
|
|
143
149
|
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
|
|
@@ -23,7 +23,7 @@ checkPaths:
|
|
|
23
23
|
- scripts/verify-foundry-package.ts
|
|
24
24
|
- scripts/release-*.ts
|
|
25
25
|
- scripts/lib/foundry-release-*.ts
|
|
26
|
-
- .github/workflows/publish
|
|
26
|
+
- .github/workflows/publish.yml
|
|
27
27
|
- .github/workflows/quality-gate.yml
|
|
28
28
|
- scripts/lib/foundry-package-contract.ts
|
|
29
29
|
- scripts/lib/foundry-runtime-paths.ts
|
|
@@ -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 #
|
|
37
|
+
lastReviewedAt: 2026-09-21
|
|
38
|
+
lastReviewedCommit: 5f848dab3c680c7ad5f5d768d9f1585e26f2427c
|
|
39
|
+
lastReviewedNote: "Reviewed for Foundry #185: release-only 0.1.10 identity projection from qualified main 5f848dab3c680c7ad5f5d768d9f1585e26f2427c changes no runtime behavior, dependency, permission or command contract. Signed publication and native/bootstrap qualification remain required 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
|
|
|
@@ -88,7 +88,7 @@ Minimum-host data is frozen in `specs/release/runtime-inputs.json`. [The pinned
|
|
|
88
88
|
|
|
89
89
|
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
90
|
|
|
91
|
-
The qualified TIDAS0.3.
|
|
91
|
+
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
92
|
|
|
93
93
|
## Build and staging roots
|
|
94
94
|
|
|
@@ -124,6 +124,14 @@ The public protocol set advertises each shipped external task input: task-start,
|
|
|
124
124
|
|
|
125
125
|
Verification uses regular-file, `O_NOFOLLOW`, fd size/inode/mtime and SHA checks. Missing, extra, linked, renamed, traversing, oversized or changed payloads fail before a package-backed facade context is created. Every package-entry resolution performs this check even if an extra source-like file appears; such a file is itself an unexpected payload and cannot switch the resolver into developer mode. A nested `node_modules` may be dependency storage only when it is a real directory, never a symlink. Source and ordinary developer-emitted layouts remain readable as legacy layout v1 or repository layout v2 without treating a copied name-only manifest as a package.
|
|
126
126
|
|
|
127
|
+
## Repository migration identity
|
|
128
|
+
|
|
129
|
+
Current release producers and CI capsules bind `tiangong-lca/foundry`, repository ID `1260957221`, and organization ID `327771381`. CI capsule identity is independent of the candidate package version, so ordinary source validation still works while the package remains `0.1.8`.
|
|
130
|
+
|
|
131
|
+
npm verification chooses exactly one historical identity from the expected package version: Foundry through `0.1.8` uses `tiangong-lca/data-foundry`, and CLI through `0.1.14` uses `tiangong-lca/tiangong-cli`, both with owner ID `199785309`. Later versions use `foundry` or `cli` under organization ID `327771381`; the CLI repository ID remains `1194220834`. The verifier binds issuer, SAN, certificate repository/owner/source/ref/event extensions, signed provenance and package integrity to the same profile. Repository redirects do not establish signing authority.
|
|
132
|
+
|
|
133
|
+
New Foundry publication and tag creation require a version above `0.1.8`. Existing tags and released bytes stay immutable. Unchanged-version source commits remain non-release events. Current runtime assembly emits canonical source/download URLs; pinned input manifests and archived signed metadata are not rewritten. npm Trusted Publisher configuration and any later versioned publication require separate live qualification.
|
|
134
|
+
|
|
127
135
|
## Version preparation
|
|
128
136
|
|
|
129
137
|
`pnpm release:version --version <major.minor.patch>` is a read-only maintainer plan. It validates the repository package identity and coherent manifest, compiled-verifier and descriptor-schema versions, then reports the three bounded content changes. Stable versions cannot decrease. The CLI has no alternate-root or serialized-plan input.
|
|
@@ -168,7 +176,7 @@ Native source qualification, published-input assembly and npm signing may consum
|
|
|
168
176
|
|
|
169
177
|
### Signed completed stages and recovery
|
|
170
178
|
|
|
171
|
-
`pnpm ci:stage restore|seal` is a source-only workflow utility. A `tiangong-foundry.ci-capsule.v1` receipt binds stage, platform, CI/release purpose, repository numeric identities, exact source commit/tree, package, Node/pnpm/TypeScript and lock hash, native-input and complete test-plan hashes, upstream input digest, and every regular payload file's size/SHA256. The trusted owning job seals only after successful semantic validation. GitHub attests the receipt, thereby binding its entire inventory. Source qualification uses the reusable `quality-gate.yml` signer; release stages use `publish
|
|
179
|
+
`pnpm ci:stage restore|seal` is a source-only workflow utility. A `tiangong-foundry.ci-capsule.v1` receipt binds stage, platform, CI/release purpose, repository numeric identities, exact source commit/tree, package, Node/pnpm/TypeScript and lock hash, native-input and complete test-plan hashes, upstream input digest, and every regular payload file's size/SHA256. The trusted owning job seals only after successful semantic validation. GitHub attests the receipt, thereby binding its entire inventory. Source qualification uses the reusable `quality-gate.yml` signer; release stages use `publish.yml`. Verification checks the hosted-runner certificate's source, caller and signer digests/refs, repository identities and original run/attempt, rather than trusting provenance-shaped JSON.
|
|
172
180
|
|
|
173
181
|
`resume_run_id` is an optional numeric locator for one exact same-source prior run. The current run is searched first, including earlier attempts. Discovery is bounded to 500 artifacts per selected run; names locate candidates but grant no authority. Missing or legitimately expired proofs cause the owning stage to execute again. Invalid signatures, mismatched content or incomplete evidence fail closed. Required downstream inputs cannot silently fall back. Verified signing time must be within 24 hours; missing or future signing timestamps are invalid. Relay artifacts keep the original receipt and payload unchanged and do not extend that lifetime. Changed source, dependencies, toolchain, platform or input requires qualification again. Legacy unsigned results are never promoted into this protocol.
|
|
174
182
|
|
|
@@ -188,7 +196,7 @@ Benchmark targets are at most 18 minutes for full qualification and 5 minutes fo
|
|
|
188
196
|
|
|
189
197
|
`pnpm release:verify-npm --package <cli|foundry> --version <x.y.z> --expected-git-head <40-hex-sha>` independently downloads the exact public npm metadata, tarball and attestation. Downloads reject redirects, credentials, alternate registry origins/paths and unbounded responses. Verification binds canonical SHA-512 to the downloaded tarball, then verifies the Sigstore certificate, issuer and transparency logs before interpreting the signed in-toto/SLSA payload. The verified certificate identity must match the signed workflow/ref, package subject, source commit and exact GitHub-hosted run attempt. Optional registry `gitHead` must match when present; its absence never substitutes for signed provenance.
|
|
190
198
|
|
|
191
|
-
CLI
|
|
199
|
+
Published CLI versions through 0.1.14 retain `tiangong-lca/tiangong-cli` and `.github/workflows/publish.yml`; later versions bind `tiangong-lca/cli` at the exact `cli-v<version>` tag. The current Foundry verifier accepts only `.github/workflows/publish.yml` for every requested version. The previously used `.github/workflows/publish-foundry.yml` signer is intentionally retired by the owner decision on 2026-09-13, including for legacy package versions; it is not an accepted rollback or verification exception. Existing published files and signatures remain immutable, but historical artifacts signed by that workflow are outside this verifier's admission policy. Repository/owner identity remains independently version-bound; later Foundry versions use `tiangong-lca/foundry`. Normal publication originates from a main push, and recovery from `workflow_dispatch` on the exact `foundry-v<version>` tag. Every case requires its expected source digest and numeric repository/owner identity.
|
|
192
200
|
|
|
193
201
|
`--output <new-absolute-directory>` preserves the verified tarball, raw registry metadata/attestations and the digest-bound verification report only after verification succeeds. It never replaces an existing directory. Reports are verification evidence, not independent trust anchors: component consumers still require the separately trusted product manifest/Skills lock. The tool cannot publish, tag, configure a publisher, read `.env` or supply a registry token. Sigstore uses an owned temporary trust cache that is removed after verification.
|
|
194
202
|
|
|
@@ -202,7 +210,7 @@ Exact-tag recovery permits empty/default inputs plus an optional canonical numer
|
|
|
202
210
|
|
|
203
211
|
The immutable `foundry-v0.1.4` workflow predates this default-input correction. To continue that release, completely rerun its original qualified main-push run `34314765464`; that preserved event has no dispatch inputs. Every required source and publication stage runs again with fresh attempt-bound artifacts, and the existing public npm release is independently verified without another upload. Do not move the old tag or mix artifacts from different attempts. A successful package upload whose immediate public readback failed must first be independently verified before choosing this recovery.
|
|
204
212
|
|
|
205
|
-
`.github/workflows/publish
|
|
213
|
+
`.github/workflows/publish.yml` connects that context gate to the existing four-native-host canonical gate through `workflow_call`. The reusable quality workflow checks out the admitted SHA, retains its ordinary PR/manual triggers, and does not persist checkout credentials. The source checks have read-only permissions; only their completed-stage sealer receives OIDC and attestation-write permissions.
|
|
206
214
|
|
|
207
215
|
After every host passes, the separate `release-tag` job revalidates the event, clean source/main relationship, release-only diff and merged PR. `pnpm release:tag` accepts no source/tag arguments or serialized context and requires that exact job identity. This tag job receives contents-write permission only for its create-or-verify operation; it installs no project dependencies and does not persist checkout credentials. The later component publisher has separate contents-write permission gated on all published-input native jobs; final-manifest publication has its own contents-write job after all public bootstrap checks.
|
|
208
216
|
|
|
@@ -226,7 +234,7 @@ For a package identity's first publication, after the reviewed pipeline has prod
|
|
|
226
234
|
2. An authorized maintainer signs in to npm using their own account and completes the required 2FA. Keep the artifact files unchanged and change into their downloaded directory outside a Git checkout.
|
|
227
235
|
3. With pinned pnpm 11.24.0, execute the generated command: `pnpm publish ./tiangong-lca-foundry-<version>.tgz --access public --no-git-checks --config.provenance-file=./foundry-<version>.sigstore`. The generic `--config.provenance-file` spelling is required by this pinned client. The provided CI signature accompanies the unchanged package; the account authorizes its upload.
|
|
228
236
|
4. Independently run `release:verify-npm` for that exact version/source, compare its tarball digests with the prepared verification, and preserve the result. After a failed or uncertain upload, inspect the exact public version before deciding the next action; do not blindly replay a publish or overwrite an existing version.
|
|
229
|
-
5. Review the new package's npm Trusted Publisher settings for organization `tiangong-lca`, repository `
|
|
237
|
+
5. Review the new package's npm Trusted Publisher settings for organization `tiangong-lca`, repository `foundry`, workflow `publish.yml`, permission to publish and the actual job environment binding. The current job declares no GitHub environment. Routine publication must use that reviewed workflow's OIDC path and receive separate public readback verification.
|
|
230
238
|
|
|
231
239
|
The npm package identity and publisher configuration are account-controlled prerequisites, separate from CI signing. A prepared artifact, a successful mock-registry transport test or source-only native qualification is not a published F1 release. The actual versioned workflow execution, complete native components and immutable product-manifest publication remain W08 release gates.
|
|
232
240
|
|
|
@@ -244,11 +252,11 @@ There is one publisher invocation. Regardless of its reported success or an unce
|
|
|
244
252
|
|
|
245
253
|
`package-artifacts/npm-publication/` contains the publication result and readable report; a successful result also preserves public metadata, attestations and verification. The workflow exports this evidence even when publication fails. `npm_published=true` is emitted only after public verification succeeds; later component/manifest stages must require it. It proves package publication only, not complete F1 runtime qualification.
|
|
246
254
|
|
|
247
|
-
An explicit `workflow_dispatch` with `diagnose_npm_oidc=true` selects the separate diagnostic job in the same Trusted Publisher workflow and skips the release context and every publication continuation. `pnpm release:diagnose-npm-oidc` accepts no arguments and requires that exact GitHub-hosted diagnostic job, canonical repository/workflow, branch dispatch, matching workflow/source SHA, clean physical checkout and explicit event input. It requests one package-specific ephemeral credential through the existing bounded OIDC exchange, discards it, and reports only fixed validation reasons, field kinds, boolean token checks and numeric timing differences. No token, raw response value, credential fingerprint or account configuration is emitted or persisted. The diagnostic cannot upload packages, create tags/releases/assets or satisfy release qualification. Its shared response inspection uses the ordinary publisher's timestamp parser and unchanged freshness/lifetime limits; a diagnostic rejection is evidence to investigate, never permission to weaken them.
|
|
255
|
+
An explicit `workflow_dispatch` with `diagnose_npm_oidc=true` selects the separate diagnostic job in the same Trusted Publisher workflow and skips the release context and every publication continuation. `pnpm release:diagnose-npm-oidc` accepts no arguments and requires that exact GitHub-hosted diagnostic job, canonical repository/workflow, branch dispatch, matching workflow/source SHA, clean physical checkout and explicit event input. It requests one package-specific ephemeral credential through the existing bounded OIDC exchange, discards it, and reports only fixed validation reasons, field kinds, boolean token checks and numeric timing differences. Failures identify admission, source, input, GitHub OIDC, npm exchange or npm response parsing using fixed stage identifiers; a response status is reported only as a bounded HTTP number. Raw dependency errors and response contents remain hidden. Rejected credentials and failed requests exit nonzero. No token, raw response value, credential fingerprint or account configuration is emitted or persisted. The diagnostic cannot upload packages, create tags/releases/assets or satisfy release qualification. Its shared response inspection uses the ordinary publisher's timestamp parser and unchanged freshness/lifetime limits; a diagnostic rejection is evidence to investigate, never permission to weaken them.
|
|
248
256
|
|
|
249
257
|
Before expensive release qualification, `release:preflight` revalidates the exact release event/merged source and registry state. An existing version undergoes public verification; a new version performs the real package-specific OIDC exchange and discards the credential after reporting fixed validation facts. First-package identity creation retains the prepared-artifact maintainer handoff. The preflight job cannot sign or publish a package.
|
|
250
258
|
|
|
251
|
-
For standalone native diagnosis, dispatch `publish
|
|
259
|
+
For standalone native diagnosis, dispatch `publish.yml` on a reviewed branch with `diagnose_platform` set to one supported tuple and `diagnose_tag` set to an exact existing stable tag; leave the other modes disabled. `release:diagnose-platform` validates that immutable tag's main ancestry, release-only source and merged PR, then executes that source's published-native preparation in an isolated worktree. Its token is read-only and it has no OIDC permission. Bounded reports preserve controller/source/platform, failing phase, exit and fixed failure facts without raw child output or credentials. Current-source native qualification also preserves `runtime-diagnostic.json` before cleaning its temporary cache; failed diagnostics are never qualification evidence.
|
|
252
260
|
|
|
253
261
|
## Runtime component publication
|
|
254
262
|
|
|
@@ -296,15 +304,15 @@ The production dependency payload is an input to complete runtime-component asse
|
|
|
296
304
|
|
|
297
305
|
`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.
|
|
298
306
|
|
|
299
|
-
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.
|
|
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.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.
|
|
300
308
|
|
|
301
|
-
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.
|
|
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.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.
|
|
302
310
|
|
|
303
311
|
## Qualification
|
|
304
312
|
|
|
305
313
|
`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.
|
|
306
314
|
|
|
307
|
-
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.
|
|
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.
|
|
308
316
|
|
|
309
317
|
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.
|
|
310
318
|
|
|
@@ -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 #
|
|
35
|
+
lastReviewedAt: 2026-09-21
|
|
36
|
+
lastReviewedCommit: 5f848dab3c680c7ad5f5d768d9f1585e26f2427c
|
|
37
|
+
lastReviewedNote: "Reviewed for Foundry #185: release-only 0.1.10 identity projection from qualified main 5f848dab3c680c7ad5f5d768d9f1585e26f2427c changes no runtime behavior, dependency, permission or command contract. Signed publication and native/bootstrap qualification remain required release gates."
|
|
38
38
|
related:
|
|
39
39
|
- docs/runtime-context-contract.md
|
|
40
40
|
- docs/task-authorization-contract.md
|
|
@@ -66,7 +66,7 @@ Input changes create an explicit new revision with retained history. A new revis
|
|
|
66
66
|
|
|
67
67
|
## Task start and request revisions
|
|
68
68
|
|
|
69
|
-
`tiangong-foundry.task-start.v1` contains exact request and actor ids, one of the
|
|
69
|
+
`tiangong-foundry.task-start.v1` contains exact request and actor ids, one of the three lanes, profile, ordered target entity types, selected source paths, optional account intent, an optional selected JSON seed and at most one current local preparation (`dataset-curation-cleanup`). The source-evidence lane requires its seed to be one of the selected sources. Task start performs no authentication and stores no identity receipt.
|
|
70
70
|
|
|
71
71
|
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
72
|
|
|
@@ -100,10 +100,20 @@ Before the first dispatch, the batch attempt-start event durably registers an im
|
|
|
100
100
|
|
|
101
101
|
Each owner command is dispatched once as executable plus argv with explicit authentication and `shell=false`. Commit stdout must match its contained report. A confirmed success requires the existing closeout checks and fresh independent root, owner, state, payload and reference verification. Lost or unknown responses and narrowly recognized same-identity conflicts use independent readback; known business failures remain unresolved. Recovery does not require the old write grant to remain unexpired and cannot change the original request. The CLI batch item's verified/recovered result determines success; aggregate batch completion alone is insufficient.
|
|
102
102
|
|
|
103
|
-
Explicit native
|
|
103
|
+
Explicit native draft handoffs additionally require a matching CLI v2 execution report: exact contract canonical digest, execution id, ordered action/row identities, per-action operation/before binding and desired payload digests, consumed attempts, and successful exact readback for every action. A row recovered from an ambiguous dispatch may close only with that same consumed-attempt, non-replayed, desired-exact evidence. Failed, forged, unknown, blocked, replayed or incomplete rows cannot close the scope. After a lost response, recovery may read the original bound output's `outputs/dataset-save-draft/summary.json`; absent or invalid native evidence remains unresolved even when roots match. Recovery never dispatches another mutation or retrofits a legacy report into native consumption.
|
|
104
104
|
|
|
105
105
|
Every readback gets a fresh output directory. A verified result binds the exact input, report and JSONL check hashes, plus the native execution report when selected; later status checks rehash each fact. Completed scopes preserve their final rows while dependent scopes are finalized again after new verified progress. Reference-only partitions use the separate canonical verification stage below; semantic changes cannot replace consumed scope rows.
|
|
106
106
|
|
|
107
|
+
## Existing owner-draft metadata repair
|
|
108
|
+
|
|
109
|
+
The `existing-owner-draft-repair` lane selects exactly three distinct source files: a native execution contract, complete before rows and candidate rows. It currently accepts Process rows, stable identity/version and existing ownership/source-reference description text only. Scientific values, references, language structure and annual-volume content cannot change. Registration and status are offline. Resume uses the qualified installed CLI for contract dry-run and exact current-owner/state-0 before readback; producer-indexed raw owner reports and per-root JSONL proofs must agree with the complete selected content. Summaries alone do not prove readback. A no-change scope completes only after validation and exact readback of both selections, without an execution request or mutation attempt.
|
|
110
|
+
|
|
111
|
+
For this metadata-only lane, reference integrity is distinct from reference freshness. Expectations are derived from the complete selected before/candidate payloads and every unchanged reference occurrence. An exact historical reference may remain only when the CLI proves that requested version exists, its sole finding is a newer version, all blocker/count/check records agree, and every root has exact current owner/state/content readback. The raw blocked CLI report and freshness findings remain unchanged; the preparation and closeout retain a separate proof and `publication_ready: false`. A missing exact version, changed reference, mismatched input path, unexpected failure or incomplete check set blocks repair. Ordinary authoring and canonical-reference quality gates keep their existing latest-version requirements.
|
|
112
|
+
|
|
113
|
+
A changed scope requires `input_kind: repair_rows` authorization, an explicit `repair_preparation` reference and the matching native contract. The existing descriptor's `finalization_sha256` binds that preparation digest for this explicit kind; no generic finalization report is manufactured. Only the locked generic profile is currently admitted for repair writes. The grant/capsule/owner-request stores are shared with ordinary execution. Dispatch rechecks the immutable preparation, account, candidate and native contract, then uses the same CLI-owned attempt ledger and guarded save path. Unknown annual volume retains its failed authoring-evidence layer and false publication readiness.
|
|
114
|
+
|
|
115
|
+
Repair closeout requires the matching consumed native execution receipt plus independent exact owner/state/payload and reference-closure readback. It binds the same preparation report, never claims generic authoring/QA/location checks ran, and never accepts trace-normalized equality. A missing receipt or wrong readback remains unresolved; resume performs readback only and cannot repeat the mutation. Status rehashes retained proof and may complete a verified repair without a generic row-authoring finalization. An explicitly linked successor may proceed only when the predecessor has a producer-verified terminal CLI failure proving zero executed actions and zero consumed CLI attempts. It preserves the same request/account/identities, uses new immutable input paths and a genuinely changed desired payload, and requires a fresh preflight and grant. A fresh before image is permitted; old evidence remains immutable. Unknown or dispatched predecessors remain blocked.
|
|
116
|
+
|
|
107
117
|
## Canonical reference verification
|
|
108
118
|
|
|
109
119
|
Identity reuse retains original source rows in the reference partition and selects different canonical targets in its rewrite evidence. After current finalization, resume verifies those selected table/id/version targets through the qualified CLI `dataset verify-remote --root-policy existing`. Its generated query contains only reference descriptors. It does not compare the source payload with the reused dataset or construct a write candidate.
|
|
@@ -120,7 +130,7 @@ Status performs local evidence verification only. Failed verification exposes `r
|
|
|
120
130
|
|
|
121
131
|
The existing task artifact transaction records a fresh immutable generation. QA and review bytes are copied exactly; the original descriptor/intent bytes are retained. The derived intent rewrites only review file locators to the independently checked task snapshots. That derived file has its own raw SHA-256 and is the file the qualified CLI verifies. It grants no permission. Identical submissions reuse the current selection. Concurrent replacement is checked under the task lock; prepared, consumed and completed owner scopes cannot replace their reference evidence. Removing the original selected files does not remove the snapshots needed for execution/recovery.
|
|
122
132
|
|
|
123
|
-
Selection invalidates prior finalization/approval projection through the recorded reference-selection digest. Finalization uses only current indexed snapshots and requires the selected dataset's current row bytes to match its original control binding; changed rows require fresh selection. Process QA receives explicit repeated `--reference-rows-file` arguments. Precommit verification receives exactly the derived `--reference-intent-file`; default canonical-reference and root policies remain owned by the CLI. Its [exact-reference protocol](https://github.com/tiangong-lca/
|
|
133
|
+
Selection invalidates prior finalization/approval projection through the recorded reference-selection digest. Finalization uses only current indexed snapshots and requires the selected dataset's current row bytes to match its original control binding; changed rows require fresh selection. Process QA receives explicit repeated `--reference-rows-file` arguments. Precommit verification receives exactly the derived `--reference-intent-file`; default canonical-reference and root policies remain owned by the CLI. Its [exact-reference protocol](https://github.com/tiangong-lca/cli/blob/main/docs/agents/exact-reference-intent-contract.md) owns consumer/actor/content/review eligibility. Foundry does not infer units, discover sibling files or create a reference exception itself.
|
|
124
134
|
|
|
125
135
|
Sealing obtains a fresh qualified CLI identity after local handoff preparation and performs complete capsule admission against the current grant and evidence. Before an unconsumed write, the workflow obtains a new current identity between initial rehydration and the final complete admission pass, so prior local work does not age that receipt. Both passes and the existing 60-second identity bound remain enforced before the attempt is consumed.
|
|
126
136
|
|
|
@@ -193,7 +203,7 @@ Every facade revision also rechecks all retained predecessors in its request cha
|
|
|
193
203
|
|
|
194
204
|
## Runtime selection and migration seam
|
|
195
205
|
|
|
196
|
-
The public facade accepts CLI/TIDAS expectations only through its process-local host interface. Ordinary argv, task specs, `.env` and ambient `TIDAS_BIN`/expectation variables cannot select trust anchors. Without a host selection, doctor, start, status and local resume work and report `qualification.required`; child-required work must return the runtime qualification action. The managed bin now obtains this selection from the CLI IPC context and its verified component metadata. The final immutable production product manifest remains a W08 deliverable. The current exact CLI 0.1.
|
|
206
|
+
The public facade accepts CLI/TIDAS expectations only through its process-local host interface. Ordinary argv, task specs, `.env` and ambient `TIDAS_BIN`/expectation variables cannot select trust anchors. Without a host selection, doctor, start, status and local resume work and report `qualification.required`; child-required work must return the runtime qualification action. The managed bin now obtains this selection from the CLI IPC context and its verified component metadata. The final immutable production product manifest remains a W08 deliverable. The current exact CLI 0.1.19 constraint remains explicit rather than silently accepting a future version.
|
|
197
207
|
|
|
198
208
|
`workspace migrate --dry-run` recursively inventories only regular files/directories, rejects links and returns `tiangong-foundry.workspace-migration-plan.v1` as an inline content-bound artifact. It classifies control, local-preparation, terminal-success, attempted/unknown, authorization/account and unclassified paths. The public envelope is bounded to 10,000 entries and 64 directory levels. The total hashed inventory is bounded to 256 MiB. Files larger than 64 MiB and recognized credential/session files retain path/size/classification facts with `sha256=null`; their contents are not read by this inventory. The tree digest binds this observational inventory, not an atomic filesystem snapshot, so W10 must re-read and verify every selected source immediately before apply. It writes nothing. W10 owns application, rollback and detailed old-schema mapping.
|
|
199
209
|
|