@tiangong-lca/foundry 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +5 -3
  2. package/docs/architecture.md +5 -3
  3. package/docs/foundry-task-contracts.md +2 -0
  4. package/docs/package-distribution-contract.md +10 -8
  5. package/docs/public-runtime-contract.md +53 -3
  6. package/docs/runtime-context-contract.md +7 -3
  7. package/docs/task-authorization-contract.md +2 -0
  8. package/package-dist/assets/foundry-package-descriptor.json +374 -136
  9. package/package-dist/scripts/foundry-facade.d.ts +6 -0
  10. package/package-dist/scripts/foundry-facade.js +38 -0
  11. package/package-dist/scripts/foundry-runtime.d.ts +3 -2
  12. package/package-dist/scripts/lib/decision-owners/identity-preflight.js +3 -1
  13. package/package-dist/scripts/lib/final-delivery-manifest.d.ts +40 -0
  14. package/package-dist/scripts/lib/final-delivery-manifest.js +145 -0
  15. package/package-dist/scripts/lib/final-delivery-review.d.ts +37 -0
  16. package/package-dist/scripts/lib/final-delivery-review.js +108 -0
  17. package/package-dist/scripts/lib/finalize-owners/cli-wrappers.d.ts +72 -1
  18. package/package-dist/scripts/lib/finalize-owners/cli-wrappers.js +123 -3
  19. package/package-dist/scripts/lib/finalize-owners/native-draft-handoff.js +4 -3
  20. package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +9 -0
  21. package/package-dist/scripts/lib/finalize-owners/post-authoring.js +37 -8
  22. package/package-dist/scripts/lib/foundry-authentication-environment.js +1 -1
  23. package/package-dist/scripts/lib/foundry-curation-queue.d.ts +73 -0
  24. package/package-dist/scripts/lib/foundry-curation-queue.js +261 -0
  25. package/package-dist/scripts/lib/foundry-edge-draft-admission.d.ts +17 -0
  26. package/package-dist/scripts/lib/foundry-edge-draft-admission.js +94 -0
  27. package/package-dist/scripts/lib/foundry-edge-identity-preflight.d.ts +47 -0
  28. package/package-dist/scripts/lib/foundry-edge-identity-preflight.js +268 -0
  29. package/package-dist/scripts/lib/foundry-edge-oauth.d.ts +4 -0
  30. package/package-dist/scripts/lib/foundry-edge-oauth.js +154 -0
  31. package/package-dist/scripts/lib/foundry-edge-reference-intent.d.ts +51 -0
  32. package/package-dist/scripts/lib/foundry-edge-reference-intent.js +184 -0
  33. package/package-dist/scripts/lib/foundry-edge-repair-preparation.d.ts +24 -0
  34. package/package-dist/scripts/lib/foundry-edge-repair-preparation.js +209 -0
  35. package/package-dist/scripts/lib/foundry-edge-session.d.ts +32 -0
  36. package/package-dist/scripts/lib/foundry-edge-session.js +203 -0
  37. package/package-dist/scripts/lib/foundry-edge-support-plan.d.ts +69 -0
  38. package/package-dist/scripts/lib/foundry-edge-support-plan.js +245 -0
  39. package/package-dist/scripts/lib/foundry-edge-support-planning.d.ts +115 -0
  40. package/package-dist/scripts/lib/foundry-edge-support-planning.js +259 -0
  41. package/package-dist/scripts/lib/foundry-edge-support.d.ts +19 -0
  42. package/package-dist/scripts/lib/foundry-edge-support.js +188 -0
  43. package/package-dist/scripts/lib/foundry-execution-admission.d.ts +4 -2
  44. package/package-dist/scripts/lib/foundry-execution-admission.js +24 -2
  45. package/package-dist/scripts/lib/foundry-finalize-edge-identity.d.ts +30 -0
  46. package/package-dist/scripts/lib/foundry-finalize-edge-identity.js +102 -0
  47. package/package-dist/scripts/lib/foundry-finalize-owners.d.ts +1 -0
  48. package/package-dist/scripts/lib/foundry-finalize-owners.js +68 -2
  49. package/package-dist/scripts/lib/foundry-interaction-input.js +2 -2
  50. package/package-dist/scripts/lib/foundry-managed-authentication.js +1 -1
  51. package/package-dist/scripts/lib/foundry-operation-result.d.ts +1 -1
  52. package/package-dist/scripts/lib/foundry-operation-result.js +1 -0
  53. package/package-dist/scripts/lib/foundry-owner-execution-store.d.ts +16 -16
  54. package/package-dist/scripts/lib/foundry-owner-execution-store.js +34 -7
  55. package/package-dist/scripts/lib/foundry-owner-readback.d.ts +21 -0
  56. package/package-dist/scripts/lib/foundry-owner-readback.js +61 -0
  57. package/package-dist/scripts/lib/foundry-package-contract.d.ts +4 -4
  58. package/package-dist/scripts/lib/foundry-package-contract.js +8 -2
  59. package/package-dist/scripts/lib/foundry-preparation-cli-validation.js +71 -0
  60. package/package-dist/scripts/lib/foundry-process-mass-balance.d.ts +64 -0
  61. package/package-dist/scripts/lib/foundry-process-mass-balance.js +224 -0
  62. package/package-dist/scripts/lib/foundry-process-qa.d.ts +19 -0
  63. package/package-dist/scripts/lib/foundry-process-qa.js +423 -0
  64. package/package-dist/scripts/lib/foundry-repair-census.d.ts +82 -0
  65. package/package-dist/scripts/lib/foundry-repair-census.js +574 -0
  66. package/package-dist/scripts/lib/foundry-repair-execution.js +13 -2
  67. package/package-dist/scripts/lib/foundry-repair-scope.d.ts +15 -2
  68. package/package-dist/scripts/lib/foundry-repair-scope.js +62 -10
  69. package/package-dist/scripts/lib/foundry-runtime-environment.d.ts +2 -0
  70. package/package-dist/scripts/lib/foundry-runtime-environment.js +18 -0
  71. package/package-dist/scripts/lib/foundry-runtime-identity.d.ts +1 -0
  72. package/package-dist/scripts/lib/foundry-runtime-identity.js +19 -1
  73. package/package-dist/scripts/lib/foundry-runtime-qualification.js +2 -2
  74. package/package-dist/scripts/lib/foundry-runtime-utils.d.ts +1 -0
  75. package/package-dist/scripts/lib/foundry-runtime-utils.js +1 -1
  76. package/package-dist/scripts/lib/foundry-scientific-repair.d.ts +38 -0
  77. package/package-dist/scripts/lib/foundry-scientific-repair.js +438 -0
  78. package/package-dist/scripts/lib/foundry-semantic-input.js +1 -1
  79. package/package-dist/scripts/lib/foundry-task-input-preparation.d.ts +4 -0
  80. package/package-dist/scripts/lib/foundry-task-input-preparation.js +160 -0
  81. package/package-dist/scripts/lib/foundry-task-registration.js +19 -1
  82. package/package-dist/scripts/lib/foundry-task-types.d.ts +2 -0
  83. package/package-dist/scripts/lib/foundry-typed-authoring-patch.d.ts +76 -0
  84. package/package-dist/scripts/lib/foundry-typed-authoring-patch.js +237 -0
  85. package/package-dist/scripts/lib/foundry-typed-context.d.ts +11 -0
  86. package/package-dist/scripts/lib/foundry-typed-context.js +79 -0
  87. package/package-dist/scripts/lib/foundry-typed-flow-qa.d.ts +166 -0
  88. package/package-dist/scripts/lib/foundry-typed-flow-qa.js +226 -0
  89. package/package-dist/scripts/lib/foundry-typed-model-write.d.ts +6 -0
  90. package/package-dist/scripts/lib/foundry-typed-model-write.js +59 -0
  91. package/package-dist/scripts/lib/foundry-workflow-assessment.js +67 -29
  92. package/package-dist/scripts/lib/foundry-workflow-authorization.js +82 -1
  93. package/package-dist/scripts/lib/foundry-workflow-context.js +59 -18
  94. package/package-dist/scripts/lib/foundry-workflow-execution.js +57 -5
  95. package/package-dist/scripts/lib/foundry-workflow-finalize.js +27 -3
  96. package/package-dist/scripts/lib/foundry-workflow-identity-stage.js +202 -161
  97. package/package-dist/scripts/lib/foundry-workflow-identity.js +16 -10
  98. package/package-dist/scripts/lib/foundry-workflow-io.js +27 -6
  99. package/package-dist/scripts/lib/foundry-workflow-reference-verify.js +102 -29
  100. package/package-dist/scripts/lib/foundry-workflow-repair.d.ts +5 -0
  101. package/package-dist/scripts/lib/foundry-workflow-repair.js +204 -2
  102. package/package-dist/scripts/lib/foundry-workflow-semantic.js +41 -21
  103. package/package-dist/scripts/lib/identity-preflight-proof.d.ts +1 -0
  104. package/package-dist/scripts/lib/identity-preflight-proof.js +19 -12
  105. package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +1 -1
  106. package/package-dist/scripts/public-api.d.ts +6 -0
  107. package/package-dist/scripts/runtime-entry.js +15 -6
  108. package/package.json +5 -2
  109. package/specs/schemas/foundry-interaction-draft.schema.json +323 -0
  110. package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
  111. package/specs/schemas/foundry-operation-result.schema.json +1 -0
  112. package/specs/schemas/foundry-package-descriptor.schema.json +5 -2
  113. package/specs/schemas/foundry-scientific-repair.schema.json +66 -0
  114. package/specs/schemas/foundry-semantic-draft.schema.json +50 -0
  115. package/specs/schemas/foundry-task-start.schema.json +10 -2
  116. package/specs/schemas/runtime-qualification.schema.json +1 -1
