+
    5mj"  c                     ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIHt ^ RIt]P                   P#                  ^ ]! ]! ]4      P)                  4       P*                  ^,          4      4       ^ RIt^ RIHtHtHtHtHtHtHtHtHtH t H!t! R R lt"R R lt#R	 R
 lt$R R lt%R R lt&R R lt'R R lt(R R lt)R R lt*R R lt+R R lt,R R lt-R# )    )annotationsN)Path)ACCOUNT_LOCK_EXIT_CODEAccountLockedErrorAccountLockStateErrorAccountLockStoreHumanOverrideErrorHumanSessionVerdictauthorize_account_useclassify_human_sessionconfirm_human_actionconfirmation_phraserevalidate_account_usec                    V ^8  d   QhRRRR/#    tmp_pathr   returnNone )formats   "b/home/user/overdeck-private-tests/workstation-ai-broad2/modules/systray/tests/test_account_lock.py__annotate__r      s       RV     c                   \        V 4      pVP                  q"! 4       p\        4       qCV8H  qU'       Eg3   \        P                  ! R)V3R*W434      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;rTVP                  pRpRpRqB! W5V4      pRqV	J q'       Eg   \        P                  ! R+V
3R,W34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;p;rVP                  pRpRpRqB! W5V4      pRqV	J q'       Eg   \        P                  ! R+V
3R,W34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;p;rVP                  pRpRpRqB! W5V4      pRqV	J q'       Eg   \        P                  ! R+V
3R,W34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;p;rVP                  q"! 4       pRR0p\        V4      qV8H  qU'       EgI   \        P                  ! R)V3R-W834      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R	\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p;p;rHVP                  pRq2! V4      pR0p\        V4      qV
8H  qD'       Eg_   \        P                  ! R)V3R.WZ34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR	\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;rVP                  pRq2! V4      pR0p\        V4      qV
8H  qD'       Eg_   \        P                  ! R)V3R.WZ34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR	\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;r\        P                  q!P                  qP                  pV! 4       pVP                   pV! V4      p	RpV	V8H  pV'       Eg   \        P                  ! R)V3R/V	V34      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V	4      R \        P                  ! V4      /	,          pR!R"V/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;p;p	;pp\"        P$                  q!P                  qP&                  pR#pV! VR$7      pV! V4      p	R%R&R'RR./pV	V8H  pV'       Eg   \        P                  ! R)V3R0V	V34      RR(\
        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MR(R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V	4      R \        P                  ! V4      /	,          pR!R"V/,          p\        \        P                  ! V4      4      hR
;p;p;p;p;p;p	;ppR
# )1==py0storepy2py4py6	frozensetpy8assert %(py10)spy10NcodexworkTpy13assert %(py15)spy15claudeF
codex:workzclaude:workassert %(py12)spy12zassert %(py14)spy14  statpy3py5py7py9py11py16assert %(py18)spy18utf-8encodingversionaccount-lock/v1lockedjsonr   za%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.locked_keys
}()
} == %(py8)s
{%(py8)s = %(py6)s()
}is)ze%(py10)s
{%(py10)s = %(py2)s
{%(py2)s = %(py0)s.set_locked
}(%(py4)s, %(py6)s, %(py8)s)
} is %(py13)szj%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.locked_keys
}()
} == %(py10)s
{%(py10)s = %(py6)s(%(py8)s)
})zs%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.locked_slugs
}(%(py4)s)
} == %(py12)s
{%(py12)s = %(py8)s(%(py10)s)
})z%(py13)s
{%(py13)s = %(py2)s
{%(py2)s = %(py0)s.S_IMODE
}(%(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.path
}.stat
}()
}.st_mode
})
} == %(py16)s)z%(py13)s
{%(py13)s = %(py2)s
{%(py2)s = %(py0)s.loads
}(%(py11)s
{%(py11)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.path
}.read_text
}(encoding=%(py9)s)
})
} == %(py16)s)r   locked_keysr!   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation
set_lockedlocked_slugsr0   S_IMODEpathst_moder?   loads	read_text)r   r   @py_assert1@py_assert3@py_assert7@py_assert5@py_format9@py_format11@py_assert9@py_assert12@py_assert11@py_format14@py_format16@py_format13@py_format15@py_assert4@py_assert6@py_assert8@py_assert10@py_assert15@py_assert14@py_format17@py_format19s   &                      r   :test_store_round_trips_tool_scoped_locks_with_private_moderj      sG   X&E--)+-+-----------5----5------------)----)---+--------:G:V:T:GT2:d:d:::::2::::::5::::5::::::G:::V:::T:::2:::d:::::::::;H;f;d;Hd3;t;t;;;;;3;;;;;;5;;;;5;;;;;;H;;;f;;;d;;;3;;;t;;;;;;;;;;G;V;T;GT2;e;e;;;;;2;;;;;;5;;;;5;;;;;;G;;;V;;;T;;;2;;;e;;;;;;;;;JJ\=,IJ),I"JJ"JJJJJJJJJJJJ5JJJJ5JJJJJJJJJJJJ)JJJJ)JJJ,IJJJ"JJJJJJJJJ=g=g&=VH=)H*==*======&======5====5======g===&======)====)===H===*==========>h>h'>fX>9X+>>+>>>>>>'>>>>>>5>>>>5>>>>>>h>>>'>>>>>>9>>>>9>>>X>>>+>>>>>>>>>><<;

