
    Wj                        d Z ddlmZ ddlZddlZddlZddlZddlmZ  ee	      j                  Z ed      ZdZdZdZdd	Zdd
ZddZddZedk(  r e e             y)zMIndependent static/evidence verifier for the Task 26 reset controller bundle.    )annotationsN)Pathz)/home/cube/.hermes/profiles/dualcoachtest@2e0894eac92bc396cc4723bf1f18ebc653b95018dd41574df435941c235da925@af4a9d0a1ffffb6eb7551c1d6dc2b32853ca6d024332a4f8f5702bbf992f141b@7ace03c6dad33d2fc3ef223621cbca68a150fde8429932138e252fb8498ac582c                d    t        j                  | j                               j                         S N)hashlibsha256
read_bytes	hexdigest)paths    G.omo/evidence/task26/reset-controller-st_01a0054d/independent_verify.pyshar      s!    >>$//+,6688    c                V    t        j                  t        | z  j                               S r	   )jsonloadsHERE	read_text)names    r   loadr      s    ::td{--/00r   c                    | st        |      y r	   )RuntimeError)	conditionmessages     r   checkr      s    7## r   c                     t         dz  } t         dz  }t         dz  }t         dz  }t         dz  }t         dz  }| |||||fD ]  }|j                         }t        t        j                  |j
                        xr2 |j                  dk(  xr! |j                  t        j                         k(  d|j                          t        t        j                  |j
                        d	v d
|j                           t        d      }t        d      }	t        d      }
t        d      }t        d      }t        t        |t              xr |j                  d      dk(  d       t!        |d         }dD ]  }t        ||v d|         t        d|d   v d       t        d|d   v d       t        |	ddt"        t$        t&        t)        |       t)        |      ddk(  d       t        t        |
t              xr |
j                  d      dk(  d       t        |
j                  d      g dk(  d        t        |
j                  d!      |
j                  d"      cxk(  xr d#k(  nc d$       |
d%   D ]T  }t         d&z  |d'   z  }t        |j                         j*                  |d(   k(  xr t)        |      |d)   k(  d*|d'           V t,        d+z  }t         d,z  }t        t)        |      t)        |      k(  d-       | j/                         }d.D ]  }t        ||v d/|         t        |d0d1d2d3d#d4d#d#d5k(  d6       t        t        |t              xr* |j                  d7      d8k(  xr |j                  d9      d#k(  d:       t        |d;   d'   d<k(  xr |d;   d=   d>k(  d?       d@d1t)        |       t)        |      t)        |      t)        |      t)        |      t)        |      t"        t$        t&        dddAdBdC}t1        t3        j4                  |ddDE             y#)FNzreset_controller.pyzschema-contract.jsonzpermission-receipt.jsonzfixture-manifest.jsonztest-receipt.jsonzlive-dry-run.json   zunsafe evidence file: >       znonprivate evidence file: schemaz task26-profile-reset-contract-v1zcontract schemaapproved_clear_scopes)	customerszcron/jobs.jsonsessionszdata/onboardingzdata/owner-actionszdata/customerszmissing approved scope: zrehearsal-reset-archivesprotected_data_rootsz%historical archives are not protectedzprofile-reset-archivesz reset archives are not protectedz"task26-profile-reset-permission-v1+TASK26_ARCHIVE_FIRST_PROFILE_RESET_APPROVEDT)r"   approvalcandidate_digestwheel_sha256plan_sha256controller_sha256contract_sha256execute_allowedzpermission seal mismatchbootstrap_session_count   zfixture bootstrap countbootstrap_states)EXPIREDr2   r2   zfixture terminal statesbootstrap_claim_countbootstrap_recovery_countr   zfixture has authorityentrieszfixtures/current-empty-profiler   sizer   zfixture mismatch: z:data/onboarding/telegram-customer-bootstrap-v1/ledger.jsonzYfixtures/current-empty-profile/data/onboarding/telegram-customer-bootstrap-v1/ledger.jsonz/live bootstrap ledger drifted from byte fixture)	
O_NOFOLLOWzos.fstatzst_nlink != 1atomic_writeprior_archivesz	rollback(bootstrap_ledger_coveredrestore_or_prepopulatezunknown data authority rootz$controller safety mechanism absent: z$task26-profile-reset-test-receipt-v1PASSzhpytest -q -p no:cacheprovider .omo/evidence/task26/reset-controller-st_01a0054d/test_reset_controller.py	   gףp=
?)r"   statuscommandpassedfailedduration_secondsnetwork_actionslive_mutationsztest receiptr>   FAIL_CLOSED	mutationszlive dry-run receiptblockerz.clean_shutdownobserved_mode0664zlive blockerz8task26-profile-reset-independent-verification-receipt-v1Fz).clean_shutdown mode 0664 (required 0600))r"   r>   r,   r-   permission_receipt_sha256fixture_manifest_sha256test_receipt_sha256live_dry_run_receipt_sha256r)   r*   r+   0bootstrap_ledger_covered_by_contract_and_fixture(historical_archives_protected_and_hashedready_for_live_resetlive_blocker),:)	sort_keys
separators)r   lstatr   statS_ISREGst_modest_nlinkst_uidosgetuidr   S_IMODEr   
isinstancedictgetset	CANDIDATEWHEELPLANr   st_sizeLIVEr   printr   dumps)
controllercontract_pathpermission_pathfixture_path
tests_pathdry_pathr   infocontract
permissionfixturetestsdryapprovedscoperowlive_ledgerfixture_ledgersourcetokenreceipts                        r   mainr~      s7   --J11M66O11L++J))H]O\:W_`zz|dll4<<(^T]]a-?^DKKSUS\S\S^D^bxy}  zC  zC  yD  aE  	Fdll4<<(N:>XY]YbYbXc<de a *+H/0J*+G$%E
"
#C	*Xt
$
eh)?Ce)egxy8345Hwex#;E7!CD x	
$1G(H
HJqr	
"h/E&F
FHjk	*#G  VC-6^b.1*oRUVcRdy}  %& 
*Wd
#
S4M(NRS(SUno	'++(
)-N
NPij	'++-
.'++>X2Y
^]^
^`wxy!66VDdiik!!S[0OSY#h-5OSefijpfqerQst " UUKwwN	#k
c.1
13de!!#Fgevo!EeWMNg 
%DPV  J1$[\pqs s uCD 
*S$

dCGGH$5$F
d377S^K_cdKdf|}	#i.
 $5
5
c#i.:Y]c:cestS_e$'
OMHZ,/,@]`am]n&)*oVYZbVc#,eTXCGuy',>ikG 
$**W
DEr   __main__)r   r   returnstr)r   r   r   object)r   boolr   r   r   None)r   int)__doc__
__future__r   r
   r   r\   rW   pathlibr   __file__parentr   rg   rc   rd   re   r   r   r   r~   __name__
SystemExit r   r   <module>r      st    S "   	  H~78N	JI91$
4n z
TV
 r   