+
    jHàj³E  ã                  óò   € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^ RI
Ht ^ RI
Ht ^ RI
Ht ^ RIHtHtHt R	 R
 ltR R ltR R ltR R ltRtR R ltR R ltR R ltR R ltR# )zªDispatcher and maintenance verbs for ``hermes kanban``: ``dispatch``,
``daemon`` (deprecated standalone loop), ``tail``/``watch`` event streaming,
``gc`` and ``repair``.
)ÚannotationsN)ÚPath)Ú	kanban_db)Úkanban_db_connect)Úkanban_db_dispatch)Úkanban_db_workspace)Ú_errÚ_fmt_tsÚ_print_jsonc               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚdict© )Úformats   "Ú:/home/ubuntu/.hermes/hermes-agent/hermes_cli/kanban_ops.pyÚ__annotate__r      s   € ÷ ñ ˜ñ ó    c                 ó¬   €  ^ RI Hp  V ! 4       p\        V\        4      '       d   VP	                  R/ 4      M/ ;'       g    / #   \
         d    / u # i ; i)zK``config.yaml`` ``kanban:`` section, or ``{}`` when config can't be loaded.©Úload_configÚkanban)Úhermes_cli.configr   Ú
isinstancer   ÚgetÚ	Exception)r   Úcfgs     r   Ú_kanban_configr      sL   € ðÝ1Ù‹mˆÜ)3°C¼×)>Ò)>�—‘˜ "Ô%ÀB×MÐMÈ2ÐMøÜô ØŠ	ðús   ‚=A Á A ÁAÁAc               ó    € V ^8„  d   QhRRRR/# )r   ÚintervalÚfloatr   Úintr   )r   s   "r   r   r       s   € ÷ ñ ˜ð ¨ñ r   c                ó’   €   V! 4        \         P                  ! \        RV 4      4       K*    \         d    \	        R4        ^ # i ; i)zCRun ``tick()`` every ``interval`` seconds (floor 0.1) until Ctrl-C.gš™™™™™¹?z

(stopped))ÚtimeÚsleepÚmaxÚKeyboardInterruptÚprint)r   Úticks   &&r   Ú
_poll_loopr)       s<   € ðØÙŒFÜ�JŠJ”s˜3 Ó)Ö*øÜô ÜˆmÔÚðús   ‚*, ¬AÁAc               ó    € V ^8„  d   QhRRRR/# ©r   Úargszargparse.Namespacer   r!   r   )r   s   "r   r   r   +   s   € ÷ +ñ +Ð&ð +¨3ñ +r   c                óv   a a€ ^ o\        RS P                   R24       V V3R lp\        S P                  V4      # )é    zTailing events for z. Ctrl-C to stop.c                 ó¶  <€ \         P                  ! 4       ;_uu_ 4       p \        P                  ! V SP                  4      pR R R 4       X Fw  pVP
                  S8”  g   K  VP                  '       d   RVP                   2MRp\        R\        VP                  4       RVP                   V 2RR7       VP
                  oKy  	  R #   + '       g   i     L�; i)NÚ Ú Ú[ú] T©Úflush)ÚkbcÚconnect_closingÚkbÚlist_eventsÚtask_idÚidÚpayloadr'   r	   Ú
