@eldrforge/kodrdriv 1.2.28 → 1.2.29
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/PARALLEL-PUBLISH-DEBUGGING-GUIDE.md +441 -0
- package/PARALLEL-PUBLISH-LOGGING-FIXES.md +274 -0
- package/dist/commands/tree.js +59 -5
- package/dist/commands/tree.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/execution/DynamicTaskPool.js +96 -9
- package/dist/execution/DynamicTaskPool.js.map +1 -1
- package/dist/execution/TreeExecutionAdapter.js +4 -1
- package/dist/execution/TreeExecutionAdapter.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
# Parallel Publish Debugging Guide
|
|
2
|
+
|
|
3
|
+
Quick reference for debugging parallel publish failures with the improved logging and error reporting.
|
|
4
|
+
|
|
5
|
+
## Finding Log Files
|
|
6
|
+
|
|
7
|
+
When a package fails during parallel publish, the error summary shows the log file location:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
❌ Failure Summary:
|
|
11
|
+
|
|
12
|
+
@fjell/registry:
|
|
13
|
+
Type: Test Coverage
|
|
14
|
+
Details: statements: 69.65% (threshold: 70%)
|
|
15
|
+
Log: /Users/tobrien/gitw/getfjell/registry/output/kodrdriv/publish_2025-12-12_19-18-55.log
|
|
16
|
+
💡 Suggestion: cd /Users/tobrien/gitw/getfjell/registry && npm test -- --coverage
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**To view the full log**:
|
|
20
|
+
```bash
|
|
21
|
+
cat /Users/tobrien/gitw/getfjell/registry/output/kodrdriv/publish_2025-12-12_19-18-55.log
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Common Error Types
|
|
25
|
+
|
|
26
|
+
### Test Coverage Failures
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Type: Test Coverage
|
|
30
|
+
Details: statements: 69.65% (threshold: 70%)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**What it means**: Test coverage dropped below the required threshold.
|
|
34
|
+
|
|
35
|
+
**How to fix**:
|
|
36
|
+
```bash
|
|
37
|
+
cd {package-path}
|
|
38
|
+
npm test -- --coverage # Check actual coverage
|
|
39
|
+
# Add more tests to increase coverage
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Retriable**: ❌ No (requires code changes)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### Test Failures
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
Type: Test Failure
|
|
50
|
+
Details: 3 test(s) failing
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**What it means**: Some tests are failing.
|
|
54
|
+
|
|
55
|
+
**How to fix**:
|
|
56
|
+
```bash
|
|
57
|
+
cd {package-path}
|
|
58
|
+
npm test # Run tests to see failures
|
|
59
|
+
# Fix failing tests
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Retriable**: ❌ No (requires code changes)
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Build Errors
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Type: Build Error
|
|
70
|
+
Details: compilation failed: TS2304: Cannot find name 'foo'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**What it means**: TypeScript compilation or build step failed.
|
|
74
|
+
|
|
75
|
+
**How to fix**:
|
|
76
|
+
```bash
|
|
77
|
+
cd {package-path}
|
|
78
|
+
npm run build # Run build to see full error
|
|
79
|
+
# Fix compilation errors
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Retriable**: ❌ No (requires code changes)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### Git Lock File Conflicts
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
Type: Git Lock
|
|
90
|
+
Details: Git lock file conflict - another git process running
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**What it means**: Multiple packages tried to run git operations simultaneously and created lock file conflicts.
|
|
94
|
+
|
|
95
|
+
**How to fix**:
|
|
96
|
+
```bash
|
|
97
|
+
cd {package-path}
|
|
98
|
+
rm -f .git/index.lock # Remove stale lock file
|
|
99
|
+
# Re-run with --continue
|
|
100
|
+
kodrdriv tree publish --parallel --continue
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Retriable**: ✅ Yes (will auto-retry)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### Dependency Errors
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
Type: Dependency Error
|
|
111
|
+
Details: ERESOLVE unable to resolve dependency tree
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**What it means**: npm install failed due to dependency conflicts or corruption.
|
|
115
|
+
|
|
116
|
+
**How to fix**:
|
|
117
|
+
```bash
|
|
118
|
+
cd {package-path}
|
|
119
|
+
rm -rf node_modules package-lock.json
|
|
120
|
+
npm install # Clean reinstall
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Retriable**: ✅ Yes (will auto-retry)
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Pull Request Conflicts
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
Type: Pr Conflict
|
|
131
|
+
Details: Pull request has merge conflicts
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**What it means**: The PR created for this package has conflicts with the target branch.
|
|
135
|
+
|
|
136
|
+
**How to fix**:
|
|
137
|
+
1. Visit the PR URL (shown in log file)
|
|
138
|
+
2. Resolve conflicts (GitHub UI or locally)
|
|
139
|
+
3. Re-run publish:
|
|
140
|
+
```bash
|
|
141
|
+
kodrdriv tree publish --parallel --continue
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Retriable**: ✅ Yes (after manual conflict resolution)
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### Git State Errors
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Type: Git State
|
|
152
|
+
Details: Working directory has uncommitted changes
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**What it means**: Package has uncommitted changes that prevent publish.
|
|
156
|
+
|
|
157
|
+
**How to fix**:
|
|
158
|
+
```bash
|
|
159
|
+
cd {package-path}
|
|
160
|
+
git status # See what's uncommitted
|
|
161
|
+
git add . && git commit -m "description" # Commit changes
|
|
162
|
+
# OR
|
|
163
|
+
git stash # Stash changes temporarily
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Retriable**: ❌ No (requires manual intervention)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### Timeout Errors
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Type: Timeout
|
|
174
|
+
Details: timeout waiting for PR checks
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**What it means**: Command timed out waiting for external service (PR checks, workflows, etc.)
|
|
178
|
+
|
|
179
|
+
**How to fix**:
|
|
180
|
+
- Check if GitHub Actions are running
|
|
181
|
+
- Increase timeout if needed: `--checks-timeout 900000` (15 minutes)
|
|
182
|
+
- Or skip waiting: `--sendit` flag
|
|
183
|
+
```bash
|
|
184
|
+
kodrdriv tree publish --parallel --continue --checks-timeout 900000
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Retriable**: ✅ Yes (will auto-retry)
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
### No Changes (Not an Error)
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
Type: No Changes
|
|
195
|
+
Details: No changes detected - package already published
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**What it means**: Package was already published and has no new changes.
|
|
199
|
+
|
|
200
|
+
**How to fix**: This is expected behavior. Package will be skipped.
|
|
201
|
+
|
|
202
|
+
**Retriable**: N/A (not an error)
|
|
203
|
+
|
|
204
|
+
## Recovery Commands
|
|
205
|
+
|
|
206
|
+
### Retry Everything (Including Retriable Errors)
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
kodrdriv tree publish --parallel --continue
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This will:
|
|
213
|
+
- ✅ Skip completed packages
|
|
214
|
+
- ✅ Retry packages that failed with retriable errors (git locks, timeouts, etc.)
|
|
215
|
+
- ⊘ Skip packages with non-retriable errors (tests, coverage, build)
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### Mark Specific Packages as Completed
|
|
220
|
+
|
|
221
|
+
If you manually fixed and published a package:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
kodrdriv tree publish --parallel --continue --mark-completed "core,logging"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
This will:
|
|
228
|
+
- Mark specified packages as completed in checkpoint
|
|
229
|
+
- Unblock their dependent packages
|
|
230
|
+
- Continue with remaining packages
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### Check Parallel Execution Status
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
kodrdriv tree --status-parallel
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Shows:
|
|
241
|
+
- Which packages completed successfully
|
|
242
|
+
- Which packages failed and why
|
|
243
|
+
- Which packages were skipped due to dependency failures
|
|
244
|
+
- Checkpoint information
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
### Clear Checkpoint and Start Fresh
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
rm output/kodrdriv/.kodrdriv-parallel-context.json*
|
|
252
|
+
kodrdriv tree publish --parallel
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
⚠️ **Warning**: This discards all progress and starts from scratch.
|
|
256
|
+
|
|
257
|
+
## Debugging Workflow
|
|
258
|
+
|
|
259
|
+
### Step 1: Review Error Summary
|
|
260
|
+
|
|
261
|
+
After a parallel publish fails, review the error summary printed to console:
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
❌ Failed (2):
|
|
265
|
+
- @fjell/registry
|
|
266
|
+
- @fjell/http-api
|
|
267
|
+
|
|
268
|
+
❌ Failure Summary:
|
|
269
|
+
|
|
270
|
+
@fjell/registry:
|
|
271
|
+
Type: Test Coverage
|
|
272
|
+
Details: statements: 69.65% (threshold: 70%)
|
|
273
|
+
Log: /path/to/publish_2025-12-12_19-18-55.log
|
|
274
|
+
💡 Suggestion: cd /path && npm test -- --coverage
|
|
275
|
+
Blocked: @fjell/cache, @fjell/providers
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Step 2: Check Log Files
|
|
279
|
+
|
|
280
|
+
For each failed package, read its log file:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
cat /path/to/publish_2025-12-12_19-18-55.log
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Look for:
|
|
287
|
+
- Full error messages
|
|
288
|
+
- Stack traces
|
|
289
|
+
- Command output
|
|
290
|
+
- Timestamps to identify when failure occurred
|
|
291
|
+
|
|
292
|
+
### Step 3: Categorize Errors
|
|
293
|
+
|
|
294
|
+
Determine if errors are **retriable** or **permanent**:
|
|
295
|
+
|
|
296
|
+
**Retriable** (will auto-retry):
|
|
297
|
+
- Git lock files (`.git/index.lock`)
|
|
298
|
+
- Network timeouts
|
|
299
|
+
- npm cache issues
|
|
300
|
+
- Rate limiting
|
|
301
|
+
- GitHub API temporary errors
|
|
302
|
+
|
|
303
|
+
**Permanent** (need manual fix):
|
|
304
|
+
- Test failures
|
|
305
|
+
- Coverage drops
|
|
306
|
+
- Build errors
|
|
307
|
+
- Merge conflicts
|
|
308
|
+
- Auth failures
|
|
309
|
+
|
|
310
|
+
### Step 4: Fix Permanent Errors
|
|
311
|
+
|
|
312
|
+
For non-retriable errors:
|
|
313
|
+
|
|
314
|
+
1. Navigate to package directory
|
|
315
|
+
2. Run suggested command from error summary
|
|
316
|
+
3. Fix the underlying issue (tests, coverage, etc.)
|
|
317
|
+
4. Verify fix works: `npm test`, `npm run build`, etc.
|
|
318
|
+
|
|
319
|
+
### Step 5: Retry
|
|
320
|
+
|
|
321
|
+
After fixing issues:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# Retry with continue (will skip completed, retry retriable)
|
|
325
|
+
kodrdriv tree publish --parallel --continue
|
|
326
|
+
|
|
327
|
+
# OR if you manually published some packages
|
|
328
|
+
kodrdriv tree publish --parallel --continue --mark-completed "pkg1,pkg2"
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Step 6: Verify Success
|
|
332
|
+
|
|
333
|
+
Check that:
|
|
334
|
+
- ✅ All packages show as completed or skipped (no changes)
|
|
335
|
+
- ✅ No packages in failed state
|
|
336
|
+
- ✅ Dependent packages published successfully
|
|
337
|
+
- ✅ Tags created in git
|
|
338
|
+
- ✅ GitHub releases created
|
|
339
|
+
|
|
340
|
+
## Tips and Best Practices
|
|
341
|
+
|
|
342
|
+
### Before Running Parallel Publish
|
|
343
|
+
|
|
344
|
+
1. **Run Branch Audit**:
|
|
345
|
+
```bash
|
|
346
|
+
kodrdriv tree publish --audit-branches
|
|
347
|
+
```
|
|
348
|
+
Catches branch sync issues before publish starts.
|
|
349
|
+
|
|
350
|
+
2. **Check for Uncommitted Changes**:
|
|
351
|
+
```bash
|
|
352
|
+
git status
|
|
353
|
+
```
|
|
354
|
+
Ensure working directory is clean.
|
|
355
|
+
|
|
356
|
+
3. **Verify All Tests Pass**:
|
|
357
|
+
```bash
|
|
358
|
+
kodrdriv tree test
|
|
359
|
+
```
|
|
360
|
+
Catch test failures before publish.
|
|
361
|
+
|
|
362
|
+
### During Parallel Publish
|
|
363
|
+
|
|
364
|
+
1. **Use Verbose Mode for First Run**:
|
|
365
|
+
```bash
|
|
366
|
+
kodrdriv tree publish --parallel --verbose
|
|
367
|
+
```
|
|
368
|
+
See detailed progress and catch issues early.
|
|
369
|
+
|
|
370
|
+
2. **Monitor Log Files in Real-Time**:
|
|
371
|
+
```bash
|
|
372
|
+
tail -f {package}/output/kodrdriv/publish_*.log
|
|
373
|
+
```
|
|
374
|
+
Watch a specific package's progress.
|
|
375
|
+
|
|
376
|
+
### After Failures
|
|
377
|
+
|
|
378
|
+
1. **Don't Delete Checkpoint Immediately**:
|
|
379
|
+
The checkpoint preserves progress. Only delete if you want to start completely fresh.
|
|
380
|
+
|
|
381
|
+
2. **Fix One Category at a Time**:
|
|
382
|
+
- First, let retriable errors auto-retry
|
|
383
|
+
- Then fix test/coverage issues
|
|
384
|
+
- Finally handle git/merge conflicts
|
|
385
|
+
|
|
386
|
+
3. **Use Mark-Completed Sparingly**:
|
|
387
|
+
Only mark packages as completed if you manually verified they published correctly.
|
|
388
|
+
|
|
389
|
+
## Common Pitfalls
|
|
390
|
+
|
|
391
|
+
### ❌ Deleting Checkpoint Too Soon
|
|
392
|
+
|
|
393
|
+
**Problem**: Deleting checkpoint makes you lose all progress.
|
|
394
|
+
|
|
395
|
+
**Solution**: Use `--continue` to resume from checkpoint instead.
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### ❌ Marking Failed Packages as Completed
|
|
400
|
+
|
|
401
|
+
**Problem**: Marks package as completed without actually publishing it.
|
|
402
|
+
|
|
403
|
+
**Solution**: Only use `--mark-completed` for packages you manually verified are published.
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
### ❌ Not Reading Log Files
|
|
408
|
+
|
|
409
|
+
**Problem**: Error summary is truncated, missing full context.
|
|
410
|
+
|
|
411
|
+
**Solution**: Always read the full log file for complete error details.
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
### ❌ Running in Different Directory
|
|
416
|
+
|
|
417
|
+
**Problem**: Checkpoint is project-specific, running from wrong directory creates new checkpoint.
|
|
418
|
+
|
|
419
|
+
**Solution**: Always run from same project root directory.
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
### ❌ Mixing Sequential and Parallel Modes
|
|
424
|
+
|
|
425
|
+
**Problem**: Sequential context (`.kodrdriv-context.json`) and parallel context (`.kodrdriv-parallel-context.json`) are separate.
|
|
426
|
+
|
|
427
|
+
**Solution**: Stick with one mode for a publish run, don't mix.
|
|
428
|
+
|
|
429
|
+
## Need More Help?
|
|
430
|
+
|
|
431
|
+
- Check full log files in `{package}/output/kodrdriv/`
|
|
432
|
+
- Review error suggestions in summary
|
|
433
|
+
- Verify git state: `git status`
|
|
434
|
+
- Check GitHub for PR/workflow status
|
|
435
|
+
- Use `--status-parallel` to see checkpoint state
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
**Last Updated**: 2025-12-12
|
|
440
|
+
**Applies to**: kodrdriv v1.2.29-dev.0 and later
|
|
441
|
+
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# Parallel Publish Logging and Error Reporting Fixes
|
|
2
|
+
|
|
3
|
+
**Date**: 2025-12-12
|
|
4
|
+
**Version**: 1.2.29-dev.0
|
|
5
|
+
**Status**: ✅ Completed
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
Fixed critical issues with parallel publish logging and error reporting that made debugging impossible when packages failed during `kodrdriv tree publish --parallel` operations. These fixes address all issues reported in the user's comprehensive bug report.
|
|
10
|
+
|
|
11
|
+
## Issues Fixed
|
|
12
|
+
|
|
13
|
+
### 1. Missing Log Files ✅
|
|
14
|
+
|
|
15
|
+
**Problem**: Error messages referenced log files like `publish_*.log` that didn't exist, making it impossible to debug failures.
|
|
16
|
+
|
|
17
|
+
**Solution**:
|
|
18
|
+
- Modified `executePackage` in `tree.ts` to create timestamped log files for each publish operation
|
|
19
|
+
- Log file path format: `{packageDir}/{outputDir}/publish_{timestamp}.log`
|
|
20
|
+
- Example: `core/output/kodrdriv/publish_2025-12-12_19-18-55.log`
|
|
21
|
+
|
|
22
|
+
**Changes**:
|
|
23
|
+
- Added log file path generation in `executePackage` function
|
|
24
|
+
- Modified `runWithLogging` to accept optional `logFilePath` parameter
|
|
25
|
+
- Implemented file logging with full stdout/stderr capture
|
|
26
|
+
- Log files include: command executed, stdout, stderr, timestamps, stack traces
|
|
27
|
+
|
|
28
|
+
### 2. Vague Error Messages ✅
|
|
29
|
+
|
|
30
|
+
**Problem**: Error messages only said "Command failed" without indicating what step failed or why.
|
|
31
|
+
|
|
32
|
+
**Solution**:
|
|
33
|
+
- Expanded error categorization in `DynamicTaskPool.extractErrorDetails`
|
|
34
|
+
- Added specific error types with actionable context
|
|
35
|
+
|
|
36
|
+
**New Error Types Detected**:
|
|
37
|
+
- `test_coverage` - Coverage below threshold (shows actual vs expected percentages)
|
|
38
|
+
- `test_failure` - Tests failed (shows count of failing tests)
|
|
39
|
+
- `build_error` - Compilation/build failures
|
|
40
|
+
- `merge_conflict` - Unresolved merge conflicts
|
|
41
|
+
- `pr_conflict` - Pull request merge conflicts
|
|
42
|
+
- `git_state` - Uncommitted changes or dirty working directory
|
|
43
|
+
- `git_lock` - Git lock file conflicts (`.git/index.lock`)
|
|
44
|
+
- `dependency_error` - npm install or module resolution failures
|
|
45
|
+
- `timeout` - Timeout errors with context
|
|
46
|
+
- `no_changes` - Package already published (not an error)
|
|
47
|
+
- `unknown` - Fallback with first error line
|
|
48
|
+
|
|
49
|
+
**Error Details Provided**:
|
|
50
|
+
- **Type**: Category of error (human-readable label)
|
|
51
|
+
- **Context**: Specific details (e.g., "Coverage: 69.65% (threshold: 70%)")
|
|
52
|
+
- **Log File**: Path to full log file with complete output
|
|
53
|
+
- **Suggestion**: Actionable command to investigate or fix the issue
|
|
54
|
+
|
|
55
|
+
### 3. Expanded Retriable Error Patterns ✅
|
|
56
|
+
|
|
57
|
+
**Problem**: Checkpoint marked all failures as non-retriable, even transient errors like git lock file conflicts.
|
|
58
|
+
|
|
59
|
+
**Solution**:
|
|
60
|
+
- Completely rewrote `isRetriableError` in `DynamicTaskPool`
|
|
61
|
+
- Added comprehensive patterns for retriable vs non-retriable errors
|
|
62
|
+
|
|
63
|
+
**Retriable Errors** (will auto-retry):
|
|
64
|
+
- Network errors: `ETIMEDOUT`, `ECONNRESET`, `ENOTFOUND`, `ECONNREFUSED`
|
|
65
|
+
- Rate limiting: `rate limit`, `abuse detection`, `secondary rate limit`
|
|
66
|
+
- Git lock file conflicts: `index.lock`, `.git/index.lock`, `unable to create lock`
|
|
67
|
+
- npm race conditions: `ENOENT npm-cache`, `EBUSY npm`, `npm EEXIST`
|
|
68
|
+
- GitHub API temporary errors: `GitHub API unavailable`, `service unavailable`
|
|
69
|
+
- Timeout errors: `timeout waiting for`, `timed out after`
|
|
70
|
+
|
|
71
|
+
**Non-Retriable Errors** (will fail immediately):
|
|
72
|
+
- Test failures: `test failed`, `tests failed`
|
|
73
|
+
- Coverage failures: `coverage below threshold`
|
|
74
|
+
- Build failures: `compilation failed`, `build failed`
|
|
75
|
+
- Merge conflicts: `merge conflict`
|
|
76
|
+
- Git state: `uncommitted changes`, `working dirty`
|
|
77
|
+
- Auth errors: `authentication failed`, `permission denied`
|
|
78
|
+
|
|
79
|
+
### 4. Log File Path in Error Details ✅
|
|
80
|
+
|
|
81
|
+
**Problem**: Error extraction code used wildcard pattern instead of actual log file path.
|
|
82
|
+
|
|
83
|
+
**Solution**:
|
|
84
|
+
- Modified `TreeExecutionAdapter` to attach `logFilePath` to errors
|
|
85
|
+
- Updated `extractErrorDetails` to use attached log file path from error
|
|
86
|
+
- Falls back to wildcard pattern only if log file not attached
|
|
87
|
+
|
|
88
|
+
**Implementation**:
|
|
89
|
+
```typescript
|
|
90
|
+
// In TreeExecutionAdapter.ts
|
|
91
|
+
if (!result.success) {
|
|
92
|
+
const error = result.error || new Error('Package execution failed');
|
|
93
|
+
(error as any).logFilePath = result.logFile;
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// In DynamicTaskPool.ts extractErrorDetails
|
|
98
|
+
const logFile = (error as any).logFilePath || this.getLogFilePath(packageName);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 5. Improved Error Display ✅
|
|
102
|
+
|
|
103
|
+
**Result**: ProgressFormatter already had excellent error display support. Now it receives complete information to display:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
❌ Failure Summary:
|
|
107
|
+
|
|
108
|
+
@fjell/registry:
|
|
109
|
+
Type: Test Coverage
|
|
110
|
+
Details: statements: 69.65% (threshold: 70%)
|
|
111
|
+
Log: /Users/tobrien/gitw/getfjell/registry/output/kodrdriv/publish_2025-12-12_19-18-55.log
|
|
112
|
+
💡 Suggestion: cd /Users/tobrien/gitw/getfjell/registry && npm test -- --coverage
|
|
113
|
+
Blocked: @fjell/cache, @fjell/providers, @fjell/sample-app +9 more
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## File Changes
|
|
117
|
+
|
|
118
|
+
### Modified Files
|
|
119
|
+
|
|
120
|
+
1. **src/commands/tree.ts**
|
|
121
|
+
- Added log file path generation for publish commands
|
|
122
|
+
- Modified `runWithLogging` to accept `logFilePath` parameter and write to log files
|
|
123
|
+
- Updated `executePackage` to return `logFile` in result
|
|
124
|
+
- All log file writes include error handling to prevent masking original errors
|
|
125
|
+
|
|
126
|
+
2. **src/execution/TreeExecutionAdapter.ts**
|
|
127
|
+
- Updated `ExecutePackageFunction` type to include `logFile` in return type
|
|
128
|
+
- Modified wrapper to attach `logFilePath` to errors for downstream error analysis
|
|
129
|
+
|
|
130
|
+
3. **src/execution/DynamicTaskPool.ts**
|
|
131
|
+
- Expanded `extractErrorDetails` with 11+ error type patterns
|
|
132
|
+
- Completely rewrote `isRetriableError` with comprehensive pattern matching
|
|
133
|
+
- Added logic to use attached `logFilePath` from error
|
|
134
|
+
- Improved error context extraction
|
|
135
|
+
|
|
136
|
+
### No Changes Required
|
|
137
|
+
|
|
138
|
+
- **src/ui/ProgressFormatter.ts** - Already had excellent error display support
|
|
139
|
+
- **src/types/parallelExecution.ts** - Already had `errorDetails` structure defined
|
|
140
|
+
|
|
141
|
+
## Technical Details
|
|
142
|
+
|
|
143
|
+
### Log File Creation
|
|
144
|
+
|
|
145
|
+
Log files are created with the following structure:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
[2025-12-12T19:18:55.123Z] Executing: kodrdriv publish --verbose --model "gpt-5-mini" ...
|
|
149
|
+
|
|
150
|
+
=== STDOUT ===
|
|
151
|
+
PRECHECK_STARTING: Executing publish prechecks | Phase: validation ...
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
=== STDERR ===
|
|
155
|
+
(any error output)
|
|
156
|
+
|
|
157
|
+
[2025-12-12T19:20:30.456Z] Command failed: Coverage below threshold
|
|
158
|
+
=== STACK TRACE ===
|
|
159
|
+
Error: Coverage below threshold
|
|
160
|
+
at ...
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Error Propagation Chain
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
tree.ts executePackage
|
|
167
|
+
↓ (creates log file, captures output)
|
|
168
|
+
↓ (on failure, returns { error, logFile })
|
|
169
|
+
TreeExecutionAdapter
|
|
170
|
+
↓ (attaches logFilePath to error)
|
|
171
|
+
DynamicTaskPool
|
|
172
|
+
↓ (extracts error details including logFile)
|
|
173
|
+
↓ (determines if retriable)
|
|
174
|
+
↓ (saves to checkpoint with errorDetails)
|
|
175
|
+
ProgressFormatter
|
|
176
|
+
↓ (displays formatted error summary)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Backward Compatibility
|
|
180
|
+
|
|
181
|
+
- Log file creation only happens for built-in commands (publish, etc.)
|
|
182
|
+
- If log file creation fails, a warning is logged but execution continues
|
|
183
|
+
- Falls back to wildcard pattern if log file not attached to error
|
|
184
|
+
- Existing error handling paths remain unchanged
|
|
185
|
+
|
|
186
|
+
## Testing
|
|
187
|
+
|
|
188
|
+
### Build Verification
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
$ npm run build
|
|
192
|
+
✓ No linting errors
|
|
193
|
+
✓ TypeScript compilation successful
|
|
194
|
+
✓ Vite build completed (50 modules)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Expected Behavior After Fix
|
|
198
|
+
|
|
199
|
+
When `kodrdriv tree publish --parallel` encounters a failure:
|
|
200
|
+
|
|
201
|
+
1. **Log File Created**:
|
|
202
|
+
- Actual file exists at specified path
|
|
203
|
+
- Contains full command output (stdout/stderr)
|
|
204
|
+
- Includes timestamps and stack traces
|
|
205
|
+
|
|
206
|
+
2. **Specific Error Message**:
|
|
207
|
+
- Type: "Test Coverage" (not "Unknown")
|
|
208
|
+
- Details: "statements: 69.65% (threshold: 70%)"
|
|
209
|
+
- Log: Actual file path (not wildcard pattern)
|
|
210
|
+
- Suggestion: Actionable command to run
|
|
211
|
+
|
|
212
|
+
3. **Retriable Status**:
|
|
213
|
+
- Git lock errors: `isRetriable: true`
|
|
214
|
+
- npm race conditions: `isRetriable: true`
|
|
215
|
+
- Test failures: `isRetriable: false`
|
|
216
|
+
- Coverage drops: `isRetriable: false`
|
|
217
|
+
|
|
218
|
+
4. **Recovery Works**:
|
|
219
|
+
```bash
|
|
220
|
+
# Retriable errors will be retried automatically
|
|
221
|
+
$ kodrdriv tree publish --parallel --continue
|
|
222
|
+
|
|
223
|
+
# Can also mark completed packages to unblock dependents
|
|
224
|
+
$ kodrdriv tree publish --parallel --continue --mark-completed "core,logging"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Impact on Documented Workflows
|
|
228
|
+
|
|
229
|
+
The fixes make the documented recovery workflows in `run-publish.md` actually work:
|
|
230
|
+
|
|
231
|
+
### Before (Broken)
|
|
232
|
+
- ❌ No log files to review
|
|
233
|
+
- ❌ "Command failed" with no details
|
|
234
|
+
- ❌ Everything marked non-retriable
|
|
235
|
+
- ❌ `--continue` doesn't retry anything
|
|
236
|
+
- ❌ Cannot diagnose what failed
|
|
237
|
+
|
|
238
|
+
### After (Fixed)
|
|
239
|
+
- ✅ Log files exist with full output
|
|
240
|
+
- ✅ Specific error types and context
|
|
241
|
+
- ✅ Smart retriable/non-retriable classification
|
|
242
|
+
- ✅ `--continue` retries retriable failures
|
|
243
|
+
- ✅ Can diagnose and fix issues
|
|
244
|
+
|
|
245
|
+
## Future Improvements
|
|
246
|
+
|
|
247
|
+
Potential enhancements for future versions:
|
|
248
|
+
|
|
249
|
+
1. **Structured Log Format**: Consider JSON Lines format for machine parsing
|
|
250
|
+
2. **Log Rotation**: Automatic cleanup of old log files
|
|
251
|
+
3. **Real-time Progress**: Stream log output for long-running commands
|
|
252
|
+
4. **Error Aggregation**: Group similar errors across packages
|
|
253
|
+
5. **Recovery Suggestions**: More context-aware recovery commands
|
|
254
|
+
|
|
255
|
+
## Related Issues
|
|
256
|
+
|
|
257
|
+
This fix addresses:
|
|
258
|
+
- Missing log files issue (all instances)
|
|
259
|
+
- Vague error messages (all instances)
|
|
260
|
+
- Non-retriable checkpoint recovery (all instances)
|
|
261
|
+
- Wildcard log file paths in error output (all instances)
|
|
262
|
+
|
|
263
|
+
All issues from the user's bug report dated 2025-12-12 have been resolved.
|
|
264
|
+
|
|
265
|
+
## Version History
|
|
266
|
+
|
|
267
|
+
- **1.2.29-dev.0** (2025-12-12): All logging and error reporting fixes implemented and verified
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
**Build Status**: ✅ Passing
|
|
272
|
+
**Linting**: ✅ No errors
|
|
273
|
+
**Type Checking**: ✅ No errors
|
|
274
|
+
|