elasticdash-test 0.1.21-alpha-2 → 0.1.21-alpha-4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elasticdash-test",
3
- "version": "0.1.21-alpha-2",
3
+ "version": "0.1.21-alpha-4",
4
4
  "description": "AI-native test runner for ElasticDash workflow testing",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,6 +4,8 @@ import { getOriginalFetch } from './interceptors/http.js'
4
4
  import { getObservabilityContext } from './interceptors/telemetry-push.js'
5
5
  import { scanTools } from './execution/tool-runner.js'
6
6
  import { debugLog } from './utils/debug.js'
7
+ import { writeFileSync, mkdirSync } from 'node:fs'
8
+ import { join } from 'node:path'
7
9
 
8
10
  /** Track trigger IDs that are currently executing or already completed to prevent duplicate execution. */
9
11
  const handledTriggers = new Set<number>()
@@ -142,6 +144,30 @@ export async function executeTrigger(
142
144
  }
143
145
  }
144
146
 
147
+ // Debug: save rerun step output to .temp/llm-debug/ for inspection
148
+ try {
149
+ const debugDir = join(cwd, '.temp', 'llm-debug')
150
+ mkdirSync(debugDir, { recursive: true })
151
+ const ts = Date.now()
152
+ const status = stepResult.available ? (stepResult.runs.every(r => !r.error) ? 'ok' : 'error') : 'unavailable'
153
+ const filename = `step${stepIndex + 1}-${ts}-${status}.json`
154
+ writeFileSync(join(debugDir, filename), JSON.stringify({
155
+ triggerId: trigger.triggerId,
156
+ stepIndex: stepIndex + 1,
157
+ totalSteps,
158
+ eventType: step.eventType,
159
+ eventName: step.eventName,
160
+ originalEventDbId: step.originalEventDbId,
161
+ input: step.input,
162
+ available: stepResult.available,
163
+ unavailableReason: stepResult.unavailableReason,
164
+ runs: stepResult.runs,
165
+ }, null, 2))
166
+ debugLog(`[elasticdash] Debug saved: ${filename}`)
167
+ } catch {
168
+ // non-critical, ignore
169
+ }
170
+
145
171
  // POST rerun results directly under the original event record
146
172
  const url = `${baseUrl}/api/observability/events/${step.originalEventDbId}/reruns`
147
173
  try {