
    E`j                     8   d dl Z d dlZd dlZd dlmZ  ee                                          j        d         Zedz  Z	edz  Z
edz  Zd Zd Zd	 Zed
k    rA	  e e                      # e$ r%Z ede ej                    ed          dZ[ww xY wdS )    N)Path   z#script/workflow-copy-authority.jsonzaudio/intro-voice-source.txtzimage/image-brief.jsonc                 N    t          j        |                                           S N)hashlibsha256	hexdigest)datas     script/validate-workflow-copy.py	sha_bytesr      s    >$))+++    c                 R    t          j        |                     d                    S )Nutf-8encoding)jsonloads	read_text)paths    r   loadr      s     :dnngn66777r   c                  6   t          t          j                  dk    rt          j        d         nd} | dvrt          d          t	          t
                    }|                    di           }|                    di           }|                    d          }|                    d          }g }|                    d	          d
k    r|                    d           t          |t                    rN|
                    d          r9|                    d          t          |                    d                    k    r|                    d           t          |t                    r,t          |          dk    st          d |D                       s|                    d           n8|                    d          d |D             k    r|                    d           t                                          rt                              d          |k    r|                    d           t$                                          s|                    d           nt	          t$                    }|                    di                               di                               d          }||k    r|                    d           |                    d          t          t
                                                    k    r|                    d           | dk    rdD ]}	t(          |	z  }
|
                                s|                    d |	z              9t	          |
          }|                    d          t          t
                                                    k    r|                    d!|	z              | | t          t
                                                    |d"}t+          t-          j        |d#$                     |sd%ndS )&Nr   pre-provider>   fullr   z!mode must be pre-provider or fullspoken_intro
left_panel
exact_textordered_text_blocksapproval_statelockedauthority_not_locked
r   r   intro_authority_invalid   c              3   D   K   | ]}t          |t                    o|V  d S r   )
isinstancestr.0xs     r   	<genexpr>zmain.<locals>.<genexpr>#   s4      BlBl`a:aQTCUCUC[Z[BlBlBlBlBlBlr   left_panel_authority_invalidblock_sha256c                 R    g | ]$}t          |                    d                     %S )r   )r   encoder'   s     r   
<listcomp>zmain.<locals>.<listcomp>%   s,    %S%S%Sqi0A0A&B&B%S%S%Sr   "left_panel_authority_hash_mismatchr   intro_source_driftimage_brief_missingassetsrequired_textleft_panel_brief_driftworkflow_copy_authority_sha256.image_brief_authority_binding_missing_or_staler   )z log/intro-tts-pronunciation.jsonzlog/intro-voice.jsonzlog/image-generation.jsonzlog/image-visual-qa.jsonzimage/layout-manifest.jsonzmissing_receipt:z+receipt_authority_binding_missing_or_stale:)verifiedmoder6   issuesF)ensure_asciir   )lensysargvRuntimeErrorr   	AUTHORITYgetappendr%   r&   endswithr   r.   listallINTRO_SOURCEis_filer   IMAGE_BRIEF
read_bytesPROJECTprintr   dumps)r9   	authorityintroleft
intro_textblocksr:   briefactualrelr   rowresults                r   mainrW      s   ch--!++38A;;D+++>???YIMM."--E==r**D<((JXX+,,FF}}%&&(22,---j#&& 1j.A.A$.G.G 1599U]K^K^bklvl}l}  F  mG  mG  cH  cH  LH  LH/000fd## <s6{{a'7'7sBlBlekBlBlBl?l?l'745555	.	!	!%S%SF%S%S%S	S	S:;;;!! ,\%;%;W%;%M%MQ[%[%[*+++   L+,,,,[!!8R((,,\2>>BB?SSVMM233399566)IDXDXDZDZ:[:[[[MMJKKKv~~ g 	S 	SCS=D<<>> 036777t**Cww788IiFZFZF\F\<]<]]]KcQRRR$*dV_`i`t`t`v`vVwVw  DJ  K  KF	$*V%
0
0
0111!11!r   __main__z"Workflow copy validation blocked: )file)r   r   r=   pathlibr   __file__resolveparentsrJ   r@   rF   rH   r   r   rW   __name__
SystemExit	ExceptionexcrK   stderr r   r   <module>rd      s     



      
$x..
 
 
"
"
*1
-;;	7700, , ,8 8 8(" (" ("V zj      8388szJJJJjmm s   A- -B2 BB