//! Cross-surface memory types for chronicle, roadmap, criteria, and panels.
//!
//! Always compiled — not gated by `graphql` or `mcp` features. The
//! `SimpleObject` derive is conditional on `#[cfg(feature = "graphql")]` so
//! the types are available to every surface (HTTP, MCP, GraphQL) from a single
//! definition. This is the G-4 equivalence contract: one struct, four surfaces,
//! zero drift.

use serde::{Deserialize, Serialize};

/// One woven point on the retrospective chronicle timeline (ADR-051, component
/// B).
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "graphql", derive(async_graphql::SimpleObject))]
pub struct ChronicleEntry {
    pub id: String,
    pub date: String,
    pub kind: String,
    pub title: String,
    pub summary: Option<String>,
    pub domain: Option<String>,
    pub refs: Vec<String>,
}

/// A roadmap item composed from the backlog roadmap and positioning roadmap
/// (component B/G).
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "graphql", derive(async_graphql::SimpleObject))]
pub struct RoadmapItem {
    pub id: String,
    pub title: String,
    pub status: String,
    pub horizon: String,
    pub graduates_to: Option<String>,
    pub mechanism: Option<String>,
    pub target_date: Option<String>,
}

/// A criterion the project holds itself to, with typed provenance (ADR-049).
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "graphql", derive(async_graphql::SimpleObject))]
pub struct Criterion {
    pub id: String,
    pub description: String,
    pub kind: String,
    pub provenance: Option<String>,
    pub validator_ref: Option<String>,
    pub related_adr: Option<String>,
}

/// A resolved panel descriptor — identifying and dispatch fields of a Panel
/// (ADR-053).
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "graphql", derive(async_graphql::SimpleObject))]
pub struct PanelSpec {
    pub id: String,
    pub title: String,
    pub kind: String,
    pub data_source_op: String,
    pub surfaces: Vec<String>,
    pub actors: Vec<String>,
}
