ttsc 0.32.0 → 0.32.1
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/TtscCompiler.js +1 -1
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/compiler/internal/ResidentCheckProcess.d.ts +74 -96
- package/lib/compiler/internal/ResidentCheckProcess.js +150 -335
- package/lib/compiler/internal/ResidentCheckProcess.js.map +1 -1
- package/lib/compiler/internal/ResidentCheckProcessHost.d.ts +127 -0
- package/lib/compiler/internal/ResidentCheckProcessHost.js +447 -0
- package/lib/compiler/internal/ResidentCheckProcessHost.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.d.ts +64 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.js +3 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.js.map +1 -0
- package/lib/compiler/internal/build/BuildExecution.d.ts +103 -1
- package/lib/compiler/internal/build/BuildExecution.js +91 -11
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -1
- package/lib/compiler/internal/build/ResidentCheckWatchSession.d.ts +16 -11
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js +37 -21
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js.map +1 -1
- package/lib/compiler/internal/build/RunBuildOptions.d.ts +6 -5
- package/lib/compiler/internal/build/WatchInputPublication.d.ts +59 -0
- package/lib/compiler/internal/build/WatchInputPublication.js +93 -0
- package/lib/compiler/internal/build/WatchInputPublication.js.map +1 -0
- package/lib/compiler/internal/build/runBuild.d.ts +29 -2
- package/lib/compiler/internal/build/runBuild.js +45 -19
- package/lib/compiler/internal/build/runBuild.js.map +1 -1
- package/lib/compiler/internal/buildNativeCompiler.d.ts +2 -0
- package/lib/compiler/internal/buildNativeCompiler.js +1 -0
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.js +4 -2
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/project/resolveOwningProjectConfig.d.ts +7 -2
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js +6 -3
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js.map +1 -1
- package/lib/compiler/internal/readEffectiveCompilerOptions.js +1 -1
- package/lib/compiler/internal/readEffectiveCompilerOptions.js.map +1 -1
- package/lib/compiler/internal/resolveBinary.d.ts +1 -0
- package/lib/compiler/internal/resolveBinary.js.map +1 -1
- package/lib/compiler/internal/resolveTsgo.d.ts +6 -0
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.d.ts +28 -1
- package/lib/compiler/internal/runSingleFileEmit.js +120 -86
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/startResidentTransform.js +8 -2
- package/lib/compiler/internal/startResidentTransform.js.map +1 -1
- package/lib/compiler/internal/transformProjectInMemory.js +11 -3
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/transformProjectInWorker.d.ts +1 -1
- package/lib/compiler/internal/transformProjectInWorker.js +3 -2
- package/lib/compiler/internal/transformProjectInWorker.js.map +1 -1
- package/lib/internal/workerModuleUrl.d.ts +28 -0
- package/lib/internal/workerModuleUrl.js +40 -0
- package/lib/internal/workerModuleUrl.js.map +1 -0
- package/lib/launcher/internal/buildSingleRootProject.js +2 -1
- package/lib/launcher/internal/buildSingleRootProject.js.map +1 -1
- package/lib/launcher/internal/getCompilerVersionText.js +3 -2
- package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.js +2 -1
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/runTtsc.js +91 -41
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.d.ts +10 -6
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js +11 -9
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js.map +1 -1
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.d.ts +20 -0
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.js +27 -0
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.js.map +1 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.d.ts +5 -3
- package/lib/launcher/internal/runtime/installRuntimeHooks.js +7 -3
- package/lib/launcher/internal/runtime/installRuntimeHooks.js.map +1 -1
- package/lib/launcher/internal/watch/AsyncWatchTopology.d.ts +113 -0
- package/lib/launcher/internal/watch/AsyncWatchTopology.js +232 -0
- package/lib/launcher/internal/watch/AsyncWatchTopology.js.map +1 -0
- package/lib/launcher/internal/watch/WatchSettlement.d.ts +49 -0
- package/lib/launcher/internal/watch/WatchSettlement.js +70 -0
- package/lib/launcher/internal/watch/WatchSettlement.js.map +1 -0
- package/lib/launcher/internal/watch/WatchTopology.d.ts +29 -1
- package/lib/launcher/internal/watch/WatchTopology.js +86 -10
- package/lib/launcher/internal/watch/WatchTopology.js.map +1 -1
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.d.ts +121 -0
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.js +3 -0
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.js.map +1 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.d.ts +19 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.js +62 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.js.map +1 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.d.ts +1 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.js +22 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.js.map +1 -0
- package/lib/plugin/CapabilityPluginResolver.d.ts +1 -1
- package/lib/plugin/CapabilityPluginResolver.js +3 -2
- package/lib/plugin/CapabilityPluginResolver.js.map +1 -1
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.d.ts +15 -12
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js +13 -11
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js.map +1 -1
- package/lib/plugin/internal/load/PluginPackageResolution.d.ts +2 -2
- package/lib/plugin/internal/load/PluginPackageResolution.js +13 -7
- package/lib/plugin/internal/load/PluginPackageResolution.js.map +1 -1
- package/lib/plugin/internal/load/ProjectPluginEntries.d.ts +23 -7
- package/lib/plugin/internal/load/ProjectPluginEntries.js +36 -14
- package/lib/plugin/internal/load/ProjectPluginEntries.js.map +1 -1
- package/lib/plugin/internal/load/collectProjectHostInputs.d.ts +3 -1
- package/lib/plugin/internal/load/collectProjectHostInputs.js +5 -2
- package/lib/plugin/internal/load/collectProjectHostInputs.js.map +1 -1
- package/lib/plugin/internal/load/hasProjectPluginEntries.d.ts +3 -1
- package/lib/plugin/internal/load/hasProjectPluginEntries.js +4 -2
- package/lib/plugin/internal/load/hasProjectPluginEntries.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.d.ts +36 -5
- package/lib/plugin/internal/load/loadProjectPlugins.js +466 -416
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/load/pluginResolutionFailure.d.ts +18 -0
- package/lib/plugin/internal/load/pluginResolutionFailure.js +32 -0
- package/lib/plugin/internal/load/pluginResolutionFailure.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.d.ts +1 -1
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js +3 -2
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js.map +1 -1
- package/lib/structures/ITtscCompilerContext.d.ts +12 -12
- package/lib/structures/ITtscPlugin.d.ts +7 -5
- package/lib/structures/ITtscPluginFactoryContext.d.ts +9 -8
- package/lib/structures/internal/TtscSingleFileEmitOptions.d.ts +12 -6
- package/package.json +9 -9
- package/src/TtscCompiler.ts +1 -1
- package/src/compiler/internal/ResidentCheckProcess.ts +159 -374
- package/src/compiler/internal/ResidentCheckProcessHost.ts +502 -0
- package/src/compiler/internal/ResidentCheckProcessProtocol.ts +53 -0
- package/src/compiler/internal/build/BuildExecution.ts +118 -9
- package/src/compiler/internal/build/ResidentCheckWatchSession.ts +41 -24
- package/src/compiler/internal/build/RunBuildOptions.ts +9 -5
- package/src/compiler/internal/build/WatchInputPublication.ts +106 -0
- package/src/compiler/internal/build/runBuild.ts +58 -34
- package/src/compiler/internal/buildNativeCompiler.ts +4 -0
- package/src/compiler/internal/compileProjectInMemory.ts +8 -2
- package/src/compiler/internal/project/resolveOwningProjectConfig.ts +16 -5
- package/src/compiler/internal/readEffectiveCompilerOptions.ts +1 -1
- package/src/compiler/internal/resolveBinary.ts +4 -1
- package/src/compiler/internal/resolveTsgo.ts +7 -0
- package/src/compiler/internal/runSingleFileEmit.ts +139 -99
- package/src/compiler/internal/startResidentTransform.ts +9 -2
- package/src/compiler/internal/transformProjectInMemory.ts +12 -3
- package/src/compiler/internal/transformProjectInWorker.ts +10 -2
- package/src/internal/workerModuleUrl.ts +34 -0
- package/src/launcher/internal/buildSingleRootProject.ts +2 -0
- package/src/launcher/internal/getCompilerVersionText.ts +3 -2
- package/src/launcher/internal/prepareExecution.ts +2 -0
- package/src/launcher/internal/runTtsc.ts +123 -45
- package/src/launcher/internal/runtime/CommonJsRuntimeSource.ts +11 -9
- package/src/launcher/internal/runtime/advertiseTypeScriptExtensions.ts +25 -0
- package/src/launcher/internal/runtime/installRuntimeHooks.ts +7 -3
- package/src/launcher/internal/watch/AsyncWatchTopology.ts +267 -0
- package/src/launcher/internal/watch/WatchSettlement.ts +67 -0
- package/src/launcher/internal/watch/WatchTopology.ts +84 -13
- package/src/launcher/internal/watch/WatchTopologyWorkerProtocol.ts +106 -0
- package/src/launcher/internal/watch/serveWatchTopologyWorker.ts +75 -0
- package/src/launcher/internal/watch/watchTopologyWorker.ts +29 -0
- package/src/plugin/CapabilityPluginResolver.ts +9 -2
- package/src/plugin/internal/load/PluginDescriptorEvaluationCache.ts +17 -12
- package/src/plugin/internal/load/PluginPackageResolution.ts +14 -9
- package/src/plugin/internal/load/ProjectPluginEntries.ts +40 -15
- package/src/plugin/internal/load/collectProjectHostInputs.ts +7 -1
- package/src/plugin/internal/load/hasProjectPluginEntries.ts +8 -3
- package/src/plugin/internal/load/loadProjectPlugins.ts +672 -594
- package/src/plugin/internal/load/pluginResolutionFailure.ts +37 -0
- package/src/plugin/internal/source/PluginBuildEnvironmentReadings.ts +8 -2
- package/src/structures/ITtscCompilerContext.ts +12 -12
- package/src/structures/ITtscPlugin.ts +7 -5
- package/src/structures/ITtscPluginFactoryContext.ts +9 -8
- package/src/structures/internal/TtscSingleFileEmitOptions.ts +22 -11
package/lib/TtscCompiler.js
CHANGED
|
@@ -102,7 +102,7 @@ class TtscCompiler {
|
|
|
102
102
|
const execution = this.resolveProjectExecution();
|
|
103
103
|
const context = this.compilerContext();
|
|
104
104
|
const loaded = (0, loadProjectPlugins_1.loadProjectPlugins)({
|
|
105
|
-
binary: (0, resolveBinary_1.resolveBinary)(
|
|
105
|
+
binary: (0, resolveBinary_1.resolveBinary)({ env: this.resolveEffectiveEnv() }) ?? "",
|
|
106
106
|
cacheDir: this.resolvePluginCacheDir(),
|
|
107
107
|
cwd: execution.cwd,
|
|
108
108
|
entries: context.plugins,
|
package/lib/TtscCompiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtscCompiler.js","sourceRoot":"","sources":["../src/TtscCompiler.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,uFAAoF;AACpF,2FAAwF;AACxF,qEAAkE;AAClE,0FAAuF;AACvF,2FAAwF;AACxF,2FAAwF;AACxF,gFAA6E;AAC7E,4EAM0C;AAE1C,kEAA+D;AAC/D,8FAA2F;AAC3F,uGAAoG;AACpG,mGAAgG;AAChG,kFAA+E;AAC/E,4FAAyF;AACzF,sFAAmF;AACnF,wGAAqG;AAKrG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAC5D,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACK,mBAAmB;QACzB,OAAO,uCAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;CACF;;AAED,SAAS,yBAAyB,CAChC,WAA8C;IAE9C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,SAAS;QAC1C,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAA,mCAAgB,EAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3D,SAAS;QACX,CAAC;QACD,iBAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -2,126 +2,104 @@ import type { ResidentCheckProcessOptions } from "./ResidentCheckProcessOptions"
|
|
|
2
2
|
import type { ResidentCheckRequest } from "./ResidentCheckRequest";
|
|
3
3
|
import type { ResidentCheckResult } from "./ResidentCheckResult";
|
|
4
4
|
/**
|
|
5
|
-
* FIFO
|
|
5
|
+
* FIFO check client whose worker owns the child and its complete pipe lifetime.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Watch topology can block the launcher's loop after shutdown timers start.
|
|
8
|
+
* Keeping spawn, EOF, signals, output draining and close on one independent
|
|
9
|
+
* loop prevents that work from spending a live child's shutdown grace or
|
|
10
|
+
* overtaking its pending close. An exit code alone never proves pipe closure: a
|
|
11
|
+
* living descendant can retain inherited stdout or stderr (#1758).
|
|
12
12
|
*
|
|
13
|
-
* The caller owns disposal.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* pipes, request listeners, timers and event-loop process reference while
|
|
20
|
-
* keeping joining failed; the client object still holds its ChildProcess. It
|
|
21
|
-
* neither kills unrelated descendants nor certifies their termination. A forced
|
|
22
|
-
* or unjoined process is not a graceful shutdown. These delays are event-loop
|
|
23
|
-
* timer policies, not hard elapsed-time bounds; synchronous blocking or
|
|
24
|
-
* callback starvation can postpone their delivery.
|
|
13
|
+
* The caller owns disposal. Retirement uses the host's one-second input flush,
|
|
14
|
+
* EOF grace and forced-join policies. Only its actual-close receipt authorizes
|
|
15
|
+
* replacement; worker failure leaves joining unknown and rejected. Strict close
|
|
16
|
+
* additionally requires a graceful zero exit. Neither worker nor client claims
|
|
17
|
+
* termination of unrelated descendants. Abrupt process exit can still interrupt
|
|
18
|
+
* cleanup.
|
|
25
19
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @evidence contracts/
|
|
32
|
-
* @evidence contracts/
|
|
33
|
-
* @evidence contracts/
|
|
20
|
+
* One worker serves one child across requests. Messages copy serialized request
|
|
21
|
+
* and reply bytes; pending request count and reply size have no fixed cap.
|
|
22
|
+
* Retirement rejects pending callers immediately and joins its worker after the
|
|
23
|
+
* terminal receipt. The client retains the Worker object.
|
|
24
|
+
*
|
|
25
|
+
* @evidence contracts/common.md#principled-implementation The independent loop owns every observation needed for retirement, and only its actual child-close receipt permits replacement, keeping parent event-loop blocking outside shutdown timing.
|
|
26
|
+
* @evidence contracts/common.md#clear-and-simple-design The client owns caller serialization and settlement; its worker owns the native transport and shutdown state machine.
|
|
27
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No elapsed parent deadline, worker exit, signal attempt or exit code fabricates a joined child; unknown worker failure rejects joining.
|
|
28
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose documents the blocking hazard, inherited-pipe authority, disposal, failure effects and unbounded request population.
|
|
29
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node loads a sibling worker using the current source or emitted extension and inherited loader arguments; the host uses native executable argv and pipes without shell commands.
|
|
30
|
+
* @evidence contracts/performance.md#efficient-algorithms Serialization and structured cloning visit message bytes; a request-id map gives constant-time settlement without scanning earlier requests. Worker startup and one thread per active child are additional costs; no speedup is claimed.
|
|
31
|
+
* @evidence contracts/performance.md#reuse-equivalent-work One worker and child serve the startup-selected check process across FIFO requests; each request remains effectful and receives its own result.
|
|
32
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The client owns one worker and one resolver pair per pending request. Results or retirement remove resolvers; joining waits for the terminal receipt and worker exit. Unexpected worker failure rejects callers and joining and removes worker liveness. Request count and bytes are uncapped, and the client object retains its Worker reference.
|
|
34
33
|
*/
|
|
35
34
|
export declare class ResidentCheckProcess {
|
|
36
|
-
private readonly
|
|
35
|
+
private readonly worker;
|
|
37
36
|
private readonly pending;
|
|
38
|
-
private
|
|
39
|
-
private readonly reader;
|
|
37
|
+
private ordinal;
|
|
40
38
|
private failure;
|
|
41
|
-
private
|
|
39
|
+
private closeError;
|
|
40
|
+
private joinError;
|
|
41
|
+
private terminal;
|
|
42
42
|
private readonly exited;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private forced;
|
|
46
|
-
private flushDeadline;
|
|
47
|
-
private terminationTimer;
|
|
48
|
-
private terminationDeadline;
|
|
49
|
-
private releaseTransport;
|
|
43
|
+
private resolveExit;
|
|
44
|
+
private rejectExit;
|
|
50
45
|
constructor(options: ResidentCheckProcessOptions);
|
|
51
46
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* that retired the process, so the caller can fall back to a one-shot check
|
|
57
|
-
* for that cycle.
|
|
58
|
-
*
|
|
59
|
-
* Serialization precedes enqueueing and normally rejects only this call;
|
|
60
|
-
* exceptional thrown-value conversion can itself fail during normalization. A
|
|
61
|
-
* closed input retires the host and rejects its other pending calls.
|
|
47
|
+
* Serialize one cycle before admission and pair its reply with this caller.
|
|
48
|
+
* Serialization failure rejects only this call when its thrown value can be
|
|
49
|
+
* normalized to an Error; normalization itself can throw synchronously. A
|
|
50
|
+
* retired transport rejects all admitted calls and every later request.
|
|
62
51
|
*
|
|
63
|
-
* @evidence contracts/common.md#principled-implementation Serialization precedes
|
|
64
|
-
* @evidence contracts/common.md#clear-and-simple-design
|
|
65
|
-
* @evidence contracts/common.md#prohibited-implementation-shortcuts
|
|
66
|
-
* @evidence contracts/common.md#meaningful-documentation
|
|
67
|
-
* @evidence contracts/portability.md#os-neutral-implementation
|
|
68
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
69
|
-
* @evidence contracts/performance.md#reuse-equivalent-work Each cycle
|
|
70
|
-
* @evidence contracts/performance.md#bound-retention-and-release-resources
|
|
52
|
+
* @evidence contracts/common.md#principled-implementation Serialization precedes worker admission; identifiers pair results with their admitted callers while the host preserves FIFO check execution.
|
|
53
|
+
* @evidence contracts/common.md#clear-and-simple-design Caller serialization stays in the client, and the host alone validates native replies and retires a failed transport.
|
|
54
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts A failed conversion adds no request slot; worker failure rejects rather than fabricating a check result.
|
|
55
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes serialization rejection and synchronous normalization failure from terminal transport failure.
|
|
56
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native input paths remain JSON data across the message and pipe boundaries without shell interpolation.
|
|
57
|
+
* @evidence contracts/performance.md#efficient-algorithms JSON conversion and message copying visit input bytes, caller-defined conversion can add arbitrary work, and map admission and settlement use constant-time key operations.
|
|
58
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Each effectful cycle owns a request and reply even when its payload matches an earlier cycle.
|
|
59
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Each admitted call retains resolver callbacks until its result or shared retirement; request population and serialized bytes have no fixed cap.
|
|
71
60
|
*/
|
|
72
61
|
request(payload: ResidentCheckRequest): Promise<ResidentCheckResult>;
|
|
73
62
|
/**
|
|
74
|
-
* Retire
|
|
75
|
-
* Idempotent; a process that already failed is left as is.
|
|
63
|
+
* Retire once and reject pending callers without waiting for native close.
|
|
76
64
|
*
|
|
77
|
-
* @evidence contracts/common.md#principled-implementation
|
|
78
|
-
* @evidence contracts/common.md#clear-and-simple-design Disposal
|
|
79
|
-
* @evidence contracts/common.md#prohibited-implementation-shortcuts
|
|
80
|
-
* @evidence contracts/common.md#meaningful-documentation
|
|
81
|
-
* @evidence contracts/portability.md#os-neutral-implementation
|
|
82
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
83
|
-
*
|
|
84
|
-
* @
|
|
85
|
-
*
|
|
86
|
-
* @evidence contracts/performance.md#bound-retention-and-release-resources Disposal clears pending callbacks and requests stdin EOF while preserving output until actual close or a failed join timer. Failed join destroys/unrefs owned transport and removes request listeners without proving child/descendant termination; timer delivery depends on the event loop, and the client object can still retain its ChildProcess.
|
|
65
|
+
* @evidence contracts/common.md#principled-implementation Terminal caller failure is set before rejection, and one retire command delegates EOF and joining to the owner.
|
|
66
|
+
* @evidence contracts/common.md#clear-and-simple-design Disposal initiates the host's existing retirement state machine rather than maintaining parent-side timers.
|
|
67
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Repeated disposal cannot revive a request or authorize replacement before actual joining.
|
|
68
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies immediate rejection and asynchronous native retirement.
|
|
69
|
+
* @evidence contracts/portability.md#os-neutral-implementation A Node message delegates native EOF and signaling without platform-specific PID commands.
|
|
70
|
+
* @evidence contracts/performance.md#efficient-algorithms Rejection visits the outstanding request map once and posts one constant-size retirement command.
|
|
71
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Disposal invalidates an owner without creating a reusable computation.
|
|
72
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Pending callbacks are released immediately; the referenced worker keeps cleanup alive until its terminal receipt and exit, and unknown ownership remains failure.
|
|
87
73
|
*/
|
|
88
74
|
dispose(): void;
|
|
89
75
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* retirement.
|
|
76
|
+
* Await actual child close and the owner thread, requiring graceful zero
|
|
77
|
+
* exit. Repeated calls share retirement but retain strict shutdown failure.
|
|
93
78
|
*
|
|
94
|
-
* @evidence contracts/common.md#principled-implementation
|
|
95
|
-
* @evidence contracts/common.md#clear-and-simple-design
|
|
96
|
-
* @evidence contracts/common.md#prohibited-implementation-shortcuts
|
|
97
|
-
* @evidence contracts/common.md#meaningful-documentation Native prose states
|
|
98
|
-
* @evidence contracts/portability.md#os-neutral-implementation
|
|
99
|
-
* @evidence contracts/performance.md#efficient-algorithms Closing
|
|
100
|
-
* @evidence contracts/performance.md#reuse-equivalent-work Repeated closes
|
|
101
|
-
* @evidence contracts/performance.md#bound-retention-and-release-resources
|
|
79
|
+
* @evidence contracts/common.md#principled-implementation Success requires the host's actual-close receipt, strict status validation and owner-thread exit.
|
|
80
|
+
* @evidence contracts/common.md#clear-and-simple-design Strict shutdown adds status validation to the same joining promise used by recovery.
|
|
81
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Neither worker disappearance nor requested forced termination substitutes for graceful child close.
|
|
82
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states child and thread joining, strict zero exit and repeated failure behavior.
|
|
83
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node worker messages carry the native host's observed close outcome without interpreting a PID or shell status.
|
|
84
|
+
* @evidence contracts/performance.md#efficient-algorithms Closing reuses retirement and performs constant-time outcome validation after its one pending-request traversal.
|
|
85
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Repeated closes await this owner's single terminal promise while retaining strict status independently from recovery joining.
|
|
86
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The host releases its pipes and timers on actual close or failed joining; the client awaits worker exit, releases pending callbacks, and preserves unknown ownership as rejection.
|
|
102
87
|
*/
|
|
103
88
|
close(): Promise<void>;
|
|
104
89
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
90
|
+
* Join a known failed child and its owner before replacement. Waiting alone
|
|
91
|
+
* starts no retirement deadline; unknown ownership rejects.
|
|
107
92
|
*
|
|
108
|
-
* @evidence contracts/common.md#principled-implementation A
|
|
109
|
-
* @evidence contracts/common.md#clear-and-simple-design
|
|
110
|
-
* @evidence contracts/common.md#prohibited-implementation-shortcuts
|
|
111
|
-
* @evidence contracts/common.md#meaningful-documentation Native prose
|
|
112
|
-
* @evidence contracts/portability.md#os-neutral-implementation The
|
|
113
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
114
|
-
* @evidence contracts/performance.md#reuse-equivalent-work
|
|
115
|
-
* @evidence contracts/performance.md#bound-retention-and-release-resources
|
|
93
|
+
* @evidence contracts/common.md#principled-implementation A known failed child can be replaced only after its actual-close receipt and worker exit.
|
|
94
|
+
* @evidence contracts/common.md#clear-and-simple-design Recovery consumes joining separately from strict shutdown status.
|
|
95
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Unknown worker or pipe ownership remains rejection rather than successful retirement.
|
|
96
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states replacement authority, passive waiting and unknown failure.
|
|
97
|
+
* @evidence contracts/portability.md#os-neutral-implementation The owner observes native close through Node APIs instead of treating signals or process IDs as portable joining proof.
|
|
98
|
+
* @evidence contracts/performance.md#efficient-algorithms The accessor returns an existing promise without timers, native probes or additional listeners.
|
|
99
|
+
* @evidence contracts/performance.md#reuse-equivalent-work All waiters share the same owner's terminal promise; replacement owns a new worker and promise.
|
|
100
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Passive waiting can remain pending for a live unretired host; active retirement releases owned resources through its existing deadlines and terminal worker exit.
|
|
116
101
|
*/
|
|
117
102
|
waitForExit(): Promise<void>;
|
|
118
|
-
private rejectExit;
|
|
119
|
-
private onLine;
|
|
120
|
-
private settle;
|
|
121
103
|
private fail;
|
|
122
|
-
private
|
|
123
|
-
private startTerminationGrace;
|
|
124
|
-
private forceTerminationAndJoin;
|
|
125
|
-
private static ignoreTransportError;
|
|
126
|
-
private exitError;
|
|
104
|
+
private workerFailed;
|
|
127
105
|
}
|