@sentry/warden 0.36.1 → 0.38.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/dist/cli/args.d.ts +1 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +0 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +12 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/runs.d.ts.map +1 -1
- package/dist/cli/commands/runs.js +10 -10
- package/dist/cli/commands/runs.js.map +1 -1
- package/dist/cli/context.d.ts +3 -0
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +4 -1
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/files.d.ts +9 -3
- package/dist/cli/files.d.ts.map +1 -1
- package/dist/cli/files.js +28 -8
- package/dist/cli/files.js.map +1 -1
- package/dist/cli/main.d.ts +28 -2
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +149 -65
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output/formatters.d.ts +7 -4
- package/dist/cli/output/formatters.d.ts.map +1 -1
- package/dist/cli/output/formatters.js +51 -17
- package/dist/cli/output/formatters.js.map +1 -1
- package/dist/cli/output/index.d.ts +2 -2
- package/dist/cli/output/index.d.ts.map +1 -1
- package/dist/cli/output/index.js +2 -2
- package/dist/cli/output/index.js.map +1 -1
- package/dist/cli/output/jsonl-schema-gen.d.ts.map +1 -1
- package/dist/cli/output/jsonl-schema-gen.js +15 -4
- package/dist/cli/output/jsonl-schema-gen.js.map +1 -1
- package/dist/cli/output/jsonl.d.ts +176 -47
- package/dist/cli/output/jsonl.d.ts.map +1 -1
- package/dist/cli/output/jsonl.js +102 -49
- package/dist/cli/output/jsonl.js.map +1 -1
- package/dist/cli/output/tasks.d.ts.map +1 -1
- package/dist/cli/output/tasks.js +3 -6
- package/dist/cli/output/tasks.js.map +1 -1
- package/dist/cli/output/usage-breakdown.d.ts +92 -0
- package/dist/cli/output/usage-breakdown.d.ts.map +1 -0
- package/dist/cli/output/usage-breakdown.js +214 -0
- package/dist/cli/output/usage-breakdown.js.map +1 -0
- package/dist/cli/terminal.d.ts +0 -1
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +4 -30
- package/dist/cli/terminal.js.map +1 -1
- package/dist/config/loader.d.ts +9 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +48 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +35 -13
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +24 -4
- package/dist/config/schema.js.map +1 -1
- package/dist/config/writer.d.ts.map +1 -1
- package/dist/config/writer.js +0 -6
- package/dist/config/writer.js.map +1 -1
- package/dist/diff/classify.d.ts +1 -15
- package/dist/diff/classify.d.ts.map +1 -1
- package/dist/diff/classify.js +1 -55
- package/dist/diff/classify.js.map +1 -1
- package/dist/event/schedule-context.d.ts +5 -0
- package/dist/event/schedule-context.d.ts.map +1 -1
- package/dist/event/schedule-context.js +2 -2
- package/dist/event/schedule-context.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/output/github-checks.d.ts +19 -0
- package/dist/output/github-checks.d.ts.map +1 -1
- package/dist/output/github-checks.js +93 -19
- package/dist/output/github-checks.js.map +1 -1
- package/dist/output/github-issues.d.ts +1 -19
- package/dist/output/github-issues.d.ts.map +1 -1
- package/dist/output/github-issues.js +0 -142
- package/dist/output/github-issues.js.map +1 -1
- package/dist/output/issue-renderer.d.ts.map +1 -1
- package/dist/output/issue-renderer.js +0 -3
- package/dist/output/issue-renderer.js.map +1 -1
- package/dist/output/renderer.d.ts.map +1 -1
- package/dist/output/renderer.js +3 -16
- package/dist/output/renderer.js.map +1 -1
- package/dist/output/stale.d.ts +6 -1
- package/dist/output/stale.d.ts.map +1 -1
- package/dist/output/stale.js +11 -3
- package/dist/output/stale.js.map +1 -1
- package/dist/output/types.d.ts +0 -1
- package/dist/output/types.d.ts.map +1 -1
- package/dist/sdk/analyze.d.ts.map +1 -1
- package/dist/sdk/analyze.js +20 -5
- package/dist/sdk/analyze.js.map +1 -1
- package/dist/sdk/post-process.d.ts.map +1 -1
- package/dist/sdk/post-process.js +12 -25
- package/dist/sdk/post-process.js.map +1 -1
- package/dist/sdk/prepare.d.ts.map +1 -1
- package/dist/sdk/prepare.js +14 -5
- package/dist/sdk/prepare.js.map +1 -1
- package/dist/sdk/prompt.d.ts.map +1 -1
- package/dist/sdk/prompt.js +1 -8
- package/dist/sdk/prompt.js.map +1 -1
- package/dist/sdk/runtimes/claude.d.ts.map +1 -1
- package/dist/sdk/runtimes/claude.js +12 -4
- package/dist/sdk/runtimes/claude.js.map +1 -1
- package/dist/sdk/runtimes/pi.d.ts.map +1 -1
- package/dist/sdk/runtimes/pi.js +10 -6
- package/dist/sdk/runtimes/pi.js.map +1 -1
- package/dist/sdk/runtimes/types.d.ts +8 -2
- package/dist/sdk/runtimes/types.d.ts.map +1 -1
- package/dist/sdk/runtimes/types.js.map +1 -1
- package/dist/sdk/scan-policy.d.ts +32 -0
- package/dist/sdk/scan-policy.d.ts.map +1 -0
- package/dist/sdk/scan-policy.js +355 -0
- package/dist/sdk/scan-policy.js.map +1 -0
- package/dist/sdk/types.d.ts +16 -3
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/sdk/types.js.map +1 -1
- package/dist/sdk/usage.d.ts +9 -1
- package/dist/sdk/usage.d.ts.map +1 -1
- package/dist/sdk/usage.js +94 -0
- package/dist/sdk/usage.js.map +1 -1
- package/dist/sdk/verify.d.ts.map +1 -1
- package/dist/sdk/verify.js +0 -6
- package/dist/sdk/verify.js.map +1 -1
- package/dist/sentry-trace.d.ts +3 -3
- package/dist/sentry-trace.d.ts.map +1 -1
- package/dist/sentry-trace.js +5 -5
- package/dist/sentry-trace.js.map +1 -1
- package/dist/sentry.d.ts +2 -1
- package/dist/sentry.d.ts.map +1 -1
- package/dist/sentry.js +12 -9
- package/dist/sentry.js.map +1 -1
- package/dist/types/index.d.ts +38 -13
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +23 -8
- package/dist/types/index.js.map +1 -1
- package/package.json +3 -3
- package/src/builtin-skills/code-review/SKILL.md +0 -1
- package/src/builtin-skills/code-review/SOURCES.md +0 -1
- package/src/builtin-skills/security-review/SKILL.md +0 -1
- package/dist/cli/fix.d.ts +0 -39
- package/dist/cli/fix.d.ts.map +0 -1
- package/dist/cli/fix.js +0 -277
- package/dist/cli/fix.js.map +0 -1
- package/dist/sdk/fix-quality.d.ts +0 -26
- package/dist/sdk/fix-quality.d.ts.map +0 -1
- package/dist/sdk/fix-quality.js +0 -188
- package/dist/sdk/fix-quality.js.map +0 -1
package/dist/cli/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/cli/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/cli/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,k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OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC3D,OAAO,0BAA0B,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
|
package/dist/cli/main.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { SkillDefinition, WardenConfig, Effort } from '../config/schema.js';
|
|
2
2
|
import { type SkillRunnerOptions } from '../sdk/runner.js';
|
|
3
3
|
import { type InvalidPiModelSelector } from '../sdk/runtimes/model-selectors.js';
|
|
4
|
-
import type { SkillReport, SeverityThreshold, ConfidenceThreshold } from '../types/index.js';
|
|
4
|
+
import type { SkillReport, SeverityThreshold, ConfidenceThreshold, SkillError } from '../types/index.js';
|
|
5
5
|
import { type CLIOptions } from './args.js';
|
|
6
6
|
import { buildLocalEventContext } from './context.js';
|
|
7
|
-
import { Reporter, runSkillTasks, type SkillTaskOptions } from './output/index.js';
|
|
7
|
+
import { Reporter, runSkillTasks, type JsonlChunkRecord, type JsonlRunMetadata, type SkillTaskOptions } from './output/index.js';
|
|
8
8
|
/**
|
|
9
9
|
* Global abort controller for graceful shutdown on SIGINT.
|
|
10
10
|
* Used to cancel in-progress SDK queries.
|
|
@@ -19,6 +19,32 @@ export declare const interrupted: {
|
|
|
19
19
|
};
|
|
20
20
|
/** Resolve the directory Warden should treat as the invocation root. */
|
|
21
21
|
export declare function resolveInvocationCwd(baseCwd: string, cliCwd: string | undefined): string;
|
|
22
|
+
/**
|
|
23
|
+
* In-flight JSONL log state for a run. Chunk records are streamed while
|
|
24
|
+
* skills run, then rewritten from final reports after post-processing.
|
|
25
|
+
* A path is dropped from `paths` if its initial write failed.
|
|
26
|
+
*/
|
|
27
|
+
export interface RunLog {
|
|
28
|
+
paths: string[];
|
|
29
|
+
primaryLogPath: string;
|
|
30
|
+
primaryLogWritten: boolean;
|
|
31
|
+
outputPath: string | undefined;
|
|
32
|
+
startTime: number;
|
|
33
|
+
baseRun: Omit<JsonlRunMetadata, 'durationMs'>;
|
|
34
|
+
chunks: JsonlChunkRecord[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Append a report-level JSONL record when streaming has not already captured one.
|
|
38
|
+
*/
|
|
39
|
+
export declare function appendReportToRunLog(log: RunLog, report: SkillReport): void;
|
|
40
|
+
/**
|
|
41
|
+
* Build finalized chunk records from streamed chunks and final reports.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildFinalChunkRecords(log: RunLog, reports: SkillReport[], totalDurationMs: number, error?: SkillError): JsonlChunkRecord[];
|
|
44
|
+
/**
|
|
45
|
+
* Render the finalized JSONL content for a run log.
|
|
46
|
+
*/
|
|
47
|
+
export declare function renderFinalRunLogContent(log: RunLog, reports: SkillReport[], totalDurationMs: number, error?: SkillError): string;
|
|
22
48
|
export interface RunSkillSpec {
|
|
23
49
|
name: string;
|
|
24
50
|
displayName?: string;
|
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAA8C,KAAK,kBAAkB,EAA4B,MAAM,kBAAkB,CAAC;AACjI,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAK5C,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAA8C,KAAK,kBAAkB,EAA4B,MAAM,kBAAkB,CAAC;AACjI,OAAO,E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U,CAAC,UAAU,CAAC,EAChC,aAAa,CAAC,EAAE,mBAAmB,GAClC,gBAAgB,CA8BlB;AAiFD,4EAA4E;AAC5E,wBAAsB,SAAS,CAC7B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,EAC3D,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAyMjB;AAucD,oFAAoF;AACpF,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA4G1C"}
|
package/dist/cli/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { existsSync, readFileSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { join, relative, resolve } from 'node:path';
|
|
3
3
|
import { config as dotenvConfig } from 'dotenv';
|
|
4
|
-
import { Sentry, flushSentry, setRepositoryScope, emitRunMetric, getTraceId } from '../sentry.js';
|
|
4
|
+
import { Sentry, flushSentry, setRepositoryScope, emitRunMetric, getTraceId, initSentry } from '../sentry.js';
|
|
5
5
|
import { emptyToUndefined, loadWardenConfigFile, resolveSkillConfigs } from '../config/loader.js';
|
|
6
6
|
import { verifyAuth } from '../sdk/runner.js';
|
|
7
7
|
import { findInvalidPiModelSelector as findInvalidPiModelSelectorTarget, invalidPiModelSelectorMessage, } from '../sdk/runtimes/model-selectors.js';
|
|
8
8
|
import { mapExtractionErrorCode } from '../sdk/errors.js';
|
|
9
|
-
import { mergeAuxiliaryUsage } from '../sdk/usage.js';
|
|
9
|
+
import { aggregateAuxiliaryUsageAttribution, mergeAuxiliaryUsage } from '../sdk/usage.js';
|
|
10
10
|
import { resolveSkillAsync, SkillLoaderError } from '../skills/loader.js';
|
|
11
11
|
import { matchTrigger, filterContextByPaths, shouldFail, countFindingsAtOrAbove } from '../triggers/matcher.js';
|
|
12
12
|
import { filterFindings } from '../types/index.js';
|
|
@@ -17,9 +17,8 @@ import { showHelp } from './help.js';
|
|
|
17
17
|
import { buildLocalEventContext, buildFileEventContext } from './context.js';
|
|
18
18
|
import { getRepoRoot, getHeadSha, refExists, getDefaultBranch } from './git.js';
|
|
19
19
|
import { renderTerminalReport, filterReports } from './terminal.js';
|
|
20
|
-
import { Reporter, detectOutputMode, parseVerbosity,
|
|
20
|
+
import { Reporter, detectOutputMode, parseVerbosity, runSkillTasks, runSkillTasksWithInk, pluralize, MODEL_DEFAULT_SENTINEL, writeJsonlContent, renderJsonlString, renderJsonlChunkLine, renderJsonlChunkRecords, renderJsonlSummaryLine, buildJsonlUsageBreakdown, auxiliaryUsageFromBreakdown, usageStatsHaveValue, initJsonlFile, appendJsonlLine, getRepoLogPath, generateRunId, } from './output/index.js';
|
|
21
21
|
import { cleanupArtifacts } from './log-cleanup.js';
|
|
22
|
-
import { collectFixableFindings, applyAllFixes, runInteractiveFixFlow, renderFixSummary, } from './fix.js';
|
|
23
22
|
import { UserAbortError } from './input.js';
|
|
24
23
|
import { runInit } from './commands/init.js';
|
|
25
24
|
import { runAdd } from './commands/add.js';
|
|
@@ -179,6 +178,7 @@ function appendChunkToRunLog(log, skillName, chunk) {
|
|
|
179
178
|
if (log.paths.length === 0)
|
|
180
179
|
return;
|
|
181
180
|
const auxiliaryUsage = chunk.auxiliaryUsage?.reduce((acc, entry) => mergeAuxiliaryUsage(acc, { [entry.agent]: entry.usage }), undefined);
|
|
181
|
+
const auxiliaryUsageAttribution = aggregateAuxiliaryUsageAttribution(chunk.auxiliaryUsage ?? []);
|
|
182
182
|
const error = chunk.failed
|
|
183
183
|
? {
|
|
184
184
|
code: chunk.failureCode ?? 'unknown',
|
|
@@ -205,9 +205,11 @@ function appendChunkToRunLog(log, skillName, chunk) {
|
|
|
205
205
|
},
|
|
206
206
|
status: error ? 'error' : 'ok',
|
|
207
207
|
findings: chunk.findings,
|
|
208
|
-
|
|
208
|
+
usageBreakdown: buildJsonlUsageBreakdown(chunk.usage, auxiliaryUsage, {
|
|
209
|
+
scan: { model: chunk.model },
|
|
210
|
+
auxiliary: auxiliaryUsageAttribution,
|
|
211
|
+
}),
|
|
209
212
|
durationMs: chunk.durationMs,
|
|
210
|
-
auxiliaryUsage,
|
|
211
213
|
error,
|
|
212
214
|
trace: chunk.trace,
|
|
213
215
|
};
|
|
@@ -226,7 +228,7 @@ function appendChunkToRunLog(log, skillName, chunk) {
|
|
|
226
228
|
catch { /* best-effort */ }
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
|
-
function buildReportChunkRecord(log, report, runDurationMs, index = 1, total = 1, error) {
|
|
231
|
+
function buildReportChunkRecord(log, report, runDurationMs, index = 1, total = 1, error, includeReportResults = true) {
|
|
230
232
|
const reportError = report.error ?? error;
|
|
231
233
|
return {
|
|
232
234
|
schemaVersion: 1,
|
|
@@ -240,10 +242,14 @@ function buildReportChunkRecord(log, report, runDurationMs, index = 1, total = 1
|
|
|
240
242
|
lineRange: '',
|
|
241
243
|
},
|
|
242
244
|
status: reportError ? 'error' : report.skippedFiles?.length ? 'skipped' : 'ok',
|
|
243
|
-
findings: report.findings,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
findings: includeReportResults ? report.findings : [],
|
|
246
|
+
usageBreakdown: includeReportResults
|
|
247
|
+
? buildJsonlUsageBreakdown(report.usage, report.auxiliaryUsage, {
|
|
248
|
+
scan: { model: report.model, runtime: report.runtime },
|
|
249
|
+
auxiliary: report.auxiliaryUsageAttribution,
|
|
250
|
+
})
|
|
251
|
+
: undefined,
|
|
252
|
+
durationMs: includeReportResults ? (report.durationMs ?? runDurationMs) : 0,
|
|
247
253
|
error: reportError,
|
|
248
254
|
skippedFiles: report.skippedFiles,
|
|
249
255
|
};
|
|
@@ -278,15 +284,22 @@ function hasReportRecord(log, report) {
|
|
|
278
284
|
return true;
|
|
279
285
|
});
|
|
280
286
|
}
|
|
287
|
+
function hasSkillChunkRecord(chunks, skill) {
|
|
288
|
+
return chunks.some((chunk) => chunk.skill === skill);
|
|
289
|
+
}
|
|
281
290
|
function shouldStreamReportRecord(log, report) {
|
|
282
291
|
if (hasReportRecord(log, report))
|
|
283
292
|
return false;
|
|
284
|
-
return Boolean(report.error || report.skippedFiles?.length || !log.chunks
|
|
293
|
+
return Boolean(report.error || report.skippedFiles?.length || !hasSkillChunkRecord(log.chunks, report.skill));
|
|
285
294
|
}
|
|
286
|
-
|
|
295
|
+
/**
|
|
296
|
+
* Append a report-level JSONL record when streaming has not already captured one.
|
|
297
|
+
*/
|
|
298
|
+
export function appendReportToRunLog(log, report) {
|
|
287
299
|
if (!shouldStreamReportRecord(log, report))
|
|
288
300
|
return;
|
|
289
|
-
const
|
|
301
|
+
const hasExistingSkillChunks = hasSkillChunkRecord(log.chunks, report.skill);
|
|
302
|
+
const record = buildReportChunkRecord(log, report, Date.now() - log.startTime, undefined, undefined, undefined, !hasExistingSkillChunks);
|
|
290
303
|
let line;
|
|
291
304
|
try {
|
|
292
305
|
line = renderJsonlChunkLine(record);
|
|
@@ -302,6 +315,43 @@ function appendReportToRunLog(log, report) {
|
|
|
302
315
|
catch { /* best-effort */ }
|
|
303
316
|
}
|
|
304
317
|
}
|
|
318
|
+
function subtractUsage(total, alreadyRecorded) {
|
|
319
|
+
if (!total)
|
|
320
|
+
return undefined;
|
|
321
|
+
const result = {
|
|
322
|
+
inputTokens: Math.max(0, total.inputTokens - (alreadyRecorded?.inputTokens ?? 0)),
|
|
323
|
+
outputTokens: Math.max(0, total.outputTokens - (alreadyRecorded?.outputTokens ?? 0)),
|
|
324
|
+
costUSD: Math.max(0, total.costUSD - (alreadyRecorded?.costUSD ?? 0)),
|
|
325
|
+
};
|
|
326
|
+
if (total.cacheReadInputTokens !== undefined || alreadyRecorded?.cacheReadInputTokens !== undefined) {
|
|
327
|
+
result.cacheReadInputTokens = Math.max(0, (total.cacheReadInputTokens ?? 0) - (alreadyRecorded?.cacheReadInputTokens ?? 0));
|
|
328
|
+
}
|
|
329
|
+
if (total.cacheCreationInputTokens !== undefined || alreadyRecorded?.cacheCreationInputTokens !== undefined) {
|
|
330
|
+
result.cacheCreationInputTokens = Math.max(0, (total.cacheCreationInputTokens ?? 0) - (alreadyRecorded?.cacheCreationInputTokens ?? 0));
|
|
331
|
+
}
|
|
332
|
+
if (total.cacheCreation5mInputTokens !== undefined || alreadyRecorded?.cacheCreation5mInputTokens !== undefined) {
|
|
333
|
+
result.cacheCreation5mInputTokens = Math.max(0, (total.cacheCreation5mInputTokens ?? 0) - (alreadyRecorded?.cacheCreation5mInputTokens ?? 0));
|
|
334
|
+
}
|
|
335
|
+
if (total.cacheCreation1hInputTokens !== undefined || alreadyRecorded?.cacheCreation1hInputTokens !== undefined) {
|
|
336
|
+
result.cacheCreation1hInputTokens = Math.max(0, (total.cacheCreation1hInputTokens ?? 0) - (alreadyRecorded?.cacheCreation1hInputTokens ?? 0));
|
|
337
|
+
}
|
|
338
|
+
if (total.webSearchRequests !== undefined || alreadyRecorded?.webSearchRequests !== undefined) {
|
|
339
|
+
result.webSearchRequests = Math.max(0, (total.webSearchRequests ?? 0) - (alreadyRecorded?.webSearchRequests ?? 0));
|
|
340
|
+
}
|
|
341
|
+
return usageStatsHaveValue(result) ? result : undefined;
|
|
342
|
+
}
|
|
343
|
+
function subtractAuxiliaryUsage(total, alreadyRecorded) {
|
|
344
|
+
if (!total)
|
|
345
|
+
return undefined;
|
|
346
|
+
const missing = {};
|
|
347
|
+
for (const [agent, usage] of Object.entries(total)) {
|
|
348
|
+
const remainder = subtractUsage(usage, alreadyRecorded?.[agent]);
|
|
349
|
+
if (remainder) {
|
|
350
|
+
missing[agent] = remainder;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return Object.keys(missing).length > 0 ? missing : undefined;
|
|
354
|
+
}
|
|
305
355
|
function lineRangeIncludes(lineRange, line) {
|
|
306
356
|
if (!lineRange)
|
|
307
357
|
return false;
|
|
@@ -317,7 +367,30 @@ function findChunkForFinding(chunks, skill, finding) {
|
|
|
317
367
|
return sameSkill[0];
|
|
318
368
|
return sameSkill.find((chunk) => chunk.chunk.file === location.path && lineRangeIncludes(chunk.chunk.lineRange, location.startLine)) ?? sameSkill.find((chunk) => chunk.chunk.file === location.path) ?? sameSkill[0];
|
|
319
369
|
}
|
|
320
|
-
function
|
|
370
|
+
function buildUsageOnlyChunkRecord(log, report, runDurationMs, auxiliaryUsage) {
|
|
371
|
+
return {
|
|
372
|
+
schemaVersion: 1,
|
|
373
|
+
run: { ...log.baseRun, durationMs: runDurationMs },
|
|
374
|
+
skill: report.skill,
|
|
375
|
+
model: report.model,
|
|
376
|
+
chunk: {
|
|
377
|
+
file: '',
|
|
378
|
+
index: 1,
|
|
379
|
+
total: 1,
|
|
380
|
+
lineRange: 'post-processing',
|
|
381
|
+
},
|
|
382
|
+
status: 'ok',
|
|
383
|
+
findings: [],
|
|
384
|
+
durationMs: 0,
|
|
385
|
+
usageBreakdown: buildJsonlUsageBreakdown(undefined, auxiliaryUsage, {
|
|
386
|
+
auxiliary: report.auxiliaryUsageAttribution,
|
|
387
|
+
}),
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Build finalized chunk records from streamed chunks and final reports.
|
|
392
|
+
*/
|
|
393
|
+
export function buildFinalChunkRecords(log, reports, totalDurationMs, error) {
|
|
321
394
|
const finalRun = { ...log.baseRun, durationMs: totalDurationMs };
|
|
322
395
|
if (log.chunks.length === 0) {
|
|
323
396
|
if (reports.length === 0 && error) {
|
|
@@ -340,16 +413,39 @@ function buildFinalChunkRecords(log, reports, totalDurationMs, error) {
|
|
|
340
413
|
...chunk,
|
|
341
414
|
run: { ...finalRun },
|
|
342
415
|
findings: findingsByChunk.get(chunk) ?? [],
|
|
416
|
+
usageBreakdown: chunk.usageBreakdown,
|
|
343
417
|
}));
|
|
344
418
|
const finalLog = { ...log, chunks: chunkRecords };
|
|
345
419
|
const missingReports = reports.filter((report) => shouldStreamReportRecord(finalLog, report));
|
|
420
|
+
const postProcessingUsageRecords = reports.flatMap((report) => {
|
|
421
|
+
const skillChunkRecords = chunkRecords.filter((chunk) => chunk.skill === report.skill);
|
|
422
|
+
if (skillChunkRecords.length === 0)
|
|
423
|
+
return [];
|
|
424
|
+
const recordedAuxiliaryUsage = skillChunkRecords.reduce((acc, chunk) => mergeAuxiliaryUsage(acc, auxiliaryUsageFromBreakdown(chunk.usageBreakdown)), undefined);
|
|
425
|
+
const missingAuxiliaryUsage = subtractAuxiliaryUsage(report.auxiliaryUsage, recordedAuxiliaryUsage);
|
|
426
|
+
return missingAuxiliaryUsage
|
|
427
|
+
? [buildUsageOnlyChunkRecord(log, report, totalDurationMs, missingAuxiliaryUsage)]
|
|
428
|
+
: [];
|
|
429
|
+
});
|
|
346
430
|
return [
|
|
347
431
|
...chunkRecords,
|
|
348
|
-
...
|
|
432
|
+
...postProcessingUsageRecords,
|
|
433
|
+
...missingReports.map((report) => {
|
|
434
|
+
const hasExistingSkillChunks = hasSkillChunkRecord(chunkRecords, report.skill);
|
|
435
|
+
return buildReportChunkRecord(log, report, totalDurationMs, undefined, undefined, error, !hasExistingSkillChunks);
|
|
436
|
+
}),
|
|
349
437
|
];
|
|
350
438
|
}
|
|
351
439
|
/**
|
|
352
|
-
*
|
|
440
|
+
* Render the finalized JSONL content for a run log.
|
|
441
|
+
*/
|
|
442
|
+
export function renderFinalRunLogContent(log, reports, totalDurationMs, error) {
|
|
443
|
+
const records = buildFinalChunkRecords(log, reports, totalDurationMs, error);
|
|
444
|
+
const run = { ...log.baseRun, durationMs: totalDurationMs };
|
|
445
|
+
return renderJsonlChunkRecords(records) + renderJsonlSummaryLine(reports, run, error);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Rewrite the run log with final records. Returns the set of paths that
|
|
353
449
|
* accepted the write, so the caller can decide whether to claim
|
|
354
450
|
* "wrote JSONL output to X" (only true when the final log actually landed).
|
|
355
451
|
*/
|
|
@@ -359,8 +455,7 @@ function finalizeRunLog(log, reports, totalDurationMs, error) {
|
|
|
359
455
|
return wrote;
|
|
360
456
|
let content;
|
|
361
457
|
try {
|
|
362
|
-
|
|
363
|
-
content = renderJsonlChunkRecords(records);
|
|
458
|
+
content = renderFinalRunLogContent(log, reports, totalDurationMs, error);
|
|
364
459
|
}
|
|
365
460
|
catch {
|
|
366
461
|
return wrote;
|
|
@@ -449,6 +544,24 @@ export function mergeSkillRunnerOptions(base, overrides) {
|
|
|
449
544
|
function needsClaudeAuth(items) {
|
|
450
545
|
return items.some((item) => (item.runtime ?? 'pi') === 'claude');
|
|
451
546
|
}
|
|
547
|
+
function findRepoPath(cwd) {
|
|
548
|
+
try {
|
|
549
|
+
return getRepoRoot(cwd);
|
|
550
|
+
}
|
|
551
|
+
catch {
|
|
552
|
+
return undefined;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
function loadOptionalConfig(options, repoPath) {
|
|
556
|
+
const configPath = options.configPath
|
|
557
|
+
? resolveConfigInput(options.configPath)
|
|
558
|
+
: repoPath
|
|
559
|
+
? resolve(repoPath, 'warden.toml')
|
|
560
|
+
: null;
|
|
561
|
+
return configPath && existsSync(configPath)
|
|
562
|
+
? loadWardenConfigFile(configPath)
|
|
563
|
+
: null;
|
|
564
|
+
}
|
|
452
565
|
/**
|
|
453
566
|
* Find the first Pi runner option using a model ID that is not provider/model.
|
|
454
567
|
*/
|
|
@@ -615,7 +728,7 @@ async function outputResultsAndHandleFixes(processed, options, reporter, runLog,
|
|
|
615
728
|
const { reports, filteredReports, hasFailure, failureReasons } = processed;
|
|
616
729
|
const traceId = runLog.baseRun.traceId;
|
|
617
730
|
const finalizedPaths = finalizeRunLog(runLog, reports, totalDuration);
|
|
618
|
-
// Only claim --output succeeded if
|
|
731
|
+
// Only claim --output succeeded if finalization actually landed there.
|
|
619
732
|
if (runLog.outputPath) {
|
|
620
733
|
if (finalizedPaths.has(runLog.outputPath)) {
|
|
621
734
|
reporter.success(`Wrote JSONL output to ${runLog.outputPath}`);
|
|
@@ -624,22 +737,12 @@ async function outputResultsAndHandleFixes(processed, options, reporter, runLog,
|
|
|
624
737
|
reporter.warning(`Failed to write output file: ${runLog.outputPath}`);
|
|
625
738
|
}
|
|
626
739
|
}
|
|
627
|
-
// Collect fixable findings early so we know whether to suppress diffs in the report
|
|
628
|
-
const fixableFindings = collectFixableFindings(filteredReports);
|
|
629
|
-
const willStepThrough = fixableFindings.length > 0
|
|
630
|
-
&& !interrupted.value
|
|
631
|
-
&& !failFastAborted
|
|
632
|
-
&& !options.json
|
|
633
|
-
&& !options.fix
|
|
634
|
-
&& reporter.verbosity !== Verbosity.Quiet
|
|
635
|
-
&& reporter.mode.isTTY
|
|
636
|
-
&& process.stdin.isTTY;
|
|
637
740
|
reporter.blank();
|
|
638
741
|
if (options.json) {
|
|
639
742
|
// Prefer reading the on-disk log (per-skill durationMs is a snapshot).
|
|
640
|
-
// Only read it back if
|
|
743
|
+
// Only read it back if finalization actually landed there;
|
|
641
744
|
// a half-written file should fall through to the in-memory render.
|
|
642
|
-
// The fallback renders the same
|
|
745
|
+
// The fallback renders the same finalized JSONL shape in memory.
|
|
643
746
|
let jsonlContent;
|
|
644
747
|
if (finalizedPaths.has(runLog.primaryLogPath)) {
|
|
645
748
|
try {
|
|
@@ -649,7 +752,7 @@ async function outputResultsAndHandleFixes(processed, options, reporter, runLog,
|
|
|
649
752
|
}
|
|
650
753
|
if (!jsonlContent) {
|
|
651
754
|
try {
|
|
652
|
-
jsonlContent =
|
|
755
|
+
jsonlContent = renderFinalRunLogContent(runLog, reports, totalDuration);
|
|
653
756
|
}
|
|
654
757
|
catch (err) {
|
|
655
758
|
reporter.error(`Failed to render JSONL output: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -659,7 +762,7 @@ async function outputResultsAndHandleFixes(processed, options, reporter, runLog,
|
|
|
659
762
|
process.stdout.write(jsonlContent);
|
|
660
763
|
}
|
|
661
764
|
else {
|
|
662
|
-
console.log(renderTerminalReport(filteredReports, reporter.mode, {
|
|
765
|
+
console.log(renderTerminalReport(filteredReports, reporter.mode, { verbosity: reporter.verbosity }));
|
|
663
766
|
}
|
|
664
767
|
// Show interrupted / fail-fast banner before summary
|
|
665
768
|
if (failFastAborted) {
|
|
@@ -677,17 +780,6 @@ async function outputResultsAndHandleFixes(processed, options, reporter, runLog,
|
|
|
677
780
|
if (!options.json && runLog.primaryLogWritten) {
|
|
678
781
|
reporter.dim(`Log: ${runLog.primaryLogPath}`);
|
|
679
782
|
}
|
|
680
|
-
// Handle fixes: --fix (automatic) always runs, interactive step-through in TTY mode
|
|
681
|
-
if (fixableFindings.length > 0) {
|
|
682
|
-
if (options.fix) {
|
|
683
|
-
const fixSummary = applyAllFixes(fixableFindings);
|
|
684
|
-
renderFixSummary(fixSummary, reporter);
|
|
685
|
-
}
|
|
686
|
-
else if (willStepThrough && !interrupted.value) {
|
|
687
|
-
const fixSummary = await runInteractiveFixFlow(fixableFindings, reporter);
|
|
688
|
-
renderFixSummary(fixSummary, reporter);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
783
|
// Interrupted takes precedence for exit code
|
|
692
784
|
if (interrupted.value) {
|
|
693
785
|
return 130;
|
|
@@ -706,26 +798,8 @@ export async function runSkills(context, options, reporter) {
|
|
|
706
798
|
const startTime = Date.now();
|
|
707
799
|
// Claude runtime can fall back to local Claude Code auth.
|
|
708
800
|
const apiKey = getAnthropicApiKey();
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
try {
|
|
712
|
-
repoPath = getRepoRoot(cwd);
|
|
713
|
-
}
|
|
714
|
-
catch {
|
|
715
|
-
// Not in a git repo - that's fine for file mode
|
|
716
|
-
}
|
|
717
|
-
// Resolve config path
|
|
718
|
-
let configPath = null;
|
|
719
|
-
if (options.configPath) {
|
|
720
|
-
configPath = resolveConfigInput(options.configPath);
|
|
721
|
-
}
|
|
722
|
-
else if (repoPath) {
|
|
723
|
-
configPath = resolve(repoPath, 'warden.toml');
|
|
724
|
-
}
|
|
725
|
-
// Load config if available
|
|
726
|
-
const config = configPath && existsSync(configPath)
|
|
727
|
-
? loadWardenConfigFile(configPath)
|
|
728
|
-
: null;
|
|
801
|
+
const repoPath = findRepoPath(cwd);
|
|
802
|
+
const config = loadOptionalConfig(options, repoPath);
|
|
729
803
|
const defaultModel = resolveCliDefaultModel(config, options.model);
|
|
730
804
|
const defaultAuxiliaryModel = resolveCliDefaultAuxiliaryModel(config);
|
|
731
805
|
const defaultSynthesisModel = resolveCliDefaultSynthesisModel(config);
|
|
@@ -829,6 +903,9 @@ export async function runSkills(context, options, reporter) {
|
|
|
829
903
|
effort: defaultEffort,
|
|
830
904
|
batchDelayMs: config?.defaults?.batchDelayMs,
|
|
831
905
|
maxContextFiles: config?.defaults?.chunking?.maxContextFiles,
|
|
906
|
+
ignore: config?.defaults?.ignore,
|
|
907
|
+
scan: config?.defaults?.scan,
|
|
908
|
+
chunking: config?.defaults?.chunking,
|
|
832
909
|
auxiliaryMaxRetries: config?.defaults?.auxiliary?.maxRetries ??
|
|
833
910
|
config?.defaults?.auxiliaryMaxRetries,
|
|
834
911
|
verifyFindings: config?.defaults?.verification?.enabled !== false,
|
|
@@ -913,11 +990,14 @@ export async function runSkills(context, options, reporter) {
|
|
|
913
990
|
}
|
|
914
991
|
async function runFileMode(filePatterns, options, reporter) {
|
|
915
992
|
const cwd = process.cwd();
|
|
993
|
+
const config = loadOptionalConfig(options, findRepoPath(cwd));
|
|
916
994
|
// Build context from files
|
|
917
995
|
reporter.step('Building context from files...');
|
|
918
996
|
const context = await buildFileEventContext({
|
|
919
997
|
patterns: filePatterns,
|
|
920
998
|
cwd,
|
|
999
|
+
ignore: config?.defaults?.ignore,
|
|
1000
|
+
scan: config?.defaults?.scan,
|
|
921
1001
|
});
|
|
922
1002
|
const pullRequest = context.pullRequest;
|
|
923
1003
|
if (!pullRequest) {
|
|
@@ -1127,6 +1207,9 @@ async function runConfigMode(options, reporter) {
|
|
|
1127
1207
|
abortController,
|
|
1128
1208
|
maxTurns: trigger.maxTurns,
|
|
1129
1209
|
maxContextFiles: config.defaults?.chunking?.maxContextFiles,
|
|
1210
|
+
ignore: trigger.ignore,
|
|
1211
|
+
scan: trigger.scan,
|
|
1212
|
+
chunking: trigger.chunking,
|
|
1130
1213
|
auxiliaryMaxRetries: trigger.auxiliaryMaxRetries,
|
|
1131
1214
|
verifyFindings: trigger.verifyFindings,
|
|
1132
1215
|
captureTraces: options.traces,
|
|
@@ -1336,6 +1419,7 @@ export async function main() {
|
|
|
1336
1419
|
// Not in a git repo - use cwd
|
|
1337
1420
|
}
|
|
1338
1421
|
loadEnvFiles(envDir);
|
|
1422
|
+
initSentry('cli');
|
|
1339
1423
|
// Show header (unless JSON output or quiet)
|
|
1340
1424
|
if (!options.json) {
|
|
1341
1425
|
reporter.header();
|