argus-reviewer-e2e 0.1.2 → 0.2.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/README.md +30 -5
- package/action/action.yml +22 -0
- package/action/sticky-comment.mjs +287 -79
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/cli.d.ts +67 -0
- package/dist/cli.js +463 -86
- package/dist/config.d.ts +105 -2
- package/dist/config.js +136 -9
- package/dist/debug.d.ts +1 -0
- package/dist/debug.js +9 -3
- package/dist/detect.d.ts +11 -1
- package/dist/detect.js +19 -3
- package/dist/evidence/ci.d.ts +47 -2
- package/dist/evidence/ci.js +98 -6
- package/dist/evidence/gate.d.ts +10 -0
- package/dist/evidence/gate.js +29 -0
- package/dist/evidence/link.d.ts +6 -1
- package/dist/evidence/link.js +7 -5
- package/dist/executor/sandbox.d.ts +105 -0
- package/dist/executor/sandbox.js +231 -0
- package/dist/probe/author.d.ts +50 -0
- package/dist/probe/author.js +149 -0
- package/dist/probe/harness.d.ts +30 -0
- package/dist/probe/harness.js +99 -0
- package/dist/probe/queue.d.ts +105 -0
- package/dist/probe/queue.js +446 -0
- package/dist/review/adjudicate.d.ts +63 -0
- package/dist/review/adjudicate.js +111 -0
- package/dist/review/secrets.d.ts +88 -0
- package/dist/review/secrets.js +220 -0
- package/dist/review/triage.d.ts +76 -0
- package/dist/review/triage.js +163 -0
- package/dist/trust.d.ts +50 -0
- package/dist/trust.js +103 -0
- package/dist/vision/cost.d.ts +14 -1
- package/dist/vision/cost.js +13 -0
- package/dist/vision/decisions.d.ts +95 -0
- package/dist/vision/decisions.js +232 -0
- package/package.json +3 -2
package/dist/cli.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ import { Config } from './config.js';
|
|
|
3
3
|
import { type ExecFn } from './detect.js';
|
|
4
4
|
import { BrowserDriver } from './driver/browser.js';
|
|
5
5
|
import { VisionClient } from './engine/loop.js';
|
|
6
|
+
import { type PrMeta } from './evidence/ci.js';
|
|
7
|
+
import { type Evidence } from './evidence/link.js';
|
|
8
|
+
import { type SecretsScanResult } from './review/secrets.js';
|
|
9
|
+
import { type TriageRecord } from './review/triage.js';
|
|
10
|
+
import { type FindingAdjudicationAudit } from './review/adjudicate.js';
|
|
11
|
+
import { type ProbeRecord } from './probe/queue.js';
|
|
12
|
+
import { CallCost } from './vision/cost.js';
|
|
6
13
|
export interface CliDeps {
|
|
7
14
|
cwd?: string;
|
|
8
15
|
env?: NodeJS.ProcessEnv;
|
|
@@ -21,5 +28,65 @@ interface PrFile {
|
|
|
21
28
|
previous_filename?: string;
|
|
22
29
|
patch?: string;
|
|
23
30
|
}
|
|
31
|
+
interface CodeReviewReport {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
skipped: boolean;
|
|
34
|
+
summary: string;
|
|
35
|
+
verdict: 'pass' | 'needs_changes' | 'approve';
|
|
36
|
+
findings: {
|
|
37
|
+
file: string;
|
|
38
|
+
line?: number;
|
|
39
|
+
severity: string;
|
|
40
|
+
category?: string;
|
|
41
|
+
message: string;
|
|
42
|
+
/** U8 — Jev true-positive probability (absent = unadjudicated). */
|
|
43
|
+
p?: number;
|
|
44
|
+
evidence?: Evidence;
|
|
45
|
+
}[];
|
|
46
|
+
/** Inline-comment cap consumed by the sticky poster (Tencent max_comments pull). */
|
|
47
|
+
maxComments?: number;
|
|
48
|
+
/** B.2 probe audit records — present only when the sandbox lane ran. */
|
|
49
|
+
probes?: ProbeRecord[];
|
|
50
|
+
/** Why an enabled lane bowed out (fork gate, no docker, no harness…). */
|
|
51
|
+
probeLaneSkipped?: string;
|
|
52
|
+
/** Secrets-lane audit — masked candidates, adjudication verdicts, skip reason. */
|
|
53
|
+
secretsScan?: SecretsScanResult | {
|
|
54
|
+
skipped: string;
|
|
55
|
+
};
|
|
56
|
+
/** U7 triage record — Jev pre-review signals (annotate/route, never gates). */
|
|
57
|
+
triage?: TriageRecord;
|
|
58
|
+
/** U8 adjudication audit — per-finding p + suppressed records. */
|
|
59
|
+
findingAdjudication?: FindingAdjudicationAudit;
|
|
60
|
+
calls: CallCost[];
|
|
61
|
+
visionCostUsd: number;
|
|
62
|
+
tokens: number;
|
|
63
|
+
model: string;
|
|
64
|
+
budgetExceeded: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Split `git diff` text into per-file PrFile entries — the local-diff
|
|
68
|
+
* equivalent of the PR-files API response (which also reports `patch`
|
|
69
|
+
* per file). `+++ b/` names new/copied files; `--- a/` covers deletions.
|
|
70
|
+
*/
|
|
71
|
+
export declare function filesFromUnifiedDiff(diff: string): PrFile[];
|
|
72
|
+
/**
|
|
73
|
+
* `--fixture <dir>` seam: the dir is a real git repo with an
|
|
74
|
+
* `argus-fixture-base` ref (the merge base) and HEAD at the PR head —
|
|
75
|
+
* scripts/demo.mjs materializes it. Returns the same diff/files/meta
|
|
76
|
+
* the GitHub paths would produce, so every downstream lane (chunking,
|
|
77
|
+
* secrets scan, evidence linkage) runs its real code path.
|
|
78
|
+
*/
|
|
79
|
+
export declare function loadFixture(dir: string, exec?: ExecFn): Promise<{
|
|
80
|
+
files: PrFile[];
|
|
81
|
+
meta: PrMeta;
|
|
82
|
+
diff: string;
|
|
83
|
+
} | {
|
|
84
|
+
skipped: string;
|
|
85
|
+
}>;
|
|
24
86
|
export declare function buildPatchChunks(files: PrFile[], contexts?: Record<string, string>): string[];
|
|
87
|
+
export declare function parseCodeReview(content: string): {
|
|
88
|
+
summary: string;
|
|
89
|
+
verdict: 'pass' | 'needs_changes' | 'approve';
|
|
90
|
+
findings: CodeReviewReport['findings'];
|
|
91
|
+
};
|
|
25
92
|
export {};
|