#![allow(dead_code)] // ARCHETYPES is read by the PersonaGrid widget landing in v0.2.

//! The 10 Kranth archetypes — slug, display label, signature glyph, canned
//! reaction.
//!
//! Slugs MUST match `brain/src/kranth_brain/prompts/voice/archetypes.json`.
//!
//! **Brand:** strictly monochrome per `project_kranth_brand.md`. Per-archetype
//! identity is carried by the *glyph* + *label* — not by colour. The only
//! colour that leaks into the cinema is sentiment-driven (aligned-green for
//! `reaction-positive`, plus mono variants), keeping us in the Linear /
//! ElevenLabs register.
//!
//! **Canned reactions** are 1-2 sentence quotes in each archetype's voice.
//! The cinema's standalone simulator uses these directly — when we wire the
//! live SDK, real model-generated reactions slot in here at the same shape.

// Each glyph is a frameless 10-char × 5-row emblem. Designed for legibility
// at a glance in the persona grid: one iconic shape per archetype, no shared
// "thing-in-a-box" template. Build rules:
//   1. Every row must be exactly 10 cells wide (so all 10 tiles align).
//   2. Use half-blocks (▄ ▀ █), shaded blocks (▒ ▓), and box-drawing.
//   3. Monochrome only — colour comes from the sentiment dot below the tile.
pub const ARCHETYPES: &[Archetype] = &[
    Archetype {
        slug: "skeptical_frugal",
        label: "Skeptical Frugal",
        // Clenched-fist coin: cent signs gripped, with squeeze marks below.
        glyph: &[
            "   ▄███▄  ",
            "  █ ¢¢¢ █ ",
            "  █ ─── █ ",
            "   ▀───▀  ",
            "    ╳ ╳   ",
        ],
        reaction: "$29/mo when there's open-source alternatives? Better moat than 'made in Rust', please.",
    },
    Archetype {
        slug: "early_adopter_technical",
        label: "Early Adopter / Tech",
        // Tiny terminal window with a prompt + blinking cursor.
        glyph: &[
            "  ╭──────╮",
            "  │$ kr ●│",
            "  │      │",
            "  │ ▌_   │",
            "  ╰──────╯",
        ],
        reaction: "Day-one user. Show me the LSP integration, the keybind story, the CLI flag surface.",
    },
    Archetype {
        slug: "enterprise_cautious",
        label: "Enterprise Cautious",
        // Corporate tower silhouette — heavy boundaries, ordered windows,
        // wide plinth. The "compliance fortress" silhouette.
        glyph: &[
            "   ╔═══╗  ",
            "   ║▪│▪║  ",
            "   ║▪│▪║  ",
            "   ║▪│▪║  ",
            "  ╚╧╧═╧╧╝ ",
        ],
        reaction: "Pre-launch checklist: SOC 2, SSO, 30-day eval, MSA. Without all four, procurement is a brick wall.",
    },
    Archetype {
        slug: "founder_just_shipping",
        label: "Founder Shipping",
        // Rocket mid-launch: pointed nose, solid body, flared exhaust.
        glyph: &[
            "     ▲    ",
            "    ╱█╲   ",
            "    ███   ",
            "   ╱███╲  ",
            "    ╲╳╱   ",
        ],
        reaction: "Charge $9. Validate. Raise to $29 once retention proves out. Ship before you tune.",
    },
    Archetype {
        slug: "marketer_brand_voice",
        label: "Marketer / Brand",
        // Megaphone projecting sound waves to the right — the brand-amp arc.
        glyph: &[
            "    ▄▄    ",
            "   ▐██) ) ",
            "  ▐███))) ",
            "   ▐██) ) ",
            "    ▀▀    ",
        ],
        reaction: "Lead with how it feels to use. Devs buy joy. Price reflects the relief, not the runtime.",
    },
    Archetype {
        slug: "compliance_officer",
        label: "Compliance Officer",
        // Magnifying glass with a focal dot inside + handle trailing down-right.
        glyph: &[
            "   ▄▄▄    ",
            "  █   █   ",
            "  █ • █   ",
            "   ▀█▀    ",
            "     ╲╲╲  ",
        ],
        reaction: "GDPR Article 30 docs? Where does logs / telemetry live? EU residency option from day one?",
    },
    Archetype {
        slug: "creator_audience_first",
        label: "Creator / Audience",
        // Microphone (grille + stand) over an audio-waveform peak — the
        // "broadcasting to a live crowd" emblem.
        glyph: &[
            "    ▄▄▄   ",
            "   ▐╳╳╳▌  ",
            "     │    ",
            "     │    ",
            "  ▁▃▆█▆▃▁ ",
        ],
        reaction: "Make it screenshot-bait. Devs share what makes them look smart for using.",
    },
    Archetype {
        slug: "data_analyst_show_me",
        label: "Data Analyst",
        // Ascending bar chart with a clear baseline — "show me the curve".
        glyph: &[
            "        █ ",
            "      ▆ █ ",
            "    ▄ █ █ ",
            "   ▂ █ █ █",
            "  ▔▔▔▔▔▔▔▔",
        ],
        reaction: "Activation curve at $9 vs $29? D7 retention by cohort? No decision without the chart.",
    },
    Archetype {
        slug: "designer_taste_first",
        label: "Designer / Taste",
        // Tight composition grid with a single intentional focal point —
        // the "everything in its place" emblem.
        glyph: &[
            "   ┌─┬─┐  ",
            "   │ │ │  ",
            "   ├─●─┤  ",
            "   │ │ │  ",
            "   └─┴─┘  ",
        ],
        reaction: "Pricing page is the product. If it shouts, you've lost the design-first buyer.",
    },
    Archetype {
        slug: "investor_pattern_match",
        label: "Investor / Pattern",
        // Trend line ending in an arrowhead, with discrete data points
        // along the slope. "Up and to the right."
        glyph: &[
            "         ▲",
            "       ╱· ",
            "     ╱·   ",
            "   ╱·     ",
            "  ▔▔▔▔▔▔▔ ",
        ],
        reaction: "Bottom-up devtool, $29 ACV — Linear circa 2020. Land if churn is <2% monthly, else pivot.",
    },
];

#[derive(Debug, Clone, Copy)]
pub struct Archetype {
    pub slug: &'static str,
    pub label: &'static str,
    pub glyph: &'static [&'static str],
    pub reaction: &'static str,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn ten_archetypes_match_brain_schema() {
        assert_eq!(ARCHETYPES.len(), 10);
    }

    #[test]
    fn slugs_are_unique() {
        let mut slugs: Vec<&str> = ARCHETYPES.iter().map(|a| a.slug).collect();
        slugs.sort();
        let before = slugs.len();
        slugs.dedup();
        assert_eq!(slugs.len(), before, "duplicate archetype slug");
    }

    #[test]
    fn every_glyph_is_five_rows() {
        for a in ARCHETYPES {
            assert_eq!(a.glyph.len(), 5, "{} glyph must be 5 rows", a.slug);
        }
    }

    #[test]
    fn every_archetype_has_a_readable_reaction() {
        for a in ARCHETYPES {
            assert!(
                a.reaction.len() >= 40,
                "{}: reaction too short to read as a 'tweet'",
                a.slug
            );
        }
    }
}
