"""Fail-closed backend authority boundary for strategy selection.

Until independent validation and explicit activation, no browser strategy may
be treated as an authorized live selection. Shadow states are diagnostics only.
"""
from pathlib import Path
from qualification_api_v2 import snapshot


def decision_snapshot(registry_path: Path):
    evidence = snapshot(registry_path)
    rows = evidence.get('strategies', [])
    return {
        'ok': evidence.get('ok', False),
        'authority': 'python-sqlite-v2',
        'mode': 'shadow-only',
        'live_activation_enabled': False,
        'active_rules': [],
        'candidate_count': len(rows),
        'shadow_status_counts': evidence.get('counts', {}),
        'registry_ready': evidence.get('ready', False),
        'reason': 'V2 qualification is not independently validated; browser-side four-rule promotions are not authorized',
    }
