@boringparts/verule 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/dist/additional-inputs.d.ts +13 -0
- package/dist/additional-inputs.js +68 -0
- package/dist/cli-command-identity.d.ts +13 -0
- package/dist/cli-command-identity.js +15 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +42 -0
- package/dist/config-loader.d.ts +14 -0
- package/dist/config-loader.js +105 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/inline-ignore.d.ts +44 -0
- package/dist/inline-ignore.js +297 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.js +594 -0
- package/dist/observation.d.ts +111 -0
- package/dist/observation.js +767 -0
- package/dist/projects.d.ts +21 -0
- package/dist/projects.js +168 -0
- package/dist/report-wire.d.ts +1623 -0
- package/dist/report-wire.js +738 -0
- package/dist/session-command.d.ts +48 -0
- package/dist/session-command.js +73 -0
- package/dist/session.d.ts +18 -0
- package/dist/session.js +812 -0
- package/dist/shared-session.d.ts +13 -0
- package/dist/shared-session.js +338 -0
- package/dist/types.d.ts +328 -0
- package/dist/types.js +41 -0
- package/dist/watch-command.d.ts +839 -0
- package/dist/watch-command.js +104 -0
- package/dist/watch.d.ts +59 -0
- package/dist/watch.js +806 -0
- package/package.json +44 -3
- package/README.md +0 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type DiagnosticLocation, type EngineCallIoMetrics, type ExplainCleanupPath, type ExplainLocalGap, type ExplainProviderEvaluation, type Gap, type NativeAdapterObservation, type ObserveLimit, type ObserveLimitInput, type ObserveMode, type ObserveOptions, type ProjectSummary, type SourceTarget } from "tssae";
|
|
2
|
+
import { type CheckpointOutcome, type Diagnostic, type ExplainResult, type ObservationReport } from "./types.ts";
|
|
3
|
+
export { type EngineCallIoMetrics };
|
|
4
|
+
export type NormalizedObserveConfig = {
|
|
5
|
+
readonly mode: ObserveMode;
|
|
6
|
+
readonly limit?: ObserveLimit;
|
|
7
|
+
};
|
|
8
|
+
export type QueryTraceRecord = {
|
|
9
|
+
readonly ruleId: string;
|
|
10
|
+
readonly queryIndex: number;
|
|
11
|
+
readonly op: string;
|
|
12
|
+
readonly projectId: string;
|
|
13
|
+
readonly provider: string;
|
|
14
|
+
readonly providers?: readonly string[];
|
|
15
|
+
readonly cacheStatus: "computed" | "reused";
|
|
16
|
+
readonly candidateCount: number;
|
|
17
|
+
readonly matchedTarget: boolean;
|
|
18
|
+
readonly durationMs: number;
|
|
19
|
+
readonly summary: string;
|
|
20
|
+
readonly detail?: unknown;
|
|
21
|
+
};
|
|
22
|
+
export type CheckpointTraceRecord = {
|
|
23
|
+
readonly ruleId: string;
|
|
24
|
+
readonly projectId: string;
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly outcome: CheckpointOutcome;
|
|
27
|
+
readonly at?: DiagnosticLocation;
|
|
28
|
+
readonly detail?: unknown;
|
|
29
|
+
};
|
|
30
|
+
/** Parses `<file[:line[:column]]>` into a normalized `SourceTarget` relative to `cwd`. */
|
|
31
|
+
export declare function parseTargetSpec(input: string, cwd: string): SourceTarget;
|
|
32
|
+
/** Normalizes a string or `SourceTarget` relative to `cwd`. */
|
|
33
|
+
export declare function normalizeTargetSpec(target: string | SourceTarget, cwd: string): SourceTarget;
|
|
34
|
+
/** Parses `--observe-limit` strings (e.g. `20`, `4096b`, `4kb`, `10items`) or SDK limit objects. */
|
|
35
|
+
export declare function parseObserveLimit(input: string | ObserveLimitInput): ObserveLimit;
|
|
36
|
+
export declare function normalizeObserveConfig(observe: ObserveMode | ObserveOptions | undefined, observeLimit: ObserveLimitInput | undefined): NormalizedObserveConfig;
|
|
37
|
+
/** Collects observation metrics, bounded detail entries, and explain traces for a check run. */
|
|
38
|
+
export declare class ObservationCollector {
|
|
39
|
+
#private;
|
|
40
|
+
readonly mode: ObserveMode;
|
|
41
|
+
readonly limit: ObserveLimit | undefined;
|
|
42
|
+
readonly explainTarget: SourceTarget | undefined;
|
|
43
|
+
constructor(options: {
|
|
44
|
+
readonly mode: ObserveMode;
|
|
45
|
+
readonly limit?: ObserveLimit;
|
|
46
|
+
readonly explainTarget?: SourceTarget;
|
|
47
|
+
readonly configAndOpenMs?: number;
|
|
48
|
+
readonly nativeAdapters?: readonly NativeAdapterObservation[];
|
|
49
|
+
readonly configuredAdapters?: readonly {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly factTypeIds: readonly string[];
|
|
52
|
+
}[];
|
|
53
|
+
});
|
|
54
|
+
isObserveEnabled(): boolean;
|
|
55
|
+
isExplainEnabled(): boolean;
|
|
56
|
+
isActive(): boolean;
|
|
57
|
+
addConfigAndOpenMs(ms: number): void;
|
|
58
|
+
addEngineQueryMs(ms: number): void;
|
|
59
|
+
addRuleExecutionMs(ms: number): void;
|
|
60
|
+
recordRpcCall(io: EngineCallIoMetrics): void;
|
|
61
|
+
recordQuery(params: {
|
|
62
|
+
readonly ruleId: string;
|
|
63
|
+
readonly op: string;
|
|
64
|
+
readonly projectId: string;
|
|
65
|
+
readonly provider: string;
|
|
66
|
+
readonly providers?: readonly string[];
|
|
67
|
+
readonly cacheStatus: "computed" | "reused";
|
|
68
|
+
readonly candidateCount: number;
|
|
69
|
+
readonly durationMs: number;
|
|
70
|
+
readonly summary: string;
|
|
71
|
+
readonly matchedLocations?: readonly DiagnosticLocation[];
|
|
72
|
+
readonly detail?: unknown;
|
|
73
|
+
}): void;
|
|
74
|
+
recordCheckpoint(params: {
|
|
75
|
+
readonly ruleId: string;
|
|
76
|
+
readonly projectId: string;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly outcome: CheckpointOutcome;
|
|
79
|
+
readonly resolveLocation: () => DiagnosticLocation | undefined;
|
|
80
|
+
readonly detailFn?: () => unknown;
|
|
81
|
+
}): void;
|
|
82
|
+
hasMatchingCandidateOverlapping(ruleId: string, loc: DiagnosticLocation): boolean;
|
|
83
|
+
recordCleanupPaths(params: {
|
|
84
|
+
readonly ruleId: string;
|
|
85
|
+
readonly targetLocations: readonly DiagnosticLocation[];
|
|
86
|
+
readonly paths: readonly ExplainCleanupPath[];
|
|
87
|
+
}): void;
|
|
88
|
+
recordRuleGaps(ruleId: string, gaps: readonly Gap[]): void;
|
|
89
|
+
recordFactExplain(params: {
|
|
90
|
+
readonly ruleId: string;
|
|
91
|
+
readonly subjectLocation?: DiagnosticLocation;
|
|
92
|
+
readonly gaps: readonly Gap[];
|
|
93
|
+
readonly localGaps: readonly ExplainLocalGap[];
|
|
94
|
+
}): void;
|
|
95
|
+
recordProviderEvaluation(params: {
|
|
96
|
+
readonly ruleId: string;
|
|
97
|
+
readonly evaluation: ExplainProviderEvaluation;
|
|
98
|
+
}): void;
|
|
99
|
+
buildObservationReport(): ObservationReport | undefined;
|
|
100
|
+
buildExplainResult(params: {
|
|
101
|
+
readonly ruleId: string;
|
|
102
|
+
readonly projects: readonly ProjectSummary[];
|
|
103
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
104
|
+
readonly suppressions?: readonly {
|
|
105
|
+
readonly ruleId: string;
|
|
106
|
+
readonly at: DiagnosticLocation;
|
|
107
|
+
readonly directiveAt: DiagnosticLocation;
|
|
108
|
+
readonly reason: string;
|
|
109
|
+
}[];
|
|
110
|
+
}): ExplainResult;
|
|
111
|
+
}
|