
     j.                        d Z ddlmZ ddlZddlmc mZ ddl	Z
ddlZddlmZ  ee      j                         j                   d   Zd
dZ edd      Zd	 Zy)u   tests/regression/test_done_escalated_coexistence.py — Group 7 (1건).

task-2472 regression: .done + .done.escalated 동시 존재 → DONE reject.

23. test_done_and_done_escalated_coexistence_rejects_done
    )annotationsN)Path   c                p   t         |z  }t        j                  j                  | t	        |            }g }d }||u}|}|r|j
                  }d }	||	u}
|
}|st        j                  d|fd||f      dt        j                         v st        j                  |      rt        j                  |      ndt        j                  |      dz  }dd|iz  }|j                  |       |rt        j                  d
fd	f      dt        j                         v st        j                  |      rt        j                  |      ndt        j                  |      t        j                  |	      dz  }d	d
|iz  }|j                  |       t        j                  |d      i z  }t        j                  d|       dz   d|iz  }t        t        j                   |            d x}x}x}x}x}x}
}	t        j                  j#                  |      }|t$        j&                  | <   |j
                  j)                  |       |S )N)is not)z%(py2)s is not %(py5)sspec)py2py5z%(py7)spy7)z5%(py11)s
{%(py11)s = %(py9)s.loader
} is not %(py14)s)py9py11py14z%(py16)spy16r   u   spec load 실패: z
>assert %(py19)spy19)WORKTREE	importlibutilspec_from_file_locationstrloader
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprappend_format_boolop_format_assertmsgAssertionError_format_explanationmodule_from_specsysmodulesexec_module)mod_namerelpathr   @py_assert1@py_assert4@py_assert3@py_assert0@py_assert10@py_assert13@py_assert12@py_format6@py_format8@py_format15@py_format17@py_format18@py_format20mods                     G/home/jay/workspace/tests/regression/test_done_escalated_coexistence.py_loadr8      sM   c>D>>11(CIFDTtT4tTT4T4 7TTTT4tTTTTTT4TTT4TTTtTTTTTTT4TTTTTTTTTTTTTTT4TTTTTTTTTT;MdV9TTTTTTTTT
..
)
)$
/CCKKKKC J    silent_corruption_guard_g7z utils/silent_corruption_guard.pyc                	   d}| dz  dz  }|j                  dd       || dz  }|j                  dd	       || d
z  }|j                  dd	       t        j                  ||       }|d   }d}||u }|st	        j
                  d|fd||f      t	        j                  |      t	        j                  |      dz  }	t	        j                  d      dz   d|	iz  }
t        t	        j                  |
            dx}x}}|d   d   }d}||u }|slt	        j
                  d|fd||f      t	        j                  |      t	        j                  |      dz  }	dd|	iz  }
t        t	        j                  |
            dx}x}}|d   d   }d}||u }|slt	        j
                  d|fd||f      t	        j                  |      t	        j                  |      dz  }	dd|	iz  }
t        t	        j                  |
            dx}x}}g }d}|d   }||v }|}|s d}|d   }|j                  } |       }||v }|}|s&t	        j
                  d|fd||f      t	        j                  |      t	        j                  |      dz  }
d d!|
iz  }|j                  |       |st	        j
                  dfd"f      t	        j                  |      t	        j                        t	        j                        t	        j                  |      d#z  }d$d%|iz  }|j                  |       t	        j                  |d&      i z  }d'd(|iz  }t        t	        j                  |            dx}x}x}x}x}x}x}x}x}}|j                          t        j                  ||       }|d   }d}||u }|st	        j
                  d|fd||f      t	        j                  |      t	        j                  |      dz  }	t	        j                  d)      dz   d|	iz  }
t        t	        j                  |
            dx}x}}|j                          |j                  d*d	       t        j                  ||       }|d   }d}||u }|st	        j
                  d|fd||f      t	        j                  |      t	        j                  |      dz  }	t	        j                  d+      dz   d|	iz  }
t        t	        j                  |
            dx}x}}y),u[   .done + .done.escalated 둘 다 존재하면 check_done_escalated_coexistence → ok=False.ztask-coexist-23memoryeventsT)parentsexist_okz.donedonezutf-8)encodingz.done.escalatedz{"reason":"test","ts":"2026-05-07T00:00:00Z","task_id":"task-coexist-23","source":"test","blocking_condition":"test","evidence_path":"/dev/null"})	workspaceokF)is)z%(py1)s is %(py4)s)py1py4uP   .done + .done.escalated 동시 존재 시 DONE 인정 불가 — ok=False 필수z
>assert %(py6)spy6Ndetaildone_existszassert %(py6)sescalated_existsu   동시 존재reasoncoexist)in)z%(py3)s in %(py6)s)py3rG   z%(py8)spy8)zJ%(py11)s in %(py18)s
{%(py18)s = %(py16)s
{%(py16)s = %(py14)s.lower
}()
})r   r   r   py18z%(py20)spy20   zassert %(py23)spy23u   .done만 있으면 PASS 필수xu(   .done.escalated만 있으면 PASS 필수)mkdir
write_textscg check_done_escalated_coexistencer   r   r   r   r    r!   lowerr   r   unlink)tmp_pathtask_id
events_dir	done_pathescalated_pathresultr,   r+   @py_assert2@py_format5@py_format7r)   @py_assert5r*   r-   r.   @py_assert15@py_assert17r/   @py_format9@py_format19@py_format21@py_format22@py_format24	result_okresult_escalated_onlys                             r7   5test_done_and_done_escalated_coexistence_rejects_donern   !   s   G H$x/JTD1 y..I'2  WI_"==N	S   11'X1NF$< 5 <5   <5        !    	[     (M*2d2*d2222*d222*222d2222222(./747/47777/4777/77747777777W?WfX.W?..W)Wvh?OW?O?U?UW?U?WW)?W2WWWWW?.WWW?WWW.WWWWWWW)?WWWW)WWW?OWWW?UWWW?WWWWWWWWWWWWWWWW 44W4QIT?DdD?d"DDD?dDDD?DDDdDDD$DDDDDDDD cG4@@T\@] &Z$Z&$.ZZZ&$ZZZ&ZZZ$ZZZ0ZZZZZZZZr9   )r&   r   r'   r   )__doc__
__future__r   builtinsr   _pytest.assertion.rewrite	assertionrewriter   importlib.utilr   r#   pathlibr   __file__resolver>   r   r8   rW   rn    r9   r7   <module>rz      sU    #     
 >!!#++A. (*LM'[r9   