+
    „WÝj  ã                   óp   € R t ^ RIt^ RIt^ RIHtHt Rt]! 0 Rm4      tRR/t	R t
R tRR/R	 ltR
 tR tR# )z?Transactional legacy binding; never a second transcript writer.N)ÚRuntimeStoreErrorÚ_jsonzgateway.local_legacy.v1:ÚguiÚdesktopc                 óž   € V P                  R 4      pV R,          R8H  ;'       d*    \        V\        4      ;'       d    VP                  R4      # )Úuser_idÚsourcer   znous:)ÚgetÚ
isinstanceÚstrÚ
startswith)Úrowr   s   & ÚPC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_state_local_migration.pyÚlegacy_account_labelr      sD   € ð �g‰g�iÓ €GØˆx�=˜IÑ%×bÐb¬*°W¼cÓ*B×bÐbÀw×GYÑGYÐZaÓGbÐbó    c                ó¢   € V P                  R4      pV R,          R8w  g   \        V\        4      '       d	   V'       g   R# ^ RIHp V! V4      V8H  # )am  Whether *subject* is the login a served remote backend stamped on this Desktop row.

``hermes serve`` stamps the WS-upgrade login as ``<provider>:<user id>``
(tui_gateway/session_transports.py). Unlike the Nous label that stamp IS an owner: once a
login's dashboard writes reach the gateway as that login, reading it as no-owner let login bob
rename, claim and delete alice's chats (#140183 review F1). So it adopts only for the caller
whose authenticated subject spells exactly that label (``_login_label``: issuer-less logins
only); every other caller, the host's own native peer included, still meets a foreign owner.
r   r   r   F)Ú_login_label)r	   r
   r   Úhermes_state_mutation_bindingr   )r   Úsubjectr   r   s   &&  r   Úlogin_owned_byr      sB   € ð �g‰g�iÓ €GØ
ˆ8…}˜	Ô!¬°G¼S×)AÒ)AÏÙÝ:Ù˜Ó  GÑ+Ð+r   r   c                ó¨  a€ SP                  R 4      pSR,          \        9  g£   \        ;QJ d    V3R lR
 4       F  '       g   K   RM	  RM! V3R lR
 4       4      '       gc   V'       d*   W28w  d$   \        S4      '       g   \	        SV4      '       d2   SP                  R4      RRV P                  4       ;'       g    R39  d   \        R	4      hR# )r   r   c              3   óF   <"  € T F  pSP                  V4      x € K  	  R # 5i)N)r	   )Ú.0Úkr   s   & €r   Ú	<genexpr>Ú&validate_legacy_row.<locals>.<genexpr>4   s   øé € ÐQÑ'P !�3—7‘7˜1—:�:Ó'Pùs   ƒ!TFÚprofile_nameNÚ ÚdefaultÚ	not_found)Úsession_keyÚchat_idÚorigin_json)r	   ÚLEGACY_LOCAL_SOURCESÚanyr   r   Ú_own_profile_namer   )Údbr   r   r   s   &f$ r   Úvalidate_legacy_rowr'   ,   sž   ø€ ð �g‰g�iÓ €GØˆH�Ô1Ô1ß‹sÔQÑ'PÓQ�s�sŠsÔQÑ'PÓQ×QÒQß˜GÔ.Ô7KÈC×7PÒ7PÜ& s¨G×4Ò4Ø�w‰w�~Ó&¨t°R¸×9MÑ9MÓ9O×9\Ð9\ÐS\Ð.]Ô]Ü Ó,Ð,ñ ^r   c                 óz  € VR ,          pW2R,          8w  d   \        R4      hVP                  RV34      P                  4       pVf   \        R4      h\        V \	        V4      VR,          R7       ^ RIHp VP                  R	WS,           34      P                  4       pV'       d>   \        P                  ! V^ ,          4      VR