created_atÚkind)ÚconnÚeventsÚeÚplr,   Úlast_ids       €€r   r(   Ú_cmd_tail.<locals>.tick/   s–   ø€ ä× Ò ×"Ô" dÜ—^’^ D¨$¯,©,Ó7ˆF÷ #ãˆAØ�t‰t�gŽ~Ø()¯	¯	¨	�q˜Ÿ™˜‘_°r�Ü˜œ' !§,¡,Ó/Ð0°°1·6±6°(¸2¸$Ð?ÀtÕLØŸ$™$’ó	 ÷ #×"ús   Ÿ"CÃC	)r'   r:   r)   r   )r,   r(   rC   s   f @r   Ú	_cmd_tailrE   +   s7   ù€ Ø€GÜ	Ð §¡˜~Ð->Ð
?Ô@öô �d—m‘m TÓ*Ð*r   c               ó    € V ^8„  d   QhRRRR/# r+   r   )r   s   "r   r   r   <   s   € ÷ añ aÐ*ð a¨sñ ar   c                ó*  €  ^ RI Hp V! 4       p\        V\        4      '       d   VP	                  R/ 4      M/ pVP	                  R4      ;'       g    RP                  4       ;'       g    Rp\        P                  ! VP	                  R4      R4      p\        P                  ! \        P                  ! VP	                  R4      R4      4      p\        V RR4      pVe   TM%\        P                  ! VP	                  R	4      R4      p\        P                  ! 4       ;_uu_ 4       p	\        P                  ! V	V P                  VV\        V R
\        P                  4      VVR7      p
RRR4       \        V RR4      '       dî   \!        / R; Uu/ uF  pV\        X
V4      bK  	  upCRX
P"                   UUUu. uF  w  rÍpRVRVRV/NK  	  upppRV
P$                  RV
P&                  RV
P(                   UUUu. uF  w  rÍpRVRVRV/NK  	  upppRV
P*                  RV
P,                   UUu. uF  w  ppRVRV/NK  	  uppRV
P.                  RV
P0                  RV
P2                  /	CRR7       ^ # \5        RX
P6                   24       V
P8                  '       d(   \5        RR P;                  V
P8                  4       24       R!V
P<                  3R"V
P>                  3R#V
P@                  3R$V
PB                  33 FF  w  pp\5        V R%\E        V4       24       V'       g   K)  \5        R&R P;                  V4       24       KH  	  \5        R'V
PF                   24       \5        R(\E        V
P"                  4       24       V P                  '       d   R)MRpV
P"                   F&  w  rÍp\5        R*T R+T R,T;'       g    R- V 24       K(  	  V
P*                  '       d,   \5        R.V: R/R P;                  V
P*                  4       24       V
P$                  '       d(   \5        R0R P;                  V
P$                  4       24       V
P(                   F  w  rÍp\5        R1V R2V R3V 24       K  	  V
P&                  '       d(   \5        R4R P;                  V
P&                  4       24       V
P,                   F  w  pp\5        R5V R6V 24       K  	  V
P.                  '       d(   \5        R7R P;                  V
P.                  4       24       V
P0                  '       d   \5        R84       V
P2                  '       d   \5        R9V
P2                   R:24       ^ #   \         d    R;p;rV\        T RR4      p EL_i ; i  + '       g   i     EL; iu upi u upppi u upppi u uppi )<r.   r   r   Údefault_assigneer1   NÚmax_in_progress_per_profileÚmax_in_progressr%   Ú	max_spawnÚfailure_limit)Údry_runrK   rJ   rL   rH   rI   ÚjsonFÚspawnedr:   ÚassigneeÚ	workspaceÚskipped_unassignedÚskipped_nonspawnableÚskipped_per_profile_cappedÚcurrentÚauto_assigned_defaultÚrespawn_guardedÚreasonÚrate_limitedÚskipped_lockedÚmemory_pressureT©ÚasciizReclaimed:    z"Reaped workers of finished tasks: ú, zCrashed:     zTimed out:   zStale:       zAuto-blocked:r0   ú  zPromoted:     zSpawned:      z (dry)z  - z  ->  z  @ Ú-z)Auto-assigned to kanban.default_assignee=ú: zSkipped (unassigned): z
Deferred (z at per-profile cap, z running): u8   Skipped (non-spawnable assignee â€” terminal lane, OK): z	Guarded (z): z6Rate-limited (released to ready, no failure counted): zISkipped: another dispatcher holds this board's lock (no writes this tick)zMemory pressure z": new workers restricted this tick)Ú	reclaimedÚcrashedÚ	timed_outÚstaleÚauto_blockedÚpromotedÚreaped_terminal_workers)$r   r   r   r   r   ÚstripÚkbdÚ_positive_intÚresolve_max_in_progressÚgetattrr   r6   r7   Údispatch_oncerM   ÚDEFAULT_FAILURE_LIMITr
   rO   rR   rS   rT   rV   rW   rY   rZ   r[   r'   rb   rh   Újoinrc   rd   re   rf   Úlenrg   )r,   r   Ú_cfgÚ_kanban_cfgrH   rI   rJ   Úcli_maxrK   r?   ÚresÚkÚtidÚwhoÚwsrU   rX   ÚlabelÚitemsÚtags   &                   r   Ú_cmd_dispatchr}   <   sG  € ð/Ý1Ù‹}ˆÜ0:¸4Ä×0FÒ0F�d—h‘h˜x¨Ô,ÈBˆØ'ŸO™OÐ,>Ó?×EÐEÀ2×LÑLÓN×VÐVÐRVÐÜ&)×&7Ò&7Ø�O‰OÐ9Ó:¸Dó'
Ð#ô ×5Ò5Ü×Ò˜kŸo™oÐ.?Ó@À$ÓGó
ˆô ˜$  tÓ,ˆàÒ*‰G´×0AÒ0AÀ+Ç/Á/ÐR]ÓB^Ð`dÓ0eð 	ô 
×	Ò	×	Ô	 $Ü×ÒØØ—L‘LØØ+Ü! $¨¼×9RÑ9RÓSØ-Ø(Cô
ˆ÷ 
ô ˆt�V˜U×#Ò#Üð 
ñ4ó5ñ4�1ð ”'˜#˜q“/Ò!ñ4ñ5ð
ð ØY\×YdÒYdõÙYdÁ~ÈÐRT�˜C ¨S°+¸rÓBÑYdóð ! #×"8Ñ"8Ø" C×$<Ñ$<Ø(à+.×+IÒ+Iõ+á+IÑ'�S˜wð ˜C ¨S°)¸WÓEÙ+Ió+ð $ S×%>Ñ%>Øà%(×%8Ò%8ô á%8‘M�S˜&ð ˜C ¨6Ó2Ù%8ò ð ˜C×,Ñ,Ø˜c×0Ñ0Ø˜s×2Ñ2ñ)
ð* õ+	ñ, Ü	ˆN˜3Ÿ=™=˜/Ð
*Ô+Ø
×"×"Ð"ÜÐ2°4·9±9¸S×=XÑ=XÓ3YÐ2ZÐ[Ô\à	˜#Ÿ+™+Ð&Ø	˜#Ÿ-™-Ð(Ø	˜#Ÿ)™)Ð$Ø	˜#×*Ñ*Ð+ó	‰ˆˆuô 	���qœ˜U›˜Ð%Ô&ß‰5Ü�B�t—y‘y Ó'Ð(Ð)Ö*ñô 
ˆN˜3Ÿ<™<˜.Ð
)Ô*Ü	ˆNœ3˜sŸ{™{Ó+Ð,Ð
-Ô.Ø—l—l�l‰(¨€CØŸœ‰ˆ�"Ü��S�E˜ ˜u D¨¯¨¨s¨°C°5Ð9Ö:ñ $à
× × Ð ÜØ7Ð8HÑ7KÈ2Ø�y‰y˜×2Ñ2Ó3Ð4ð6ô	
ð ××ÐÜÐ& t§y¡y°×1GÑ1GÓ'HÐ&IÐJÔKØ ×;Ô;Ñˆ�'Ü�
˜3˜%Ð4°W°I¸[ÈÈÐNÖOñ <à
××ÐÜØFØ�y‰y˜×1Ñ1Ó2Ð3ð5ô	
ð ×*Ô*‰ˆˆVÜ�	˜&˜  S EÐ*Ö+ñ +à
××ÐÜÐFÀtÇyÁyÐQT×QaÑQaÓGbÐFcÐdÔeØ
××ÐÜÐYÔZØ
××ÐÜÐ  ×!4Ñ!4Ð 5Ð5WÐXÔYÙøôY ô /ØKOÐOÐÐOÐ6Ü˜D %¨Ó.‹	ð/ú÷ 
×	Ð	üò5ùôùô
+ùó
 sD   ‚AU ÁU Á)BU Ä"AU(ÆU<
Æ2VÇ3VÈ'V"ÕU%Õ$U%Õ(U9	uy  hermes kanban daemon: DEPRECATED â€” the dispatcher now runs
inside the gateway. To use kanban:

    hermes gateway start       # starts the gateway + embedded dispatcher

Ready tasks will be picked up on the next dispatcher tick
(default: every 60 seconds). Configure via config.yaml:

    kanban:
      dispatch_in_gateway: true      # default
      dispatch_interval_seconds: 60
      failure_limit: 2              # consecutive non-success attempts before auto-block

Running both the gateway AND this standalone daemon will
race for claims. If you truly need the old standalone
daemon (no gateway available), rerun with --force.c               ó    € V ^8„  d   QhRRRR/# r+   r   )r   s   "r   r   r   ¬   s   € ÷ ^ñ ^Ð(ð ^¨Sñ ^r   c           	     ó4  aaaa€ \        V RR4      '       g   \        \        ^4      # \        P                  ! 4        \        V RR4      pV'       d`    \        V4      P                  P                  RRR7       \        V4      P                  \        \        P                  ! 4       4      RR7       \!        \        V RR4      4      o\        RV P"                   R\        P                  ! 4        R2\        P                  R7       ^oR^ R^ /oR R loVVVV3R lp \$        P&                  ! V P"                  V P(                  \        V R\$        P*                  4      VR7       V'       d    \        V4      P-                  4        M \        R4       ^ #   \         d-   p\        R	T R
T 2\        P                  R7        Rp?ELRp?ii ; i  \         d     LTi ; i  T'       d-    \        T4      P-                  4        i   \         d     i i ; ii ; i)uD  Deprecated â€” the dispatcher now runs inside the gateway. Kept so old
scripts/systemd units get a clear migration message; ``--force`` (hidden
from --help) keeps the standalone loop for hosts that truly cannot run the
gateway. The default path exits 2 so nobody accidentally runs two
dispatchers against the same kanban.db.ÚforceFÚpidfileNT)ÚparentsÚexist_okzutf-8)Úencodingz!warning: could not write pidfile ra   ©ÚfileÚverbosez;Kanban dispatcher running STANDALONE via --force (interval=zs, pid=zŠ). Ctrl-C to stop. NOTE: if a gateway is also running with dispatch_in_gateway=true (default), you have two dispatchers racing for claims.Ú	bad_ticksÚlast_warn_atc               ó   € V ^8„  d   QhRR/# )r   r   Úboolr   )r   s   "r   r   Ú!_cmd_daemon.<locals>.__annotate__Ï   s   € ÷ ñ  4ñ r   c                 óÌ   €  \         P                  ! 4       ;_uu_ 4       p \        P                  ! V 4      uuRRR4       #   + '       g   i     R# ; i  \         d     R# i ; i)z•Is there a ready+assigned+unclaimed task the dispatcher would spawn for?
Control-plane lanes pulled via ``claim_task`` are correctly idle, not stuck.NF)r6   r7   rj   Úhas_spawnable_readyr   )r?   s    r   Ú_ready_queue_nonemptyÚ*_cmd_daemon.<locals>._ready_queue_nonemptyÏ   sF   € ð	Ü×$Ò$×&Ô&¨$Ü×.Ò.¨tÓ4÷ '×&×&Ó&ûäô 	Úð	ús-   ‚A ŸA µ
A Á A	ÁA ÁA ÁA#Á"A#c                óª  <€ \        V P                  4      ;'       g    S! 4       pV'       d)   V P                  '       g   SR ;;,          ^,          uu&   M^ SR &   SR ,          S8¼  d–   \        \        P                  ! 4       4      pVSR,          ,
          R8¼  dc   \
        P                  ! V .4      pV'       d   RV R2MRp\        R\        V4       RSR ,           RV R	2\        P                  R
