@opensip-cli/graph 0.1.4 → 0.1.6
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 +2 -2
- package/dist/__tests__/cli/graph-config.test.js +5 -3
- package/dist/__tests__/cli/graph-config.test.js.map +1 -1
- package/dist/__tests__/tool-branches.test.js +4 -1
- package/dist/__tests__/tool-branches.test.js.map +1 -1
- package/dist/cli/__tests__/graph-command-plan.test.d.ts +2 -0
- package/dist/cli/__tests__/graph-command-plan.test.d.ts.map +1 -0
- package/dist/cli/__tests__/graph-command-plan.test.js +46 -0
- package/dist/cli/__tests__/graph-command-plan.test.js.map +1 -0
- package/dist/cli/graph-command-plan.d.ts +23 -0
- package/dist/cli/graph-command-plan.d.ts.map +1 -0
- package/dist/cli/graph-command-plan.js +43 -0
- package/dist/cli/graph-command-plan.js.map +1 -0
- package/dist/cli/graph-config.d.ts.map +1 -1
- package/dist/cli/graph-config.js +20 -1
- package/dist/cli/graph-config.js.map +1 -1
- package/dist/cli/graph-feature-columns.d.ts +7 -0
- package/dist/cli/graph-feature-columns.d.ts.map +1 -0
- package/dist/cli/graph-feature-columns.js +10 -0
- package/dist/cli/graph-feature-columns.js.map +1 -0
- package/dist/cli/graph-multi-path-mode.d.ts +24 -0
- package/dist/cli/graph-multi-path-mode.d.ts.map +1 -0
- package/dist/cli/graph-multi-path-mode.js +64 -0
- package/dist/cli/graph-multi-path-mode.js.map +1 -0
- package/dist/cli/graph-run-outcome.d.ts +12 -0
- package/dist/cli/graph-run-outcome.d.ts.map +1 -0
- package/dist/cli/graph-run-outcome.js +2 -0
- package/dist/cli/graph-run-outcome.js.map +1 -0
- package/dist/cli/graph-session-contribution.d.ts +29 -0
- package/dist/cli/graph-session-contribution.d.ts.map +1 -0
- package/dist/cli/graph-session-contribution.js +58 -0
- package/dist/cli/graph-session-contribution.js.map +1 -0
- package/dist/cli/graph-sharded-engine.d.ts +77 -0
- package/dist/cli/graph-sharded-engine.d.ts.map +1 -0
- package/dist/cli/graph-sharded-engine.js +229 -0
- package/dist/cli/graph-sharded-engine.js.map +1 -0
- package/dist/cli/graph-single-run-mode.d.ts +23 -0
- package/dist/cli/graph-single-run-mode.d.ts.map +1 -0
- package/dist/cli/graph-single-run-mode.js +107 -0
- package/dist/cli/graph-single-run-mode.js.map +1 -0
- package/dist/cli/graph-workspace-mode.d.ts +11 -0
- package/dist/cli/graph-workspace-mode.d.ts.map +1 -0
- package/dist/cli/graph-workspace-mode.js +87 -0
- package/dist/cli/graph-workspace-mode.js.map +1 -0
- package/dist/cli/graph.d.ts +7 -131
- package/dist/cli/graph.d.ts.map +1 -1
- package/dist/cli/graph.js +18 -681
- package/dist/cli/graph.js.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type LiveGraphOutput } from './graph-report.js';
|
|
2
|
+
import type { GraphCommandOptions } from './graph-options.js';
|
|
3
|
+
import type { Shard } from './orchestrate/shard-model.js';
|
|
4
|
+
import type { GraphProgressCallback, RunGraphResult } from './orchestrate.js';
|
|
5
|
+
import type { GraphProfileRunRecorder } from './profile.js';
|
|
6
|
+
import type { GraphConfig, ResolutionMode, Rule } from '../types.js';
|
|
7
|
+
import type { ToolCliContext } from '@opensip-cli/core';
|
|
8
|
+
import type { DataStore } from '@opensip-cli/datastore';
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a path to absolute (a relative input resolves against `base`, not
|
|
11
|
+
* necessarily `process.cwd()`), then realpath it so exact and sharded engines see
|
|
12
|
+
* one canonical run root. Falls back to the absolute path when realpath fails.
|
|
13
|
+
*/
|
|
14
|
+
export declare function realpathOrSelf(input: string, base: string): string;
|
|
15
|
+
/** Shard resolution plus optional synthetic-partition timing. */
|
|
16
|
+
export interface ShardResolution {
|
|
17
|
+
readonly shards: Shard[];
|
|
18
|
+
readonly partition?: {
|
|
19
|
+
readonly durationMs: number;
|
|
20
|
+
readonly detail: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Engine-selection policy (ADR-0033, superseding ADR-0032/0031). The sharded
|
|
25
|
+
* engine is the default when the project can actually shard; exact is selected
|
|
26
|
+
* for `--exact`, positional runs, or non-shardable projects.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveEngineShards(opts: GraphCommandOptions, cli: ToolCliContext, positionalPaths: readonly string[]): Promise<ShardResolution>;
|
|
29
|
+
/** Human-readable explanation for the graph engine observability event. */
|
|
30
|
+
export declare function engineSelectionReason(opts: GraphCommandOptions, positionalPaths: readonly string[], sharded: boolean): string;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a project's shard set the same way a production `graph` run does,
|
|
33
|
+
* exposed for the real-repo equivalence guardrail.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveShardsForCwd(cwd: string, cliScript: string, cli: ToolCliContext): Promise<readonly Shard[]>;
|
|
36
|
+
/** Inputs the sharded build path threads from `executeGraph`. */
|
|
37
|
+
export interface ShardedBuildContext {
|
|
38
|
+
readonly opts: GraphCommandOptions;
|
|
39
|
+
readonly shards: readonly Shard[];
|
|
40
|
+
readonly projectRoot: string;
|
|
41
|
+
readonly cli: ToolCliContext;
|
|
42
|
+
readonly config: GraphConfig;
|
|
43
|
+
readonly rules: readonly Rule[];
|
|
44
|
+
readonly onProgress?: GraphProgressCallback;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Run a sharded build and record its wall-clock stage in the optional graph
|
|
48
|
+
* profile. The build result is unchanged; this helper only centralizes timing
|
|
49
|
+
* so the main command handler does not own sharded profiling mechanics.
|
|
50
|
+
*/
|
|
51
|
+
export declare function runProfiledShardedBuild(profileRun: GraphProfileRunRecorder | undefined, ctx: ShardedBuildContext): Promise<RunGraphResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Serializable live-build request handed from the interactive runner to the
|
|
54
|
+
* graph engine. Mirrors the subset of GraphCommandOptions the live view needs.
|
|
55
|
+
*/
|
|
56
|
+
export interface GraphLiveBuildArgs {
|
|
57
|
+
readonly cwd: string;
|
|
58
|
+
readonly noCache?: boolean;
|
|
59
|
+
readonly resolution?: ResolutionMode;
|
|
60
|
+
readonly exact?: boolean;
|
|
61
|
+
readonly config?: GraphConfig;
|
|
62
|
+
readonly rules?: readonly Rule[];
|
|
63
|
+
readonly cliScript?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the live runner's build engine with the same shardability policy the
|
|
67
|
+
* static `graph` command uses. The live UI consumes the returned shard list to
|
|
68
|
+
* choose exact vs. sharded worker execution.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveLiveEngineShards(args: GraphLiveBuildArgs, cli: ToolCliContext): Promise<Shard[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Execute a sharded graph build for the interactive/live runner and reduce the
|
|
73
|
+
* result to the serializable `LiveGraphOutput` shape consumed by Ink and worker
|
|
74
|
+
* transports.
|
|
75
|
+
*/
|
|
76
|
+
export declare function runShardedLiveBuild(args: GraphLiveBuildArgs, shards: readonly Shard[], datastore: DataStore | undefined, onProgress: GraphProgressCallback): Promise<LiveGraphOutput>;
|
|
77
|
+
//# sourceMappingURL=graph-sharded-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-sharded-engine.d.ts","sourceRoot":"","sources":["../../src/cli/graph-sharded-engine.ts"],"names":[],"mappings":"AAQA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAY/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAqB,cAAc,EAAE,IAAI,EA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E,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,qBAAqB,CAAC;CAC7C;AA+BD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,uBAAuB,GAAG,SAAS,EAC/C,GAAG,EAAE,mBAAmB,GACvB,OAAO,CAAC,cAAc,CAAC,CAYzB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,KAAK,EAAE,CAAC,CAUlB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,eAAe,CAAC,CAuB1B"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { realpathSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { pickAdapter } from '../lang-adapter/registry.js';
|
|
4
|
+
import { CatalogRepo } from '../persistence/catalog-repo.js';
|
|
5
|
+
import { currentRules } from '../rules/registry.js';
|
|
6
|
+
import { DASHBOARD_FEATURE_COLUMNS } from './graph-feature-columns.js';
|
|
7
|
+
import { buildLiveGraphOutput } from './graph-report.js';
|
|
8
|
+
import { resolveCanonicalFileSet } from './orchestrate/canonical-file-set.js';
|
|
9
|
+
import { detectMonorepoLayout, partitionFlatRepo, selectStrategyForLayout, } from './orchestrate/flat-monorepo-strategy.js';
|
|
10
|
+
import { partitionFilesIntoShards } from './orchestrate/partition-files.js';
|
|
11
|
+
import { loadGraphConfig, runShardedGraph } from './orchestrate.js';
|
|
12
|
+
import { resolveAdaptersForRun } from './resolve-adapters.js';
|
|
13
|
+
import { discoverPolyglotUnits } from './workspace-runner.js';
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a path to absolute (a relative input resolves against `base`, not
|
|
16
|
+
* necessarily `process.cwd()`), then realpath it so exact and sharded engines see
|
|
17
|
+
* one canonical run root. Falls back to the absolute path when realpath fails.
|
|
18
|
+
*/
|
|
19
|
+
export function realpathOrSelf(input, base) {
|
|
20
|
+
const absolute = resolve(base, input);
|
|
21
|
+
try {
|
|
22
|
+
return realpathSync(absolute);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
/* v8 ignore next */
|
|
26
|
+
return absolute;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Engine-selection policy (ADR-0033, superseding ADR-0032/0031). The sharded
|
|
31
|
+
* engine is the default when the project can actually shard; exact is selected
|
|
32
|
+
* for `--exact`, positional runs, or non-shardable projects.
|
|
33
|
+
*/
|
|
34
|
+
export async function resolveEngineShards(opts, cli, positionalPaths) {
|
|
35
|
+
if (opts.exact === true)
|
|
36
|
+
return { shards: [] };
|
|
37
|
+
if (positionalPaths.length > 0)
|
|
38
|
+
return { shards: [] };
|
|
39
|
+
return resolveShards(opts, cli);
|
|
40
|
+
}
|
|
41
|
+
/** Human-readable explanation for the graph engine observability event. */
|
|
42
|
+
export function engineSelectionReason(opts, positionalPaths, sharded) {
|
|
43
|
+
if (sharded)
|
|
44
|
+
return 'sharded-default';
|
|
45
|
+
if (opts.exact === true)
|
|
46
|
+
return 'exact-opt-out';
|
|
47
|
+
if (positionalPaths.length > 0)
|
|
48
|
+
return 'exact-positional-paths';
|
|
49
|
+
return 'exact-not-shardable';
|
|
50
|
+
}
|
|
51
|
+
async function resolveShards(opts, cli) {
|
|
52
|
+
const cliScript = opts.cliScript ?? process.argv[1];
|
|
53
|
+
if (typeof cliScript !== 'string' || cliScript.length === 0)
|
|
54
|
+
return { shards: [] };
|
|
55
|
+
let units;
|
|
56
|
+
try {
|
|
57
|
+
units = await discoverPolyglotUnits(opts.cwd, resolveAdaptersForRun(opts, cli));
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
/* v8 ignore next */
|
|
61
|
+
return resolveSyntheticFlatShards(opts);
|
|
62
|
+
}
|
|
63
|
+
if (units.length <= 1)
|
|
64
|
+
return resolveSyntheticFlatShards(opts);
|
|
65
|
+
const adapter = pickAdapter(opts.cwd);
|
|
66
|
+
let rootDiscovery;
|
|
67
|
+
try {
|
|
68
|
+
rootDiscovery = adapter.discoverFiles({ cwd: opts.cwd });
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
/* v8 ignore next */
|
|
72
|
+
return resolveSyntheticFlatShards(opts);
|
|
73
|
+
}
|
|
74
|
+
const canonicalFiles = resolveCanonicalFileSet(rootDiscovery.files);
|
|
75
|
+
const shards = partitionFilesIntoShards({
|
|
76
|
+
canonicalFiles,
|
|
77
|
+
units: units.map((u) => ({
|
|
78
|
+
id: u.id,
|
|
79
|
+
rootDir: u.rootDir,
|
|
80
|
+
...(u.configPath === undefined ? {} : { configPathAbs: u.configPath }),
|
|
81
|
+
})),
|
|
82
|
+
projectRoot: rootDiscovery.projectDirAbs,
|
|
83
|
+
rootConfigPathAbs: rootDiscovery.configPathAbs,
|
|
84
|
+
});
|
|
85
|
+
if (shards.length > 1)
|
|
86
|
+
return { shards };
|
|
87
|
+
return resolveSyntheticFlatShards(opts);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Resolve a project's shard set the same way a production `graph` run does,
|
|
91
|
+
* exposed for the real-repo equivalence guardrail.
|
|
92
|
+
*/
|
|
93
|
+
export async function resolveShardsForCwd(cwd, cliScript, cli) {
|
|
94
|
+
const resolution = await resolveShards({ cwd, cliScript, noCache: true }, cli);
|
|
95
|
+
return resolution.shards;
|
|
96
|
+
}
|
|
97
|
+
function resolveSyntheticFlatShards(opts) {
|
|
98
|
+
if (typeof opts.language === 'string' && opts.language.length > 0)
|
|
99
|
+
return { shards: [] };
|
|
100
|
+
const adapter = pickAdapter(opts.cwd);
|
|
101
|
+
if (adapter.id !== 'typescript')
|
|
102
|
+
return { shards: [] };
|
|
103
|
+
let discovery;
|
|
104
|
+
try {
|
|
105
|
+
discovery = adapter.discoverFiles({ cwd: opts.cwd });
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return { shards: [] };
|
|
109
|
+
}
|
|
110
|
+
const canonicalFiles = resolveCanonicalFileSet(discovery.files);
|
|
111
|
+
const partitionStart = Date.now();
|
|
112
|
+
const layout = detectMonorepoLayout({
|
|
113
|
+
repoRoot: discovery.projectDirAbs,
|
|
114
|
+
files: canonicalFiles,
|
|
115
|
+
});
|
|
116
|
+
const selection = selectStrategyForLayout(layout);
|
|
117
|
+
if (layout.kind !== 'flat-large' || selection.mode !== 'synthetic-partition') {
|
|
118
|
+
return { shards: [] };
|
|
119
|
+
}
|
|
120
|
+
const graphConfig = loadGraphConfig(opts.cwd);
|
|
121
|
+
const strategy = graphConfig.partitionStrategy ?? selection.partitionStrategy ?? 'hybrid';
|
|
122
|
+
const partitions = partitionFlatRepo({
|
|
123
|
+
files: layout.files,
|
|
124
|
+
repoRoot: discovery.projectDirAbs,
|
|
125
|
+
strategy,
|
|
126
|
+
});
|
|
127
|
+
const shards = partitions
|
|
128
|
+
.filter((p) => p.files.length > 0)
|
|
129
|
+
.map((p) => ({
|
|
130
|
+
id: `partition:${p.id}`,
|
|
131
|
+
rootDir: discovery.projectDirAbs,
|
|
132
|
+
files: p.files,
|
|
133
|
+
configPathAbs: discovery.configPathAbs,
|
|
134
|
+
}));
|
|
135
|
+
if (shards.length <= 1)
|
|
136
|
+
return { shards: [] };
|
|
137
|
+
return {
|
|
138
|
+
shards,
|
|
139
|
+
partition: {
|
|
140
|
+
durationMs: Date.now() - partitionStart,
|
|
141
|
+
detail: `${strategy}: ${String(shards.length)} partition(s)`,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
async function runShardedBuild(ctx) {
|
|
146
|
+
const { opts, shards, projectRoot, cli, config, rules } = ctx;
|
|
147
|
+
const datastore = cli.scope.datastore();
|
|
148
|
+
const sharded = await runShardedGraph({
|
|
149
|
+
shards,
|
|
150
|
+
projectRoot,
|
|
151
|
+
cliScript: opts.cliScript ?? process.argv[1] ?? '',
|
|
152
|
+
adapter: pickAdapter(projectRoot, opts.language),
|
|
153
|
+
resolutionMode: opts.resolution ?? 'exact',
|
|
154
|
+
concurrency: opts.concurrency,
|
|
155
|
+
useCache: opts.noCache !== true,
|
|
156
|
+
config,
|
|
157
|
+
rules,
|
|
158
|
+
catalogRepo: datastore ? new CatalogRepo(datastore) : null,
|
|
159
|
+
emitFeatures: DASHBOARD_FEATURE_COLUMNS,
|
|
160
|
+
...(ctx.onProgress === undefined ? {} : { onProgress: ctx.onProgress }),
|
|
161
|
+
...(opts.language === undefined ? {} : { language: opts.language }),
|
|
162
|
+
});
|
|
163
|
+
return {
|
|
164
|
+
catalog: sharded.catalog,
|
|
165
|
+
indexes: sharded.indexes,
|
|
166
|
+
signals: sharded.signals,
|
|
167
|
+
resolutionStats: sharded.resolutionStats,
|
|
168
|
+
cacheHit: sharded.cacheHit,
|
|
169
|
+
features: sharded.features,
|
|
170
|
+
shardStats: sharded.shardStats,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Run a sharded build and record its wall-clock stage in the optional graph
|
|
175
|
+
* profile. The build result is unchanged; this helper only centralizes timing
|
|
176
|
+
* so the main command handler does not own sharded profiling mechanics.
|
|
177
|
+
*/
|
|
178
|
+
export async function runProfiledShardedBuild(profileRun, ctx) {
|
|
179
|
+
const started = Date.now();
|
|
180
|
+
const result = await runShardedBuild(ctx);
|
|
181
|
+
if (profileRun !== undefined) {
|
|
182
|
+
// @fitness-ignore-next-line detached-promises -- GraphProfileRunRecorder.recordStage is synchronous timing bookkeeping, not a promise-returning call.
|
|
183
|
+
profileRun.recordStage('sharded-build', Date.now() - started, `${String(ctx.shards.length)} shard(s)`);
|
|
184
|
+
}
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Resolve the live runner's build engine with the same shardability policy the
|
|
189
|
+
* static `graph` command uses. The live UI consumes the returned shard list to
|
|
190
|
+
* choose exact vs. sharded worker execution.
|
|
191
|
+
*/
|
|
192
|
+
export async function resolveLiveEngineShards(args, cli) {
|
|
193
|
+
const opts = {
|
|
194
|
+
cwd: args.cwd,
|
|
195
|
+
noCache: args.noCache,
|
|
196
|
+
resolution: args.resolution,
|
|
197
|
+
exact: args.exact,
|
|
198
|
+
...(args.cliScript === undefined ? {} : { cliScript: args.cliScript }),
|
|
199
|
+
};
|
|
200
|
+
const resolution = await resolveEngineShards(opts, cli, []);
|
|
201
|
+
return resolution.shards;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Execute a sharded graph build for the interactive/live runner and reduce the
|
|
205
|
+
* result to the serializable `LiveGraphOutput` shape consumed by Ink and worker
|
|
206
|
+
* transports.
|
|
207
|
+
*/
|
|
208
|
+
export async function runShardedLiveBuild(args, shards, datastore, onProgress) {
|
|
209
|
+
const result = await runShardedGraph({
|
|
210
|
+
shards,
|
|
211
|
+
projectRoot: args.cwd,
|
|
212
|
+
cliScript: args.cliScript ?? process.argv[1] ?? '',
|
|
213
|
+
adapter: pickAdapter(args.cwd),
|
|
214
|
+
resolutionMode: args.resolution ?? 'exact',
|
|
215
|
+
useCache: args.noCache !== true,
|
|
216
|
+
config: args.config ?? {},
|
|
217
|
+
rules: args.rules ?? currentRules(),
|
|
218
|
+
catalogRepo: datastore ? new CatalogRepo(datastore) : null,
|
|
219
|
+
emitFeatures: DASHBOARD_FEATURE_COLUMNS,
|
|
220
|
+
onProgress,
|
|
221
|
+
});
|
|
222
|
+
return buildLiveGraphOutput({
|
|
223
|
+
catalog: result.catalog,
|
|
224
|
+
indexes: result.indexes,
|
|
225
|
+
signals: result.signals,
|
|
226
|
+
cacheHit: result.cacheHit,
|
|
227
|
+
}, args.cwd);
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=graph-sharded-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-sharded-engine.js","sourceRoot":"","sources":["../../src/cli/graph-sharded-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAU9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AU,IAAI,OAAO;QAC1C,QAAQ,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI;QAC/B,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;QACzB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,YAAY,EAAE;QACnC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,YAAY,EAAE,yBAAyB;QACvC,UAAU;KACX,CAAC,CAAC;IACH,OAAO,oBAAoB,CACzB;QACE,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,EACD,IAAI,CAAC,GAAG,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ToolCliContext } from '@opensip-cli/core';
|
|
2
|
+
import { type RunGraphResult } from './orchestrate.js';
|
|
3
|
+
import type { GraphCommandOptions } from './graph-options.js';
|
|
4
|
+
import type { GraphRunOutcome } from './graph-run-outcome.js';
|
|
5
|
+
import type { GraphProfileBuilder } from './profile.js';
|
|
6
|
+
import type { Rule } from '../types.js';
|
|
7
|
+
type DispatchGraphResult = (opts: GraphCommandOptions, rawResult: RunGraphResult, cli: ToolCliContext, startedAt: string, suppressionRoot: string) => Promise<GraphRunOutcome | undefined>;
|
|
8
|
+
export interface SinglePathContext {
|
|
9
|
+
readonly opts: GraphCommandOptions;
|
|
10
|
+
readonly cli: ToolCliContext;
|
|
11
|
+
readonly rules: readonly Rule[];
|
|
12
|
+
readonly startedAt: string;
|
|
13
|
+
readonly profile?: GraphProfileBuilder;
|
|
14
|
+
readonly dispatchGraphResult: DispatchGraphResult;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whole-project or single-positional-path graph execution. Owns the
|
|
18
|
+
* exact/sharded engine dispatch, profiling run bucket, shard-failure surfacing,
|
|
19
|
+
* and language mismatch policy for the single-run shape.
|
|
20
|
+
*/
|
|
21
|
+
export declare function executeSinglePathGraph(ctx: SinglePathContext, positionalPaths: readonly string[]): Promise<GraphRunOutcome | undefined>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=graph-single-run-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-single-run-mode.d.ts","sourceRoot":"","sources":["../../src/cli/graph-single-run-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,cAAc,CAAC;AACjF,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,aAAa,CAAC;AAKjD,KAAK,mBAAmB,GAAG,CACzB,IAAI,EAAE,mBAAmB,EACzB,SAAS,EAAE,cAAc,EACzB,GAAG,EAAE,cAAc,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,KACpB,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CACnD;AAmBD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,iBAAiB,EACtB,eAAe,EAAE,SAAS,MAAM,EAAE,GACjC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CA8EtC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ConfigurationError, currentScope, logger, SystemError, } from '@opensip-cli/core';
|
|
2
|
+
import { DASHBOARD_FEATURE_COLUMNS } from './graph-feature-columns.js';
|
|
3
|
+
import { countFiles } from './graph-report.js';
|
|
4
|
+
import { engineSelectionReason, realpathOrSelf, resolveEngineShards, runProfiledShardedBuild, } from './graph-sharded-engine.js';
|
|
5
|
+
import { loadGraphConfig, runGraph } from './orchestrate.js';
|
|
6
|
+
import { positionalPathLabel } from './positional-paths.js';
|
|
7
|
+
const MODULE_GRAPH_CLI = 'graph:cli';
|
|
8
|
+
function recordPartitionStage(profileRun, partition) {
|
|
9
|
+
if (profileRun === undefined || partition === undefined)
|
|
10
|
+
return;
|
|
11
|
+
profileRun.recordStage('partition', partition.durationMs, partition.detail);
|
|
12
|
+
}
|
|
13
|
+
function finishProfileRun(profileRun, result) {
|
|
14
|
+
if (profileRun !== undefined) {
|
|
15
|
+
profileRun.finish(result);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whole-project or single-positional-path graph execution. Owns the
|
|
20
|
+
* exact/sharded engine dispatch, profiling run bucket, shard-failure surfacing,
|
|
21
|
+
* and language mismatch policy for the single-run shape.
|
|
22
|
+
*/
|
|
23
|
+
export async function executeSinglePathGraph(ctx, positionalPaths) {
|
|
24
|
+
const { opts, cli, rules, startedAt, profile, dispatchGraphResult } = ctx;
|
|
25
|
+
// Realpath the run root ONCE, before engine selection (F3 path parity). The
|
|
26
|
+
// EXACT engine normalizes its project dir via realpathSync internally
|
|
27
|
+
// (graph-typescript normalize-project-dir); the SHARDED worker derives
|
|
28
|
+
// project-relative `code.file` paths against this `projectRoot`. Under a
|
|
29
|
+
// symlinked cwd a RAW root would make the sharded paths gain `../..` prefixes
|
|
30
|
+
// while exact stays canonical, so the two engines emitted different
|
|
31
|
+
// `code.file` values. Canonicalizing here keeps both engines byte-identical.
|
|
32
|
+
const runCwd = realpathOrSelf(positionalPaths[0] ?? opts.cwd, opts.cwd);
|
|
33
|
+
const config = loadGraphConfig(opts.cwd);
|
|
34
|
+
const resolution = await resolveEngineShards(opts, cli, positionalPaths);
|
|
35
|
+
const shards = resolution.shards;
|
|
36
|
+
logger.info({
|
|
37
|
+
evt: 'graph.cli.graph.engine',
|
|
38
|
+
module: MODULE_GRAPH_CLI,
|
|
39
|
+
mode: shards.length > 1 ? 'sharded' : 'exact',
|
|
40
|
+
requestedExact: opts.exact === true,
|
|
41
|
+
shards: shards.length,
|
|
42
|
+
reason: engineSelectionReason(opts, positionalPaths, shards.length > 1),
|
|
43
|
+
});
|
|
44
|
+
const profileRun = profile?.startRun({
|
|
45
|
+
label: positionalPaths.length === 0 ? 'root' : positionalPathLabel(runCwd, opts.cwd),
|
|
46
|
+
cwd: runCwd,
|
|
47
|
+
mode: shards.length > 1 ? 'sharded' : 'single-process',
|
|
48
|
+
});
|
|
49
|
+
// @fitness-ignore-next-line detached-promises -- sync profiling bookkeeping helper.
|
|
50
|
+
recordPartitionStage(profileRun, resolution.partition);
|
|
51
|
+
const result = shards.length > 1
|
|
52
|
+
? await runProfiledShardedBuild(profileRun, {
|
|
53
|
+
opts,
|
|
54
|
+
shards,
|
|
55
|
+
projectRoot: runCwd,
|
|
56
|
+
cli,
|
|
57
|
+
config,
|
|
58
|
+
rules,
|
|
59
|
+
})
|
|
60
|
+
: await runGraph({
|
|
61
|
+
cwd: runCwd,
|
|
62
|
+
noCache: opts.noCache,
|
|
63
|
+
resolution: opts.resolution,
|
|
64
|
+
language: opts.language,
|
|
65
|
+
config,
|
|
66
|
+
rules,
|
|
67
|
+
datastore: cli.scope.datastore(),
|
|
68
|
+
emitFeatures: DASHBOARD_FEATURE_COLUMNS,
|
|
69
|
+
onProgress: profileRun?.onProgress,
|
|
70
|
+
});
|
|
71
|
+
// @fitness-ignore-next-line detached-promises -- sync profiling bookkeeping helper.
|
|
72
|
+
finishProfileRun(profileRun, result);
|
|
73
|
+
if (shards.length > 1) {
|
|
74
|
+
const sharded = result;
|
|
75
|
+
if (sharded.failedShardIds && sharded.failedShardIds.length > 0) {
|
|
76
|
+
throw new SystemError(`Sharded graph build had ${sharded.failedShardIds.length} shard failure(s); ` +
|
|
77
|
+
`catalog and any --gate-* / baseline artifacts are incomplete. ` +
|
|
78
|
+
`See 'graph.sharded.shard_failed' log events for per-shard details.`, { code: 'GRAPH.SHARD.FAILURES' });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// @fitness-ignore-next-line detached-promises -- sync validation helper; throws synchronously on mismatch.
|
|
82
|
+
enforceLanguageMismatchPolicy(opts, result.catalog, [runCwd]);
|
|
83
|
+
const scope = currentScope();
|
|
84
|
+
if (scope !== undefined) {
|
|
85
|
+
// @fitness-ignore-next-line detached-promises -- DiagnosticsBus.event is synchronous.
|
|
86
|
+
scope.diagnostics.event('execute', 'debug', 'graph build complete', {
|
|
87
|
+
mode: shards.length > 1 ? 'sharded' : 'exact',
|
|
88
|
+
shards: shards.length,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return await dispatchGraphResult(opts, result, cli, startedAt, runCwd);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* D14 mixed policy. When `--language X` was specified and the run discovered
|
|
95
|
+
* zero files matching that adapter, exit 2 with the canonical error. Automatic
|
|
96
|
+
* detection paths do not trigger this check.
|
|
97
|
+
*/
|
|
98
|
+
function enforceLanguageMismatchPolicy(opts, catalog, paths) {
|
|
99
|
+
if (typeof opts.language !== 'string' || opts.language.length === 0)
|
|
100
|
+
return;
|
|
101
|
+
const fileCount = catalog === null ? 0 : countFiles(catalog);
|
|
102
|
+
if (fileCount > 0)
|
|
103
|
+
return;
|
|
104
|
+
const pathLabel = paths.map((p) => positionalPathLabel(p, opts.cwd)).join(', ');
|
|
105
|
+
throw new ConfigurationError(`--language ${opts.language} matched 0 files under ${pathLabel}; check the flag or paths.`);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=graph-single-run-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-single-run-mode.js","sourceRoot":"","sources":["../../src/cli/graph-single-run-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAuB,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAmBrC,SAAS,oBAAoB,CAC3B,UAA+C,EAC/C,SAA+E;IAE/E,IAAI,UAAU,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO;IAChE,UAAU,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CACvB,UAA+C,EAC/C,MAAsB;IAEtB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,GAAsB,EACtB,eAAkC;IAElC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,K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K,CAAC,SAAS,EAAE,OAAO,EAAE,sBAAsB,EAAE;YAClE,IAAI,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;YAC7C,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,SAAS,6BAA6B,CACpC,IAAyB,EACzB,OAAuB,EACvB,KAAwB;IAExB,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC5E,MAAM,SAAS,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7D,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO;IAC1B,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChF,MAAM,IAAI,kBAAkB,CAC1B,cAAc,IAAI,CAAC,QAAQ,0BAA0B,SAAS,4BAA4B,CAC3F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ToolCliContext } from '@opensip-cli/core';
|
|
2
|
+
import { type GraphProfileBuilder } from './profile.js';
|
|
3
|
+
import type { GraphCommandOptions } from './graph-options.js';
|
|
4
|
+
import type { GraphRunOutcome } from './graph-run-outcome.js';
|
|
5
|
+
/**
|
|
6
|
+
* `graph --workspace` fan-out. The parent aggregates per-unit child runs for
|
|
7
|
+
* reporting and a single dashboard session, but intentionally does not emit a
|
|
8
|
+
* cloud signal envelope for the aggregate.
|
|
9
|
+
*/
|
|
10
|
+
export declare function executeWorkspaceGraph(opts: GraphCommandOptions, cli: ToolCliContext, profile?: GraphProfileBuilder): Promise<GraphRunOutcome | undefined>;
|
|
11
|
+
//# sourceMappingURL=graph-workspace-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workspace-mode.d.ts","sourceRoot":"","sources":["../../src/cli/graph-workspace-mode.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAwB9D;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,cAAc,EACnB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAsEtC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { EXIT_CODES } from '@opensip-cli/contracts';
|
|
2
|
+
import { ConfigurationError, logger, } from '@opensip-cli/core';
|
|
3
|
+
import { buildWorkspaceSessionContribution } from './graph-session-contribution.js';
|
|
4
|
+
import { resolveAdaptersForRun } from './resolve-adapters.js';
|
|
5
|
+
import { buildWorkspaceJsonDocument, writeWorkspaceReport } from './workspace-report.js';
|
|
6
|
+
import { discoverPolyglotUnits, runWorkspaceUnitsInParallel } from './workspace-runner.js';
|
|
7
|
+
const EVT_GRAPH_COMPLETE = 'graph.cli.graph.complete';
|
|
8
|
+
const MODULE_GRAPH_CLI = 'graph:cli';
|
|
9
|
+
function setProfileStageRecorded(profileRun, durationMs, unitCount) {
|
|
10
|
+
if (profileRun !== undefined) {
|
|
11
|
+
profileRun.recordStage('workspace-fanout', durationMs, `${String(unitCount)} unit(s)`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function setProfileSummaryFinished(profileRun, summary) {
|
|
15
|
+
if (profileRun !== undefined) {
|
|
16
|
+
profileRun.finishSummary(summary);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `graph --workspace` fan-out. The parent aggregates per-unit child runs for
|
|
21
|
+
* reporting and a single dashboard session, but intentionally does not emit a
|
|
22
|
+
* cloud signal envelope for the aggregate.
|
|
23
|
+
*/
|
|
24
|
+
export async function executeWorkspaceGraph(opts, cli, profile) {
|
|
25
|
+
const cliScript = opts.cliScript ?? process.argv[1];
|
|
26
|
+
if (typeof cliScript !== 'string' || cliScript.length === 0) {
|
|
27
|
+
throw new ConfigurationError('--workspace: could not determine the CLI entry script (process.argv[1] is empty).');
|
|
28
|
+
}
|
|
29
|
+
const adapters = resolveAdaptersForRun(opts, cli);
|
|
30
|
+
const units = await discoverPolyglotUnits(opts.cwd, adapters);
|
|
31
|
+
if (units.length === 0) {
|
|
32
|
+
const adapterLabel = adapters.map((a) => a.id).join(', ') || '(no language adapters available)';
|
|
33
|
+
throw new ConfigurationError(`--workspace: no workspace units detected for [${adapterLabel}]. Use 'opensip graph' for whole-project analysis.`);
|
|
34
|
+
}
|
|
35
|
+
const profileRun = profile?.startRun({
|
|
36
|
+
label: 'workspace',
|
|
37
|
+
cwd: opts.cwd,
|
|
38
|
+
mode: 'workspace',
|
|
39
|
+
});
|
|
40
|
+
// Internal per-run timer for the workspace report artifact. The generic
|
|
41
|
+
// session row's timing remains host-owned.
|
|
42
|
+
const startedAt = Date.now();
|
|
43
|
+
const result = await runWorkspaceUnitsInParallel({
|
|
44
|
+
cwd: opts.cwd,
|
|
45
|
+
units,
|
|
46
|
+
cliScript,
|
|
47
|
+
concurrency: opts.concurrency,
|
|
48
|
+
noCache: opts.noCache,
|
|
49
|
+
resolution: opts.resolution,
|
|
50
|
+
recipe: opts.recipe,
|
|
51
|
+
...(opts.language === undefined ? {} : { language: opts.language }),
|
|
52
|
+
});
|
|
53
|
+
const durationMs = Date.now() - startedAt;
|
|
54
|
+
setProfileStageRecorded(profileRun, durationMs, units.length);
|
|
55
|
+
const allSignals = [];
|
|
56
|
+
for (const r of result.perUnit)
|
|
57
|
+
allSignals.push(...r.signals);
|
|
58
|
+
setProfileSummaryFinished(profileRun, {
|
|
59
|
+
cacheHit: false,
|
|
60
|
+
signals: allSignals.length,
|
|
61
|
+
});
|
|
62
|
+
let session;
|
|
63
|
+
if (opts.json === true) {
|
|
64
|
+
cli.emitJson(buildWorkspaceJsonDocument(result.perUnit, durationMs));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
await writeWorkspaceReport(result.perUnit, durationMs, cli);
|
|
68
|
+
session = buildWorkspaceSessionContribution(opts, allSignals);
|
|
69
|
+
}
|
|
70
|
+
if (result.anyChildFailed) {
|
|
71
|
+
cli.setExitCode(EXIT_CODES.RUNTIME_ERROR);
|
|
72
|
+
process.stderr.write(`graph --workspace: at least one unit run failed; see per-unit output above.\n`);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
cli.setExitCode(EXIT_CODES.SUCCESS);
|
|
76
|
+
}
|
|
77
|
+
logger.info({
|
|
78
|
+
evt: EVT_GRAPH_COMPLETE,
|
|
79
|
+
module: MODULE_GRAPH_CLI,
|
|
80
|
+
units: result.perUnit.length,
|
|
81
|
+
findings: allSignals.length,
|
|
82
|
+
failed: result.anyChildFailed,
|
|
83
|
+
durationMs,
|
|
84
|
+
});
|
|
85
|
+
return session === undefined ? undefined : { session };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=graph-workspace-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workspace-mode.js","sourceRoot":"","sources":["../../src/cli/graph-workspace-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA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