@sentry/warden 0.20.0 → 0.21.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/dist/cli/args.d.ts +7 -5
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +31 -17
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/commands/runs.d.ts +26 -0
  7. package/dist/cli/commands/runs.d.ts.map +1 -0
  8. package/dist/cli/commands/runs.js +668 -0
  9. package/dist/cli/commands/runs.js.map +1 -0
  10. package/dist/cli/main.d.ts +15 -0
  11. package/dist/cli/main.d.ts.map +1 -1
  12. package/dist/cli/main.js +236 -128
  13. package/dist/cli/main.js.map +1 -1
  14. package/dist/cli/output/index.d.ts +1 -1
  15. package/dist/cli/output/index.d.ts.map +1 -1
  16. package/dist/cli/output/index.js +1 -1
  17. package/dist/cli/output/index.js.map +1 -1
  18. package/dist/cli/output/ink-runner.d.ts.map +1 -1
  19. package/dist/cli/output/ink-runner.js +32 -14
  20. package/dist/cli/output/ink-runner.js.map +1 -1
  21. package/dist/cli/output/jsonl-schema-gen.d.ts +16 -0
  22. package/dist/cli/output/jsonl-schema-gen.d.ts.map +1 -0
  23. package/dist/cli/output/jsonl-schema-gen.js +63 -0
  24. package/dist/cli/output/jsonl-schema-gen.js.map +1 -0
  25. package/dist/cli/output/jsonl.d.ts +168 -34
  26. package/dist/cli/output/jsonl.d.ts.map +1 -1
  27. package/dist/cli/output/jsonl.js +212 -144
  28. package/dist/cli/output/jsonl.js.map +1 -1
  29. package/dist/cli/output/tasks.d.ts +2 -0
  30. package/dist/cli/output/tasks.d.ts.map +1 -1
  31. package/dist/cli/output/tasks.js +167 -27
  32. package/dist/cli/output/tasks.js.map +1 -1
  33. package/dist/cli/terminal.d.ts.map +1 -1
  34. package/dist/cli/terminal.js +20 -0
  35. package/dist/cli/terminal.js.map +1 -1
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +2 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/sdk/analyze.d.ts.map +1 -1
  41. package/dist/sdk/analyze.js +83 -10
  42. package/dist/sdk/analyze.js.map +1 -1
  43. package/dist/sdk/errors.d.ts +11 -0
  44. package/dist/sdk/errors.d.ts.map +1 -1
  45. package/dist/sdk/errors.js +50 -0
  46. package/dist/sdk/errors.js.map +1 -1
  47. package/dist/sdk/types.d.ts +9 -1
  48. package/dist/sdk/types.d.ts.map +1 -1
  49. package/dist/types/index.d.ts +129 -6
  50. package/dist/types/index.d.ts.map +1 -1
  51. package/dist/types/index.js +59 -3
  52. package/dist/types/index.js.map +1 -1
  53. package/package.json +2 -1
  54. package/dist/cli/commands/logs.d.ts +0 -19
  55. package/dist/cli/commands/logs.d.ts.map +0 -1
  56. package/dist/cli/commands/logs.js +0 -412
  57. package/dist/cli/commands/logs.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../src/cli/commands/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC7H,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACL,SAAS,EACT,cAAc,EACd,UAAU,EACV,UAAU,EACV,iBAA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AC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE1C,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE;YAC9B,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC;oBAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBAAC,CAAC;gBAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;YACjD,CAAC;YACD,aAAa,CAAC,SAAS,CAAC,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAChC,cAAc,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC;QAEF,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACjC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,WAAwB,EACxB,OAAmB,EACnB,QAAkB;IAElB,QAAQ,WAAW,CAAC,UAAU,EAAE,CAAC;QAC/B,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;QAClE,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrD,KAAK,IAAI;YACP,OAAO,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACtC,KAAK,QAAQ;YACX,OAAO,aAAa,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -1,3 +1,6 @@
