File size: 676 Bytes
7ff7119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""PackageInsightsState — 5-perspective fan-out + synthesis."""

from __future__ import annotations

from operator import add
from typing import Annotated, TypedDict

from graph.states.pipeline_state import (
    PackageInsights,
    ProcessedDocument,
)


class PackageInsightsState(TypedDict, total=False):
    """The package_insights_graph state."""

    documents: list[ProcessedDocument]
    package_type: str  # audit | dd | compliance | general

    # Per-perspective fan-out outputs (appended via reducer)
    perspectives: Annotated[list[dict], add]
    """[{perspective: str, summary: str, findings: list[str]}, ...]"""

    final_insights: PackageInsights | None