+
    $tj)                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ]P                  ! R4      t
^}t]! ]P                  P                  RR4      4      t]! ]P                  P                  RR4      4      t]P                  P                  R	R
4      tRR/R R lltR R ltR R lt]R8X  d    ]! ]! 4       4      hR#   ] d%   t]! R] 2]P2                  R7       ]! ]4      hRtAii ; i)zJRun one cdx attempt, capture its workspace, and upload the bounded result.)annotationsN)Pathz^[0-9a-f]{40,64}$CDX_WORKSPACEz
/workspaceCDX_RESULT_DIRz/resultCDX_RESULT_UPLOADERz /usr/local/bin/cdx-result-uploadcheckTc               $    V ^8  d   QhRRRRRR/# )   argvz	list[str]r   boolreturnsubprocess.CompletedProcess )formats   "e/home/user/overdeck-private-tests/workstation-ai-broad-final/modules/sandbox/image/bin/cdx-k3s-worker__annotate__r      s"      y D 4O     c                   \         P                  ! V R R7      pV'       d4   VP                  '       d"   \        V ^ ,           RVP                   24      hV# )Fr   z exited )
subprocessrun
returncodeRuntimeError)r
   r   	completeds   &$ r   callr      sG    t51I%%%d1gYhy/C/C.DEFFr   c                    V ^8  d   QhRRRR/# )r	   argsstrr   r   r   )r   s   "r   r   r      s      s 2 r   c            	     N    \        R RR\         2R\        \        4      .V O4      # )z/usr/bin/git-czsafe.directory=z-C)r   	WORKSPACEr   )r   s   *r   gitr!      s2    	{;T3y>TX  r   c                   V ^8  d   QhRR/# )r	   r   intr   )r   s   "r   r   r      s      c r   c            
     t   \        \        P                  4      ^8  gM   \        P                  ^,          R8w  g1   \        P	                  \        P                  ^,          4      '       g   \        R4      h\        P                  ^,          p \        \        P                  R,          RR7      p\        RRR4       \        R	R
R	RRRRR4       \        R,          p\        R,          p\        RR\        V4      RRV  24       VP                  V4       \        \        \        V4      .4       VP                  # )   z--z5usage: cdx-k3s-worker INPUT_COMMIT -- AGENT [ARGS...]:   NNFr   addz-Az--ignore-errorsr   zuser.name=cdx-offloadzuser.email=cdx-offload@localcommitz--allow-emptyz-mzcdx-offload-resultzresult.bundlezresult.bundle.tmpbundlecreateHEAD^)lensysr
   COMMIT	fullmatchr   r   r!   
RESULT_DIRr   replaceUPLOADERr   )input_commitagentr)   	temporarys       r   mainr7      s    
388}qCHHQK4/v7G7GQR7T7TRSS88A;L"U+Et&'%t-K/4)= /)F00I(C	NFa~4FGf(CK	 !r   __main__zcdx-k3s-worker: )file)__doc__
__future__r   osrer   r.   pathlibr   compiler/   RESULT_FAILUREenvirongetr    r1   r3   r   r!   r7   __name__
SystemExit	Exceptionexcprintstderrr   r   r   <module>rI      s    P " 	 	  
 	(	)>?	"**..!19=>
::>>/1ST4 $ z)     ) &SZZ8(()s   1C   C+C&&C+