@ttsc/unplugin 0.36.3 → 0.37.0

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 (145) hide show
  1. package/lib/api.js +5 -2
  2. package/lib/api.js.map +1 -1
  3. package/lib/api.mjs +1 -1
  4. package/lib/core/bridge/TtscProjectRecord.d.cts +7 -0
  5. package/lib/core/bridge/TtscProjectRecord.d.mts +7 -0
  6. package/lib/core/bridge/TtscProjectRecord.d.ts +7 -0
  7. package/lib/core/bridge/projectRecordArgumentsMatch.d.cts +8 -5
  8. package/lib/core/bridge/projectRecordArgumentsMatch.d.mts +8 -5
  9. package/lib/core/bridge/projectRecordArgumentsMatch.d.ts +8 -5
  10. package/lib/core/bridge/projectRecordArgumentsMatch.js +15 -8
  11. package/lib/core/bridge/projectRecordArgumentsMatch.js.map +1 -1
  12. package/lib/core/bridge/projectRecordArgumentsMatch.mjs +15 -8
  13. package/lib/core/bridge/projectRecordArgumentsMatch.mjs.map +1 -1
  14. package/lib/core/bridge/readProjectRecordFile.js +8 -1
  15. package/lib/core/bridge/readProjectRecordFile.js.map +1 -1
  16. package/lib/core/bridge/readProjectRecordFile.mjs +8 -1
  17. package/lib/core/bridge/readProjectRecordFile.mjs.map +1 -1
  18. package/lib/core/index.js +5 -2
  19. package/lib/core/index.js.map +1 -1
  20. package/lib/core/index.mjs +1 -1
  21. package/lib/core/next/next.js +2 -2
  22. package/lib/core/next/next.js.map +1 -1
  23. package/lib/core/next/next.mjs +1 -1
  24. package/lib/core/rollup/rollupDeliveryOptions.js +2 -2
  25. package/lib/core/rollup/rollupDeliveryOptions.js.map +1 -1
  26. package/lib/core/rollup/rollupDeliveryOptions.mjs +1 -1
  27. package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +12 -4
  28. package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +12 -4
  29. package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +12 -4
  30. package/lib/core/transform/cache/selectCachedGenerationAction.js +16 -9
  31. package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
  32. package/lib/core/transform/cache/selectCachedGenerationAction.mjs +16 -9
  33. package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
  34. package/lib/core/transform/clock/filesystemListingDevices.d.cts +24 -0
  35. package/lib/core/transform/clock/filesystemListingDevices.d.mts +24 -0
  36. package/lib/core/transform/clock/filesystemListingDevices.d.ts +24 -0
  37. package/lib/core/transform/clock/filesystemListingDevices.js +36 -0
  38. package/lib/core/transform/clock/filesystemListingDevices.js.map +1 -0
  39. package/lib/core/transform/clock/filesystemListingDevices.mjs +34 -0
  40. package/lib/core/transform/clock/filesystemListingDevices.mjs.map +1 -0
  41. package/lib/core/transform/clock/refreshFilesystemClockReference.d.cts +10 -4
  42. package/lib/core/transform/clock/refreshFilesystemClockReference.d.mts +10 -4
  43. package/lib/core/transform/clock/refreshFilesystemClockReference.d.ts +10 -4
  44. package/lib/core/transform/clock/refreshFilesystemClockReference.js +40 -4
  45. package/lib/core/transform/clock/refreshFilesystemClockReference.js.map +1 -1
  46. package/lib/core/transform/clock/refreshFilesystemClockReference.mjs +40 -4
  47. package/lib/core/transform/clock/refreshFilesystemClockReference.mjs.map +1 -1
  48. package/lib/core/transform/generation/captureTransformGeneration.js +8 -2
  49. package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
  50. package/lib/core/transform/generation/captureTransformGeneration.mjs +8 -2
  51. package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
  52. package/lib/core/transform/inputs/pluginSourceFilesDigest.d.cts +7 -1
  53. package/lib/core/transform/inputs/pluginSourceFilesDigest.d.mts +7 -1
  54. package/lib/core/transform/inputs/pluginSourceFilesDigest.d.ts +7 -1
  55. package/lib/core/transform/inputs/pluginSourceFilesDigest.js +66 -4
  56. package/lib/core/transform/inputs/pluginSourceFilesDigest.js.map +1 -1
  57. package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs +66 -4
  58. package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs.map +1 -1
  59. package/lib/core/transform/session/claimSharedCompile.d.cts +12 -1
  60. package/lib/core/transform/session/claimSharedCompile.d.mts +12 -1
  61. package/lib/core/transform/session/claimSharedCompile.d.ts +12 -1
  62. package/lib/core/transform/session/claimSharedCompile.js +22 -4
  63. package/lib/core/transform/session/claimSharedCompile.js.map +1 -1
  64. package/lib/core/transform/session/claimSharedCompile.mjs +22 -4
  65. package/lib/core/transform/session/claimSharedCompile.mjs.map +1 -1
  66. package/lib/core/transform/transformTtsc.js +3 -2
  67. package/lib/core/transform/transformTtsc.js.map +1 -1
  68. package/lib/core/transform/transformTtsc.mjs +2 -1
  69. package/lib/core/transform/transformTtsc.mjs.map +1 -1
  70. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.cts +1 -17
  71. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.mts +1 -17
  72. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.ts +1 -17
  73. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js +7 -53
  74. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js.map +1 -1
  75. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs +1 -54
  76. package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs.map +1 -1
  77. package/lib/core/transform/validation/captureUniversalHostInputValidation.d.cts +10 -2
  78. package/lib/core/transform/validation/captureUniversalHostInputValidation.d.mts +10 -2
  79. package/lib/core/transform/validation/captureUniversalHostInputValidation.d.ts +10 -2
  80. package/lib/core/transform/validation/captureUniversalHostInputValidation.js +19 -2
  81. package/lib/core/transform/validation/captureUniversalHostInputValidation.js.map +1 -1
  82. package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs +19 -2
  83. package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs.map +1 -1
  84. package/lib/core/transform/validation/environmentInputMismatch.d.cts +23 -0
  85. package/lib/core/transform/validation/environmentInputMismatch.d.mts +23 -0
  86. package/lib/core/transform/validation/environmentInputMismatch.d.ts +23 -0
  87. package/lib/core/transform/validation/environmentInputMismatch.js +46 -0
  88. package/lib/core/transform/validation/environmentInputMismatch.js.map +1 -0
  89. package/lib/core/transform/validation/environmentInputMismatch.mjs +44 -0
  90. package/lib/core/transform/validation/environmentInputMismatch.mjs.map +1 -0
  91. package/lib/core/transform/validation/isEnvironmentInputs.d.cts +15 -0
  92. package/lib/core/transform/validation/isEnvironmentInputs.d.mts +15 -0
  93. package/lib/core/transform/validation/isEnvironmentInputs.d.ts +15 -0
  94. package/lib/core/transform/validation/isEnvironmentInputs.js +26 -0
  95. package/lib/core/transform/validation/isEnvironmentInputs.js.map +1 -0
  96. package/lib/core/transform/validation/isEnvironmentInputs.mjs +24 -0
  97. package/lib/core/transform/validation/isEnvironmentInputs.mjs.map +1 -0
  98. package/lib/core/transform/watch/TtscTransformHooks.d.cts +6 -4
  99. package/lib/core/transform/watch/TtscTransformHooks.d.mts +6 -4
  100. package/lib/core/transform/watch/TtscTransformHooks.d.ts +6 -4
  101. package/lib/core/transform/watch/handWatchInputs.d.cts +3 -1
  102. package/lib/core/transform/watch/handWatchInputs.d.mts +3 -1
  103. package/lib/core/transform/watch/handWatchInputs.d.ts +3 -1
  104. package/lib/core/transform/watch/handWatchInputs.js +7 -2
  105. package/lib/core/transform/watch/handWatchInputs.js.map +1 -1
  106. package/lib/core/transform/watch/handWatchInputs.mjs +7 -2
  107. package/lib/core/transform/watch/handWatchInputs.mjs.map +1 -1
  108. package/lib/core/transform/watch/notifyFailedGenerationInputs.js +3 -1
  109. package/lib/core/transform/watch/notifyFailedGenerationInputs.js.map +1 -1
  110. package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs +3 -1
  111. package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs.map +1 -1
  112. package/lib/core/transform/watch/notifyProjectRecord.js +4 -0
  113. package/lib/core/transform/watch/notifyProjectRecord.js.map +1 -1
  114. package/lib/core/transform/watch/notifyProjectRecord.mjs +4 -0
  115. package/lib/core/transform/watch/notifyProjectRecord.mjs.map +1 -1
  116. package/lib/core/transform/watch/notifyWatchInputs.js +3 -1
  117. package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
  118. package/lib/core/transform/watch/notifyWatchInputs.mjs +3 -1
  119. package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
  120. package/lib/core/turbopack/turbopack.js +2 -2
  121. package/lib/core/turbopack/turbopack.js.map +1 -1
  122. package/lib/core/turbopack/turbopack.mjs +1 -1
  123. package/lib/core/unplugin.js +3 -3
  124. package/lib/core/unplugin.js.map +1 -1
  125. package/lib/core/unplugin.mjs +1 -1
  126. package/package.json +3 -3
  127. package/src/core/bridge/TtscProjectRecord.ts +8 -0
  128. package/src/core/bridge/projectRecordArgumentsMatch.ts +19 -7
  129. package/src/core/bridge/readProjectRecordFile.ts +8 -1
  130. package/src/core/transform/cache/selectCachedGenerationAction.ts +19 -4
  131. package/src/core/transform/clock/filesystemListingDevices.ts +38 -0
  132. package/src/core/transform/clock/refreshFilesystemClockReference.ts +42 -4
  133. package/src/core/transform/generation/captureTransformGeneration.ts +8 -1
  134. package/src/core/transform/inputs/pluginSourceFilesDigest.ts +73 -5
  135. package/src/core/transform/session/claimSharedCompile.ts +35 -5
  136. package/src/core/transform/transformTtsc.ts +1 -0
  137. package/src/core/transform/tsconfig/resolveCompilerEnvironment.ts +1 -61
  138. package/src/core/transform/validation/captureUniversalHostInputValidation.ts +21 -1
  139. package/src/core/transform/validation/environmentInputMismatch.ts +43 -0
  140. package/src/core/transform/validation/isEnvironmentInputs.ts +28 -0
  141. package/src/core/transform/watch/TtscTransformHooks.ts +6 -3
  142. package/src/core/transform/watch/handWatchInputs.ts +5 -1
  143. package/src/core/transform/watch/notifyFailedGenerationInputs.ts +3 -0
  144. package/src/core/transform/watch/notifyProjectRecord.ts +5 -0
  145. package/src/core/transform/watch/notifyWatchInputs.ts +8 -1