;;);)11;<12;e;2e;;;;;2e;;;;;;4;;;;4;;;<;;;;;;;;;;;;;
;;;;;;);;;1;;;2;;;e;;;;;;;;;:: jj ** G *G< :<= $=,/B = B    = B     4   4   :     e   e   j   *   G   <   =    B         r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   0   s      4 TX r   c                	  a aa \         P                  ! ^4      o. oR VVV 3R llp\         P                  ! VRR7      p\         P                  ! VRR7      pVP                  4        VP                  4        SP	                  ^R7       VP                  ^R7       VP                  ^R7       VP                  qD! 4       qU'       * qf'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR
;p;rVVP                  qD! 4       qU'       * qf'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR
;p;rV. pSV8H  qD'       g   \        P                  ! RV3RSV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          p	RRV	/,          p\        \        P                  ! V4      4      hR
;rH\        S 4      qP                   q! 4       pRR0p\#        V4      qV8H  q'       Eg   \        P                  ! RV3R W34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! S 4      '       d   \        P                  ! S 4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p
;p;p;rR
# )!   c               $    V ^8  d   QhRRRRRR/# )r   toolstrslugr   r   r   )r   s   "r   r   Rtest_store_serializes_concurrent_updates_without_losing_keys.<locals>.__annotate__4   s!     ! !3 !c !d !r   c                   <  SP                  ^R7       \        S4      P                  WR4       R#   \         d   pSP	                  T4        Rp?R# Rp?ii ; i)   timeoutTN)waitr   rN   BaseExceptionappend)ro   rq   excbarrierfailuresr   s   && r   lockJtest_store_serializes_concurrent_updates_without_losing_keys.<locals>.lock4   sJ    	!LLL#X&11$dC 	!OOC  	!s   -2 AAA)targetargsru   zGassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.is_alive
}()
}r   firstr   r   Nsecondr|   r1   assert %(py5)sr2   zcodex:ownerzclaude:agentr   py1r   r3   r4   r!   r5   r'   r(   r)   )r%   owner)r*   agentr@   z%(py0)s == %(py3)s)z%(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}.locked_keys
}()
} == %(py13)s
{%(py13)s = %(py9)s(%(py11)s)
})	threadingBarrierThreadstartrw   joinis_aliverH   rI   rF   rJ   rK   rL   rM   rG   r   rE   r!   )r   r}   r   r   rU   rV   rX   @py_format6@py_assert2@py_format4rb   rc   re   r\   rd   r^   r_   r{   r|   s   f                @@r   <test_store_serializes_concurrent_updates_without_losing_keysr   0   sX   "G$&H! ! D/ABET0CDF	KKM
LLNLLL	JJqJ
KKK~~~uu~            v    v             8r>8r88rH% 11 13 	'y'8  8    3             H   H   %   1   3     y   y   '   8        r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   K   s     . . . .r   c                   \        V 4      pVP                  R RR4       VP                  pR pRpRqR! W4V4      pRqvVJ q'       Eg   \        P                  ! RV3RWg34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;p;p;p;rVP                  pR pRqB! W44      pRqVJ qf'       Eg	   \        P                  ! RV3RW[34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;p;p;rkVP                  pR pRqB! W44      pRqVJ qf'       Eg	   \        P                  ! RV3RW[34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;p;p;rkVP                  pR pRqB! W44      pRqVJ qf'       Eg	   \        P                  ! RV3RW[34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R	\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;p;p;rkVP                  q"! 4       p\        4       qSV8H  qD'       Eg3   \        P                  ! RV3RW534      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR	\        P                  ! V4      /,          pRR
V/,          p\        \        P                  ! V4      4      hR;p;p;rER# )r%   oldTnewr   r   r   r   r    r"   r$   r'   r(   r)   NFr5   assert %(py13)sr!   r#   rB   )z`%(py10)s
{%(py10)s = %(py2)s
{%(py2)s = %(py0)s.rekey
}(%(py4)s, %(py6)s, %(py8)s)
} is %(py13)szY%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.is_locked
}(%(py4)s, %(py6)s)
} is %(py11)s)zT%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.drop
}(%(py4)s, %(py6)s)
} is %(py11)sr@   rA   )r   rN   rekeyrF   rG   rH   rI   rJ   rK   rL   rM   	is_lockeddroprE   r!   )r   r   rU   rV   rX   rW   r[   r\   r]   r^   r_   re   @py_format12rY   rZ   s   &              r   !test_store_rekeys_and_drops_locksr   K   s   X&E	WeT*;;5w55u5;wu-5555555-555555555555555;555w555555u555-555555555555??373E3?7*3e3e33333*333333533335333?3337333E333*333e333333333??272E2?7*2d2d22222*222222522225222?2227222E222*222d222222222::-g-u-:g%-------%------5----5---:---g---u---%--------------)+-+-----------5----5------------)----)---+--------r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   V   s      O OO	Or   c                8   \        V 4      pVP                  R RR4       RRRR/pVP                  R RR4       VP                  RRR4       VP                  q3! V4      pRqTVJ qf'       Eg+   \        P
                  ! RV3RWE34      R	R
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;reVP                  q3! 4       p	RR0p\        V4      qV
8H  q'       EgI   \        P
                  ! RV3RW34      R	R
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
R\        P                  ! V4      R\        P                  ! V	4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p	;p;rZR# )r%   r   Tz	codex:oldz	codex:newFr   r*   	unrelatedr   r   r   r1   snapshotr2   r"   r#   r$   Nzclaude:unrelatedr   r    r!   r,   r-   rB   )zX%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.restore_key_states
}(%(py3)s)
} is %(py8)sr@   rD   )r   rN   r   restore_key_statesrF   rG   rH   rI   rJ   rK   rL   rM   rE   r!   )r   r   r   rU   rb   rW   rc   rY   rZ   rV   r[   rX   r`   s   &            r   >test_restore_key_states_preserves_unrelated_concurrent_updatesr   V   s    X&E	WeT*T;6H	KK&	X{D1##5#H-5555555-555555555555555#555555H5555H555-55555555555NN[:L,MN),M"NN"NNNNNNNNNNNN5NNNN5NNNNNNNNNNNN)NNNN)NNN,MNNN"NNNNNNNNNNr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   d   s      4 D r   c                :   \        V 4      pVP                  P                  R RR7       \        P                  ! \
        RR7      ;_uu_ 4        VP                  4        RRR4       VP                  P                  \        P                  ! RRRR	./4      RR7       VP                  P                  R
4       \        P                  ! \
        RR7      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z{"version":"wrong","locked":[]}r9   r:   zversion must bematchNr<   r=   r>   r+   i  zgroup/world writable)
r   rQ   
write_textpytestraisesr   rE   r?   dumpschmod)r   r   s   & r   ,test_store_rejects_malformed_or_unsafe_stater   d   s    X&E	JJ;gN	,4E	F	F 
G 
JJ

I0(\NKL   
JJU	,4J	K	K 
L	K 
G	F 
L	K	Ks   C6D	6D		D	c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   s   s     
 
t 
 
r   c                \   V R ,          pVP                  \        P                  ! RRR. /4      RR7       \        V 4      pVP                  P                  V4       \        P                  ! \        RR7      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     R# ; i)	ztarget.jsonr<   r=   r>   r9   r:   zmust not be a symlinkr   N)
r   r?   r   r   rQ   
symlink_tor   r   r   rE   )r   r   r   s   &  r    test_store_rejects_symlink_stater   s   s    %F


I0(B?@   X&E	JJ&!	,4K	L	L 
M	L	L	Ls   ?BB+	c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r      s     . . .r   c                 &   Rp RpRp\        V VVR7      pRpRp\        WE4      qcV8H  qw'       Eg   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      RR\        P
                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /	,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p ;p;p;p;p;p;rVRp RpRp\        V VVR7      q3P                  pRqV
J qD'       Eg(   \        P                  ! RV3RVV
34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;p;rJRp RpRp\        V VVR7      q3P                  pRqV
J qD'       Eg(   \        P                  ! RV3RVV
34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;p;rJR p RpRp\        WVR7      q3P                  pRqV
J qD'       Eg(   \        P                  ! RV3RVV
34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;p;rJR p RpRp\        WVR7      pRpRp\        WE4      qcV8H  qw'       Eg   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      RR\        P
                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /	,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p ;p;p;p;p;p;rVR p RpRp\        WVR7      pRpRp\        WE4      qcV8H  qw'       Eg   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      RR\        P
                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /	,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p ;p;p;p;p;p;rVR# )!/user.slice/human.sliceTN)controlling_ttycontainer_signalFz$agent-cgroup:/user.slice/agent.slicer   r   r   r   r    r"   r$   r	   r-   r.   r6   r7   r8   r'   r(   r)   zfile:/.dockerenvcontrolling-ttyzno-tty)r   z/user.slice/agent.slicer@   )z%(py8)s
{%(py8)s = %(py0)s(%(py2)s, controlling_tty=%(py4)s, container_signal=%(py6)s)
} == %(py16)s
{%(py16)s = %(py10)s(%(py12)s, %(py14)s)
})z/user.slice/app-Dispatch.scoper   rB   )z%(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py0)s(%(py2)s, controlling_tty=%(py4)s, container_signal=%(py6)s)
}.human
} is %(py13)s)r   r   )r   r	   rF   rG   rH   rI   rJ   rK   rL   rM   human)rU   rV   rX   rW   r]   @py_assert13rf   r[   rh   ri   r\   r^   r_   s                r   ?test_human_session_classifier_is_agent_decisive_and_fail_closedr      s1
   >LL L!> L #	L %K	L 
U	K	L 
L	L L L ;L:K	L  
L	L L FLV	L L 4L3K	L! L L CL)	L! L L CL)	L>L L CL)	LL L CL)	L L L CL)	L  L L FLV	L L 4L3K	L 
	L L CL)	L 
	L L CL)	L #	L L CL)	L %K	L L CL)	L 
L	L L L L L 9L8K	L L L L 	F !E  e	 	 	   	  	  f	  	!   9	!   9	E  9	  9	   9	    9	    9	 	     	   	% !$  e	 	 	   	  	  V	  	!   )	!   )	$  )	  )	   )	    )	    )	 	      	   	 3E!
3E e    f  !  9!  9
 9  93E 9   9   9       	6 6376!
4 6!6#46	T	56	56 6 6$5$56 	56 6/5v6 6556! 6 6,5I6! 6 6,5I6
6 6,5I6 6 6,5I6376 6,5I6  6 6/5v6 6556	6 6,5I6	6 6,5I6!6 6,5I6#46 6,5I6	56 6 6 6 6"5"56 6 6 6 	.!.48.!
D .".$,.	U	-.	-. . .--. 	-. .'-v. .--.! . .$-I.! . .$-I.
. .$-I.!. .$-I.48. .$-I.  . .'-v. .--.	. .$-I.	. .$-I.". .$-I.$,. .$-I.	-. . . . .--. . . .r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s      
  
t  
r   c                 ~  a . o\        R RRR V3R lR7       Rp RpRp\        WV4      pR	qCV8H  qU'       Eg   \        P                  ! R V3R!VV34      R
R\        P
                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;rTR.pSV8H  q '       g   \        P                  ! R V 3R"SV34      R
R\        P
                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;r\        P                  ! \        RR7      ;_uu_ 4        \        R RRR R R7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        \        R RRR R R7       RRR4       R#   + '       g   i     LQ; i  + '       g   i     R# ; i)#unlockr%   r&   c                     \        R R4      # Tr   r	   r   r   r   <lambda>?test_human_confirmation_requires_exact_phrase.<locals>.<lambda>   s    1$8IJr   c                :   < SP                  V 4      ;'       g    R # )zUNLOCK codex:work
ry   )promptpromptss   &r   r   r      s    7>>&+A+Z+ZEZ+Zr   )session_probeconfirmation_readeruse-oncer*   personalzUSE claude:personal ONCEr   r   r   r   r    r"   r5   r   r'   Nz%Type 'UNLOCK codex:work' to confirm: r   r1   r   r2   zdid not matchr   c                     \        R R4      # r   r   r   r   r   r   r      s    "5d<M"Nr   c                    R # )zunlock codex:workr   _prompts   &r   r   r      s    0Cr   zrequires a human terminalc                     \        R R4      # )Fzagent-cgroup:/agent.slicer   r   r   r   r   r      s    "5e=X"Yr   c                .    \         P                  ! R 4      # )zmust not prompt an agent)r   failr   s   &r   r   r      s    <V0Wr   r@   )zC%(py8)s
{%(py8)s = %(py0)s(%(py2)s, %(py4)s, %(py6)s)
} == %(py11)sr   )r   r   rF   rG   rH   rI   rJ   rK   rL   rM   r   r   r   )rU   rV   rX   rW   re   r[   r   r^   r   r   r   r   s              @r   -test_human_confirmation_requires_exact_phraser      s%   GJZ  * 8 Z zZ@ ""   @"          z   8   Z   @   "        ???7??????7???????7????7????????????	)	A	AN C	
 
B 
)1L	M	MY W	
 
N	M 
B	A 
N	M	Ms   <J;J+J(	+J<	c               $    V ^8  d   QhRRRRRR/# r   r   r   monkeypatchzpytest.MonkeyPatchr   r   r   )r   s   "r   r   r      s$     +4 +4+4!3+4	+4r   c                  a \        V 4      pVP                  R RR4       \        P                  ! \        4      ;_uu_ 4       p\        V R RRRR7       RRR4       XP                  qDP                  qU\        8H  qf'       Eg"   \        P                  ! R!V3R"V\        34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      R
R\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR/,          pRRV/,          p\        \        P                   ! V4      4      hR;p;rVVP                  P#                  4       R,          p	R.qYV8H  q'       gy   \        P                  ! R!V
3R#W34      R\        P                  ! V	4      R	\        P                  ! V4      /,          pRR
V/,          p\        \        P                   ! V4      4      hR;p	;r\        P                  ! \$        RR7      ;_uu_ 4        \        V R RRRR7       RRR4       . oVP'                  \(        RV3R l4       \        V R RRRR7      pVP*                  pRqVJ qU'       g   \        P                  ! R$V3R%WM34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p;r]R&.p
SV
8H  qD'       g   \        P                  ! R!V3R'SV
34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;rJVP,                  pR pRqd! WV4      pRpVVJ pV'       Eg
   \        P                  ! R$V3R(VV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR V/,          p\        \        P                   ! V4      4      hR;p;p;p;p;pp\/        W4       R#   + '       g   i     ELb; i  + '       g   i     EL@; i))r%   r&   TFallow_lockedexplicit_accountNr   deniedr   r   r    r   zassert %(py8)sr"   accountsr+   r   zassert %(py6)szexplicit --accountr   r   c                *   < SP                  WV34      # Nr   )actionro   rq   confirmationss   &&&r   r   Ntest_authorization_denies_lock_and_allows_confirmed_one_shot.<locals>.<lambda>   s    =#7#7t8L#Mr   authorizationr2   zassert %(py7)sr3   r   r1   r   r   r5   r   r'   r@   )zL%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.exit_code
} == %(py6)s)z%(py1)s == %(py4)srB   )z7%(py2)s
{%(py2)s = %(py0)s.locked_override
} is %(py5)s)r   r%   r&   r   r   )r   rN   r   r   r   r
   value	exit_coder   rF   rG   rH   rI   rJ   rK   rL   rM   refusal_payloadr   setattraccount_locklocked_overrider   r   )r   r   r   r   rU   rV   rX   @py_format7rY   @py_assert0r   @py_format5r   rb   r   @py_format8r   rW   re   r[   r   r^   r   s   &&                    @r   <test_authorization_denies_lock_and_allows_confirmed_one_shotr      so    X&E	Wfd+	)	*	*f!	
 
+ <<;!!;%;;;;;;!%;;;;;;;6;;;;6;;;<;;;!;;;;;;%;;;;;%;;;;;;;;;<<'')*5G,GGGGGG5GGG5GGGGGGGGGGG	)1E	F	F"	
 
G 13MM
 *M ((0D0D00000(000000=0000=000(000D00000000:;;=;;;;;;=;;;;;;;=;;;;=;;;;;;;;;;;;??373F3?7+3t3+t33333+t333333533335333?3337333F333+333t33333333383K 
+	*	* 
G	F	Fs   V,8W ,V=	 W	c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r      s$     8 88!38	8r   c                `   \        V 4      pVP                  R RR4       VP                  \        RR 4       \	        V R RRRR7      pVP
                  P                  RRR7       \        P                  ! \        4      ;_uu_ 4        \        W4       R	R	R	4       R	#   + '       g   i     R	# ; i)
r%   r&   Tr   c                     R # r   r   )_argss   *r   r   Ptest_override_revalidation_still_fails_closed_on_invalid_state.<locals>.<lambda>   s    Tr   r   znot-jsonr9   r:   N)r   rN   r   r   r
   rQ   r   r   r   r   r   )r   r   r   r   s   &&  r   >test_override_revalidation_still_fails_closed_on_invalid_stater      s     X&E	Wfd+&<>QR)M 
