feat(#168): Implement job steps tracking

Implement JobStepsModule for granular step tracking within runner jobs.

Features:
- Create and track job steps (SETUP, EXECUTION, VALIDATION, CLEANUP)
- Track step status transitions (PENDING → RUNNING → COMPLETED/FAILED)
- Record token usage for AI_ACTION steps
- Calculate step duration automatically
- GET endpoints for listing and retrieving steps

Implementation:
- JobStepsService: CRUD operations, status tracking, duration calculation
- JobStepsController: GET /runner-jobs/:jobId/steps endpoints
- DTOs: CreateStepDto, UpdateStepDto with validation
- Full unit test coverage (16 tests)

Quality gates:
- Build:  Passed
- Lint:  Passed
- Tests:  16/16 passed
- Coverage:  100% statements, 100% functions, 100% lines, 83.33% branches

Also fixed pre-existing TypeScript strict mode issue in job-events DTO.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 21:16:23 -06:00
parent 7102b4a1d2
commit efe624e2c1
54 changed files with 2597 additions and 17 deletions

View File

@@ -61,24 +61,26 @@
### Issue 166 - [INFRA-004] Stitcher module structure
- **Estimate:** 50,000 tokens (sonnet)
- **Actual:** _pending_
- **Variance:** _pending_
- **Agent ID:** _pending_
- **Status:** pending
- **Actual:** ~62,000 tokens (sonnet)
- **Variance:** +24% (over estimate)
- **Agent ID:** af3724d
- **Status:** ✅ completed
- **Dependencies:** #165
- **Notes:** Workflow orchestration wrapper for OpenClaw
- **Quality Gates:** ✅ All passed (12 tests, typecheck, lint, build)
- **Notes:** Implemented webhook endpoint, Guard Rails, Quality Rails, BullMQ integration. Service and controller with full test coverage.
---
### Issue 167 - [INFRA-005] Runner jobs CRUD and queue submission
- **Estimate:** 55,000 tokens (sonnet)
- **Actual:** _pending_
- **Variance:** _pending_
- **Agent ID:** _pending_
- **Status:** pending
- **Actual:** ~76,000 tokens (sonnet)
- **Variance:** +38% (over estimate)
- **Agent ID:** aa914a0
- **Status:** ✅ completed
- **Dependencies:** #164, #165
- **Notes:** Job lifecycle management, BullMQ queue submission
- **Quality Gates:** ✅ All passed (24 tests, typecheck, lint, build)
- **Notes:** Implemented 5 REST endpoints (create, list, get, cancel, retry) with BullMQ integration and Prisma persistence.
---
@@ -251,9 +253,9 @@
### Phase 2: Stitcher Service
- **Estimated:** 205,000 tokens
- **Actual:** _pending_
- **Actual:** _in_progress_ (~138,000 for #166, #167)
- **Variance:** _pending_
- **Issues:** #166, #167, #168, #169
- **Issues:** #166 (✅), #167 (✅), #168, #169
### Phase 3: Chat Integration
@@ -333,6 +335,10 @@ _Execution events will be logged here as work progresses._
[2026-02-01 19:18] Issue #164 COMPLETED - Agent a1585e8 - ~65,000 tokens
[2026-02-01 19:18] Wave 1 COMPLETE - Total: ~145,000 tokens
[2026-02-01 19:18] Wave 2 STARTED - Stitcher core (#166, #167)
[2026-02-01 19:25] Issue #166 COMPLETED - Agent af3724d - ~62,000 tokens
[2026-02-01 19:32] Issue #167 COMPLETED - Agent aa914a0 - ~76,000 tokens
[2026-02-01 19:32] Wave 2 COMPLETE - Total: ~138,000 tokens
[2026-02-01 19:32] Wave 3 STARTED - Stitcher events (#168, #169)
```
## Notes