from __future__ import annotations
from dataclasses import asdict
from .beta import ToyParams

def positivity_region(p: ToyParams):
    """
    For the toy slice, positivity is interpreted as the document's forward bounds:
      a1 > 0, a2 > 0, a1 + a2 > 0
    (Additional bounds can be added once full truncation parameters exist.)
    """
    margins = {
        "a1": p.a1,
        "a2": p.a2,
        "a1_plus_a2": p.a1 + p.a2,
    }
    min_margin = min(margins.values())
    region_nonempty = (min_margin > 0.0)
    return region_nonempty, float(min_margin), margins, asdict(p)
