@afaik-lab/weigh 0.0.0-stage → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +49 -0
- package/LICENSE +373 -0
- package/README.md +102 -2
- package/dist/agent.d.ts +83 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +204 -0
- package/dist/agent.js.map +1 -0
- package/dist/ceilings.d.ts +32 -0
- package/dist/ceilings.d.ts.map +1 -0
- package/dist/ceilings.js +61 -0
- package/dist/ceilings.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +530 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-cli.d.ts +15 -0
- package/dist/config-cli.d.ts.map +1 -0
- package/dist/config-cli.js +132 -0
- package/dist/config-cli.js.map +1 -0
- package/dist/config.d.ts +198 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +373 -0
- package/dist/config.js.map +1 -0
- package/dist/context-cli.d.ts +35 -0
- package/dist/context-cli.d.ts.map +1 -0
- package/dist/context-cli.js +251 -0
- package/dist/context-cli.js.map +1 -0
- package/dist/context.d.ts +118 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +159 -0
- package/dist/context.js.map +1 -0
- package/dist/corrections/correction-set.d.ts +67 -0
- package/dist/corrections/correction-set.d.ts.map +1 -0
- package/dist/corrections/correction-set.js +104 -0
- package/dist/corrections/correction-set.js.map +1 -0
- package/dist/corrections/correction.d.ts +74 -0
- package/dist/corrections/correction.d.ts.map +1 -0
- package/dist/corrections/correction.js +154 -0
- package/dist/corrections/correction.js.map +1 -0
- package/dist/corrections/follow-up.d.ts +69 -0
- package/dist/corrections/follow-up.d.ts.map +1 -0
- package/dist/corrections/follow-up.js +217 -0
- package/dist/corrections/follow-up.js.map +1 -0
- package/dist/corrections/index.d.ts +31 -0
- package/dist/corrections/index.d.ts.map +1 -0
- package/dist/corrections/index.js +31 -0
- package/dist/corrections/index.js.map +1 -0
- package/dist/corrections/ledger.d.ts +78 -0
- package/dist/corrections/ledger.d.ts.map +1 -0
- package/dist/corrections/ledger.js +117 -0
- package/dist/corrections/ledger.js.map +1 -0
- package/dist/corrections/promotion.d.ts +119 -0
- package/dist/corrections/promotion.d.ts.map +1 -0
- package/dist/corrections/promotion.js +221 -0
- package/dist/corrections/promotion.js.map +1 -0
- package/dist/corrections/schema.d.ts +125 -0
- package/dist/corrections/schema.d.ts.map +1 -0
- package/dist/corrections/schema.js +100 -0
- package/dist/corrections/schema.js.map +1 -0
- package/dist/corrections-cli.d.ts +28 -0
- package/dist/corrections-cli.d.ts.map +1 -0
- package/dist/corrections-cli.js +157 -0
- package/dist/corrections-cli.js.map +1 -0
- package/dist/diff.d.ts +105 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +202 -0
- package/dist/diff.js.map +1 -0
- package/dist/doctor.d.ts +38 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +197 -0
- package/dist/doctor.js.map +1 -0
- package/dist/events.d.ts +21 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +5 -0
- package/dist/events.js.map +1 -0
- package/dist/findings.d.ts +510 -0
- package/dist/findings.d.ts.map +1 -0
- package/dist/findings.js +645 -0
- package/dist/findings.js.map +1 -0
- package/dist/follow-up-cli.d.ts +88 -0
- package/dist/follow-up-cli.d.ts.map +1 -0
- package/dist/follow-up-cli.js +208 -0
- package/dist/follow-up-cli.js.map +1 -0
- package/dist/harness.d.ts +64 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +71 -0
- package/dist/harness.js.map +1 -0
- package/dist/help/command-help.d.ts +9 -0
- package/dist/help/command-help.d.ts.map +1 -0
- package/dist/help/command-help.js +21 -0
- package/dist/help/command-help.js.map +1 -0
- package/dist/help/commands/answer.d.ts +3 -0
- package/dist/help/commands/answer.d.ts.map +1 -0
- package/dist/help/commands/answer.js +39 -0
- package/dist/help/commands/answer.js.map +1 -0
- package/dist/help/commands/config.d.ts +3 -0
- package/dist/help/commands/config.d.ts.map +1 -0
- package/dist/help/commands/config.js +25 -0
- package/dist/help/commands/config.js.map +1 -0
- package/dist/help/commands/context.d.ts +3 -0
- package/dist/help/commands/context.d.ts.map +1 -0
- package/dist/help/commands/context.js +44 -0
- package/dist/help/commands/context.js.map +1 -0
- package/dist/help/commands/corrections.d.ts +3 -0
- package/dist/help/commands/corrections.d.ts.map +1 -0
- package/dist/help/commands/corrections.js +30 -0
- package/dist/help/commands/corrections.js.map +1 -0
- package/dist/help/commands/doctor.d.ts +3 -0
- package/dist/help/commands/doctor.d.ts.map +1 -0
- package/dist/help/commands/doctor.js +12 -0
- package/dist/help/commands/doctor.js.map +1 -0
- package/dist/help/commands/index.d.ts +4 -0
- package/dist/help/commands/index.d.ts.map +1 -0
- package/dist/help/commands/index.js +27 -0
- package/dist/help/commands/index.js.map +1 -0
- package/dist/help/commands/memory.d.ts +3 -0
- package/dist/help/commands/memory.d.ts.map +1 -0
- package/dist/help/commands/memory.js +33 -0
- package/dist/help/commands/memory.js.map +1 -0
- package/dist/help/commands/models.d.ts +3 -0
- package/dist/help/commands/models.d.ts.map +1 -0
- package/dist/help/commands/models.js +17 -0
- package/dist/help/commands/models.js.map +1 -0
- package/dist/help/commands/options.d.ts +4 -0
- package/dist/help/commands/options.d.ts.map +1 -0
- package/dist/help/commands/options.js +13 -0
- package/dist/help/commands/options.js.map +1 -0
- package/dist/help/commands/review.d.ts +3 -0
- package/dist/help/commands/review.d.ts.map +1 -0
- package/dist/help/commands/review.js +50 -0
- package/dist/help/commands/review.js.map +1 -0
- package/dist/help/commands/sessions.d.ts +3 -0
- package/dist/help/commands/sessions.d.ts.map +1 -0
- package/dist/help/commands/sessions.js +23 -0
- package/dist/help/commands/sessions.js.map +1 -0
- package/dist/help/commands/show.d.ts +3 -0
- package/dist/help/commands/show.d.ts.map +1 -0
- package/dist/help/commands/show.js +18 -0
- package/dist/help/commands/show.js.map +1 -0
- package/dist/help/help.d.ts +16 -0
- package/dist/help/help.d.ts.map +1 -0
- package/dist/help/help.js +68 -0
- package/dist/help/help.js.map +1 -0
- package/dist/help/index.d.ts +4 -0
- package/dist/help/index.d.ts.map +1 -0
- package/dist/help/index.js +7 -0
- package/dist/help/index.js.map +1 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/block.d.ts +65 -0
- package/dist/knowledge/block.d.ts.map +1 -0
- package/dist/knowledge/block.js +89 -0
- package/dist/knowledge/block.js.map +1 -0
- package/dist/knowledge/claim.d.ts +143 -0
- package/dist/knowledge/claim.d.ts.map +1 -0
- package/dist/knowledge/claim.js +297 -0
- package/dist/knowledge/claim.js.map +1 -0
- package/dist/knowledge/index.d.ts +32 -0
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge/index.js +29 -0
- package/dist/knowledge/index.js.map +1 -0
- package/dist/knowledge/novelty.d.ts +65 -0
- package/dist/knowledge/novelty.d.ts.map +1 -0
- package/dist/knowledge/novelty.js +94 -0
- package/dist/knowledge/novelty.js.map +1 -0
- package/dist/knowledge/recall.d.ts +134 -0
- package/dist/knowledge/recall.d.ts.map +1 -0
- package/dist/knowledge/recall.js +229 -0
- package/dist/knowledge/recall.js.map +1 -0
- package/dist/knowledge/recalled-claim.d.ts +35 -0
- package/dist/knowledge/recalled-claim.d.ts.map +1 -0
- package/dist/knowledge/recalled-claim.js +67 -0
- package/dist/knowledge/recalled-claim.js.map +1 -0
- package/dist/knowledge/recalled.d.ts +70 -0
- package/dist/knowledge/recalled.d.ts.map +1 -0
- package/dist/knowledge/recalled.js +149 -0
- package/dist/knowledge/recalled.js.map +1 -0
- package/dist/knowledge/schema.d.ts +83 -0
- package/dist/knowledge/schema.d.ts.map +1 -0
- package/dist/knowledge/schema.js +96 -0
- package/dist/knowledge/schema.js.map +1 -0
- package/dist/knowledge/staleness.d.ts +48 -0
- package/dist/knowledge/staleness.d.ts.map +1 -0
- package/dist/knowledge/staleness.js +85 -0
- package/dist/knowledge/staleness.js.map +1 -0
- package/dist/knowledge/store.d.ts +100 -0
- package/dist/knowledge/store.d.ts.map +1 -0
- package/dist/knowledge/store.js +184 -0
- package/dist/knowledge/store.js.map +1 -0
- package/dist/memory/compose-file.d.ts +14 -0
- package/dist/memory/compose-file.d.ts.map +1 -0
- package/dist/memory/compose-file.js +25 -0
- package/dist/memory/compose-file.js.map +1 -0
- package/dist/memory/index.d.ts +43 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +119 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/oss.d.ts +62 -0
- package/dist/memory/oss.d.ts.map +1 -0
- package/dist/memory/oss.js +230 -0
- package/dist/memory/oss.js.map +1 -0
- package/dist/memory/platform.d.ts +37 -0
- package/dist/memory/platform.d.ts.map +1 -0
- package/dist/memory/platform.js +131 -0
- package/dist/memory/platform.js.map +1 -0
- package/dist/memory/scope.d.ts +49 -0
- package/dist/memory/scope.d.ts.map +1 -0
- package/dist/memory/scope.js +70 -0
- package/dist/memory/scope.js.map +1 -0
- package/dist/memory/types.d.ts +113 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +18 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory-cli.d.ts +17 -0
- package/dist/memory-cli.d.ts.map +1 -0
- package/dist/memory-cli.js +107 -0
- package/dist/memory-cli.js.map +1 -0
- package/dist/models-cli.d.ts +12 -0
- package/dist/models-cli.d.ts.map +1 -0
- package/dist/models-cli.js +54 -0
- package/dist/models-cli.js.map +1 -0
- package/dist/models.d.ts +111 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +227 -0
- package/dist/models.js.map +1 -0
- package/dist/paths.d.ts +35 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +65 -0
- package/dist/paths.js.map +1 -0
- package/dist/profile.d.ts +28 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +154 -0
- package/dist/profile.js.map +1 -0
- package/dist/progress.d.ts +70 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +132 -0
- package/dist/progress.js.map +1 -0
- package/dist/quiet.d.ts +2 -0
- package/dist/quiet.d.ts.map +1 -0
- package/dist/quiet.js +21 -0
- package/dist/quiet.js.map +1 -0
- package/dist/reconcile/continuation.d.ts +132 -0
- package/dist/reconcile/continuation.d.ts.map +1 -0
- package/dist/reconcile/continuation.js +306 -0
- package/dist/reconcile/continuation.js.map +1 -0
- package/dist/reconcile/index.d.ts +26 -0
- package/dist/reconcile/index.d.ts.map +1 -0
- package/dist/reconcile/index.js +28 -0
- package/dist/reconcile/index.js.map +1 -0
- package/dist/reconcile/outcome-set.d.ts +53 -0
- package/dist/reconcile/outcome-set.d.ts.map +1 -0
- package/dist/reconcile/outcome-set.js +124 -0
- package/dist/reconcile/outcome-set.js.map +1 -0
- package/dist/reconcile/outcome.d.ts +56 -0
- package/dist/reconcile/outcome.d.ts.map +1 -0
- package/dist/reconcile/outcome.js +60 -0
- package/dist/reconcile/outcome.js.map +1 -0
- package/dist/reconcile/reconciliation.d.ts +49 -0
- package/dist/reconcile/reconciliation.d.ts.map +1 -0
- package/dist/reconcile/reconciliation.js +88 -0
- package/dist/reconcile/reconciliation.js.map +1 -0
- package/dist/reconcile/schema.d.ts +157 -0
- package/dist/reconcile/schema.d.ts.map +1 -0
- package/dist/reconcile/schema.js +97 -0
- package/dist/reconcile/schema.js.map +1 -0
- package/dist/record/index.d.ts +23 -0
- package/dist/record/index.d.ts.map +1 -0
- package/dist/record/index.js +25 -0
- package/dist/record/index.js.map +1 -0
- package/dist/record/review-record.d.ts +28 -0
- package/dist/record/review-record.d.ts.map +1 -0
- package/dist/record/review-record.js +78 -0
- package/dist/record/review-record.js.map +1 -0
- package/dist/record/schema.d.ts +153 -0
- package/dist/record/schema.d.ts.map +1 -0
- package/dist/record/schema.js +87 -0
- package/dist/record/schema.js.map +1 -0
- package/dist/record/store.d.ts +83 -0
- package/dist/record/store.d.ts.map +1 -0
- package/dist/record/store.js +162 -0
- package/dist/record/store.js.map +1 -0
- package/dist/record/stored-review.d.ts +36 -0
- package/dist/record/stored-review.d.ts.map +1 -0
- package/dist/record/stored-review.js +90 -0
- package/dist/record/stored-review.js.map +1 -0
- package/dist/refute.d.ts +318 -0
- package/dist/refute.d.ts.map +1 -0
- package/dist/refute.js +513 -0
- package/dist/refute.js.map +1 -0
- package/dist/render.d.ts +212 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +544 -0
- package/dist/render.js.map +1 -0
- package/dist/review-cli.d.ts +181 -0
- package/dist/review-cli.d.ts.map +1 -0
- package/dist/review-cli.js +598 -0
- package/dist/review-cli.js.map +1 -0
- package/dist/reviewer.d.ts +297 -0
- package/dist/reviewer.d.ts.map +1 -0
- package/dist/reviewer.js +580 -0
- package/dist/reviewer.js.map +1 -0
- package/dist/session-cli.d.ts +17 -0
- package/dist/session-cli.d.ts.map +1 -0
- package/dist/session-cli.js +62 -0
- package/dist/session-cli.js.map +1 -0
- package/dist/session.d.ts +36 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +105 -0
- package/dist/session.js.map +1 -0
- package/dist/settings.d.ts +68 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +175 -0
- package/dist/settings.js.map +1 -0
- package/dist/show-cli.d.ts +39 -0
- package/dist/show-cli.d.ts.map +1 -0
- package/dist/show-cli.js +56 -0
- package/dist/show-cli.js.map +1 -0
- package/dist/stdout.d.ts +28 -0
- package/dist/stdout.d.ts.map +1 -0
- package/dist/stdout.js +44 -0
- package/dist/stdout.js.map +1 -0
- package/dist/target.d.ts +58 -0
- package/dist/target.d.ts.map +1 -0
- package/dist/target.js +96 -0
- package/dist/target.js.map +1 -0
- package/dist/tools/index.d.ts +93 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +146 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/root.d.ts +62 -0
- package/dist/tools/root.d.ts.map +1 -0
- package/dist/tools/root.js +51 -0
- package/dist/tools/root.js.map +1 -0
- package/dist/usage.d.ts +75 -0
- package/dist/usage.d.ts.map +1 -0
- package/dist/usage.js +100 -0
- package/dist/usage.js.map +1 -0
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/dist/workspace.d.ts +48 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +126 -0
- package/dist/workspace.js.map +1 -0
- package/docker-compose.yml +61 -0
- package/package.json +70 -4
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning a review into something readable in a terminal.
|
|
3
|
+
*
|
|
4
|
+
* Findings are the product, so the rendering is not cosmetic: a wall of
|
|
5
|
+
* unwrapped text at a fixed indent is a review nobody reads past the third
|
|
6
|
+
* entry. Colour carries severity, indentation carries structure, and the
|
|
7
|
+
* evidence is set apart from the claim so a reader can check one against the
|
|
8
|
+
* other without parsing prose.
|
|
9
|
+
*/
|
|
10
|
+
import type { Finding, Severity, Suppression, Verdict, VerdictLevel } from './findings.js';
|
|
11
|
+
import type { Reconciliation } from './reconcile/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* ANSI styling, or nothing at all.
|
|
14
|
+
*
|
|
15
|
+
* Every method is a no-op on a plain palette, so callers never branch on
|
|
16
|
+
* whether colour is in play — the decision is made once, here.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Palette {
|
|
19
|
+
private readonly _enabled;
|
|
20
|
+
private constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Colour when a human is watching and has not asked us not to.
|
|
23
|
+
*
|
|
24
|
+
* NO_COLOR is honoured whatever its value, per the convention; FORCE_COLOR
|
|
25
|
+
* wins over a non-TTY so `weigh review | less -R` still has colour when
|
|
26
|
+
* asked for.
|
|
27
|
+
*/
|
|
28
|
+
static for(stream: {
|
|
29
|
+
isTTY?: boolean;
|
|
30
|
+
}, env?: NodeJS.ProcessEnv): Palette;
|
|
31
|
+
static plain(): Palette;
|
|
32
|
+
private _wrap;
|
|
33
|
+
bold(text: string): string;
|
|
34
|
+
dim(text: string): string;
|
|
35
|
+
path(text: string): string;
|
|
36
|
+
good(text: string): string;
|
|
37
|
+
/** The recommendation, in the colour of what it recommends. */
|
|
38
|
+
verdict(level: VerdictLevel, text: string): string;
|
|
39
|
+
/** Consequence, not decoration: the colour is the severity. */
|
|
40
|
+
severity(severity: Severity, text: string): string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Greedy pack of pre-formed segments.
|
|
44
|
+
*
|
|
45
|
+
* A footer row is several facts joined by a separator, not prose. Folding it
|
|
46
|
+
* on spaces puts the break inside "2,171 out"; folding it on the separator
|
|
47
|
+
* keeps each fact whole.
|
|
48
|
+
*/
|
|
49
|
+
export declare function packSegments(segments: readonly string[], width: number, separator?: string): string[];
|
|
50
|
+
/** Greedy wrap. Words longer than the width are left alone rather than cut. */
|
|
51
|
+
export declare function wrap(text: string, width: number): string[];
|
|
52
|
+
/** Trims to fit, keeping the end — the tail of a path is what identifies it. */
|
|
53
|
+
export declare function ellipsise(text: string, width: number, keep?: 'head' | 'tail'): string;
|
|
54
|
+
export interface RunFooter {
|
|
55
|
+
coverage: string;
|
|
56
|
+
/** Changed files opened, over changed files. Qualifies the recommendation. */
|
|
57
|
+
coverageRatio: number;
|
|
58
|
+
model: string;
|
|
59
|
+
channel: string;
|
|
60
|
+
/** Reasoning depth the run was given. */
|
|
61
|
+
effort?: string;
|
|
62
|
+
/** Why the run stopped early, when it did. */
|
|
63
|
+
stopped?: string;
|
|
64
|
+
/** Times the run was sent back for reading too little. Absent means none. */
|
|
65
|
+
nudges?: number;
|
|
66
|
+
/** Findings the confidence floor withheld, when it withheld any. */
|
|
67
|
+
withheld?: {
|
|
68
|
+
count: number;
|
|
69
|
+
floor: number;
|
|
70
|
+
};
|
|
71
|
+
/** What a refute pass did, when one ran. Absent means none did. */
|
|
72
|
+
refuted?: {
|
|
73
|
+
dropped: number;
|
|
74
|
+
kept: number;
|
|
75
|
+
/** Carried from the last review and not shown to the pass. Absent means none. */
|
|
76
|
+
carried?: number;
|
|
77
|
+
/** Why it did not finish, when it did not. */
|
|
78
|
+
stopped?: string;
|
|
79
|
+
};
|
|
80
|
+
modelCalls: number;
|
|
81
|
+
inputTokens: number;
|
|
82
|
+
outputTokens: number;
|
|
83
|
+
cachedTokens: number;
|
|
84
|
+
cost?: number;
|
|
85
|
+
durationMs: number;
|
|
86
|
+
base: string;
|
|
87
|
+
baseSha: string;
|
|
88
|
+
head: string;
|
|
89
|
+
/**
|
|
90
|
+
* What the review was told about this repository before it started.
|
|
91
|
+
*
|
|
92
|
+
* On the page because it changes how the findings should be read: a review
|
|
93
|
+
* that knew the house conventions and still reported one is saying something
|
|
94
|
+
* different from a review that was never told. Absent when nothing was
|
|
95
|
+
* recalled, which is the state of an unprimed repository.
|
|
96
|
+
*/
|
|
97
|
+
recalled?: string;
|
|
98
|
+
/**
|
|
99
|
+
* The review this one continued, when it continued one.
|
|
100
|
+
*
|
|
101
|
+
* On the page because a continuation's findings are not all its own: some
|
|
102
|
+
* were carried from the review named here, and a reader judging this report
|
|
103
|
+
* should be able to go and read that one.
|
|
104
|
+
*/
|
|
105
|
+
continued?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Where the review was written, when it was kept.
|
|
108
|
+
*
|
|
109
|
+
* On the page because it is how anyone reaches this review again — to refute
|
|
110
|
+
* it later, or to correct a finding in it. Absent when nothing was written.
|
|
111
|
+
*/
|
|
112
|
+
saved?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Lays out one review.
|
|
116
|
+
*
|
|
117
|
+
* Width and palette are fixed at construction so every method below can treat
|
|
118
|
+
* them as settled — the alternative is threading a "should I colour this"
|
|
119
|
+
* question through every call that formats a string.
|
|
120
|
+
*/
|
|
121
|
+
export declare class ReviewRenderer {
|
|
122
|
+
private readonly _palette;
|
|
123
|
+
private readonly _width;
|
|
124
|
+
constructor(_palette: Palette, columns: number | undefined);
|
|
125
|
+
static for(stream: {
|
|
126
|
+
isTTY?: boolean;
|
|
127
|
+
columns?: number;
|
|
128
|
+
}): ReviewRenderer;
|
|
129
|
+
review(summary: string, groups: Map<Severity, Finding[]>, verdict: Verdict, footer: RunFooter,
|
|
130
|
+
/** What a refute pass took out, listed after what survived it. */
|
|
131
|
+
suppressed?: readonly Suppression[],
|
|
132
|
+
/** This review against the last one, when there was a last one. */
|
|
133
|
+
reconciled?: Reconciliation): string;
|
|
134
|
+
/**
|
|
135
|
+
* What a second pass took out, and what it rested on.
|
|
136
|
+
*
|
|
137
|
+
* Last, and shorter than a finding: these are not being reported, they are
|
|
138
|
+
* being accounted for. But they are shown, because a finding that vanishes
|
|
139
|
+
* between the review and the report is indistinguishable from one that was
|
|
140
|
+
* never written — and a reader who cannot see the kill cannot disagree with
|
|
141
|
+
* it. The ground and the reason are the whole point of the section; a line
|
|
142
|
+
* saying only "2 dropped" would be worse than saying nothing.
|
|
143
|
+
*/
|
|
144
|
+
private _suppressed;
|
|
145
|
+
/**
|
|
146
|
+
* This review against the last one.
|
|
147
|
+
*
|
|
148
|
+
* After the findings, because what is wrong now comes before what used to be
|
|
149
|
+
* wrong — but before the footer, because this is about the code and the
|
|
150
|
+
* footer is about the run. Each line carries the reason behind its status: a
|
|
151
|
+
* bare "fixed" is a claim, and the reader has to be able to disagree with it.
|
|
152
|
+
*
|
|
153
|
+
* The pointer is the number in *this* report, taken from the same numbering
|
|
154
|
+
* the index uses, so "still open → #2" and "#2" below cannot disagree about
|
|
155
|
+
* which finding they mean.
|
|
156
|
+
*/
|
|
157
|
+
private _reconciled;
|
|
158
|
+
/** ` → #2`, when this run reported the same problem and numbered it. */
|
|
159
|
+
private _pointer;
|
|
160
|
+
/**
|
|
161
|
+
* A status, coloured by what it means for the reader.
|
|
162
|
+
*
|
|
163
|
+
* A fix is good news and reads as it. Anything still standing is painted by
|
|
164
|
+
* the finding's own severity, because that is what it costs to leave. An
|
|
165
|
+
* `unverified` is dim: it is the absence of an answer, and colouring it would
|
|
166
|
+
* give it a weight it has not earned.
|
|
167
|
+
*/
|
|
168
|
+
private _status;
|
|
169
|
+
/** `BLOCK · 1 high, 2 medium` — the recommendation, and what it rests on. */
|
|
170
|
+
private _banner;
|
|
171
|
+
/** The one finding to read first, set apart from the prose. */
|
|
172
|
+
private _headline;
|
|
173
|
+
/**
|
|
174
|
+
* Every finding on one screen, before any of them is argued.
|
|
175
|
+
*
|
|
176
|
+
* A reader deciding whether to read the detail wants the shape of the review
|
|
177
|
+
* first: how many, how bad, and where.
|
|
178
|
+
*/
|
|
179
|
+
private _index;
|
|
180
|
+
/** `── high ──────────────── 2 findings ──`, severity-coloured. */
|
|
181
|
+
private _severityHeading;
|
|
182
|
+
/** A rule with a label at one end and a count at the other. */
|
|
183
|
+
private _heading;
|
|
184
|
+
/**
|
|
185
|
+
* One finding: a numbered location line, the claim, the evidence, the fix.
|
|
186
|
+
*
|
|
187
|
+
* The number is how a finding is referred to afterwards — "#3 is
|
|
188
|
+
* intentional" has to mean the same thing here and in a PR comment — so it
|
|
189
|
+
* sits in the margin where it can be found without reading.
|
|
190
|
+
*/
|
|
191
|
+
private _finding;
|
|
192
|
+
/**
|
|
193
|
+
* One line on the second pass, or nothing when there was not one.
|
|
194
|
+
*
|
|
195
|
+
* A pass that failed says so here rather than in `stopped`, which is about
|
|
196
|
+
* the review. The two failures mean different things: a stopped review has
|
|
197
|
+
* findings it never looked for, while a stopped refute pass has findings it
|
|
198
|
+
* never argued with — the first is a gap in the answer, the second is only
|
|
199
|
+
* a second opinion that did not arrive.
|
|
200
|
+
*/
|
|
201
|
+
/**
|
|
202
|
+
* One line on the confidence floor, or nothing when it withheld nothing.
|
|
203
|
+
*
|
|
204
|
+
* Silent when the floor is 0 or everything cleared it — a row saying "0
|
|
205
|
+
* withheld" on every clean review is noise, and the floor is a number the
|
|
206
|
+
* user set, so they already know it is there.
|
|
207
|
+
*/
|
|
208
|
+
private _withheld;
|
|
209
|
+
private _refuted;
|
|
210
|
+
private _footer;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,KAAK,EAAW,cAAc,EAAoB,MAAM,sBAAsB,CAAC;AAiBtF;;;;;GAKG;AACH,qBAAa,OAAO;IACE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAA7C,OAAO,eAAmD;IAE1D;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAIrF;IAED,MAAM,CAAC,KAAK,IAAI,OAAO,CAEtB;IAED,OAAO,CAAC,KAAK;IAIb,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzB;IAED,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzB;IAED,+DAA+D;IAC/D,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;IAED,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CASjD;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,MA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