# Tasks — OBS-001: Session Log Analyzer — make the shipped command actually work

Spec: `.agents/spec-docs/active/OBS-001-session-log-analyzer.md`
Test Plan SSOT: the spec's TC table.

The parser/reporter logic (TC-03/04/05) already exists and passes unit tests; the two
integration bugs (session-path mismatch, flag rejection) are what this work fixes.

- [x] T1 (TC-01): `runSessionAnalyze` reads sessions from BOTH project-level
      (`projectPaths(cwd).sessions`) and user-level (`userPaths().sessions`), merged +
      deduped + sorted; default run prints the most recent session's timing report.
- [x] T2 (TC-02): `--last <n>` aggregate works end-to-end — fix flag delivery by intercepting
      `session analyze` in `cli.ts` BEFORE `parseCliArgs()`.
- [x] T3 (TC-03): gap_ms ISO-8601 calc — existing parser.test.ts (regression, keep green).
- [x] T4 (TC-04): interval classification — existing parser.test.ts (regression).
- [x] T5 (TC-05): slow-interval (>10s) section — existing reporter.test.ts (regression).
- [x] T6 (TC-06): no sessions / unreadable → clear stderr message + exit 1 (preserved).
- [x] T7 (TC-07): `--session <id-prefix>` selects a specific session (flag now delivered).
- [x] T8: new integration test `session-analyze-command.test.ts` covering path-merge +
      flag handling (TC-01/02/06/07) with temp project + home dirs. (Verified at GATE-COMPLETE:
      file present on disk, 6 tests pass — TC-01/02/06/07 + TC-07b + user/project merge.)
- [x] T9: wrap-up — agent-cli test/typecheck/lint/build green; real-binary 7-TC verification
      recorded as User Execution evidence; PR to develop (squash); GATE-VERIFY/COMPLETE; spec
      → done; backlog/tasks archived.

## Test Plan

Authoritative TC table: the spec's `## Test Plan`. TC-03/04/05 via existing parser/reporter
unit suites; TC-01/02/06/07 via new `session-analyze-command.test.ts` (temp dirs) AND a
real-binary scenario (`/tmp/obs001-verify.sh`-style) recorded as User Execution evidence.
