@callidescope/output 0.0.77 → 0.0.79
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 +24 -0
- package/dist/src/index.d.ts +125 -513
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## 0.0.79 (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-graph to 0.0.79
|
|
11
|
+
- Updated callidescope-core to 0.0.79
|
|
12
|
+
|
|
13
|
+
## 0.0.78 (2026-11-10)
|
|
14
|
+
|
|
15
|
+
### 🚀 Features
|
|
16
|
+
|
|
17
|
+
- **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))
|
|
18
|
+
|
|
19
|
+
### 🧱 Updated Dependencies
|
|
20
|
+
|
|
21
|
+
- Updated callidescope-configuration to 0.0.79
|
|
22
|
+
- Updated callidescope-graph to 0.0.78
|
|
23
|
+
- Updated callidescope-core to 0.0.78
|
|
24
|
+
|
|
1
25
|
## 0.0.77 (2026-11-10)
|
|
2
26
|
|
|
3
27
|
### 🧱 Updated Dependencies
|
package/dist/src/index.d.ts
CHANGED
|
@@ -37,10 +37,9 @@ export declare class AddressReportModule {
|
|
|
37
37
|
/**
|
|
38
38
|
* Renders `depth` and `breadth`'s findings for a terminal.
|
|
39
39
|
*
|
|
40
|
-
* Markdown by default
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* text. JSON carries the same data with nothing rendered.
|
|
40
|
+
* Markdown by default, mermaid on request, as `callidescope` prints them.
|
|
41
|
+
* Mermaid is paste-ready source; markdown reads well as terminal text.
|
|
42
|
+
* JSON carries the same data unrendered.
|
|
44
43
|
*/
|
|
45
44
|
export declare class AddressReportService {
|
|
46
45
|
private readonly mermaidReportService;
|
|
@@ -61,21 +60,15 @@ export declare class AddressReportService {
|
|
|
61
60
|
/** Renders one callable's direct callers and callees. */
|
|
62
61
|
renderBreadth(args: RenderBreadthArguments): string;
|
|
63
62
|
/**
|
|
64
|
-
* Renders several callables' direct calls as one document.
|
|
65
|
-
*
|
|
66
|
-
* JSON is **always** an array, whatever the address count, so a script can
|
|
67
|
-
* `JSON.parse` a run's output without branching on how many addresses it
|
|
68
|
-
* asked about. Markdown and mermaid concatenate the per-callable renders,
|
|
69
|
-
* each of which already carries its own heading naming the address.
|
|
63
|
+
* Renders several callables' direct calls as one document. JSON is always an array,
|
|
64
|
+
* whatever the address count.
|
|
70
65
|
*/
|
|
71
66
|
renderBreadthReports(args: RenderBreadthReportsArguments): string;
|
|
72
67
|
/** Renders the paths traced above and below one callable. */
|
|
73
68
|
renderDepth(args: RenderDepthArguments): string;
|
|
74
69
|
/**
|
|
75
|
-
* Renders several callables' traced paths as one document.
|
|
76
|
-
*
|
|
77
|
-
* JSON is **always** an array, for the same reason `renderBreadthReports`
|
|
78
|
-
* does it: one run, one parseable document, regardless of address count.
|
|
70
|
+
* Renders several callables' traced paths as one document. JSON is always an array,
|
|
71
|
+
* whatever the address count.
|
|
79
72
|
*/
|
|
80
73
|
renderDepthReports(args: RenderDepthReportsArguments): string;
|
|
81
74
|
}
|
|
@@ -134,25 +127,10 @@ export declare interface FindOwnedFindingsArguments {
|
|
|
134
127
|
readonly reports: readonly ProjectReport[];
|
|
135
128
|
}
|
|
136
129
|
|
|
137
|
-
/**
|
|
138
|
-
* The start marker of any anchored block this convention recognizes, not
|
|
139
|
-
* just the one a given destination owns.
|
|
140
|
-
*
|
|
141
|
-
* Used to find where a corrupted block — a start marker with no matching
|
|
142
|
-
* end — has to stop being replaced: at another block's own territory,
|
|
143
|
-
* never past it.
|
|
144
|
-
*/
|
|
130
|
+
/** Start marker of an anchored block. Replacement stops at other blocks. */
|
|
145
131
|
export declare const FOREIGN_ANCHOR_PATTERN: RegExp;
|
|
146
132
|
|
|
147
|
-
/**
|
|
148
|
-
* Anything holding a frame list, whether or not it is a full `CallStack`.
|
|
149
|
-
*
|
|
150
|
-
* `ReportService.renderStackTree` and `MermaidReportService.renderStacks`
|
|
151
|
-
* only ever read `frames`, so this is what they accept: a full `CallStack`
|
|
152
|
-
* satisfies it, and so does a path with no depth or entry-point kind of its
|
|
153
|
-
* own, such as one traced from an arbitrary address rather than a recognized
|
|
154
|
-
* entry point.
|
|
155
|
-
*/
|
|
133
|
+
/** Anything holding a frame list, such as a `CallStack`. */
|
|
156
134
|
export declare interface FramedStack {
|
|
157
135
|
readonly frames: readonly StackFrame[];
|
|
158
136
|
}
|
|
@@ -166,13 +144,7 @@ export declare const HEADROOM_BUCKET_FOUR_PLUS = "4+";
|
|
|
166
144
|
/** Bucket holding the projects one frame from their own limit. */
|
|
167
145
|
export declare const HEADROOM_BUCKET_ONE = "1";
|
|
168
146
|
|
|
169
|
-
/**
|
|
170
|
-
* The order the scoreboard prints its buckets in, tightest first.
|
|
171
|
-
*
|
|
172
|
-
* A fixed list rather than the keys a run happened to produce, so a bucket
|
|
173
|
-
* nothing fell into is still printed as a zero. "Nothing is over its limit" is
|
|
174
|
-
* the row a reader came for, and an absent row cannot say it.
|
|
175
|
-
*/
|
|
147
|
+
/** Scoreboard bucket order, tightest first. Fixed, so empty ones still print. */
|
|
176
148
|
export declare const HEADROOM_BUCKET_ORDER: readonly ["over limit", "0 — at limit", "1", "2–3", "4+", "no stacks"];
|
|
177
149
|
|
|
178
150
|
/** Bucket holding the projects whose deepest stack broke their own limit. */
|
|
@@ -181,26 +153,10 @@ export declare const HEADROOM_BUCKET_OVER_LIMIT = "over limit";
|
|
|
181
153
|
/** Bucket holding the projects two or three frames from their own limit. */
|
|
182
154
|
export declare const HEADROOM_BUCKET_TWO_TO_THREE = "2\u20133";
|
|
183
155
|
|
|
184
|
-
/**
|
|
185
|
-
* Bucket holding the projects that measured no stack at all.
|
|
186
|
-
*
|
|
187
|
-
* Named rather than folded into the widest headroom bucket: a project whose
|
|
188
|
-
* deepest stack is zero is not a project with room to spare, it is a project
|
|
189
|
-
* whose limit gates nothing, and those are opposite findings.
|
|
190
|
-
*/
|
|
156
|
+
/** Bucket for projects with no stack. Such a limit gates nothing. */
|
|
191
157
|
export declare const HEADROOM_BUCKET_UNMEASURED = "no stacks";
|
|
192
158
|
|
|
193
|
-
/**
|
|
194
|
-
* Structured values that belong beside a log line rather than inside it.
|
|
195
|
-
*
|
|
196
|
-
* Counts, percentages, and durations are the values that change on every
|
|
197
|
-
* occurrence, so they are carried as fields: the message stays constant and
|
|
198
|
-
* groupable in telemetry, and the numbers stay queryable instead of having to
|
|
199
|
-
* be parsed back out of prose.
|
|
200
|
-
*
|
|
201
|
-
* The named members are the recurring ones; the index signature keeps the
|
|
202
|
-
* argument open for whatever a given call site needs to attach.
|
|
203
|
-
*/
|
|
159
|
+
/** Values beside the log line, kept as queryable fields. */
|
|
204
160
|
declare interface LogData {
|
|
205
161
|
[key: string]: unknown;
|
|
206
162
|
/** How many things the operation handled. */
|
|
@@ -214,20 +170,10 @@ declare interface LogData {
|
|
|
214
170
|
}
|
|
215
171
|
|
|
216
172
|
/**
|
|
217
|
-
* Transient
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* Messages follow one grammar: an emoji naming the subject, a verb in present
|
|
223
|
-
* progressive or past tense, then the object. Values that vary per call —
|
|
224
|
-
* counts, percentages, durations — go in the `data` argument rather than the
|
|
225
|
-
* message, so the message stays constant enough for telemetry to group on.
|
|
226
|
-
*
|
|
227
|
-
* ```ts
|
|
228
|
-
* this.logger.info("📥 Downloading CSEL sources", undefined, { total: 428 });
|
|
229
|
-
* this.logger.info("📥 Downloaded CSEL sources", undefined, { count: 412 });
|
|
230
|
-
* ```
|
|
173
|
+
* Transient logger, so each injecting class gets its own instance. Consumers
|
|
174
|
+
* call `setContext(ClassName.name)`. Backed by pino: JSON in production,
|
|
175
|
+
* pretty-printed in development. Messages start with an emoji naming the subject,
|
|
176
|
+
* then a present or past-tense verb. Varying values such as counts go in `data`.
|
|
231
177
|
*/
|
|
232
178
|
declare @Injectable({ scope: Scope.TRANSIENT })
|
|
233
179
|
class LoggerService
|
|
@@ -245,12 +191,7 @@ implements LoggerServiceContract
|
|
|
245
191
|
private static readonly isProduction =
|
|
246
192
|
process.env["NODE_ENV"] === "production";
|
|
247
193
|
|
|
248
|
-
/**
|
|
249
|
-
* Built on first use, not when this file is evaluated.
|
|
250
|
-
*
|
|
251
|
-
* A destination fixed at import time could only ever be chosen by this
|
|
252
|
-
* package, since every consumer's own code runs after its imports.
|
|
253
|
-
*/
|
|
194
|
+
/** Built lazily, so `logToStandardError` can still set the destination. */
|
|
254
195
|
private static rootLogger: pino.Logger | undefined;
|
|
255
196
|
|
|
256
197
|
/** Whether lines go to standard error instead of standard output. */
|
|
@@ -293,18 +234,8 @@ implements LoggerServiceContract
|
|
|
293
234
|
}
|
|
294
235
|
|
|
295
236
|
/**
|
|
296
|
-
* Sends
|
|
297
|
-
*
|
|
298
|
-
* For a command-line application whose standard output *is* its result. A log
|
|
299
|
-
* line sharing that stream is not a diagnostic beside the data, it is a
|
|
300
|
-
* corruption of it. Call it before anything logs — the first statement of the
|
|
301
|
-
* application's bootstrap.
|
|
302
|
-
*
|
|
303
|
-
* A call after the first line warns and changes nothing: the destination is
|
|
304
|
-
* fixed when the pino instance is built, and tearing down a transport
|
|
305
|
-
* somebody is writing through would be worse than refusing. The warning is
|
|
306
|
-
* the point — silently leaving the lines on standard output is how a caller
|
|
307
|
-
* would ship a corrupted pipe without ever being told.
|
|
237
|
+
* Sends later lines to standard error, for a command whose stdout is its
|
|
238
|
+
* result. Call it first; later calls warn and change nothing.
|
|
308
239
|
*/
|
|
309
240
|
static logToStandardError(): void {
|
|
310
241
|
if (LoggerService.rootLogger !== undefined) {
|
|
@@ -318,10 +249,8 @@ implements LoggerServiceContract
|
|
|
318
249
|
}
|
|
319
250
|
|
|
320
251
|
/**
|
|
321
|
-
* Fails a malformed message in development,
|
|
322
|
-
*
|
|
323
|
-
* A logger that throws in production turns an observability call into an
|
|
324
|
-
* outage, so the check runs only where a developer is present to fix it.
|
|
252
|
+
* Fails a malformed message in development only, since a throw in production
|
|
253
|
+
* would turn logging into an outage.
|
|
325
254
|
*/
|
|
326
255
|
private assertConventionalMessage(args: {
|
|
327
256
|
context: string | undefined;
|
|
@@ -381,11 +310,8 @@ implements LoggerServiceContract
|
|
|
381
310
|
}
|
|
382
311
|
|
|
383
312
|
/**
|
|
384
|
-
* Whether a word is a
|
|
385
|
-
*
|
|
386
|
-
* Present progressive means the operation is under way; past means it
|
|
387
|
-
* finished. Regular morphology covers both, so a new verb needs no
|
|
388
|
-
* registration anywhere — only irregular pasts are enumerated.
|
|
313
|
+
* Whether a word is a present-progressive or past-tense verb. Only irregular
|
|
314
|
+
* pasts need listing; regular morphology covers the rest.
|
|
389
315
|
*/
|
|
390
316
|
private isConventionalVerb(word: string): boolean {
|
|
391
317
|
const lowercased = word.toLowerCase();
|
|
@@ -461,11 +387,8 @@ implements LoggerServiceContract
|
|
|
461
387
|
}
|
|
462
388
|
|
|
463
389
|
/**
|
|
464
|
-
* Logs
|
|
465
|
-
*
|
|
466
|
-
* `ConsoleLogger.error` spends a third slot on a context string that the
|
|
467
|
-
* other levels do not have, so this one accepts either: a string keeps
|
|
468
|
-
* NestJS's meaning, an object is structured data like everywhere else.
|
|
390
|
+
* Logs at the `error` level. The second argument is a stack, the third a
|
|
391
|
+
* context string or structured data.
|
|
469
392
|
*/
|
|
470
393
|
override error(
|
|
471
394
|
message: unknown,
|
|
@@ -496,12 +419,8 @@ implements LoggerServiceContract
|
|
|
496
419
|
}
|
|
497
420
|
|
|
498
421
|
/**
|
|
499
|
-
* Logs
|
|
500
|
-
*
|
|
501
|
-
* NestJS and `nest-commander` call this method directly as part of the
|
|
502
|
-
* framework's own `LoggerService` contract, so it must keep working
|
|
503
|
-
* exactly as before. Application code should call `info` instead — the
|
|
504
|
-
* same behavior under a name that says what level it logs at.
|
|
422
|
+
* Logs at the `info` level, as NestJS and `nest-commander` call it.
|
|
423
|
+
* Application code should call `info` instead.
|
|
505
424
|
*/
|
|
506
425
|
override log(message: unknown, context?: string, data?: LogData): void {
|
|
507
426
|
this.info(message, context, data);
|
|
@@ -532,7 +451,7 @@ implements LoggerServiceContract
|
|
|
532
451
|
}
|
|
533
452
|
}
|
|
534
453
|
|
|
535
|
-
/**
|
|
454
|
+
/** Public logger shape, for test doubles without the service. */
|
|
536
455
|
declare interface LoggerServiceContract extends ConsoleLogger {
|
|
537
456
|
/** Normalizes unknown errors into a stable message and timestamped log line. */
|
|
538
457
|
buildErrorLogEntry(
|
|
@@ -547,23 +466,10 @@ declare interface LoggerServiceContract extends ConsoleLogger {
|
|
|
547
466
|
info(message: unknown, context?: string, data?: LogData): void;
|
|
548
467
|
}
|
|
549
468
|
|
|
550
|
-
/**
|
|
551
|
-
* Heading over the call stacks that ran deeper than their project allows.
|
|
552
|
-
*
|
|
553
|
-
* A constant rather than a literal because two renderings write it — the
|
|
554
|
-
* whole-run report, and the findings-only rendering a gate prints — and a
|
|
555
|
-
* reader who greps a failed pipeline for one of them must find the other.
|
|
556
|
-
*/
|
|
469
|
+
/** Heading for stacks deeper than allowed, identical in both renderings. */
|
|
557
470
|
export declare const MARKDOWN_DEEP_STACKS_HEADING = "Call stacks over the depth limit";
|
|
558
471
|
|
|
559
|
-
/**
|
|
560
|
-
* How each anchored destination draws the stacks it carries.
|
|
561
|
-
*
|
|
562
|
-
* One list rather than the pair written out at each of the two places a run
|
|
563
|
-
* writes anchored blocks — its own and every project's — because the pairing is
|
|
564
|
-
* the same fact both times, and two copies of it are two places for `mermaid`
|
|
565
|
-
* to start printing trees.
|
|
566
|
-
*/
|
|
472
|
+
/** How each anchored destination draws stacks. Keeps `mermaid` from printing trees. */
|
|
567
473
|
export declare const MARKDOWN_DESTINATION_RENDERINGS: readonly [readonly ["markdown", "tree"], readonly ["mermaid", "diagram"]];
|
|
568
474
|
|
|
569
475
|
/** Header of the depth-headroom scoreboard. */
|
|
@@ -584,9 +490,8 @@ export declare const MARKDOWN_WIDE_CALLABLES_HEADING = "Callables over the bread
|
|
|
584
490
|
/**
|
|
585
491
|
* Renders a run, or one project's slice of it, as markdown.
|
|
586
492
|
*
|
|
587
|
-
* Markdown
|
|
588
|
-
*
|
|
589
|
-
* project's own README — and only one of those can read anything else.
|
|
493
|
+
* Markdown serves a terminal, a report file, and a section spliced into a
|
|
494
|
+
* project's README alike. Only markdown reads well in all three.
|
|
590
495
|
*/
|
|
591
496
|
export declare class MarkdownReportService {
|
|
592
497
|
private readonly mermaidReportService;
|
|
@@ -594,40 +499,18 @@ export declare class MarkdownReportService {
|
|
|
594
499
|
private readonly workspaceReportService;
|
|
595
500
|
constructor(mermaidReportService: MermaidReportService, reportService: ReportService, workspaceReportService: WorkspaceReportService);
|
|
596
501
|
/**
|
|
597
|
-
* Renders each callable's breadth, the first few openly and the rest
|
|
598
|
-
*
|
|
599
|
-
*
|
|
600
|
-
* Shared by both scopes: a project section passes every callable with a
|
|
601
|
-
* direct callee, unfiltered by any limit, the same way its stacks are;
|
|
602
|
-
* a whole-run section passes only the `WideCallableFinding`s that broke
|
|
603
|
-
* the configured limit. `WideCallableFinding` is a `CallableBreadthReport`
|
|
604
|
-
* with a `limit` added, so one renderer covers both without caring which
|
|
605
|
-
* it was handed. Unfiltered, a project's breadth table is one row per
|
|
606
|
-
* non-leaf callable — every bit as unbounded as its stacks — so it earns
|
|
607
|
-
* the same truncation rather than a bare table.
|
|
502
|
+
* Renders each callable's breadth, the first few openly and the rest behind a disclosure, shared
|
|
503
|
+
* by project and run sections.
|
|
608
504
|
*/
|
|
609
505
|
private renderCallableBreadths;
|
|
610
506
|
/**
|
|
611
|
-
* Renders one limit's value cell
|
|
612
|
-
*
|
|
613
|
-
* A limit the project does not declare prints `none` rather than a number,
|
|
614
|
-
* which is breadth's usual case: it has no default at any level, so a
|
|
615
|
-
* project writing `maximumBreadth: undefined` is gated on breadth by nothing
|
|
616
|
-
* at all, and printing some number there would say the opposite.
|
|
507
|
+
* Renders one limit's value cell, printing `none` for an undeclared limit rather than a number
|
|
508
|
+
* that implies a gate.
|
|
617
509
|
*/
|
|
618
510
|
private renderLimitCell;
|
|
619
511
|
/**
|
|
620
|
-
* Renders the two limits one project is judged against
|
|
621
|
-
*
|
|
622
|
-
* A project's block already carried its deepest stack and its widest
|
|
623
|
-
* callable; what it could not say is what either number is measured against.
|
|
624
|
-
* That was inferable while one workspace number gated everything and is not
|
|
625
|
-
* inferable now — the limit is a fact about this project, and fifty projects
|
|
626
|
-
* hold fifty answers.
|
|
627
|
-
*
|
|
628
|
-
* There is no origin column, because there is no second origin left: every
|
|
629
|
-
* traced project's configuration is complete, so both numbers are written in
|
|
630
|
-
* the file beside this readme or the run refused to start.
|
|
512
|
+
* Renders the two limits one project is judged against, since a limit is a fact about that
|
|
513
|
+
* project alone.
|
|
631
514
|
*/
|
|
632
515
|
private renderProjectLimits;
|
|
633
516
|
/** Renders one stack: a labelled heading line and its tree in a fence. */
|
|
@@ -639,87 +522,44 @@ export declare class MarkdownReportService {
|
|
|
639
522
|
/** Renders a table, or says plainly that there was nothing to put in one. */
|
|
640
523
|
private renderTable;
|
|
641
524
|
/**
|
|
642
|
-
* Names each callable that broke its breadth limit,
|
|
643
|
-
*
|
|
644
|
-
* A line rather than `renderCallableBreadths`' table, and deliberately not
|
|
645
|
-
* that method reused: the table's columns say what a callable calls, and a
|
|
646
|
-
* finding's product is the number it broke. `limit` is per project now, so a
|
|
647
|
-
* reader cannot infer it from the run the way a single workspace-wide number
|
|
648
|
-
* could be inferred — it has to be printed beside the breadth it failed.
|
|
525
|
+
* Names each callable that broke its breadth limit, one line each, printing the project's `limit`
|
|
526
|
+
* beside it.
|
|
649
527
|
*/
|
|
650
528
|
private renderWideCallableLines;
|
|
651
529
|
/**
|
|
652
|
-
* The heading prefix one level below the block's own
|
|
653
|
-
*
|
|
654
|
-
* Derived rather than fixed, so a block spliced under an `##` heading writes
|
|
655
|
-
* `###` subsections and stays a well-formed subtree of the file it landed
|
|
656
|
-
* in. A heading carrying no leading `#` at all yields `##`, which is the
|
|
657
|
-
* level these sections had before the heading was configurable.
|
|
530
|
+
* The heading prefix one level below the block's own, so a spliced block stays a well-formed
|
|
531
|
+
* subtree.
|
|
658
532
|
*/
|
|
659
533
|
private subsectionPrefix;
|
|
660
534
|
/**
|
|
661
|
-
* Renders the two findings a gate weighs, and nothing else
|
|
662
|
-
*
|
|
663
|
-
* A gate prints why it decided rather than what it read: the full report is
|
|
664
|
-
* what a trace is for, and burying two deep stacks in a listing of every
|
|
665
|
-
* stack in the project is how a failed pipeline stops being read.
|
|
666
|
-
*
|
|
667
|
-
* Here rather than in the caller because rendering is this package's job,
|
|
668
|
-
* and because the headings are `renderRun`'s headings — written once, so a
|
|
669
|
-
* reader who greps a pipeline log for one rendering finds the other.
|
|
535
|
+
* Renders the two findings a gate weighs, and nothing else, so a failed pipeline shows why it
|
|
536
|
+
* decided.
|
|
670
537
|
*/
|
|
671
538
|
renderFindings(args: RenderFindingsArguments): string;
|
|
672
539
|
/** Renders one project's section, for splicing into its own README. */
|
|
673
540
|
renderProjectSection(args: RenderProjectSectionArguments): string;
|
|
674
541
|
/**
|
|
675
|
-
* Renders a whole run, for a terminal or a report file.
|
|
676
|
-
*
|
|
677
|
-
* Opens with what the run adds up to rather than with its findings: the
|
|
678
|
-
* summary, the per-project index, and the headroom each project has left.
|
|
679
|
-
* A workspace holding fifty projects is not readable as a list of
|
|
680
|
-
* callables, and every section below these three is one — so a reader
|
|
681
|
-
* arriving at this block learns which project to look at before being
|
|
682
|
-
* handed the stacks.
|
|
542
|
+
* Renders a whole run, for a terminal or a report file. Opens with the summary, the project index,
|
|
543
|
+
* and the headroom.
|
|
683
544
|
*/
|
|
684
545
|
renderRun(args: RenderRunArguments): string;
|
|
685
546
|
/**
|
|
686
|
-
* Renders every stack, the first few openly and the rest behind a disclosure
|
|
687
|
-
*
|
|
688
|
-
* A package with two hundred stacks is still worth publishing in full — an
|
|
689
|
-
* agent reading the file can expand it, and a person scrolling past should
|
|
690
|
-
* not have to.
|
|
547
|
+
* Renders every stack, the first few openly and the rest behind a disclosure, so a large package
|
|
548
|
+
* stays complete.
|
|
691
549
|
*/
|
|
692
550
|
renderStacks(args: RenderStacksArguments): string;
|
|
693
551
|
}
|
|
694
552
|
|
|
695
|
-
/**
|
|
696
|
-
* Callables a diagram draws before it stops accepting stacks.
|
|
697
|
-
*
|
|
698
|
-
* GitHub refuses a mermaid block past 50,000 characters, and at roughly fifty
|
|
699
|
-
* characters per node and edge this leaves room to spare — the widest project
|
|
700
|
-
* here draws 263. Whole stacks are dropped rather than trimmed, so the diagram
|
|
701
|
-
* never shows an edge into a callable it does not draw.
|
|
702
|
-
*/
|
|
553
|
+
/** Callables a diagram draws, since GitHub caps mermaid at 50,000 characters. */
|
|
703
554
|
export declare const MAXIMUM_DIAGRAM_NODES = 300;
|
|
704
555
|
|
|
705
|
-
/**
|
|
706
|
-
* Opens every diagram.
|
|
707
|
-
*
|
|
708
|
-
* Left to right, because that is the direction a stack reads and the direction
|
|
709
|
-
* a wide, shallow call graph fits a page.
|
|
710
|
-
*/
|
|
556
|
+
/** Opens every diagram left to right, the way a stack reads. */
|
|
711
557
|
export declare const MERMAID_FLOWCHART_HEADER = "flowchart LR";
|
|
712
558
|
|
|
713
559
|
/** What mermaid would read as syntax inside a node label. */
|
|
714
560
|
export declare const MERMAID_LABEL_ESCAPES: ReadonlyMap<string, string>;
|
|
715
561
|
|
|
716
|
-
/**
|
|
717
|
-
* A diagram under construction.
|
|
718
|
-
*
|
|
719
|
-
* Mutable, and deliberately so: nodes and edges accumulate across every stack
|
|
720
|
-
* drawn, and threading an immutable accumulator through that would say nothing
|
|
721
|
-
* the name does not.
|
|
722
|
-
*/
|
|
562
|
+
/** A diagram under construction. Mutable, since stacks add nodes and edges. */
|
|
723
563
|
export declare interface MermaidDiagram {
|
|
724
564
|
readonly edges: Set<string>;
|
|
725
565
|
readonly identifiersByCallable: Map<CallableId, string>;
|
|
@@ -729,15 +569,10 @@ export declare interface MermaidDiagram {
|
|
|
729
569
|
/**
|
|
730
570
|
* Draws a set of call stacks as one mermaid flowchart.
|
|
731
571
|
*
|
|
732
|
-
* One diagram for all
|
|
733
|
-
*
|
|
734
|
-
* together the shared tails converge — every resolver ending in the same
|
|
735
|
-
* service, every command reaching the same repository — and that convergence
|
|
736
|
-
* is the thing a picture shows and an indented tree cannot.
|
|
572
|
+
* One diagram for all stacks, because shared tails converge there and that convergence is what a
|
|
573
|
+
* picture shows and an indented tree cannot.
|
|
737
574
|
*
|
|
738
|
-
* Labels carry the callable's name and
|
|
739
|
-
* and documents belongs to the tree rendering, which has room for it; a
|
|
740
|
-
* diagram trying to carry all of that is unreadable at any size.
|
|
575
|
+
* Labels carry only the callable's name. Signatures and docs belong to the tree rendering.
|
|
741
576
|
*/
|
|
742
577
|
export declare class MermaidReportService {
|
|
743
578
|
constructor();
|
|
@@ -760,13 +595,7 @@ export declare class MermaidReportService {
|
|
|
760
595
|
}): string;
|
|
761
596
|
}
|
|
762
597
|
|
|
763
|
-
/**
|
|
764
|
-
* Frames a stack needs before a report carries it.
|
|
765
|
-
*
|
|
766
|
-
* Two, because a single frame is a callable that calls nothing — accurate, but
|
|
767
|
-
* not a call stack, and there are twice as many of those as there are real
|
|
768
|
-
* ones.
|
|
769
|
-
*/
|
|
598
|
+
/** Fewest frames a reported stack needs; one frame is a callable. */
|
|
770
599
|
export declare const MINIMUM_STACK_FRAMES = 2;
|
|
771
600
|
|
|
772
601
|
/** Raised when the anchor helper is asked to write a file nothing named. */
|
|
@@ -796,19 +625,13 @@ export declare class OutputJsonService {
|
|
|
796
625
|
/** Reads an existing report, returning an empty string if absent. */
|
|
797
626
|
private readExisting;
|
|
798
627
|
/**
|
|
799
|
-
* Renders the JSON report for the traced findings
|
|
800
|
-
*
|
|
801
|
-
* Ends with a newline so the file matches what a formatter would leave
|
|
802
|
-
* behind, and so check mode does not fail over the one byte every other tool
|
|
803
|
-
* in the repository adds.
|
|
628
|
+
* Renders the JSON report for the traced findings, ending with a newline so formatters and check
|
|
629
|
+
* mode agree.
|
|
804
630
|
*/
|
|
805
631
|
buildReport(args: BuildReportArguments): string;
|
|
806
632
|
/**
|
|
807
|
-
* Syncs the configured JSON file with the
|
|
808
|
-
*
|
|
809
|
-
* In write mode the report is written, creating parent directories as
|
|
810
|
-
* needed. In check mode nothing is written and the return value reports
|
|
811
|
-
* whether the file already holds the current report.
|
|
633
|
+
* Syncs the configured JSON file with the findings: writes in write mode, and in check mode
|
|
634
|
+
* reports whether it is current.
|
|
812
635
|
*/
|
|
813
636
|
sync(args: SyncJsonArguments): boolean;
|
|
814
637
|
}
|
|
@@ -822,10 +645,9 @@ export declare class OutputMarkdownModule {
|
|
|
822
645
|
/**
|
|
823
646
|
* Splices a generated block into a markdown file, between two anchors.
|
|
824
647
|
*
|
|
825
|
-
* Staleness
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
* whether the block drifted or was never written.
|
|
648
|
+
* Staleness compares the extracted block with the regenerated one, byte for byte.
|
|
649
|
+
* A missing file or anchor counts as stale, not as an error, so check mode
|
|
650
|
+
* reports drift and absence alike.
|
|
829
651
|
*/
|
|
830
652
|
export declare class OutputMarkdownService {
|
|
831
653
|
private readonly logger;
|
|
@@ -839,25 +661,13 @@ export declare class OutputMarkdownService {
|
|
|
839
661
|
/** Reads a file, treating an absent one as empty. */
|
|
840
662
|
private readExisting;
|
|
841
663
|
/**
|
|
842
|
-
* Cuts
|
|
843
|
-
*
|
|
844
|
-
* Reached only when the start marker is present but the block's own end
|
|
845
|
-
* marker cannot be found anywhere after it — the same file this
|
|
846
|
-
* convention lets stack several anchored blocks back to back, so
|
|
847
|
-
* everything is fair game to have drifted except one thing: another
|
|
848
|
-
* block's own anchors. The span is cut at the next such anchor, or at the
|
|
849
|
-
* end of the file when none follows, so the fresh block replaces exactly
|
|
850
|
-
* what belonged to this one and nothing that belonged to another.
|
|
664
|
+
* Cuts a start marker's corrupted span, up to the next anchor or end of file, and splices the
|
|
665
|
+
* fresh block in.
|
|
851
666
|
*/
|
|
852
667
|
private replaceOrphanedBlock;
|
|
853
668
|
/**
|
|
854
|
-
* Places the generated block
|
|
855
|
-
*
|
|
856
|
-
* A pattern match replaces cleanly. No start marker at all falls back to
|
|
857
|
-
* appending, the historical behavior for a file never written to before.
|
|
858
|
-
* A start marker with no matching end can never satisfy the pattern —
|
|
859
|
-
* silently leaving it in place is what let a run claim success while
|
|
860
|
-
* changing nothing — so that span is cut out and replaced instead.
|
|
669
|
+
* Places the generated block: replaces a match, appends when no marker exists, and cuts a
|
|
670
|
+
* dangling start marker.
|
|
861
671
|
*/
|
|
862
672
|
private spliceBlock;
|
|
863
673
|
/** Builds the helpers a configured `writeBlock` function is handed. */
|
|
@@ -865,11 +675,8 @@ export declare class OutputMarkdownService {
|
|
|
865
675
|
/** Syncs the configured markdown destination with the current findings. */
|
|
866
676
|
sync(args: SyncMarkdownArguments): boolean;
|
|
867
677
|
/**
|
|
868
|
-
* Splices the anchored block into a file
|
|
869
|
-
*
|
|
870
|
-
* Appends the block when the anchors are absent, creates the file when it
|
|
871
|
-
* does not exist, and in check mode writes nothing and reports whether the
|
|
872
|
-
* file already holds the current block.
|
|
678
|
+
* Splices the anchored block into a file, appending or creating it as needed, and in check mode
|
|
679
|
+
* only reports drift.
|
|
873
680
|
*/
|
|
874
681
|
syncAnchoredBlock(args: SyncAnchoredBlockArguments): boolean;
|
|
875
682
|
/** Wraps content in the configured anchors. */
|
|
@@ -882,13 +689,13 @@ export declare interface OwnedFindings {
|
|
|
882
689
|
readonly wideCallables: readonly WideCallableFinding[];
|
|
883
690
|
}
|
|
884
691
|
|
|
885
|
-
/**
|
|
692
|
+
/** Message split into emoji and the prose telemetry stores. */
|
|
886
693
|
declare interface ParsedLogMessage {
|
|
887
694
|
emoji: string | undefined;
|
|
888
695
|
text: string;
|
|
889
696
|
}
|
|
890
697
|
|
|
891
|
-
/** One project's row
|
|
698
|
+
/** One project's index row and the scoreboard's bucketing numbers. */
|
|
892
699
|
export declare interface ProjectIndexRow {
|
|
893
700
|
readonly deepest: number;
|
|
894
701
|
readonly headroom: number;
|
|
@@ -906,9 +713,8 @@ export declare class ProjectReportsModule {
|
|
|
906
713
|
/**
|
|
907
714
|
* Scopes a run's findings to the project each one came from.
|
|
908
715
|
*
|
|
909
|
-
* A
|
|
910
|
-
*
|
|
911
|
-
* project the entry point — or the reported callable — belongs to.
|
|
716
|
+
* A project's README section should describe that project, not the workspace it
|
|
717
|
+
* sits in, so everything is keyed on the owning project of the entry point or callable.
|
|
912
718
|
*/
|
|
913
719
|
export declare class ProjectReportsService {
|
|
914
720
|
private readonly pathsService;
|
|
@@ -927,75 +733,28 @@ export declare class ProjectReportsService {
|
|
|
927
733
|
/** Reads the depth measured for one callable, or nothing if unmeasured. */
|
|
928
734
|
private readDepth;
|
|
929
735
|
/**
|
|
930
|
-
* Reads the limits one project is judged against
|
|
931
|
-
*
|
|
932
|
-
* A project the lookup does not name falls back to the workspace's, which is
|
|
933
|
-
* what a project declaring nothing is given anyway — so a report arriving
|
|
934
|
-
* from outside the resolved set is judged rather than silently exempted.
|
|
736
|
+
* Reads the limits one project is judged against, falling back to the workspace's for a project
|
|
737
|
+
* the lookup does not name.
|
|
935
738
|
*/
|
|
936
739
|
private readProjectLimits;
|
|
937
740
|
/** Builds one report per project, in the order the projects were traced. */
|
|
938
741
|
build(args: BuildProjectReportsArguments): ProjectReport[];
|
|
939
742
|
/**
|
|
940
|
-
* Picks the stacks a run should fail on, deepest first
|
|
941
|
-
*
|
|
942
|
-
* A filter over the stacks the reports already hold rather than a second
|
|
943
|
-
* traversal: reconstructing the same paths twice would let the number the
|
|
944
|
-
* gate fails on drift from the number the README publishes.
|
|
945
|
-
*
|
|
946
|
-
* Each project is judged against its own limit rather than one number for
|
|
947
|
-
* the whole workspace, so a stack deeper than the project that roots it
|
|
948
|
-
* allows is reported even when a noisier project elsewhere allows more.
|
|
949
|
-
* The stack is judged by the project owning its entry point, which is the
|
|
950
|
-
* project `build` already filed it under.
|
|
951
|
-
*
|
|
952
|
-
* `maximumDepth` is a positive integer, so a stack past it is at least two
|
|
953
|
-
* deep and therefore survived the minimum-frame filter above.
|
|
743
|
+
* Picks the stacks a run should fail on, deepest first, each judged against its owning project's
|
|
744
|
+
* own limit.
|
|
954
745
|
*/
|
|
955
746
|
findDeepStacks(args: {
|
|
956
747
|
limits: ProjectLimitsLookup;
|
|
957
748
|
reports: readonly ProjectReport[];
|
|
958
749
|
}): DeepStackFinding[];
|
|
959
750
|
/**
|
|
960
|
-
* Picks the findings a named set of projects owns, and nothing else.
|
|
961
|
-
*
|
|
962
|
-
* For a run whose verdict covers fewer projects than its measurement did. A
|
|
963
|
-
* finding's owner is already decided — `build` files a stack under the
|
|
964
|
-
* project owning its entry point and a breadth report under the project
|
|
965
|
-
* declaring the callable — so this selects among those reports rather than
|
|
966
|
-
* deciding ownership a second way.
|
|
967
|
-
*
|
|
968
|
-
* A named project the reports do not hold contributes nothing rather than
|
|
969
|
-
* being an error: a run may be pointed at a project whose files it then
|
|
970
|
-
* found nothing in, and having read nothing is a fact for the caller's own
|
|
971
|
-
* rules to judge.
|
|
751
|
+
* Picks the findings a named set of projects owns, and nothing else. A named project with no
|
|
752
|
+
* reports contributes nothing.
|
|
972
753
|
*/
|
|
973
754
|
findOwnedFindings(args: FindOwnedFindingsArguments): OwnedFindings;
|
|
974
755
|
/**
|
|
975
|
-
* Picks the named projects a run opened no file of its own from
|
|
976
|
-
*
|
|
977
|
-
* The companion to `findOwnedFindings`, and the reason it needs one: owning
|
|
978
|
-
* no finding is what a clean project and an unread one look like from the
|
|
979
|
-
* outside, and a caller judging only the findings cannot tell them apart.
|
|
980
|
-
* The project's own `fileCount` is what separates them — `collect` counts a
|
|
981
|
-
* file per project once the run's exclusions and the per-project ones have
|
|
982
|
-
* had their say, so a project whose files were all filtered away reports
|
|
983
|
-
* zero however much the rest of the run read.
|
|
984
|
-
*
|
|
985
|
-
* **Files rather than callables**, which is the weaker of the two questions
|
|
986
|
-
* and the right one. A project can hold files that declare no callable at
|
|
987
|
-
* all — one whose `tsconfig.json` names only its own configuration files and
|
|
988
|
-
* its tests is the shape, and this repository has five — and those were
|
|
989
|
-
* read, so a verdict on them is a verdict on something. Asking for a
|
|
990
|
-
* callable would fail every one of them for containing no functions, which
|
|
991
|
-
* is not a finding about anything. The cost is stated plainly: a project
|
|
992
|
-
* whose sources are excluded while a configuration file of its own survives
|
|
993
|
-
* counts as read.
|
|
994
|
-
*
|
|
995
|
-
* A named project with no report at all counts as unread rather than as an
|
|
996
|
-
* error, the same way `findOwnedFindings` treats one: a run pointed at a
|
|
997
|
-
* project the workspace configuration excludes never discovers it, and that
|
|
998
|
-
* is exactly the case worth failing.
|
|
756
|
+
* Picks the named projects a run opened no file of its own from, judged by their file count
|
|
757
|
+
* rather than callables.
|
|
999
758
|
*/
|
|
1000
759
|
findUnreadProjects(args: {
|
|
1001
760
|
/** The projects entitled to fail on what they own. */
|
|
@@ -1003,17 +762,8 @@ export declare class ProjectReportsService {
|
|
|
1003
762
|
reports: readonly ProjectReport[];
|
|
1004
763
|
}): string[];
|
|
1005
764
|
/**
|
|
1006
|
-
* Picks the callables a run should fail on, widest first.
|
|
1007
|
-
*
|
|
1008
|
-
* A filter over the breadth reports the reports already hold, mirroring
|
|
1009
|
-
* `findDeepStacks`, so the number the gate fails on cannot drift from the
|
|
1010
|
-
* number the README publishes. A callable is judged by the project that
|
|
1011
|
-
* declares it, which is the project `build` already filed it under.
|
|
1012
|
-
*
|
|
1013
|
-
* No default exists for `maximumBreadth`: until a configuration sets one,
|
|
1014
|
-
* nothing can exceed it, so a project with no limit anywhere in its
|
|
1015
|
-
* inheritance reports nothing rather than being judged against a number
|
|
1016
|
-
* nobody chose.
|
|
765
|
+
* Picks the callables a run should fail on, widest first, each judged by its declaring project.
|
|
766
|
+
* No breadth limit means none fails.
|
|
1017
767
|
*/
|
|
1018
768
|
findWideCallables(args: {
|
|
1019
769
|
limits: ProjectLimitsLookup;
|
|
@@ -1043,17 +793,7 @@ declare interface RenderDepthReportsArguments {
|
|
|
1043
793
|
readonly reports: readonly DepthReport[];
|
|
1044
794
|
}
|
|
1045
795
|
|
|
1046
|
-
/**
|
|
1047
|
-
* Arguments for rendering only the findings a gate weighs.
|
|
1048
|
-
*
|
|
1049
|
-
* No `rendering`, unlike `RenderRunArguments`: a gate's product is the list of
|
|
1050
|
-
* things to go and fix, and a diagram of them is not that list.
|
|
1051
|
-
*
|
|
1052
|
-
* The findings themselves rather than the run that produced them, also unlike
|
|
1053
|
-
* `RenderRunArguments`: a scoped gate judges fewer findings than its trace
|
|
1054
|
-
* measured, and a renderer handed the whole run would print the ones it was
|
|
1055
|
-
* not judged on.
|
|
1056
|
-
*/
|
|
796
|
+
/** Arguments for rendering only the findings a gate weighs. */
|
|
1057
797
|
export declare interface RenderFindingsArguments extends OwnedFindings {
|
|
1058
798
|
readonly previewCount: number;
|
|
1059
799
|
}
|
|
@@ -1067,13 +807,7 @@ export declare interface RenderProjectIndexArguments {
|
|
|
1067
807
|
/** Arguments for rendering one project's section. */
|
|
1068
808
|
export declare interface RenderProjectSectionArguments {
|
|
1069
809
|
readonly heading: string;
|
|
1070
|
-
/**
|
|
1071
|
-
* The lookup the whole run resolved, rather than this project's two numbers.
|
|
1072
|
-
*
|
|
1073
|
-
* The renderer reads its own row out of it through the same `limitsFor` the
|
|
1074
|
-
* index and the gate read, so a project's block and the workspace's view of
|
|
1075
|
-
* that project cannot come to disagree about which limit applied.
|
|
1076
|
-
*/
|
|
810
|
+
/** The lookup the whole run resolved, so a project's block and the workspace's view of it cannot disagree on the limit. */
|
|
1077
811
|
readonly limits: ProjectLimitsLookup;
|
|
1078
812
|
readonly previewCount: number;
|
|
1079
813
|
readonly rendering: StackRendering;
|
|
@@ -1115,57 +849,35 @@ export declare class ReportFindingsModule {
|
|
|
1115
849
|
}
|
|
1116
850
|
|
|
1117
851
|
/**
|
|
1118
|
-
* Weighs every finding a run
|
|
1119
|
-
* to gate.
|
|
852
|
+
* Weighs every finding a run produces, failing on the ones it gates.
|
|
1120
853
|
*
|
|
1121
|
-
* Kept
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
* the trace rather than weigh its output.
|
|
854
|
+
* Kept apart from `CallidescopeCommand`, as `RunPlanService` is: this service
|
|
855
|
+
* decides on its own what a run does with its findings, through `this.logger`,
|
|
856
|
+
* leaving the command to orchestrate the trace.
|
|
1125
857
|
*/
|
|
1126
858
|
export declare class ReportFindingsService {
|
|
1127
859
|
private readonly logger;
|
|
1128
860
|
constructor(logger: LoggerService);
|
|
1129
861
|
/**
|
|
1130
|
-
* Names the stacks that ran deeper than
|
|
1131
|
-
*
|
|
1132
|
-
* Reported whether or not the run gates on them — a stack this long is worth
|
|
1133
|
-
* saying out loud even in a run that only wrote a report — but only a run
|
|
1134
|
-
* asked to fail on depth fails on it.
|
|
862
|
+
* Names the stacks that ran deeper than allowed. Reported whether or not the run gates on them;
|
|
863
|
+
* only a depth gate fails.
|
|
1135
864
|
*/
|
|
1136
865
|
private reportDeepStacks;
|
|
1137
866
|
/**
|
|
1138
|
-
* Fails a run that traced nothing at all
|
|
1139
|
-
*
|
|
1140
|
-
* Unconditional, and not something `--check` turns on. Every other finding
|
|
1141
|
-
* is a verdict on code that was read; this one says no code was read, and a
|
|
1142
|
-
* gate that passes because it never looked is worse than one that fails —
|
|
1143
|
-
* it reports the workspace as clean and there is nothing in the output to
|
|
1144
|
-
* say otherwise.
|
|
867
|
+
* Fails a run that traced nothing at all, unconditionally, since a gate that never looked must
|
|
868
|
+
* not pass.
|
|
1145
869
|
*/
|
|
1146
870
|
private reportEmptyTrace;
|
|
1147
871
|
/** Names the destinations that no longer hold what a fresh run would write. */
|
|
1148
872
|
private reportStaleness;
|
|
1149
873
|
/**
|
|
1150
|
-
* Names the callables that
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
* Reported whether or not the run gates on them, mirroring
|
|
1154
|
-
* `reportDeepStacks` — but only a run asked to fail on breadth fails on it.
|
|
874
|
+
* Names the callables that call more things directly than allowed. Reported always; only a breadth
|
|
875
|
+
* gate fails on them.
|
|
1155
876
|
*/
|
|
1156
877
|
private reportWideCallables;
|
|
1157
878
|
/**
|
|
1158
|
-
* Weighs every finding a run can produce
|
|
1159
|
-
*
|
|
1160
|
-
* They are weighed separately and announced separately. A stack that is too
|
|
1161
|
-
* deep is something the code does; a callable calling too many things is
|
|
1162
|
-
* something else the code does; a stale report is something the checkout
|
|
1163
|
-
* has not caught up with. Reading one as another sends the author to fix
|
|
1164
|
-
* the wrong thing.
|
|
1165
|
-
*
|
|
1166
|
-
* A project that could not be read never reaches here: it ends the trace
|
|
1167
|
-
* before anything is printed or written, and is reported by
|
|
1168
|
-
* `CallidescopeCommand` itself.
|
|
879
|
+
* Weighs every finding a run can produce and fails on any of them, announcing each kind
|
|
880
|
+
* separately so its fix is clear.
|
|
1169
881
|
*/
|
|
1170
882
|
reportFindings(args: ReportFindingsArguments): void;
|
|
1171
883
|
}
|
|
@@ -1192,82 +904,36 @@ export declare class ReportService {
|
|
|
1192
904
|
/** Renders what a frame warns about: that it recurses, that it is on its way out. */
|
|
1193
905
|
private renderMarkers;
|
|
1194
906
|
/**
|
|
1195
|
-
* Renders a callable's signature, collapsing one
|
|
1196
|
-
*
|
|
1197
|
-
* The return type survives the collapse. Which twelve services a constructor
|
|
1198
|
-
* takes is noise at the point where someone is reading a stack; what it hands
|
|
1199
|
-
* back is not.
|
|
907
|
+
* Renders a callable's signature, collapsing a long one while keeping the return type.
|
|
1200
908
|
*/
|
|
1201
909
|
private renderSignature;
|
|
1202
910
|
/**
|
|
1203
|
-
* Shortens a summary to
|
|
1204
|
-
*
|
|
1205
|
-
* The opening sentence first, because a comment that runs long here is a
|
|
1206
|
-
* short statement of what the callable does followed by paragraphs of why —
|
|
1207
|
-
* and the first half is the half that orients someone reading a stack. It is
|
|
1208
|
-
* printed whole and unmarked: it is a complete thought, not an elision, and
|
|
1209
|
-
* the frame's `file:line` is already the pointer to the rest.
|
|
1210
|
-
*
|
|
1211
|
-
* Cutting at the character instead throws away a sentence boundary that was
|
|
1212
|
-
* usually right there. Across this repository that happens to a fifth of
|
|
1213
|
-
* printed summaries, whose opening sentences run about 64 characters at the
|
|
1214
|
-
* median and 113 at the very longest.
|
|
1215
|
-
*
|
|
1216
|
-
* A single sentence longer than the limit has no boundary to find, so it is
|
|
1217
|
-
* cut on a word — half a word reads as a typo rather than as an elision —
|
|
1218
|
-
* and marked as cut short.
|
|
911
|
+
* Shortens a summary to fit an indented frame, keeping the opening sentence whole, or
|
|
912
|
+
* cutting on a word and marking it.
|
|
1219
913
|
*/
|
|
1220
914
|
private shortenSummary;
|
|
1221
915
|
/**
|
|
1222
|
-
* Renders every frame of a stack,
|
|
1223
|
-
*
|
|
1224
|
-
* Takes anything holding a frame list rather than a full `CallStack`: a
|
|
1225
|
-
* depth or entry-point kind is never read here, so a caller with a path
|
|
1226
|
-
* that has neither — an address-centered lookup, for one — does not have to
|
|
1227
|
-
* fabricate one to call this.
|
|
916
|
+
* Renders every frame of a stack, entry point first, from anything holding a frame list, not only
|
|
917
|
+
* a full `CallStack`.
|
|
1228
918
|
*/
|
|
1229
919
|
renderStackTree(stack: {
|
|
1230
920
|
frames: readonly StackFrame[];
|
|
1231
921
|
}): string;
|
|
1232
922
|
}
|
|
1233
923
|
|
|
1234
|
-
/**
|
|
924
|
+
/** Names the workspace root when it is a traced project. */
|
|
1235
925
|
export declare const ROOT_PROJECT_LABEL = ".";
|
|
1236
926
|
|
|
1237
|
-
/**
|
|
1238
|
-
* Ends a sentence, when the next one starts.
|
|
1239
|
-
*
|
|
1240
|
-
* A capital after the space is what separates a sentence break from `e.g. the`
|
|
1241
|
-
* or a dotted identifier, neither of which ends anything.
|
|
1242
|
-
*/
|
|
927
|
+
/** Sentence break: a capital must follow, so `e.g.` does not split. */
|
|
1243
928
|
export declare const SENTENCE_END_PATTERN: RegExp;
|
|
1244
929
|
|
|
1245
|
-
/**
|
|
1246
|
-
* Characters of signature a frame prints before it collapses the parameters.
|
|
1247
|
-
*
|
|
1248
|
-
* Most signatures here are short — the median is under twenty characters — but
|
|
1249
|
-
* a NestJS constructor taking a dozen injected services runs past four hundred,
|
|
1250
|
-
* and one of those inside an indented stack destroys the shape that makes the
|
|
1251
|
-
* stack readable at all.
|
|
1252
|
-
*/
|
|
930
|
+
/** Signature characters a frame prints before parameters collapse. */
|
|
1253
931
|
export declare const SIGNATURE_LIMIT = 80;
|
|
1254
932
|
|
|
1255
|
-
/**
|
|
1256
|
-
* How a report draws the stacks it found.
|
|
1257
|
-
*
|
|
1258
|
-
* Narrower than `CallidescopeOutputFormat` on purpose: `json` is a different
|
|
1259
|
-
* report rather than a different drawing of this one, and a renderer that had
|
|
1260
|
-
* to accept it would carry a case it can never answer.
|
|
1261
|
-
*/
|
|
933
|
+
/** How a report draws stacks. Excludes `json`, which is no drawing. */
|
|
1262
934
|
export declare type StackRendering = "diagram" | "tree";
|
|
1263
935
|
|
|
1264
|
-
/**
|
|
1265
|
-
* Characters of documentation prose a printed frame keeps.
|
|
1266
|
-
*
|
|
1267
|
-
* A summary is meant to orient a reader mid-stack, not to replace opening the
|
|
1268
|
-
* file, and a paragraph indented under ten frames is worse than a sentence.
|
|
1269
|
-
* Only the tree is bound by this — the JSON report carries the whole comment.
|
|
1270
|
-
*/
|
|
936
|
+
/** Documentation characters a printed frame keeps. JSON keeps all of it. */
|
|
1271
937
|
export declare const SUMMARY_LIMIT = 120;
|
|
1272
938
|
|
|
1273
939
|
/** Introduces the documentation line printed under a frame. */
|
|
@@ -1288,19 +954,9 @@ export declare interface SyncDestinationsArguments {
|
|
|
1288
954
|
/** The depth and breadth limits each traced project is judged against. */
|
|
1289
955
|
readonly projectLimits: ProjectLimitsLookup;
|
|
1290
956
|
readonly result: CallGraphResult;
|
|
1291
|
-
/**
|
|
1292
|
-
* Workspace-relative root of each project the run was scoped to, keyed by
|
|
1293
|
-
* name. Only these projects have a section published, so a scoped run never
|
|
1294
|
-
* writes into a dependency it merely measured.
|
|
1295
|
-
*/
|
|
957
|
+
/** Root of each scoped project, keyed by name. Only these get a published section, never a measured-only dependency. */
|
|
1296
958
|
readonly startingProjectRoots: ReadonlyMap<string, string>;
|
|
1297
|
-
/**
|
|
1298
|
-
* The written destinations each project declared for itself, by name.
|
|
1299
|
-
*
|
|
1300
|
-
* Every traced project declares a complete configuration, so every one of
|
|
1301
|
-
* them is named here — a project publishing nothing wrote `markdown:
|
|
1302
|
-
* undefined` rather than being absent.
|
|
1303
|
-
*/
|
|
959
|
+
/** Destinations each project declared, by name. A project publishing nothing names `markdown: undefined`, never absence. */
|
|
1304
960
|
readonly writeByProject: ReadonlyMap<string, ResolvedCallidescopeWriteConfiguration>;
|
|
1305
961
|
}
|
|
1306
962
|
|
|
@@ -1309,12 +965,7 @@ export declare interface SyncJsonArguments extends BuildReportArguments {
|
|
|
1309
965
|
readonly check: boolean;
|
|
1310
966
|
}
|
|
1311
967
|
|
|
1312
|
-
/**
|
|
1313
|
-
* Arguments for syncing the configured markdown destination.
|
|
1314
|
-
*
|
|
1315
|
-
* The rendered markdown arrives already built: what a report says belongs to
|
|
1316
|
-
* the report module, and this one only decides where it lands.
|
|
1317
|
-
*/
|
|
968
|
+
/** Arguments for syncing the markdown destination, already rendered. */
|
|
1318
969
|
export declare interface SyncMarkdownArguments {
|
|
1319
970
|
readonly check: boolean;
|
|
1320
971
|
readonly content: string;
|
|
@@ -1339,44 +990,24 @@ export declare interface SyncProjectSectionsArguments {
|
|
|
1339
990
|
export declare const TRUNCATION_SUFFIX = "\u2026";
|
|
1340
991
|
|
|
1341
992
|
/**
|
|
1342
|
-
* Renders what a whole run says about the projects in it
|
|
1343
|
-
* one callable or one stack.
|
|
1344
|
-
*
|
|
1345
|
-
* Its own service because it answers a question the rest of the report cannot.
|
|
1346
|
-
* Every other section names callables — a stack, a spread, a wide callable —
|
|
1347
|
-
* and a workspace holding fifty projects is not readable as a list of
|
|
1348
|
-
* callables. These two sections are the index and the scoreboard: which
|
|
1349
|
-
* project holds what, and how much room each has left before its own limit
|
|
1350
|
-
* stops it.
|
|
993
|
+
* Renders what a whole run says about the projects in it.
|
|
1351
994
|
*
|
|
1352
|
-
*
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
* limits resolve per project — so a report that showed one number would be
|
|
1356
|
-
* describing a model the tool no longer has.
|
|
995
|
+
* Two sections: the index and the scoreboard, showing which project holds what
|
|
996
|
+
* and how much room each has before its own limit stops it. Both key on each
|
|
997
|
+
* project's resolved limit.
|
|
1357
998
|
*/
|
|
1358
999
|
export declare class WorkspaceReportService {
|
|
1359
1000
|
constructor();
|
|
1360
1001
|
/**
|
|
1361
|
-
* Sorts a project's headroom into
|
|
1362
|
-
*
|
|
1363
|
-
* A project measuring nothing is its own bucket rather than a large
|
|
1364
|
-
* headroom, and that distinction is the point of having the scoreboard at
|
|
1365
|
-
* all: a project whose deepest stack is zero has every frame of its limit
|
|
1366
|
-
* unused, which reads as the safest row in the table while actually being
|
|
1367
|
-
* the one row where the limit gates nothing. Bucketing it by `limit - 0`
|
|
1368
|
-
* would file the least-gated projects among the healthiest.
|
|
1002
|
+
* Sorts a project's headroom into its scoreboard bucket. A project measuring nothing gets its own
|
|
1003
|
+
* bucket, not a large headroom.
|
|
1369
1004
|
*/
|
|
1370
1005
|
private bucketFor;
|
|
1371
1006
|
/** The widest single callable a project declares, or zero when it has none. */
|
|
1372
1007
|
private widestBreadth;
|
|
1373
1008
|
/**
|
|
1374
|
-
* Reads each project's report and
|
|
1375
|
-
*
|
|
1376
|
-
* Public so both sections render from the same rows rather than each
|
|
1377
|
-
* deriving them: the scoreboard counts exactly the rows the index lists, and
|
|
1378
|
-
* two derivations of "headroom" that could disagree would be worse than one
|
|
1379
|
-
* that is merely wrong.
|
|
1009
|
+
* Reads each project's report and resolved limits into one row, so both sections render from the
|
|
1010
|
+
* same rows.
|
|
1380
1011
|
*/
|
|
1381
1012
|
buildRows(args: RenderProjectIndexArguments): ProjectIndexRow[];
|
|
1382
1013
|
/** The limits one project resolved to, or the workspace's when unlisted. */
|
|
@@ -1385,21 +1016,13 @@ export declare class WorkspaceReportService {
|
|
|
1385
1016
|
projectName: string;
|
|
1386
1017
|
}): ProjectLimits;
|
|
1387
1018
|
/**
|
|
1388
|
-
* Counts how many projects sit in each headroom bucket.
|
|
1389
|
-
*
|
|
1390
|
-
* The index says what every project holds; this says what the set of them
|
|
1391
|
-
* adds up to, which is the number a ratchet is actually lowered against. A
|
|
1392
|
-
* bucket nothing falls into is still printed, because "nothing is over its
|
|
1393
|
-
* limit" is the row a reader is looking for and an absent row cannot say it.
|
|
1019
|
+
* Counts how many projects sit in each headroom bucket. Empty buckets are still printed, since
|
|
1020
|
+
* 'nothing over its limit' must show.
|
|
1394
1021
|
*/
|
|
1395
1022
|
renderHeadroom(rows: readonly ProjectIndexRow[]): string;
|
|
1396
1023
|
/**
|
|
1397
|
-
* Renders one row per project: what it measured, and
|
|
1398
|
-
*
|
|
1399
|
-
* `Limit` is a bare number now. It used to carry `declared` or `inherited`
|
|
1400
|
-
* beside it, and with every traced project's configuration complete only one
|
|
1401
|
-
* of those two is reachable — a column with one value in every row is worse
|
|
1402
|
-
* than no column.
|
|
1024
|
+
* Renders one row per project: what it measured, and its limit as a bare number, since only one
|
|
1025
|
+
* origin is reachable.
|
|
1403
1026
|
*/
|
|
1404
1027
|
renderProjectIndex(args: RenderProjectIndexArguments): string;
|
|
1405
1028
|
}
|
|
@@ -1419,11 +1042,8 @@ export declare class WriteDestinationsModule {
|
|
|
1419
1042
|
/**
|
|
1420
1043
|
* Writes a finished run to every destination it was configured with.
|
|
1421
1044
|
*
|
|
1422
|
-
*
|
|
1423
|
-
*
|
|
1424
|
-
* this decides where what it found lands. There are two answers to that second
|
|
1425
|
-
* question — the workspace's own declarations and each project's — and keeping
|
|
1426
|
-
* them side by side is what stops one writing over the other.
|
|
1045
|
+
* Kept apart from the command: the command decides whether a run may write, and this decides where
|
|
1046
|
+
* the findings land, for both the workspace and each project.
|
|
1427
1047
|
*/
|
|
1428
1048
|
export declare class WriteDestinationsService {
|
|
1429
1049
|
private readonly markdownReportService;
|
|
@@ -1431,16 +1051,8 @@ export declare class WriteDestinationsService {
|
|
|
1431
1051
|
private readonly outputMarkdownService;
|
|
1432
1052
|
constructor(markdownReportService: MarkdownReportService, outputJsonService: OutputJsonService, outputMarkdownService: OutputMarkdownService);
|
|
1433
1053
|
/**
|
|
1434
|
-
* Writes the destinations each project declared for itself, returning the
|
|
1435
|
-
*
|
|
1436
|
-
*
|
|
1437
|
-
* A path is read relative to that project's own root, which is what keeps a
|
|
1438
|
-
* project's declaration about its own documents rather than about the
|
|
1439
|
-
* repository's — a project cannot write into a sibling by declaring one.
|
|
1440
|
-
*
|
|
1441
|
-
* Only the projects a run was scoped to are published: a dependency measured
|
|
1442
|
-
* through the closure has its own run to publish it, and this one was never
|
|
1443
|
-
* pointed at it.
|
|
1054
|
+
* Writes the destinations each project declared for itself, returning the stale ones.
|
|
1055
|
+
* Paths are relative to each project's own root.
|
|
1444
1056
|
*/
|
|
1445
1057
|
private syncProjectDestinations;
|
|
1446
1058
|
/** Writes one project's declared destinations, returning the stale ones. */
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@callidescope/configuration": "0.0.
|
|
8
|
-
"@callidescope/core": "0.0.
|
|
9
|
-
"@callidescope/graph": "0.0.
|
|
7
|
+
"@callidescope/configuration": "0.0.80",
|
|
8
|
+
"@callidescope/core": "0.0.79",
|
|
9
|
+
"@callidescope/graph": "0.0.79",
|
|
10
10
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
11
11
|
"pino": "^10.3.1",
|
|
12
12
|
"pino-pretty": "^13.1.3",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"strict": true
|
|
64
64
|
},
|
|
65
65
|
"types": "./dist/src/index.d.ts",
|
|
66
|
-
"version": "0.0.
|
|
66
|
+
"version": "0.0.79"
|
|
67
67
|
}
|