1
+ import type { SkillReport, ConfidenceThreshold } from '../types/index.js';
2
+ import { type CLIOptions } from './args.js';
3
+ import { runSkillTasks } from './output/index.js';
1
4
  /**
2
5
  * Global abort controller for graceful shutdown on SIGINT.
3
6
  * Used to cancel in-progress SDK queries.
@@ -10,5 +13,17 @@ export declare const abortController: AbortController;
10
13
  export declare const interrupted: {
11
14
  value: boolean;
12
15
  };
16
+ interface ProcessedResults {
17
+ reports: SkillReport[];
18
+ filteredReports: SkillReport[];
19
+ hasFailure: boolean;
20
+ failureReasons: string[];
21
+ }
22
+ /**
23
+ * Process skill task results into reports and check for failures.
24
+ * Exported for testing; callers inside main.ts use it directly.
25
+ */
26
+ export declare function processTaskResults(results: Awaited<ReturnType<typeof runSkillTasks>>, reportOn: CLIOptions['reportOn'], minConfidence?: ConfidenceThreshold): ProcessedResults;
13
27
  export declare function main(): Promise<void>;
28
+ export {};
14
29
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AA4CA;;;GAGG;AACH,eAAO,MAAM,eAAe,iBAAwB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,WAAW;;CAAmB,CAAC;AAmxB5C,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA4F1C"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAc,MAAM,mBAAmB,CAAC;AAGtF,OAAO,EAAwD,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAIlG,OAAO,EAKL,aAAa,EAcd,MAAM,mBAAmB,CAAC;AAe3B;;;GAGG;AACH,eAAO,MAAM,eAAe,iBAAwB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,WAAW;;CAAmB,CAAC;AAsM5C,UAAU,gBAAgB;IACxB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,EAClD,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAChC,aAAa,CAAC,EAAE,mBAAmB,GAClC,gBAAgB,CA8BlB;AA6qBD,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA4F1C"}
package/dist/cli/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { existsSync } from 'node:fs';
1
+ import { existsSync, readFileSync } from 'node:fs';
2
2
  import { dirname, join, resolve } from 'node:path';
3
3
  import { config as dotenvConfig } from 'dotenv';
4
4
  import { Sentry, flushSentry, setGlobalAttributes, emitRunMetric, getTraceId } from '../sentry.js';
@@ -12,7 +12,7 @@ import { parseCliArgs, showHelp, showVersion, classifyTargets } from './args.js'
12
12
  import { buildLocalEventContext, buildFileEventContext } from './context.js';
13
13
  import { getRepoRoot, getHeadSha, refExists, hasUncommittedChanges } from './git.js';
14
14
  import { renderTerminalReport, filterReports } from './terminal.js';
15
- import { Reporter, detectOutputMode, parseVerbosity, Verbosity, runSkillTasks, runSkillTasksWithInk, pluralize, MODEL_DEFAULT_SENTINEL, writeJsonlContent, renderJsonlString, getRepoLogPath, generateRunId, } from './output/index.js';
15
+ import { Reporter, detectOutputMode, parseVerbosity, Verbosity, runSkillTasks, runSkillTasksWithInk, pluralize, MODEL_DEFAULT_SENTINEL, writeJsonlContent, renderJsonlString, renderJsonlSkillLine, renderJsonlSummaryLine, initJsonlFile, appendJsonlLine, getRepoLogPath, generateRunId, } from './output/index.js';
16
16
  import { cleanupArtifacts } from './log-cleanup.js';
17
17
  import { collectFixableFindings, applyAllFixes, runInteractiveFixFlow, renderFixSummary, } from './fix.js';
18
18
  import { UserAbortError } from './input.js';
@@ -20,7 +20,7 @@ import { runInit } from './commands/init.js';
20
20
  import { runAdd } from './commands/add.js';
21
21
  import { runSetupApp } from './commands/setup-app.js';
22
22
  import { runSync } from './commands/sync.js';