R7       VSR&   S'       g   R# V P                  ;'       gq    V P                  ;'       g]    V P                  ;'       gI    V P                  ;'       g5    V P                  ;'       g!    V P                  ;'       g    V P                   pV'       dÀ   \        R\        \        \        P                  ! 4       4      4       RV P                   R\#        V P                  4       R\#        V P                  4       R\#        V P                   4       RV P                   R\#        V P                  4       R\#        V P                  4       2R
R7       R# R# )rˆ   r‰   i,  z Last tick held back: Ú.r1   r2   z3] WARN dispatcher stuck: ready queue non-empty for z6 consecutive ticks but 0 workers spawned successfully.zž Check profile health (venv, PATH, credentials) and `hermes kanban list --status ready` / `hermes kanban list --status blocked` for recent spawn_failed tasks.T)r†   r5   Nz] reclaimed=z	 crashed=z timed_out=z stale=z
 promoted=z	 spawned=z auto_blocked=r4   )r‹   rR   rO   r!   r#   rj   Údescribe_suppressionr'   r	   ÚsysÚstderrrb   rc   rd   rg   rf   re   rq   )	ru   Úready_pendingÚnowÚheldÚdid_workÚHEALTH_WINDOWr�   Úhealth_stater‡   s	   &    €€€€r   Ú_on_tickÚ_cmd_daemon.<locals>._on_tickØ   s  ø€ Ü˜S×3Ñ3Ó4×OÐOÑ8MÓ8Oˆß §§ Ø˜×%¨Õ*Ô%à()ˆL˜Ñ%à˜Õ$¨Ô5Ü”d—i’i“kÓ"ˆCØ�\ .Õ1Õ1°SÔ8Ü×/Ò/°°Ó6�ß;?Ð/°¨v°QÑ7ÀR�ÜØœ ›�~Ð%XØ# KÕ0Ð1ð 2$Ø$( 6ð *1ð2ô
 Ÿ™¨4õð 03�˜^Ñ,ßÙà�M‰M÷ <ð <˜SŸ[™[÷ <ð <¨C¯M©M÷ <ð <¸S¿\¹\÷ <ð <Ø�{‰{÷<ð <Ø!×.Ñ.÷<ð <Ø25·)±)ð 	÷ ÜØ”GœC¤§	¢	£Ó,Ó-Ð.¨l¸3¿=¹=¸/ð JÜ˜sŸ{™{Ó+Ð,¨K¼¸C¿M¹MÓ8JÐ7KÈ7ÔSVÐWZ×W`ÑW`ÓSaÐRbð cØŸL™L˜>¨´3°s·{±{Ó3CÐ2Dð E Ü # C×$4Ñ$4Ó 5Ð6ð8ð ÷ñ r   rL   )r   rK   rL   Úon_tickz(dispatcher stopped))rm   r   Ú_DAEMON_DEPRECATEDr8   Úinit_dbr   ÚparentÚmkdirÚ
write_textÚstrÚosÚgetpidÚOSErrorr'   r”   r•   r‹   r   rj   Ú
run_daemonr%   ro   Úunlink)r,   r�   Úexcrœ   rš   r�   r›   r‡   s   &   @@@@r   Ú_cmd_daemonr«   ¬   sÑ  û€ ô �4˜ %×(Ò(ÜÔ&¨Ó*Ð*ô ‡J‚J„Lä�d˜I tÓ,€Gßð	YÜ�‹M× Ñ ×&Ñ&¨t¸dÐ&ÔCÜ�‹M×$Ñ$¤S¬¯ª«Ó%5ÀÐ$ÔHô ”7˜4 ¨EÓ2Ó3€GÜ	Ø
EÀdÇmÁmÀ_ð UÜ�yŠy‹{ˆmð Zð	[ô �Z‰Zõ	ð €MØ  N°AÐ6€Lõ÷"ð "ðHÜ�ŠØ—]‘]Ø—h‘hÜ! $¨¼×9RÑ9RÓSØõ		
÷ ðÜ�W“×$Ñ$Õ&ð ô
 
Ð
 Ô!ÙøôY ô 	YÜÐ5°g°Y¸bÀÀÐFÌSÏZÉZ×XÓXûð	YûôR ô Ùðû÷ ðÜ�W“×$Ñ$Õ&øÜô Ùðúð úsb   ÁAF ÄAG! Å,G! Å.G ÆGÆ!!GÇGÇGÇGÇ!	HÇ+HÈHÈHÈHÈHÈHc               ó    € V ^8„  d   QhRRRR/# r+   r   )r   s   "r   r   r     s   € ÷ !+ñ !+Ð'ð !+¨Cñ !+r   c                ó.  a aa€ S P                   '       dQ   S P                   P                  R4       Uu0 uF*  qP                  4       '       g   K  VP                  4       kK,  	  upMRo\        R\        P
                  ! 4        R2RR7       \        P                  ! 4       ;_uu_ 4       p\        VP                  R4      P                  4       R,          4      oRRR4       V VV3R	 lp\        S P                  V4      # u upi   + '       g   i     L3; i)
z(Live-stream task_events to the terminal.Ú,Nz'Watching kanban events (initial board 'z'). Ctrl-C to stop.Tr4   z1SELECT COALESCE(MAX(id), 0) AS m FROM task_eventsÚmc                 óH  <€ \         P                  ! 4       ;_uu_ 4       p V P                  R S34      P                  4       pRRR4       X EF+  p\	        S\        VR,          4      4      oS'       d   VR,          S9  gU   SP                  '       d   VR,          SP                  8w  g+   SP                  '       d   VR,          SP                  8w  d   KŒ   VR,          '       d   \        P                  ! VR,          4      MRpV'       d   RV 2MRp\        R	\        \        P                  ! VR
,          4      4       RVR,          R RVR,          R RVR,          ;'       g    R RV 2
RR7       EK.  	  R#   + '       g   i     ELE; i  \         d    Rp Lši ; i)z¸SELECT e.id, e.task_id, e.kind, e.payload, e.created_at,        t.assignee, t.tenant FROM task_events e LEFT JOIN tasks t ON t.id = e.task_id WHERE e.id > ? ORDER BY e.id ASC LIMIT 200Nr;   r>   rP   Útenantr<   r0   r1   r2   r=   r3   r:   Ú10sÚ18sz (@r`   Ú)Tr4   )r6   r7   ÚexecuteÚfetchallr%   r!   rP   r±   rN   Úloadsr   r'   r	   r8   Ú	_to_epoch)r?   ÚrowsÚrr<   rB   r,   ÚcursorÚkindss        €€€r   r(   Ú_cmd_watch.<locals>.tick  sX  ø€ ä× Ò ×"Ô" dØ—<‘<ð.ð �	ó	÷
 ‰h‹jð ÷ #ô ˆAÜ˜¤ Q t¥W£Ó.ˆFß˜!˜F�)¨5Ô0°d·m·m°mÈÈ*ÍÐY]×YfÑYfÔHfØŸŸ˜¨¨(­°t·{±{Ô(BÙðØ67¸	·l´lœ$Ÿ*š* Q y¥\Ô2È�÷ #*�1�W�I‘¨rˆBÜØ”GœBŸLšL¨¨<­Ó9Ó:Ð;¸2¸aÀ	½lÈ3Ð=OÈqØ�V•9˜S�/  Q z¥]×%9Ð%9°cÐ$:¸!¸B¸4ðAà÷ð ó ÷ #×"Ð"ûô ô Ø’ðús#   Ÿ"E=ÃFÃ'FÅ=F	ÆF!Æ F!)r¼   Úsplitri   r'   r8   Úget_current_boardr6   r7   r!   rµ   Úfetchoner)   r   )r,   rv   r?   r(   r»   r¼   s   f   @@r   Ú
_cmd_watchrÁ     sÁ   ú€ àGKÇzÇzÀz §
¡
× 0Ñ 0°Ô 5ÓCÑ 5˜1¿¹¿ŒYˆQ�W‰WŽYÑ 5ÒCÐW[€EÜ	Ð3´B×4HÒ4HÓ4JÐ3KÐK^Ð
_ÐgkÕlä	×	Ò	×	Ô	 $Ü�T—\‘\Ð"UÓV×_Ñ_ÓaÐbeÕfÓgˆ÷ 
÷ô2 �d—m‘m TÓ*Ð*ùò? D÷ 
×	ús   ³C?ÁC?Â)0DÄD	c               ó    € V ^8„  d   QhRRRR/# r+   r   )r   s   "r   r   r   1  s   € ÷ 0ñ 0Ð$ð 0¨ñ 0r   c           	     óè  € ^ RI p\        V R^4      p\        V R^4      pV^ 8  g   V^ 8  d   \        R^4      # \        P                  ! 4       p^ p\
        P                  ! 4       ;_uu_ 4       pVP                  R4      P                  4       pV EF—  pVR,          R8X  d¦   VR,          p	V	'       d“   \        V	4      P                  4       '       dt   \        P                  ! WhR	,          V	4      '       d   Kh  \        P                  ! VR	,          W˜R
,          4       \        V	4      P                  4       '       g
   V^,          pK·  VR,          R8w  d   KÇ  \        VR,          ;'       g    WHR	,          ,          4      p
V
P                  4       '       d3   V
P                  4       '       g   \        P                  ! V
4      '       g   EK;  \        P                   ! WhR	,          V
4      '       d   EKb  VP#                  V
RR7       V
P%                  4       '       d   EKŽ  V^,          pEKš  	  RRR4       ^ pV'       dL   \
        P                  ! 4       ;_uu_ 4       p\        P&                  ! Wb^,          R,          R7      pRRR4       V'       d&   \        P(                  ! V^,          R,          R7      M^ p\+        RV RV RV R24       ^ #   + '       g   i     L«; i  + '       g   i     Li; i)zKRemove archived tasks' scratch workspaces, old events, and old worker logs.NÚevent_retention_daysÚlog_retention_daysz>kanban gc: retention days must be >= 0 (0 disables that sweep)z[SELECT id, workspace_kind, workspace_path, branch_name FROM tasks WHERE status = 'archived'Úworkspace_kindÚworktreeÚworkspace_pathr;   Úbranch_nameÚscratchT)Úignore_errorsi  )Úolder_than_secondszGC complete: z workspace(s), z event row(s), z log file(s) removed)Úshutilrm   r   r8   Úworkspaces_rootr6   r7   rµ   r¶   r   Úis_dirÚkbwÚ_defer_shared_worktree_cleanupÚ_cleanup_worktree_workspaceÚ
is_symlinkÚ_is_managed_scratch_pathÚ_defer_shared_workspace_cleanupÚrmtreeÚexistsÚ	gc_eventsÚgc_worker_logsr'   )r,   rÍ   Ú
event_daysÚlog_daysÚscratch_rootÚ
removed_wsr?   r¹   ÚrowÚwt_pathÚpathÚremoved_eventsÚremoved_logss   &            r   Ú_cmd_gcrã   1  sE  € ãÜ˜Ð5°rÓ:€JÜ�tÐ1°2Ó6€HØ�A„~˜ AœÜÐTÐVWÓXÐXÜ×%Ò%Ó'€LØ€JÜ	×	Ò	×	Ô	 $Ø�|‰|ð(ó
÷ ‰(‹*ð 	ô ˆCØÐ#Õ$¨
Ô2ð Ð.Õ/�ßœt G›}×3Ñ3×5Ò5Ü×9Ò9¸$ÀDÅ	È7×SÒSÙ Ü×3Ò3°C¸µI¸wÈMÕHZÔ[Ü ›=×/Ñ/×1Ò1Ø" a�˜
ÙØÐ#Õ$¨	Ô1ÙÜ˜Ð,Õ-×KÐK°,ÀTÅÕ2JÓLˆDð
 —;‘;—=’= D§O¡O×$5Ò$5¼S×=YÒ=YÐZ^×=_Ò=_ÚÜ×2Ò2°4¸T½ÀD×IÒIÚØ�M‰M˜$¨dˆMÔ3Ø—;‘;—=•=Ø˜a•“
ñ3 ÷ 
ð@ €NßÜ× Ò ×"Ô" dÜŸ\š\¨$ÐPRÅ?ÐUYÕCYÔZˆN÷ #çQY”2×$Ò$¸À2½ÈÕ8LÕMÐ_`€LÜ	ˆM˜*˜ _ØÐ˜O¨L¨>Ð9MðOô Pá÷O 
×	ú÷D #×"ús?   Á-AKÂ2B8KÅ+)KÆKÆ+KÇAKÈKÉ&K!ËK	Ë!K1	c               ó    € V ^8„  d   QhRRRR/# r+   r   )r   s   "r   r   r   d  s   € ÷ 6ñ 6Ð(ð 6¨Sñ 6r   c                óP  €  \         P                  ! 4       p\	        T RR4      '       d‘   \        RTP                  R\        TP                  4      RTP                  RTP                  R	TP                  '       d   \        TP                  4      MRR
TP                  /RR7       TP                  R#9   d   ^ # ^# TP                  R8X  d   \        RTP                   R24       ^ # TP                  R8X  d   \        TP                   R24       ^ # TP                  R8X  dw   \        TP                   R24       \        RRP                  TP                  4       24       TP                  '       d   \        RTP                   24       \        R4       ^ # R R lpT! TP                   R24       TP                  ;'       g    . R,           F  pT! RT 24       K  	  TP                  '       dV   T! RRP                  TP                  4       R24       TP                  ;'       g    . R,           F  pT! RT 24       K  	  MT! R 4       TP                  '       d   T! R!TP                   24       T! R"4       ^#   \         d   p\        RT 24      u Rp?# Rp?ii ; i)$z¸Integrity check + narrow index-REINDEX auto-repair. Dispatched BEFORE
the auto ``kb.init_db()`` (init refuses corrupt DBs). Exit 0 = healthy /
repaired / no DB file, 1 = still corrupt.zkanban repair: NrN   FÚstatusÚdb_pathÚmessagesÚpost_repair_messagesÚbackup_pathÚ	reindexedTr\   ÚokÚrepairedÚmissingzNo kanban DB at u    â€” nothing to repair.u*   : integrity_check ok â€” no repair needed.z: repaired.z  reindexed: r^   z  pre-repair backup: z  integrity_check now ok.c               ó    € V ^8„  d   QhRRRR/# )r   Úliner¤   r   ÚNoner   )r   s   "r   r   Ú!_cmd_repair.<locals>.__annotate__†  s   € ÷ %ñ %�#ð %˜$ñ %r   c                ó<   € \        V \        P                  R 7       R# )r…   N)r'   r”   r•   )rð   s   &r   ÚerrÚ_cmd_repair.<locals>.err†  s   € ÜˆdœŸ™×$r   z
: CORRUPT.:Né
   Nr_   z  REINDEX (z1) attempted but integrity_check is still failing:z    uV     Not an index-only failure â€” automatic REINDEX repair does not apply (fail-closed).z  corrupt copy quarantined at: uï     Recover manually (copy kanban.db aside FIRST, then run `sqlite3 <copy> ".recover"` into a fresh file â€” never against the live path, a WAL-reset-vulnerable sqlite3 CLI can corrupt it further) or move the file aside to start a new board.>   rì   rî   rí   )r6   Ú	repair_dbr   r   rm   r
   ræ   r¤   rç   rè   ré   rê   rë   r'   rp   )r,   Úreportrª   rô   rð   s   &    r   Ú_cmd_repairrù   d  sc  € ð-Ü—’“ˆô ˆt�V˜U×#Ò#ÜØ�f—m‘mØ”s˜6Ÿ>™>Ó*Ø˜Ÿ™Ø" F×$?Ñ$?Ø°f×6H×6HÐ6Hœ3˜v×1Ñ1Ô2ÈdØ˜×)Ñ)ð
ð õ	ð —M‘MÐ%BÔBˆqÐIÈÐIà‡}�}˜	Ô!ÜÐ  §¡Ð 0Ð0GÐHÔIÙØ‡}�}˜ÔÜ�—‘Ð Ð JÐKÔLÙØ‡}�}˜
Ô"Ü�—‘Ð  Ð,Ô-Ü�˜dŸi™i¨×(8Ñ(8Ó9Ð:Ð;Ô<Ø××ÐÜÐ)¨&×*<Ñ*<Ð)=Ð>Ô?ÜÐ)Ô*Ùõ%ñ ˆ6�>‰>Ð
˜*Ð%Ô&Ø—‘×&Ð& B¨×,Ð,ˆÙˆb��ˆKÖñ -à××ÐÙˆk˜$Ÿ)™) F×$4Ñ$4Ó5Ð6Ð6gÐhÔiØ×0Ñ0×6Ð6°B¸×<Ð<ˆDÙ�$�t�f�Öò =ñ 	ÐdÔeØ××ÐÙÐ-¨f×.@Ñ.@Ð-AÐBÔCÙð	@ôñ øôa ô -Ü�o c UÐ+Ó,Õ,ûð-ús   ‚J ÊJ%ÊJ ÊJ%Ê J%) Ú__doc__Ú
__future__r   ÚargparserN   r¥   r”   r#   Úpathlibr   Ú
hermes_clir   r8   r   r6   r   rj   r   rÐ   Úhermes_cli.kanban_outputr   r	   r
   r   r)   rE   r}   rŸ   r«   rÁ   rã   rù   r   r   r   Ú<module>r      sk   ðñõ
 #ã Û Û 	Û 
Û Ý å &Ý /Ý 0Ý 1ß ?Ñ ?õõõ+õ"aðJð õ^õB!+õH0÷f6r   