,          VR,          .8w  d   \        R4      h^ RI	H
p VP                  Ws34      P                  4       e   \        R4      h^ RIHp V! WV.4       V P                  W4      p	VP                  RV	\        P                  ! 4       34      P                  4       '       d   \        R4      h\        V,           p
VP                  RV
34      P                  4       '       d   \        R4      hVR,          R,          pVP                  RVR,          VR,          VR,          R\!        V4      V34       VP                  RV
\!        RVR,          R
VR
,          RVR,          R V/4      34       R# )Úlegacy_session_idÚ
session_idÚstorage_unavailablez!SELECT * FROM sessions WHERE id=?Nr   Úprincipal_id)r   )ÚBINDING_PREFIXú(SELECT value FROM state_meta WHERE key=?Ú
profile_idÚpermission_denied)Ú_CHAIN_STEP_SQLÚadmission_conflict)Úrequire_idlezJSELECT 1 FROM session_turn_leases WHERE conversation_id=? AND expires_at>?Úruntime_coordination_requiredz$SELECT 1 FROM state_meta WHERE key=?ÚentryÚoriginzZUPDATE sessions SET session_key=?,chat_id=?,user_id=?,chat_type=?,origin_json=? WHERE id=?ÚrouteÚdmz-INSERT INTO state_meta(key,value) VALUES(?,?))r   ÚexecuteÚfetchoner'   Údictr   r-   ÚjsonÚloadsÚhermes_state_compressionr1   Úhermes_state_mutation_guardsr3   Ú_session_turn_lease_key_on_connÚtimeÚLEGACY_PREFIXr   )r&   ÚconnÚreceiptÚtargetr   r-   Úimportedr1   r3   ÚrootÚkeyr   s   &&&         r   Úbind_legacy_targetrI   ;   sþ  € ØÐ(Õ)€FØ˜Õ&Ô&ÜÐ 5Ó6Ð6Ø
�,‰,Ð:¸V¸IÓ
F×
OÑ
OÓ
Q€CØ
‚{Ü Ó,Ð,Ü˜œD ›I¨w°~Õ/FÕGÝ<Ø�|‰|ÐFÈÕI`ÐHbÓc×lÑlÓn€Hß”D—J’J˜x¨�{Ó+°¸Õ0EÀwÈ~ÕG^Ð/_Ô_ÜÐ 3Ó4Ð4Ý8Ø‡|�|�O YÓ/×8Ñ8Ó:ÒFÜÐ 4Ó5Ð5Ý9Ù�˜F˜8Ô$Ø×-Ñ-¨dÓ;€DØ‡|�|Ð`Øœ4Ÿ9š9›;Ð'ó)ß)1©«ö4äÐ ?Ó@Ð@Ü
˜&Õ
 €CØ‡|�|Ð:¸S¸FÓC×LÑL×NÒNÜÐ 5Ó6Ð6Ø�WÕ˜hÕ'€Fð 	‡L�LÐmØ˜'Õ" G¨LÕ$9¸7À>Õ;RÐTXÔZ_Ð`fÓZgÐioÐpôrà‡L�LÐ@À3ÌØ�g˜lÕ+¨\¸7À<Õ;PØ˜ Õ/Ð1DÀfðONó IOð CPö Qr   c                 óh  € VP                  R VR,          4      pR V9   d�   W!R,          8w  d   \        R4      hV P                  R\        V,           34      P	                  4       pR Uu/ uF  qDW,          bK  	  ppVe#   \
        P                  ! V^ ,          4      V8w  d   \        R4      hV# u upi )r)   r*   r+   r.   )r*   r/   r,   r)   )r	   r   r9   rB   r:   r<   r=   )rC   rD   rG   r   r   Úexpecteds   &&    r   Úlegacy_lineage_rootrL   ]   s¤   € Ø�;‰;Ð*¨G°LÕ,AÓB€DØ˜gÔ%Ø˜<Õ(Ô(Ü#Ð$9Ó:Ð:Ø�l‰lÐEÌÐX\ÕH\ÐG^Ó_×hÑhÓjˆÙ+lÓmÑ+l a�w•z’MÑ+lˆÐmØŠ;œ$Ÿ*š* S¨¥VÓ,°Ô8Ü#Ð$9Ó:Ð:Ø€Kùò ns   Á)B/>   ÚacpÚclir   ÚtuiÚtoolr   Úoneshot)Ú__doc__r<   rA   Úhermes_state_runtimer   r   rB   Ú	frozensetr#   ÚLEGACY_CREATION_SOURCESr   r   r'   rI   rL   © r   r   Ú<module>rW      sR   ðÙ EÛ Û ç 9à*€ñ !Ò![Ó\Ð à$ eÐ,Ð òcò,ð"-¨Dô -òQôD	r   