scx_truther 0.5.1

A useless scheduler for sched-ext (rustland-core) that dispenses astrology, conspiracy theories, numerology, and cryptid sightings instead of scheduling anything
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2.

use log::info;

use crate::util::Rng;

pub const RUNES: [(&str, &str, &str); 24] = [
    (
        "",
        "Fehu",
        "Wealth. Your disk usage will only grow from here.",
    ),
    ("", "Uruz", "Strength. The monolith holds, for now."),
    (
        "",
        "Thurisaz",
        "A thorn. Something in your dependency tree will prick you.",
    ),
    (
        "",
        "Ansuz",
        "A message is coming. It will be a chat ping during your focus block.",
    ),
    (
        "",
        "Raidho",
        "A journey. Your PR is about to travel through four rounds of review.",
    ),
    (
        "",
        "Kenaz",
        "A torch. Someone finally understands the legacy code. Briefly.",
    ),
    (
        "",
        "Gebo",
        "A gift. An unsolicited refactor, delivered as a 2,000-line PR.",
    ),
    (
        "",
        "Wunjo",
        "Joy. The tests pass on the first run. Be suspicious.",
    ),
    (
        "",
        "Hagalaz",
        "Hail. A dependency bump breaks everything downstream.",
    ),
    (
        "",
        "Nauthiz",
        "Need. You need coffee. You will not get coffee.",
    ),
    (
        "",
        "Isa",
        "Ice. The deploy pipeline is frozen, as is your patience.",
    ),
    (
        "",
        "Jera",
        "A harvest. The sprint ends. Nothing was finished.",
    ),
    (
        "",
        "Eihwaz",
        "Endurance. The build has been running for eleven minutes.",
    ),
    (
        "",
        "Perthro",
        "Mystery. Nobody knows why it works. Nobody will ask.",
    ),
    (
        "",
        "Algiz",
        "Protection. Your branch protection rules save you from yourself.",
    ),
    (
        "",
        "Sowilo",
        "The sun. The dashboard is all green. For now.",
    ),
    (
        "",
        "Tiwaz",
        "Victory. You close the ticket before the retro.",
    ),
    (
        "",
        "Berkano",
        "Growth. The repository grows. So does the technical debt.",
    ),
    (
        "",
        "Ehwaz",
        "Movement. The migration finally runs, three quarters late.",
    ),
    (
        "",
        "Mannaz",
        "Humanity. Someone on the team remembers to write a comment.",
    ),
    (
        "",
        "Laguz",
        "Flow. The data pipeline works, and nobody knows why.",
    ),
    (
        "",
        "Ingwaz",
        "Completion. A feature ships. Users do not notice.",
    ),
    (
        "",
        "Dagaz",
        "Breakthrough. You finally find the off-by-one.",
    ),
    (
        "",
        "Othala",
        "Inheritance. You have inherited a codebase. May the gods help you.",
    ),
];

pub struct RuneCast {
    index: usize,
}

impl RuneCast {
    pub fn cast(rng: &mut Rng) -> Self {
        Self {
            index: (rng.next_u64() as usize) % RUNES.len(),
        }
    }

    pub fn index(&self) -> usize {
        self.index
    }

    pub fn log(&self) {
        let (symbol, name, meaning) = RUNES[self.index];
        info!("Rune cast: {symbol} {name}");
        info!("{meaning}");
    }
}