"""Stages use distinct outputs; inference requires real completed new checkpoints."""
from pathlib import Path
import argparse
import sys

PROJECT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(PROJECT))
from pallet.mask_annotation_update_requests import stage,infer,contacts,build

if __name__=='__main__':
    p=argparse.ArgumentParser(description=__doc__);p.add_argument('stage',choices=('stage','infer','contacts','build'))
    p.add_argument('--attempt',help='Explicit new inference-attempt ID; previous timeout evidence stays untouched');a=p.parse_args()
    if a.stage=='infer':infer(a.attempt)
    else:
        if a.attempt:p.error('--attempt is only valid for inference')
        {'stage':stage,'contacts':contacts,'build':build}[a.stage]()