23
- import { runLogs } from './commands/logs.js';
23
+ import { runRuns } from './commands/runs.js';
24
24
  /**
25
25
  * Global abort controller for graceful shutdown on SIGINT.
26
26
  * Used to cancel in-progress SDK queries.
@@ -69,15 +69,18 @@ function resolveConfigPath(options, repoPath) {
69
69
  return options.config ? resolve(cwd, options.config) : resolve(repoPath, 'warden.toml');
70
70
  }
71
71
  /**
72
- * Write a minimal JSONL log (summary-only, 0 findings) for early-exit paths.
73
- * Returns the rendered content and the log file path. The content is always
74
- * available even if the file write fails, so callers can use it for --json
75
- * output without reading back from disk.
72
+ * Emit a minimal JSONL log (summary-only, 0 findings) for early-exit paths.
73
+ *
74
+ * Behavior:
75
+ * - `--json`: writes to stdout (the API contract for piping consumers).
76
+ * - `--output <path>`: writes to that explicit path (CI artifacts).
77
+ * - Default `.warden/logs/`: written only when `error` is set. Real
78
+ * failures (auth, config load, etc.) belong in the on-disk audit trail;
79
+ * pure no-ops (no files, no skills) would just clutter it.
76
80
  */
77
- function writeEmptyRunLog(repoPath, opts) {
81
+ function emitEmptyRunLog(repoPath, options, error) {
78
82
  const runId = generateRunId();
79
83
  const timestamp = new Date();
80
- const logPath = getRepoLogPath(repoPath, runId, timestamp);
81
84
  let headSha;
82
85
  try {
83
86
  headSha = getHeadSha(repoPath);
@@ -85,43 +88,129 @@ function writeEmptyRunLog(repoPath, opts) {
85
88
  catch {
86
89
  // Not in a git repo or HEAD is unborn
87
90
  }
88
- const content = renderJsonlString([], 0, { runId, traceId: opts?.traceId, timestamp, headSha });
91
+ const content = renderJsonlString([], 0, {
92
+ runId,
93
+ traceId: getTraceId(),
94
+ timestamp,
95
+ headSha,
96
+ error,
97
+ });
98
+ if (error) {
99
+ const logPath = getRepoLogPath(repoPath, runId, timestamp);
100
+ try {
101
+ writeJsonlContent(logPath, content);
102
+ }
103
+ catch (err) {
104
+ console.warn(`Warning: Failed to write run log: ${err instanceof Error ? err.message : String(err)}`);
105
+ }
106
+ }
107
+ if (options.output) {
108
+ try {
109
+ writeJsonlContent(options.output, content);
110
+ }
111
+ catch (err) {
112
+ console.warn(`Warning: Failed to write output file: ${err instanceof Error ? err.message : String(err)}`);
113
+ }
114
+ }
115
+ if (options.json) {
116
+ process.stdout.write(content);
117
+ }
118
+ }
119
+ function initializeRunLog(args) {
120
+ const { repoPath, runId, timestamp, traceId, headSha, model, outputPath, reporter, startTime } = args;
121
+ const baseRun = {
122
+ timestamp: timestamp.toISOString(),
123
+ cwd: process.cwd(),
124
+ runId,
125
+ traceId,
126
+ model,
127
+ headSha,
128
+ };
129
+ const primaryLogPath = getRepoLogPath(repoPath, runId, timestamp);
130
+ let primaryLogWritten = false;
89
131
  try {
90
- writeJsonlContent(logPath, content);
132
+ initJsonlFile(primaryLogPath);
133
+ primaryLogWritten = true;
91
134
  }
92
135
  catch (err) {
93
- console.warn(`Warning: Failed to write run log: ${err instanceof Error ? err.message : String(err)}`);
136
+ reporter.warning(`Failed to write run log: ${err instanceof Error ? err.message : String(err)}`);
94
137
  }
95
- if (opts?.outputPath) {
138
+ let resolvedOutputPath;
139
+ if (outputPath) {
96
140
  try {
97
- writeJsonlContent(opts.outputPath, content);
141
+ initJsonlFile(outputPath);
142
+ resolvedOutputPath = outputPath;
98
143
  }
99
144
  catch (err) {
100
- console.warn(`Warning: Failed to write output file: ${err instanceof Error ? err.message : String(err)}`);
145
+ reporter.warning(`Failed to write output file: ${err instanceof Error ? err.message : String(err)}`);
146
+ }
147
+ }
148
+ const paths = [];
149
+ if (primaryLogWritten)
150
+ paths.push(primaryLogPath);
151
+ if (resolvedOutputPath)
152
+ paths.push(resolvedOutputPath);
153
+ return { paths, primaryLogPath, primaryLogWritten, outputPath: resolvedOutputPath, startTime, baseRun };
154
+ }
155
+ function appendSkillToRunLog(log, report) {
156
+ if (log.paths.length === 0)
157
+ return;
158
+ const run = { ...log.baseRun, durationMs: Date.now() - log.startTime };
159
+ const line = renderJsonlSkillLine(report, run);
160
+ for (const p of log.paths) {
161
+ try {
162
+ appendJsonlLine(p, line);
101
163
  }
164
+ catch { /* best-effort */ }
102
165
  }
103
- return { logPath, content };
166
+ }
167
+ /**
168
+ * Append the run-final summary record. Returns the set of paths that
169
+ * accepted the write, so the caller can decide whether to claim
170
+ * "wrote JSONL output to X" (only true when the summary actually landed).
171
+ */
172
+ function finalizeRunLog(log, reports, totalDurationMs, error) {
173
+ const wrote = new Set();
174
+ if (log.paths.length === 0)
175
+ return wrote;
176
+ const run = { ...log.baseRun, durationMs: totalDurationMs };
177
+ const line = renderJsonlSummaryLine(reports, run, error);
178
+ for (const p of log.paths) {
179
+ try {
180
+ appendJsonlLine(p, line);
181
+ wrote.add(p);
182
+ }
183
+ catch { /* best-effort */ }
184
+ }
185
+ return wrote;
104
186
  }
105
187
  /**
106
188
  * Process skill task results into reports and check for failures.
189
+ * Exported for testing; callers inside main.ts use it directly.
107
190
  */
108
- function processTaskResults(results, reportOn, minConfidence) {
191
+ export function processTaskResults(results, reportOn, minConfidence) {
109
192
  const reports = [];
110
193
  let hasFailure = false;
111
194
  const failureReasons = [];
112
195
  for (const result of results) {
113
- if (result.report) {
114
- reports.push(result.report);
115
- // Apply confidence filtering before failOn evaluation so low-confidence findings
116
- // don't cause exit code 1. Per-result minConfidence (from trigger config) takes
117
- // precedence over the global default.
118
- const effectiveConfidence = result.minConfidence ?? minConfidence;
119
- const reportForFail = { ...result.report, findings: filterFindings(result.report.findings, undefined, effectiveConfidence) };
120
- if (result.failOn && shouldFail(reportForFail, result.failOn)) {
121
- hasFailure = true;
122
- const count = countFindingsAtOrAbove(reportForFail, result.failOn);
123
- failureReasons.push(`${result.name}: ${count} ${result.failOn}+ severity ${pluralize(count, 'issue')}`);
124
- }
196
+ if (!result.report)
197
+ continue;
198
+ reports.push(result.report);
199
+ // Skill-level errors always fail the run, independent of failOn thresholds.
200
+ if (result.report.error) {
201
+ hasFailure = true;
202
+ failureReasons.push(`${result.name}: ${result.report.error.code}: ${result.report.error.message}`);
203
+ continue;
204
+ }
205
+ // Apply confidence filtering before failOn evaluation so low-confidence findings
206
+ // don't cause exit code 1. Per-result minConfidence (from trigger config) takes
207
+ // precedence over the global default.
208
+ const effectiveConfidence = result.minConfidence ?? minConfidence;
209
+ const reportForFail = { ...result.report, findings: filterFindings(result.report.findings, undefined, effectiveConfidence) };
210
+ if (result.failOn && shouldFail(reportForFail, result.failOn)) {
211
+ hasFailure = true;
212
+ const count = countFindingsAtOrAbove(reportForFail, result.failOn);
213
+ failureReasons.push(`${result.name}: ${count} ${result.failOn}+ severity ${pluralize(count, 'issue')}`);
125
214
  }
126
215
  }
127
216
  const filteredReports = filterReports(reports, reportOn, minConfidence);
@@ -130,39 +219,17 @@ function processTaskResults(results, reportOn, minConfidence) {
130
219
  /**
131
220
  * Output results and handle fixes. Returns exit code.
132
221
  */
133
- async function outputResultsAndHandleFixes(processed, options, reporter, repoPath, totalDuration, failFastAborted, resolvedModel) {
222
+ async function outputResultsAndHandleFixes(processed, options, reporter, runLog, totalDuration, failFastAborted) {
134
223
  const { reports, filteredReports, hasFailure, failureReasons } = processed;
135
- const traceId = getTraceId();
136
- const runId = generateRunId();
137
- const timestamp = new Date();
138
- // Capture HEAD SHA safely (non-fatal if not in a git repo)
139
- let headSha;
140
- try {
141
- headSha = getHeadSha(repoPath);
142
- }
143
- catch {
144
- // Not in a git repo or HEAD is unborn
145
- }
146
- // Render JSONL content once so repo log and --output have identical timestamps
147
- const jsonlContent = renderJsonlString(reports, totalDuration, { runId, traceId, timestamp, model: resolvedModel, headSha });
148
- // Always write repo-local JSONL log (non-fatal — don't lose analysis output)
149
- const logPath = getRepoLogPath(repoPath, runId, timestamp);
150
- let logWritten = false;
151
- try {
152
- writeJsonlContent(logPath, jsonlContent);
153
- logWritten = true;
154
- }
155
- catch (err) {
156
- reporter.warning(`Failed to write run log: ${err instanceof Error ? err.message : String(err)}`);
157
- }
158
- // Write additional copy to --output path if specified
159
- if (options.output) {
160
- try {
161
- writeJsonlContent(options.output, jsonlContent);
162
- reporter.success(`Wrote JSONL output to ${options.output}`);
224
+ const traceId = runLog.baseRun.traceId;
225
+ const finalizedPaths = finalizeRunLog(runLog, reports, totalDuration);
226
+ // Only claim --output succeeded if the summary actually landed there.
227
+ if (runLog.outputPath) {
228
+ if (finalizedPaths.has(runLog.outputPath)) {
229
+ reporter.success(`Wrote JSONL output to ${runLog.outputPath}`);
163
230
  }
164
- catch (err) {
165
- reporter.warning(`Failed to write output file: ${err instanceof Error ? err.message : String(err)}`);
231
+ else {
232
+ reporter.warning(`Failed to write output file: ${runLog.outputPath}`);
166
233
  }
167
234
  }
168
235
  // Collect fixable findings early so we know whether to suppress diffs in the report
@@ -175,14 +242,33 @@ async function outputResultsAndHandleFixes(processed, options, reporter, repoPat
175
242
  && reporter.verbosity !== Verbosity.Quiet
176
243
  && reporter.mode.isTTY
177
244
  && process.stdin.isTTY;
178
- // Output results
179
245
  reporter.blank();
180
246
  if (options.json) {
181
- // --json: output pre-rendered JSONL (identical to log file contents)
247
+ // Prefer reading the on-disk log (per-skill durationMs is a snapshot).
248
+ // Only read it back if finalize actually landed the summary there;
249
+ // a half-written file should fall through to the in-memory render.
250
+ // The fallback uses the run total for every record — structurally
251
+ // valid but not byte-identical to the file.
252
+ let jsonlContent;
253
+ if (finalizedPaths.has(runLog.primaryLogPath)) {
254
+ try {
255
+ jsonlContent = readFileSync(runLog.primaryLogPath, 'utf-8');
256
+ }
257
+ catch { /* fall through */ }
258
+ }
259
+ if (!jsonlContent) {
260
+ jsonlContent = renderJsonlString(reports, totalDuration, {
261
+ runId: runLog.baseRun.runId,
262
+ traceId,
263
+ timestamp: new Date(runLog.baseRun.timestamp),
264
+ model: runLog.baseRun.model,
265
+ headSha: runLog.baseRun.headSha,
266
+ cwd: runLog.baseRun.cwd,
267
+ });
268
+ }
182
269
  process.stdout.write(jsonlContent);
183
270
  }
184
271
  else {
185
- // Suppress fix diffs in report when interactive step-through will show them
186
272
  console.log(renderTerminalReport(filteredReports, reporter.mode, { suppressFixDiffs: willStepThrough, verbosity: reporter.verbosity }));
187
273
  }
188
274
  // Show interrupted / fail-fast banner before summary
@@ -198,8 +284,8 @@ async function outputResultsAndHandleFixes(processed, options, reporter, repoPat
198
284
  reporter.blank();
199
285
  reporter.renderSummary(filteredReports, totalDuration, { traceId });
200
286
  // Show log file path after summary (only if write succeeded)
201
- if (!options.json && logWritten) {
202
- reporter.dim(`Log: ${logPath}`);
287
+ if (!options.json && runLog.primaryLogWritten) {
288
+ reporter.dim(`Log: ${runLog.primaryLogPath}`);
203
289
  }
204
290
  // Handle fixes: --fix (automatic) always runs, interactive step-through in TTY mode
205
291
  if (fixableFindings.length > 0) {
@@ -250,15 +336,13 @@ async function runSkills(context, options, reporter) {
250
336
  verifyAuth({ apiKey });
251
337
  }
252
338
  catch (error) {
253
- reporter.error(error.message);
254
- const effectiveRepo = repoPath ?? cwd;
255
- if (options.json) {
256
- const { content } = writeEmptyRunLog(effectiveRepo, { traceId: getTraceId(), outputPath: options.output });
257
- process.stdout.write(content);
258
- }
259
- else {
260
- writeEmptyRunLog(effectiveRepo, { traceId: getTraceId(), outputPath: options.output });
261
- }
339
+ const message = error.message;
340
+ reporter.error(message);
341
+ emitEmptyRunLog(repoPath ?? cwd, options, {
342
+ code: 'auth_failed',
343
+ message,
344
+ timestamp: new Date().toISOString(),
345
+ });
262
346
  return 1;
263
347
  }
264
348
  // Resolve config path
@@ -310,13 +394,8 @@ async function runSkills(context, options, reporter) {
310
394
  emitRunMetric();
311
395
  // Handle case where no skills to run
312
396
  if (skillsToRun.length === 0) {
313
- const effectiveRepo = repoPath ?? cwd;
314
- if (options.json) {
315
- const { content } = writeEmptyRunLog(effectiveRepo, { traceId: getTraceId(), outputPath: options.output });
316
- process.stdout.write(content);
317
- }
318
- else {
319
- writeEmptyRunLog(effectiveRepo, { traceId: getTraceId(), outputPath: options.output });
397
+ emitEmptyRunLog(repoPath ?? cwd, options);
398
+ if (!options.json) {
320
399
  reporter.warning('No triggers matched for the changed files');
321
400
  reporter.tip('Specify a skill explicitly: warden <target> --skill <name>');
322
401
  }
@@ -347,6 +426,29 @@ async function runSkills(context, options, reporter) {
347
426
  context: filterContextByPaths(context, filters),
348
427
  runnerOptions,
349
428
  }));
429
+ // Open the run's JSONL log before launching skills so `warden runs
430
+ // follow <runId>` works from a second terminal while the run is live.
431
+ const runId = generateRunId();
432
+ const timestamp = new Date();
433
+ const traceId = getTraceId();
434
+ let headSha;
435
+ try {
436
+ headSha = getHeadSha(repoPath ?? cwd);
437
+ }
438
+ catch {
439
+ // Not a git repo or HEAD is unborn — non-fatal
440
+ }
441
+ const runLog = initializeRunLog({
442
+ repoPath: repoPath ?? cwd,
443
+ runId,
444
+ timestamp,
445
+ traceId,
446
+ headSha,
447
+ model: logModel,
448
+ outputPath: options.output,
449
+ reporter,
450
+ startTime,
451
+ });
350
452
  // Run skills with Ink UI (TTY) or simple console output (non-TTY)
351
453
  const concurrency = options.parallel ?? DEFAULT_CONCURRENCY;
352
454
  failFastController = options.failFast ? new AbortController() : undefined;
@@ -355,6 +457,7 @@ async function runSkills(context, options, reporter) {
355
457
  verbosity: reporter.verbosity,
356
458
  concurrency,
357
459
  failFastController,
460
+ onSkillComplete: (report) => appendSkillToRunLog(runLog, report),
358
461
  };
359
462
  const results = reporter.mode.isTTY
360
463
  ? await runSkillTasksWithInk(tasks, taskOptions)
@@ -363,7 +466,7 @@ async function runSkills(context, options, reporter) {
363
466
  const totalDuration = Date.now() - startTime;
364
467
  const effectiveMinConfidence = options.minConfidence ?? config?.defaults?.minConfidence ?? 'medium';
365
468
  const processed = processTaskResults(results, options.reportOn, effectiveMinConfidence);
366
- return outputResultsAndHandleFixes(processed, options, reporter, repoPath ?? cwd, totalDuration, failFastController?.signal.aborted, logModel);
469
+ return outputResultsAndHandleFixes(processed, options, reporter, runLog, totalDuration, failFastController?.signal.aborted);
367
470
  }
368
471
  /**
369
472
  * Run in file mode: analyze specific files.
@@ -382,12 +485,8 @@ async function runFileMode(filePatterns, options, reporter) {
382
485
  return 1;
383
486
  }
384
487
  if (pullRequest.files.length === 0) {
385
- if (options.json) {
386
- const { content } = writeEmptyRunLog(cwd, { traceId: getTraceId(), outputPath: options.output });
387
- process.stdout.write(content);
388
- }
389
- else {
390
- writeEmptyRunLog(cwd, { traceId: getTraceId(), outputPath: options.output });
488
+ emitEmptyRunLog(cwd, options);
489
+ if (!options.json) {
391
490
  reporter.blank();
392
491
  reporter.warning('No files matched the given patterns');
393
492
  }
@@ -456,12 +555,8 @@ async function runGitRefMode(gitRef, options, reporter) {
456
555
  return 1;
457
556
  }
458
557
  if (pullRequest.files.length === 0) {
459
- if (options.json) {
460
- const { content } = writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
461
- process.stdout.write(content);
462
- }
463
- else {
464
- writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
558
+ emitEmptyRunLog(repoPath, options);
559
+ if (!options.json) {
465
560
  reporter.renderEmptyState('No changes found');
466
561
  reporter.blank();
467
562
  }
@@ -509,12 +604,8 @@ async function runConfigMode(options, reporter) {
509
604
  return 1;
510
605
  }
511
606
  if (pullRequest.files.length === 0) {
512
- if (options.json) {
513
- const { content } = writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
514
- process.stdout.write(content);
515
- }
516
- else {
517
- writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
607
+ emitEmptyRunLog(repoPath, options);
608
+ if (!options.json) {
518
609
  if (options.staged) {
519
610
  reporter.renderEmptyState('No staged changes found');
520
611
  }
@@ -549,12 +640,8 @@ async function runConfigMode(options, reporter) {
549
640
  }
550
641
  const triggersToRun = [...seen.values()];
551
642
  if (triggersToRun.length === 0) {
552
- if (options.json) {
553
- const { content } = writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
554
- process.stdout.write(content);
555
- }
556
- else {
557
- writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
643
+ emitEmptyRunLog(repoPath, options);
644
+ if (!options.json) {
558
645
  reporter.blank();
559
646
  if (options.skill) {
560
647
  reporter.warning(`No triggers matched for skill: ${options.skill}`);
@@ -577,14 +664,13 @@ async function runConfigMode(options, reporter) {
577
664
  verifyAuth({ apiKey });
578
665
  }
579
666
  catch (error) {
580
- reporter.error(error.message);
581
- if (options.json) {
582
- const { content } = writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
583
- process.stdout.write(content);
584
- }
585
- else {
586
- writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
587
- }
667
+ const message = error.message;
668
+ reporter.error(message);
669
+ emitEmptyRunLog(repoPath, options, {
670
+ code: 'auth_failed',
671
+ message,
672
+ timestamp: new Date().toISOString(),
673
+ });
588
674
  return 1;
589
675
  }
590
676
  // Build trigger tasks
@@ -608,6 +694,33 @@ async function runConfigMode(options, reporter) {
608
694
  auxiliaryMaxRetries: config.defaults?.auxiliaryMaxRetries,
609
695
  },
610
696
  }));
697
+ // Initialize the run's JSONL log up front so a second terminal can
698
+ // `warden runs follow <runId>` while skills are still running.
699
+ // Skill records are appended on each completion; the trailing summary
700
+ // is appended in `outputResultsAndHandleFixes`.
701
+ // Run-level model is the default (ignoring per-trigger overrides); per-skill models are on each report.
702
+ const defaultModel = config.defaults?.model ?? options.model ?? process.env['WARDEN_MODEL'] ?? MODEL_DEFAULT_SENTINEL;
703
+ const runId = generateRunId();
704
+ const timestamp = new Date();
705
+ const traceId = getTraceId();
706
+ let headSha;
707
+ try {
708
+ headSha = getHeadSha(repoPath);
709
+ }
710
+ catch {
711
+ // Not a git repo or HEAD is unborn — non-fatal
712
+ }
713
+ const runLog = initializeRunLog({
714
+ repoPath,
715
+ runId,
716
+ timestamp,
717
+ traceId,
718
+ headSha,
719
+ model: defaultModel,
720
+ outputPath: options.output,
721
+ reporter,
722
+ startTime,
723
+ });
611
724
  // Run triggers with Ink UI (TTY) or simple console output (non-TTY)
612
725
  const concurrency = options.parallel ?? config.runner?.concurrency ?? DEFAULT_CONCURRENCY;
613
726
  failFastController = options.failFast ? new AbortController() : undefined;
@@ -616,6 +729,7 @@ async function runConfigMode(options, reporter) {
616
729
  verbosity: reporter.verbosity,
617
730
  concurrency,
618
731
  failFastController,
732
+ onSkillComplete: (report) => appendSkillToRunLog(runLog, report),
619
733
  };
620
734
  const results = reporter.mode.isTTY
621
735
  ? await runSkillTasksWithInk(tasks, taskOptions)
@@ -623,9 +737,7 @@ async function runConfigMode(options, reporter) {
623
737
  // Process results and output
624
738
  const totalDuration = Date.now() - startTime;
625
739
  const processed = processTaskResults(results, options.reportOn, effectiveMinConfidence);
626
- // Run-level model is the default (ignoring per-trigger overrides); per-skill models are on each report.
627
- const defaultModel = config.defaults?.model ?? options.model ?? process.env['WARDEN_MODEL'] ?? MODEL_DEFAULT_SENTINEL;
628
- return outputResultsAndHandleFixes(processed, options, reporter, repoPath, totalDuration, failFastController?.signal.aborted, defaultModel);
740
+ return outputResultsAndHandleFixes(processed, options, reporter, runLog, totalDuration, failFastController?.signal.aborted);
629
741
  }
630
742
  /**
631
743
  * Run in direct skill mode: run a specific skill on uncommitted changes.
@@ -660,12 +772,8 @@ async function runDirectSkillMode(options, reporter) {
660
772
  return 1;
661
773
  }
662
774
  if (pullRequest.files.length === 0) {
663
- if (options.json) {
664
- const { content } = writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
665
- process.stdout.write(content);
666
- }
667
- else {
668
- writeEmptyRunLog(repoPath, { traceId: getTraceId(), outputPath: options.output });
775
+ emitEmptyRunLog(repoPath, options);
776
+ if (!options.json) {
669
777
  if (options.staged) {
670
778
  reporter.renderEmptyState('No staged changes found');
671
779
  }
@@ -717,7 +825,7 @@ async function runCommand(options, reporter) {
717
825
  return runFileMode(filePatterns, options, reporter);
718
826
  }
719
827
  export async function main() {
720
- const { command, options, setupAppOptions, logsOptions } = parseCliArgs();
828
+ const { command, options, setupAppOptions, runsOptions } = parseCliArgs();
721
829
  if (command === 'help') {
722
830
  showHelp();
723
831
  process.exit(0);
@@ -762,12 +870,12 @@ export async function main() {
762
870
  return runSetupApp(setupAppOptions, reporter);
763
871
  case 'sync':
764
872
  return runSync(options, reporter);
765
- case 'logs':
766
- if (!logsOptions) {
767
- reporter.error('Missing logs options');
873
+ case 'runs':
874
+ if (!runsOptions) {
875
+ reporter.error('Missing runs options');
768
876
  process.exit(1);
769
877
  }
770
- return runLogs(logsOptions, options, reporter);
878
+ return runRuns(runsOptions, options, reporter);
771
879
  default:
772
880
  return runCommand(options, reporter);
773
881
  }