"""Path helpers for generated final-report view artifacts."""
from __future__ import annotations

from pathlib import Path


def html_view_path(report_path: Path) -> Path:
    """Return the HTML sibling for a final-report Markdown or data path."""
    if report_path.name.endswith(".data.json"):
        stem = report_path.name.removesuffix(".data.json")
        return report_path.with_name(stem + ".html")
    return report_path.with_suffix(".html")


def user_responses_dir_for_report(report_path: Path) -> Path:
    """Return the sidecar directory used by the report's exported responses."""
    return report_path.parent.parent / "user-responses"


def team_state_path_for_report(report_path: Path, task_type: str, seq: str) -> Path:
    """Return the team-state sibling that records the run's usage windows."""
    return report_path.parent.parent / "state" / f"team-state-{task_type}-{seq}.json"
