@ttsc/unplugin 0.31.0 → 0.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/bridge/projectRecordMoved.js +1 -1
- package/lib/core/bridge/projectRecordMoved.js.map +1 -1
- package/lib/core/bridge/projectRecordMoved.mjs +1 -1
- package/lib/core/bridge/projectRecordMoved.mjs.map +1 -1
- package/lib/core/bun/bun.d.cts +3 -2
- package/lib/core/bun/bun.d.mts +3 -2
- package/lib/core/bun/bun.d.ts +3 -2
- package/lib/core/bun/bun.js +8 -4
- package/lib/core/bun/bun.js.map +1 -1
- package/lib/core/bun/bun.mjs +8 -4
- package/lib/core/bun/bun.mjs.map +1 -1
- package/lib/core/observer/createInputObserver.js +7 -6
- package/lib/core/observer/createInputObserver.js.map +1 -1
- package/lib/core/observer/createInputObserver.mjs +7 -6
- package/lib/core/observer/createInputObserver.mjs.map +1 -1
- package/lib/core/observer/openIsolatedRecursiveWatch.d.cts +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.d.mts +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.d.ts +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.js +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.js.map +1 -1
- package/lib/core/observer/openIsolatedRecursiveWatch.mjs +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.mjs.map +1 -1
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +12 -3
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +12 -3
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +12 -3
- package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +2 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +2 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +2 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.js +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
- package/lib/core/transform/deliverCachedTransform.d.cts +36 -0
- package/lib/core/transform/deliverCachedTransform.d.mts +36 -0
- package/lib/core/transform/deliverCachedTransform.d.ts +36 -0
- package/lib/core/transform/deliverCachedTransform.js +73 -0
- package/lib/core/transform/deliverCachedTransform.js.map +1 -0
- package/lib/core/transform/deliverCachedTransform.mjs +71 -0
- package/lib/core/transform/deliverCachedTransform.mjs.map +1 -0
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.cts +2 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.mts +2 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.ts +2 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.js +6 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.js.map +1 -1
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.mjs +6 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.mjs.map +1 -1
- package/lib/core/transform/envelope/selectExternalInputPaths.d.cts +3 -5
- package/lib/core/transform/envelope/selectExternalInputPaths.d.mts +3 -5
- package/lib/core/transform/envelope/selectExternalInputPaths.d.ts +3 -5
- package/lib/core/transform/envelope/selectExternalInputPaths.js +8 -7
- package/lib/core/transform/envelope/selectExternalInputPaths.js.map +1 -1
- package/lib/core/transform/envelope/selectExternalInputPaths.mjs +8 -7
- package/lib/core/transform/envelope/selectExternalInputPaths.mjs.map +1 -1
- package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.cts +15 -12
- package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.mts +15 -12
- package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.ts +15 -12
- package/lib/core/transform/generation/captureFailedGenerationInputStates.js +1 -1
- package/lib/core/transform/generation/captureFailedGenerationInputStates.js.map +1 -1
- package/lib/core/transform/generation/captureFailedGenerationInputStates.mjs +1 -1
- package/lib/core/transform/generation/captureFailedGenerationInputStates.mjs.map +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.js +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.mjs +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js +2 -2
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js.map +1 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs +2 -2
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs.map +1 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.d.cts +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.d.mts +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.d.ts +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.js +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.js.map +1 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.mjs +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.mjs.map +1 -1
- package/lib/core/transform/generation/transformProject.d.cts +9 -7
- package/lib/core/transform/generation/transformProject.d.mts +9 -7
- package/lib/core/transform/generation/transformProject.d.ts +9 -7
- package/lib/core/transform/generation/transformProject.js +14 -9
- package/lib/core/transform/generation/transformProject.js.map +1 -1
- package/lib/core/transform/generation/transformProject.mjs +14 -9
- package/lib/core/transform/generation/transformProject.mjs.map +1 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.d.cts +9 -3
- package/lib/core/transform/inputs/pluginSourceFilesDigest.d.mts +9 -3
- package/lib/core/transform/inputs/pluginSourceFilesDigest.d.ts +9 -3
- package/lib/core/transform/inputs/pluginSourceFilesDigest.js +10 -4
- package/lib/core/transform/inputs/pluginSourceFilesDigest.js.map +1 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs +11 -5
- package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs.map +1 -1
- package/lib/core/transform/inputs/pluginSourceHolds.d.cts +4 -2
- package/lib/core/transform/inputs/pluginSourceHolds.d.mts +4 -2
- package/lib/core/transform/inputs/pluginSourceHolds.d.ts +4 -2
- package/lib/core/transform/inputs/pluginSourceHolds.js +9 -4
- package/lib/core/transform/inputs/pluginSourceHolds.js.map +1 -1
- package/lib/core/transform/inputs/pluginSourceHolds.mjs +9 -4
- package/lib/core/transform/inputs/pluginSourceHolds.mjs.map +1 -1
- package/lib/core/transform/inputs/pluginSourceState.d.cts +3 -1
- package/lib/core/transform/inputs/pluginSourceState.d.mts +3 -1
- package/lib/core/transform/inputs/pluginSourceState.d.ts +3 -1
- package/lib/core/transform/inputs/pluginSourceState.js +8 -3
- package/lib/core/transform/inputs/pluginSourceState.js.map +1 -1
- package/lib/core/transform/inputs/pluginSourceState.mjs +8 -3
- package/lib/core/transform/inputs/pluginSourceState.mjs.map +1 -1
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.cts +18 -5
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.mts +18 -5
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.ts +18 -5
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.js +53 -12
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.js.map +1 -1
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.mjs +53 -12
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/WatchBroker.d.cts +14 -4
- package/lib/core/transform/tracker/broker/WatchBroker.d.mts +14 -4
- package/lib/core/transform/tracker/broker/WatchBroker.d.ts +14 -4
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.cts +63 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.mts +63 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.ts +63 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.js +89 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.js.map +1 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.mjs +89 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.mjs.map +1 -0
- package/lib/core/transform/tracker/broker/drainWatchBroker.d.cts +8 -8
- package/lib/core/transform/tracker/broker/drainWatchBroker.d.mts +8 -8
- package/lib/core/transform/tracker/broker/drainWatchBroker.d.ts +8 -8
- package/lib/core/transform/tracker/broker/drainWatchBroker.js +12 -13
- package/lib/core/transform/tracker/broker/drainWatchBroker.js.map +1 -1
- package/lib/core/transform/tracker/broker/drainWatchBroker.mjs +12 -13
- package/lib/core/transform/tracker/broker/drainWatchBroker.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/getWatchBroker.d.cts +18 -15
- package/lib/core/transform/tracker/broker/getWatchBroker.d.mts +18 -15
- package/lib/core/transform/tracker/broker/getWatchBroker.d.ts +18 -15
- package/lib/core/transform/tracker/broker/getWatchBroker.js +87 -17
- package/lib/core/transform/tracker/broker/getWatchBroker.js.map +1 -1
- package/lib/core/transform/tracker/broker/getWatchBroker.mjs +87 -17
- package/lib/core/transform/tracker/broker/getWatchBroker.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/openBrokeredWatch.d.cts +5 -5
- package/lib/core/transform/tracker/broker/openBrokeredWatch.d.mts +5 -5
- package/lib/core/transform/tracker/broker/openBrokeredWatch.d.ts +5 -5
- package/lib/core/transform/tracker/broker/openBrokeredWatch.js +11 -14
- package/lib/core/transform/tracker/broker/openBrokeredWatch.js.map +1 -1
- package/lib/core/transform/tracker/broker/openBrokeredWatch.mjs +11 -14
- package/lib/core/transform/tracker/broker/openBrokeredWatch.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/usesWatchBroker.d.cts +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.d.mts +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.d.ts +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.js +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.mjs +7 -7
- package/lib/core/transform/tracker/broker/watchBrokerSource.d.cts +9 -10
- package/lib/core/transform/tracker/broker/watchBrokerSource.d.mts +9 -10
- package/lib/core/transform/tracker/broker/watchBrokerSource.d.ts +9 -10
- package/lib/core/transform/tracker/broker/watchBrokerSource.js +10 -11
- package/lib/core/transform/tracker/broker/watchBrokerSource.js.map +1 -1
- package/lib/core/transform/tracker/broker/watchBrokerSource.mjs +10 -11
- package/lib/core/transform/tracker/broker/watchBrokerSource.mjs.map +1 -1
- package/lib/core/transform/transformTtsc.d.cts +7 -4
- package/lib/core/transform/transformTtsc.d.mts +7 -4
- package/lib/core/transform/transformTtsc.d.ts +7 -4
- package/lib/core/transform/transformTtsc.js +38 -93
- package/lib/core/transform/transformTtsc.js.map +1 -1
- package/lib/core/transform/transformTtsc.mjs +38 -93
- package/lib/core/transform/transformTtsc.mjs.map +1 -1
- package/lib/core/transform/validation/TtscGenerationProof.d.cts +105 -0
- package/lib/core/transform/validation/TtscGenerationProof.d.mts +105 -0
- package/lib/core/transform/validation/TtscGenerationProof.d.ts +105 -0
- package/lib/core/transform/validation/TtscGenerationProof.js +149 -0
- package/lib/core/transform/validation/TtscGenerationProof.js.map +1 -0
- package/lib/core/transform/validation/TtscGenerationProof.mjs +149 -0
- package/lib/core/transform/validation/TtscGenerationProof.mjs.map +1 -0
- package/lib/core/transform/validation/captureUniversalHostInputValidation.js +2 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.js.map +1 -1
- package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs +2 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs.map +1 -1
- package/lib/core/transform/validation/matchesCachedSource.d.cts +18 -15
- package/lib/core/transform/validation/matchesCachedSource.d.mts +18 -15
- package/lib/core/transform/validation/matchesCachedSource.d.ts +18 -15
- package/lib/core/transform/validation/matchesCachedSource.js +28 -22
- package/lib/core/transform/validation/matchesCachedSource.js.map +1 -1
- package/lib/core/transform/validation/matchesCachedSource.mjs +28 -22
- package/lib/core/transform/validation/matchesCachedSource.mjs.map +1 -1
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.cts +3 -2
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.mts +3 -2
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.ts +3 -2
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.js +4 -4
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.js.map +1 -1
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs +4 -4
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs.map +1 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.cts +2 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.mts +2 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.ts +2 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.js +2 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.js.map +1 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs +2 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.cts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.mts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.ts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.js +7 -5
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.js.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.mjs +7 -5
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.mjs.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputs.d.cts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputs.d.mts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputs.d.ts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputs.js +5 -5
- package/lib/core/transform/validation/matchesUniversalHostInputs.js.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputs.mjs +5 -5
- package/lib/core/transform/validation/matchesUniversalHostInputs.mjs.map +1 -1
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.cts +5 -4
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.mts +5 -4
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.ts +5 -4
- package/lib/core/transform/validation/nativeInputPredicatesHold.js +31 -12
- package/lib/core/transform/validation/nativeInputPredicatesHold.js.map +1 -1
- package/lib/core/transform/validation/nativeInputPredicatesHold.mjs +31 -12
- package/lib/core/transform/validation/nativeInputPredicatesHold.mjs.map +1 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.cts +2 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.mts +2 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.ts +2 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.js +2 -2
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.js.map +1 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.mjs +2 -2
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.mjs.map +1 -1
- package/lib/core/transform/watch/captureWatchInputBaseline.d.cts +4 -0
- package/lib/core/transform/watch/captureWatchInputBaseline.d.mts +4 -0
- package/lib/core/transform/watch/captureWatchInputBaseline.d.ts +4 -0
- package/lib/core/transform/watch/captureWatchInputBaseline.js +3 -0
- package/lib/core/transform/watch/captureWatchInputBaseline.js.map +1 -1
- package/lib/core/transform/watch/captureWatchInputBaseline.mjs +3 -0
- package/lib/core/transform/watch/captureWatchInputBaseline.mjs.map +1 -1
- package/lib/core/transform/watch/captureWatchInputBaselines.d.cts +2 -0
- package/lib/core/transform/watch/captureWatchInputBaselines.d.mts +2 -0
- package/lib/core/transform/watch/captureWatchInputBaselines.d.ts +2 -0
- package/lib/core/transform/watch/captureWatchInputBaselines.js +3 -1
- package/lib/core/transform/watch/captureWatchInputBaselines.js.map +1 -1
- package/lib/core/transform/watch/captureWatchInputBaselines.mjs +3 -1
- package/lib/core/transform/watch/captureWatchInputBaselines.mjs.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.js +3 -0
- package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.mjs +3 -0
- package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.d.cts +5 -2
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.d.mts +5 -2
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.d.ts +5 -2
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js +6 -3
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js.map +1 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs +6 -3
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs.map +1 -1
- package/lib/core/turbopack/turbopack.js +2 -1
- package/lib/core/turbopack/turbopack.js.map +1 -1
- package/lib/core/turbopack/turbopack.mjs +2 -1
- package/lib/core/turbopack/turbopack.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/bridge/projectRecordMoved.ts +3 -1
- package/src/core/bun/bun.ts +8 -4
- package/src/core/observer/createInputObserver.ts +8 -5
- package/src/core/observer/openIsolatedRecursiveWatch.ts +11 -12
- package/src/core/transform/cache/TtscCachedProjectTransform.ts +13 -3
- package/src/core/transform/cache/selectCachedGenerationAction.ts +9 -1
- package/src/core/transform/deliverCachedTransform.ts +97 -0
- package/src/core/transform/envelope/selectDeclaredProjectInputKeys.ts +5 -2
- package/src/core/transform/envelope/selectExternalInputPaths.ts +7 -7
- package/src/core/transform/filesystem/TtscTransformFilesystemOperations.ts +15 -12
- package/src/core/transform/generation/captureFailedGenerationInputStates.ts +1 -0
- package/src/core/transform/generation/captureTransformGeneration.ts +6 -1
- package/src/core/transform/generation/failedGenerationEnvironmentChanged.ts +12 -2
- package/src/core/transform/generation/selectTransformAttemptDisposition.ts +3 -1
- package/src/core/transform/generation/transformProject.ts +13 -9
- package/src/core/transform/inputs/pluginSourceFilesDigest.ts +11 -4
- package/src/core/transform/inputs/pluginSourceHolds.ts +13 -3
- package/src/core/transform/inputs/pluginSourceState.ts +8 -2
- package/src/core/transform/inputs/preparePluginBuildEnvironments.ts +64 -11
- package/src/core/transform/tracker/broker/WatchBroker.ts +15 -4
- package/src/core/transform/tracker/broker/WatchBrokerTransport.ts +82 -0
- package/src/core/transform/tracker/broker/drainWatchBroker.ts +12 -13
- package/src/core/transform/tracker/broker/getWatchBroker.ts +89 -18
- package/src/core/transform/tracker/broker/openBrokeredWatch.ts +11 -14
- package/src/core/transform/tracker/broker/usesWatchBroker.ts +7 -7
- package/src/core/transform/tracker/broker/watchBrokerSource.ts +10 -11
- package/src/core/transform/transformTtsc.ts +38 -92
- package/src/core/transform/validation/TtscGenerationProof.ts +201 -0
- package/src/core/transform/validation/captureUniversalHostInputValidation.ts +2 -1
- package/src/core/transform/validation/matchesCachedSource.ts +27 -21
- package/src/core/transform/validation/matchesCompleteInputSnapshot.ts +5 -3
- package/src/core/transform/validation/matchesNarrowPersistentInputs.ts +3 -1
- package/src/core/transform/validation/matchesUniversalHostInputTrees.ts +8 -3
- package/src/core/transform/validation/matchesUniversalHostInputs.ts +6 -4
- package/src/core/transform/validation/nativeInputPredicatesHold.ts +36 -14
- package/src/core/transform/validation/notificationsProveProgramUnchanged.ts +3 -1
- package/src/core/transform/watch/captureWatchInputBaseline.ts +4 -0
- package/src/core/transform/watch/captureWatchInputBaselines.ts +7 -1
- package/src/core/transform/watch/notifyWatchInputs.ts +3 -0
- package/src/core/transform/watch/watchInputEvidenceMatchesDisk.ts +12 -2
- package/src/core/turbopack/turbopack.ts +2 -1
|
@@ -7,6 +7,7 @@ import { WATCH_PROBE_DIRECTORY_PREFIX } from "./WATCH_PROBE_DIRECTORY_PREFIX";
|
|
|
7
7
|
import { WATCH_PROBE_TIMEOUT_MS } from "./WATCH_PROBE_TIMEOUT_MS";
|
|
8
8
|
import type { WatchBrokerLocation } from "./WatchBrokerLocation";
|
|
9
9
|
import type { WatchBrokerSink } from "./WatchBrokerSink";
|
|
10
|
+
import { WatchBrokerTransport } from "./WatchBrokerTransport";
|
|
10
11
|
import { drainWatchBroker } from "./drainWatchBroker";
|
|
11
12
|
import { getWatchBroker } from "./getWatchBroker";
|
|
12
13
|
import { probeForLocation } from "./probeForLocation";
|
|
@@ -16,11 +17,11 @@ import { sweepAbandonedWatchProbes } from "./sweepAbandonedWatchProbes";
|
|
|
16
17
|
* Open directory watches in the isolated watch process for one sink, and report
|
|
17
18
|
* when they hear.
|
|
18
19
|
*
|
|
19
|
-
* On Windows,
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* macOS, each registration's watches are streams of their own, started
|
|
23
|
-
* the child reports ready, and a dropped event reaches the sink as a gap
|
|
20
|
+
* On Windows, ttsc's native helper owns completion-port directory subscriptions
|
|
21
|
+
* and omits access-only notifications (#1719). Native loss and failure withdraw
|
|
22
|
+
* coverage; actual change events remain authoritative even after A-B-A writes.
|
|
23
|
+
* On macOS, each registration's watches are streams of their own, started
|
|
24
|
+
* before the child reports ready, and a dropped event reaches the sink as a gap
|
|
24
25
|
* (samchon/ttsc#1425). A stream that can be probed reports ready only once its
|
|
25
26
|
* opening probe came back through it; the child suppresses ordinary callbacks
|
|
26
27
|
* received before that probe. This is its backend protocol, not a guarantee
|
|
@@ -143,10 +144,7 @@ export function openBrokeredWatch(
|
|
|
143
144
|
};
|
|
144
145
|
});
|
|
145
146
|
broker.pendingRegistrations += 1;
|
|
146
|
-
|
|
147
|
-
// Bun's IPC channel omits Node's Control.ref/unref methods. The child itself
|
|
148
|
-
// still owns the outstanding acknowledgement on that runtime.
|
|
149
|
-
broker.child.channel?.ref?.();
|
|
147
|
+
WatchBrokerTransport.reference(broker, true);
|
|
150
148
|
const id = broker.nextId++;
|
|
151
149
|
let resolveReady!: () => void;
|
|
152
150
|
const answered = new Promise<void>((resolve) => {
|
|
@@ -166,7 +164,7 @@ export function openBrokeredWatch(
|
|
|
166
164
|
let failed = false;
|
|
167
165
|
let failure: unknown;
|
|
168
166
|
try {
|
|
169
|
-
|
|
167
|
+
WatchBrokerTransport.send(broker, { id, op: "remove" });
|
|
170
168
|
} catch (error) {
|
|
171
169
|
failed = true;
|
|
172
170
|
failure = error;
|
|
@@ -176,7 +174,7 @@ export function openBrokeredWatch(
|
|
|
176
174
|
WATCH_BROKER.current = undefined;
|
|
177
175
|
}
|
|
178
176
|
try {
|
|
179
|
-
|
|
177
|
+
WatchBrokerTransport.close(broker);
|
|
180
178
|
} catch (error) {
|
|
181
179
|
if (!failed) {
|
|
182
180
|
failed = true;
|
|
@@ -194,7 +192,7 @@ export function openBrokeredWatch(
|
|
|
194
192
|
}
|
|
195
193
|
if (failed) throw failure;
|
|
196
194
|
};
|
|
197
|
-
|
|
195
|
+
WatchBrokerTransport.send(broker, {
|
|
198
196
|
allEvents: options.allEvents,
|
|
199
197
|
locations: normalized,
|
|
200
198
|
id,
|
|
@@ -226,8 +224,7 @@ export function openBrokeredWatch(
|
|
|
226
224
|
// a reply over an unreferenced channel lets the loop empty and the process
|
|
227
225
|
// exit mid-build.
|
|
228
226
|
if (broker.pendingRegistrations === 0 && broker.pendingDrains === 0) {
|
|
229
|
-
|
|
230
|
-
broker.child.channel?.unref?.();
|
|
227
|
+
WatchBrokerTransport.reference(broker, false);
|
|
231
228
|
}
|
|
232
229
|
});
|
|
233
230
|
return {
|
|
@@ -4,13 +4,13 @@ import type { TtscTransformFilesystemOperations } from "../../filesystem/TtscTra
|
|
|
4
4
|
* Whether a tracker over `filesystem` opens its watches in the isolated watch
|
|
5
5
|
* broker rather than in this process.
|
|
6
6
|
*
|
|
7
|
-
* The host filesystem on Windows and macOS does: Windows so that
|
|
8
|
-
*
|
|
9
|
-
* own FSEventStream, whose dropped events
|
|
10
|
-
* re-creates whenever any watch in the host
|
|
11
|
-
* discards (samchon/ttsc#1418,
|
|
12
|
-
* its own `watch` retains that
|
|
13
|
-
* view.
|
|
7
|
+
* The host filesystem on Windows and macOS does: Windows so that native
|
|
8
|
+
* mutation filters exclude access-time noise without a Node fs-event handle,
|
|
9
|
+
* and macOS so that each watch is its own FSEventStream, whose dropped events
|
|
10
|
+
* are reported, rather than one libuv re-creates whenever any watch in the host
|
|
11
|
+
* opens or closes, and whose drops it discards (samchon/ttsc#1418,
|
|
12
|
+
* samchon/ttsc#1425). An embedder that supplies its own `watch` retains that
|
|
13
|
+
* capability, including for a host-filesystem view.
|
|
14
14
|
*
|
|
15
15
|
* @evidence contracts/common.md#principled-implementation
|
|
16
16
|
* A supplied filesystem watcher is authoritative; only the native host
|
|
@@ -8,13 +8,10 @@ import { WATCH_PROBE_TIMEOUT_MS } from "./WATCH_PROBE_TIMEOUT_MS";
|
|
|
8
8
|
* frontier described below; a reply alone does not certify every scope, since
|
|
9
9
|
* probe-dependent streams can be named unproven and gaps withdraw authority.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* are not a universal kernel-order proof: FIFO completion-port queueing alone
|
|
16
|
-
* does not guarantee dequeue order or establish when notification completion
|
|
17
|
-
* becomes observable relative to a write and IPC request.
|
|
11
|
+
* Windows production registrations use ttsc's native helper, not this program
|
|
12
|
+
* (#1719). The optional fs.watch backend remains an explicit direct program
|
|
13
|
+
* capability used by its scripted protocol tests; it never supplies Windows
|
|
14
|
+
* production cache proof. Its drain yields through two immediate turns.
|
|
18
15
|
*
|
|
19
16
|
* On macOS the watches go through the `fsevents` binding, one FSEventStream per
|
|
20
17
|
* location, instead of relying on `fs.watch` for stream and loss authority
|
|
@@ -59,11 +56,13 @@ import { WATCH_PROBE_TIMEOUT_MS } from "./WATCH_PROBE_TIMEOUT_MS";
|
|
|
59
56
|
* The child protocol keeps per-registration streams and ordered drains;
|
|
60
57
|
* macOS proof requires clean probe delivery. Loss flags withdraw coverage
|
|
61
58
|
* before probe recognition, so matching a probe name cannot erase that warning.
|
|
62
|
-
* The
|
|
59
|
+
* The optional fs.watch two-turn frontier retains its runtime/backend ordering premise;
|
|
63
60
|
* this source does not independently prove kernel completeness.
|
|
64
61
|
* @evidence contracts/common.md#clear-and-simple-design
|
|
65
|
-
* One maintained child program serves
|
|
66
|
-
*
|
|
62
|
+
* One maintained child program serves macOS and the explicitly selected
|
|
63
|
+
* fs.watch protocol capability; Windows production uses its native helper.
|
|
64
|
+
* This function injects resolved capability and the shared timeout with
|
|
65
|
+
* JSON-safe path encoding.
|
|
67
66
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts
|
|
68
67
|
* Native flags and deadlines express backend contracts, not fixture-specific
|
|
69
68
|
* repairs. Missing bindings and probes report uncertainty rather than silent success.
|
|
@@ -351,7 +350,7 @@ function drain(requestId) {
|
|
|
351
350
|
entry.abandon();
|
|
352
351
|
}
|
|
353
352
|
}
|
|
354
|
-
//
|
|
353
|
+
// Explicit fs.watch watches, and streams already proven, answer after two turns: the
|
|
355
354
|
// first lets the loop poll for completions the kernel had already queued,
|
|
356
355
|
// the second answers after their callbacks.
|
|
357
356
|
outstanding += 1;
|
|
@@ -10,37 +10,28 @@ import { TRANSFORM_RESULT_FILESYSTEM } from "./cache/TRANSFORM_RESULT_FILESYSTEM
|
|
|
10
10
|
import type { TtscTransformCache } from "./cache/TtscTransformCache";
|
|
11
11
|
import { awaitOrEvict } from "./cache/awaitOrEvict";
|
|
12
12
|
import { createTransformCacheKey } from "./cache/createTransformCacheKey";
|
|
13
|
-
import { disposeCachedTransform } from "./cache/disposeCachedTransform";
|
|
14
13
|
import { evictGeneration } from "./cache/evictGeneration";
|
|
15
14
|
import { replaysTerminalGeneration } from "./cache/replaysTerminalGeneration";
|
|
16
15
|
import { selectCachedGenerationAction } from "./cache/selectCachedGenerationAction";
|
|
17
|
-
import { selectOrEvict } from "./cache/selectOrEvict";
|
|
18
16
|
import { transformCacheEpoch } from "./cache/transformCacheEpoch";
|
|
19
17
|
import { transformCacheTrustsNotifications } from "./cache/transformCacheTrustsNotifications";
|
|
20
18
|
import { transformFilesystem } from "./cache/transformFilesystem";
|
|
21
19
|
import { withdrawGenerationNotifications } from "./cache/withdrawGenerationNotifications";
|
|
22
|
-
import {
|
|
23
|
-
import { reportSuccessDiagnostics } from "./diagnostics/reportSuccessDiagnostics";
|
|
24
|
-
import type { TtscTransformedOutput } from "./envelope/TtscTransformedOutput";
|
|
25
|
-
import { TtscMissingProgramOutputError } from "./errors/TtscMissingProgramOutputError";
|
|
20
|
+
import { deliverCachedTransform } from "./deliverCachedTransform";
|
|
26
21
|
import { TtscUnstableGenerationError } from "./errors/TtscUnstableGenerationError";
|
|
27
22
|
import { transformProject } from "./generation/transformProject";
|
|
28
23
|
import { preparePluginBuildEnvironments } from "./inputs/preparePluginBuildEnvironments";
|
|
29
24
|
import { TRANSFORM_CACHE_SESSIONS } from "./session/TRANSFORM_CACHE_SESSIONS";
|
|
30
25
|
import { settleProjectMutationEvents } from "./tracker/settleProjectMutationEvents";
|
|
31
26
|
import { resolveProjectSelection } from "./tsconfig/resolveProjectSelection";
|
|
32
|
-
import { createTransformResult } from "./utils/createTransformResult";
|
|
33
27
|
import { isDeclarationFile } from "./utils/isDeclarationFile";
|
|
34
28
|
import { isHostWrapperQuery } from "./utils/isHostWrapperQuery";
|
|
35
29
|
import { pluginsAreDisabled } from "./utils/pluginsAreDisabled";
|
|
36
30
|
import { stripQuery } from "./utils/stripQuery";
|
|
37
|
-
import {
|
|
31
|
+
import { TtscGenerationProof } from "./validation/TtscGenerationProof";
|
|
38
32
|
import type { TtscTransformHooks } from "./watch/TtscTransformHooks";
|
|
39
33
|
import type { TtscWatchSelection } from "./watch/TtscWatchSelection";
|
|
40
|
-
import { notifyFailedGenerationInputs } from "./watch/notifyFailedGenerationInputs";
|
|
41
34
|
import { notifyRejectedGenerationInputs } from "./watch/notifyRejectedGenerationInputs";
|
|
42
|
-
import { notifyVolatileDelivery } from "./watch/notifyVolatileDelivery";
|
|
43
|
-
import { notifyWatchInputs } from "./watch/notifyWatchInputs";
|
|
44
35
|
import { prepareProjectRecordDirectories } from "./watch/prepareProjectRecordDirectories";
|
|
45
36
|
|
|
46
37
|
/**
|
|
@@ -78,7 +69,7 @@ import { prepareProjectRecordDirectories } from "./watch/prepareProjectRecordDir
|
|
|
78
69
|
* per build, not per compilation.
|
|
79
70
|
* @evidence contracts/common.md#principled-implementation Project selection and generation-qualified cache admission preserve compiler disk authority; fresh-only success additionally needs an explicit nonwatching lifecycle, coherent project declaration and actual host-cache withdrawal, because incomplete observation cannot support watch invalidation.
|
|
80
71
|
* @evidence contracts/common.md#clear-and-simple-design One delivery coordinator composes project selection, cache admission, compilation, output selection and host notifications; dedicated owners handle proof and lifetime internals.
|
|
81
|
-
* @evidence contracts/common.md#prohibited-implementation-shortcuts Wrapper modules cannot poison source baselines
|
|
72
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Wrapper modules cannot poison source baselines; incomplete local results can share only explicitly nonwatching first deliveries in their exact pass. Unknown/watching lifecycles or unsupported withdrawal reject and evict them rather than invent persistent records or dependency closure.
|
|
82
73
|
* @evidence contracts/common.md#meaningful-documentation Native paragraphs and argument tags explain project scope, no-transform outcomes, cache epochs and per-build notification responsibilities with links to maintained reference context.
|
|
83
74
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
84
75
|
* Selection/key construction pays ancestor/config/alias/option/path text work.
|
|
@@ -86,15 +77,18 @@ import { prepareProjectRecordDirectories } from "./watch/prepareProjectRecordDir
|
|
|
86
77
|
* replay source/project/external/universal proofs before selecting output.
|
|
87
78
|
* In-flight/valid completed reuse avoids compilation, not those checks or
|
|
88
79
|
* output/map/notification/record work. Capture misses pay whole native compile
|
|
89
|
-
* and input populations
|
|
80
|
+
* and input populations. The common proof owner skips redundant environment
|
|
81
|
+
* preparation for proven first deliveries and shares synchronous native proof
|
|
82
|
+
* queries; persistent/repeated delivery establishes fresh authority. Concurrent supersession can repeat the outer loop
|
|
90
83
|
* without a delivery-level retry/time bound here.
|
|
91
84
|
* @evidence contracts/performance.md#reuse-equivalent-work Cache identity covers config/options/plugins/aliases; current generations, pass-qualified terminal verdicts and in-flight Promises are shared only while their source and dependency proof remains valid.
|
|
92
85
|
* @evidence contracts/performance.md#bound-retention-and-release-resources
|
|
93
86
|
* Optional cache state retains current generation Promises/results and
|
|
94
87
|
* per-key dependency/case facts without a byte/key cap here. Native tasks
|
|
95
88
|
* belong to compiler/capture owners; uncached captures retain no notification
|
|
96
|
-
* or persistent clock probe. Fresh-only delivery
|
|
97
|
-
*
|
|
89
|
+
* or persistent clock probe. Fresh-only delivery releases capture resources,
|
|
90
|
+
* retaining only an explicitly admitted local pass result; rejected or failed
|
|
91
|
+
* incomplete handoff detaches its generation. Eviction/disposal attempt independent resource release
|
|
98
92
|
* and native failures need not close every handle or remove every probe.
|
|
99
93
|
* @evidence contracts/portability.md#os-neutral-implementation Native module paths and project coordinates use supported path/filesystem abstractions, while actual case policy and watcher capability come from generation proof rather than OS-name assumptions.
|
|
100
94
|
*/
|
|
@@ -171,6 +165,8 @@ export async function transformTtsc(
|
|
|
171
165
|
await preparePluginBuildEnvironments(
|
|
172
166
|
terminal.validation.cached.result,
|
|
173
167
|
filesystem,
|
|
168
|
+
undefined,
|
|
169
|
+
terminal.validation.cached.projectRoot,
|
|
174
170
|
);
|
|
175
171
|
if (cache?.get(key) !== transformed) continue;
|
|
176
172
|
}
|
|
@@ -218,15 +214,18 @@ export async function transformTtsc(
|
|
|
218
214
|
if (!transformCacheTrustsNotifications(cache)) {
|
|
219
215
|
withdrawGenerationNotifications(cached);
|
|
220
216
|
}
|
|
221
|
-
await preparePluginBuildEnvironments(cached.result, filesystem, cached);
|
|
222
|
-
if (cache?.get(key) !== transformed) continue;
|
|
223
217
|
if (epoch === undefined) {
|
|
224
218
|
await settleProjectMutationEvents(cached);
|
|
225
219
|
if (cache?.get(key) !== transformed) {
|
|
226
220
|
continue;
|
|
227
221
|
}
|
|
228
222
|
}
|
|
223
|
+
await TtscGenerationProof.prepare(cached, file, epoch);
|
|
224
|
+
if (cache?.get(key) !== transformed) continue;
|
|
225
|
+
// No await between this observation and synchronous admission.
|
|
226
|
+
const proof = TtscGenerationProof.create(cached, file, epoch);
|
|
229
227
|
const action = selectCachedGenerationAction({
|
|
228
|
+
proof,
|
|
230
229
|
cache,
|
|
231
230
|
cached,
|
|
232
231
|
epoch,
|
|
@@ -239,36 +238,17 @@ export async function transformTtsc(
|
|
|
239
238
|
continue;
|
|
240
239
|
}
|
|
241
240
|
if (action === "serve") {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
});
|
|
254
|
-
} catch (error) {
|
|
255
|
-
if (!(error instanceof TtscMissingProgramOutputError)) {
|
|
256
|
-
notifyFailedGenerationInputs(hooks, cached, file, watchSelection);
|
|
257
|
-
throw error;
|
|
258
|
-
}
|
|
259
|
-
// The compile is fine and simply has nothing for this module, so the
|
|
260
|
-
// module goes back to the host untransformed rather than failing the
|
|
261
|
-
// build (samchon/ttsc#1308). Its project config and selection inputs
|
|
262
|
-
// still decide whether a later generation will contain this module,
|
|
263
|
-
// so hosts must receive the same universal watch-input batch.
|
|
264
|
-
reportMissingProgramOutput(cached, error, epoch);
|
|
265
|
-
notifyWatchInputs(hooks, cached, file, watchSelection);
|
|
266
|
-
markCachedSourceServed(cached, file);
|
|
267
|
-
return undefined;
|
|
268
|
-
}
|
|
269
|
-
notifyWatchInputs(hooks, cached, file, watchSelection);
|
|
270
|
-
markCachedSourceServed(cached, file);
|
|
271
|
-
return createTransformResult(file, source, output);
|
|
241
|
+
return deliverCachedTransform({
|
|
242
|
+
cache,
|
|
243
|
+
cached,
|
|
244
|
+
generation: transformed,
|
|
245
|
+
key,
|
|
246
|
+
epoch,
|
|
247
|
+
file,
|
|
248
|
+
source,
|
|
249
|
+
hooks,
|
|
250
|
+
selection: watchSelection,
|
|
251
|
+
});
|
|
272
252
|
}
|
|
273
253
|
transformed = undefined;
|
|
274
254
|
}
|
|
@@ -336,50 +316,16 @@ export async function transformTtsc(
|
|
|
336
316
|
policies.set(key, reported);
|
|
337
317
|
}
|
|
338
318
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
(hooks.project?.watching !== undefined &&
|
|
351
|
-
hooks.project.watching !== hooks.watching))
|
|
352
|
-
) {
|
|
353
|
-
throw new Error(
|
|
354
|
-
"@ttsc/unplugin: plugin input observation is unavailable; fresh output " +
|
|
355
|
-
"requires an explicitly nonwatching host with supported cache withdrawal. " +
|
|
356
|
-
"Watching, unknown or contradictory lifecycles cannot safely observe its changes.",
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
hooks?.markVolatile?.();
|
|
360
|
-
}
|
|
361
|
-
reportSuccessDiagnostics(cached, epoch);
|
|
362
|
-
let output: TtscTransformedOutput;
|
|
363
|
-
try {
|
|
364
|
-
output = selectOrEvict(cache, key, generation, epoch, {
|
|
365
|
-
file,
|
|
366
|
-
projectRoot,
|
|
367
|
-
result,
|
|
368
|
-
tsconfig: cached.tsconfig,
|
|
369
|
-
});
|
|
370
|
-
} catch (error) {
|
|
371
|
-
if (!(error instanceof TtscMissingProgramOutputError)) {
|
|
372
|
-
notifyFailedGenerationInputs(hooks, cached, file, watchSelection);
|
|
373
|
-
throw error;
|
|
374
|
-
}
|
|
375
|
-
reportMissingProgramOutput(cached, error, epoch);
|
|
376
|
-
notifyWatchInputs(hooks, cached, file, watchSelection);
|
|
377
|
-
markCachedSourceServed(cached, file);
|
|
378
|
-
return undefined;
|
|
379
|
-
}
|
|
380
|
-
notifyWatchInputs(hooks, cached, file, watchSelection);
|
|
381
|
-
markCachedSourceServed(cached, file);
|
|
382
|
-
notifyVolatileDelivery(hooks, cached, file);
|
|
383
|
-
return createTransformResult(file, source, output);
|
|
319
|
+
return deliverCachedTransform({
|
|
320
|
+
cache,
|
|
321
|
+
cached,
|
|
322
|
+
generation,
|
|
323
|
+
key,
|
|
324
|
+
epoch,
|
|
325
|
+
file,
|
|
326
|
+
source,
|
|
327
|
+
hooks,
|
|
328
|
+
selection: watchSelection,
|
|
329
|
+
});
|
|
384
330
|
}
|
|
385
331
|
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { PluginBuildEnvironmentReadings } from "ttsc/plugin-source";
|
|
2
|
+
|
|
3
|
+
import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
|
|
4
|
+
import type { TtscTransformCache } from "../cache/TtscTransformCache";
|
|
5
|
+
import { disposeCachedTransform } from "../cache/disposeCachedTransform";
|
|
6
|
+
import { evictGeneration } from "../cache/evictGeneration";
|
|
7
|
+
import { resultFilesystem } from "../cache/resultFilesystem";
|
|
8
|
+
import { envelopeDerivation } from "../envelope/envelopeDerivation";
|
|
9
|
+
import { selectPluginSourceInputs } from "../envelope/selectPluginSourceInputs";
|
|
10
|
+
import { pathIdentityKey } from "../filesystem/pathIdentityKey";
|
|
11
|
+
import { preparePluginBuildEnvironments } from "../inputs/preparePluginBuildEnvironments";
|
|
12
|
+
import { toProjectKey } from "../project/toProjectKey";
|
|
13
|
+
import type { TtscTransformHooks } from "../watch/TtscTransformHooks";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The shared ownership boundary for generation reuse in every adapter.
|
|
17
|
+
*
|
|
18
|
+
* WARNING (#1712, #1713): a module, a synchronous input-proof transaction, a
|
|
19
|
+
* delivery pass, and a persistent generation have different lifetimes. Keep
|
|
20
|
+
* those distinctions here. Do not add native preparation before every module,
|
|
21
|
+
* keep positive toolchain checks for a whole process, or make Bun's adapter
|
|
22
|
+
* invent its own cache policy. A proven pass shares its first deliveries;
|
|
23
|
+
* persistent/repeated deliveries require new current observations. Incomplete
|
|
24
|
+
* observations can share a coherent local result only inside an explicitly
|
|
25
|
+
* nonwatching pass with actual host-cache withdrawal, never a record or pool.
|
|
26
|
+
*
|
|
27
|
+
* @evidence contracts/common.md#principled-implementation Explicit pass identity, source baseline and first-delivery membership delimit sharing; synchronous transactions independently qualify current native inputs and incomplete local outputs retain stricter lifecycle admission.
|
|
28
|
+
* @evidence contracts/common.md#clear-and-simple-design One core owner supplies the same preparation, pass and fresh-only policies to every adapter instead of separate host-specific caches.
|
|
29
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Missing observation never becomes complete snapshot authority; watching, persistent, repeated and unknown boundaries cannot borrow an incomplete pass result.
|
|
30
|
+
* @evidence contracts/common.md#meaningful-documentation Native context names the four lifetimes and warns against the specific performance and stale-cache regressions they prevent.
|
|
31
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Members delegate native observations to the generation's filesystem and the native environment owner.
|
|
32
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Members own baseline lookup, batch qualification and admission.
|
|
33
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Members establish the distinct sharing boundaries.
|
|
34
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The namespace owns no registry; transactions and generations have explicit callers.
|
|
35
|
+
*/
|
|
36
|
+
export namespace TtscGenerationProof {
|
|
37
|
+
/**
|
|
38
|
+
* One synchronous admission after all asynchronous preparation has settled.
|
|
39
|
+
* Never retain this object in a generation or use it after an await.
|
|
40
|
+
*
|
|
41
|
+
* @evidence contracts/common.md#principled-implementation The exact cached owner prevents a proof of another result from supplying authority; optional native verdict is earned only by this synchronous transaction.
|
|
42
|
+
* @evidence contracts/common.md#clear-and-simple-design One transaction carries environment observations and the shared native predicate verdict.
|
|
43
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Absent environment or predicate proof remains absent, never implied success.
|
|
44
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states the no-await lifetime and members distinguish owner, environment and predicate authority.
|
|
45
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Native identity is retained by the referenced generation, not inferred by this carrier.
|
|
46
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms This carrier executes no computation.
|
|
47
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The creating operation and validators own sharing decisions.
|
|
48
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The synchronous caller owns this handle-free carrier.
|
|
49
|
+
*/
|
|
50
|
+
export interface Transaction {
|
|
51
|
+
/** Exact generation being synchronously admitted. */
|
|
52
|
+
readonly cached: TtscCachedProjectTransform;
|
|
53
|
+
|
|
54
|
+
/** Current batch, absent when the pass already owns this input proof. */
|
|
55
|
+
readonly environments?: ReadonlyMap<string, string | undefined>;
|
|
56
|
+
|
|
57
|
+
/** Current native predicate verdict, unbuilt until its first gate. */
|
|
58
|
+
nativePredicates?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Prepare native authority only when this delivery needs a new input proof.
|
|
63
|
+
* The caller must create its synchronous transaction after awaiting this.
|
|
64
|
+
*
|
|
65
|
+
* @evidence contracts/common.md#principled-implementation A qualified first-delivery pass already owns environment proof; all other requests prepare actual authority before synchronous admission.
|
|
66
|
+
* @evidence contracts/common.md#clear-and-simple-design One branch delegates native preparation rather than repeating it in adapters.
|
|
67
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Only the existing explicit pass contract permits skipping preparation; no watcher silence or process lifetime substitutes for it.
|
|
68
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states preparation versus transaction ordering.
|
|
69
|
+
* @evidence contracts/portability.md#os-neutral-implementation Preparation uses the actual generation filesystem and native toolchain reader.
|
|
70
|
+
* @evidence contracts/performance.md#efficient-algorithms Qualified first deliveries perform baseline/identity lookups; other deliveries delegate one preparation per unique plugin directory.
|
|
71
|
+
* @evidence contracts/performance.md#reuse-equivalent-work The pass shares its existing first-delivery proof; persistent and repeated deliveries establish new native authority.
|
|
72
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Native requests belong to their environment owner; no transaction survives this await.
|
|
73
|
+
*/
|
|
74
|
+
export async function prepare(
|
|
75
|
+
cached: TtscCachedProjectTransform,
|
|
76
|
+
file: string,
|
|
77
|
+
epoch: number | undefined,
|
|
78
|
+
): Promise<void> {
|
|
79
|
+
if (!sharesPass(cached, file, epoch))
|
|
80
|
+
await preparePluginBuildEnvironments(
|
|
81
|
+
cached.result,
|
|
82
|
+
resultFilesystem(cached.result),
|
|
83
|
+
cached,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Start fresh synchronous observation after notification and preparation
|
|
89
|
+
* awaits, sharing actual SDK queries and native predicate replay locally.
|
|
90
|
+
*
|
|
91
|
+
* @evidence contracts/common.md#principled-implementation Current environments are batch-qualified after asynchronous work; a qualified pass needs no redundant native environment observation.
|
|
92
|
+
* @evidence contracts/common.md#clear-and-simple-design One constructor binds observations to their exact generation.
|
|
93
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No current verdict is retained across deliveries or asynchronous boundaries.
|
|
94
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the mandatory ordering and synchronous lifetime.
|
|
95
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native observation remains with the environment witness owner and actual generation path identity.
|
|
96
|
+
* @evidence contracts/performance.md#efficient-algorithms Plugin selection is generation-indexed; one batch shares variable hashing and distinct SDK metadata queries.
|
|
97
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Only the following synchronous validators borrow this batch; pass sharing uses its independent first-delivery contract.
|
|
98
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The caller releases the transaction at the end of synchronous admission; no registry or native handle is acquired.
|
|
99
|
+
*/
|
|
100
|
+
export function create(
|
|
101
|
+
cached: TtscCachedProjectTransform,
|
|
102
|
+
file: string,
|
|
103
|
+
epoch: number | undefined,
|
|
104
|
+
): Transaction {
|
|
105
|
+
return {
|
|
106
|
+
cached,
|
|
107
|
+
...(sharesPass(cached, file, epoch)
|
|
108
|
+
? {}
|
|
109
|
+
: {
|
|
110
|
+
environments: PluginBuildEnvironmentReadings.cachedAll(
|
|
111
|
+
selectPluginSourceInputs(cached.result).keys(),
|
|
112
|
+
),
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Whether this module's first delivery belongs to this generation's proven
|
|
119
|
+
* pass. A missing source baseline cannot acquire this permission.
|
|
120
|
+
*
|
|
121
|
+
* @evidence contracts/common.md#principled-implementation Epoch equality, coherent snapshot or admitted local-pass state, a recorded source and an unserved identity are all required.
|
|
122
|
+
* @evidence contracts/common.md#clear-and-simple-design One predicate is shared by async preparation and synchronous source validation.
|
|
123
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts An incomplete ordinary generation or absent module baseline cannot earn pass reuse.
|
|
124
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states the first-delivery and baseline restrictions.
|
|
125
|
+
* @evidence contracts/portability.md#os-neutral-implementation Baselines use the generation's actual identity and compiler project-key policy.
|
|
126
|
+
* @evidence contracts/performance.md#efficient-algorithms Baseline and served-set lookup avoid full input population traversal.
|
|
127
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Only first deliveries in the same explicitly declared pass share its proof; repeated and later-pass requests do not.
|
|
128
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The predicate borrows generation state without retaining another owner.
|
|
129
|
+
*/
|
|
130
|
+
export function sharesPass(
|
|
131
|
+
cached: TtscCachedProjectTransform,
|
|
132
|
+
file: string,
|
|
133
|
+
epoch: number | undefined,
|
|
134
|
+
): boolean {
|
|
135
|
+
if (
|
|
136
|
+
epoch === undefined ||
|
|
137
|
+
cached.deliveryEpoch !== epoch ||
|
|
138
|
+
(cached.projectSnapshotComplete !== true &&
|
|
139
|
+
cached.passDeliveryOnly !== true) ||
|
|
140
|
+
(cached.freshDeliveryOnly === true && cached.passDeliveryOnly !== true)
|
|
141
|
+
)
|
|
142
|
+
return false;
|
|
143
|
+
const identities = envelopeDerivation(cached).identityContext;
|
|
144
|
+
const identity = pathIdentityKey(file, identities);
|
|
145
|
+
if (cached.servedFiles?.has(identity)) return false;
|
|
146
|
+
const key = toProjectKey(cached.projectRoot, file, identities);
|
|
147
|
+
return (
|
|
148
|
+
cached.sourceHashes?.[identity] !== undefined ||
|
|
149
|
+
Object.hasOwn(cached.inputHashes, key) ||
|
|
150
|
+
cached.externalInputHashes?.[identity] !== undefined
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Admit and notify a fresh-only local delivery. A coherent pass-only success
|
|
156
|
+
* can keep its result inside this pass after releasing capture resources;
|
|
157
|
+
* every other fresh-only answer is detached before notifying the host.
|
|
158
|
+
* Callback failure always evicts the incomplete owner.
|
|
159
|
+
*
|
|
160
|
+
* @evidence contracts/common.md#principled-implementation Explicit nonwatching, consistent project lifecycle and cache-withdrawal capability are required on every successful incomplete delivery; retention additionally needs the compile's exact pass-only epoch.
|
|
161
|
+
* @evidence contracts/common.md#clear-and-simple-design One owner handles initial and cached fresh-only admission, resource release and host notification.
|
|
162
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Incomplete output never acquires a persistent record or publication, and failed/unknown/watching capability cannot leave a reusable owner.
|
|
163
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs distinguish local pass retention, resource release and callback failure effects.
|
|
164
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This lifecycle operation delegates native resource release to the generation disposer.
|
|
165
|
+
* @evidence contracts/performance.md#efficient-algorithms Identity/epoch checks and one callback add no input scan; resource disposal visits the fixed tracker population.
|
|
166
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Only coherent locally admitted output in its exact nonwatching pass survives; a later pass or repeated module must obtain another result.
|
|
167
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Capture resources are released even when local output is kept; rejection and callback failure detach the owning Promise, and the cache lifecycle bounds retained result lifetime.
|
|
168
|
+
*/
|
|
169
|
+
export function admitFreshOnly(
|
|
170
|
+
cached: TtscCachedProjectTransform,
|
|
171
|
+
cache: TtscTransformCache | undefined,
|
|
172
|
+
key: string,
|
|
173
|
+
generation: Promise<TtscCachedProjectTransform>,
|
|
174
|
+
epoch: number | undefined,
|
|
175
|
+
hooks: TtscTransformHooks | undefined,
|
|
176
|
+
): void {
|
|
177
|
+
if (cached.freshDeliveryOnly !== true) return;
|
|
178
|
+
const authorized =
|
|
179
|
+
hooks?.watching === false &&
|
|
180
|
+
hooks.markVolatile !== undefined &&
|
|
181
|
+
(hooks.project?.watching === undefined ||
|
|
182
|
+
hooks.project.watching === false);
|
|
183
|
+
const retain =
|
|
184
|
+
authorized &&
|
|
185
|
+
epoch !== undefined &&
|
|
186
|
+
cached.deliveryEpoch === epoch &&
|
|
187
|
+
cached.passDeliveryOnly === true;
|
|
188
|
+
disposeCachedTransform(cached);
|
|
189
|
+
if (!retain) evictGeneration(cache, key, generation);
|
|
190
|
+
if (cached.result.type === "success" && !authorized)
|
|
191
|
+
throw new Error(
|
|
192
|
+
"@ttsc/unplugin: plugin input observation is unavailable; fresh output requires an explicitly nonwatching host with supported cache withdrawal. Watching, unknown or contradictory lifecycles cannot safely observe its changes.",
|
|
193
|
+
);
|
|
194
|
+
try {
|
|
195
|
+
hooks?.markVolatile?.();
|
|
196
|
+
} catch (error) {
|
|
197
|
+
evictGeneration(cache, key, generation);
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -302,7 +302,7 @@ export function captureUniversalHostInputValidation(
|
|
|
302
302
|
const prepared = usesPreparedPluginBuildEnvironments(cached.result);
|
|
303
303
|
const environment = prepared
|
|
304
304
|
? PluginBuildEnvironmentReadings.cached(directory)
|
|
305
|
-
: processPluginBuildEnvironment(directory);
|
|
305
|
+
: processPluginBuildEnvironment(directory, false, cached.projectRoot);
|
|
306
306
|
if (
|
|
307
307
|
environment === undefined ||
|
|
308
308
|
!pluginSourceHolds(
|
|
@@ -310,6 +310,7 @@ export function captureUniversalHostInputValidation(
|
|
|
310
310
|
digest,
|
|
311
311
|
filesystem,
|
|
312
312
|
prepared ? { environment } : undefined,
|
|
313
|
+
cached.projectRoot,
|
|
313
314
|
)
|
|
314
315
|
) {
|
|
315
316
|
recordGenerationProofFailure(failures, {
|