@tiangong-lca/foundry 0.1.17 → 0.1.18

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 (111) hide show
  1. package/README.md +23 -7
  2. package/docs/architecture.md +15 -3
  3. package/docs/foundry-task-contracts.md +27 -3
  4. package/docs/package-distribution-contract.md +45 -13
  5. package/docs/public-runtime-contract.md +73 -5
  6. package/docs/runtime-context-contract.md +20 -4
  7. package/docs/task-authorization-contract.md +15 -3
  8. package/docs/workspace-migration-contract.md +5 -3
  9. package/package-dist/assets/foundry-package-descriptor.json +333 -139
  10. package/package-dist/scripts/foundry-facade.d.ts +5 -0
  11. package/package-dist/scripts/foundry-facade.js +258 -16
  12. package/package-dist/scripts/foundry-runtime.d.ts +1 -1
  13. package/package-dist/scripts/lib/bundle-sample-utils.d.ts +4 -4
  14. package/package-dist/scripts/lib/bundle-source-context.d.ts +6 -4
  15. package/package-dist/scripts/lib/bundle-source-context.js +10 -8
  16. package/package-dist/scripts/lib/decision-owners/identity-preflight.js +16 -6
  17. package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +2 -1
  18. package/package-dist/scripts/lib/finalize-owners/post-authoring.js +28 -1
  19. package/package-dist/scripts/lib/foundry-assessment-producer.d.ts +6 -0
  20. package/package-dist/scripts/lib/foundry-assessment-producer.js +167 -0
  21. package/package-dist/scripts/lib/foundry-command-metadata.js +6 -1
  22. package/package-dist/scripts/lib/foundry-decision-owners.d.ts +1 -1
  23. package/package-dist/scripts/lib/foundry-decision-owners.js +15 -7
  24. package/package-dist/scripts/lib/foundry-execution-admission.js +4 -1
  25. package/package-dist/scripts/lib/foundry-finalize-owners.js +64 -17
  26. package/package-dist/scripts/lib/foundry-identity-stage-input.d.ts +24 -0
  27. package/package-dist/scripts/lib/foundry-identity-stage-input.js +122 -0
  28. package/package-dist/scripts/lib/foundry-identity-stage-state.d.ts +17 -0
  29. package/package-dist/scripts/lib/foundry-identity-stage-state.js +48 -0
  30. package/package-dist/scripts/lib/foundry-installed-entry.d.ts +2 -0
  31. package/package-dist/scripts/lib/foundry-installed-entry.js +173 -0
  32. package/package-dist/scripts/lib/foundry-managed-adoption.d.ts +12 -0
  33. package/package-dist/scripts/lib/foundry-managed-adoption.js +108 -0
  34. package/package-dist/scripts/lib/foundry-managed-authentication.d.ts +4 -0
  35. package/package-dist/scripts/lib/foundry-managed-authentication.js +28 -0
  36. package/package-dist/scripts/lib/foundry-managed-host.js +14 -2
  37. package/package-dist/scripts/lib/foundry-migration-transfer-io.d.ts +2 -0
  38. package/package-dist/scripts/lib/foundry-migration-transfer-io.js +27 -3
  39. package/package-dist/scripts/lib/foundry-operation-result.d.ts +1 -1
  40. package/package-dist/scripts/lib/foundry-operation-result.js +1 -0
  41. package/package-dist/scripts/lib/foundry-package-contract.d.ts +4 -4
  42. package/package-dist/scripts/lib/foundry-package-contract.js +10 -2
  43. package/package-dist/scripts/lib/foundry-preparation-cli-validation.d.ts +2 -0
  44. package/package-dist/scripts/lib/foundry-preparation-cli-validation.js +25 -3
  45. package/package-dist/scripts/lib/foundry-quality-review-context.d.ts +3 -0
  46. package/package-dist/scripts/lib/foundry-quality-review-context.js +18 -0
  47. package/package-dist/scripts/lib/foundry-quality-review-input.d.ts +48 -0
  48. package/package-dist/scripts/lib/foundry-quality-review-input.js +284 -0
  49. package/package-dist/scripts/lib/foundry-quality-review-lineage.d.ts +13 -0
  50. package/package-dist/scripts/lib/foundry-quality-review-lineage.js +123 -0
  51. package/package-dist/scripts/lib/foundry-quality-review.d.ts +112 -0
  52. package/package-dist/scripts/lib/foundry-quality-review.js +487 -0
  53. package/package-dist/scripts/lib/foundry-runtime-identity.js +3 -1
  54. package/package-dist/scripts/lib/foundry-runtime-qualification.js +2 -2
  55. package/package-dist/scripts/lib/foundry-runtime-utils.js +1 -1
  56. package/package-dist/scripts/lib/foundry-task-authorization.d.ts +2 -1
  57. package/package-dist/scripts/lib/foundry-task-authorization.js +32 -11
  58. package/package-dist/scripts/lib/foundry-task-registration.js +4 -5
  59. package/package-dist/scripts/lib/foundry-task-runtime-adoption-write.d.ts +28 -0
  60. package/package-dist/scripts/lib/foundry-task-runtime-adoption-write.js +250 -0
  61. package/package-dist/scripts/lib/foundry-task-runtime-adoption.d.ts +60 -0
  62. package/package-dist/scripts/lib/foundry-task-runtime-adoption.js +549 -0
  63. package/package-dist/scripts/lib/foundry-task-store.d.ts +4 -1
  64. package/package-dist/scripts/lib/foundry-task-store.js +113 -4
  65. package/package-dist/scripts/lib/foundry-task-types.d.ts +2 -1
  66. package/package-dist/scripts/lib/foundry-validation-reference-context.d.ts +8 -0
  67. package/package-dist/scripts/lib/foundry-validation-reference-context.js +115 -0
  68. package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +1 -0
  69. package/package-dist/scripts/lib/foundry-workflow-assessment.js +115 -22
  70. package/package-dist/scripts/lib/foundry-workflow-authorization.js +17 -4
  71. package/package-dist/scripts/lib/foundry-workflow-child-failure.d.ts +44 -0
  72. package/package-dist/scripts/lib/foundry-workflow-child-failure.js +439 -0
  73. package/package-dist/scripts/lib/foundry-workflow-context.js +37 -8
  74. package/package-dist/scripts/lib/foundry-workflow-finalize.js +37 -0
  75. package/package-dist/scripts/lib/foundry-workflow-identity-recovery.d.ts +6 -0
  76. package/package-dist/scripts/lib/foundry-workflow-identity-recovery.js +450 -0
  77. package/package-dist/scripts/lib/foundry-workflow-identity-stage.d.ts +9 -0
  78. package/package-dist/scripts/lib/foundry-workflow-identity-stage.js +676 -0
  79. package/package-dist/scripts/lib/foundry-workflow-identity.js +10 -1
  80. package/package-dist/scripts/lib/foundry-workflow-io.d.ts +7 -1
  81. package/package-dist/scripts/lib/foundry-workflow-io.js +76 -11
  82. package/package-dist/scripts/lib/foundry-workflow-semantic.js +27 -13
  83. package/package-dist/scripts/lib/foundry-workflow-state.d.ts +4 -0
  84. package/package-dist/scripts/lib/foundry-workflow-state.js +165 -22
  85. package/package-dist/scripts/lib/identity-preflight-artifacts.d.ts +4 -7
  86. package/package-dist/scripts/lib/identity-preflight-artifacts.js +18 -5
  87. package/package-dist/scripts/lib/identity-preflight-proof.d.ts +5 -0
  88. package/package-dist/scripts/lib/identity-preflight-proof.js +73 -1
  89. package/package-dist/scripts/lib/identity-preflight-recovery-proof.d.ts +78 -0
  90. package/package-dist/scripts/lib/identity-preflight-recovery-proof.js +415 -0
  91. package/package-dist/scripts/lib/import-curation/curation-cleanup.d.ts +9 -1
  92. package/package-dist/scripts/lib/import-curation/curation-cleanup.js +39 -2
  93. package/package-dist/scripts/lib/import-curation/curation-gate.d.ts +1 -0
  94. package/package-dist/scripts/lib/import-curation/curation-gate.js +19 -1
  95. package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +1 -1
  96. package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.js +11 -2
  97. package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.js +4 -1
  98. package/package-dist/scripts/package-entry.js +2 -3
  99. package/package-dist/scripts/public-api.d.ts +5 -0
  100. package/package-dist/scripts/public-api.js +2 -0
  101. package/package-dist/scripts/runtime-entry.d.ts +2 -0
  102. package/package-dist/scripts/runtime-entry.js +42 -15
  103. package/package.json +6 -2
  104. package/specs/schemas/foundry-identity-stage-input.schema.json +47 -0
  105. package/specs/schemas/foundry-managed-adoption.schema.json +40 -0
  106. package/specs/schemas/foundry-managed-runtime.schema.json +1 -1
  107. package/specs/schemas/foundry-operation-result.schema.json +1 -0
  108. package/specs/schemas/foundry-package-descriptor.schema.json +6 -2
  109. package/specs/schemas/foundry-quality-review-draft.schema.json +271 -0
  110. package/specs/schemas/foundry-quality-review-input.schema.json +271 -0
  111. package/specs/schemas/runtime-qualification.schema.json +1 -1