@@ -7,11 +7,14 @@ import type { TtscTransformCache } from "./TtscTransformCache";
7
7
  * The caller owns awaiting, Promise-ownership checks and required native
8
8
  * notification settling. A volatile or mismatching generation is evicted by
9
9
  * identity; if eviction exposed a sibling replacement, the caller retries it.
10
- * Otherwise the caller must capture a new generation. A serving decision does
11
- * not perform output selection or host notification, which remain with
12
- * delivery.
10
+ * Otherwise the caller must capture a new generation. A generation whose
11
+ * plugins read an environment variable that `environment`, the delivery's
12
+ * compiler environment snapshot, no longer gives the recorded value is
13
+ * mismatching on every path, the pass-shared first delivery included: no file
14
+ * proof can stand in for it. A serving decision does not perform output
15
+ * selection or host notification, which remain with delivery.
13
16
  *
14
- * @evidence contracts/common.md#principled-implementation The actual generation's volatility and recorded source proof decide serving; identity-guarded eviction then distinguishes a sibling's current replacement from an empty capture slot.
17
+ * @evidence contracts/common.md#principled-implementation The actual generation's volatility, recorded environment reads and recorded source proof decide serving; identity-guarded eviction then distinguishes a sibling's current replacement from an empty capture slot.
15
18
  * @evidence contracts/common.md#clear-and-simple-design One synchronous operation selects serve/retry/capture and owns mismatch eviction, while its production caller owns awaiting, notification settling, native capture and output delivery.
16
19
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Decisions inspect the supplied actual generation and validators without fabricating a producer result, capability or success; no injectable compiler callback or test-only branch is introduced.
17
20
  * @evidence contracts/common.md#meaningful-documentation Native prose states the caller's awaited-Promise and settled-notification responsibilities and separates the decision from producer and delivery effects.
