@ttsc/graph 0.30.3 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -6,22 +6,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.publishArtifacts = publishArtifacts;
|
|
7
7
|
exports.publishArtifactsResident = publishArtifactsResident;
|
|
8
8
|
exports.artifactsAreStale = artifactsAreStale;
|
|
9
|
+
exports.artifactsAreStaleResident = artifactsAreStaleResident;
|
|
9
10
|
exports.watchedBy = watchedBy;
|
|
10
11
|
exports.fingerprintInputs = fingerprintInputs;
|
|
11
|
-
const node_child_process_1 = require("node:child_process");
|
|
12
12
|
const node_crypto_1 = require("node:crypto");
|
|
13
13
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
14
|
const node_os_1 = __importDefault(require("node:os"));
|
|
15
15
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
16
|
const ttsc_1 = require("ttsc");
|
|
17
|
+
const GraphProcessTrace_1 = require("../internal/GraphProcessTrace");
|
|
18
|
+
/**
|
|
19
|
+
* Discover configured publishers and synchronously publish their artifact set.
|
|
20
|
+
* Input identity is captured before the graph-nodes verbs to avoid accepting a
|
|
21
|
+
* concurrent document edit as already represented by an older answer.
|
|
22
|
+
*
|
|
23
|
+
* @evidence contracts/common.md#principled-implementation Capability discovery and each sidecar's project-inputs/graph-nodes verbs remain the authorities for plugin selection and artifact meaning.
|
|
24
|
+
* @evidence contracts/common.md#clear-and-simple-design The one-shot path composes discovery, input capture and publication through helpers also used by resident requests.
|
|
25
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Unavailable sidecars do not produce fabricated artifacts; no evidence-rule-specific parser or private compiler mutation substitutes for the publisher.
|
|
26
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose documents synchronous ownership and the freshness snapshot's required ordering.
|
|
27
|
+
* @evidence contracts/performance.md#efficient-algorithms Discovery runs once per publication, distinct input paths are merged and fingerprinted once, and publisher JSON is concatenated in one pass.
|
|
28
|
+
* @evidence contracts/performance.md#reuse-equivalent-work This one-shot caller has no resident sidecar owner; resident consumers use publishArtifactsResident and session freshness reuse instead of repeatedly spawning this path.
|
|
29
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources SpawnSync owns each child through completion; the exchange file is overwritten per process/project, but historical project files have no explicit reclamation yet.
|
|
30
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native paths and temporary storage use Node path/os APIs; sidecars receive argument arrays and hidden Windows child windows without shell composition.
|
|
31
|
+
*/
|
|
17
32
|
function publishArtifacts(options) {
|
|
18
|
-
const
|
|
33
|
+
const discovery = (0, ttsc_1.resolveCapabilityPluginResolution)({
|
|
19
34
|
capability: "graphNodes",
|
|
20
35
|
cwd: options.cwd,
|
|
21
36
|
tsconfig: options.tsconfig,
|
|
22
37
|
});
|
|
38
|
+
const plugins = discovery.plugins;
|
|
23
39
|
if (plugins.length === 0)
|
|
24
|
-
return unpublished(options);
|
|
40
|
+
return unpublished(options, discovery);
|
|
25
41
|
// The inputs are stated before the set is asked for, never after. A document
|
|
26
42
|
// edited between the two calls has to read as a change next time, and only
|
|
27
43
|
// this order gives that: a fingerprint taken first describes a state at least
|
|
@@ -30,7 +46,8 @@ function publishArtifacts(options) {
|
|
|
30
46
|
// the set, and the edit that landed in the gap would read as already
|
|
31
47
|
// accounted for — the exact staleness this exists to remove.
|
|
32
48
|
const inputs = readInputs(plugins.map((plugin) => runVerb(plugin, "project-inputs", options)), options);
|
|
33
|
-
|
|
49
|
+
const fingerprint = fingerprintInputs(inputs);
|
|
50
|
+
return assemble(options, inputs, fingerprint, plugins.map((plugin) => runVerb(plugin, "graph-nodes", options)), discovery);
|
|
34
51
|
}
|
|
35
52
|
/**
|
|
36
53
|
* The same answer, asked of sidecars this caller keeps open.
|
|
@@ -45,29 +62,59 @@ function publishArtifacts(options) {
|
|
|
45
62
|
* so the answer is the same one either way and only its cost differs. The
|
|
46
63
|
* fallback matters more here than most: a daemon that quietly answered nothing
|
|
47
64
|
* would be indistinguishable from a project that publishes nothing.
|
|
65
|
+
*
|
|
66
|
+
* @evidence contracts/common.md#principled-implementation Both paths ask the same configured sidecar verbs; input identity is captured before publication and invalidation clears the daemon's stale Program first.
|
|
67
|
+
* @evidence contracts/common.md#clear-and-simple-design The caller supplies daemon and asynchronous resolver ownership while this function owns ordered input and artifact phases and the shared result assembly.
|
|
68
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts A failed daemon falls back to the public direct verb, not an invented empty-success result or a reimplementation of its parser.
|
|
69
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains resident reuse, direct-command fallback and the reason to invalidate the Program before input collection.
|
|
70
|
+
* @evidence contracts/performance.md#efficient-algorithms Independent publishers run concurrently within each of two ordered phases; deduplication avoids repeatedly hashing the same declared file path.
|
|
71
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Session-owned daemons reuse process and plugin loading only while binary, manifest and project context match; changed inputs rebuild the publication.
|
|
72
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The session owns the resolver and daemons. Failed publication joins every selected verb and releases its proof; successful publication transfers proof release to the session. Cancellation closes and joins an active daemon or supervised direct command. One exchange file per process/project still has no historical-file reclamation.
|
|
73
|
+
* @evidence contracts/portability.md#os-neutral-implementation The fallback preserves native argument-vector invocation and Node path resolution; daemon ownership uses the same cross-platform process boundary.
|
|
48
74
|
*/
|
|
49
|
-
async function publishArtifactsResident(options, daemon) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
async function publishArtifactsResident(options, daemon, resolver) {
|
|
76
|
+
options.signal?.throwIfAborted();
|
|
77
|
+
const discovery = await resolver.resolve({ capability: "graphNodes", cwd: options.cwd, tsconfig: options.tsconfig }, { signal: options.signal });
|
|
78
|
+
try {
|
|
79
|
+
options.signal?.throwIfAborted();
|
|
80
|
+
const plugins = discovery.plugins;
|
|
81
|
+
if (plugins.length === 0)
|
|
82
|
+
return unpublished(options, discovery);
|
|
83
|
+
// The first request of a republish drops the daemon's warm Program. The
|
|
84
|
+
// artifacts depend on which sources exist and what they declare — that is
|
|
85
|
+
// what activates a claim — and between two republishes the developer has
|
|
86
|
+
// been editing code as well as documents. Reusing a Program from before
|
|
87
|
+
// those edits would deactivate a claim whose files now exist, which is a
|
|
88
|
+
// stale answer of exactly the kind this whole mechanism removes. What the
|
|
89
|
+
// daemon still saves is the process, the plugin load, and the configuration
|
|
90
|
+
// evaluation, which is most of the cost.
|
|
91
|
+
const inputs = readInputs(await joinedPublications(plugins.map(async (plugin) => askVerb(plugin, "project-inputs", options, await daemon(plugin), true, resolver))), options);
|
|
92
|
+
const fingerprint = fingerprintInputs(inputs);
|
|
93
|
+
const outputs = await joinedPublications(plugins.map(async (plugin) => askVerb(plugin, "graph-nodes", options, await daemon(plugin), false, resolver)));
|
|
94
|
+
options.signal?.throwIfAborted();
|
|
95
|
+
return assemble(options, inputs, fingerprint, outputs, discovery);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
try {
|
|
99
|
+
await discovery.release();
|
|
100
|
+
}
|
|
101
|
+
catch (cleanup) {
|
|
102
|
+
throw new AggregateError([error, cleanup], "@ttsc/graph: discovery release failed");
|
|
103
|
+
}
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** Join every publisher before releasing a failed publication's proof. */
|
|
108
|
+
async function joinedPublications(outputs) {
|
|
109
|
+
const results = await Promise.allSettled(outputs);
|
|
110
|
+
const failures = results.filter((result) => result.status === "rejected");
|
|
111
|
+
if (failures.length > 0)
|
|
112
|
+
throw new AggregateError(failures.map((result) => result.reason), "@ttsc/graph: artifact publication failed");
|
|
113
|
+
return results.map((result) => result.value);
|
|
67
114
|
}
|
|
68
115
|
/** Run one verb as its own process, returning its stdout or `null`. */
|
|
69
116
|
function runVerb(plugin, verb, options) {
|
|
70
|
-
const result =
|
|
117
|
+
const result = GraphProcessTrace_1.GraphProcessTrace.spawnSync(plugin.binary, [
|
|
71
118
|
verb,
|
|
72
119
|
"--cwd",
|
|
73
120
|
options.cwd,
|
|
@@ -97,13 +144,59 @@ function runVerb(plugin, verb, options) {
|
|
|
97
144
|
return result.stdout;
|
|
98
145
|
}
|
|
99
146
|
/** Ask one verb through a daemon, or as a process when it cannot answer. */
|
|
100
|
-
async function askVerb(plugin, verb, options, daemon, invalidate) {
|
|
101
|
-
|
|
102
|
-
|
|
147
|
+
async function askVerb(plugin, verb, options, daemon, invalidate, resolver) {
|
|
148
|
+
options.signal?.throwIfAborted();
|
|
149
|
+
let closing;
|
|
150
|
+
const abort = () => {
|
|
151
|
+
closing = daemon?.close();
|
|
152
|
+
void closing?.catch(() => undefined);
|
|
153
|
+
};
|
|
154
|
+
options.signal?.addEventListener("abort", abort, { once: true });
|
|
155
|
+
if (options.signal?.aborted)
|
|
156
|
+
abort();
|
|
157
|
+
let served;
|
|
158
|
+
let failure;
|
|
159
|
+
try {
|
|
160
|
+
served = await daemon?.ask(verb, invalidate);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
failure = error;
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
options.signal?.removeEventListener("abort", abort);
|
|
168
|
+
try {
|
|
169
|
+
await closing;
|
|
170
|
+
}
|
|
171
|
+
catch (cleanup) {
|
|
172
|
+
throw new AggregateError([
|
|
173
|
+
...(failure === undefined ? [] : [failure]),
|
|
174
|
+
...(options.signal?.aborted ? [options.signal.reason] : []),
|
|
175
|
+
cleanup,
|
|
176
|
+
], "@ttsc/graph: cancelled daemon cleanup failed");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
options.signal?.throwIfAborted();
|
|
180
|
+
if (served !== undefined && served !== null)
|
|
181
|
+
return served;
|
|
182
|
+
const result = await resolver.runCommand(plugin.binary, [
|
|
183
|
+
verb,
|
|
184
|
+
"--cwd",
|
|
185
|
+
options.cwd,
|
|
186
|
+
"--tsconfig",
|
|
187
|
+
options.tsconfig,
|
|
188
|
+
`--plugins-json=${plugin.manifest}`,
|
|
189
|
+
...projectContextArgs(plugin),
|
|
190
|
+
], { maxBuffer: 256 * 1024 * 1024, encoding: "utf8", windowsHide: true }, { signal: options.signal });
|
|
191
|
+
options.signal?.throwIfAborted();
|
|
192
|
+
return result.error ||
|
|
193
|
+
result.status !== 0 ||
|
|
194
|
+
typeof result.stdout !== "string"
|
|
195
|
+
? null
|
|
196
|
+
: result.stdout;
|
|
103
197
|
}
|
|
104
198
|
/** The artifact answer, from each sidecar's `graph-nodes` output. */
|
|
105
|
-
function assemble(options, inputs, outputs) {
|
|
106
|
-
const fingerprint = fingerprintInputs(inputs);
|
|
199
|
+
function assemble(options, inputs, fingerprint, outputs, discovery) {
|
|
107
200
|
const published = [];
|
|
108
201
|
for (const output of outputs) {
|
|
109
202
|
if (output === null)
|
|
@@ -111,14 +204,15 @@ function assemble(options, inputs, outputs) {
|
|
|
111
204
|
try {
|
|
112
205
|
const parsed = JSON.parse(output);
|
|
113
206
|
if (Array.isArray(parsed))
|
|
114
|
-
|
|
207
|
+
for (const entryToAppend of parsed)
|
|
208
|
+
published.push(entryToAppend);
|
|
115
209
|
}
|
|
116
210
|
catch {
|
|
117
211
|
continue;
|
|
118
212
|
}
|
|
119
213
|
}
|
|
120
214
|
if (published.length === 0)
|
|
121
|
-
return { file: null, fingerprint, inputs };
|
|
215
|
+
return { file: null, fingerprint, inputs, discovery };
|
|
122
216
|
// One file per process and project, overwritten, rather than a fresh temp
|
|
123
217
|
// directory per call. A directory per call is a leak nothing here is
|
|
124
218
|
// positioned to clean — the path outlives this function by design, since the
|
|
@@ -134,23 +228,57 @@ function assemble(options, inputs, outputs) {
|
|
|
134
228
|
// impossible.
|
|
135
229
|
const file = node_path_1.default.join(node_os_1.default.tmpdir(), `ttsc-graph-artifacts-${String(process.pid)}-${projectKey(options)}.json`);
|
|
136
230
|
node_fs_1.default.writeFileSync(file, JSON.stringify(published));
|
|
137
|
-
return { file, fingerprint, inputs };
|
|
231
|
+
return { file, fingerprint, inputs, discovery };
|
|
138
232
|
}
|
|
139
233
|
/**
|
|
140
234
|
* Whether the inputs an answer was derived from have moved since.
|
|
141
235
|
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* refresh it guards — while a `stat` per document costs less than reading one
|
|
146
|
-
* of them.
|
|
236
|
+
* Published documents are compared by content identity. The owning resolver
|
|
237
|
+
* separately qualifies discovery, including successful absence. Unavailable,
|
|
238
|
+
* incomplete or changed discovery proof requires another lookup.
|
|
147
239
|
*
|
|
148
|
-
* The
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
240
|
+
* @evidence contracts/common.md#principled-implementation The owning discovery query must still qualify this exact lookup, and exchange-file existence plus declared input identity must also hold before any publication or successful absence is reused.
|
|
241
|
+
* @evidence contracts/common.md#clear-and-simple-design Discovery freshness stays with the resolver and downstream document identity stays with fingerprintInputs; this predicate combines their independent authority.
|
|
242
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Equal size and modification time cannot substitute for file-content equivalence, and a partial no-plugin watch list cannot prove discovery stability.
|
|
243
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain content-based publication freshness, successful absence and conservative relookup for incomplete discovery proof.
|
|
244
|
+
* @evidence contracts/performance.md#efficient-algorithms Freshness hashes the distinct declared inputs and traverses watch roots once per inventory entry; its cost grows with watched bytes and entries rather than only stat count.
|
|
245
|
+
* @evidence contracts/performance.md#reuse-equivalent-work The resolver's original complete discovery proof authorizes sharing populated or empty results; changed or unproved selection requires relookup, and document fingerprints separately qualify overlay reuse.
|
|
246
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This predicate borrows an inventory and returns a boolean; the publication and session own their storage and sidecars.
|
|
247
|
+
* @evidence contracts/portability.md#os-neutral-implementation Existence and fingerprints use Node filesystem APIs and native absolute paths without assumptions about platform shell commands.
|
|
152
248
|
*/
|
|
153
249
|
function artifactsAreStale(published) {
|
|
250
|
+
// Discovery remains the loader's authority, including successful absence.
|
|
251
|
+
// A downstream input list cannot replace an unavailable or incomplete proof.
|
|
252
|
+
if (published.discovery?.status !== "resolved" ||
|
|
253
|
+
!published.discovery.isCurrent())
|
|
254
|
+
return true;
|
|
255
|
+
return artifactInputsAreStale(published);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Check the exact resident discovery proof before reusing its overlay.
|
|
259
|
+
* Discovery runs off the request thread; declared artifact bytes remain an
|
|
260
|
+
* independent freshness premise after that authority has answered.
|
|
261
|
+
*
|
|
262
|
+
* @evidence contracts/common.md#principled-implementation The original asynchronous proof must authorize reuse before exchange existence and declared input fingerprints are compared.
|
|
263
|
+
* @evidence contracts/common.md#clear-and-simple-design Resolver proof and artifact-input validation retain their separate owners in one ordered predicate.
|
|
264
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Unavailable or invalid proof requires relookup; no partial inventory substitutes for SDK authority.
|
|
265
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes off-thread discovery from this consumer's independent artifact inputs.
|
|
266
|
+
* @evidence contracts/performance.md#efficient-algorithms The owner validates discovery once and fingerprintInputs hashes each declared file and directory inventory, scaling with declared entries and bytes.
|
|
267
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Only this exact publication's current proof plus unchanged artifact inputs authorizes reuse, including resolved absence.
|
|
268
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This predicate borrows the session-owned publication and acquires no lasting proof or process.
|
|
269
|
+
* @evidence contracts/portability.md#os-neutral-implementation SDK process observation remains with its owner and artifact checks use Node native filesystem APIs.
|
|
270
|
+
*/
|
|
271
|
+
async function artifactsAreStaleResident(published, options = {}) {
|
|
272
|
+
options.signal?.throwIfAborted();
|
|
273
|
+
if (published.discovery.status !== "resolved")
|
|
274
|
+
return true;
|
|
275
|
+
const current = await published.discovery.isCurrent(options);
|
|
276
|
+
options.signal?.throwIfAborted();
|
|
277
|
+
if (!current)
|
|
278
|
+
return true;
|
|
279
|
+
return artifactInputsAreStale(published);
|
|
280
|
+
}
|
|
281
|
+
function artifactInputsAreStale(published) {
|
|
154
282
|
// The written set is one of its own inputs, by existence alone. It lives in
|
|
155
283
|
// the system temp directory, which is swept on a schedule this session has no
|
|
156
284
|
// say in, and the server is handed the path on every request — so once it is
|
|
@@ -169,18 +297,12 @@ function artifactsAreStale(published) {
|
|
|
169
297
|
* The answer for a project that publishes nothing, and what to watch so that
|
|
170
298
|
* answer can change.
|
|
171
299
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* samchon/ttsc#1276 is about — and paying that per request to learn nothing
|
|
177
|
-
* would be worse than the staleness it prevents.
|
|
178
|
-
*
|
|
179
|
-
* Bounded, and deliberately: a tsconfig that inherits its plugins from an
|
|
180
|
-
* extended config is not tracked here, because naming the whole extends chain
|
|
181
|
-
* means asking the loader that is itself the expense.
|
|
300
|
+
* The direct config and package manifest are useful provenance, but do not
|
|
301
|
+
* cover inherited configuration or dependency installation. The attached owning
|
|
302
|
+
* discovery proof supplies that independent authority; direct paths do not
|
|
303
|
+
* stand in for it.
|
|
182
304
|
*/
|
|
183
|
-
function unpublished(options) {
|
|
305
|
+
function unpublished(options, discovery) {
|
|
184
306
|
const inputs = {
|
|
185
307
|
directories: [],
|
|
186
308
|
files: [
|
|
@@ -188,7 +310,12 @@ function unpublished(options) {
|
|
|
188
310
|
node_path_1.default.resolve(options.cwd, "package.json"),
|
|
189
311
|
],
|
|
190
312
|
};
|
|
191
|
-
return {
|
|
313
|
+
return {
|
|
314
|
+
file: null,
|
|
315
|
+
fingerprint: fingerprintInputs(inputs),
|
|
316
|
+
inputs,
|
|
317
|
+
discovery,
|
|
318
|
+
};
|
|
192
319
|
}
|
|
193
320
|
/**
|
|
194
321
|
* What each sidecar said its rules read, as one watch list.
|
|
@@ -260,14 +387,26 @@ function readInputs(outputs, options) {
|
|
|
260
387
|
* Two readings have to be right here, and both are cheap to get wrong. A
|
|
261
388
|
* pattern carrying no wildcard is a path, not a tree: watching its parent
|
|
262
389
|
* instead would state every sibling on every request to learn about the one
|
|
263
|
-
* file that was declared.
|
|
264
|
-
*
|
|
265
|
-
*
|
|
390
|
+
* file that was declared. A bare filename wildcard stays shallow; globstar or a
|
|
391
|
+
* wildcard directory component requires descent from the fixed prefix.
|
|
392
|
+
*
|
|
393
|
+
* @evidence contracts/common.md#principled-implementation Literal paths remain individual inputs; wildcard paths use their fixed directory prefix and descend when remaining path components can contain matched files.
|
|
394
|
+
* @evidence contracts/common.md#clear-and-simple-design A single fixed-prefix calculation and descent decision produce the directory descriptor consumed by fingerprinting.
|
|
395
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Descent is not inferred solely from globstar, which would miss wildcard directory components followed by a filename.
|
|
396
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose documents literal paths, bare wildcards and wildcard-directory descent.
|
|
397
|
+
* @evidence contracts/performance.md#efficient-algorithms Pattern scanning is linear in pattern length and avoids directory traversal at selection time; a bare filename wildcard keeps the walk shallow.
|
|
398
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This pure descriptor calculation has no cross-request producer or validation coordinator; publication owns reuse.
|
|
399
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned descriptor transfers to its caller and owns no handle or retained task.
|
|
400
|
+
* @evidence contracts/portability.md#os-neutral-implementation Both slash forms are recognized at the native-path boundary and relative roots resolve through Node path APIs.
|
|
266
401
|
*/
|
|
267
402
|
function watchedBy(pattern, cwd) {
|
|
268
403
|
if (pattern.search(GLOB_MAGIC) < 0)
|
|
269
404
|
return null;
|
|
270
|
-
|
|
405
|
+
const magic = pattern.search(GLOB_MAGIC);
|
|
406
|
+
return {
|
|
407
|
+
path: globRoot(pattern, cwd),
|
|
408
|
+
recursive: pattern.includes("**") || /[/\\]/u.test(pattern.slice(magic)),
|
|
409
|
+
};
|
|
271
410
|
}
|
|
272
411
|
/**
|
|
273
412
|
* The project identity flag, for a plugin whose descriptor asks for one.
|
|
@@ -310,37 +449,67 @@ function absolute(target, cwd) {
|
|
|
310
449
|
/**
|
|
311
450
|
* The state of every input, as one comparable string.
|
|
312
451
|
*
|
|
313
|
-
* Files are
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
452
|
+
* Files are hashed by content so same-size edits with restored modification
|
|
453
|
+
* times remain observable. Directory membership is walked conservatively from
|
|
454
|
+
* declared roots; matching remains the sidecar's responsibility.
|
|
455
|
+
*
|
|
456
|
+
* @evidence contracts/common.md#principled-implementation The fingerprint includes input paths and regular-file bytes; sorted records make enumeration order irrelevant while missing paths retain an explicit marker.
|
|
457
|
+
* @evidence contracts/common.md#clear-and-simple-design File state and conservative directory traversal share one record representation before the final digest.
|
|
458
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Metadata equality, hidden-directory skipping and arbitrary depth limits do not stand in for declared input identity.
|
|
459
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states content hashing, conservative membership and sidecar ownership of actual matching.
|
|
460
|
+
* @evidence contracts/performance.md#efficient-algorithms Cost is linear in watched regular-file bytes plus O(N log N) record sorting; broad recursive globs conservatively over-read and may invalidate unrelated edits.
|
|
461
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This computes one validation identity; the session compares it with the publication snapshot and decides reuse.
|
|
462
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Synchronous reads close their descriptors internally, and the record array exists only for this computation; no historical fingerprint state is retained here.
|
|
463
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native stat, read and directory APIs handle platform paths; NUL-separated fields prevent filename ambiguity without shell serialization.
|
|
318
464
|
*/
|
|
319
465
|
function fingerprintInputs(inputs) {
|
|
320
466
|
const parts = [];
|
|
467
|
+
const states = new Map();
|
|
321
468
|
for (const file of inputs.files)
|
|
322
|
-
parts.push(stateOf(file));
|
|
469
|
+
parts.push(stateOf(file, states));
|
|
323
470
|
for (const directory of inputs.directories)
|
|
324
|
-
|
|
471
|
+
for (const entryToAppend of walkState(directory.path, directory.recursive, states))
|
|
472
|
+
parts.push(entryToAppend);
|
|
325
473
|
parts.sort();
|
|
326
474
|
return (0, node_crypto_1.createHash)("sha256").update(parts.join("\n")).digest("hex");
|
|
327
475
|
}
|
|
328
476
|
/**
|
|
329
|
-
* A
|
|
477
|
+
* A regular file's content identity, physical directory identity, or absence.
|
|
330
478
|
*
|
|
331
479
|
* The fields are joined on a character a path cannot contain. Separated by a
|
|
332
480
|
* space, a file literally named `a 1 2` states the same string as a one-byte
|
|
333
481
|
* file named `a`, and an edit to either would then read as no edit at all.
|
|
334
482
|
*/
|
|
335
|
-
function stateOf(file) {
|
|
483
|
+
function stateOf(file, states) {
|
|
484
|
+
const existing = states.get(file);
|
|
485
|
+
if (existing !== undefined)
|
|
486
|
+
return existing;
|
|
336
487
|
try {
|
|
337
488
|
const stat = node_fs_1.default.statSync(file);
|
|
338
|
-
|
|
489
|
+
const identity = stat.isFile()
|
|
490
|
+
? (0, node_crypto_1.createHash)("sha256").update(node_fs_1.default.readFileSync(file)).digest("hex")
|
|
491
|
+
: stat.isDirectory()
|
|
492
|
+
? ["directory", node_fs_1.default.realpathSync.native(file)].join(SEPARATOR)
|
|
493
|
+
: ["other", String(stat.size), String(stat.mtimeMs)].join(SEPARATOR);
|
|
494
|
+
const state = [file, identity].join(SEPARATOR);
|
|
495
|
+
states.set(file, state);
|
|
496
|
+
return state;
|
|
339
497
|
}
|
|
340
|
-
catch {
|
|
341
|
-
|
|
498
|
+
catch (error) {
|
|
499
|
+
if (!missingPath(error))
|
|
500
|
+
throw error;
|
|
501
|
+
const state = [file, "absent"].join(SEPARATOR);
|
|
502
|
+
states.set(file, state);
|
|
503
|
+
return state;
|
|
342
504
|
}
|
|
343
505
|
}
|
|
506
|
+
/** Missing paths are inputs; unreadable existing inputs are failures. */
|
|
507
|
+
function missingPath(error) {
|
|
508
|
+
return (typeof error === "object" &&
|
|
509
|
+
error !== null &&
|
|
510
|
+
"code" in error &&
|
|
511
|
+
(error.code === "ENOENT" || error.code === "ENOTDIR"));
|
|
512
|
+
}
|
|
344
513
|
/**
|
|
345
514
|
* The character that joins fields a path could otherwise forge.
|
|
346
515
|
*
|
|
@@ -360,43 +529,60 @@ function globRoot(pattern, cwd) {
|
|
|
360
529
|
const magic = pattern.search(GLOB_MAGIC);
|
|
361
530
|
const head = magic < 0 ? pattern : pattern.slice(0, magic);
|
|
362
531
|
const slash = Math.max(head.lastIndexOf("/"), head.lastIndexOf("\\"));
|
|
363
|
-
const root = slash < 0
|
|
532
|
+
const root = slash < 0
|
|
533
|
+
? ""
|
|
534
|
+
: head.slice(0, Math.max(slash, node_path_1.default.parse(head).root.length));
|
|
364
535
|
return root === "" ? cwd : absolute(root, cwd);
|
|
365
536
|
}
|
|
366
537
|
/**
|
|
367
538
|
* Every entry below `directory`, stated.
|
|
368
539
|
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* directories are skipped below the declared root, which is what the glob that
|
|
373
|
-
* named it would have matched anyway.
|
|
540
|
+
* Descent follows the declared pattern rather than a guessed maximum depth or
|
|
541
|
+
* excluded directory name. Symlink directories are followed with a physical
|
|
542
|
+
* ancestor set so their declared contents are watched without creating cycles.
|
|
374
543
|
*
|
|
375
544
|
* A directory that does not exist states itself absent, which is what notices
|
|
376
545
|
* one being created.
|
|
377
546
|
*/
|
|
378
|
-
function walkState(directory, recursive,
|
|
379
|
-
if (depth > 12)
|
|
380
|
-
return [];
|
|
547
|
+
function walkState(directory, recursive, inputStates, ancestors = new Set()) {
|
|
381
548
|
let entries;
|
|
549
|
+
let physical;
|
|
382
550
|
try {
|
|
551
|
+
physical = node_fs_1.default.realpathSync.native(directory);
|
|
552
|
+
if (ancestors.has(physical))
|
|
553
|
+
return [stateOf(directory, inputStates)];
|
|
383
554
|
entries = node_fs_1.default.readdirSync(directory, { withFileTypes: true });
|
|
384
555
|
}
|
|
385
|
-
catch {
|
|
386
|
-
|
|
556
|
+
catch (error) {
|
|
557
|
+
if (!missingPath(error))
|
|
558
|
+
throw error;
|
|
559
|
+
return [stateOf(directory, inputStates)];
|
|
387
560
|
}
|
|
561
|
+
const nextAncestors = new Set(ancestors);
|
|
562
|
+
nextAncestors.add(physical);
|
|
388
563
|
const states = [];
|
|
389
564
|
for (const entry of entries) {
|
|
390
565
|
const child = node_path_1.default.join(directory, entry.name);
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
566
|
+
let directoryEntry = entry.isDirectory();
|
|
567
|
+
if (entry.isSymbolicLink()) {
|
|
568
|
+
try {
|
|
569
|
+
directoryEntry = node_fs_1.default.statSync(child).isDirectory();
|
|
570
|
+
}
|
|
571
|
+
catch (error) {
|
|
572
|
+
if (!missingPath(error))
|
|
573
|
+
throw error;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (directoryEntry) {
|
|
577
|
+
if (!recursive) {
|
|
578
|
+
states.push(stateOf(child, inputStates));
|
|
395
579
|
continue;
|
|
396
|
-
|
|
580
|
+
}
|
|
581
|
+
for (const entryToAppend of walkState(child, recursive, inputStates, nextAncestors))
|
|
582
|
+
states.push(entryToAppend);
|
|
397
583
|
continue;
|
|
398
584
|
}
|
|
399
|
-
states.push(stateOf(child));
|
|
585
|
+
states.push(stateOf(child, inputStates));
|
|
400
586
|
}
|
|
401
587
|
return states;
|
|
402
588
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishedArtifacts.js","sourceRoot":"","sources":["../../src/model/publishedArtifacts.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2DAA+C;AAC/C,6CAAyC;AACzC,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAC7B,+BAA4E;AAwF5E,0BAAiC,OAGhC;IACC,MAAM,OAAO,GAAG,IAAA,+BAAwB,EAAC;QACvC,UAAU,EAAE,YAAY;QACxB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IACtD,6EAA6E;IAC7E,2EAA2E;IAC3E,8EAA8E;IAC9E,8EAA8E;IAC9E,2EAA2E;IAC3E,qEAAqE;IACrE,6DAA6D;IAC7D,MAAM,MAAM,GAAG,UAAU,CACvB,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,EACnE,OAAO,CACR,CAAC;IACF,OAAO,QAAQ,CACb,OAAO,EACP,MAAM,EACN,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CACjE,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACI,KAAK,mCACV,OAA0C,EAC1C,MAAqE;IAErE,MAAM,OAAO,GAAG,IAAA,+BAAwB,EAAC;QACvC,UAAU,EAAE,YAAY;QACxB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CA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AK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,cAAc,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,cAAc,GAAG,iBAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YACpD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;oBAAE,MAAM,KAAK,CAAC;YACvC,CAAC;QACH,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;gBACzC,SAAS;YACX,CAAC;YACD,KAAK,MAAM,aAAa,IAAI,SAAS,CACnC,KAAK,EACL,SAAS,EACT,WAAW,EACX,aAAa,CACd;gBACC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC7B,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CapturedProcessOutput } from "./CapturedProcessOutput";
|
|
1
2
|
/**
|
|
2
3
|
* Ensure a resolved native binary can be executed on POSIX installs.
|
|
3
4
|
*
|
|
@@ -5,16 +6,17 @@
|
|
|
5
6
|
* package binaries without executable bits. The ttsc launcher already repairs
|
|
6
7
|
* its native helper before spawning; @ttsc/graph has its own ttscgraph spawn
|
|
7
8
|
* paths, so it must apply the same first-run repair here.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation POSIX executable access is checked before preserving existing permission bits and adding the required execution permissions.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design This helper owns the native permission boundary for all graph spawn lanes.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Permission repair addresses supported package installation differences; failures still reach the original spawn path.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain the package-manager condition and why graph must apply its own spawn-boundary repair.
|
|
14
|
+
* @evidence contracts/performance.md#efficient-algorithms Permission repair uses constant-count access/stat/chmod operations without reading binary contents or scanning directories.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Permission is an effectful spawn precondition, not a completed producer result shared across requests.
|
|
16
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This precondition retains no handle, task or historical entry after synchronous filesystem calls.
|
|
17
|
+
* @evidence contracts/portability.md#os-neutral-implementation Windows has no POSIX executable-bit requirement; other hosts use filesystem access and mode APIs rather than path spelling assumptions.
|
|
8
18
|
*/
|
|
9
19
|
export declare function ensureExecutable(binary: string): void;
|
|
10
|
-
export interface CapturedProcessOutput {
|
|
11
|
-
/** Close the descriptors and remove the backing files. */
|
|
12
|
-
dispose(): void;
|
|
13
|
-
/** Read one stream's text. */
|
|
14
|
-
read(stream: "stdout" | "stderr"): string;
|
|
15
|
-
stderrFd: number;
|
|
16
|
-
stdoutFd: number;
|
|
17
|
-
}
|
|
18
20
|
/**
|
|
19
21
|
* A pair of temporary files standing in for a child process's pipes.
|
|
20
22
|
*
|
|
@@ -27,5 +29,14 @@ export interface CapturedProcessOutput {
|
|
|
27
29
|
* the same answer everywhere. Reading the result back still materializes a
|
|
28
30
|
* string, so V8's own maximum string length remains the outer bound — a
|
|
29
31
|
* property of the runtime rather than a budget chosen here.
|
|
32
|
+
*
|
|
33
|
+
* @evidence contracts/common.md#principled-implementation Passing file descriptors avoids spawnSync's pipe-buffer limit while later UTF-8 reads preserve each output channel.
|
|
34
|
+
* @evidence contracts/common.md#clear-and-simple-design One factory transfers descriptor and directory ownership through a read/dispose handle; private helpers isolate cleanup.
|
|
35
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The capture uses supported spawn descriptors rather than patching child_process or imposing repository-sized output limits.
|
|
36
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain file capture, heap materialization and the runtime string-length boundary; the handle documents caller disposal.
|
|
37
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native fs descriptors and path.join operate on every host; storage is created beneath the resolved physical system-temp directory.
|
|
38
|
+
* @evidence contracts/performance.md#efficient-algorithms Capturing writes directly to files; reading costs linear output bytes and materializes one stream string, with no pipe-buffer copy in this heap.
|
|
39
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Stdout and stderr are distinct effectful streams from one child invocation; reruns require new storage and cannot reuse a prior result.
|
|
40
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The returned owner disposes two descriptors and one directory; acquisition failure unwinds acquired storage and removal is best effort when foreign handles remain open.
|
|
30
41
|
*/
|
|
31
42
|
export declare function captureProcessOutput(): CapturedProcessOutput;
|