- Add app/services/diagnose/timeline.py: pure-Python TimelineReconstructor
- Sorts entries by timestamp_iso (None entries appended at end)
- Sliding-window clustering anchored to first entry in each cluster
- Computes cluster_id (sha1[:12]), severity (highest wins), burst flag,
gap_before_seconds, representative_text (highest rank, longest text tiebreak)
- Builds TimelineResult with dominant_sources sorted by entry count descending
- Update pipeline.py stub to import TimelineReconstructor (Task 6 wiring prep)
- Add tests/test_diagnose_timeline.py: 15 tests covering all 13 required cases
plus null-timestamp edge case variant; all 318 tests passing
Closes: #29
18 lines
496 B
Python
18 lines
496 B
Python
"""Multi-agent diagnose pipeline orchestrator — stub (Task 1)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
from typing import Any
|
|
|
|
from app.services.diagnose.timeline import TimelineReconstructor
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
# run_pipeline() will be implemented in Task 6
|
|
logger.debug("TimelineReconstructor available: %s", TimelineReconstructor)
|
|
|
|
|
|
async def run_pipeline(*args: Any, **kwargs: Any) -> None:
|
|
"""Placeholder — implemented in Task 6."""
|
|
return None
|