@@ -38,6 +41,11 @@ export declare function selectCachedGenerationAction(props: {
38
41
  generation: Promise<TtscCachedProjectTransform>;
39
42
  key: string;
40
43
  source: string;
44
+ /**
45
+ * The delivery's compiler environment snapshot, the one a recompile would run
46
+ * under, against which recorded environment reads are compared.
47
+ */
48
+ environment: NodeJS.ProcessEnv;
41
49
  /** False only for speculative source reads before an actual module delivery. */
42
50
  reportDivergence?: boolean;
43
51
  proof?: TtscGenerationProof.Transaction;
@@ -2,6 +2,7 @@
2
2
 
3
3
  var envelopeDerivation = require('../envelope/envelopeDerivation.js');
4
4
  var isVolatileFile = require('../envelope/isVolatileFile.js');
5
+ var environmentInputMismatch = require('../validation/environmentInputMismatch.js');
5
6
  var matchesCachedSource = require('../validation/matchesCachedSource.js');
6
7
  var evictGeneration = require('./evictGeneration.js');
7
8
 
@@ -11,11 +12,14 @@ var evictGeneration = require('./evictGeneration.js');
11
12
  * The caller owns awaiting, Promise-ownership checks and required native
12
13
  * notification settling. A volatile or mismatching generation is evicted by
13
14
  * identity; if eviction exposed a sibling replacement, the caller retries it.
14
- * Otherwise the caller must capture a new generation. A serving decision does
15
- * not perform output selection or host notification, which remain with
16
- * delivery.
15
+ * Otherwise the caller must capture a new generation. A generation whose
16
+ * plugins read an environment variable that `environment`, the delivery's
17
+ * compiler environment snapshot, no longer gives the recorded value is
18
+ * mismatching on every path, the pass-shared first delivery included: no file
19
+ * proof can stand in for it. A serving decision does not perform output
20
+ * selection or host notification, which remain with delivery.
17
21
  *
18
- * @evidence contracts/common.md#principled-implementation The actual generation's volatility and recorded source proof decide serving; identity-guarded eviction then distinguishes a sibling's current replacement from an empty capture slot.
22
+ * @evidence contracts/common.md#principled-implementation The actual generation's volatility, recorded environment reads and recorded source proof decide serving; identity-guarded eviction then distinguishes a sibling's current replacement from an empty capture slot.
19
23
  * @evidence contracts/common.md#clear-and-simple-design One synchronous operation selects serve/retry/capture and owns mismatch eviction, while its production caller owns awaiting, notification settling, native capture and output delivery.
20
24
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Decisions inspect the supplied actual generation and validators without fabricating a producer result, capability or success; no injectable compiler callback or test-only branch is introduced.
21
25
  * @evidence contracts/common.md#meaningful-documentation Native prose states the caller's awaited-Promise and settled-notification responsibilities and separates the decision from producer and delivery effects.
@@ -35,11 +39,14 @@ var evictGeneration = require('./evictGeneration.js');
35
39
  * @evidence contracts/portability.md#os-neutral-implementation Generation derivation and source validation retain their actual filesystem identity and compiler policy; this coordinator adds no platform inference or path rewriting.
36
40
  */
37
41
  function selectCachedGenerationAction(props) {
38
- if (!isVolatileFile.isVolatileFile(envelopeDerivation.envelopeDerivation(props.cached), {
39
- file: props.file,
40
- projectRoot: props.cached.projectRoot,
41
- result: props.cached.result,
42
- }) &&
42
+ if (environmentInputMismatch.environmentInputMismatch(props.cached.result.type === "exception"
43
+ ? undefined
44
+ : props.cached.result.environmentInputs, props.environment) === undefined &&
45
+ !isVolatileFile.isVolatileFile(envelopeDerivation.envelopeDerivation(props.cached), {
46
+ file: props.file,
47
+ projectRoot: props.cached.projectRoot,
48
+ result: props.cached.result,
49
+ }) &&
43
50
  matchesCachedSource.matchesCachedSource(props.cached, props.file, props.source, props.epoch, props.proof, props.reportDivergence)) {
44
51
  return "serve";
45
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"selectCachedGenerationAction.js","sources":["../../../../src/core/transform/cache/selectCachedGenerationAction.ts"],"sourcesContent":[null],"names":["isVolatileFile","envelopeDerivation","matchesCachedSource","evictGeneration"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACG,SAAU,4BAA4B,CAAC,KAW5C,EAAA;IACC,IACE,CAACA,6BAAc,CAACC,qCAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QAChD,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,QAAA,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;AACrC,QAAA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;KAC5B,CAAC;QACFC,uCAAmB,CACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,gBAAgB,CACvB,EACD;AACA,QAAA,OAAO,OAAO;IAChB;AACA,IAAAC,+BAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;AACxE;;;;"}
1
+ {"version":3,"file":"selectCachedGenerationAction.js","sources":["../../../../src/core/transform/cache/selectCachedGenerationAction.ts"],"sourcesContent":[null],"names":["environmentInputMismatch","isVolatileFile","envelopeDerivation","matchesCachedSource","evictGeneration"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACG,SAAU,4BAA4B,CAAC,KAgB5C,EAAA;IACC,IACEA,iDAAwB,CACtB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK;AAC3B,UAAE;AACF,UAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,EACzC,KAAK,CAAC,WAAW,CAClB,KAAK,SAAS;QACf,CAACC,6BAAc,CAACC,qCAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;YAChD,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,YAAA,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;AACrC,YAAA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;SAC5B,CAAC;QACFC,uCAAmB,CACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,gBAAgB,CACvB,EACD;AACA,QAAA,OAAO,OAAO;IAChB;AACA,IAAAC,+BAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;AACxE;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { envelopeDerivation } from '../envelope/envelopeDerivation.mjs';
2
2
  import { isVolatileFile } from '../envelope/isVolatileFile.mjs';
3
+ import { environmentInputMismatch } from '../validation/environmentInputMismatch.mjs';
3
4
  import { matchesCachedSource } from '../validation/matchesCachedSource.mjs';
4
5
  import { evictGeneration } from './evictGeneration.mjs';
5
6
 
@@ -9,11 +10,14 @@ import { evictGeneration } from './evictGeneration.mjs';
9
10
  * The caller owns awaiting, Promise-ownership checks and required native
10
11
  * notification settling. A volatile or mismatching generation is evicted by
11
12
  * identity; if eviction exposed a sibling replacement, the caller retries it.
12
- * Otherwise the caller must capture a new generation. A serving decision does
13
- * not perform output selection or host notification, which remain with
14
- * delivery.
13
+ * Otherwise the caller must capture a new generation. A generation whose
14
+ * plugins read an environment variable that `environment`, the delivery's
15
+ * compiler environment snapshot, no longer gives the recorded value is
16
+ * mismatching on every path, the pass-shared first delivery included: no file
17
+ * proof can stand in for it. A serving decision does not perform output
18
+ * selection or host notification, which remain with delivery.
15
19
  *
16
- * @evidence contracts/common.md#principled-implementation The actual generation's volatility and recorded source proof decide serving; identity-guarded eviction then distinguishes a sibling's current replacement from an empty capture slot.
20
+ * @evidence contracts/common.md#principled-implementation The actual generation's volatility, recorded environment reads and recorded source proof decide serving; identity-guarded eviction then distinguishes a sibling's current replacement from an empty capture slot.
17
21
  * @evidence contracts/common.md#clear-and-simple-design One synchronous operation selects serve/retry/capture and owns mismatch eviction, while its production caller owns awaiting, notification settling, native capture and output delivery.
18
22
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Decisions inspect the supplied actual generation and validators without fabricating a producer result, capability or success; no injectable compiler callback or test-only branch is introduced.
19
23
  * @evidence contracts/common.md#meaningful-documentation Native prose states the caller's awaited-Promise and settled-notification responsibilities and separates the decision from producer and delivery effects.
@@ -33,11 +37,14 @@ import { evictGeneration } from './evictGeneration.mjs';
33
37
  * @evidence contracts/portability.md#os-neutral-implementation Generation derivation and source validation retain their actual filesystem identity and compiler policy; this coordinator adds no platform inference or path rewriting.
34
38
  */
35
39
  function selectCachedGenerationAction(props) {
36
- if (!isVolatileFile(envelopeDerivation(props.cached), {
37
- file: props.file,
38
- projectRoot: props.cached.projectRoot,
39
- result: props.cached.result,
40
- }) &&
40
+ if (environmentInputMismatch(props.cached.result.type === "exception"
41
+ ? undefined
42
+ : props.cached.result.environmentInputs, props.environment) === undefined &&
43
+ !isVolatileFile(envelopeDerivation(props.cached), {
44
+ file: props.file,
45
+ projectRoot: props.cached.projectRoot,
46
+ result: props.cached.result,
47
+ }) &&
41
48
  matchesCachedSource(props.cached, props.file, props.source, props.epoch, props.proof, props.reportDivergence)) {
42
49
  return "serve";
43
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"selectCachedGenerationAction.mjs","sources":["../../../../src/core/transform/cache/selectCachedGenerationAction.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACG,SAAU,4BAA4B,CAAC,KAW5C,EAAA;IACC,IACE,CAAC,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QAChD,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,QAAA,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;AACrC,QAAA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;KAC5B,CAAC;QACF,mBAAmB,CACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,gBAAgB,CACvB,EACD;AACA,QAAA,OAAO,OAAO;IAChB;AACA,IAAA,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;AACxE;;;;"}
1
+ {"version":3,"file":"selectCachedGenerationAction.mjs","sources":["../../../../src/core/transform/cache/selectCachedGenerationAction.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACG,SAAU,4BAA4B,CAAC,KAgB5C,EAAA;IACC,IACE,wBAAwB,CACtB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK;AAC3B,UAAE;AACF,UAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,EACzC,KAAK,CAAC,WAAW,CAClB,KAAK,SAAS;QACf,CAAC,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;YAChD,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,YAAA,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;AACrC,YAAA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;SAC5B,CAAC;QACF,mBAAmB,CACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,gBAAgB,CACvB,EACD;AACA,QAAA,OAAO,OAAO;IAChB;AACA,IAAA,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;AACxE;;;;"}
@@ -0,0 +1,24 @@
1
+ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations.cjs";
2
+ /**
3
+ * The devices on which an observing view saw its adapter-owned probe directory
4
+ * move both of its stamps when the probe was recreated, keyed by the operations
5
+ * object, as `filesystemClockReferences` keys their references.
6
+ *
7
+ * A directory's stamps move when an entry is created, removed or renamed in it,
8
+ * so while they hold still a directory still holds the entries a walk read
9
+ * (`IPluginSourceListing` from `ttsc/plugin-source`). That premise is offered
10
+ * as evidence only on a device where the view has seen it hold, and each
11
+ * refresh clears and re-establishes it with the reference it mints.
12
+ *
13
+ * @evidence contracts/common.md#principled-implementation A device enters only after the view observed a fresh entry change in owned storage move that directory's modification and change stamps; refresh clears the set before minting.
14
+ * @evidence contracts/common.md#clear-and-simple-design One WeakMap owns the sets by operation identity, beside the reference tables they qualify.
15
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No device is assumed to keep directory stamps from its platform or filesystem name.
16
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the premise, how a device is admitted and when it is cleared.
17
+ * @evidence contracts/portability.md#os-neutral-implementation Devices are the observing view's bigint identifiers; the premise is observed, not inferred from the OS.
18
+ * @evidence contracts/performance.md#efficient-algorithms One WeakMap lookup selects the set.
19
+ * @evidence contracts/performance.md#reuse-equivalent-work Every proof through one operations object shares its admitted devices until the next refresh.
20
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Weak association does not retain the operations object, and a set holds at most the devices of its probes.
21
+ */
22
+ export declare function filesystemListingDevices(
23
+ /** Coherent observing view whose probe established the premise. */
24
+ filesystem: TtscTransformFilesystemOperations): Set<bigint>;
@@ -0,0 +1,24 @@
1
+ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations.mjs";
2
+ /**
3
+ * The devices on which an observing view saw its adapter-owned probe directory
4
+ * move both of its stamps when the probe was recreated, keyed by the operations
5
+ * object, as `filesystemClockReferences` keys their references.
6
+ *
7
+ * A directory's stamps move when an entry is created, removed or renamed in it,
8
+ * so while they hold still a directory still holds the entries a walk read
9
+ * (`IPluginSourceListing` from `ttsc/plugin-source`). That premise is offered
10
+ * as evidence only on a device where the view has seen it hold, and each
11
+ * refresh clears and re-establishes it with the reference it mints.
12
+ *
13
+ * @evidence contracts/common.md#principled-implementation A device enters only after the view observed a fresh entry change in owned storage move that directory's modification and change stamps; refresh clears the set before minting.
14
+ * @evidence contracts/common.md#clear-and-simple-design One WeakMap owns the sets by operation identity, beside the reference tables they qualify.
15
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No device is assumed to keep directory stamps from its platform or filesystem name.
16
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the premise, how a device is admitted and when it is cleared.
17
+ * @evidence contracts/portability.md#os-neutral-implementation Devices are the observing view's bigint identifiers; the premise is observed, not inferred from the OS.
18
+ * @evidence contracts/performance.md#efficient-algorithms One WeakMap lookup selects the set.
19
+ * @evidence contracts/performance.md#reuse-equivalent-work Every proof through one operations object shares its admitted devices until the next refresh.
20
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Weak association does not retain the operations object, and a set holds at most the devices of its probes.
21
+ */
22
+ export declare function filesystemListingDevices(
23
+ /** Coherent observing view whose probe established the premise. */
24
+ filesystem: TtscTransformFilesystemOperations): Set<bigint>;
@@ -0,0 +1,24 @@
1
+ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations";
2
+ /**
3
+ * The devices on which an observing view saw its adapter-owned probe directory
4
+ * move both of its stamps when the probe was recreated, keyed by the operations
5
+ * object, as `filesystemClockReferences` keys their references.
6
+ *
7
+ * A directory's stamps move when an entry is created, removed or renamed in it,
8
+ * so while they hold still a directory still holds the entries a walk read
9
+ * (`IPluginSourceListing` from `ttsc/plugin-source`). That premise is offered
10
+ * as evidence only on a device where the view has seen it hold, and each
11
+ * refresh clears and re-establishes it with the reference it mints.
12
+ *
13
+ * @evidence contracts/common.md#principled-implementation A device enters only after the view observed a fresh entry change in owned storage move that directory's modification and change stamps; refresh clears the set before minting.
14
+ * @evidence contracts/common.md#clear-and-simple-design One WeakMap owns the sets by operation identity, beside the reference tables they qualify.
15
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No device is assumed to keep directory stamps from its platform or filesystem name.
16
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the premise, how a device is admitted and when it is cleared.
17
+ * @evidence contracts/portability.md#os-neutral-implementation Devices are the observing view's bigint identifiers; the premise is observed, not inferred from the OS.
18
+ * @evidence contracts/performance.md#efficient-algorithms One WeakMap lookup selects the set.
19
+ * @evidence contracts/performance.md#reuse-equivalent-work Every proof through one operations object shares its admitted devices until the next refresh.
20
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Weak association does not retain the operations object, and a set holds at most the devices of its probes.
21
+ */
22
+ export declare function filesystemListingDevices(
23
+ /** Coherent observing view whose probe established the premise. */
24
+ filesystem: TtscTransformFilesystemOperations): Set<bigint>;
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * The devices on which an observing view saw its adapter-owned probe directory
5
+ * move both of its stamps when the probe was recreated, keyed by the operations
6
+ * object, as `filesystemClockReferences` keys their references.
7
+ *
8
+ * A directory's stamps move when an entry is created, removed or renamed in it,
9
+ * so while they hold still a directory still holds the entries a walk read
10
+ * (`IPluginSourceListing` from `ttsc/plugin-source`). That premise is offered
11
+ * as evidence only on a device where the view has seen it hold, and each
12
+ * refresh clears and re-establishes it with the reference it mints.
13
+ *
14
+ * @evidence contracts/common.md#principled-implementation A device enters only after the view observed a fresh entry change in owned storage move that directory's modification and change stamps; refresh clears the set before minting.
15
+ * @evidence contracts/common.md#clear-and-simple-design One WeakMap owns the sets by operation identity, beside the reference tables they qualify.
16
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No device is assumed to keep directory stamps from its platform or filesystem name.
17
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the premise, how a device is admitted and when it is cleared.
18
+ * @evidence contracts/portability.md#os-neutral-implementation Devices are the observing view's bigint identifiers; the premise is observed, not inferred from the OS.
19
+ * @evidence contracts/performance.md#efficient-algorithms One WeakMap lookup selects the set.
20
+ * @evidence contracts/performance.md#reuse-equivalent-work Every proof through one operations object shares its admitted devices until the next refresh.
21
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Weak association does not retain the operations object, and a set holds at most the devices of its probes.
22
+ */
23
+ function filesystemListingDevices(
24
+ /** Coherent observing view whose probe established the premise. */
25
+ filesystem) {
26
+ let devices = FILESYSTEM_LISTING_DEVICES.get(filesystem);
27
+ if (devices === undefined) {
28
+ devices = new Set();
29
+ FILESYSTEM_LISTING_DEVICES.set(filesystem, devices);
30
+ }
31
+ return devices;
32
+ }
33
+ const FILESYSTEM_LISTING_DEVICES = new WeakMap();
34
+
35
+ exports.filesystemListingDevices = filesystemListingDevices;
36
+ //# sourceMappingURL=filesystemListingDevices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystemListingDevices.js","sources":["../../../../src/core/transform/clock/filesystemListingDevices.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;SACa,wBAAwB;AACtC;AACA,UAA6C,EAAA;IAE7C,IAAI,OAAO,GAAG,0BAA0B,CAAC,GAAG,CAAC,UAAU,CAAC;AACxD,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,OAAO,GAAG,IAAI,GAAG,EAAE;AACnB,QAAA,0BAA0B,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;IACrD;AACA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,0BAA0B,GAAG,IAAI,OAAO,EAG3C;;;;"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The devices on which an observing view saw its adapter-owned probe directory
3
+ * move both of its stamps when the probe was recreated, keyed by the operations
4
+ * object, as `filesystemClockReferences` keys their references.
5
+ *
6
+ * A directory's stamps move when an entry is created, removed or renamed in it,
7
+ * so while they hold still a directory still holds the entries a walk read
8
+ * (`IPluginSourceListing` from `ttsc/plugin-source`). That premise is offered
9
+ * as evidence only on a device where the view has seen it hold, and each
10
+ * refresh clears and re-establishes it with the reference it mints.
11
+ *
12
+ * @evidence contracts/common.md#principled-implementation A device enters only after the view observed a fresh entry change in owned storage move that directory's modification and change stamps; refresh clears the set before minting.
13
+ * @evidence contracts/common.md#clear-and-simple-design One WeakMap owns the sets by operation identity, beside the reference tables they qualify.
14
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No device is assumed to keep directory stamps from its platform or filesystem name.
15
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the premise, how a device is admitted and when it is cleared.
16
+ * @evidence contracts/portability.md#os-neutral-implementation Devices are the observing view's bigint identifiers; the premise is observed, not inferred from the OS.
17
+ * @evidence contracts/performance.md#efficient-algorithms One WeakMap lookup selects the set.
18
+ * @evidence contracts/performance.md#reuse-equivalent-work Every proof through one operations object shares its admitted devices until the next refresh.
19
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Weak association does not retain the operations object, and a set holds at most the devices of its probes.
20
+ */
21
+ function filesystemListingDevices(
22
+ /** Coherent observing view whose probe established the premise. */
23
+ filesystem) {
24
+ let devices = FILESYSTEM_LISTING_DEVICES.get(filesystem);
25
+ if (devices === undefined) {
26
+ devices = new Set();
27
+ FILESYSTEM_LISTING_DEVICES.set(filesystem, devices);
28
+ }
29
+ return devices;
30
+ }
31
+ const FILESYSTEM_LISTING_DEVICES = new WeakMap();
32
+
33
+ export { filesystemListingDevices };
34
+ //# sourceMappingURL=filesystemListingDevices.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystemListingDevices.mjs","sources":["../../../../src/core/transform/clock/filesystemListingDevices.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;AAmBG;SACa,wBAAwB;AACtC;AACA,UAA6C,EAAA;IAE7C,IAAI,OAAO,GAAG,0BAA0B,CAAC,GAAG,CAAC,UAAU,CAAC;AACxD,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,OAAO,GAAG,IAAI,GAAG,EAAE;AACnB,QAAA,0BAA0B,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;IACrD;AACA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,0BAA0B,GAAG,IAAI,OAAO,EAG3C;;;;"}
@@ -19,6 +19,12 @@ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransf
19
19
  * valid price for this optimization, so the cross-volume case degrades to more
20
20
  * reads instead.
21
21
  *
22
+ * Recreating the probe is also an entry change in the owned directory. When the
23
+ * view sees that directory's modification and change stamps both move, its
24
+ * device is admitted as one whose directory stamps witness their entries
25
+ * (`filesystemListingDevices`), so a plugin source listing can be replayed
26
+ * there instead of enumerated.
27
+ *
22
28
  * @evidence contracts/common.md#principled-implementation Clearing old references before a fresh owned probe write prevents previous or rolled-back stamps from certifying content; only observed regular-file metadata establishes a same-device reference.
23
29
  * @evidence contracts/common.md#clear-and-simple-design This operation mints and records one probe stamp; input metadata comparison remains in the separability consumer.
24
30
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed writes, inaccessible probes, or another device cannot be replaced by Date.now or a historical maximum; actual content proof remains necessary.
@@ -26,10 +32,10 @@ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransf
26
32
  * @evidence contracts/portability.md#os-neutral-implementation OS-neutral clock proof uses native owned-path writes and the observing view's bigint device/time metadata, preserving cross-volume and unavailable-probe behavior without a platform clock assumption.
27
33
  * @evidence contracts/performance.md#efficient-algorithms
28
34
  * Clear the view's prior entries, then an available directory performs native
29
- * path joining, one write of process-counter text and one observed metadata
30
- * read. Costs include path/counter text and native I/O; a missing directory
31
- * skips I/O. Clearing/recording follows the current reference population,
32
- * not a scan of project inputs.
35
+ * path joining, one removal and one write of process-counter text and three
36
+ * observed metadata reads. Costs include path/counter text and native I/O; a
37
+ * missing directory skips I/O. Clearing/recording follows the current
38
+ * reference population, not a scan of project inputs.
33
39
  * @evidence contracts/performance.md#reuse-equivalent-work The existing probe path and shared per-view reference table are reused; only a newly minted stamp can authorize signature reuse.
34
40
  * @evidence contracts/performance.md#bound-retention-and-release-resources
35
41
  * Refresh clears history and retains at most one regular-file device stamp;
@@ -19,6 +19,12 @@ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransf
19
19
  * valid price for this optimization, so the cross-volume case degrades to more
20
20
  * reads instead.
21
21
  *
22
+ * Recreating the probe is also an entry change in the owned directory. When the
23
+ * view sees that directory's modification and change stamps both move, its
24
+ * device is admitted as one whose directory stamps witness their entries
25
+ * (`filesystemListingDevices`), so a plugin source listing can be replayed
26
+ * there instead of enumerated.
27
+ *
22
28
  * @evidence contracts/common.md#principled-implementation Clearing old references before a fresh owned probe write prevents previous or rolled-back stamps from certifying content; only observed regular-file metadata establishes a same-device reference.
23
29
  * @evidence contracts/common.md#clear-and-simple-design This operation mints and records one probe stamp; input metadata comparison remains in the separability consumer.
24
30
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed writes, inaccessible probes, or another device cannot be replaced by Date.now or a historical maximum; actual content proof remains necessary.
@@ -26,10 +32,10 @@ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransf
26
32
  * @evidence contracts/portability.md#os-neutral-implementation OS-neutral clock proof uses native owned-path writes and the observing view's bigint device/time metadata, preserving cross-volume and unavailable-probe behavior without a platform clock assumption.
27
33
  * @evidence contracts/performance.md#efficient-algorithms
28
34
  * Clear the view's prior entries, then an available directory performs native
29
- * path joining, one write of process-counter text and one observed metadata
30
- * read. Costs include path/counter text and native I/O; a missing directory
31
- * skips I/O. Clearing/recording follows the current reference population,
32
- * not a scan of project inputs.
35
+ * path joining, one removal and one write of process-counter text and three
36
+ * observed metadata reads. Costs include path/counter text and native I/O; a
37
+ * missing directory skips I/O. Clearing/recording follows the current
38
+ * reference population, not a scan of project inputs.
33
39
  * @evidence contracts/performance.md#reuse-equivalent-work The existing probe path and shared per-view reference table are reused; only a newly minted stamp can authorize signature reuse.
34
40
  * @evidence contracts/performance.md#bound-retention-and-release-resources
35
41
  * Refresh clears history and retains at most one regular-file device stamp;
@@ -19,6 +19,12 @@ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransf
19
19
  * valid price for this optimization, so the cross-volume case degrades to more
20
20
  * reads instead.
21
21
  *
22
+ * Recreating the probe is also an entry change in the owned directory. When the
23
+ * view sees that directory's modification and change stamps both move, its
24
+ * device is admitted as one whose directory stamps witness their entries
25
+ * (`filesystemListingDevices`), so a plugin source listing can be replayed
26
+ * there instead of enumerated.
27
+ *
22
28
  * @evidence contracts/common.md#principled-implementation Clearing old references before a fresh owned probe write prevents previous or rolled-back stamps from certifying content; only observed regular-file metadata establishes a same-device reference.
23
29
  * @evidence contracts/common.md#clear-and-simple-design This operation mints and records one probe stamp; input metadata comparison remains in the separability consumer.
24
30
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed writes, inaccessible probes, or another device cannot be replaced by Date.now or a historical maximum; actual content proof remains necessary.
@@ -26,10 +32,10 @@ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransf
26
32
  * @evidence contracts/portability.md#os-neutral-implementation OS-neutral clock proof uses native owned-path writes and the observing view's bigint device/time metadata, preserving cross-volume and unavailable-probe behavior without a platform clock assumption.
27
33
  * @evidence contracts/performance.md#efficient-algorithms
28
34
  * Clear the view's prior entries, then an available directory performs native
29
- * path joining, one write of process-counter text and one observed metadata
30
- * read. Costs include path/counter text and native I/O; a missing directory
31
- * skips I/O. Clearing/recording follows the current reference population,
32
- * not a scan of project inputs.
35
+ * path joining, one removal and one write of process-counter text and three
36
+ * observed metadata reads. Costs include path/counter text and native I/O; a
37
+ * missing directory skips I/O. Clearing/recording follows the current
38
+ * reference population, not a scan of project inputs.
33
39
  * @evidence contracts/performance.md#reuse-equivalent-work The existing probe path and shared per-view reference table are reused; only a newly minted stamp can authorize signature reuse.
34
40
  * @evidence contracts/performance.md#bound-retention-and-release-resources
35
41
  * Refresh clears history and retains at most one regular-file device stamp;
@@ -3,6 +3,7 @@
3
3
  var fs = require('node:fs');
4
4
  var path = require('node:path');
5
5
  var filesystemClockReferences = require('./filesystemClockReferences.js');
6
+ var filesystemListingDevices = require('./filesystemListingDevices.js');
6
7
 
7
8
  /**
8
9
  * Replace every prior clock proof with one reference minted by a fresh write.
@@ -24,6 +25,12 @@ var filesystemClockReferences = require('./filesystemClockReferences.js');
24
25
  * valid price for this optimization, so the cross-volume case degrades to more
25
26
  * reads instead.
26
27
  *
28
+ * Recreating the probe is also an entry change in the owned directory. When the
29
+ * view sees that directory's modification and change stamps both move, its
30
+ * device is admitted as one whose directory stamps witness their entries
31
+ * (`filesystemListingDevices`), so a plugin source listing can be replayed
32
+ * there instead of enumerated.
33
+ *
27
34
  * @evidence contracts/common.md#principled-implementation Clearing old references before a fresh owned probe write prevents previous or rolled-back stamps from certifying content; only observed regular-file metadata establishes a same-device reference.
28
35
  * @evidence contracts/common.md#clear-and-simple-design This operation mints and records one probe stamp; input metadata comparison remains in the separability consumer.
29
36
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed writes, inaccessible probes, or another device cannot be replaced by Date.now or a historical maximum; actual content proof remains necessary.
@@ -31,10 +38,10 @@ var filesystemClockReferences = require('./filesystemClockReferences.js');
31
38
  * @evidence contracts/portability.md#os-neutral-implementation OS-neutral clock proof uses native owned-path writes and the observing view's bigint device/time metadata, preserving cross-volume and unavailable-probe behavior without a platform clock assumption.
32
39
  * @evidence contracts/performance.md#efficient-algorithms
33
40
  * Clear the view's prior entries, then an available directory performs native
34
- * path joining, one write of process-counter text and one observed metadata
35
- * read. Costs include path/counter text and native I/O; a missing directory
36
- * skips I/O. Clearing/recording follows the current reference population,
37
- * not a scan of project inputs.
41
+ * path joining, one removal and one write of process-counter text and three
42
+ * observed metadata reads. Costs include path/counter text and native I/O; a
43
+ * missing directory skips I/O. Clearing/recording follows the current
44
+ * reference population, not a scan of project inputs.
38
45
  * @evidence contracts/performance.md#reuse-equivalent-work The existing probe path and shared per-view reference table are reused; only a newly minted stamp can authorize signature reuse.
39
46
  * @evidence contracts/performance.md#bound-retention-and-release-resources
40
47
  * Refresh clears history and retains at most one regular-file device stamp;
@@ -48,20 +55,49 @@ referenceDirectory,
48
55
  /** Coherent observing view whose device/time reference will be replaced. */
49
56
  filesystem) {
50
57
  const references = filesystemClockReferences.filesystemClockReferences(filesystem);
58
+ const listings = filesystemListingDevices.filesystemListingDevices(filesystem);
51
59
  references.clear();
60
+ listings.clear();
52
61
  if (referenceDirectory === undefined)
53
62
  return;
54
63
  try {
55
64
  const probe = path.join(referenceDirectory, "clock-reference");
65
+ // The probe is recreated rather than rewritten, so the owned directory sees
66
+ // an entry change whose effect on its stamps qualifies the device.
67
+ const directory = () => {
68
+ try {
69
+ return filesystem.lstat(referenceDirectory);
70
+ }
71
+ catch {
72
+ // A view that cannot state the directory only forgoes the listing.
73
+ return undefined;
74
+ }
75
+ };
76
+ const parent = directory();
77
+ try {
78
+ fs.rmSync(probe, { force: true });
79
+ }
80
+ catch {
81
+ // A probe that cannot be removed is rewritten in place, which moves no
82
+ // directory stamp, so the device is simply not admitted.
83
+ }
56
84
  fs.writeFileSync(probe, `${process.hrtime.bigint()}\n`);
57
85
  const stats = filesystem.lstat(probe);
58
86
  if (stats.isFile()) {
59
87
  references.set(stats.dev, stats.mtimeNs);
88
+ const moved = parent === undefined ? undefined : directory();
89
+ if (parent !== undefined &&
90
+ moved !== undefined &&
91
+ moved.dev === stats.dev &&
92
+ moved.mtimeNs > parent.mtimeNs &&
93
+ moved.ctimeNs > parent.ctimeNs)
94
+ listings.add(stats.dev);
60
95
  }
61
96
  }
62
97
  catch {
63
98
  // A failed refresh leaves no reference, so content comparison continues.
64
99
  references.clear();
100
+ listings.clear();
65
101
  }
66
102
  }
67
103
 
@@ -1 +1 @@
1
- {"version":3,"file":"refreshFilesystemClockReference.js","sources":["../../../../src/core/transform/clock/refreshFilesystemClockReference.ts"],"sourcesContent":[null],"names":["filesystemClockReferences"],"mappings":";;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;SACa,+BAA+B;AAC7C;AACA,kBAAsC;AACtC;AACA,UAA6C,EAAA;AAE7C,IAAA,MAAM,UAAU,GAAGA,mDAAyB,CAAC,UAAU,CAAC;IACxD,UAAU,CAAC,KAAK,EAAE;IAClB,IAAI,kBAAkB,KAAK,SAAS;QAAE;AACtC,IAAA,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;AAC9D,QAAA,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA,EAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAA,EAAA,CAAI,CAAC;QACvD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,QAAA,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAClB,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;QAC1C;IACF;AAAE,IAAA,MAAM;;QAEN,UAAU,CAAC,KAAK,EAAE;IACpB;AACF;;;;"}
1
+ {"version":3,"file":"refreshFilesystemClockReference.js","sources":["../../../../src/core/transform/clock/refreshFilesystemClockReference.ts"],"sourcesContent":[null],"names":["filesystemClockReferences","filesystemListingDevices"],"mappings":";;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CG;SACa,+BAA+B;AAC7C;AACA,kBAAsC;AACtC;AACA,UAA6C,EAAA;AAE7C,IAAA,MAAM,UAAU,GAAGA,mDAAyB,CAAC,UAAU,CAAC;AACxD,IAAA,MAAM,QAAQ,GAAGC,iDAAwB,CAAC,UAAU,CAAC;IACrD,UAAU,CAAC,KAAK,EAAE;IAClB,QAAQ,CAAC,KAAK,EAAE;IAChB,IAAI,kBAAkB,KAAK,SAAS;QAAE;AACtC,IAAA,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;;;QAG9D,MAAM,SAAS,GAAG,MAEF;AACd,YAAA,IAAI;AACF,gBAAA,OAAO,UAAU,CAAC,KAAK,CAAC,kBAAkB,CAAC;YAC7C;AAAE,YAAA,MAAM;;AAEN,gBAAA,OAAO,SAAS;YAClB;AACF,QAAA,CAAC;AACD,QAAA,MAAM,MAAM,GAAG,SAAS,EAAE;AAC1B,QAAA,IAAI;YACF,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACnC;AAAE,QAAA,MAAM;;;QAGR;AACA,QAAA,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA,EAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAA,EAAA,CAAI,CAAC;QACvD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,QAAA,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAClB,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;AACxC,YAAA,MAAM,KAAK,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS,EAAE;YAC5D,IACE,MAAM,KAAK,SAAS;AACpB,gBAAA,KAAK,KAAK,SAAS;AACnB,gBAAA,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG;AACvB,gBAAA,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAC9B,gBAAA,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAE9B,gBAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;QAC3B;IACF;AAAE,IAAA,MAAM;;QAEN,UAAU,CAAC,KAAK,EAAE;QAClB,QAAQ,CAAC,KAAK,EAAE;IAClB;AACF;;;;"}
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { filesystemClockReferences } from './filesystemClockReferences.mjs';
4
+ import { filesystemListingDevices } from './filesystemListingDevices.mjs';
4
5
 
5
6
  /**
6
7
  * Replace every prior clock proof with one reference minted by a fresh write.
@@ -22,6 +23,12 @@ import { filesystemClockReferences } from './filesystemClockReferences.mjs';
22
23
  * valid price for this optimization, so the cross-volume case degrades to more
23
24
  * reads instead.
24
25
  *
26
+ * Recreating the probe is also an entry change in the owned directory. When the
27
+ * view sees that directory's modification and change stamps both move, its
28
+ * device is admitted as one whose directory stamps witness their entries
29
+ * (`filesystemListingDevices`), so a plugin source listing can be replayed
30
+ * there instead of enumerated.
31
+ *
25
32
  * @evidence contracts/common.md#principled-implementation Clearing old references before a fresh owned probe write prevents previous or rolled-back stamps from certifying content; only observed regular-file metadata establishes a same-device reference.
26
33
  * @evidence contracts/common.md#clear-and-simple-design This operation mints and records one probe stamp; input metadata comparison remains in the separability consumer.
27
34
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed writes, inaccessible probes, or another device cannot be replaced by Date.now or a historical maximum; actual content proof remains necessary.
@@ -29,10 +36,10 @@ import { filesystemClockReferences } from './filesystemClockReferences.mjs';
29
36
  * @evidence contracts/portability.md#os-neutral-implementation OS-neutral clock proof uses native owned-path writes and the observing view's bigint device/time metadata, preserving cross-volume and unavailable-probe behavior without a platform clock assumption.
30
37
  * @evidence contracts/performance.md#efficient-algorithms
31
38
  * Clear the view's prior entries, then an available directory performs native
32
- * path joining, one write of process-counter text and one observed metadata
33
- * read. Costs include path/counter text and native I/O; a missing directory
34
- * skips I/O. Clearing/recording follows the current reference population,
35
- * not a scan of project inputs.
39
+ * path joining, one removal and one write of process-counter text and three
40
+ * observed metadata reads. Costs include path/counter text and native I/O; a
41
+ * missing directory skips I/O. Clearing/recording follows the current
42
+ * reference population, not a scan of project inputs.
36
43
  * @evidence contracts/performance.md#reuse-equivalent-work The existing probe path and shared per-view reference table are reused; only a newly minted stamp can authorize signature reuse.
37
44
  * @evidence contracts/performance.md#bound-retention-and-release-resources
38
45
  * Refresh clears history and retains at most one regular-file device stamp;
@@ -46,20 +53,49 @@ referenceDirectory,
46
53
  /** Coherent observing view whose device/time reference will be replaced. */
47
54
  filesystem) {
48
55
  const references = filesystemClockReferences(filesystem);
56
+ const listings = filesystemListingDevices(filesystem);
49
57
  references.clear();
58
+ listings.clear();
50
59
  if (referenceDirectory === undefined)
51
60
  return;
52
61
  try {
53
62
  const probe = path.join(referenceDirectory, "clock-reference");
63
+ // The probe is recreated rather than rewritten, so the owned directory sees
64
+ // an entry change whose effect on its stamps qualifies the device.
65
+ const directory = () => {
66
+ try {
67
+ return filesystem.lstat(referenceDirectory);
68
+ }
69
+ catch {
70
+ // A view that cannot state the directory only forgoes the listing.
71
+ return undefined;
72
+ }
73
+ };
74
+ const parent = directory();
75
+ try {
76
+ fs.rmSync(probe, { force: true });
77
+ }
78
+ catch {
79
+ // A probe that cannot be removed is rewritten in place, which moves no
80
+ // directory stamp, so the device is simply not admitted.
81
+ }
54
82
  fs.writeFileSync(probe, `${process.hrtime.bigint()}\n`);
55
83
  const stats = filesystem.lstat(probe);
56
84
  if (stats.isFile()) {
57
85
  references.set(stats.dev, stats.mtimeNs);
86
+ const moved = parent === undefined ? undefined : directory();
87
+ if (parent !== undefined &&
88
+ moved !== undefined &&
89
+ moved.dev === stats.dev &&
90
+ moved.mtimeNs > parent.mtimeNs &&
91
+ moved.ctimeNs > parent.ctimeNs)
92
+ listings.add(stats.dev);
58
93
  }
59
94
  }
60
95
  catch {
61
96
  // A failed refresh leaves no reference, so content comparison continues.
62
97
  references.clear();
98
+ listings.clear();
63
99
  }
64
100
  }
65
101
 
@@ -1 +1 @@
1
- {"version":3,"file":"refreshFilesystemClockReference.mjs","sources":["../../../../src/core/transform/clock/refreshFilesystemClockReference.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;SACa,+BAA+B;AAC7C;AACA,kBAAsC;AACtC;AACA,UAA6C,EAAA;AAE7C,IAAA,MAAM,UAAU,GAAG,yBAAyB,CAAC,UAAU,CAAC;IACxD,UAAU,CAAC,KAAK,EAAE;IAClB,IAAI,kBAAkB,KAAK,SAAS;QAAE;AACtC,IAAA,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;AAC9D,QAAA,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA,EAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAA,EAAA,CAAI,CAAC;QACvD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,QAAA,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAClB,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;QAC1C;IACF;AAAE,IAAA,MAAM;;QAEN,UAAU,CAAC,KAAK,EAAE;IACpB;AACF;;;;"}
1
+ {"version":3,"file":"refreshFilesystemClockReference.mjs","sources":["../../../../src/core/transform/clock/refreshFilesystemClockReference.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CG;SACa,+BAA+B;AAC7C;AACA,kBAAsC;AACtC;AACA,UAA6C,EAAA;AAE7C,IAAA,MAAM,UAAU,GAAG,yBAAyB,CAAC,UAAU,CAAC;AACxD,IAAA,MAAM,QAAQ,GAAG,wBAAwB,CAAC,UAAU,CAAC;IACrD,UAAU,CAAC,KAAK,EAAE;IAClB,QAAQ,CAAC,KAAK,EAAE;IAChB,IAAI,kBAAkB,KAAK,SAAS;QAAE;AACtC,IAAA,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;;;QAG9D,MAAM,SAAS,GAAG,MAEF;AACd,YAAA,IAAI;AACF,gBAAA,OAAO,UAAU,CAAC,KAAK,CAAC,kBAAkB,CAAC;YAC7C;AAAE,YAAA,MAAM;;AAEN,gBAAA,OAAO,SAAS;YAClB;AACF,QAAA,CAAC;AACD,QAAA,MAAM,MAAM,GAAG,SAAS,EAAE;AAC1B,QAAA,IAAI;YACF,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACnC;AAAE,QAAA,MAAM;;;QAGR;AACA,QAAA,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA,EAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAA,EAAA,CAAI,CAAC;QACvD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;AACrC,QAAA,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAClB,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;AACxC,YAAA,MAAM,KAAK,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS,EAAE;YAC5D,IACE,MAAM,KAAK,SAAS;AACpB,gBAAA,KAAK,KAAK,SAAS;AACnB,gBAAA,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG;AACvB,gBAAA,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAC9B,gBAAA,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAE9B,gBAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;QAC3B;IACF;AAAE,IAAA,MAAM;;QAEN,UAAU,CAAC,KAAK,EAAE;QAClB,QAAQ,CAAC,KAAK,EAAE;IAClB;AACF;;;;"}
@@ -217,7 +217,11 @@ async function captureTransformGeneration(props) {
217
217
  })
218
218
  : undefined;
219
219
  const claim = props.session !== undefined && state !== undefined
220
- ? await claimSharedCompile.claimSharedCompile(props.session, sharedCompileIdentity.sharedCompileIdentity({ ...props, projectRoot }), state, { adopt: true, rejectedPublication: props.rejected })
220
+ ? await claimSharedCompile.claimSharedCompile(props.session, sharedCompileIdentity.sharedCompileIdentity({ ...props, projectRoot }), state, {
221
+ adopt: true,
222
+ environment: compilerEnvironment,
223
+ rejectedPublication: props.rejected,
224
+ })
221
225
  : undefined;
222
226
  if (claim?.kind === "compile") {
223
227
  sharedClaim = claim;
@@ -576,7 +580,9 @@ async function captureTransformGeneration(props) {
576
580
  const graphFailures = compilerGraphInputProofFailures.compilerGraphInputProofFailures(cached);
577
581
  mergeGenerationProofFailures.mergeGenerationProofFailures(failures, graphFailures);
578
582
  mergeGenerationProofFailures.mergeGenerationProofFailures(failures, externalInputSnapshot.failures);
579
- const universalInputCapture = captureUniversalHostInputValidation.captureUniversalHostInputValidation(cached, props.currentFile);
583
+ // Recorded environment reads must hold under the environment this worker
584
+ // compiles under; a publication recorded under another value is refuted.
585
+ const universalInputCapture = captureUniversalHostInputValidation.captureUniversalHostInputValidation(cached, props.currentFile, compilerEnvironment);
580
586
  restrictNotificationCoverageToProvenInputs.restrictNotificationCoverageToProvenInputs(hostInputTracker, cached, universalInputCapture.validation);
581
587
  mergeGenerationProofFailures.mergeGenerationProofFailures(failures, universalInputCapture.failures);
582
588
  const graphProofs = graphFailures.entries.length === 0 && graphFailures.omitted === 0;