@quickchatai/pi-quickreview 1.2.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -27
- package/assets/config.example.toml +25 -7
- package/assets/prompts/onboarding.md +8 -7
- package/assets/schemas/review-result.v1.json +60 -0
- package/dist/extensions/quickreview.d.ts +17 -5
- package/dist/extensions/quickreview.d.ts.map +1 -1
- package/dist/extensions/quickreview.js +79 -26
- package/dist/extensions/quickreview.js.map +1 -1
- package/dist/src/engine/auth.d.ts +4 -0
- package/dist/src/engine/auth.d.ts.map +1 -1
- package/dist/src/engine/auth.js +11 -2
- package/dist/src/engine/auth.js.map +1 -1
- package/dist/src/engine/lens/activity.d.ts +45 -0
- package/dist/src/engine/lens/activity.d.ts.map +1 -0
- package/dist/src/engine/lens/activity.js +118 -0
- package/dist/src/engine/lens/activity.js.map +1 -0
- package/dist/src/engine/lens/runlens.d.ts +7 -0
- package/dist/src/engine/lens/runlens.d.ts.map +1 -1
- package/dist/src/engine/lens/runlens.js +30 -1
- package/dist/src/engine/lens/runlens.js.map +1 -1
- package/dist/src/engine/lens/tool.d.ts +7 -0
- package/dist/src/engine/lens/tool.d.ts.map +1 -1
- package/dist/src/engine/lens/tool.js +101 -18
- package/dist/src/engine/lens/tool.js.map +1 -1
- package/dist/src/engine/lens/wave.d.ts +6 -0
- package/dist/src/engine/lens/wave.d.ts.map +1 -1
- package/dist/src/engine/lens/wave.js +16 -0
- package/dist/src/engine/lens/wave.js.map +1 -1
- package/dist/src/homes.js +1 -1
- package/dist/src/homes.js.map +1 -1
- package/dist/src/live/events.d.ts +3 -0
- package/dist/src/live/events.d.ts.map +1 -1
- package/dist/src/live/events.js.map +1 -1
- package/dist/src/live/lensline.d.ts +20 -0
- package/dist/src/live/lensline.d.ts.map +1 -0
- package/dist/src/live/lensline.js +70 -0
- package/dist/src/live/lensline.js.map +1 -0
- package/dist/src/live/projection.d.ts +55 -0
- package/dist/src/live/projection.d.ts.map +1 -0
- package/dist/src/live/projection.js +465 -0
- package/dist/src/live/projection.js.map +1 -0
- package/dist/src/live/read.d.ts +24 -0
- package/dist/src/live/read.d.ts.map +1 -0
- package/dist/src/live/read.js +60 -0
- package/dist/src/live/read.js.map +1 -0
- package/dist/src/live/writer.d.ts +3 -0
- package/dist/src/live/writer.d.ts.map +1 -1
- package/dist/src/live/writer.js +6 -1
- package/dist/src/live/writer.js.map +1 -1
- package/dist/src/localreview.d.ts +18 -8
- package/dist/src/localreview.d.ts.map +1 -1
- package/dist/src/localreview.js +103 -43
- package/dist/src/localreview.js.map +1 -1
- package/dist/src/modelroute.d.ts +4 -0
- package/dist/src/modelroute.d.ts.map +1 -1
- package/dist/src/modelroute.js +21 -0
- package/dist/src/modelroute.js.map +1 -1
- package/dist/src/plugin/args.d.ts +38 -7
- package/dist/src/plugin/args.d.ts.map +1 -1
- package/dist/src/plugin/args.js +134 -37
- package/dist/src/plugin/args.js.map +1 -1
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +5 -1
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/login.d.ts +8 -4
- package/dist/src/plugin/login.d.ts.map +1 -1
- package/dist/src/plugin/login.js +25 -32
- package/dist/src/plugin/login.js.map +1 -1
- package/dist/src/plugin/messages.d.ts +7 -0
- package/dist/src/plugin/messages.d.ts.map +1 -0
- package/dist/src/plugin/messages.js +13 -0
- package/dist/src/plugin/messages.js.map +1 -0
- package/dist/src/plugin/peers.d.ts +17 -0
- package/dist/src/plugin/peers.d.ts.map +1 -0
- package/dist/src/plugin/peers.js +55 -0
- package/dist/src/plugin/peers.js.map +1 -0
- package/dist/src/plugin/review.d.ts +52 -6
- package/dist/src/plugin/review.d.ts.map +1 -1
- package/dist/src/plugin/review.js +261 -95
- package/dist/src/plugin/review.js.map +1 -1
- package/dist/src/plugin/scan.d.ts +80 -44
- package/dist/src/plugin/scan.d.ts.map +1 -1
- package/dist/src/plugin/scan.js +450 -233
- package/dist/src/plugin/scan.js.map +1 -1
- package/dist/src/plugin/scancases.d.ts +33 -0
- package/dist/src/plugin/scancases.d.ts.map +1 -0
- package/dist/src/plugin/scancases.js +153 -0
- package/dist/src/plugin/scancases.js.map +1 -0
- package/dist/src/plugin/settings.d.ts +18 -0
- package/dist/src/plugin/settings.d.ts.map +1 -0
- package/dist/src/plugin/settings.js +47 -0
- package/dist/src/plugin/settings.js.map +1 -0
- package/dist/src/plugin/setup.d.ts +35 -12
- package/dist/src/plugin/setup.d.ts.map +1 -1
- package/dist/src/plugin/setup.js +258 -118
- package/dist/src/plugin/setup.js.map +1 -1
- package/dist/src/plugin/versiongate.d.ts +3 -0
- package/dist/src/plugin/versiongate.d.ts.map +1 -1
- package/dist/src/plugin/versiongate.js +9 -4
- package/dist/src/plugin/versiongate.js.map +1 -1
- package/dist/src/profileoverrides.d.ts +3 -0
- package/dist/src/profileoverrides.d.ts.map +1 -1
- package/dist/src/profileoverrides.js +9 -2
- package/dist/src/profileoverrides.js.map +1 -1
- package/dist/src/reviewapi.d.ts +22 -31
- package/dist/src/reviewapi.d.ts.map +1 -1
- package/dist/src/reviewapi.js +90 -66
- package/dist/src/reviewapi.js.map +1 -1
- package/dist/src/reviewdest.d.ts +1 -1
- package/dist/src/reviewdest.d.ts.map +1 -1
- package/dist/src/reviewdest.js +4 -3
- package/dist/src/reviewdest.js.map +1 -1
- package/dist/src/reviewtarget.d.ts +36 -0
- package/dist/src/reviewtarget.d.ts.map +1 -0
- package/dist/src/reviewtarget.js +6 -0
- package/dist/src/reviewtarget.js.map +1 -0
- package/dist/src/round-progress.d.ts +5 -0
- package/dist/src/round-progress.d.ts.map +1 -1
- package/dist/src/round-progress.js.map +1 -1
- package/dist/src/round-stage-deadlines.d.ts +26 -1
- package/dist/src/round-stage-deadlines.d.ts.map +1 -1
- package/dist/src/round-stage-deadlines.js +45 -2
- package/dist/src/round-stage-deadlines.js.map +1 -1
- package/dist/src/savedpost.d.ts +65 -0
- package/dist/src/savedpost.d.ts.map +1 -0
- package/dist/src/savedpost.js +131 -0
- package/dist/src/savedpost.js.map +1 -0
- package/dist/src/scan/caseread.d.ts +84 -0
- package/dist/src/scan/caseread.d.ts.map +1 -0
- package/dist/src/scan/caseread.js +263 -0
- package/dist/src/scan/caseread.js.map +1 -0
- package/dist/src/scan/channelfs.d.ts +6 -0
- package/dist/src/scan/channelfs.d.ts.map +1 -0
- package/dist/src/scan/channelfs.js +27 -0
- package/dist/src/scan/channelfs.js.map +1 -0
- package/dist/src/scan/cutrender.d.ts +13 -0
- package/dist/src/scan/cutrender.d.ts.map +1 -0
- package/dist/src/scan/cutrender.js +51 -0
- package/dist/src/scan/cutrender.js.map +1 -0
- package/dist/src/scan/facts.d.ts +72 -0
- package/dist/src/scan/facts.d.ts.map +1 -0
- package/dist/src/scan/facts.js +593 -0
- package/dist/src/scan/facts.js.map +1 -0
- package/dist/src/scan/findings.d.ts +320 -0
- package/dist/src/scan/findings.d.ts.map +1 -0
- package/dist/src/scan/findings.js +948 -0
- package/dist/src/scan/findings.js.map +1 -0
- package/dist/src/scan/ledger.d.ts +116 -0
- package/dist/src/scan/ledger.d.ts.map +1 -0
- package/dist/src/scan/ledger.js +207 -0
- package/dist/src/scan/ledger.js.map +1 -0
- package/dist/src/scan/presentation.d.ts +19 -0
- package/dist/src/scan/presentation.d.ts.map +1 -0
- package/dist/src/scan/presentation.js +9 -0
- package/dist/src/scan/presentation.js.map +1 -0
- package/dist/src/scan/scan.d.ts +354 -0
- package/dist/src/scan/scan.d.ts.map +1 -0
- package/dist/src/scan/scan.js +725 -0
- package/dist/src/scan/scan.js.map +1 -0
- package/dist/src/scan/scanagents.d.ts +23 -0
- package/dist/src/scan/scanagents.d.ts.map +1 -0
- package/dist/src/scan/scanagents.js +99 -0
- package/dist/src/scan/scanagents.js.map +1 -0
- package/dist/src/scan/scanassemble.d.ts +65 -0
- package/dist/src/scan/scanassemble.d.ts.map +1 -0
- package/dist/src/scan/scanassemble.js +93 -0
- package/dist/src/scan/scanassemble.js.map +1 -0
- package/dist/src/scan/scanfs.d.ts +26 -0
- package/dist/src/scan/scanfs.d.ts.map +1 -0
- package/dist/src/scan/scanfs.js +229 -0
- package/dist/src/scan/scanfs.js.map +1 -0
- package/dist/src/scan/scanlease.d.ts +50 -0
- package/dist/src/scan/scanlease.d.ts.map +1 -0
- package/dist/src/scan/scanlease.js +251 -0
- package/dist/src/scan/scanlease.js.map +1 -0
- package/dist/src/scan/scanleaves.d.ts +55 -0
- package/dist/src/scan/scanleaves.d.ts.map +1 -0
- package/dist/src/scan/scanleaves.js +258 -0
- package/dist/src/scan/scanleaves.js.map +1 -0
- package/dist/src/scan/scanports.d.ts +79 -0
- package/dist/src/scan/scanports.d.ts.map +1 -0
- package/dist/src/scan/scanports.js +8 -0
- package/dist/src/scan/scanports.js.map +1 -0
- package/dist/src/scan/scanrender.d.ts +128 -0
- package/dist/src/scan/scanrender.d.ts.map +1 -0
- package/dist/src/scan/scanrender.js +527 -0
- package/dist/src/scan/scanrender.js.map +1 -0
- package/dist/src/scan/scanreport.d.ts +126 -0
- package/dist/src/scan/scanreport.d.ts.map +1 -0
- package/dist/src/scan/scanreport.js +289 -0
- package/dist/src/scan/scanreport.js.map +1 -0
- package/dist/src/scan/scanrun.d.ts +472 -0
- package/dist/src/scan/scanrun.d.ts.map +1 -0
- package/dist/src/scan/scanrun.js +1733 -0
- package/dist/src/scan/scanrun.js.map +1 -0
- package/dist/src/scan/scantree.d.ts +21 -0
- package/dist/src/scan/scantree.d.ts.map +1 -0
- package/dist/src/scan/scantree.js +297 -0
- package/dist/src/scan/scantree.js.map +1 -0
- package/dist/src/scan/scanverbs.d.ts +208 -0
- package/dist/src/scan/scanverbs.d.ts.map +1 -0
- package/dist/src/scan/scanverbs.js +689 -0
- package/dist/src/scan/scanverbs.js.map +1 -0
- package/dist/src/scan/stage2.d.ts +221 -0
- package/dist/src/scan/stage2.d.ts.map +1 -0
- package/dist/src/scan/stage2.js +617 -0
- package/dist/src/scan/stage2.js.map +1 -0
- package/dist/src/scan/stage2request.d.ts +125 -0
- package/dist/src/scan/stage2request.d.ts.map +1 -0
- package/dist/src/scan/stage2request.js +259 -0
- package/dist/src/scan/stage2request.js.map +1 -0
- package/dist/src/scan/textsniff.d.ts +14 -0
- package/dist/src/scan/textsniff.d.ts.map +1 -0
- package/dist/src/scan/textsniff.js +88 -0
- package/dist/src/scan/textsniff.js.map +1 -0
- package/dist/src/scan/unitcut.d.ts +135 -0
- package/dist/src/scan/unitcut.d.ts.map +1 -0
- package/dist/src/scan/unitcut.js +437 -0
- package/dist/src/scan/unitcut.js.map +1 -0
- package/dist/src/scan/unitcutstore.d.ts +155 -0
- package/dist/src/scan/unitcutstore.d.ts.map +1 -0
- package/dist/src/scan/unitcutstore.js +381 -0
- package/dist/src/scan/unitcutstore.js.map +1 -0
- package/dist/src/setupchecklist.d.ts +240 -0
- package/dist/src/setupchecklist.d.ts.map +1 -0
- package/dist/src/setupchecklist.js +407 -0
- package/dist/src/setupchecklist.js.map +1 -0
- package/package.json +7 -3
- package/skills/qcr-review/SKILL.md +24 -0
- package/skills/qcr-scan/SKILL.md +23 -0
- package/skills/qcr-setup/SKILL.md +18 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { FindingsFile, MatchQuestion, ResemblesDismissed, ScanFinding } from "./findings.js";
|
|
2
|
+
import type { RunFile, ScanRun, ScanRunSummary } from "./scanrun.js";
|
|
3
|
+
export type { FindingState, ScanFinding } from "./findings.js";
|
|
4
|
+
export type { ScanCaseState, ScanRun, ScanRunSummary } from "./scanrun.js";
|
|
5
|
+
export type { ScanSeverity } from "./scan.js";
|
|
6
|
+
export declare const FINDING_STATES: readonly ["new", "promoted", "dismissed", "fixed"];
|
|
7
|
+
export declare const RUN_FILE = "scan/run.json";
|
|
8
|
+
export declare const RUN_VERSION = 1;
|
|
9
|
+
export declare const FINDINGS_FILE = "scan/findings.json";
|
|
10
|
+
export declare const FINDINGS_VERSION = 1;
|
|
11
|
+
export declare const SCAN_STOP_FILE = "scan/stop.json";
|
|
12
|
+
export declare const SCAN_STOP_RESULT_FILE = "scan/stop-result.json";
|
|
13
|
+
/** The skeptic's tier for a stored scan finding: `confirmed` (it traced a
|
|
14
|
+
* concrete scenario), `likely` (a real mechanism, reachability not fully
|
|
15
|
+
* traced), `doubtful` (refuted, class-matched, or anything it would have
|
|
16
|
+
* killed — kept, never dropped). */
|
|
17
|
+
export type Validity = "confirmed" | "likely" | "doubtful";
|
|
18
|
+
export declare const VALIDITIES: readonly Validity[];
|
|
19
|
+
/** A tier, or `unknown`: no skeptic judged it (the validator was off or
|
|
20
|
+
* failed) or it was stored before tiers existed — never guessed. */
|
|
21
|
+
export type ValidityView = Validity | "unknown";
|
|
22
|
+
/** Display order: confirmed first, unknown last. */
|
|
23
|
+
export declare const VALIDITY_ORDER: readonly ValidityView[];
|
|
24
|
+
/** The longest dismissal reason triage takes. The TUI checks it before
|
|
25
|
+
* asking, so an over-long reason is refused where it is typed. */
|
|
26
|
+
export declare const DISMISS_REASON_MAX = 500;
|
|
27
|
+
/** A dismissed finding a re-scan settled as no longer reported (findings.ts
|
|
28
|
+
* `unreported`): out of play, as a fixed one is, until a scan reports it again. */
|
|
29
|
+
export declare const goneDismissal: (f: Pick<ScanFinding, "state" | "unreported">) => boolean;
|
|
30
|
+
/** A finding's tier as stored — `unknown` when it carries none. */
|
|
31
|
+
export declare function validityOf(f: {
|
|
32
|
+
validity?: Validity | null;
|
|
33
|
+
}): ValidityView;
|
|
34
|
+
/** Is a finding still standing — new, or promoted and not yet fixed? The
|
|
35
|
+
* portrait's counts and the scan tab's weights read open the same way. */
|
|
36
|
+
export declare const isOpenFinding: (f: Pick<ScanFinding, "state">) => boolean;
|
|
37
|
+
/** A finding's resemblance to a DISMISSED one (findings.ts sets it when it
|
|
38
|
+
* stores the finding), as a reader shows it: only on a finding still
|
|
39
|
+
* untriaged (`new`) — once the operator promotes or dismisses it, the
|
|
40
|
+
* resemblance is answered. */
|
|
41
|
+
export declare function dismissedLookalike(f: Pick<ScanFinding, "state" | "resembles_dismissed">): ResemblesDismissed | null;
|
|
42
|
+
/** 1 for a finding flagged as resembling a dismissed one, else 0 — the sort
|
|
43
|
+
* key that puts it below the unflagged findings of its tier. */
|
|
44
|
+
export declare const lookalikeRank: (f: Pick<ScanFinding, "state" | "resembles_dismissed">) => number;
|
|
45
|
+
/** Parse the run record; throws on anything this version does not read. */
|
|
46
|
+
export declare function parseRunFile(text: string): RunFile;
|
|
47
|
+
/** Parse the findings store; throws on anything this version does not read. */
|
|
48
|
+
export declare function parseFindingsFile(text: string): FindingsFile;
|
|
49
|
+
/** One record file: absent, read, or why it could not be. */
|
|
50
|
+
export type RecordRead<T> = {
|
|
51
|
+
kind: "absent";
|
|
52
|
+
} | {
|
|
53
|
+
kind: "read";
|
|
54
|
+
value: T;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "unreadable";
|
|
57
|
+
why: string;
|
|
58
|
+
};
|
|
59
|
+
/** The scan run record in the state home at `home`. */
|
|
60
|
+
export declare function readScanRuns(home: string): RecordRead<{
|
|
61
|
+
current: ScanRun | null;
|
|
62
|
+
history: ScanRunSummary[];
|
|
63
|
+
}>;
|
|
64
|
+
/** The findings store in the state home at `home`. */
|
|
65
|
+
export declare function readScanFindings(home: string): RecordRead<{
|
|
66
|
+
findings: ScanFinding[];
|
|
67
|
+
question: MatchQuestion | null;
|
|
68
|
+
}>;
|
|
69
|
+
export interface ScanStopRequest {
|
|
70
|
+
/** Unique per click; the result names it. */
|
|
71
|
+
id: string;
|
|
72
|
+
/** The run the TUI showed running — only that run is stopped. */
|
|
73
|
+
run: string;
|
|
74
|
+
at: string;
|
|
75
|
+
/** Who asked: the TUI's stop, `qcr scan stop`, or the companion's
|
|
76
|
+
* scan_stop for a run another process drives. */
|
|
77
|
+
by: "tui" | "cli" | "companion";
|
|
78
|
+
}
|
|
79
|
+
export interface ScanStopResult {
|
|
80
|
+
request: string;
|
|
81
|
+
run: string;
|
|
82
|
+
at: string;
|
|
83
|
+
ok: boolean;
|
|
84
|
+
errors: string[];
|
|
85
|
+
/** The run the answering companion was driving when it answered — `null`
|
|
86
|
+
* when it drove none. Absent from an answer that does not say. A run the
|
|
87
|
+
* record still calls running that the companion says it is not driving was
|
|
88
|
+
* interrupted (a companion restart loses the run in flight). */
|
|
89
|
+
in_flight?: string | null;
|
|
90
|
+
}
|
|
91
|
+
/** Parse a stop request, or null when it is not one. */
|
|
92
|
+
export declare function parseStopRequest(text: string): ScanStopRequest | null;
|
|
93
|
+
/** Parse a stop result, or null when it is not one. */
|
|
94
|
+
export declare function parseStopResult(text: string): ScanStopResult | null;
|
|
95
|
+
/**
|
|
96
|
+
* The TUI's stop: ask the companion to stop the run `run`, which the TUI
|
|
97
|
+
* showed running. Refused when the record cannot be read or no longer shows
|
|
98
|
+
* that run running — a stop is never aimed at a run the operator did not see.
|
|
99
|
+
* The notice line says what was asked, or why nothing was.
|
|
100
|
+
*/
|
|
101
|
+
export declare function clickStopScan(home: string, run: string, now?: Date, by?: ScanStopRequest["by"]): {
|
|
102
|
+
ok: true;
|
|
103
|
+
request: string;
|
|
104
|
+
line: string;
|
|
105
|
+
} | {
|
|
106
|
+
ok: false;
|
|
107
|
+
line: string;
|
|
108
|
+
};
|
|
109
|
+
/** The companion's latest stop answer: none yet (`absent`, or a file this
|
|
110
|
+
* version does not read as one), the answer, or `unreadable` with the reason
|
|
111
|
+
* — never a throw, and an unreadable answer is never mistaken for none. */
|
|
112
|
+
export type StopResultRead = {
|
|
113
|
+
kind: "absent";
|
|
114
|
+
} | {
|
|
115
|
+
kind: "read";
|
|
116
|
+
result: ScanStopResult;
|
|
117
|
+
} | {
|
|
118
|
+
kind: "unreadable";
|
|
119
|
+
why: string;
|
|
120
|
+
};
|
|
121
|
+
export declare function readStopResult(home: string): StopResultRead;
|
|
122
|
+
/** What became of the stop `request`: the companion's answer, or null while
|
|
123
|
+
* it has not answered (a companion that is down stops nothing — and runs
|
|
124
|
+
* nothing either). */
|
|
125
|
+
export declare function scanStopOutcome(home: string, request: string): string | null;
|
|
126
|
+
//# sourceMappingURL=scanreport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanreport.d.ts","sourceRoot":"","sources":["../../../src/scan/scanreport.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAErE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,cAAc,oDAAqD,CAAC;AAEjF,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAI7D;;;oCAGoC;AACpC,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC3D,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAAwC,CAAC;AACnF;oEACoE;AACpE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAA+B,CAAC;AAElF;kEACkE;AAClE,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;mFACmF;AACnF,eAAO,MAAM,aAAa,GAAI,GAAG,IAAI,CAAC,W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AAI,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAS3D;AAED;;sBAEsB;AACtB,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW5E"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
// The scan report's read side and its stop channel: what the TUI's `[8] scan`
|
|
2
|
+
// tab reads out of the state home, and the one file through which it asks
|
|
3
|
+
// the companion to stop a running scan. A leaf like stage2request.ts:
|
|
4
|
+
// it reaches its siblings by type only, so the TUI (which never imports the
|
|
5
|
+
// setup engine — tests/single-shepherd.test.ts) can read the run record and
|
|
6
|
+
// the findings store without carrying the case runner along.
|
|
7
|
+
//
|
|
8
|
+
// Two record files, both the engine's (this module owns their names and
|
|
9
|
+
// their parsers, so the engine and the TUI can never read them differently):
|
|
10
|
+
// `scan/run.json` (scanrun.ts — the current run and a short history) and
|
|
11
|
+
// `scan/findings.json` (findings.ts — every finding with its state). Each is
|
|
12
|
+
// read totally and is one of three facts: absent (no scan has written it),
|
|
13
|
+
// read, or unreadable with the reason — never an empty list standing in for
|
|
14
|
+
// a file that could not be read (the honest-unknown rule).
|
|
15
|
+
//
|
|
16
|
+
// The stop channel mirrors the stage-2 start channel: the TUI writes
|
|
17
|
+
// `SCAN_STOP_FILE` naming the run it showed running; the companion's scan
|
|
18
|
+
// belt picks it up within seconds, stops exactly that run (in-flight cases
|
|
19
|
+
// aborted, the ledger resumes the rest) and answers in
|
|
20
|
+
// `SCAN_STOP_RESULT_FILE`, naming the request it answered — so a stop is
|
|
21
|
+
// answered once and never replayed onto a later run.
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
import { readTextIfPresent, writeAtomic } from "./channelfs.js";
|
|
24
|
+
export const FINDING_STATES = ["new", "promoted", "dismissed", "fixed"];
|
|
25
|
+
export const RUN_FILE = "scan/run.json";
|
|
26
|
+
export const RUN_VERSION = 1;
|
|
27
|
+
export const FINDINGS_FILE = "scan/findings.json";
|
|
28
|
+
export const FINDINGS_VERSION = 1;
|
|
29
|
+
export const SCAN_STOP_FILE = "scan/stop.json";
|
|
30
|
+
export const SCAN_STOP_RESULT_FILE = "scan/stop-result.json";
|
|
31
|
+
export const VALIDITIES = ["confirmed", "likely", "doubtful"];
|
|
32
|
+
/** Display order: confirmed first, unknown last. */
|
|
33
|
+
export const VALIDITY_ORDER = [...VALIDITIES, "unknown"];
|
|
34
|
+
/** The longest dismissal reason triage takes. The TUI checks it before
|
|
35
|
+
* asking, so an over-long reason is refused where it is typed. */
|
|
36
|
+
export const DISMISS_REASON_MAX = 500;
|
|
37
|
+
/** A dismissed finding a re-scan settled as no longer reported (findings.ts
|
|
38
|
+
* `unreported`): out of play, as a fixed one is, until a scan reports it again. */
|
|
39
|
+
export const goneDismissal = (f) => f.state === "dismissed" && f.unreported != null;
|
|
40
|
+
/** A finding's tier as stored — `unknown` when it carries none. */
|
|
41
|
+
export function validityOf(f) {
|
|
42
|
+
return f.validity !== undefined &&
|
|
43
|
+
f.validity !== null &&
|
|
44
|
+
VALIDITIES.includes(f.validity)
|
|
45
|
+
? f.validity
|
|
46
|
+
: "unknown";
|
|
47
|
+
}
|
|
48
|
+
const clean = (err) => (err instanceof Error ? err.message : String(err));
|
|
49
|
+
// ---- the two records ---------------------------------------------------------------
|
|
50
|
+
/** Is a finding still standing — new, or promoted and not yet fixed? The
|
|
51
|
+
* portrait's counts and the scan tab's weights read open the same way. */
|
|
52
|
+
export const isOpenFinding = (f) => f.state === "new" || f.state === "promoted";
|
|
53
|
+
/** A finding's resemblance to a DISMISSED one (findings.ts sets it when it
|
|
54
|
+
* stores the finding), as a reader shows it: only on a finding still
|
|
55
|
+
* untriaged (`new`) — once the operator promotes or dismisses it, the
|
|
56
|
+
* resemblance is answered. */
|
|
57
|
+
export function dismissedLookalike(f) {
|
|
58
|
+
return f.state === "new" ? (f.resembles_dismissed ?? null) : null;
|
|
59
|
+
}
|
|
60
|
+
/** 1 for a finding flagged as resembling a dismissed one, else 0 — the sort
|
|
61
|
+
* key that puts it below the unflagged findings of its tier. */
|
|
62
|
+
export const lookalikeRank = (f) => dismissedLookalike(f) ? 1 : 0;
|
|
63
|
+
/** Parse the run record; throws on anything this version does not read. */
|
|
64
|
+
export function parseRunFile(text) {
|
|
65
|
+
const raw = JSON.parse(text);
|
|
66
|
+
if (typeof raw !== "object" || raw === null || raw.version !== RUN_VERSION)
|
|
67
|
+
throw new Error("unknown version");
|
|
68
|
+
const current = raw.current ?? null;
|
|
69
|
+
if (current !== null && (typeof current !== "object" || !Array.isArray(current.cases))) {
|
|
70
|
+
throw new Error("`current` is not a scan run");
|
|
71
|
+
}
|
|
72
|
+
return { version: RUN_VERSION, current, history: Array.isArray(raw.history) ? raw.history : [] };
|
|
73
|
+
}
|
|
74
|
+
/** Parse the findings store; throws on anything this version does not read. */
|
|
75
|
+
export function parseFindingsFile(text) {
|
|
76
|
+
const raw = JSON.parse(text);
|
|
77
|
+
if (typeof raw !== "object" ||
|
|
78
|
+
raw === null ||
|
|
79
|
+
raw.version !== FINDINGS_VERSION ||
|
|
80
|
+
!Array.isArray(raw.findings)) {
|
|
81
|
+
throw new Error("not a version-1 findings store");
|
|
82
|
+
}
|
|
83
|
+
for (const f of raw.findings) {
|
|
84
|
+
if (typeof f?.fingerprint !== "string" ||
|
|
85
|
+
typeof f.path !== "string" ||
|
|
86
|
+
typeof f.state !== "string") {
|
|
87
|
+
throw new Error("a finding has no fingerprint, path or state");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const q = raw.question ?? null;
|
|
91
|
+
if (q !== null &&
|
|
92
|
+
(typeof q.key !== "string" || !Array.isArray(q.unreported) || !Array.isArray(q.fresh))) {
|
|
93
|
+
throw new Error("the pending match question is malformed");
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
version: FINDINGS_VERSION,
|
|
97
|
+
findings: currentLookalikes(raw.findings.map(stickyDismissal)),
|
|
98
|
+
question: q,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** A `resembles_dismissed` flag is written when a finding is stored; the
|
|
102
|
+
* dismissal it names can change after that — re-dismissed with another
|
|
103
|
+
* reason, promoted (the operator changed their mind), or folded into a fresh
|
|
104
|
+
* finding by a match answer. Every reader goes through this parse, so the
|
|
105
|
+
* flag is re-read against the store here: it names the finding that now
|
|
106
|
+
* carries that fingerprint (itself, or the one it became an alias of) and
|
|
107
|
+
* that finding's current reason while it is still dismissed, and it is
|
|
108
|
+
* dropped otherwise — a stale "looks like a finding you dismissed" never
|
|
109
|
+
* reaches the operator. */
|
|
110
|
+
function currentLookalikes(findings) {
|
|
111
|
+
if (!findings.some((f) => f.resembles_dismissed))
|
|
112
|
+
return findings;
|
|
113
|
+
const owner = new Map();
|
|
114
|
+
for (const f of findings)
|
|
115
|
+
for (const a of f.aliases ?? [])
|
|
116
|
+
owner.set(a, f);
|
|
117
|
+
for (const f of findings)
|
|
118
|
+
owner.set(f.fingerprint, f);
|
|
119
|
+
return findings.map((f) => {
|
|
120
|
+
if (!f.resembles_dismissed)
|
|
121
|
+
return f;
|
|
122
|
+
const { resembles_dismissed: flag, ...rest } = f;
|
|
123
|
+
const d = owner.get(flag.fingerprint);
|
|
124
|
+
if (!d || d.state !== "dismissed" || d.fingerprint === f.fingerprint)
|
|
125
|
+
return rest;
|
|
126
|
+
return {
|
|
127
|
+
...rest,
|
|
128
|
+
resembles_dismissed: {
|
|
129
|
+
fingerprint: d.fingerprint,
|
|
130
|
+
reason: d.dismissal?.reason ?? flag.reason,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** A legacy store may hold a dismissed finding recorded as `fixed` with
|
|
136
|
+
* `fixed.from = "dismissed"`: it reads back as the dismissal it is, its fix
|
|
137
|
+
* kept as the `unreported` audit stamp (findings.ts). Every other finding is
|
|
138
|
+
* returned as it is. */
|
|
139
|
+
function stickyDismissal(f) {
|
|
140
|
+
if (f.state !== "fixed" || f.fixed?.from !== "dismissed")
|
|
141
|
+
return f;
|
|
142
|
+
const { run, sha, at } = f.fixed;
|
|
143
|
+
return { ...f, state: "dismissed", fixed: null, unreported: { run, sha, at } };
|
|
144
|
+
}
|
|
145
|
+
function readRecord(home, rel, parse) {
|
|
146
|
+
let text;
|
|
147
|
+
try {
|
|
148
|
+
text = readTextIfPresent(join(home, rel));
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
return { kind: "unreadable", why: `${rel} cannot be read: ${clean(err)}` };
|
|
152
|
+
}
|
|
153
|
+
if (text === null)
|
|
154
|
+
return { kind: "absent" };
|
|
155
|
+
try {
|
|
156
|
+
return { kind: "read", value: parse(text) };
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
return { kind: "unreadable", why: `${rel} is not a record this version reads (${clean(err)})` };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** The scan run record in the state home at `home`. */
|
|
163
|
+
export function readScanRuns(home) {
|
|
164
|
+
return readRecord(home, RUN_FILE, (t) => {
|
|
165
|
+
const f = parseRunFile(t);
|
|
166
|
+
return { current: f.current, history: f.history };
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/** The findings store in the state home at `home`. */
|
|
170
|
+
export function readScanFindings(home) {
|
|
171
|
+
return readRecord(home, FINDINGS_FILE, (t) => {
|
|
172
|
+
const f = parseFindingsFile(t);
|
|
173
|
+
return { findings: f.findings, question: f.question ?? null };
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/** Parse a stop request, or null when it is not one. */
|
|
177
|
+
export function parseStopRequest(text) {
|
|
178
|
+
try {
|
|
179
|
+
const r = JSON.parse(text);
|
|
180
|
+
if (typeof r !== "object" ||
|
|
181
|
+
r === null ||
|
|
182
|
+
typeof r.id !== "string" ||
|
|
183
|
+
r.id === "" ||
|
|
184
|
+
typeof r.run !== "string" ||
|
|
185
|
+
r.run === "")
|
|
186
|
+
return null;
|
|
187
|
+
return {
|
|
188
|
+
id: r.id,
|
|
189
|
+
run: r.run,
|
|
190
|
+
at: typeof r.at === "string" ? r.at : "",
|
|
191
|
+
by: r.by === "cli" || r.by === "companion" ? r.by : "tui",
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/** Parse a stop result, or null when it is not one. */
|
|
199
|
+
export function parseStopResult(text) {
|
|
200
|
+
try {
|
|
201
|
+
const r = JSON.parse(text);
|
|
202
|
+
if (typeof r !== "object" ||
|
|
203
|
+
r === null ||
|
|
204
|
+
typeof r.request !== "string" ||
|
|
205
|
+
typeof r.ok !== "boolean")
|
|
206
|
+
return null;
|
|
207
|
+
return {
|
|
208
|
+
request: r.request,
|
|
209
|
+
run: typeof r.run === "string" ? r.run : "",
|
|
210
|
+
at: typeof r.at === "string" ? r.at : "",
|
|
211
|
+
ok: r.ok,
|
|
212
|
+
errors: Array.isArray(r.errors)
|
|
213
|
+
? r.errors.filter((e) => typeof e === "string")
|
|
214
|
+
: [],
|
|
215
|
+
...(typeof r.in_flight === "string" || r.in_flight === null
|
|
216
|
+
? { in_flight: r.in_flight }
|
|
217
|
+
: {}),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The TUI's stop: ask the companion to stop the run `run`, which the TUI
|
|
226
|
+
* showed running. Refused when the record cannot be read or no longer shows
|
|
227
|
+
* that run running — a stop is never aimed at a run the operator did not see.
|
|
228
|
+
* The notice line says what was asked, or why nothing was.
|
|
229
|
+
*/
|
|
230
|
+
export function clickStopScan(home, run, now = new Date(), by = "tui") {
|
|
231
|
+
const read = readScanRuns(home);
|
|
232
|
+
if (read.kind === "unreadable")
|
|
233
|
+
return { ok: false, line: `scan not stopped: ${read.why}` };
|
|
234
|
+
const cur = read.kind === "read" ? read.value.current : null;
|
|
235
|
+
if (cur === null || cur.id !== run || cur.state !== "running") {
|
|
236
|
+
return {
|
|
237
|
+
ok: false,
|
|
238
|
+
line: `scan not stopped: ${run} is no longer running — look at the report again`,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
const request = {
|
|
242
|
+
id: `${now.toISOString()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
243
|
+
run,
|
|
244
|
+
at: now.toISOString(),
|
|
245
|
+
by,
|
|
246
|
+
};
|
|
247
|
+
try {
|
|
248
|
+
writeAtomic(join(home, SCAN_STOP_FILE), `${JSON.stringify(request)}\n`);
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
return {
|
|
252
|
+
ok: false,
|
|
253
|
+
line: `scan not stopped: the stop request could not be written: ${clean(err)}`,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
ok: true,
|
|
258
|
+
request: request.id,
|
|
259
|
+
line: `stop asked for ${run} — the companion stops it within seconds; the ledger resumes the rest`,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export function readStopResult(home) {
|
|
263
|
+
let text;
|
|
264
|
+
try {
|
|
265
|
+
text = readTextIfPresent(join(home, SCAN_STOP_RESULT_FILE));
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
return { kind: "unreadable", why: `${SCAN_STOP_RESULT_FILE}: ${clean(err)}` };
|
|
269
|
+
}
|
|
270
|
+
const r = text === null ? null : parseStopResult(text);
|
|
271
|
+
return r === null ? { kind: "absent" } : { kind: "read", result: r };
|
|
272
|
+
}
|
|
273
|
+
/** What became of the stop `request`: the companion's answer, or null while
|
|
274
|
+
* it has not answered (a companion that is down stops nothing — and runs
|
|
275
|
+
* nothing either). */
|
|
276
|
+
export function scanStopOutcome(home, request) {
|
|
277
|
+
const read = readStopResult(home);
|
|
278
|
+
// Not "no answer yet": the answer may be there, unreadable — said once,
|
|
279
|
+
// never polled for silently.
|
|
280
|
+
if (read.kind === "unreadable")
|
|
281
|
+
return `the scan stop's answer cannot be read (${read.why}) — check scan_status`;
|
|
282
|
+
if (read.kind === "absent" || read.result.request !== request)
|
|
283
|
+
return null;
|
|
284
|
+
const r = read.result;
|
|
285
|
+
return r.ok
|
|
286
|
+
? `scan ${r.run} stopped — what finished is in the ledger`
|
|
287
|
+
: `scan stop refused: ${r.errors.join("; ")}`;
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=scanreport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanreport.js","sourceRoot":"","sources":["../../../src/scan/scanreport.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,sEAAsE;AACtE,4EAA4E;AAC5E,4EAA4E;AAC5E,6DAA6D;AAC7D,EAAE;AACF,wEAAwE;AACxE,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,2DAA2D;AAC3D,EAAE;AACF,qEAAqE;AACrE,0EAA0E;AAC1E,2EAA2E;AAC3E,uDAAuD;AACvD,yEAAyE;AACzE,qDAAqD;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQhE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AAEjF,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,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