
    I`j                         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ed	k    r e e                      dS )
    N)Path   #script/workflow-copy-authority.jsonaudio/intro-voice-source.txtz&log/workflow-copy-materialization.jsonc                 N    t          j        |                                           S )N)hashlibsha256	hexdigest)datas    #script/materialize-workflow-copy.pyshar      s    >$))+++    c            	         t          j        t                              d                    } |                     di                               d          }|                     d          dk    s*t          |t                    r|                    d          st          d          |	                    d          }| d                             d	          t          |          k    rt          d
          t          j                            dd           t                              t          j        dz             }|                    |           t#          j        |t                     dt                                          |k    dt          t                                                    dt          t                                                    d}t(                              t(          j        dz             }|                    t          j        |dd          dz   d           t#          j        |t(                     t/          t          j        |d                     |d         rdndS )Nzutf-8)encodingspoken_intro
exact_textapproval_statelocked
z)locked workflow-copy authority is invalidr	   z$spoken intro authority hash mismatchT)parentsexist_okz.partr   r   r   )versionverifiedworkflow_copy_authority_pathworkflow_copy_authority_sha256intro_source_pathintro_source_sha256F   )ensure_asciiindent)r   r   r   )jsonloads	AUTHORITY	read_textget
isinstancestrendswithRuntimeErrorencoder   INTRO_SOURCEparentmkdir	with_namenamewrite_bytesosreplace
read_bytesRECEIPT
write_textdumpsprint)	authoritytextr   tempreceipts        r   mainr<      s   
9...@@AAI==,,00>>D}}%&&(22*T3:O:O2W[WdWdeiWjWj2FGGG;;wD $$X..#d));;ABBBdT:::!!,"3g"=>>DTJt\""" ++--5(M*-i.B.B.D.D*E*E;"<#:#:#<#<== G W\G344DOODJwU1EEELW^O___JtW	$*W5
1
1
1222
#*11*r   __main__)r   r!   r1   pathlibr   __file__resolver   PROJECTr#   r+   r4   r   r<   __name__
SystemExit r   r   <module>rE      s      				      
$x..
 
 
"
"
*1
-;;	77
<
<, , ,+ + +6 z
*TTVV

 r   