package/README.md CHANGED
@@ -158,9 +158,9 @@ checkPaths:
158
158
  - test/unit/lint-suppression-audit.test.mts
159
159
  - test/unit/zero-javascript-ratchet.test.mts
160
160
  - test/scenarios/foundry-package-consumer.test.mts
161
- lastReviewedAt: 2026-11-15
162
- lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
163
- lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
161
+ lastReviewedAt: 2026-11-19
162
+ lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
163
+ lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
164
164
  ---
165
165
 
166
166
  # TianGong LCA Data Foundry
@@ -169,6 +169,8 @@ The ordinary user entry is the independently installed [TianGong Foundry skill](
169
169
 
170
170
  The public task protocol can retain a short goal and scope, register evidence-bound questions and raw answers, and distinguish task-wide, dataset-type-wide and exact registered-object choices. An object choice carries a versioned identity and current row hash; independent Process work can continue while another Process awaits an answer. Semantic results record only applicable decision IDs and their indexed before/after row hashes, while a concise recap points back to full evidence. The entry skill explains human decisions in plain language and accepts natural answers; Foundry presents the question, impact and next step before the exact record locator while preserving full evidence in indexed artifacts. The CLI keeps scientific validation and write permission separate. A source checkout implementing this protocol does not itself update the independently qualified installed runtime selection.
171
171
 
172
+ Use `task prepare-input` to bind an interaction or semantic submission to current task evidence. An existing owner draft can enter the scientific repair workflow with a reviewed before/candidate pair, field-level sources and a Worker provider-impact report. The [public task contract](docs/public-runtime-contract.md) describes the required files and recovery behavior.
173
+
172
174
  The package candidate now supports CLI-managed execution with verified runtime components and separate read/write workspace access. F1 publication and complete production qualification remain in progress; see `docs/package-distribution-contract.md` for the current release boundary.
173
175
 
174
176
  Migration transfer planning is governed by [the workspace migration contract](docs/workspace-migration-contract.md). W10 provides explicit source/queue/input staging, current-owner task adoption, audited v2 activation and separate runtime read/write selection. Preserved history blocks replay across requests and migrations; none of these records grants business permission. Operational qualification and release integration remain tracked in #108/#980.
@@ -152,9 +152,9 @@ checkPaths:
152
152
  - test/unit/foundry-runtime-environment.test.mts
153
153
  - test/unit/lint-suppression-audit.test.mts
154
154
  - docs/incremental-change-set-contract.md
155
- lastReviewedAt: 2026-11-15
156
- lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
157
- lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
155
+ lastReviewedAt: 2026-11-19
156
+ lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
157
+ lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
158
158
  ---
159
159
 
160
160
  # Architecture
@@ -189,6 +189,8 @@ Foundry selects a private session reference and exact project/user intent, then
189
189
 
190
190
  `foundry-runtime-qualification.ts` binds current Foundry package identity to exact public CLI and independently selected native TIDAS bytes/protocols. `foundry-execution-admission.ts` then binds the current source lineage, derived final rows, active grant/actions/QA evidence and owner CLI CommandSpec. Rehydration in a new process reconstructs every process-local proof and checks the exact owner-draft argv shape before returning the spec. Mutation dispatch, attempt transitions and readback remain with the existing CLI/orchestration owners.
191
191
 
192
+ The local descriptor preparer in `foundry-task-input-preparation.ts` derives digests from indexed task state. The scientific repair path in `foundry-scientific-repair.ts` binds the field sources, reviewer and native comparison. `foundry-repair-census.ts` independently observes visible identities and dependencies for preparation and original-attempt verification. [Public repair workflow](public-runtime-contract.md#scientific-process-repair)
193
+
192
194
  ## Public facade composition
193
195
 
194
196
  Preparation quality review is a Foundry-owned local policy decision over retained CLI QA evidence. `foundry-quality-review-input.ts` selects strict descriptors; `foundry-quality-review.ts` registers and rehydrates task-indexed evidence; `foundry-quality-review-lineage.ts` verifies the existing cleanup producer's exact validation-context derivation. Assessment, curation, finalization and execution admission consume the same narrow receipt. The CLI continues to own numerical QA, existing reference owners continue to own closure, and ordinary task authorization continues to own write permission. No separate task/state store or dataset writer is introduced.
@@ -183,3 +183,5 @@ The deterministic local `dataset-workflow-quality-review` stage uses the existin
183
183
  The local CLI failure path appends a failed operation receipt and a single `dataset-workflow-failure` artifact to the same hash-chained index. Its plan retains the original command, job and input scope. Failed receipts are never valid completed producers or successful cache entries. Task status verifies the original plan/receipt/artifact bytes without rerunning the child; partial stage output is not indexed as success. This forward diagnostic path neither reconstructs historical missing producers nor permits a mutation or UNKNOWN replay.
184
184
 
185
185
  A retained failed diagnostic is not a complete original producer for runtime adoption. The current strict adoption lineage reader rejects that history; status/readback support does not clear it or infer a recovery capability.
186
+
187
+ Preparing an interaction or semantic descriptor reads the current task index and returns a local result. Submitting it through `task resume` rechecks the state and selected files under the existing task contract. Scientific draft repair additionally retains the field-change evidence, Worker comparison and two-pass visible census behind its preparation receipt. The consumed write attempt continues through its original readback action. [Public inputs and outputs](public-runtime-contract.md)
@@ -39,20 +39,20 @@ related:
39
39
  - docs/runtime-context-contract.md
40
40
  - docs/task-authorization-contract.md
41
41
  - docs/safety-policy.md
42
- lastReviewedAt: 2026-11-15
43
- lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
44
- lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
42
+ lastReviewedAt: 2026-11-19
43
+ lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
44
+ lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
45
45
  ---
46
46
 
47
47
  # Foundry package distribution
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
- `specs/release/runtime-inputs.json` selects the exact public CLI source and version used by default preparation; the current source pins CLI 0.1.28 at `49c4ac555d35666e4a6ab8ad701338a45c345147`. The public production path verifies registry integrity and cryptographic provenance against that selection. An explicitly selected local CLI source candidate retains its own complete source, lock, archive and runtime facts and must match the fixed dependency version. Equal version strings do not identify equal programs. Package-specific minimum-release-age exceptions remain scoped; the default policy is unchanged.
51
+ `specs/release/runtime-inputs.json` selects the exact public CLI source and version used by default preparation; the current source pins CLI 0.4.0 at `7797e532b81120f4be2a516c5c0a4f8c8b545ec4`. The public production path verifies registry integrity and cryptographic provenance against that selection. An explicitly selected local CLI source candidate retains its own complete source, lock, archive and runtime facts and must match the fixed dependency version. Equal version strings do not identify equal programs. Package-specific minimum-release-age exceptions remain scoped; the default policy is unchanged.
52
52
 
53
53
  Historically, Foundry #215 adopted CLI 0.1.23 in source while retaining package version 0.1.13; the then-published Foundry 0.1.13 bundled CLI 0.1.22. That adoption required a separate version-only release and qualified final runtime manifest/lock. The already merged #210 terminal decision-recap characterization changed only two test files and added no runtime behavior.
54
54
 
55
- The package depends exactly on public `@tiangong-lca/cli@0.1.28`. 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.1, 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.
55
+ The package depends exactly on public `@tiangong-lca/cli@0.4.0`. 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.1, 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.
56
56
 
57
57
  The development verification chain from Sigstore through minimatch 10.2.6 now locks brace-expansion 5.0.12, a compatible patch within its existing range. Bounded isolated regressions cover both stack-exhaustion advisories while retaining ordinary expansion behavior. The sixteen-package production closure is unchanged. The high-severity audit threshold, default 1,440-minute release age and all package/native input versions remain unchanged; no advisory ignore or new dependency override is added.
58
58
 
@@ -194,7 +194,7 @@ Source CI preserves each successful native result under a run-attempt-specific a
194
194
 
195
195
  ## CI qualification and verified build reuse
196
196
 
197
- The local `pnpm prepush:gate` remains the complete developer gate. Full source CI partitions the complete test-file inventory into four duration-balanced groups on each Linux/macOS platform and ten on Windows x64. The plan digest binds the complete platform-to-shard mapping; aggregation requires all 22 receipts and every test file exactly once per platform. Test files execute in isolated Node processes; shared environment and process mocks never require concurrent tests within one process. New unprofiled files remain included. Successful per-file summaries from prior timed-out Windows runs provide measured weights; other-platform managed/adoption/identity timings retain explicit provisional estimates with the documented 1.4x hosted slowdown margin until successful native measurement. Partial event logs supply timing evidence only, never a passing shard receipt. The 40-minute job limit remains unchanged. Every shard binds the exact clean source and global plan digest, records Node-owned counters and per-file execution evidence, and hashes its event report. A separate native TAP diagnostic file retains assertion details before the complete run finishes; its payload is excluded from the machine event report and passing-receipt checks. Missing, duplicate, failed, platform-mismatched or stale results block qualification.
197
+ The local `pnpm prepush:gate` remains the complete developer gate. Full source CI partitions the complete test-file inventory into four duration-balanced groups on each Linux platform, eight on macOS arm64, and ten on Windows x64. The plan digest binds the complete platform-to-shard mapping; aggregation requires all 26 receipts and every test file exactly once per platform. Test files execute in isolated Node processes; shared environment and process mocks never require concurrent tests within one process. New unprofiled files remain included. Successful per-file summaries from prior timed-out Windows runs provide measured weights; other-platform managed/adoption/identity timings retain explicit provisional estimates with the documented 1.4x hosted slowdown margin until successful native measurement. Partial event logs supply timing evidence only, never a passing shard receipt. The 40-minute job limit remains unchanged. Every shard binds the exact clean source and global plan digest, records Node-owned counters and per-file execution evidence, and hashes its event report. A separate native TAP diagnostic file retains assertion details before the complete run finishes; its payload is excluded from the machine event report and passing-receipt checks. Missing, duplicate, failed, platform-mismatched or stale results block qualification.
198
198
 
199
199
  Foundry #260 keeps LPT, two test workers, matrix concurrency 16, the 40-minute job limit and the 20% plus 90-second planning allowance. Its source-bound Windows timing refresh selects ten shards from measured complete-file summaries while retaining labelled prior weights for changed test sources. The profile records durable source/artifact/event and selection hashes; partial/failed execution remains timing evidence only. The added indices require the current native platform's declared partition. Source commit/tree and the complete global plan hash change capsule identity, so previous source/native/bootstrap successes cannot substitute for a fresh complete candidate qualification.
200
200
 
@@ -342,7 +342,7 @@ Native handshake success is not minimum-host or clean-machine qualification. Cur
342
342
 
343
343
  `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.
344
344
 
345
- 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.28 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.
345
+ 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.4.0 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.
346
346
 
347
347
  The allocation consumer scenario exercises Product and Waste Flow targets in both Input and Output directions through the actual installed public CLI in the verified component cache. It checks the versioned semantic profile, exact candidate and original Flow hashes, profile/tolerance options hash, Elementary exclusion, missing-context status and immutable input bytes. This direct CLI launch is separate from genuine Foundry IPC. A Process source-evidence task then selects the validated Input Waste wrapper and its CLI report, binds both source hashes to the registered actor/task/runtime, follows returned IPC actions through local row materialization, and preserves the Process payload and exact semantic context. The report is recorded as selected evidence; it is not a Foundry semantic admission decision or remote write authority. Native TIDAS and predecessor runtime metadata in this scenario remain fixtures. Existing registered tasks require explicit reviewed runtime adoption; dependency/source delivery never migrates or replays them automatically.
348
348
 
@@ -360,7 +360,7 @@ Managed continuations retain the trusted manifest bytes in an exclusive content-
360
360
 
361
361
  Copied bootstrap qualification additionally starts a credential-free task and executes its exact returned action in a fresh process. That process must retain both the task id and ready runtime qualification. Source/recovery capsules and final public qualification require the `task-start` and `returned-action` phases on every supported platform, alongside the existing cold/warm, developer-command and tamper checks.
362
362
 
363
- The managed adoption extension ships `foundry-managed-adoption.schema.json` and its descriptor protocol alongside the unchanged managed-runtime v1 metadata. The control component belongs to the separately reviewed managed launch, not the npm payload or a task. It binds a sealed complete S and independently reviewed Q without inserting Q into S. Package qualification must exercise actual CLI `runtime exec` → direct package entry → managed host; a separately constructed public API host is supporting coverage only. Current source pins CLI 0.1.28; exact local CLI418 package and published/retained packages stay distinct frozen inputs.
363
+ The managed adoption extension ships `foundry-managed-adoption.schema.json` and its descriptor protocol alongside the unchanged managed-runtime v1 metadata. The control component belongs to the separately reviewed managed launch, not the npm payload or a task. It binds a sealed complete S and independently reviewed Q without inserting Q into S. Package qualification must exercise actual CLI `runtime exec` → direct package entry → managed host; a separately constructed public API host is supporting coverage only. Current source pins CLI 0.4.0; exact local CLI418 package and published/retained packages stay distinct frozen inputs.
364
364
 
365
365
  ## Stable installed selection and upgrade ownership
366
366
 
@@ -369,3 +369,5 @@ The existing public bin now also hosts installation-owned default selection and
369
369
  Skill instructions depend on the installed entry and public protocols. Deployment can change the selected complete release without changing skill files. The exact package dependency graph, runtime assets and task/attempt records remain version-bound. Historical standalone bootstrap locks remain reproducible release assets and have no precedence over an explicit deployment selection.
370
370
 
371
371
  CLI candidate updates enter through the existing Dependabot proposals and complete source/native/package CI. Release owners update the reviewed CLI source/provenance facts and run the existing release preparation and publication chain. An accepted dependency change produces a new immutable combination. Deployment verifies it, checks required protocols with `runtime describe`, installs the selected components, and updates its manifest/digest pair together. Restoring the preceding pair restores the prior default for new calls; existing tasks retain original returned actions. A new public protocol requires caller compatibility work; an unchanged protocol permits reuse of the same skill.
372
+
373
+ The scientific Process repair protocol packages its own selection schema. For that workflow the installation owner also supplies a qualified Worker `snapshot_builder` and the independently verified SHA-256 of the installed executable. Build from the reviewed Worker source with `cargo build --locked --release -p solver-worker --bin snapshot_builder` in a supported Worker build environment, or use a deployment artifact qualified for the same diagnostic. Keep its native libraries available in its deployed layout. Check the selected installation with the public provider-impact fixture before binding its digest in the host configuration. The [scientific repair contract](public-runtime-contract.md#scientific-process-repair) specifies the protocol marker, input evidence and task recovery.
@@ -38,9 +38,9 @@ related:
38
38
  - docs/runtime-context-contract.md
39
39
  - docs/task-authorization-contract.md
40
40
  - docs/package-distribution-contract.md
41
- lastReviewedAt: 2026-11-15
42
- lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
43
- lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
41
+ lastReviewedAt: 2026-11-19
42
+ lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
43
+ lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
44
44
  ---
45
45
 
46
46
  # Public runtime protocol
@@ -54,6 +54,7 @@ This is the implemented v1 facade protocol for `@tiangong-lca/foundry` and its `
54
54
  | `tiangong-foundry workspace init --workspace <path> --json` | Atomically initialize/verify the versioned workspace; preserve existing records and reject unversioned state requiring migration. No login or business write. |
55
55
  | `tiangong-foundry doctor --workspace <path> [--expected-project-ref <ref> --expected-user-id <uuid> [--session-reference <path>]] --json` | Read-only runtime, asset, workspace and account-readiness diagnostics. It checks only bounded reference metadata, never session contents, repository maintenance, Git, login or download. |
56
56
  | `tiangong-foundry task start --workspace <path> --spec <file> --json` | Validate the strict `task-start.v1` spec and independently capture its selected sources/optional seed. A relative spec path resolves from the selected workspace root. Request ID, actor, lane, profile, account intent and preparation live in the reviewed spec. |
57
+ | `tiangong-foundry task prepare-input --workspace <path> --task <id> --actor <id> --kind interaction\|semantic --input <draft.json> --json` | Read current indexed task evidence and return a strict `prepared_task_input` descriptor with derived SHA-256 bindings. No task registration, authentication or stage dispatch. |
57
58
  | `tiangong-foundry task status --workspace <path> --task <id> --actor <id> --json` | Reconstruct the exact registered request revision and inspect its current task/index/attempt state. Actor intent is supplied independently on every call. |
58
59
  | `tiangong-foundry task resume --workspace <path> --task <id> --actor <id> [--semantic-input <file> | --interaction-input <file> | --authorization-input <file> | --reference-input <file> | --identity-stage-input <file> | --quality-review-input <file>] --json` | Continue registered preparation, capture one bound interaction/semantic/reference/quality-review/approval input, explicitly admit a new read-only identity stage, or execute and verify a sealed owner scope. Input kinds are mutually exclusive. Consumed/ambiguous mutation state is readback-only and never replayed. |
59
60
  | `tiangong-foundry workspace migrate --workspace <path> --dry-run --json` | Inventory old state and produce a content-bound migration plan. Applying that plan is a separately explicit operation defined by W10. |
@@ -78,6 +79,10 @@ Status and resume resolve a task only through its immutable task pointer and req
78
79
 
79
80
  Native conversion uses the selected qualified TIDAS executable with an isolated environment. Automatic format detection omits the native `--from-format` option. Output files, the import report and the adapter result enter the existing content-bound task transaction. A converter-reported failure blocks later stages; successful conversion alone is not task completion. CLI context packs preserve their actual task-contained file references and enter the same index. A new invocation never adopts an interrupted, unindexed context generation.
80
81
 
82
+ For CLI 0.4 candidate qualification, the context stage calls the typed Dataset contract of each task entity. Foundry retains the original result and projects schema, methodology and ruleset files from its manifest. Each available component must match the recorded byte count and SHA-256 before the stage can register it. Flow and Process require all three components. Other dataset types can omit components the owner explicitly reports as unavailable. The Model command keeps the Foundry lifecyclemodel artifact type.
83
+
84
+ The CLI 0.4 candidate uses typed Flow validation in managed assessment and post-authoring. Each invocation checks schema and business rules against one exact Flow payload. Foundry retains the complete report and checks its result receipt, payload digest, UUID and version before projecting findings for curation. The stdout issue preview can omit findings. Remote references and candidate identity retain their separate verification stages.
85
+
81
86
  After context preparation, the facade materializes typed row arrays from the selected seed or the primary native dataset tree. Process-bundle copies remain evidence and are not counted as additional source rows. Derived inputs must have a verified producer in the same task index. Context preparation includes the converted dependency types as well as the requested types.
82
87
 
83
88
  The public facade assesses one current dataset type per resume. It registers a cumulative report with explicit `in_progress` or `completed` coverage, so the first actionable blocker can be returned before the remaining types finish; an independent type retains its continuation command. Every generation binds the previous indexed assessment, current rows, relevant context and task-interaction digest. Existing current set reports may be reused only when their row, context, queue closure, applicable interaction digest and registered artifact facts still match. A process/flow assessment builds its complete CLI-owned closure queue inside its own generation. A partial assessment is usable for current semantic work but cannot enter identity preflight, finalization, approval or completion. Direct internal callers that omit the bounded-set options retain their original full-batch operation.
@@ -102,6 +107,8 @@ After local semantic work is ready, a further resume performs process/flow ident
102
107
 
103
108
  Preflight reuses the existing request builder, query audit, receipt-bound runner and index merger. Requests target current unwrapped payloads and retain source trace context. Remote reads finish before a local transaction registers their immutable evidence; that transaction cannot replay a remote operation. Registration rechecks current rows under the task lock. Failed reads remain visible as `needs_input` and a later resume may retry the read-only stage. Status never performs a search. Successful preflight invalidates the earlier assessment, and the next resume re-runs curation against its exact identity index. Manual review becomes dedicated identity work even for the generic profile. This read evidence supplies decision context; submitting a bound identity decision remains separate from write authorization.
104
109
 
110
+ The CLI 0.4 identity candidate sends Foundry's audited search request to the existing Flow or Process hybrid-search Edge endpoint using the authenticated operator. The verified project, current target bytes, query, returned candidate versions and observation are retained for the identity review. Search results enter review because a bounded candidate query does not establish identity equivalence. Retained legacy attempts follow their original recovery contract.
111
+
105
112
  Source-context files accept JSON objects/arrays and JSONL, including current multi-row JSONL emitted by semantic identity apply. Format selection preserves the existing trace collector and exact per-row target/version/hash bindings. Malformed source content returns `source_trace_invalid` without parser excerpts or source contents; retained evidence is unchanged and request preparation dispatches no identity query.
106
113
 
107
114
  An executable next action preserves `cwd=workspaceRoot`, the application arguments and purpose. An unmanaged source/emitted host retains its direct Node/package entry. A verified managed host instead selects its exact CLI `runtime exec` command with the original trusted manifest digest, component cache and launch id before the unchanged Foundry arguments. Its verified binding digest covers every executable field; workspace, task and actor are explicit argv values, while task lookup revalidates the immutable revision fingerprint and current runtime/input facts before work. It has no `display` authority. A final restricted data CommandSpec still requires the W04 execution-context/identity/authorization gate; Owner execution validates it immediately before the first dispatch.
@@ -132,6 +139,28 @@ A changed scope requires `input_kind: repair_rows` authorization, an explicit `r
132
139
 
133
140
  Repair closeout requires the matching consumed native execution receipt plus independent exact owner/state/payload and reference-closure readback. It binds the same preparation report, never claims generic authoring/QA/location checks ran, and never accepts trace-normalized equality. A missing receipt or wrong readback remains unresolved; resume performs readback only and cannot repeat the mutation. Status rehashes retained proof and may complete a verified repair without a generic row-authoring finalization. An explicitly linked successor may proceed only when the predecessor has a producer-verified terminal CLI failure proving zero executed actions and zero consumed CLI attempts. It preserves the same request/account/identities, uses new immutable input paths and a genuinely changed desired payload, and requires a fresh preflight and grant. A fresh before image is permitted; old evidence remains immutable. Unknown or dispatched predecessors remain blocked.
134
141
 
142
+ ## Scientific Process repair
143
+
144
+ Use `runtime describe --json --require-protocol tiangong-foundry.scientific-repair.v1` to check the selected Foundry installation. The installation owner also provides a qualified `snapshot_builder` built from the Worker provider-impact implementation and configures its verified binary digest as described in the [host configuration contract](env-surface-policy.md). The [Worker provider-impact contract](https://github.com/tiangong-lca/worker/blob/e1e36d195701d8da61f2868e44a0eed4fc558e71/docs/provider-impact-diagnostic-contract.md) describes the input, invocation and matrix-only report.
145
+
146
+ Scientific and Exchanges edits submitted through the metadata selection fail offline with `repair_provider_impact_diagnostics_missing`. The diagnostic names affected paths and the Worker-owned before/candidate provider-impact evidence. The separate `existing-owner-draft-scientific` selection uses the same repair lane, contract, before/candidate and predecessor fields and adds a `scientific` descriptor path. Every referenced file must be an independently selected task source under its canonical absolute path. Scientific edits are bounded to Process exchanges, quantitative reference, mathematical relations, time, geography, technology, name, synonyms, general comment, classification, LCI method and source-treatment/representativeness fields. Dataset identity, administrative ownership/permissions, technical headers and opaque `common:other` fields remain protected. The existing metadata description-text allowance also applies.
147
+
148
+ The strict `tiangong-foundry.scientific-repair.v1` descriptor contains `author_id`, `worker_input`, `worker_report`, `changes`, `sources` and `review`. File selections use `{file, sha256}`. The author must equal the task actor. The native input is `worker.provider-impact.input.v1` in `matrix_only` mode and binds the same actor-owned state0 Process identities and complete selected before/candidate bodies. Its overlays cover exactly the changed Process rows. The independently reviewed full native report is recomputed by Foundry using the trusted deployed Worker and must match byte for byte. Its required `scope.frozen_selection_contract` is `worker.provider-impact.frozen-census.v1`, including on indexed-evidence reuse. Required provider/consumer closure and native-selection validation belong to that producer. [Worker #288](https://github.com/tiangong-lca/worker/issues/288)
149
+
150
+ The changes file uses `tiangong-foundry.scientific-repair-changes.v1` with a `changes` array. Each entry binds `id`, `version`, a JSON Pointer `path`, `before_sha256`, `after_sha256`, `basis` and structured `evidence`. Value hashes cover `{present: true, value}` or `{present: false}`. Every changed value appears exactly once. Added and removed array occurrences require their own entries. Each evidence item names its selected `source` and `source_sha256`, plus a quote present in those exact source bytes, or a JSON Pointer `path` and `value_sha256` covering its located `{present, value}`. The independent review follows the existing final-delivery reviewer contract with a distinct `reviewer_id`, `scope: scientific-content-and-provider-impact`, `status: PASS`, zero P0/P1 findings and exact `reviewed_artifacts` coverage. Required artifact IDs are `before`, `candidate`, `worker_input`, `worker_report`, `changes` and `source_0` through the last selected source. Review, source and candidate changes invalidate the scope.
151
+
152
+ Preparation scans the complete public100 and actor-owned0 Process, Model and Flow dependency directories twice through the authenticated public read interface. The directory requests identity/visibility and the JSON subtrees needed to project Flow references, Model result/component references and exact declared Flow types. Retained directory evidence contains compact identity projections, each original response hash and its redacted current identity receipt. A long read renews the same account/project/runtime receipt through the existing CLI owner under its original freshness rules.
153
+
154
+ A conservative undirected identity component separates the supplied family from all visible peers. Shared Product/Waste, Other and unknown Flow UUIDs connect Processes across every visible revision. Only a reference whose exact visible Flow revision explicitly declares `Elementary flow` can be excluded from this connection proof. Model associations and every visible Model revision's result/component identities also connect the family. Candidate Process references participate before any write. Signs, weights, geography and provider choices remain Worker-owned. Missing connected Process/Model members, omitted visible historical revisions and uncertain relevant references reject. An isolated unrelated missing dependency can remain outside the proved family.
155
+
156
+ Only the complete selected family and its exact supporting bodies are read twice and compared with the frozen Worker input. Versionless Flow choices must match the latest eligible revision in the full visible Flow directory. Public state200 supporting Source/Contact/FlowProperty/UnitGroup data retain their existing admission, while numeric Flows keep the state100/owner0 predicate. Each directory type is bounded to 100000 combined visible rows, the complete read to 1 GiB of transferred response bytes, and the retained compact projections and exact family evidence to separate 64 MiB budgets across both passes. Worker retains its own 10000-total-document and 64 MiB request bounds. A larger or inseparable family fails explicitly.
157
+
158
+ The proof distinguishes `directory_complete` from `body_scope: closed_conservative_family`, records global-directory and selected-family counts/digests, and retains `transaction_snapshot: false` and `double_scan: true`. Pagination/count/identity drift, changed projections or family bodies, unknown ownership and unproved separation fail closed. The native report retains its `supplied_finite_universe` and unverified-online scope flags. Foundry records these separate authenticated observations and rechecks the current family before the first consumed mutation attempt.
159
+
160
+ The published CLI applies every proposed field edit to the exact before payload and its output must equal the complete reviewed candidate. Scientific repair currently admits the generic profile with every typed validation layer, native TIDAS schema and existing curation gate passing. Complete census-verified Flow, FlowProperty and UnitGroup bodies supply local QA. Native schema validation uses the existing exact Flow-context wrapper projection and verifies that every write payload stays equal to the reviewed candidate. Deterministic cleanup must preserve the selected candidate content, otherwise the revised complete candidate requires a new immutable scope. The resulting preparation binds source review, native provider-impact, census, patch, validation, cleanup and curation evidence through the task producer index. Authorization uses the existing `repair_rows` descriptor and seals that exact preparation. Existing owner/state/preimage CAS, single-dispatch attempt consumption and exact readback apply.
161
+
162
+ After root and dependency readback, scientific repair observes the complete census again with the approved overlays applied. A changed peer, incomplete observation or lineage/dependency mismatch retains an unresolved consumed attempt and readback-only recovery. Successful readback records `concurrent_interval_atomicity: unproven` because the complete scans and the target CAS use separate transactions. It establishes the recorded before/after observations and exact target write, while concurrent changes between those observations retain that explicit limit. Later readback can resolve an original attempt only against the same reviewed overlay and peer evidence.
163
+
135
164
  ## Canonical reference verification
136
165
 
137
166
  Identity reuse retains original source rows in the reference partition and selects different canonical targets in its rewrite evidence. After current finalization, resume verifies those selected table/id/version targets through the qualified CLI `dataset verify-remote --root-policy existing`. Its generated query contains only reference descriptors. It does not compare the source payload with the reused dataset or construct a write candidate.
@@ -166,6 +195,21 @@ Reassessment and finalization recheck the complete observation, rows, context, r
166
195
 
167
196
  The review digest participates in assessment and finalization freshness. Final write authorization and execution admission remain independent and recheck any quality review required by the final rows. A review creates no grant, capsule, owner request, dispatch or attempt, changes no `allowed_actions`, and cannot recover or replay an existing attempt.
168
197
 
198
+ ## Preparing interaction and semantic inputs
199
+
200
+ Use the public `task prepare-input` command to derive the exact current bindings before `task resume`. The same API is `facade.prepareInput({ taskId, actorId, kind, draftFile })`. Preparation reads task evidence and selected local files and returns the descriptor as the inline `prepared_task_input` artifact. Save that artifact's `value` as a JSON file, then submit it with `--interaction-input` or `--semantic-input`. Preparation does not register an event or execute a task stage. Submission still rechecks current state, task locks, scientific evidence, authorization and consumed attempts.
201
+
202
+ An [interaction draft](../specs/schemas/foundry-interaction-draft.schema.json) has `schema: "tiangong-foundry.interaction-draft.v1"` and `events`. Events retain the strict interaction fields but select `evidence_files: ["<registered-source-or-artifact-path>"]` in place of digest strings. An optional narrow `object_scope` selects `{ "entity_id": "<id>", "version": "<version>" }`. Preparation verifies a unique current registered row and computes `row_sha256`. It also derives task/actor, current `expected_state_sha256` and registered evidence byte hashes. A single events array may contain a question followed by its already-confirmed answer and explicit `decision_id`.
203
+
204
+ A [semantic draft](../specs/schemas/foundry-semantic-draft.schema.json) has `schema: "tiangong-foundry.semantic-draft.v1"` and `submissions`. Each submission selects `{ "kind": "patch", "authoring_task": "<current-task.json>", "file": "<completed-patch.json>" }`, with optional explicit `decision_ids`. Other supported kinds are `classification`, `location` and `identity`. Preparation proves the authoring task belongs to the current assessment and derives `assessment_sha256`, current `interaction_sha256`, `authoring_task_sha256`, and each selected file's raw byte `sha256`. Paths resolve against the explicit workspace and output file selections are absolute.
205
+
206
+ ```bash
207
+ tiangong-foundry task prepare-input --workspace /absolute/workspace --task "$TASK_ID" --actor "$ACTOR_ID" --kind interaction --input /absolute/interaction-draft.json --json
208
+ tiangong-foundry task prepare-input --workspace /absolute/workspace --task "$TASK_ID" --actor "$ACTOR_ID" --kind semantic --input /absolute/semantic-draft.json --json
209
+ ```
210
+
211
+ The descriptor binds one observed state. A concurrent event or changed file requires fresh preparation and review. Strict descriptors continue to be accepted directly, and stale submitted digests remain rejected. File-reference `sha256` values always hash exact file bytes, including whitespace and newlines. `object_scope.row_sha256` uses the canonical entire registered row object. CLI native `payload_sha256` uses its canonical TIDAS payload digest. These fields bind different objects, and their values must come from their corresponding producers.
212
+
169
213
  ## Authorization input
170
214
 
171
215
  `--authorization-input` selects a strict `tiangong-foundry.authorization-input.v1` descriptor separately from semantic input. It binds task, actor, current finalization SHA-256, dataset type, `input_kind` (`current_rows` or `final_rows`), input SHA-256 and expected previous authorization-pointer SHA-256 (null for initial registration). It separately selects a grant file and unique user-decision/source-model evidence files with hashes. At least one user-decision item is required; each file is bounded to 8 MiB and the selection to 64 MiB. Credential and linked-file inputs are rejected. The grant's evidence references must use the selected canonical absolute paths, as required by the existing registration contract.
@@ -174,6 +218,8 @@ For `input_kind=final_rows` with Flow, Process or Source, the descriptor may als
174
218
 
175
219
  Finalization exposes per-scope `authorization_inputs` with independently computed bindings and input digests. These are review metadata, not grants. The trusted caller must select approval evidence from actual current user authorization; task output or grant text alone cannot supply approval. The existing validator checks the grant, current CLI identity and scope; registration rechecks current finalization while holding the task lock and uses the existing compare-and-swap pointer. Concurrent distinct initial grants cannot both activate.
176
220
 
221
+ The CLI 0.4 candidate seals the Foundry draft plan and records an attempt before dispatch. The existing Edge create interface receives the exact approved UUID, version and payload. For an existing Flow identity, the plan also binds the visible predecessor and repeats the exact head check immediately before creating the next approved version. The typed `dataset model create` command uses the existing Model bundle transaction so Model content and its derived graph are saved together. Guarded Process repair passes the complete approved before document to the existing Edge save interface for comparison inside the transaction. An explicit insert contract remains bound to the plan and its ordered final rows. Recovery uses the original Foundry attempt and independent exact readback. A retained CLI-native attempt still requires its original CLI receipt and readback under its original runtime.
222
+
177
223
  For a ready `final_rows` scope, the runtime rebuilds the original owner handoff under the validated grant, binds CommandSpec artifacts to absolute final-row paths, and creates the existing execution capsule. It registers a `foundry-authorization.json` result; identical current submissions reuse it without re-authentication or another capsule. Projection requires the matching current finalization, active pointer digest and unexpired record. A sealed result is explicitly pending execution and never dispatches a mutation. `current_rows` registration records preparation approval. Subsequent resume re-finalizes the selected type under that current grant, then proves final-row lineage and derives/activates the exact successor before sealing. Actions, evidence, account/profile binding and expiry are unchanged. Equal-byte derived files reuse the original grant only after lineage proof. A capture interruption after activation resumes from the retained preparation approval and verifies the active grant is its exact derivation; it does not request another approval. Blocked re-finalization retains its reports without repeating remote reads. Existing authorization, capsule and no-replay rules remain authoritative for subsequent execution.
178
224
 
179
225
  ## Task interaction input
@@ -249,6 +295,8 @@ The public facade accepts CLI/TIDAS expectations only through its process-local
249
295
 
250
296
  Cleanup may change the byte representation of a Unit Group or Flow Property before its input-bound permission is reapplied. When the selected scope is blocked only by `reference_only_support_type_write_blocked` and the retained approval includes both its exact write action and `canonical_support_local_mint`, resume may derive the grant against the already indexed final-row lineage. It then re-finalizes that scope using the newly bound input and original approval origin. Actions, evidence, account/profile and expiry remain unchanged. Schema, content, reference and other blockers cannot enter this path.
251
297
 
298
+ For the CLI 0.4 candidate, support finalization validates the exact create intent and reads each dependency version through the typed CLI. The owner execution capsule seals a distinct Edge create plan over the approved final-row bytes, project, account and exact dependency payloads. The existing owner attempt record is written before dispatch. A consumed plan is recovered using the original request and a fresh exact Edge readback of the roots and dependencies. A dependent FlowProperty scope waits for the original UnitGroup scope to complete before it can dispatch.
299
+
252
300
  Finalization records which authorization hash it used; a still-blocked result under that same grant is retained instead of repeatedly running the stage. Completed scopes preserve their original reports and final-row generations during both ordinary dependency finalization and later prepared-approval continuation. A ready scope with an already activated derived grant returns a bound continuation command to finish sealing, without requesting another approval.
253
301
 
254
302
  ## Account verification mode
@@ -263,6 +311,8 @@ Production-test mode never invokes traceHash acceptance: owner/state/identity/ve
263
311
 
264
312
  CLI session ownership, fresh identity receipts and the existing explicit process-only headless contract remain authoritative. Workspace/task/actor intent applies on every host; a Codex thread id is supplemental. Doctor reports `not_requested`, `needs_auth` or `configured_unverified` from explicit intent and bounded session-reference metadata without reading it or claiming authentication. Actual restricted resume obtains a fresh CLI identity. Login never grants publish/delete/mint permission. Existing approval for an unchanged batch is reused after evidence validation; no per-row confirmation is introduced. When a new approval is necessary, preparation and reviewable mutation evidence come first.
265
313
 
314
+ Direct Edge requests in the CLI 0.4 candidate support the existing process-only token input and the default operator OAuth mode. For OAuth, Foundry uses the existing public client registration and loopback PKCE, verifies the subject online and checks it against the current CLI-verified task project and operator. The Edge bearer is reused within the current process and is held in memory. The existing CLI login and its private cache continue to belong to the CLI.
315
+
266
316
  The facade cannot authorize actions from source text or infer permission from a historical profile. Missing grants block only affected operations; independent preparation and ready scopes continue. User-facing summaries show stages, counts and concrete remedies, with versions/argv/hashes in diagnostic artifacts when needed.
267
317
 
268
318
  Transfer planning adds `--to <destination> --actor <actor> --request <request>` and optional repeated `--stage-manifest <source-state-relative-path>` to the same dry-run operation. It produces `workspace-migration-transfer-plan.v2`, independently binds runtime and intent, observes source bytes again, and interprets selected historical attempt evidence without granting execution authority. Explicit adoption/apply/audit and runtime selection are defined by the migration contract. See [workspace migration](workspace-migration-contract.md). Both inventory and transfer paths reject unsupported hosts before legacy-state reads.
@@ -45,9 +45,9 @@ related:
45
45
  - docs/task-authorization-contract.md
46
46
  - docs/public-runtime-contract.md
47
47
  - docs/package-distribution-contract.md
48
- lastReviewedAt: 2026-11-15
49
- lastReviewedCommit: c30a1f516553282f7c82c82c5733689557078b5c
50
- lastReviewedNote: "Foundry #278: reviewed the 0.1.18 package, verifier and descriptor version projections over main containing the installed-entry change; runtime inputs, workflow, ownership and task contracts are unchanged."
48
+ lastReviewedAt: 2026-11-19
49
+ lastReviewedCommit: 119f1e2b6248532baf3d0f9989fe84fcebc864e3
50
+ lastReviewedNote: "Foundry #287: reviewed the four eligible development-tool updates and complete unchanged lock graph during formatting; native/source qualification, compiler and public-runtime closure, cache inputs, credential and publishing authority remain unchanged."
51
51
  ---
52
52
 
53
53
  # Runtime context
@@ -60,8 +60,12 @@ The runtime entry now exposes the six W05 hierarchical operations described in `
60
60
 
61
61
  The public task facade delegates sealed owner execution to `foundry-workflow-execution.ts`, request/attempt state to `foundry-owner-execution-store.ts`, and independent owner verification to `foundry-owner-readback.ts`. The existing closeout factory lives under `lib/finalize-owners` with its developer-command re-export preserved. Local operation receipts capture evidence only; the CLI batch boundary owns one-shot mutation and readback recovery. `foundry-workflow-reference-verify.ts` separately binds current semantic canonical targets to qualified CLI reference checks, using an explicit authentication environment and fresh output generation. See [public execution and recovery](public-runtime-contract.md#owner-execution-and-recovery).
62
62
 
63
+ A scientific repair pins its deployment-selected Worker executable separately from the CLI and TIDAS runtime qualification. Its public result binds the frozen input, native report and the observed visible directory. The original task keeps those input and execution identities across preparation, approval and recovery. [Scientific repair](public-runtime-contract.md#scientific-process-repair)
64
+
63
65
  ## Runtime qualification and child admission
64
66
 
67
+ The installed CLI contract test exercises the package's actual executable without credentials. It checks command and option availability for authoring context, identity preflight, exact reference/readback verification, and execution-contract draft writes. A dependency candidate can retain the public TypeScript exports while removing these executable routes. When migrating the Foundry callers, update the test alongside those callers and qualify behavior with the candidate's real package.
68
+
65
69
  The public workflow selects derived row/context facts from the current verified task index before assessment. `runFoundryTaskOperation` rechecks their producer ancestry and original sources. Native validation and the exact CLI's local QA/queue commands use the qualified runtime and isolated environment; curation and authoring write only to a fresh task-owned generation. Runtime assets and source-owner reference bases remain separate from user workspace paths.
66
70
 
67
71
  For queue build, the exact CLI's exit 1 can carry a valid `blocked` data report. Foundry verifies its schema/status pair, current selected row paths and SHA-256 values, and the complete regular-file queue output tree before indexing those artifacts. Process `dataset validate` likewise admits exit 0/1 only when the complete report matches the current row candidate, four validation layers, allocation/reference coverage, supplied exact Flow documents and output artifacts. The exact SDK 0.5.1 `core/validation/process-semantics` and native 0.3.4 `tidas-validation/src/process_semantics.rs` emit checks by applicability; `contracts.rs` accumulates those emitted checks. Undeclared/scalar-empty and targetless compatibility modes do not require explicit-target fraction/direction coverage. Missing profile evidence or unresolved coverage presented as passed is rejected without introducing scientific rules. Its data findings become existing bounded authoring action items; absence or inconsistency of evidence fails closed. Other CLI exits retain their existing fail-closed treatment. A blocked closure is a local evidence gap; it cannot grant authorization, finalization or a replay of any owner attempt.
@@ -147,3 +147,5 @@ The explicit public authorization workflow supplies an internal trusted `refresh
147
147
  Current state, selected rows/evidence and active pointer are rechecked under the lock. Registration checks grant expiry after its final current-state check; loading verifies pointer equality again before returning. Fresh identity does not extend grant lifetime, alter the 60-second rule, clear attempts, change native insert-only contracts, or retain credentials in another store. Same-task runtime adoption supplies no authorization and preserves original owner-recovery barriers.
148
148
 
149
149
  The L=S+K carrier binds compatibility through independently reviewed component inventory and full executing-runtime equality. Its same-package Q brand supplies no account or write grant; all original source/profile/registration/CAS/stop/consumed/UNKNOWN checks remain. An explicit cli-auth policy projects process-only credentials into current identity verification while task account/session intent remains authoritative; a parent receipt cannot replace the fresh child receipt.
150
+
151
+ A scientific Process repair uses `input_kind=repair_rows` and the existing scoped grant. The Worker comparison, field sources, reviewer report and observed census qualify the candidate for approval. A consumed attempt with unresolved peer or root evidence remains eligible only for readback. The target compare-and-swap and the independent census observations have separate transaction boundaries. [Scientific Process repair](public-runtime-contract.md#scientific-process-repair)