@callidescope/nx 0.0.79 → 0.0.81

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/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## 0.0.81 (2026-11-11)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **codometer:** ✨ tighten the comment budgets and shorten every comment over them ([#2262](https://github.com/organizzolini/codebase/pull/2262), [#2261](https://github.com/organizzolini/codebase/issues/2261))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated callidescope-configuration to 0.0.80
10
+ - Updated callidescope-output to 0.0.79
11
+ - Updated callidescope-graph to 0.0.79
12
+ - Updated callidescope-core to 0.0.79
13
+ - Updated callidescope-cli to 0.0.80
14
+
15
+ ## 0.0.80 (2026-11-10)
16
+
17
+ ### 🚀 Features
18
+
19
+ - **codometer:** ✨ gate JSDoc on every declaration kind and shorten long comments ([#2227](https://github.com/organizzolini/codebase/pull/2227), [#2226](https://github.com/organizzolini/codebase/issues/2226))
20
+
21
+ ### 🧱 Updated Dependencies
22
+
23
+ - Updated callidescope-configuration to 0.0.79
24
+ - Updated callidescope-output to 0.0.78
25
+ - Updated callidescope-graph to 0.0.78
26
+ - Updated callidescope-core to 0.0.78
27
+ - Updated callidescope-cli to 0.0.79
28
+
1
29
  ## 0.0.79 (2026-11-10)
2
30
 
3
31
  ### 🧱 Updated Dependencies
@@ -2,12 +2,7 @@ import { ExecutorContext } from '@nx/devkit';
2
2
 
3
3
  /** Options the `depth` and `breadth` executors accept. */
4
4
  declare interface AddressExecutorOptions {
5
- /**
6
- * The callables to look up, each `<file>#<qualified-name>`.
7
- *
8
- * Plural to match the `--addresses` the command line takes, so one target
9
- * run answers about a whole rename rather than one callable at a time.
10
- */
5
+ /** The callables to look up, each `<file>#<qualified-name>`. Plural, so one run answers about a whole rename. */
11
6
  readonly addresses?: string[] | undefined;
12
7
  readonly configuration: string;
13
8
  readonly format?: string | undefined;
@@ -20,11 +15,7 @@ declare interface AddressExecutorOptions {
20
15
  }
21
16
 
22
17
  /**
23
- * Prints each named callable's direct callers and callees side by side — the two questions a rename or a refactor needs answered together.
24
- *
25
- * The addresses are resolved against the target's own project and its Nx
26
- * dependencies rather than the whole workspace, which is both faster than the
27
- * `callidescope breadth` command and the set the addresses actually belong to.
18
+ * Prints each named callable's direct callers and callees, resolved within the target's Nx scope.
28
19
  */
29
20
  declare function breadthExecutor(options: AddressExecutorOptions, context: ExecutorContext): Promise<{
30
21
  success: boolean;
@@ -2,12 +2,7 @@ import { ExecutorContext } from '@nx/devkit';
2
2
 
3
3
  /** Options the `depth` and `breadth` executors accept. */
4
4
  declare interface AddressExecutorOptions {
5
- /**
6
- * The callables to look up, each `<file>#<qualified-name>`.
7
- *
8
- * Plural to match the `--addresses` the command line takes, so one target
9
- * run answers about a whole rename rather than one callable at a time.
10
- */
5
+ /** The callables to look up, each `<file>#<qualified-name>`. Plural, so one run answers about a whole rename. */
11
6
  readonly addresses?: string[] | undefined;
12
7
  readonly configuration: string;
13
8
  readonly format?: string | undefined;
@@ -20,11 +15,7 @@ declare interface AddressExecutorOptions {
20
15
  }
21
16
 
22
17
  /**
23
- * Prints every call stack above and below each named callable — every caller chain up to a root, every callee chain down to a leaf.
24
- *
25
- * The addresses are resolved against the target's own project and its Nx
26
- * dependencies rather than the whole workspace, which is both faster than the
27
- * `callidescope depth` command and the set the addresses actually belong to.
18
+ * Prints every call stack above and below each named callable, resolved within the target's Nx scope.
28
19
  */
29
20
  declare function depthExecutor(options: AddressExecutorOptions, context: ExecutorContext): Promise<{
30
21
  success: boolean;
@@ -2,25 +2,13 @@ import { ExecutorContext } from '@nx/devkit';
2
2
  import { TaskGraph } from '@nx/devkit';
3
3
 
4
4
  /**
5
- * Gates every task Nx batched for this executor from one trace.
6
- *
7
- * One `gate` task per project used to trace the whole workspace on its own, so
8
- * the cold run of a workspace of ~60 projects traced it ~60 times. A batch
9
- * traces the combined scope once and judges each task by its own project's
10
- * findings, so each still passes or fails alone and is still cached alone —
11
- * Nx hashes and replays batched tasks one by one. Tasks that name different
12
- * configuration files cannot share a trace, so they are batched per file.
5
+ * Gates every task Nx batched from one shared trace, judging each task by its own
6
+ * project's findings.
13
7
  */
14
8
  declare function gateBatchExecutor(...[taskGraph, options, overrides, context]: GateBatchExecutorArguments): Promise<Record<string, GateBatchTaskResult>>;
15
9
  export default gateBatchExecutor;
16
10
 
17
- /**
18
- * The four arguments Nx calls a batch executor with, in the order it passes them.
19
- *
20
- * A tuple rather than four parameters because Nx fixes that signature and the
21
- * workspace holds a function to three: the task graph, each task's resolved
22
- * options by task id, the overrides of the whole run, and the context.
23
- */
11
+ /** Batch executor arguments: task graph, options, overrides, and context. */
24
12
  declare type GateBatchExecutorArguments = [
25
13
  taskGraph: TaskGraph,
26
14
  options: Record<string, GateExecutorOptions>,
@@ -28,13 +16,7 @@ overrides: GateExecutorOptions,
28
16
  context: ExecutorContext
29
17
  ];
30
18
 
31
- /**
32
- * What one task of a gate batch settled on.
33
- *
34
- * Nx's own type for a batch executor's result is not exported through
35
- * `@nx/devkit`, so this states the shape Nx reads back: whether the task
36
- * passed, and the output to show and to store with it in the cache.
37
- */
19
+ /** One gate task's verdict and the output Nx caches. */
38
20
  declare interface GateBatchTaskResult {
39
21
  readonly success: boolean;
40
22
  readonly terminalOutput: string;
@@ -1,22 +1,7 @@
1
1
  import { ExecutorContext } from '@nx/devkit';
2
2
 
3
3
  /**
4
- * Fails one project's task when its call stacks broke the limits it is held to.
5
- *
6
- * The gate rather than the trace: `trace` prints every stack in a project for
7
- * somebody reading it, and this prints only the stacks and callables that
8
- * decided the exit code, which is what a failed pipeline is asked to explain.
9
- *
10
- * Inferred onto every project holding a `tsconfig.json` that the workspace
11
- * configuration does not exclude, so `nx affected -t gate` gates a branch by
12
- * the projects it changed — and a project whose stacks got deeper is named by
13
- * the task that failed, which one workspace-wide task never could.
14
- *
15
- * With neither `projects` nor `tags` given, the selection is the project this
16
- * target belongs to, widened along the Nx dependency graph: a stack truncated
17
- * at a package boundary measures the wrong thing. The widening decides what is
18
- * traced and not what is judged — a dependency's breach fails the dependency's
19
- * own gate, which is the task named after the project that owns it.
4
+ * Fails one project's task when its call stacks break their limits. Prints only the deciding stacks.
20
5
  */
21
6
  declare function gateExecutor(options: GateExecutorOptions, context: ExecutorContext): Promise<{
22
7
  success: boolean;
@@ -1,17 +1,7 @@
1
1
  import { ExecutorContext } from '@nx/devkit';
2
2
 
3
3
  /**
4
- * Traces one selection of Nx projects with callidescope.
5
- *
6
- * Inferred onto every project holding a `tsconfig.json`, so
7
- * `nx run-many -t callidescope-trace` covers the workspace,
8
- * `nx run-many -t callidescope-trace --projects=tag:type:package` covers a
9
- * category, and `nx affected -t callidescope-trace` covers only what changed
10
- * — none of which the workspace-wide command can do, and none of which needs
11
- * a flag of its own: selecting projects is what the task runner is for.
12
- *
13
- * With neither `projects` nor `tags` given, the selection is the project this
14
- * target belongs to.
4
+ * Traces one selection of Nx projects, defaulting to the target's own project when none are named.
15
5
  */
16
6
  declare function traceExecutor(options: TraceExecutorOptions, context: ExecutorContext): Promise<{
17
7
  success: boolean;
@@ -20,14 +20,11 @@ export declare class AddressModule {
20
20
  }
21
21
 
22
22
  /**
23
- * Answers `depth` and `breadth` about the callables it is named, inside a
24
- * resolved selection of Nx projects.
23
+ * Answers `depth` and `breadth` about the callables it is named, inside a resolved
24
+ * selection of Nx projects.
25
25
  *
26
- * The lookup itself is callidescope's — this only decides what it is asked
27
- * about. What the plugin adds is the scope: the CLI resolves an address
28
- * against the whole workspace, while here it is resolved against one project
29
- * and its Nx dependencies, which is both faster and the set the address
30
- * actually belongs to.
26
+ * The lookup is callidescope's. This adds the scope: the address resolves against one
27
+ * project and its Nx dependencies, which is faster and the set it belongs to.
31
28
  */
32
29
  export declare class AddressService {
33
30
  private readonly addressLookupService;
@@ -36,20 +33,13 @@ export declare class AddressService {
36
33
  private readonly breadthService;
37
34
  constructor(addressLookupService: AddressLookupService, addressReportService: AddressReportService, addressDepthService: AddressDepthService, breadthService: BreadthService);
38
35
  /**
39
- * Matches one address against an already-traced selection, or explains why
40
- * it could not be.
41
- *
42
- * The explanation is returned rather than logged: an executor's product is
43
- * what it writes to stdout, and a reader looking at a failed task needs the
44
- * reason in the same place the report would have been.
36
+ * Matches one address against a traced selection, or returns why it could not. Returned,
37
+ * not logged, so a failed task shows it.
45
38
  */
46
39
  private identify;
47
40
  /**
48
- * Traces the selection, then matches every address against it.
49
- *
50
- * All or nothing, the way the command line is: a task that printed the
51
- * addresses it understood and skipped the rest would report a partial
52
- * answer under a `success` nobody asked it to qualify.
41
+ * Traces the selection, then matches every address against it. All or nothing,
42
+ * like the command line.
53
43
  */
54
44
  private locate;
55
45
  /** Prints each callable's direct callers and callees, side by side. */
@@ -87,25 +77,10 @@ export declare const DEFAULT_BREADTH_TARGET_NAME = "callidescope-breadth";
87
77
  /** Name of the inferred per-project depth-lookup target. */
88
78
  export declare const DEFAULT_DEPTH_TARGET_NAME = "callidescope-depth";
89
79
 
90
- /**
91
- * Name of the inferred per-project gate target.
92
- *
93
- * Named after what it decides rather than after what it measures. `trace`,
94
- * `depth`, and `breadth` all print something a reader asked for; this one is
95
- * the target here a pipeline is meant to read an exit code from, so it says
96
- * `gate`.
97
- */
80
+ /** Inferred gate target, named for its verdict, which pipelines read. */
98
81
  export declare const DEFAULT_GATE_TARGET_NAME = "callidescope-restrict";
99
82
 
100
- /**
101
- * Names of the inferred per-project targets, when the registration names none.
102
- *
103
- * Prefixed defaults keep inferred tasks grouped and recognizable in Nx task
104
- * lists, and avoid collisions with generic names in workspaces carrying
105
- * several toolchains.
106
- *
107
- * Every one of them is overridable from the `nx.json` registration.
108
- */
83
+ /** Default inferred target names; prefixed to group and avoid collisions. */
109
84
  export declare const DEFAULT_TRACE_TARGET_NAME = "callidescope-trace";
110
85
 
111
86
  /** A target this plugin infers onto a project. */
@@ -131,13 +106,7 @@ declare interface InferTargetsArguments {
131
106
  /** A loaded configuration, beside the path the loader settled on. */
132
107
  declare interface LoadedRunConfiguration {
133
108
  readonly configuration: ResolvedCallidescopeConfiguration;
134
- /**
135
- * Where the configuration was read from.
136
- *
137
- * The path the loader settled on rather than the one it was handed, since a
138
- * relative path is resolved before it is read — and a run resolves a
139
- * project's own configuration relative to it.
140
- */
109
+ /** Where the configuration was read from: the path the loader settled on, since a relative one is resolved before reading. */
141
110
  readonly path: string;
142
111
  }
143
112
 
@@ -179,16 +148,7 @@ export declare interface LookupResult {
179
148
  export declare class MainModule {
180
149
  }
181
150
 
182
- /**
183
- * One Nx project, reduced to what a directory resolution needs of it.
184
- *
185
- * `codependix-nx-projects` declares a near-identical shape and reads it out of the
186
- * graph the same way. They are deliberately not shared: the two packages sit
187
- * in different toolchains, and `configuration/eslint.config.ts` lets this one
188
- * depend on nothing but `logging` precisely so `@nx/devkit` cannot spread. A
189
- * package extracted to hold both would have to be depended on by both, which
190
- * is the coupling that rule exists to prevent.
191
- */
151
+ /** Nx project fields directory resolution needs; not shared, by design. */
192
152
  export declare interface NxProject {
193
153
  readonly name: string;
194
154
  /** Workspace-relative root, exactly as the Nx project graph states it. */
@@ -204,10 +164,7 @@ export declare class OptionsModule {
204
164
  /**
205
165
  * Narrows the untyped options object Nx hands a plugin.
206
166
  *
207
- * Nx passes whatever the consumer wrote in `nx.json` with no validation, so
208
- * every field is checked before use rather than cast. A bad value falls back
209
- * to its default: a typo in a target name should not stop the project graph
210
- * from being built.
167
+ * Nx passes unvalidated `nx.json` options, so every field is checked before use. A bad value falls back to its default, so a typo does not stop the project graph.
211
168
  */
212
169
  export declare class OptionsService {
213
170
  private readonly configurationService;
@@ -217,19 +174,13 @@ export declare class OptionsService {
217
174
  /** Reads a string field from an untrusted record, or `undefined`. */
218
175
  private readString;
219
176
  /**
220
- * Reads the `configuration` option of an executor, refusing a missing one.
221
- *
222
- * Nx validates the option against `schema.json`, but a target written by hand
223
- * reaches an executor unchecked, so the same refusal the plugin option gets —
224
- * decided by the configuration layer — is applied here.
177
+ * Reads the `configuration` option of an executor, refusing a missing one, since
178
+ * hand-written targets skip `schema.json`.
225
179
  */
226
180
  readConfiguration(value: unknown): string;
227
181
  /**
228
- * Narrows an untrusted output format to one callidescope renders.
229
- *
230
- * A target written by hand in a `project.json` bypasses the executor's
231
- * `schema.json` enum, so an unrecognized value falls back to whatever the
232
- * configuration chose rather than reaching the renderer.
182
+ * Narrows an untrusted output format to one callidescope renders, since hand-written targets
183
+ * bypass the `schema.json` enum.
233
184
  */
234
185
  readFormat(value: unknown): CallidescopeOutputFormat | undefined;
235
186
  /**
@@ -244,21 +195,13 @@ export declare class OptionsService {
244
195
  format: CallidescopeOutputFormat | undefined;
245
196
  };
246
197
  /**
247
- * Reads a list of strings out of an executor's options.
248
- *
249
- * Nx validates an option against its `schema.json` before the executor sees
250
- * it, but a target written by hand in a `project.json` reaches here
251
- * unchecked, so a non-array or a list holding non-strings is narrowed rather
252
- * than trusted. Entries are trimmed and the blanks dropped, so a trailing
253
- * comma in `--projects a,b,` names two projects rather than three.
198
+ * Reads a list of strings from executor options, trimming entries and dropping blanks, so
199
+ * `a,b,` names two projects.
254
200
  */
255
201
  readStringList(value: unknown): string[];
256
202
  /**
257
- * Resolves the effective plugin options from an untrusted value.
258
- *
259
- * Every field has a default except `configurationPath`: the workspace
260
- * configuration is never searched for, so a registration that does not name
261
- * it is refused rather than guessed at.
203
+ * Resolves the effective plugin options from an untrusted value. Only `configurationPath`
204
+ * has no default, and it is never searched for.
262
205
  */
263
206
  resolvePluginOptions(options: unknown): CallidescopePluginOptions;
264
207
  }
@@ -285,133 +228,54 @@ export declare class PluginService {
285
228
  private readonly verdictService;
286
229
  constructor(callidescopeService: CallidescopeService, configurationService: ConfigurationService, fileFilterService: FileFilterService, markdownReportService: MarkdownReportService, optionsService: OptionsService, projectsService: ProjectsService, runConfigurationService: RunConfigurationService, verdictService: VerdictService);
287
230
  /**
288
- * Builds the predicate deciding which projects the workspace configuration
289
- * keeps out of every trace.
290
- *
291
- * The run's own filter, built from the same two fields
292
- * `WorkspaceService.discoverProjects` builds it from and asked the same
293
- * question it asks — is this project's `tsconfig.json` excluded — so
294
- * inference and discovery can never disagree about which projects a run
295
- * covers.
296
- *
297
- * A configuration that cannot be loaded excludes nothing. This runs while Nx
298
- * is building the project graph, where a thrown error stops every command in
299
- * the workspace rather than one task; the executor loads the same file again
300
- * and refuses there, where a refusal is about the run that asked for it.
231
+ * Builds the predicate for projects the workspace configuration excludes from every trace.
232
+ * A configuration that cannot load excludes nothing.
301
233
  */
302
234
  private buildExclusionFilter;
303
235
  /**
304
- * Builds one project's targets, gate included unless it is excluded.
305
- *
306
- * An excluded project gets the three that print something and not the one
307
- * that decides an exit code. Its own code is never traced — discovery drops
308
- * it before its `tsconfig.json` is opened — so a gate there would own no
309
- * finding at all and report green for a project it never read.
310
- * `projects/ic-suite/callidescope/callidescope-examples` is the case: its fixtures exist to breach
311
- * the limits, which is why `.callidescopeignore` names it.
312
- *
313
- * That sentence is what `runTrace`'s exemption from the unread rule keeps
314
- * true: such a project reads nothing of its own by definition, so a trace
315
- * failing on that would hand it a permanently red target.
236
+ * Builds one project's targets, with the gate only when the project is not excluded. An
237
+ * excluded gate would pass without reading anything.
316
238
  */
317
239
  private buildInferredTargets;
318
240
  /** Whether a project's directory holds a TypeScript program to trace. */
319
241
  private holdsProgram;
320
242
  /**
321
- * Whether the workspace configuration excludes this project outright.
322
- *
323
- * The project's own `tsconfig.json` is the path asked about, because that is
324
- * the path `WorkspaceService.discoverProjects` asks about — a project is
325
- * excluded when the file that makes it a project is.
326
- *
327
- * Joined with `path.posix` rather than `path.join`, unlike `holdsProgram`
328
- * beside it: a filter matches the workspace-relative POSIX paths git and the
329
- * exclusion globs are written in, where `holdsProgram` hands `existsSync` a
330
- * native absolute path.
243
+ * Whether the workspace configuration excludes this project, judged by its `tsconfig.json`
244
+ * path in POSIX form.
331
245
  */
332
246
  private isExcludedProject;
333
247
  /**
334
- * Turns one traced outcome into the gate's result for the projects it judges.
335
- *
336
- * What to print comes from the verdict: the findings it judged, or, for a
337
- * run that read nothing and so has none to show, the reason it failed. The
338
- * one thing added to that verdict is the exit code for an unread judged
339
- * project, which is the gate's alone — see `VerdictService.judge`.
248
+ * Turns one traced outcome into the gate's result, printing the verdict's findings or its
249
+ * reason. A gate alone fails unread projects.
340
250
  */
341
251
  private renderGateVerdict;
342
252
  /**
343
- * States what a selection asked for that the workspace does not have.
344
- *
345
- * Both kinds of mistake are named at once, each beside the vocabulary it
346
- * was drawn from, so a command line with two typos in it is two typos to
347
- * fix rather than two runs.
253
+ * States what a selection asked for that the workspace does not have, naming every typo at once.
348
254
  */
349
255
  describeRefusedScope(scope: ResolvedTraceScope): string;
350
256
  /**
351
- * Infers this plugin's targets onto every project holding a `tsconfig.json`.
352
- *
353
- * A project with no program of its own is skipped rather than given a target
354
- * that would trace nothing — `callidescope` warns and moves on, so an
355
- * inferred target there would be a permanently empty report. The
356
- * workspace-root project is skipped for the opposite reason: it contains
357
- * every other project, so its target would trace the whole workspace under
358
- * one uncacheable task.
359
- *
360
- * Asynchronous because the gate is only inferred onto a project the
361
- * workspace configuration does not exclude, and only that file can say which
362
- * projects those are — see `buildExclusionFilter`, which is read once here
363
- * rather than once per project for the same reason the plugin options are.
257
+ * Infers this plugin's targets onto every project holding a `tsconfig.json`, skipping the
258
+ * workspace root and projects without a program.
364
259
  */
365
260
  inferTargets(args: InferTargetsArguments): Promise<Map<string, InferredTargets>>;
366
261
  /**
367
- * Resolves an executor's `projects`/`tags` selection into directories.
368
- *
369
- * The selection is widened along the Nx dependency graph unless asked not to
370
- * be — see `ProjectsService.resolveDependencyClosure` for why a trace that
371
- * stops at a project's own boundary measures the wrong thing. Two sets of
372
- * directories come back for that reason: what the widened selection reads,
373
- * and what the selection itself is answerable for.
262
+ * Resolves an executor's `projects`/`tags` selection into directories, widened along the Nx
263
+ * graph unless told not to.
374
264
  */
375
265
  resolveTraceScope(args: ResolveTraceScopeArguments): Promise<ResolvedTraceScope>;
376
266
  /**
377
- * Traces the resolved directories and judges what it found against the
378
- * limits every project in scope declared.
379
- *
380
- * The verdict is `judge`'s, which is where the rules are written; this
381
- * chooses what to print for it — the findings it judged, or, for a run that
382
- * read nothing and so has none to show, the reason it failed instead.
383
- *
384
- * The one thing it adds to that verdict is the exit code for an unread
385
- * judged project, which is the gate's alone — see `judge`.
267
+ * Traces the resolved directories and judges the findings against each in-scope project's
268
+ * declared limits.
386
269
  */
387
270
  runGate(args: RunGateArguments): Promise<RunTraceResult>;
388
271
  /**
389
- * Gates every task of a batch from one trace of their combined scope.
390
- *
391
- * Each gate used to trace the whole workspace on its own, so a run of ~60
392
- * projects traced it ~60 times. The trace reads the union of the tasks'
393
- * directories once, then every task is judged by `judge` on the projects it
394
- * alone answers for, exactly as `runGate` judges one — a breach the shared
395
- * trace found fails only the task whose project owns it, which is what keeps
396
- * a batch's verdicts the same as the separate runs' would have been.
272
+ * Gates every task of a batch from one trace of their combined scope, judging each task by
273
+ * the projects it owns.
397
274
  */
398
275
  runGateBatch(args: RunGateBatchArguments): Promise<Record<string, RunTraceResult>>;
399
276
  /**
400
- * Traces the resolved directories and renders the report.
401
- *
402
- * This is the whole of the "logic on top of core callidescope": the
403
- * selection above is Nx's to resolve, and everything below this line is
404
- * callidescope's own, reached through the same services the `callidescope`
405
- * command uses rather than through a subprocess.
406
- *
407
- * Judged by the same predicate the gate is, so the two targets cannot come
408
- * to disagree about what a passing run is. A run that read nothing keeps its
409
- * report and gains the reason underneath it: a summary table of zeroes is
410
- * what happened, not why it failed.
411
- *
412
- * The one rule the two act on differently: a judged project none of whose
413
- * own files were read is **printed here and not failed on**, where a gate
414
- * fails — see `judge` for why that is the one exemption.
277
+ * Traces the resolved directories and renders the report, judged by the gate's predicate.
278
+ * Unread projects print but do not fail.
415
279
  */
416
280
  runTrace(args: RunTraceArguments): Promise<RunTraceResult>;
417
281
  }
@@ -423,79 +287,35 @@ export declare class ProjectsModule {
423
287
  /**
424
288
  * Resolves Nx project names to the directories a callidescope run traces.
425
289
  *
426
- * This is the whole of callidescope's Nx awareness. `callidescope-cli` and
427
- * `callidescope-graph` know nothing about Nx and never read a project graph;
428
- * they take directories. What an Nx workspace has that plain paths do not is
429
- * a stable name for each of those directories, and turning one into the other
430
- * is the only thing this package is for.
431
- *
432
- * The project graph is passed in rather than read here, so every resolution
433
- * rule below is testable without a workspace to build a graph from —
434
- * `readProjectGraph` is the one method that touches Nx at run time.
290
+ * Only this part of callidescope knows about Nx. The project graph is passed in, so resolution is testable without a workspace.
435
291
  */
436
292
  export declare class ProjectsService {
437
293
  constructor();
438
294
  /** Every tag any project carries, sorted and deduplicated. */
439
295
  private readTags;
440
296
  /**
441
- * Collects the names of every project carrying any of the given tags, and
442
- * the tags nothing carries.
443
- *
444
- * Any of them rather than all of them. Nx tags come in families whose
445
- * members are mutually exclusive on one project — nothing is both
446
- * `type:application` and `type:package` — so requiring every tag would make
447
- * the common selection resolve to nothing. Any is also the reading that
448
- * composes: each tag widens the set, the way naming another project does.
297
+ * Collects projects carrying any of the given tags, and the tags nothing carries. Any, not all,
298
+ * since tag families exclude each other.
449
299
  */
450
300
  private resolveTaggedNames;
451
301
  /** Reads the workspace's Nx project graph. */
452
302
  readProjectGraph(): Promise<ProjectGraph>;
453
303
  /**
454
- * Lists every project the graph knows, sorted by name.
455
- *
456
- * A project rooted at the workspace root is kept rather than filtered out.
457
- * It resolves to `.`, which `--directories` accepts, and naming it is a
458
- * caller saying they mean the root program — a different thing from
459
- * omitting `--directories`, which walks the workspace for every
460
- * `tsconfig.json` there is.
304
+ * Lists every project the graph knows, sorted by name, keeping the root project,
305
+ * which resolves to `.`.
461
306
  */
462
307
  readProjects(graph: ProjectGraph): NxProject[];
463
308
  /**
464
- * Widens a set of project names to include everything they depend on.
465
- *
466
- * Dependencies, never dependents. A call stack runs downward — a command
467
- * calls into the service it was injected with, which lives in a package it
468
- * depends on — and those packages are what a trace of one project has to
469
- * carry. Its dependents call *into* it and add no frames below it.
470
- *
471
- * This widens what the run is *scoped to*, not how far a stack runs:
472
- * `WorkspaceService.walkImportedProjectClosure` already builds the program
473
- * of every project the named directories transitively import. What the Nx
474
- * graph adds is edges the compiler never read — an implicit dependency, or
475
- * one that exists only at run time. Being scoped rather than merely reached
476
- * costs nothing in this plugin, which writes nothing anywhere; it is the
477
- * command-line host that acts on it, publishing a `README.md` section for a
478
- * scoped project on a `--write` run.
479
- *
480
- * External `npm:` targets are dropped: they have no workspace directory to
481
- * trace, and following them would mean tracing `node_modules`.
309
+ * Widens project names to their dependencies, not dependents, since stacks run downward.
310
+ * External `npm:` targets are dropped.
482
311
  */
483
312
  resolveDependencyClosure(args: {
484
313
  graph: ProjectGraph;
485
314
  projectNames: readonly string[];
486
315
  }): string[];
487
316
  /**
488
- * Resolves Nx project names and tags to their workspace-relative roots.
489
- *
490
- * The two selections are unioned, not intersected: naming a project and
491
- * naming a tag both widen what gets traced, and a project reached both ways
492
- * is still one directory. Intersecting them would make `--tags` a filter on
493
- * `--projects`, which would resolve to nothing whenever only one was given.
494
- *
495
- * Unknown names and unmatched tags are collected rather than dropped or
496
- * thrown on, so one resolution reports every typo at once instead of one
497
- * per run, and the caller decides whether a partial resolution is worth
498
- * tracing.
317
+ * Resolves project names and tags to workspace-relative roots, merging them and collecting
318
+ * unknown names rather than throwing.
499
319
  */
500
320
  resolveDirectories(args: {
501
321
  graph: ProjectGraph;
@@ -503,12 +323,8 @@ export declare class ProjectsService {
503
323
  tags?: readonly string[] | undefined;
504
324
  }): ResolvedProjectDirectories;
505
325
  /**
506
- * Resolves names and tags to the project names they stand for.
507
- *
508
- * Separate from `resolveDirectories` because a directory is the last step,
509
- * not the only one: widening a selection along the Nx dependency graph
510
- * happens between the two, and it happens in names, which is the only
511
- * vocabulary the project graph speaks.
326
+ * Resolves names and tags to project names, kept separate from directories because widening
327
+ * happens in names.
512
328
  */
513
329
  resolveProjectNames(args: {
514
330
  graph: ProjectGraph;
@@ -534,7 +350,7 @@ export declare interface ResolvedProjectDirectories extends ResolvedProjectSelec
534
350
  readonly directories: string[];
535
351
  }
536
352
 
537
- /** What a set of Nx project names and tags resolved to, before directories. */
353
+ /** Resolved project names and tags, before directories. */
538
354
  export declare interface ResolvedProjectSelection {
539
355
  /**
540
356
  * Every project name the graph knew, sorted — what a caller names back when
@@ -548,22 +364,9 @@ export declare interface ResolvedProjectSelection {
548
364
  readonly knownTags: string[];
549
365
  /** The projects the selection reached, sorted and deduplicated. */
550
366
  readonly projectNames: string[];
551
- /**
552
- * The names the project graph does not know, in the order they were given.
553
- *
554
- * Reported rather than dropped: a name nobody resolves is a trace that
555
- * silently covers less than it was asked to, which is the one failure a
556
- * report cannot show you.
557
- */
367
+ /** Names the project graph does not know, in the order given. Reported, since a silently dropped name covers less than asked. */
558
368
  readonly unknownNames: string[];
559
- /**
560
- * The tags no project in the workspace carries, in the order they were
561
- * given.
562
- *
563
- * Refused for the same reason an unknown name is: a tag matching nothing is
564
- * far more often a typo than an empty category, and either way the run it
565
- * would produce covers less than it was asked to without saying so.
566
- */
369
+ /** Tags no project carries, in the order given. Refused like an unknown name, since a tag matching nothing is usually a typo. */
567
370
  readonly unmatchedTags: string[];
568
371
  }
569
372
 
@@ -577,14 +380,7 @@ export declare interface ResolvedTraceScope {
577
380
  readonly knownTags: string[];
578
381
  /** Every project the selection reached, including pulled-in dependencies. */
579
382
  readonly projectNames: string[];
580
- /**
581
- * Directories of the projects the selection itself named, before the
582
- * dependency widening.
583
- *
584
- * What a verdict covers, where `directories` is what a trace reads: a
585
- * dependency pulled in to keep a stack from stopping at a package boundary
586
- * is measured by this run and judged by its own.
587
- */
383
+ /** Directories of the projects the selection named, before dependency widening. What a verdict covers, not what a trace reads. */
588
384
  readonly selectedDirectories: string[];
589
385
  /** Names the workspace does not have. */
590
386
  readonly unknownNames: string[];
@@ -614,31 +410,20 @@ declare interface ResolveTraceScopeArguments {
614
410
  /**
615
411
  * Reads the callidescope configuration one run is judged by.
616
412
  *
617
- * Its own service rather than more of `PluginService`, because every target
618
- * here starts by reading the same file — the one its `configurationPath` names
619
- * — and none of them can be written until it is read. Keeping
620
- * it apart also keeps the verdict and the inference in `PluginService` beside
621
- * each other, which is where the rules a reader comes looking for are.
413
+ * Kept apart from `PluginService` because every target reads this file first. Keeping it
414
+ * separate leaves the verdict and inference together in `PluginService`.
622
415
  */
623
416
  declare class RunConfigurationService {
624
417
  private readonly configurationService;
625
418
  constructor(configurationService: ConfigurationService);
626
419
  /**
627
- * Resolves and loads the configuration one run is judged by.
628
- *
629
- * The file-aware load rather than the plain one: a run resolves a
630
- * configuration beside every project it reaches, and skips whichever file is
631
- * already serving as this run's own.
420
+ * Resolves and loads the configuration one run is judged by, skipping whichever file is already
421
+ * this run's own.
632
422
  */
633
423
  load(args: LoadRunConfigurationArguments): Promise<LoadedRunConfiguration>;
634
424
  }
635
425
 
636
- /**
637
- * Arguments for gating one resolved selection against its limits.
638
- *
639
- * The trace's arguments without `format`: a gate's output is the findings that
640
- * decided its exit code, so there is no second rendering of it to ask for.
641
- */
426
+ /** Trace arguments without `format`: a gate prints its findings. */
642
427
  declare type RunGateArguments = Omit<RunTraceArguments, "format">;
643
428
 
644
429
  /** Arguments for gating several tasks from one trace. */
@@ -649,7 +434,7 @@ declare interface RunGateBatchArguments {
649
434
  readonly workspaceRoot: string;
650
435
  }
651
436
 
652
- /** One task of a gate batch: the projects it reads and the ones it answers for. */
437
+ /** Gate batch task: projects read, and projects answered for. */
653
438
  declare interface RunGateBatchTask {
654
439
  /** Workspace-relative directories the task's trace reads. */
655
440
  readonly directories: readonly string[];
@@ -666,18 +451,7 @@ declare interface RunTraceArguments {
666
451
  readonly directories: readonly string[];
667
452
  /** What the run prints. Defaults to markdown when omitted. */
668
453
  readonly format?: CallidescopeOutputFormat | undefined;
669
- /**
670
- * The projects whose findings decide the verdict.
671
- *
672
- * A subset of `directories`, which is what gets traced: a run reaches into
673
- * the dependencies of what it was pointed at, and a finding there belongs
674
- * to the task named after the project that owns it.
675
- *
676
- * Workspace-relative roots, because that is what callidescope calls a
677
- * project name — `WorkspaceService.discoverProjects` names each project by
678
- * the directory holding its `tsconfig.json`, and a report's `projectName`
679
- * is that same string. An Nx project name would match nothing.
680
- */
454
+ /** Projects whose findings decide the verdict: a subset of `directories`, named by callidescope's own project roots, not Nx names. */
681
455
  readonly judgedProjectNames: readonly string[];
682
456
  readonly workspaceRoot: string;
683
457
  }
@@ -688,94 +462,32 @@ export declare interface RunTraceResult {
688
462
  readonly report: string;
689
463
  }
690
464
 
691
- /**
692
- * What one predicate decided about a traced result.
693
- *
694
- * The findings come back with the verdict so the rendering shows what was
695
- * judged rather than what was measured — the two differ for every scoped run.
696
- *
697
- * `reason` carries the rendering a verdict owes the reader when the findings
698
- * cannot explain it themselves — a run that read nothing has no finding to
699
- * show, and a bare red task there is the guessing game this rule exists to
700
- * end.
701
- */
465
+ /** One predicate's decision. `reason` explains what findings cannot. */
702
466
  declare interface RunVerdict {
703
467
  readonly findings: OwnedFindings;
704
468
  /** Whether every rule both targets share was cleared. */
705
469
  readonly ok: boolean;
706
470
  readonly reason: string | undefined;
707
- /**
708
- * Judged projects none of whose own files were read.
709
- *
710
- * Reported beside `ok` rather than folded into it, because this is the one
711
- * rule the two targets act on differently: a `gate` fails on it, a `trace`
712
- * prints it and passes. Every project the workspace configuration excludes
713
- * reads nothing of its own and keeps its trace while losing its gate, so a
714
- * trace failing here would be permanently red for being configured as asked.
715
- * The rule itself still lives in one place — `PluginService.judge` — and only
716
- * the consequence is the caller's.
717
- */
471
+ /** Judged projects none of whose own files were read. A `gate` fails on this and a `trace` prints it and passes. */
718
472
  readonly unreadProjectNames: readonly string[];
719
473
  }
720
474
 
721
475
  /**
722
476
  * Decides whether a traced result passes, for every target that reads one.
723
477
  *
724
- * Its own service so one trace can be judged once per project: a batch of
725
- * gates traces the workspace a single time and asks this the same question of
726
- * each project, which is why a verdict takes the result and the projects to
727
- * judge rather than a trace to run.
478
+ * One trace serves a batch: this judges each project from the same result. A verdict takes the result and the projects to judge, not a trace to run.
728
479
  */
729
480
  declare class VerdictService {
730
481
  private readonly projectReportsService;
731
482
  constructor(projectReportsService: ProjectReportsService);
732
483
  /**
733
- * The block a verdict owes the reader when its findings cannot explain it.
734
- *
735
- * Both targets print this and only one fails on it — see `judge` — because
736
- * an unread project is a fact about the run either way. The unread projects
737
- * come first when both apply: they name what went missing, where the
738
- * whole-run reason can only say that something did.
484
+ * The block a verdict owes the reader when its findings cannot explain it. Unread projects come
485
+ * first, since they name what went missing.
739
486
  */
740
487
  explain(verdict: RunVerdict): string | undefined;
741
488
  /**
742
- * Decides whether a traced result passes, for every target that reads one.
743
- *
744
- * One predicate rather than the same expression beside each caller, so a
745
- * rule added here cannot reach one verdict and miss the other.
746
- *
747
- * **Only the projects the run was scoped to are judged.** A trace reaches
748
- * into the dependencies of what it was pointed at, so judging the whole
749
- * run's findings would fail `alpha`'s task for a breach in `beta`. The same
750
- * line the publishing side already draws, one step further along:
751
- * measurement reaches into dependencies, publishing does not, and judging
752
- * does not either. A dependency's breach is its own gate's business, and
753
- * `nx affected` selects it too when it changes, so nothing escapes a verdict.
754
- *
755
- * **A judged project none of whose own files were read is named back**, the
756
- * case `callidescope`'s own `reportEmptyTrace` fails for the same reason: a
757
- * gate that passes because it never looked reports the project as clean.
758
- * Asked of each judged project rather than of the whole run, because
759
- * narrowing made those two different questions — a project with dependencies
760
- * has a non-empty run whatever became of its own sources, so its own
761
- * `exclude` over-matching would otherwise leave it owning no finding and
762
- * passing green. The whole run is asked too, for a run judging no project at
763
- * all.
764
- *
765
- * It is the one rule whose **consequence** is the caller's rather than this
766
- * predicate's, and so the one thing `unreadProjectNames` is returned beside
767
- * `ok` for: a `gate` fails on it and a `trace` prints it and passes. Every
768
- * project the workspace configuration excludes reads nothing of its own and
769
- * is denied a gate while keeping its trace, so failing the trace too would
770
- * make that project's target permanently red for being configured exactly as
771
- * it was asked to be. Finding the projects stays here either way, so the
772
- * rule cannot be applied to one verdict and forgotten by the other.
773
- *
774
- * **Depth is judged always, breadth wherever a limit exists** — not two
775
- * modes to be selected between. `maximumDepth` has a default and
776
- * `maximumBreadth` has none at any level, so a project declaring no breadth
777
- * limit can produce no breadth finding to fail on. Reading the findings
778
- * rather than naming a check is what keeps that true without a decision.
489
+ * Decides whether a traced result passes, judging only in-scope projects. Unread judged projects
490
+ * are named back to the caller.
779
491
  */
780
492
  judge(args: {
781
493
  judgedProjectNames: readonly string[];
package/package.json CHANGED
@@ -4,11 +4,11 @@
4
4
  "url": "https://github.com/organizzolini/codebase/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@callidescope/cli": "0.0.78",
8
- "@callidescope/configuration": "0.0.78",
9
- "@callidescope/core": "0.0.77",
10
- "@callidescope/graph": "0.0.77",
11
- "@callidescope/output": "0.0.77",
7
+ "@callidescope/cli": "0.0.80",
8
+ "@callidescope/configuration": "0.0.80",
9
+ "@callidescope/core": "0.0.79",
10
+ "@callidescope/graph": "0.0.79",
11
+ "@callidescope/output": "0.0.79",
12
12
  "@nestjs/common": "^11.1.21 || ^12.0.1",
13
13
  "@nestjs/core": "^11.1.21 || ^12.0.1",
14
14
  "@nx/devkit": "^24.0.0",
@@ -80,5 +80,5 @@
80
80
  "strict": true
81
81
  },
82
82
  "types": "./dist/src/index.d.ts",
83
- "version": "0.0.79"
83
+ "version": "0.0.81"
84
84
  }