@ttsc/graph 0.30.4 → 0.31.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/README.md +122 -30
- package/lib/CapturedProcessOutput.d.ts +47 -0
- package/lib/CapturedProcessOutput.js +3 -0
- package/lib/CapturedProcessOutput.js.map +1 -0
- package/lib/ILauncherOption.d.ts +22 -0
- package/lib/ILauncherOption.js +3 -0
- package/lib/ILauncherOption.js.map +1 -0
- package/lib/IProjectOptions.d.ts +18 -0
- package/lib/IProjectOptions.js +3 -0
- package/lib/IProjectOptions.js.map +1 -0
- package/lib/ParsedLauncherOptions.d.ts +13 -0
- package/lib/ParsedLauncherOptions.js +3 -0
- package/lib/ParsedLauncherOptions.js.map +1 -0
- package/lib/TtscGraphApplication.d.ts +38 -1
- package/lib/TtscGraphApplication.js +26 -1
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/TtscGraphLauncherArguments.d.ts +115 -0
- package/lib/TtscGraphLauncherArguments.js +181 -0
- package/lib/TtscGraphLauncherArguments.js.map +1 -0
- package/lib/TtscGraphViewSnapshot.d.ts +35 -0
- package/lib/TtscGraphViewSnapshot.js +48 -0
- package/lib/TtscGraphViewSnapshot.js.map +1 -0
- package/lib/index.d.ts +9 -24
- package/lib/index.js +6 -128
- package/lib/index.js.map +1 -1
- package/lib/internal/GraphProcessTrace.d.ts +1 -0
- package/lib/internal/GraphProcessTrace.js +235 -0
- package/lib/internal/GraphProcessTrace.js.map +1 -0
- package/lib/launcherArgs.d.ts +75 -16
- package/lib/launcherArgs.js +77 -8
- package/lib/launcherArgs.js.map +1 -1
- package/lib/model/IArtifactDirectory.d.ts +26 -0
- package/lib/model/IArtifactDirectory.js +3 -0
- package/lib/model/IArtifactDirectory.js.map +1 -0
- package/lib/model/IArtifactInputs.d.ts +19 -0
- package/lib/model/IArtifactInputs.js +3 -0
- package/lib/model/IArtifactInputs.js.map +1 -0
- package/lib/model/IPublishedArtifacts.d.ts +76 -0
- package/lib/model/IPublishedArtifacts.js +3 -0
- package/lib/model/IPublishedArtifacts.js.map +1 -0
- package/lib/model/IPublishedArtifactsResident.d.ts +19 -0
- package/lib/model/IPublishedArtifactsResident.js +3 -0
- package/lib/model/IPublishedArtifactsResident.js.map +1 -0
- package/lib/model/ITtscLintDaemonTarget.d.ts +20 -0
- package/lib/model/ITtscLintDaemonTarget.js +3 -0
- package/lib/model/ITtscLintDaemonTarget.js.map +1 -0
- package/lib/model/TtscGraphLinePeer.d.ts +146 -0
- package/lib/model/TtscGraphLinePeer.js +213 -0
- package/lib/model/TtscGraphLinePeer.js.map +1 -0
- package/lib/model/TtscGraphMemory.d.ts +156 -16
- package/lib/model/TtscGraphMemory.js +228 -222
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphNativeArguments.d.ts +40 -0
- package/lib/model/TtscGraphNativeArguments.js +64 -0
- package/lib/model/TtscGraphNativeArguments.js.map +1 -0
- package/lib/model/TtscGraphNodeId.d.ts +55 -3
- package/lib/model/TtscGraphNodeId.js +40 -2
- package/lib/model/TtscGraphNodeId.js.map +1 -1
- package/lib/model/TtscGraphProjection.d.ts +156 -0
- package/lib/model/TtscGraphProjection.js +390 -0
- package/lib/model/TtscGraphProjection.js.map +1 -0
- package/lib/model/TtscGraphProtocol.d.ts +28 -0
- package/lib/model/TtscGraphProtocol.js +928 -0
- package/lib/model/TtscGraphProtocol.js.map +1 -0
- package/lib/model/TtscGraphReadonly.d.ts +15 -0
- package/lib/model/TtscGraphReadonly.js +3 -0
- package/lib/model/TtscGraphReadonly.js.map +1 -0
- package/lib/model/TtscGraphRequestOptions.d.ts +16 -0
- package/lib/model/TtscGraphRequestOptions.js +3 -0
- package/lib/model/TtscGraphRequestOptions.js.map +1 -0
- package/lib/model/TtscGraphSession.d.ts +82 -36
- package/lib/model/TtscGraphSession.js +164 -1238
- package/lib/model/TtscGraphSession.js.map +1 -1
- package/lib/model/TtscGraphSessionOptions.d.ts +20 -0
- package/lib/model/TtscGraphSessionOptions.js +3 -0
- package/lib/model/TtscGraphSessionOptions.js.map +1 -0
- package/lib/model/TtscGraphSessionState.d.ts +187 -0
- package/lib/model/TtscGraphSessionState.js +417 -0
- package/lib/model/TtscGraphSessionState.js.map +1 -0
- package/lib/model/TtscGraphShardStore.d.ts +64 -3
- package/lib/model/TtscGraphShardStore.js +85 -15
- package/lib/model/TtscGraphShardStore.js.map +1 -1
- package/lib/model/TtscGraphSourceReader.d.ts +31 -8
- package/lib/model/TtscGraphSourceReader.js +37 -13
- package/lib/model/TtscGraphSourceReader.js.map +1 -1
- package/lib/model/TtscLintDaemon.d.ts +35 -17
- package/lib/model/TtscLintDaemon.js +39 -117
- package/lib/model/TtscLintDaemon.js.map +1 -1
- package/lib/model/TtscLintDaemonState.d.ts +69 -0
- package/lib/model/TtscLintDaemonState.js +166 -0
- package/lib/model/TtscLintDaemonState.js.map +1 -0
- package/lib/model/copyGraphRecords.d.ts +14 -0
- package/lib/model/copyGraphRecords.js +19 -0
- package/lib/model/copyGraphRecords.js.map +1 -0
- package/lib/model/copyGraphSnapshot.d.ts +17 -0
- package/lib/model/copyGraphSnapshot.js +33 -0
- package/lib/model/copyGraphSnapshot.js.map +1 -0
- package/lib/model/loadGraph.d.ts +19 -10
- package/lib/model/loadGraph.js +21 -12
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/model/publishedArtifacts.d.ts +78 -97
- package/lib/model/publishedArtifacts.js +271 -85
- package/lib/model/publishedArtifacts.js.map +1 -1
- package/lib/nativeExecutable.d.ts +19 -8
- package/lib/nativeExecutable.js +75 -15
- package/lib/nativeExecutable.js.map +1 -1
- package/lib/reduce.d.ts +19 -45
- package/lib/reduce.js +19 -3
- package/lib/reduce.js.map +1 -1
- package/lib/resolveGraphBinary.d.ts +9 -0
- package/lib/resolveGraphBinary.js +11 -3
- package/lib/resolveGraphBinary.js.map +1 -1
- package/lib/runGraph.d.ts +21 -0
- package/lib/runGraph.js +83 -0
- package/lib/runGraph.js.map +1 -0
- package/lib/server/IResolvedGraphHandle.d.ts +22 -0
- package/lib/server/IResolvedGraphHandle.js +3 -0
- package/lib/server/IResolvedGraphHandle.js.map +1 -0
- package/lib/server/createServer.d.ts +14 -10
- package/lib/server/createServer.js +42 -39
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/exportSurface.d.ts +23 -1
- package/lib/server/exportSurface.js +23 -1
- package/lib/server/exportSurface.js.map +1 -1
- package/lib/server/formatGraphFailure.d.ts +20 -0
- package/lib/server/formatGraphFailure.js +35 -0
- package/lib/server/formatGraphFailure.js.map +1 -0
- package/lib/server/pathPolicy.d.ts +70 -5
- package/lib/server/pathPolicy.js +66 -4
- package/lib/server/pathPolicy.js.map +1 -1
- package/lib/server/resolveHandle.d.ts +10 -5
- package/lib/server/resolveHandle.js +39 -7
- package/lib/server/resolveHandle.js.map +1 -1
- package/lib/server/resultAudit.d.ts +17 -14
- package/lib/server/resultAudit.js +56 -27
- package/lib/server/resultAudit.js.map +1 -1
- package/lib/server/resultNext.d.ts +26 -1
- package/lib/server/resultNext.js +14 -0
- package/lib/server/resultNext.js.map +1 -1
- package/lib/server/runDetails.d.ts +72 -15
- package/lib/server/runDetails.js +104 -69
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.d.ts +9 -0
- package/lib/server/runEntrypoints.js +9 -0
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.d.ts +13 -3
- package/lib/server/runLookup.js +19 -6
- package/lib/server/runLookup.js.map +1 -1
- package/lib/server/runOverview.d.ts +13 -4
- package/lib/server/runOverview.js +13 -4
- package/lib/server/runOverview.js.map +1 -1
- package/lib/server/runTour.d.ts +9 -0
- package/lib/server/runTour.js +33 -65
- package/lib/server/runTour.js.map +1 -1
- package/lib/server/runTrace.d.ts +25 -1
- package/lib/server/runTrace.js +133 -88
- package/lib/server/runTrace.js.map +1 -1
- package/lib/server/startServer.d.ts +16 -0
- package/lib/server/startServer.js +24 -1
- package/lib/server/startServer.js.map +1 -1
- package/lib/structures/ITtscGraphApplication.d.ts +95 -41
- package/lib/structures/ITtscGraphDecorator.d.ts +18 -0
- package/lib/structures/ITtscGraphDetails.d.ts +81 -6
- package/lib/structures/ITtscGraphDocTag.d.ts +17 -8
- package/lib/structures/ITtscGraphDump.d.ts +106 -8
- package/lib/structures/ITtscGraphEdge.d.ts +14 -2
- package/lib/structures/ITtscGraphEntrypoints.d.ts +81 -6
- package/lib/structures/ITtscGraphEscape.d.ts +24 -2
- package/lib/structures/ITtscGraphEvidence.d.ts +9 -0
- package/lib/structures/ITtscGraphLookup.d.ts +42 -9
- package/lib/structures/ITtscGraphNext.d.ts +12 -1
- package/lib/structures/ITtscGraphNode.d.ts +38 -11
- package/lib/structures/ITtscGraphOverview.d.ts +81 -6
- package/lib/structures/ITtscGraphSnapshot.d.ts +97 -2
- package/lib/structures/ITtscGraphSpan.d.ts +9 -0
- package/lib/structures/ITtscGraphTour.d.ts +83 -9
- package/lib/structures/ITtscGraphTrace.d.ts +99 -14
- package/lib/structures/RawDump.d.ts +22 -0
- package/lib/structures/RawDump.js +3 -0
- package/lib/structures/RawDump.js.map +1 -0
- package/lib/structures/RawEdge.d.ts +20 -0
- package/lib/structures/RawEdge.js +3 -0
- package/lib/structures/RawEdge.js.map +1 -0
- package/lib/structures/RawNode.d.ts +26 -0
- package/lib/structures/RawNode.js +3 -0
- package/lib/structures/RawNode.js.map +1 -0
- package/lib/structures/TtscGraphArtifactNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js +9 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js.map +1 -1
- package/lib/structures/TtscGraphDumpEdgeKind.d.ts +15 -1
- package/lib/structures/TtscGraphDumpNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphEdgeKind.d.ts +13 -4
- package/lib/structures/TtscGraphNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphNodeModifier.d.ts +9 -0
- package/lib/structures/ViewerLink.d.ts +20 -0
- package/lib/structures/ViewerLink.js +3 -0
- package/lib/structures/ViewerLink.js.map +1 -0
- package/lib/structures/ViewerNode.d.ts +24 -0
- package/lib/structures/ViewerNode.js +3 -0
- package/lib/structures/ViewerNode.js.map +1 -0
- package/lib/structures/ViewerPayload.d.ts +42 -0
- package/lib/structures/ViewerPayload.js +3 -0
- package/lib/structures/ViewerPayload.js.map +1 -0
- package/lib/view.d.ts +9 -0
- package/lib/view.js +203 -91
- package/lib/view.js.map +1 -1
- package/lib/viewer/viewer.js +1 -1
- package/package.json +8 -6
- package/src/CapturedProcessOutput.ts +50 -0
- package/src/ILauncherOption.ts +24 -0
- package/src/IProjectOptions.ts +19 -0
- package/src/ParsedLauncherOptions.ts +13 -0
- package/src/TtscGraphApplication.ts +38 -1
- package/src/TtscGraphLauncherArguments.ts +207 -0
- package/src/TtscGraphViewSnapshot.ts +46 -0
- package/src/index.ts +9 -160
- package/src/internal/GraphProcessTrace.ts +242 -0
- package/src/launcherArgs.ts +89 -23
- package/src/model/IArtifactDirectory.ts +27 -0
- package/src/model/IArtifactInputs.ts +21 -0
- package/src/model/IPublishedArtifacts.ts +81 -0
- package/src/model/IPublishedArtifactsResident.ts +24 -0
- package/src/model/ITtscLintDaemonTarget.ts +22 -0
- package/src/model/TtscGraphLinePeer.ts +318 -0
- package/src/model/TtscGraphMemory.ts +284 -246
- package/src/model/TtscGraphNativeArguments.ts +67 -0
- package/src/model/TtscGraphNodeId.ts +57 -3
- package/src/model/TtscGraphProjection.ts +473 -0
- package/src/model/TtscGraphProtocol.ts +90 -0
- package/src/model/TtscGraphReadonly.ts +17 -0
- package/src/model/TtscGraphRequestOptions.ts +16 -0
- package/src/model/TtscGraphSession.ts +196 -475
- package/src/model/TtscGraphSessionOptions.ts +22 -0
- package/src/model/TtscGraphSessionState.ts +558 -0
- package/src/model/TtscGraphShardStore.ts +99 -23
- package/src/model/TtscGraphSourceReader.ts +37 -15
- package/src/model/TtscLintDaemon.ts +55 -136
- package/src/model/TtscLintDaemonState.ts +174 -0
- package/src/model/copyGraphRecords.ts +17 -0
- package/src/model/copyGraphSnapshot.ts +30 -0
- package/src/model/loadGraph.ts +23 -12
- package/src/model/publishedArtifacts.ts +361 -182
- package/src/nativeExecutable.ts +93 -26
- package/src/reduce.ts +24 -51
- package/src/resolveGraphBinary.ts +13 -3
- package/src/runGraph.ts +90 -0
- package/src/server/IResolvedGraphHandle.ts +24 -0
- package/src/server/createServer.ts +16 -22
- package/src/server/exportSurface.ts +23 -1
- package/src/server/formatGraphFailure.ts +32 -0
- package/src/server/pathPolicy.ts +70 -5
- package/src/server/resolveHandle.ts +45 -14
- package/src/server/resultAudit.ts +58 -27
- package/src/server/resultNext.ts +26 -1
- package/src/server/runDetails.ts +138 -73
- package/src/server/runEntrypoints.ts +13 -1
- package/src/server/runLookup.ts +23 -7
- package/src/server/runOverview.ts +17 -5
- package/src/server/runTour.ts +44 -82
- package/src/server/runTrace.ts +175 -102
- package/src/server/startServer.ts +29 -1
- package/src/structures/ITtscGraphApplication.ts +95 -41
- package/src/structures/ITtscGraphDecorator.ts +18 -0
- package/src/structures/ITtscGraphDetails.ts +81 -6
- package/src/structures/ITtscGraphDocTag.ts +17 -8
- package/src/structures/ITtscGraphDump.ts +106 -8
- package/src/structures/ITtscGraphEdge.ts +14 -2
- package/src/structures/ITtscGraphEntrypoints.ts +81 -6
- package/src/structures/ITtscGraphEscape.ts +24 -2
- package/src/structures/ITtscGraphEvidence.ts +9 -0
- package/src/structures/ITtscGraphLookup.ts +42 -9
- package/src/structures/ITtscGraphNext.ts +12 -1
- package/src/structures/ITtscGraphNode.ts +38 -11
- package/src/structures/ITtscGraphOverview.ts +88 -6
- package/src/structures/ITtscGraphSnapshot.ts +117 -2
- package/src/structures/ITtscGraphSpan.ts +9 -0
- package/src/structures/ITtscGraphTour.ts +83 -9
- package/src/structures/ITtscGraphTrace.ts +100 -14
- package/src/structures/RawDump.ts +25 -0
- package/src/structures/RawEdge.ts +22 -0
- package/src/structures/RawNode.ts +31 -0
- package/src/structures/TtscGraphArtifactNodeKind.ts +9 -0
- package/src/structures/TtscGraphDumpEdgeKind.ts +15 -1
- package/src/structures/TtscGraphDumpNodeKind.ts +9 -0
- package/src/structures/TtscGraphEdgeKind.ts +13 -4
- package/src/structures/TtscGraphNodeKind.ts +9 -0
- package/src/structures/TtscGraphNodeModifier.ts +9 -0
- package/src/structures/ViewerLink.ts +22 -0
- package/src/structures/ViewerNode.ts +28 -0
- package/src/structures/ViewerPayload.ts +52 -0
- package/src/view.ts +208 -110
- package/src/viewer/legend.ts +119 -27
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GraphProcessTrace = void 0;
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_crypto_1 = require("node:crypto");
|
|
9
|
+
const node_events_1 = require("node:events");
|
|
10
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
/**
|
|
13
|
+
* Private process observers; package entrypoints do not export this namespace.
|
|
14
|
+
* The aliases retain Node's overloads while their adapters pass arguments
|
|
15
|
+
* intact. Native executable, argv and option types stay with Node. This
|
|
16
|
+
* grouping adds no product flag, protocol field, cache, process holder or
|
|
17
|
+
* algorithm; those responsibilities remain with the adapters and their existing
|
|
18
|
+
* callers.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
var GraphProcessTrace;
|
|
23
|
+
(function (GraphProcessTrace) {
|
|
24
|
+
GraphProcessTrace.spawn = observeSpawn;
|
|
25
|
+
GraphProcessTrace.spawnSync = observeSpawnSync;
|
|
26
|
+
})(GraphProcessTrace || (exports.GraphProcessTrace = GraphProcessTrace = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Correlate one actual call in the coordinator's absolute scratch directory.
|
|
29
|
+
* Failed writes leave bounded integrity evidence where possible; an unwritable
|
|
30
|
+
* sink remains missing measurement data. Neither failure changes product IO.
|
|
31
|
+
*
|
|
32
|
+
* A process-local nonce and increasing ordinal distinguish calls from child PID
|
|
33
|
+
* reuse. The optional closure owns correlation and the append sink only;
|
|
34
|
+
* callers own process behavior. Node's absolute-path and append operations use
|
|
35
|
+
* the coordinator's native path spelling and process.pid identifies the writer.
|
|
36
|
+
* No fixture oracle, foreign mutation or test-helper dependency is involved.
|
|
37
|
+
* Each event carries the writer's actual process.version; that runtime string
|
|
38
|
+
* alone does not authenticate executable bytes or the loaded native image.
|
|
39
|
+
*
|
|
40
|
+
* Each event serializes its observed fields once, so temporary text follows
|
|
41
|
+
* event size. Synchronous IO is measurement overhead, not a claimed speedup.
|
|
42
|
+
* Effectful calls and writes are never deduplicated. Scalar counters and one
|
|
43
|
+
* nonce persist per module instance; each append closes its handle. Events are
|
|
44
|
+
* capped at64MiB and writer output at256MiB, plus one overwritten bounded
|
|
45
|
+
* integrity marker. The coordinator retains these files until writers join.
|
|
46
|
+
*/
|
|
47
|
+
function begin() {
|
|
48
|
+
const root = process.env.TTSC_E2E_TRACE;
|
|
49
|
+
if (!root || !node_path_1.default.isAbsolute(root))
|
|
50
|
+
return undefined;
|
|
51
|
+
try {
|
|
52
|
+
instance ??= (0, node_crypto_1.randomUUID)();
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
const writerInstance = instance;
|
|
58
|
+
const invocation = `${writerInstance}:${++ordinal}`;
|
|
59
|
+
const file = node_path_1.default.join(root, `${process.pid}-${writerInstance}.jsonl`);
|
|
60
|
+
return (event, fields) => {
|
|
61
|
+
try {
|
|
62
|
+
const line = JSON.stringify({
|
|
63
|
+
...fields,
|
|
64
|
+
schema: 1,
|
|
65
|
+
event,
|
|
66
|
+
writerPid: process.pid,
|
|
67
|
+
instance: writerInstance,
|
|
68
|
+
sequence: ++sequence,
|
|
69
|
+
at: new Date().toISOString(),
|
|
70
|
+
invocation,
|
|
71
|
+
data: {
|
|
72
|
+
...fields.data,
|
|
73
|
+
writerRuntime: process.version,
|
|
74
|
+
},
|
|
75
|
+
}) + "\n";
|
|
76
|
+
const bytes = Buffer.byteLength(line);
|
|
77
|
+
if (bytes > EVENT_LIMIT || written + bytes > WRITER_LIMIT)
|
|
78
|
+
throw new Error("trace writer byte budget exceeded");
|
|
79
|
+
node_fs_1.default.appendFileSync(file, line, { encoding: "utf8", mode: 0o600 });
|
|
80
|
+
written += bytes;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
try {
|
|
84
|
+
node_fs_1.default.writeFileSync(`${file}.integrity`, "trace serialization, append or byte budget failed", { mode: 0o600 });
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
/* Missing trace remains an integrity failure. */
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Observe the supported spawn, exit and close events on the original child.
|
|
94
|
+
* errorMonitor observes errors without becoming a normal error handler. Call
|
|
95
|
+
* bounds are not exact OS creation times; close does not join descendants.
|
|
96
|
+
*
|
|
97
|
+
* Native spawn executes once with unchanged executable, argv and options and
|
|
98
|
+
* returns the original child or throws the same synchronous error. Events
|
|
99
|
+
* provide actual PID and lifecycle observations under one invocation; cwd
|
|
100
|
+
* records explicit or inherited intent without guessing native resolution.
|
|
101
|
+
* Streams, parsing, shutdown, references and normal errors stay caller-owned.
|
|
102
|
+
*
|
|
103
|
+
* Disabled observation delegates directly; enabled calls serialize argv and a
|
|
104
|
+
* fixed event population. Effectful starts are not reusable results. Once
|
|
105
|
+
* listeners retain correlation until their event or child collection; no timer,
|
|
106
|
+
* reference change, kill or independent wait is added. Existing owners release
|
|
107
|
+
* the child, and no foreign process export is patched.
|
|
108
|
+
*/
|
|
109
|
+
function observeSpawn(...args) {
|
|
110
|
+
const trace = begin();
|
|
111
|
+
if (!trace)
|
|
112
|
+
return Reflect.apply(node_child_process_1.spawn, undefined, args);
|
|
113
|
+
const options = (Array.isArray(args[1]) ? args[2] : args[1]);
|
|
114
|
+
const selected = {
|
|
115
|
+
argv: [args[0], ...(Array.isArray(args[1]) ? args[1] : [])],
|
|
116
|
+
cwd: options?.cwd === undefined ? null : String(options.cwd),
|
|
117
|
+
data: { primitive: "spawn", cwdInherited: options?.cwd === undefined },
|
|
118
|
+
};
|
|
119
|
+
const startLowerBound = new Date().toISOString();
|
|
120
|
+
trace("process-attempt", { ...selected, pid: null, startLowerBound });
|
|
121
|
+
let child;
|
|
122
|
+
try {
|
|
123
|
+
child = Reflect.apply(node_child_process_1.spawn, undefined, args);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
trace("process-result", {
|
|
127
|
+
pid: null,
|
|
128
|
+
started: false,
|
|
129
|
+
exitObserved: false,
|
|
130
|
+
startLowerBound,
|
|
131
|
+
startUpperBound: new Date().toISOString(),
|
|
132
|
+
data: { outcome: "synchronous-spawn-error", error },
|
|
133
|
+
});
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
const startUpperBound = new Date().toISOString();
|
|
137
|
+
let started = false;
|
|
138
|
+
let exitObserved = false;
|
|
139
|
+
child.once("spawn", () => {
|
|
140
|
+
started = true;
|
|
141
|
+
trace("process-start", {
|
|
142
|
+
pid: child.pid ?? null,
|
|
143
|
+
started,
|
|
144
|
+
startLowerBound,
|
|
145
|
+
startUpperBound,
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
child.once(node_events_1.errorMonitor, (error) => trace("process-error", {
|
|
149
|
+
pid: child.pid ?? null,
|
|
150
|
+
started,
|
|
151
|
+
exitObserved,
|
|
152
|
+
error: error.message,
|
|
153
|
+
data: { code: error.code },
|
|
154
|
+
}));
|
|
155
|
+
child.once("exit", (status, signal) => {
|
|
156
|
+
exitObserved = true;
|
|
157
|
+
trace("process-exit", {
|
|
158
|
+
pid: child.pid ?? null,
|
|
159
|
+
started,
|
|
160
|
+
exitObserved,
|
|
161
|
+
status,
|
|
162
|
+
signal,
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
child.once("close", (status, signal) => trace("process-close", {
|
|
166
|
+
pid: child.pid ?? null,
|
|
167
|
+
started,
|
|
168
|
+
exitObserved,
|
|
169
|
+
status,
|
|
170
|
+
signal,
|
|
171
|
+
}));
|
|
172
|
+
return child;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Observe the original synchronous result without replacing file descriptors,
|
|
176
|
+
* encoding, buffers, shell options or errors. A positive returned PID records a
|
|
177
|
+
* started child; call bounds do not invent its exact creation timestamp.
|
|
178
|
+
*
|
|
179
|
+
* Actual returned PID/status/signal/error distinguish a child from a failed
|
|
180
|
+
* pre-start attempt. Executable, argv, native options and the identical result
|
|
181
|
+
* or thrown error pass through unchanged. Explicit cwd and inherited intent are
|
|
182
|
+
* distinct observations, not resolved executable identity. Downstream capture,
|
|
183
|
+
* status mapping, protocol bytes and disposal remain in their existing owners.
|
|
184
|
+
*
|
|
185
|
+
* Observation adds argv serialization and two bounded event writes per actual
|
|
186
|
+
* effectful call; captured output is not copied or reused as expected counts.
|
|
187
|
+
* One correlation remains until native return, append handles close per write
|
|
188
|
+
* and original callers still release their captures.
|
|
189
|
+
*/
|
|
190
|
+
function observeSpawnSync(...args) {
|
|
191
|
+
const trace = begin();
|
|
192
|
+
if (!trace)
|
|
193
|
+
return Reflect.apply(node_child_process_1.spawnSync, undefined, args);
|
|
194
|
+
const options = (Array.isArray(args[1]) ? args[2] : args[1]);
|
|
195
|
+
const selected = {
|
|
196
|
+
argv: [args[0], ...(Array.isArray(args[1]) ? args[1] : [])],
|
|
197
|
+
cwd: options?.cwd === undefined ? null : String(options.cwd),
|
|
198
|
+
data: { primitive: "spawnSync", cwdInherited: options?.cwd === undefined },
|
|
199
|
+
};
|
|
200
|
+
const startLowerBound = new Date().toISOString();
|
|
201
|
+
trace("process-attempt", { ...selected, pid: null, startLowerBound });
|
|
202
|
+
let result;
|
|
203
|
+
try {
|
|
204
|
+
result = Reflect.apply(node_child_process_1.spawnSync, undefined, args);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
trace("process-result", {
|
|
208
|
+
pid: null,
|
|
209
|
+
started: false,
|
|
210
|
+
exitObserved: false,
|
|
211
|
+
startLowerBound,
|
|
212
|
+
startUpperBound: new Date().toISOString(),
|
|
213
|
+
data: { outcome: "synchronous-spawn-error", error },
|
|
214
|
+
});
|
|
215
|
+
throw error;
|
|
216
|
+
}
|
|
217
|
+
trace("process-result", {
|
|
218
|
+
pid: result.pid || null,
|
|
219
|
+
started: result.pid > 0,
|
|
220
|
+
exitObserved: result.status !== null || result.signal !== null,
|
|
221
|
+
status: result.status,
|
|
222
|
+
signal: result.signal,
|
|
223
|
+
error: result.error?.message,
|
|
224
|
+
startLowerBound,
|
|
225
|
+
startUpperBound: new Date().toISOString(),
|
|
226
|
+
});
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
let instance;
|
|
230
|
+
let ordinal = 0;
|
|
231
|
+
let sequence = 0;
|
|
232
|
+
let written = 0;
|
|
233
|
+
const EVENT_LIMIT = 64 * 1024 * 1024;
|
|
234
|
+
const WRITER_LIMIT = 256 * 1024 * 1024;
|
|
235
|
+
//# sourceMappingURL=GraphProcessTrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphProcessTrace.js","sourceRoot":"","sources":["../../src/internal/GraphProcessTrace.ts"],"names":[],"mappings":";;;;;;AAAA,2DAK4B;AAC5B,6CAAyC;AACzC,6CAA2C;AAC3C,sDAAyB;AACzB,0DAA6B;AAE7B;;;;;;;;;GASG;AACH,IAAiB,iBAAiB,CAGjC;AAHD,WAAiB,iBAAiB;IACnB,uBAAK,GAAG,YAAkC,CAAC;IAC3C,2BAAS,GAAG,gBAA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B,eAAe;QACf,eAAe,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC1C,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAI,QAA4B,CAAC;AACjC,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACrC,MAAM,YAAY,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
package/lib/launcherArgs.d.ts
CHANGED
|
@@ -1,24 +1,83 @@
|
|
|
1
|
+
import type { ILauncherOption } from "./ILauncherOption";
|
|
2
|
+
import type { IProjectOptions } from "./IProjectOptions";
|
|
3
|
+
import type { ParsedLauncherOptions } from "./ParsedLauncherOptions";
|
|
4
|
+
/**
|
|
5
|
+
* Invalid launcher syntax or a value outside the option's supported domain.
|
|
6
|
+
*
|
|
7
|
+
* @evidence contracts/common.md#principled-implementation An Error subtype gives callers a distinct argument-failure category while preserving the original diagnostic message.
|
|
8
|
+
* @evidence contracts/common.md#clear-and-simple-design Only the error name differs; native Error owns stack and message behavior.
|
|
9
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No global Error behavior is patched to classify launcher failures.
|
|
10
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline identifies the two supported causes without restating the class name.
|
|
11
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Argument failure representation has no filesystem or process boundary.
|
|
12
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources an Error subclass retains only its message and stack for the catcher.
|
|
13
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms an Error subclass that only sets its name, so it runs no algorithm.
|
|
14
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work an Error subclass holds no computation that could be shared.
|
|
15
|
+
*/
|
|
1
16
|
export declare class GraphArgumentError extends Error {
|
|
2
17
|
constructor(message: string);
|
|
3
18
|
}
|
|
4
|
-
type OptionKind = "value" | "flag" | "boolean";
|
|
5
|
-
export interface ILauncherOption {
|
|
6
|
-
key: string;
|
|
7
|
-
flags: readonly string[];
|
|
8
|
-
kind: OptionKind;
|
|
9
|
-
}
|
|
10
|
-
export type ParsedLauncherOptions = ReadonlyMap<string, string | boolean>;
|
|
11
|
-
export interface IProjectOptions {
|
|
12
|
-
cwd: string;
|
|
13
|
-
tsconfig: string;
|
|
14
|
-
}
|
|
15
19
|
export declare const PROJECT_OPTIONS: readonly ILauncherOption[];
|
|
16
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Parse one complete launcher argument vector and reject every unknown token.
|
|
22
|
+
*
|
|
23
|
+
* Repeated aliases replace the prior canonical value. Missing values, values on
|
|
24
|
+
* bare flags and unsupported boolean spellings throw GraphArgumentError.
|
|
25
|
+
*
|
|
26
|
+
* @evidence contracts/common.md#principled-implementation An alias map and ordered argument scan implement explicit option grammar; typed validators reject unsupported values without coercion.
|
|
27
|
+
* @evidence contracts/common.md#clear-and-simple-design Definitions own grammar while private helpers own equals syntax, nonempty text and boolean spellings.
|
|
28
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Every token must match a configured option; unknown input is not silently accepted for a known fixture.
|
|
29
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains repeated options and argument failures, with tags separated by a blank comment line.
|
|
30
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Token parsing interprets no path and invokes no native process; projectOptions handles path-bearing options later.
|
|
31
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources builds a local Map that it returns and keeps no handle.
|
|
32
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one pass over argv with a Map of flag aliases, linear in the argument count.
|
|
33
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work parses one argv per launch and caches nothing.
|
|
34
|
+
*/
|
|
17
35
|
export declare function parseLauncherOptions(argv: readonly string[], definitions: readonly ILauncherOption[]): ParsedLauncherOptions;
|
|
18
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the two project-selection values shared by every launcher lane.
|
|
38
|
+
*
|
|
39
|
+
* Defaults are the process directory and tsconfig.json; relative cwd values are
|
|
40
|
+
* resolved before package lookup or native process invocation.
|
|
41
|
+
*
|
|
42
|
+
* @evidence contracts/common.md#principled-implementation Native path.resolve makes cwd absolute while the config retains the producer's cwd-relative convention.
|
|
43
|
+
* @evidence contracts/common.md#clear-and-simple-design One adapter owns both shared defaults for all launcher lanes.
|
|
44
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Defaults are public launcher conventions rather than named-repository exceptions.
|
|
45
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose documents defaults and resolution timing instead of only listing returned keys.
|
|
46
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node path.resolve applies the host's native path rules without manually concatenating separators.
|
|
47
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
|
|
48
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms resolves two values in constant time.
|
|
49
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work two lookups per call, nothing worth sharing.
|
|
50
|
+
*/
|
|
19
51
|
export declare function projectOptions(values: ParsedLauncherOptions): IProjectOptions;
|
|
20
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Read a bounded non-negative integer option without JavaScript coercion.
|
|
54
|
+
*
|
|
55
|
+
* The value must be present, decimal digits and a safe integer no greater than
|
|
56
|
+
* maximum. Missing parser state is an internal error; invalid text is an
|
|
57
|
+
* argument error.
|
|
58
|
+
*
|
|
59
|
+
* @evidence contracts/common.md#principled-implementation Decimal syntax plus safe-integer and maximum checks exclude coercible nonintegers and precision loss before returning a number.
|
|
60
|
+
* @evidence contracts/common.md#clear-and-simple-design One validator owns nonnegative parsing and is reused by the positive validator.
|
|
61
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Bounds are supplied by the option contract rather than expected fixture values.
|
|
62
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains numeric domain and the distinction between missing state and invalid input.
|
|
63
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Numeric option validation has no native filesystem or process operation.
|
|
64
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a number and retains nothing.
|
|
65
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one digit-pattern test and one Number conversion of a single option value.
|
|
66
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work validates one option value per call.
|
|
67
|
+
*/
|
|
21
68
|
export declare function nonNegativeIntegerOption(values: ParsedLauncherOptions, key: string, maximum: number): number;
|
|
22
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Read a bounded positive integer option without JavaScript coercion.
|
|
71
|
+
*
|
|
72
|
+
* Uses the nonnegative validator and additionally rejects zero.
|
|
73
|
+
*
|
|
74
|
+
* @evidence contracts/common.md#principled-implementation Reusing safe nonnegative validation then excluding zero yields exactly the bounded positive-integer domain.
|
|
75
|
+
* @evidence contracts/common.md#clear-and-simple-design The adapter adds one domain restriction rather than duplicating numeric parsing.
|
|
76
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Zero rejection follows the option domain, not a special expected command case.
|
|
77
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the additional restriction and identifies the shared validator.
|
|
78
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The positivity restriction is a platform-independent numeric predicate.
|
|
79
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a number and retains nothing.
|
|
80
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms delegates to nonNegativeIntegerOption and compares the result with zero.
|
|
81
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work validates one option value per call.
|
|
82
|
+
*/
|
|
23
83
|
export declare function positiveIntegerOption(values: ParsedLauncherOptions, key: string, maximum: number): number;
|
|
24
|
-
export {};
|
package/lib/launcherArgs.js
CHANGED
|
@@ -9,6 +9,18 @@ exports.projectOptions = projectOptions;
|
|
|
9
9
|
exports.nonNegativeIntegerOption = nonNegativeIntegerOption;
|
|
10
10
|
exports.positiveIntegerOption = positiveIntegerOption;
|
|
11
11
|
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
/**
|
|
13
|
+
* Invalid launcher syntax or a value outside the option's supported domain.
|
|
14
|
+
*
|
|
15
|
+
* @evidence contracts/common.md#principled-implementation An Error subtype gives callers a distinct argument-failure category while preserving the original diagnostic message.
|
|
16
|
+
* @evidence contracts/common.md#clear-and-simple-design Only the error name differs; native Error owns stack and message behavior.
|
|
17
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No global Error behavior is patched to classify launcher failures.
|
|
18
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline identifies the two supported causes without restating the class name.
|
|
19
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Argument failure representation has no filesystem or process boundary.
|
|
20
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources an Error subclass retains only its message and stack for the catcher.
|
|
21
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms an Error subclass that only sets its name, so it runs no algorithm.
|
|
22
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work an Error subclass holds no computation that could be shared.
|
|
23
|
+
*/
|
|
12
24
|
class GraphArgumentError extends Error {
|
|
13
25
|
constructor(message) {
|
|
14
26
|
super(message);
|
|
@@ -20,7 +32,21 @@ exports.PROJECT_OPTIONS = [
|
|
|
20
32
|
{ key: "cwd", flags: ["--cwd"], kind: "value" },
|
|
21
33
|
{ key: "tsconfig", flags: ["--tsconfig"], kind: "value" },
|
|
22
34
|
];
|
|
23
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Parse one complete launcher argument vector and reject every unknown token.
|
|
37
|
+
*
|
|
38
|
+
* Repeated aliases replace the prior canonical value. Missing values, values on
|
|
39
|
+
* bare flags and unsupported boolean spellings throw GraphArgumentError.
|
|
40
|
+
*
|
|
41
|
+
* @evidence contracts/common.md#principled-implementation An alias map and ordered argument scan implement explicit option grammar; typed validators reject unsupported values without coercion.
|
|
42
|
+
* @evidence contracts/common.md#clear-and-simple-design Definitions own grammar while private helpers own equals syntax, nonempty text and boolean spellings.
|
|
43
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Every token must match a configured option; unknown input is not silently accepted for a known fixture.
|
|
44
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains repeated options and argument failures, with tags separated by a blank comment line.
|
|
45
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Token parsing interprets no path and invokes no native process; projectOptions handles path-bearing options later.
|
|
46
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources builds a local Map that it returns and keeps no handle.
|
|
47
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one pass over argv with a Map of flag aliases, linear in the argument count.
|
|
48
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work parses one argv per launch and caches nothing.
|
|
49
|
+
*/
|
|
24
50
|
function parseLauncherOptions(argv, definitions) {
|
|
25
51
|
const flags = new Map();
|
|
26
52
|
for (const definition of definitions) {
|
|
@@ -32,12 +58,13 @@ function parseLauncherOptions(argv, definitions) {
|
|
|
32
58
|
const arg = argv[i];
|
|
33
59
|
const exact = flags.get(arg);
|
|
34
60
|
if (exact !== undefined) {
|
|
35
|
-
if (exact.kind === "value") {
|
|
61
|
+
if (exact.kind === "value" || exact.kind === "string") {
|
|
36
62
|
const value = argv[++i];
|
|
37
|
-
if (value === undefined ||
|
|
63
|
+
if (value === undefined ||
|
|
64
|
+
(exact.kind === "value" && value.startsWith("-"))) {
|
|
38
65
|
throw new GraphArgumentError(`${arg} requires a non-empty value`);
|
|
39
66
|
}
|
|
40
|
-
parsed.set(exact.key, requireValue(arg, value));
|
|
67
|
+
parsed.set(exact.key, exact.kind === "string" ? value : requireValue(arg, value));
|
|
41
68
|
}
|
|
42
69
|
else {
|
|
43
70
|
parsed.set(exact.key, true);
|
|
@@ -56,19 +83,48 @@ function parseLauncherOptions(argv, definitions) {
|
|
|
56
83
|
parsed.set(definition.key, parseBoolean(flag, value));
|
|
57
84
|
}
|
|
58
85
|
else {
|
|
59
|
-
parsed.set(definition.key, requireValue(flag, value));
|
|
86
|
+
parsed.set(definition.key, definition.kind === "string" ? value : requireValue(flag, value));
|
|
60
87
|
}
|
|
61
88
|
}
|
|
62
89
|
return parsed;
|
|
63
90
|
}
|
|
64
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Resolve the two project-selection values shared by every launcher lane.
|
|
93
|
+
*
|
|
94
|
+
* Defaults are the process directory and tsconfig.json; relative cwd values are
|
|
95
|
+
* resolved before package lookup or native process invocation.
|
|
96
|
+
*
|
|
97
|
+
* @evidence contracts/common.md#principled-implementation Native path.resolve makes cwd absolute while the config retains the producer's cwd-relative convention.
|
|
98
|
+
* @evidence contracts/common.md#clear-and-simple-design One adapter owns both shared defaults for all launcher lanes.
|
|
99
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Defaults are public launcher conventions rather than named-repository exceptions.
|
|
100
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose documents defaults and resolution timing instead of only listing returned keys.
|
|
101
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node path.resolve applies the host's native path rules without manually concatenating separators.
|
|
102
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
|
|
103
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms resolves two values in constant time.
|
|
104
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work two lookups per call, nothing worth sharing.
|
|
105
|
+
*/
|
|
65
106
|
function projectOptions(values) {
|
|
66
107
|
return {
|
|
67
108
|
cwd: node_path_1.default.resolve(stringValue(values, "cwd") ?? process.cwd()),
|
|
68
109
|
tsconfig: stringValue(values, "tsconfig") ?? "tsconfig.json",
|
|
69
110
|
};
|
|
70
111
|
}
|
|
71
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Read a bounded non-negative integer option without JavaScript coercion.
|
|
114
|
+
*
|
|
115
|
+
* The value must be present, decimal digits and a safe integer no greater than
|
|
116
|
+
* maximum. Missing parser state is an internal error; invalid text is an
|
|
117
|
+
* argument error.
|
|
118
|
+
*
|
|
119
|
+
* @evidence contracts/common.md#principled-implementation Decimal syntax plus safe-integer and maximum checks exclude coercible nonintegers and precision loss before returning a number.
|
|
120
|
+
* @evidence contracts/common.md#clear-and-simple-design One validator owns nonnegative parsing and is reused by the positive validator.
|
|
121
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Bounds are supplied by the option contract rather than expected fixture values.
|
|
122
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains numeric domain and the distinction between missing state and invalid input.
|
|
123
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Numeric option validation has no native filesystem or process operation.
|
|
124
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a number and retains nothing.
|
|
125
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one digit-pattern test and one Number conversion of a single option value.
|
|
126
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work validates one option value per call.
|
|
127
|
+
*/
|
|
72
128
|
function nonNegativeIntegerOption(values, key, maximum) {
|
|
73
129
|
const value = stringValue(values, key);
|
|
74
130
|
if (value === undefined) {
|
|
@@ -83,7 +139,20 @@ function nonNegativeIntegerOption(values, key, maximum) {
|
|
|
83
139
|
}
|
|
84
140
|
return number;
|
|
85
141
|
}
|
|
86
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* Read a bounded positive integer option without JavaScript coercion.
|
|
144
|
+
*
|
|
145
|
+
* Uses the nonnegative validator and additionally rejects zero.
|
|
146
|
+
*
|
|
147
|
+
* @evidence contracts/common.md#principled-implementation Reusing safe nonnegative validation then excluding zero yields exactly the bounded positive-integer domain.
|
|
148
|
+
* @evidence contracts/common.md#clear-and-simple-design The adapter adds one domain restriction rather than duplicating numeric parsing.
|
|
149
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Zero rejection follows the option domain, not a special expected command case.
|
|
150
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the additional restriction and identifies the shared validator.
|
|
151
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The positivity restriction is a platform-independent numeric predicate.
|
|
152
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a number and retains nothing.
|
|
153
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms delegates to nonNegativeIntegerOption and compares the result with zero.
|
|
154
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work validates one option value per call.
|
|
155
|
+
*/
|
|
87
156
|
function positiveIntegerOption(values, key, maximum) {
|
|
88
157
|
const value = nonNegativeIntegerOption(values, key, maximum);
|
|
89
158
|
if (value === 0) {
|
package/lib/launcherArgs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcherArgs.js","sourceRoot":"","sources":["../src/launcherArgs.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,0DAA6B;
|
|
1
|
+
{"version":3,"file":"launcherArgs.js","sourceRoot":"","sources":["../src/launcherArgs.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,0DAA6B;AAM7B;;;;;;;;;;;GAWG;AACH,wBAAgC,SAAQ,KAAK;IAC3C,YAAmB,OAAe;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;;AAEY,QAAA,eAAe,GAA+B;IACzD,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;IAC/C,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;CAC1D,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,8BACE,IAAuB,EACvB,WAAuC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C;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,KAAa;IAC/C,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,kBAAkB,CAAC,GAAG,IAAI,6BAA6B,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,KAAa;IAC/C,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,IAAI,CAAC;QACd,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,KAAK,CAAC;QACf;YACE,MAAM,IAAI,kBAAkB,CAAC,GAAG,IAAI,2BAA2B,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAClB,MAA6B,EAC7B,GAAW;IAEX,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,KAAK,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A directory watched on behalf of the pattern that named it.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation The absolute root and descent flag identify the conservative tree population needed to notice a declared pattern changing.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design A directory watch contains only its native root and traversal choice; resolved files remain in the separate file list.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The depth decision follows wildcard path structure rather than an arbitrary maximum documentation depth.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains the recursive distinction and why a bare filename wildcard does not require a repository-wide scan.
|
|
8
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources data shape only: it holds no handle, task or retained state.
|
|
9
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms data shape only: it contains no loop or algorithm.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work data shape only: it computes nothing another request could share.
|
|
11
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation data shape only: it touches no file, path or process.
|
|
12
|
+
*/
|
|
13
|
+
export interface IArtifactDirectory {
|
|
14
|
+
/** Absolute path of the directory to walk. */
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the walk descends.
|
|
18
|
+
*
|
|
19
|
+
* Taken from wildcard path structure rather than assumed, because assuming it
|
|
20
|
+
* is expensive in exactly the case that looks harmless: a rule declaring
|
|
21
|
+
* `*.md` has the project root for its fixed prefix, and treating that as
|
|
22
|
+
* recursive would state every file in the repository before every graph
|
|
23
|
+
* request.
|
|
24
|
+
*/
|
|
25
|
+
recursive: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IArtifactDirectory.js","sourceRoot":"","sources":["../../src/model/IArtifactDirectory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IArtifactDirectory } from "./IArtifactDirectory";
|
|
2
|
+
/**
|
|
3
|
+
* Paths an answer was derived from, split by how they are watched.
|
|
4
|
+
*
|
|
5
|
+
* @evidence contracts/common.md#principled-implementation Explicit files and watched directories represent edits and membership changes as distinct input populations.
|
|
6
|
+
* @evidence contracts/common.md#clear-and-simple-design Two lists carry sidecar-declared provenance without a second glob interpreter or compiler dependency model.
|
|
7
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts An input inventory does not assert complete discovery provenance for a missing publisher.
|
|
8
|
+
* @evidence contracts/common.md#meaningful-documentation Native property prose identifies individual files and directories that notice additions and deletions.
|
|
9
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources data shape only: it holds no handle, task or retained state.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms data shape only: it contains no loop or algorithm.
|
|
11
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work data shape only: it computes nothing another request could share.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation data shape only: it touches no file, path or process.
|
|
13
|
+
*/
|
|
14
|
+
export interface IArtifactInputs {
|
|
15
|
+
/** Files stated one by one. */
|
|
16
|
+
files: string[];
|
|
17
|
+
/** Directories walked, which is what notices an added or deleted file. */
|
|
18
|
+
directories: IArtifactDirectory[];
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IArtifactInputs.js","sourceRoot":"","sources":["../../src/model/IArtifactInputs.ts"],"names":[],"mappings":""}
|