@@ -40,14 +40,14 @@ checkPaths:
40
40
  - test/scenarios/runtime-workspace.test.mts
41
41
  - test/scenarios/foundry-execution-admission.test.mts
42
42
  - test/scenarios/foundry-package-consumer.test.mts
43
- lastReviewedAt: 2026-10-08
44
- lastReviewedCommit: d07ac492a3a5891502039a6cc83ef30b9fbba50b
45
- lastReviewedNote: "Reviewed Foundry #237 exact three-field 0.1.16 to 0.1.17 release projection from eligible PR236 Main d07ac492; CLI/native pins, lock closure, authorization and all business source remain unchanged. Official publication and final managed qualification remain pending."
46
43
  related:
47
44
  - docs/architecture.md
48
45
  - docs/task-authorization-contract.md
49
46
  - docs/public-runtime-contract.md
50
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."
51
51
  ---
52
52
 
53
53
  # Runtime context
@@ -66,7 +66,7 @@ The public workflow selects derived row/context facts from the current verified
66
66
 
67
67
  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.
68
68
 
69
- `qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.27` runtime descriptor. It also compares a strict TIDAS expectation with the selected platform, executable bytes, compatible 0.2.x or 0.3.x version, validation protocols, event schemas and asset fingerprint. The selected TIDAS executable is copied into a private temporary directory, rehashed there and invoked with the credential-free child environment; both handshake calls must be silent. Qualification uses a process-local brand. The portable identity described by `runtime-qualification.schema.json` is diagnostic evidence and cannot be deserialized into authority.
69
+ `qualifyFoundryRuntime` compares an independently selected CLI expectation with the exact installed `@tiangong-lca/cli@0.1.28` runtime descriptor. It also compares a strict TIDAS expectation with the selected platform, executable bytes, compatible 0.2.x or 0.3.x version, validation protocols, event schemas and asset fingerprint. The selected TIDAS executable is copied into a private temporary directory, rehashed there and invoked with the credential-free child environment; both handshake calls must be silent. Qualification uses a process-local brand. The portable identity described by `runtime-qualification.schema.json` is diagnostic evidence and cannot be deserialized into authority.
70
70
 
