
    ]^j	                        d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ  ee          	                                j
        d         Zedz  Zedz  Zedz  Zedz  Zed	z  Zed
z  edz  edz  edz  gZd Zd Zedk    rS	  ej         e                       dS # e$ r0Z ede ej                    ej        d           Y dZ[dS dZ[ww xY wdS )    N)datetimetimezone)Path   zstory/story-canon.txtzstory/spoken-narration.txtzstory/draft-report.jsonzstory/originality-report.jsonzstory/promotion-report.jsonzscript/story-brief.jsonzscript/identity-registry.jsonzscript/reveal-ledger.jsonzscript/outline.jsonc                 r    t          j        |                                                                           S )N)hashlibsha256
read_bytes	hexdigest)paths    script/promote-story.pyshar      s(    >$//++,,66888    c                     t          j        t          j        t	          t
          dz            gd           t          j        t          j        t	          t
          dz            gd           t          j        t          	                    d                    } t          j        t          	                    d                    }t                                          t                                          k    rt          d          d t          D             }d	dd
dt	          t                              t
                              t#          t                    t	          t                              t
                              t#          t                    | d         | d         |t#          t                    |                    d          du t'          j        t*          j                                                  d}t0                              t          j        |dd          dz   d           t
          dz  }t          j        |	                    d                    }d|d<   |d         |d<   |d         |d<   |                    t          j        |dd          dz   d           t7          t          j        |d                     dS )Nzscript/validate-story.pyT)checkzscript/validate-originality.pyzutf-8)encodingzcanon/spoken bytes differc                 8    i | ]}|j         t          |          S  )namer   ).0r   s     r   
<dictcomp>zmain.<locals>.<dictcomp>   s"    <<<$CII<<<r   r   passed011
word_countchaptersverified)versionr   status
project_id
canon_pathcanon_sha256spoken_pathspoken_sha256r   r   authority_hashesoriginality_report_sha256originality_verifiedpromoted_atF   )ensure_asciiindent
zscript/project-manifest.jsonstory_promoted_ready_for_ttsr   r!   )r)   r   )
subprocessrunsys
executablestrPROJECTjsonloadsREPORT	read_textORIGINALITYCANONr
   SPOKENRuntimeError	AUTHORITYrelative_tor   getr   nowr   utc	isoformatOUT
write_textdumpsprint)reportoriginality	authorityreceiptmanifest_pathmanifests         r   mainrK      sT   NCNC2L(L$M$MNVZ[[[[NCNC2R(R$S$ST\`aaaaZ(('(::;;F*[22G2DDEEKV..00006777<<)<<<I$(%%++G4455s5zz6--g6677#f++\*z8J%CDTDT +
 ; ;t C|HL11;;== G NN4:gE!DDDtKV]N^^^<<Mz-1171CCDDH7HX&~6H^$\2H\TZuQOOORVVahiii	$*W5
1
1
12221r   __main__zPromotion blocked: )file)r   r3   r-   r/   r   r   pathlibr   __file__resolveparentsr2   r8   r9   r5   r7   rA   r;   r   rK   __name__exit	ExceptionexcrD   stderrr   r   r   <module>rW      s         



 ' ' ' ' ' ' ' '      
$x..
 
 
"
"
*1
-))	/	/	,	,77--00'<[2[]d  hC  ^C  EL  Od  Ed  e	9 9 9  8 z   )C))
;;;; s   ?B C%C		C