JJ*w7	,	-	-x7 
.	-	-	-s   BB-	c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s     8 8 8RV 8r   c                    \        V R RRRR7      p\        V 4      P                  R RR4       \        P                  ! \
        4      ;_uu_ 4        \        W4       RRR4       R#   + '       g   i     R# ; i)r*   r&   FTr   N)r
   r   rN   r   r   r   r   )r   r   s   & r   :test_revalidation_blocks_a_race_that_locks_after_selectionr      s[    )M X))(FDA	)	*	*x7 
+	*	*	*s   A%%A6	c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s     C Cd Ct Cr   c                   \        V 4      pVP                  4        \        P                  p\        P                  q1P
                  qC! V4      qUP                  qb! V4      pR qV8H  q'       Eg   \        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /
,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;p;p;p;p;p;rR# )r/   r   r0   r   r1   osr2   r    r   r"   r$   r-   r.   py17zassert %(py19)spy19Nr@   )z%(py14)s
{%(py14)s = %(py2)s
{%(py2)s = %(py0)s.S_IMODE
}(%(py12)s
{%(py12)s = %(py10)s
{%(py10)s = %(py5)s
{%(py5)s = %(py3)s.stat
}(%(py8)s
{%(py8)s = %(py6)s.lock_path
})
}.st_mode
})
} == %(py17)s)r   rE   r0   rP   r   	lock_pathrR   rF   rG   rH   rI   rJ   rK   rL   rM   )r   r   rU   rb   rW   r[   r]   r   @py_assert16rf   @py_format18@py_format20s   &           r   test_state_lock_file_is_privater     s:   X&E	<<BBB0B88B<89BUBUBBBBB9BBBBBB4BBBB4BBB<BBBBBBBBBBBBBBBBBBBBBBBBBBBBB0BBB8BBB9BBBUBBBBBBBBBr   ).
__future__r   builtinsrH   _pytest.assertion.rewrite	assertionrewriterF   r?   r   r0   sysr   pathlibr   r   rQ   insertrp   __file__resolveparentsr   r   r   r   r   r   r	   r
   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r     s    "    	  
    3tH~--/77:; <    $6.O
.6 
F+4\8&8Cr   