71
71
  The TIDAS expectation admits only `linux-x64`, `linux-arm64`, `darwin-arm64` and `win32-x64`; `darwin-x64` cannot enter the schema or runtime context. `tidas-runtime-expectation.schema.json` is the reviewed machine shape. Qualification creation performs the isolated version/protocol/assets handshake once. Every later assertion reopens and hashes the selected executable and rejects any byte drift before child admission; identical immutable bytes do not replay the handshake. This keeps the original observed behavior bound to exact content while avoiding repeated child-process creation inside one admission call.
72
72
 
@@ -111,6 +111,8 @@ User-selected external inputs are regular files captured as canonical path, byte
111
111
 
112
112
  Task artifacts are written only under the selected `taskRoot`; state and cache have distinct resolver areas. Existing path components and physical containment are checked, including after directories are created. Symlink/junction escapes and a changed workspace marker are rejected. A complete new artifact is installed exclusively from an owned temporary file. Existing identical bytes may be reused; different existing bytes require a new output revision. A failed operation never deletes a prior artifact.
113
113
 
114
+ The Task store can capture already generated stage outputs without rewriting their bytes. Its private transaction capability verifies current writer/runtime/source/input bindings before, between and after the fresh output reads, then records the complete matching batch. Completed-receipt publication rechecks these bindings after the callback returns. Content writers retain their per-write checks. This adds no public entry, environment trust, business permission or cross-operation proof cache; the sampling boundary is documented in [the Task contract](foundry-task-contracts.md#local-operation-plans-and-receipts).
115
+
114
116
  The default in-memory data-read bound is 64 MiB; native/streaming stages must declare and enforce their own larger-input protocol instead of silently loading unbounded payloads. Cache contents and layout records are not write or replay authority.
115
117
 
116
118
  ## Facade state and downstream integration
@@ -146,3 +148,17 @@ Managed command continuations retain the original verified launch id through the
146
148
  Public reference selection uses the internal `dataset-workflow-reference-input` task operation. It preserves selected source evidence, publishes indexed QA/review snapshots and a derived intent with only file locators changed. Current row and reference-selection digests fence finalization; snapshot files remain selected inputs for authorization, execution and readback. The selected package/CLI/TIDAS trust anchors and account authority are unchanged.
147
149
 
148
150
  The public execution owner verifies current identity separately for initial rehydration and the final complete pre-dispatch admission pass. Local work between them cannot reuse the earlier receipt as fresh authority. Both passes retain current runtime, account, grant, input and CommandSpec verification before the existing attempt-consumption boundary; no replay or additional grant is introduced.
151
+
152
+ ## Exact compatibility and diagnostic interpretation
153
+
154
+ The public same-task adoption host is described in [the public runtime contract](public-runtime-contract.md#same-task-compatibility-and-retained-identity-diagnostics). Its immutable receipt chain qualifies complete old/new package and CLI inventories, retains identical Node/Toolkit bytes, and enforces the selected tip during current continuation. Native successor links use contained slash-separated relative locators on every platform; the immutable writer still rejects traversal, absolute paths and links. Four legacy identity fields or equal package versions cannot establish compatible code. Prior producer/context facts remain history and do not stand in for fresh current machine gates.
155
+
156
+ Identity report interpretation supports the current CLI 0.1.28 and retained 0.1.27 manual-review exit-1 pair after complete bound validation. Retained 0.1.22 reports require their own original account/CLI/producer facts and an independently qualified predecessor inventory. A recovery proof is a new interpretation, not a historical CLI execution manifest, and cannot replace a missing original raw authenticated receipt. Present retained executable/inventory readback is explicitly current observation.
157
+
158
+ Explicit Process reference selection reaches initial queue/QA and the current CLI validation wrapper. Native input and scientific Process bytes remain unchanged. Missing/wrong exact bodies and projection/report/reference drift remain blocking evidence.
159
+
160
+ The managed adoption carrier explicitly proves L and S use the same complete execution components/cache keys and identical launch/workspace constraints before setting workspace access to S. The original L remains the launch authority for returned actions; `runtimeTarget` alone cannot establish executing-runtime ownership. Inventory-bound control files issue no credential or write permission. See the public runtime contract for the no-cycle construction and child authentication boundary.
161
+
162
+ Quality-review descriptors bind the current qualified runtime, complete row artifact, canonical per-object payload, QA/context/reference facts and actual account intent. Their task-indexed snapshots expire and are rechecked by reassessment, finalization and write admission. A successor runtime requires a new review of its current observations; arbitrary serialized decisions and environment values never restore a review capability. See the [public preparation contract](public-runtime-contract.md#preparation-quality-review).
163
+
164
+ The installed entry may select a deployment-owned manifest/digest/cache before managed IPC admission. This chooses a new invocation, not a replacement runtime context. Existing returned actions enter the original managed launch directly and ignore installation defaults; exact qualification and task/attempt bindings remain unchanged. See the installation selection contract in `public-runtime-contract.md`.
@@ -29,13 +29,13 @@ checkPaths:
29
29
  - test/unit/task-authorization.test.mts
30
30
  - test/unit/task-profile-authority.test.mts
31
31
  - test/scenarios/foundry-execution-admission.test.mts
32
- lastReviewedAt: 2026-10-07
33
- lastReviewedCommit: caa95a4808eda51dc5c7c78f3c39e4e079bdb802
34
- lastReviewedNote: "Reviewed Foundry #223 preparation consuming complete owning CLI 0.1.27 validation, exact candidate/Flow bindings and published Toolkit 0.3.4 applicable coverage; authorization and no-replay boundaries remain unchanged. Foundry source version stays 0.1.16 pending a separate release."
32
+ lastReviewedAt: 2026-10-11
33
+ lastReviewedCommit: 2d5cbf38f4e44b4b4d30bba52abd38ef8947bed3
35
34
  related:
36
35
  - docs/architecture.md
37
36
  - docs/safety-policy.md
38
37
  - docs/foundry-task-contracts.md
38
+ lastReviewedNote: "Reviewed current-main integration of explicit preparation review, payload-bound context and diagnostic-only failures, plus native candidate generation and independently reviewed managed adoption; original Task eligibility and data acceptance remain separate."
39
39
  ---
40
40
 
41
41
  # Task authorization
@@ -100,6 +100,10 @@ USLCI's `preserve_referenced_review_sources` domain rule retains a source refere
100
100
 
101
101
  Worldsteel's naming rule classifies only the single trailing `Global` or `EU` plus data-year match, optionally followed by `v<number>`, in a process `baseName`. It applies only to the `latin-author-year` marker. Any additional author/year match, table/figure marker, other name field or other dataset type remains subject to the content policy. Adding another geography requires reviewed source evidence and tests. No whole content-policy rule is waived by a profile.
102
102
 
103
+ ## Preparation review and write authority
104
+
105
+ The public preparation-quality input described in [the runtime contract](public-runtime-contract.md#preparation-quality-review) records a separately scoped disposition for a current Process mass observation before finalization. It requires applicable user-decision and source-model evidence, exact object/content/QA/context bindings and an unexpired receipt. It does not activate `authorization.json`, add `qa_waivers` or grant an action. Finalization and pre-dispatch admission independently recheck the receipt and its exact scientific payload; final ordinary write approval remains required. The existing authorization-based code waiver below is unchanged and must not be used to broaden an object-specific preparation review to an entire Process batch.
106
+
103
107
  ## QA exceptions
104
108
 
105
109
  The only v1 QA exception is `process_material_balance_deviation` for `process`. The task must provide both user approval and referenced, content-bound `source-model` evidence demonstrating why this exact source scope is an aggregation/formula observation. The source format name or presence of `LCI_RESULT` alone is insufficient. Other QA codes, schema errors, unit-scale errors, missing references and full-context requirements cannot be waived by this contract.
@@ -135,3 +139,11 @@ For public prepared FP/UG input, a captured finalization blocked solely by the s
135
139
  Explicit reference inputs and their review files are control evidence, not authorization or QA waivers. A new selection invalidates the finalization projection; prepared/consumed scopes cannot replace it. Admission requires the same independently selected intent, passing precommit report and review-file facts in both CommandSpecs, alongside final rows and any native contract. Readback rechecks this evidence even when the mutation response is unavailable.
136
140
 
137
141
  After local handoff preparation, the public workflow validates the earlier identity context and obtains a fresh identity from the same qualified CLI and explicit authentication context before capsule creation. Age expiry of the earlier receipt is tolerated at this boundary; context or runtime mismatches propagate. An unconsumed execution also obtains a fresh identity after initial rehydration and before its second complete pre-dispatch admission. Both full admission passes remain required, and the attempt is not consumed until they pass. Capsule/admission checks independently revalidate the active grant, task/account binding, lineage and evidence. New identity receipts do not extend grant lifetime or reset attempts; the 60-second freshness bound is unchanged.
142
+
143
+ ## Freshness after locked metadata verification
144
+
145
+ The explicit public authorization workflow supplies an internal trusted `refreshIdentity` callback to registration/loading. The helpers first verify the current locked snapshot and original task/runtime/account/mode binding. They invoke the callback only for an aged bound proof, using the same qualified CLI and explicit authentication context. Other mismatches propagate. Direct callers without a callback remain strict.
146
+
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
+
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.
@@ -35,9 +35,9 @@ checkPaths:
35
35
  - test/scenarios/workspace-migration-planning.test.mts
36
36
  - test/unit/foundry-migration-transfer.test.mts
37
37
  - test/scenarios/workspace-migration-transfer.test.mts
38
- lastReviewedAt: 2026-09-08
39
- lastReviewedCommit: 3da2201c023a02053fd7325422b5e53fe9c84826
40
- lastReviewedNote: "Reviewed for Foundry #118 explicit ordinary/production-test intent through fingerprints, immutable account records, migration templates and sealed execution; qualified traceHash-only acceptance binds original/fresh raw hashes and preserves all verification evidence. Production-test rejects differences. Full release/live acceptance remains open."
38
+ lastReviewedAt: 2026-10-10
39
+ lastReviewedCommit: baaa384e1db47fb53eb29f7b3764e448510aeff1
40
+ lastReviewedNote: "Reviewed final existing-output capture verification on the working delta based on baaa384e. Current writer/runtime/job/profile and source/input checks run before, between and after two fresh output reads; an independent P2 report-before-capture late-drift repro is fixed, including a caught error returning previously written JSON. New receipt publication reloads current writer/Task/runtime and preserves final input verification; ordinary bytewriters, cached replay, sorted depth-first roster, index CAS and authority/science remain unchanged. Focused59/59 and wholeadoption23/23 pass; latejob2RED->2GREEN and retainedCLI first/second/caught negatives are recorded. No cross-operation hash cache or filesystem-wide atomicity claim. baaa preparation remained unused,87bd Native19/20 failed history remains preserved; new full Source/emitted/installed/native qualification is pending. No originalDATA requery/default034/science/release change."
41
41
  related:
42
42
  - docs/public-runtime-contract.md
43
43
  - docs/runtime-context-contract.md
@@ -73,6 +73,8 @@ Plans bind current runtime/package/entry/platform facts. Installed mode also bin
73
73
 
74
74
  A shared CLI-owned migration lock is keyed by canonical destination and independent of runtime version. Its complete cache path is checked before acquisition, including symlinked cache ancestors, and it cannot be placed in the preserved source. Copies are streamed, hashed and flushed before exclusive publication. Different existing files are preserved and rejected. A completed archive is audited rather than reconstructed after lost or corrupt evidence. Recognized temporary copy/metadata files are confined to owned scratch; unknown state remains a blocker.
75
75
 
76
+ Retained file verification freshly reads and hashes every byte. Its zeroed scratch buffer is bounded by the observed file size and a 1 MiB ceiling, with a positive one-byte buffer for empty-file EOF and growth checks. The regular-file, no-follow, inode/device, size, timestamp, linked-path and growth checks remain required; smaller scratch allocation does not permit cached or partial hashes. Full path facts also produce a canonical locator: already-canonical retained paths use native resolution; different native spelling or a native resolution error falls back to the existing generic resolver. Retained package and CLI inventory loops consume byte/hash content facts without constructing a discarded canonical locator. They still validate every selected relative path and freshly execute all regular-file, no-follow, inode/device, size, timestamp, linked-path and growth checks; no prior file observation or hash is reused. Entry and descriptor path facts retain their resolver and fallback, including resolution errors before the file closes. Every task writer and transaction retains complete runtime revalidation.
77
+
76
78
  ## Historical task classes
77
79
 
78
80
  | Evidence | Adoption behavior |