turnstone/app/services/diagnose
pyr0ball 5da8db2bcd fix(diagnose): pass full timeline clusters and hypothesis descriptions to synthesizer LLM
Stage 5 (SummarySynthesizer) was only sending aggregate timeline stats to the
LLM (cluster count, burst count, gap count) — the actual sequenced cluster data
that Stage 1 reconstructed was never included. The LLM had no per-cluster
timestamps, severity, burst flags, silence gaps, or representative text to
write the TIMELINE section from.

Added _build_timeline_block() to emit a numbered per-cluster summary matching
the format Stage 3 uses for the hypothesizer, and included it in the user
message alongside the hypothesis block.

Also fixed _build_hypothesis_block() to include the 2-4 sentence description
each hypothesis carries — previously only the title and novelty score reached
the LLM.

11 new tests cover _build_timeline_block() directly (burst label, gap threshold,
pattern tags, text truncation at 200 chars, null start_iso, multi-cluster
numbering). 529 tests passing.
2026-06-16 21:46:01 -07:00
..
__init__.py Merge feat/32-domain-view: domain-view mapping for patterns and diagnose output (#32) 2026-06-01 20:01:19 -07:00
_llm_client.py fix: strip reasoning-model thinking tags; surface untracked node names 2026-06-16 09:42:44 -07:00
classifier.py feat(classifier): add Hybrid-BERT label mapping shim (#41) 2026-06-01 16:20:31 -07:00
hypothesizer.py fix(diagnose): add max_tokens to all LLM calls; fix reasoning card contrast 2026-05-27 22:23:36 -07:00
legacy.py fix: frozen dataclasses, clean __all__, improve exception logging in diagnose package 2026-05-25 12:31:07 -07:00
models.py refactor: pipeline cleanup — 6 follow-up fixes (#33-#38) 2026-05-25 19:05:56 -07:00
pipeline.py fix: split incidents tables to dedicated turnstone-incidents.db (#60) 2026-06-01 15:54:23 -07:00
suppressor.py fix: split incidents tables to dedicated turnstone-incidents.db (#60) 2026-06-01 15:54:23 -07:00
synthesizer.py fix(diagnose): pass full timeline clusters and hypothesis descriptions to synthesizer LLM 2026-06-16 21:46:01 -07:00
timeline.py refactor: split TimelineReconstructor.reconstruct into helpers, fix magic number + error handling 2026-05-25 13:22:18 -07:00