veriskit 0.5.1 → 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/CHANGELOG.md +6 -0
- package/README.md +21 -0
- package/bin/veris +1 -1
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +2982 -0
- package/dist/index.d.ts +190 -0
- package/dist/index.js +1100 -2620
- package/package.json +14 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
|
|
2
|
+
type CapabilityId = "types" | "lint" | "unit" | "browser";
|
|
3
|
+
type CheckStatus = "passed" | "failed" | "skipped" | "unknown";
|
|
4
|
+
type VerdictState = "verified" | "failed" | "partial";
|
|
5
|
+
interface Capability {
|
|
6
|
+
id: CapabilityId;
|
|
7
|
+
available: boolean;
|
|
8
|
+
runner?: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
}
|
|
11
|
+
interface Project {
|
|
12
|
+
root: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
packageManager: PackageManager;
|
|
15
|
+
frameworks: string[];
|
|
16
|
+
languages: string[];
|
|
17
|
+
scripts: Record<string, string>;
|
|
18
|
+
capabilities: Capability[];
|
|
19
|
+
}
|
|
20
|
+
interface CheckResult {
|
|
21
|
+
checkId: CapabilityId;
|
|
22
|
+
status: CheckStatus;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
summary: string;
|
|
25
|
+
logRef?: string;
|
|
26
|
+
outputTail?: string;
|
|
27
|
+
counts?: {
|
|
28
|
+
passed?: number;
|
|
29
|
+
failed?: number;
|
|
30
|
+
total?: number;
|
|
31
|
+
};
|
|
32
|
+
cached?: boolean;
|
|
33
|
+
}
|
|
34
|
+
interface Verdict {
|
|
35
|
+
state: VerdictState;
|
|
36
|
+
verifiedCapabilities: CapabilityId[];
|
|
37
|
+
skipped: CapabilityId[];
|
|
38
|
+
reasons: string[];
|
|
39
|
+
}
|
|
40
|
+
interface EnvironmentInfo {
|
|
41
|
+
os: string;
|
|
42
|
+
node: string;
|
|
43
|
+
pm: string;
|
|
44
|
+
ci: boolean;
|
|
45
|
+
timestamp: string;
|
|
46
|
+
}
|
|
47
|
+
interface VerificationRun {
|
|
48
|
+
id: string;
|
|
49
|
+
startedAt: string;
|
|
50
|
+
project: Project;
|
|
51
|
+
results: CheckResult[];
|
|
52
|
+
verdict: Verdict;
|
|
53
|
+
reportRef?: string;
|
|
54
|
+
env: EnvironmentInfo;
|
|
55
|
+
scope?: {
|
|
56
|
+
kind: "affected" | "watch";
|
|
57
|
+
changedCount: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare function detectProject(root: string): Promise<Project>;
|
|
62
|
+
|
|
63
|
+
interface GitAnchor {
|
|
64
|
+
commit: string;
|
|
65
|
+
branch: string;
|
|
66
|
+
dirty: boolean;
|
|
67
|
+
changedFiles: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface EvidenceCheck {
|
|
71
|
+
id: CapabilityId;
|
|
72
|
+
status: CheckStatus;
|
|
73
|
+
runner?: string;
|
|
74
|
+
durationMs: number;
|
|
75
|
+
summary: string;
|
|
76
|
+
counts?: {
|
|
77
|
+
passed?: number;
|
|
78
|
+
failed?: number;
|
|
79
|
+
total?: number;
|
|
80
|
+
};
|
|
81
|
+
logDigest?: string;
|
|
82
|
+
}
|
|
83
|
+
interface EvidenceRecord {
|
|
84
|
+
schema: string;
|
|
85
|
+
id: string;
|
|
86
|
+
startedAt: string;
|
|
87
|
+
tool: {
|
|
88
|
+
name: string;
|
|
89
|
+
version: string;
|
|
90
|
+
};
|
|
91
|
+
git: GitAnchor | null;
|
|
92
|
+
env: {
|
|
93
|
+
os: string;
|
|
94
|
+
node: string;
|
|
95
|
+
pm: string;
|
|
96
|
+
ci: boolean;
|
|
97
|
+
timestamp: string;
|
|
98
|
+
};
|
|
99
|
+
project: {
|
|
100
|
+
name: string;
|
|
101
|
+
packageManager: string;
|
|
102
|
+
frameworks: string[];
|
|
103
|
+
languages: string[];
|
|
104
|
+
};
|
|
105
|
+
scope: {
|
|
106
|
+
kind: "full" | "affected" | "watch";
|
|
107
|
+
changedCount: number;
|
|
108
|
+
};
|
|
109
|
+
checks: EvidenceCheck[];
|
|
110
|
+
verdict: {
|
|
111
|
+
state: VerdictState;
|
|
112
|
+
verifiedCapabilities: CapabilityId[];
|
|
113
|
+
skipped: CapabilityId[];
|
|
114
|
+
reasons: string[];
|
|
115
|
+
};
|
|
116
|
+
digest: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare function verifyProject(root: string, opts?: {
|
|
120
|
+
partialOk?: boolean;
|
|
121
|
+
browser?: boolean;
|
|
122
|
+
}): Promise<{
|
|
123
|
+
run: VerificationRun;
|
|
124
|
+
record: EvidenceRecord;
|
|
125
|
+
}>;
|
|
126
|
+
interface AffectedOutcome {
|
|
127
|
+
run?: VerificationRun;
|
|
128
|
+
record?: EvidenceRecord;
|
|
129
|
+
note: string;
|
|
130
|
+
changedCount: number;
|
|
131
|
+
nothingAffected: boolean;
|
|
132
|
+
}
|
|
133
|
+
declare function affectedProject(root: string, opts?: {
|
|
134
|
+
base?: string;
|
|
135
|
+
}): Promise<AffectedOutcome>;
|
|
136
|
+
|
|
137
|
+
interface EvidenceCheckResult {
|
|
138
|
+
name: string;
|
|
139
|
+
ok: boolean;
|
|
140
|
+
detail: string;
|
|
141
|
+
}
|
|
142
|
+
interface VerifyResult {
|
|
143
|
+
ok: boolean;
|
|
144
|
+
kind: "record" | "bundle";
|
|
145
|
+
record: EvidenceRecord;
|
|
146
|
+
checks: EvidenceCheckResult[];
|
|
147
|
+
signed: boolean;
|
|
148
|
+
}
|
|
149
|
+
interface VerifyOptions {
|
|
150
|
+
sigPath?: string;
|
|
151
|
+
expectedKeyId?: string;
|
|
152
|
+
expectedPubKeyPem?: string;
|
|
153
|
+
}
|
|
154
|
+
declare function verifyEvidenceFile(path: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
155
|
+
|
|
156
|
+
interface FlakyCheck {
|
|
157
|
+
id: CapabilityId;
|
|
158
|
+
statuses: CheckStatus[];
|
|
159
|
+
}
|
|
160
|
+
declare function detectFlaky(records: EvidenceRecord[]): FlakyCheck[];
|
|
161
|
+
|
|
162
|
+
declare function loadRuns(root: string, limit?: number): EvidenceRecord[];
|
|
163
|
+
|
|
164
|
+
type NodeKind = "source" | "test" | "config" | "other";
|
|
165
|
+
interface ModuleNode {
|
|
166
|
+
file: string;
|
|
167
|
+
kind: NodeKind;
|
|
168
|
+
imports: string[];
|
|
169
|
+
importedBy: string[];
|
|
170
|
+
}
|
|
171
|
+
interface ProjectGraph {
|
|
172
|
+
root: string;
|
|
173
|
+
resolver: "typescript" | "scanner";
|
|
174
|
+
nodes: Record<string, ModuleNode>;
|
|
175
|
+
sourceFiles: string[];
|
|
176
|
+
testFiles: string[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface Analysis {
|
|
180
|
+
untested: string[];
|
|
181
|
+
blastRadius: Record<string, number>;
|
|
182
|
+
risky: string[];
|
|
183
|
+
}
|
|
184
|
+
declare function analyze(graph: ProjectGraph, changed?: string[]): Analysis;
|
|
185
|
+
|
|
186
|
+
declare function buildGraph(project: Project): Promise<ProjectGraph>;
|
|
187
|
+
|
|
188
|
+
declare function getEnvironmentInfo(pm: string): EnvironmentInfo;
|
|
189
|
+
|
|
190
|
+
export { type AffectedOutcome, type Analysis, type CapabilityId, type EvidenceRecord, type FlakyCheck, type Project, type ProjectGraph, type Verdict, type VerificationRun, type VerifyResult, affectedProject, analyze, buildGraph, detectFlaky, detectProject, getEnvironmentInfo, loadRuns, verifyEvidenceFile, verifyProject };
|