diff --git a/notes/bd-129.md b/notes/bd-129.md new file mode 100644 index 0000000..5f74915 --- /dev/null +++ b/notes/bd-129.md @@ -0,0 +1,28 @@ +# BD-129: Integration Test for Real NEEDLE Worker Logs + +## Task +Create a vitest integration test that reads actual NEEDLE log files from ~/.needle/logs/ and verifies the parser correctly extracts worker, bead, timestamp and event information from production logs. + +## Finding +The integration test already exists in `src/parser.real-logs.integration.test.ts`, created in bead `bd-6q2`. + +## Existing Test Coverage +The file contains 467 lines with 19 comprehensive tests: + +1. **Log directory sanity checks** - verifies .jsonl files exist and are valid JSONL +2. **NeedleEvent shape assertions** - validates canonical format parsing, session_id preservation, monotonically increasing sequence numbers, nested data fields, and bead_id preservation +3. **Worker lifecycle events** - tests worker.started, worker.idle, worker.state_transition, worker.stopped +4. **Bead lifecycle events** - tests bead.claim.*, bead.completed, bead.released +5. **Adapter round-trip** - verifies consistency between parseNeedleEvent and parseLogLine +6. **Cross-file consistency** - tests multiple log files, worker_id consistency, event type variety + +All 19 tests pass successfully. + +## Test Results +``` +Test Files 1 passed (1) +Tests 19 passed (19) +``` + +## Conclusion +Task already completed in previous bead. No changes needed.