"""Public new2041 drafts transport/keypoints/authenticated reads, no annotation POST."""
from pathlib import Path
import sys

PROJECT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(PROJECT));sys.path.insert(0,str(PROJECT/'scripts'))
from scripts import check_mask_model_requests_public as checks
from pallet.pose_review_geometry import canonical

if __name__=='__main__':
    checks.ROOT=PROJECT/'outputs/pallet_mask_annotation_update_requests_v2';checks.OUT=PROJECT/'outputs/pallet_mask_annotation_update_checks_v2/public_acceptance'
    checks.STATE=PROJECT/'outputs/pallet_mask_annotation_update_managed_v2/public_access.json';checks.REVIEWS=PROJECT/'outputs/pallet_mask_model_reviews_v5/mask_reviews.sqlite3'
    try:checks.main()
    except Exception as error:
        if checks.OUT.exists() and not (checks.OUT/'failure.json').exists():
            secret=(PROJECT/'outputs/pallet_pose_human_review_v1/access_key.txt').read_text().strip()
            (checks.OUT/'failure.json').write_bytes(canonical(dict(state='failed_new2041_public_transport',
                error=(type(error).__name__+': '+str(error)).replace(secret,'[redacted]'),production_annotation_POST_attempts=0))+b'\n')
        raise
