```python
"""planner.py - greedy selection of fictional campaign proposals."""


def _is_valid_int(value):
    return isinstance(value, int) and not isinstance(value, bool)


def plan(rows, budget_cents, excluded_channels=()):
    """Select rows in input order while they fit in the remaining budget.

    Each row is a mapping with a string "id" and a nonnegative integer
    "cost_cents". A row is selected if its cost is at most the remaining
    budget; otherwise it is skipped and later rows are still considered.

    excluded_channels is reserved for a later feature and currently has
    no effect.

    Returns a dict with selected_ids, spent_cents and remaining_cents.
    Neither rows nor excluded_channels are mutated.
    """
    if not _is_valid_int(budget_cents):
        raise ValueError("budget_cents must be an integer")
    if budget_cents < 0:
        raise ValueError("budget_cents must be nonnegative")

    remaining = budget_cents
    selected_ids = []

    for row in rows:
        cost = row["cost_cents"]
        if not _is_valid_int(cost) or cost < 0:
            raise ValueError("cost_cents must be a nonnegative integer")
        if cost <= remaining:
            selected_ids.append(row["id"])
            remaining -= cost

    return {
        "selected_ids": selected_ids,
        "spent_cents": budget_cents - remaining,
        "remaining_cents": remaining,
    }
```