from pathlib import Path

from autoshorts.growth_plan import load_testbatch, validate_testbatch
from autoshorts.retention import score_idea_retention


def test_testbatch_002_pauses_faithtok_and_uses_three_non_religious_pillars():
    batch = load_testbatch(Path("data/drafts/testbatch_002.json"))

    summary = validate_testbatch(batch)

    assert summary["total_ideas"] == 9
    assert summary["pillars"] == {
        "ai_life_systems": 3,
        "attention_design": 3,
        "life_optimization": 3,
    }
    assert "faithtok" not in {idea["pillar"] for idea in batch["ideas"]}


def test_testbatch_002_meets_retention_threshold():
    batch = load_testbatch(Path("data/drafts/testbatch_002.json"))

    scores = [score_idea_retention(idea)["score"] for idea in batch["ideas"]]

    assert min(scores) >= 8
    assert sum(1 for idea in batch["ideas"] if idea["duration_seconds"] >= 60) == 3
