/ core / database / __pycache__ / models.cpython-314.pyc
models.cpython-314.pyc
  1  +
  2  q�fih&����Rt^RIHtHt^RIHt^RIHt^RIHtH	t	H
  3  t
  4  Ht!RR]4t!RR]4t
]!R	R
  5  44t]!RR44t]!R
R44tR#)zn
  6  Data models for the God Database.
  7  
  8  These are the atomic units that form the foundation of the entire system.
  9  )�	dataclass�field)�datetime)�Enum)�Optional�List�Dict�Anyc�6�]tRt^
tRtRtRtRtRtRt	Rt
 10  RtR	tR
 11  #)�ContentTypez&Types of content a bullet can contain.�text�code�	image_ref�	audio_ref�	video_ref�link�
 12  structured�N)
�__name__�
 13  __module__�__qualname__�__firstlineno__�__doc__�TEXT�CODE�	IMAGE_REF�	AUDIO_REF�	VIDEO_REF�LINK�
 14  STRUCTURED�__static_attributes__r��7/Users/rcerf/repos/Sovereign_OS/core/database/models.pyrr
s(��0��D��D��I��I��I��D��Jr!rc�j�]tRt^tRtRtRtRtRtRt	Rt
 15  RtR	tR
 16  t
RtRtR
tRtRtRtRtRtRtRtRtRtR#)�EdgeTypez'Types of relationships between bullets.�is_a�has_a�part_of�instance_of�causes�enables�prevents�requires�
 17  relates_to�
 18  similar_to�opposite_of�analogous_to�before�after�during�cites�supports�contradicts�reminded_of�led_torN)rrrrr�IS_A�HAS_A�PART_OF�INSTANCE_OF�CAUSES�ENABLES�PREVENTS�REQUIRES�
 19  RELATES_TO�
 20  SIMILAR_TO�OPPOSITE_OF�ANALOGOUS_TO�BEFORE�AFTER�DURING�CITES�SUPPORTS�CONTRADICTS�REMINDED_OF�LED_TOr rr!r"r$r$ss��1��D��E��G��K��F��G��H��H��J��J��K�!�L��F��E�
�F�
�E��H��K� �K�
�Fr!r$c�Za�]tRt^;toRt]!]PR7t^t	V3Rlt
 21  RtVtR#)�PredictionTargetz�
 22  A potential edge that the system predicts should form.
 23  
 24  This is the free energy engine's prediction of what connections
 25  would reduce prediction error if they were made.
 26  ��default_factoryc�b<�V^8�dQh/S[;R&S[;R&S[;R&S[;R&S[;R&S[;R&#)��target_uuid�predicted_edge_type�prediction_strength�free_energy_reduction�first_predicted�prediction_count)�strr$�floatr�int)�format�
__classdict__s"�r"�__annotate__�PredictionTarget.__annotate__;sS�������"�!�����!� ���C����r!rN)
rrrrrrr�nowrWrX�__annotate_func__r �__classdictcell__�r]s@r"rNrN;s'�����!&�h�l�l� C�O����r!rNc�Va�]tRt^KtoRt]PtRt]	!]
 27  R7t]	!]PR7t]	!]PR7t]	!]PR7t^t]	!]
 28  R7t]	!]R7t]	!]
 29  R7tRtRtRt]	!]R7tV3RlRlt]V3RlRl4tV3R	ltR
 30  tVtR#)�Bulleta
 31  The atomic unit of information - a Markov blanket at the lowest level.
 32  
 33  Every piece of information in the system decomposes to bullets.
 34  Bullets can have edges to other bullets, forming a graph.
 35  The content NEVER leaves the blanket; only structure flows out.
 36  NrO�c�6<�V^8�dQhRS[S[S[3,/#�rR�return�rrYr	)r\r]s"�r"r^�Bullet.__annotate__ss���
 37  �
 38  ��c�3�h��
 39  r!c��/RVPbRVPbRVPbRVPPbRVP
 40  bRVPbRVPP4bRVPP4bR	VPP4bR
 41  VPbRVPbRVPbR
VPUu.uFepRVPRVP PRVP"RVP$RVP&P4RVP(/NKg	upbRVP*bRVP,bRVP.bRVP0b#uupi)�"Convert to dictionary for storage.�uuid�
 42  blanket_id�content�content_type�parent_uuid�child_uuids�
 43  created_at�
 44  updated_at�accessed_at�access_count�visible_tags�
metadata_tags�prediction_targetsrSrTrUrVrWrX�gravity_well_strength�free_energy_score�resonance_score�last_resonance_factors)rnrorprq�valuerrrsrt�	isoformatrurvrwrxryrzrSrTrUrVrWrXr{r|r}r~)�self�pts& r"�to_dict�Bullet.to_dictss���
 45  ��D�I�I�
 46  ��$�/�/�
 47  �
�t�|�|�
 48  �
�D�-�-�3�3�	
 49 50  
�4�+�+�
 51  �
�4�+�+�

 52  �
�$�/�/�3�3�5�
 53  �
�$�/�/�3�3�5�
 54  �
�4�+�+�5�5�7�
 55  �
�D�-�-�
 56  �
�D�-�-�
 57  �
�T�/�/�
 58  �
!��1�1�
 59  #�2�B�"�2�>�>�)�2�+A�+A�+G�+G�)�2�+A�+A�+�R�-E�-E�%�r�'9�'9�'C�'C�'E�&��(;�(;�
�2�
 60  #�
 61  �0
$�T�%?�%?�1
 62  �2
 ��!7�!7�3
 63  �4
�t�3�3�5
 64  �6
%�d�&A�&A�7
 65  �	
 66  ��
 67  #s�!A+Fc�:<�V^8�dQhRS[S[S[3,RR/#)rR�datarirerj)r\r]s"�r"r^rk�s#��� 
 68  � 
 69  �T�#�s�(�^� 
 70  �� 
 71  r!c
��VPR.4Uu.uF[p\VR,\VR,4VR,VR,\P!VR,4VR,R7NK]	ppV!R/R	VR	,bR
 72  VR
 73  ,bRVR,bR\VPRR
44bRVPR4bRVPR.4bR\P!VR,4bR\P!VR,4bR\P!VR,4bRVPR^4bRVPR.4bRVPR/4bRVbRVPRR4bRVPRR4bRVPRR4bRVPR/4b#uupi)�Create from dictionary.rzrSrTrUrVrWrX)rSrTrUrVrWrXrnrorprqrrrrsrtrurvrwrxryr{rfr|r}r~r)�getrNr$r�
fromisoformatr)�clsr�r�rzs&&  r"�	from_dict�Bullet.from_dict�s����h�h�3�R�8�
 74  
 75  �9��
��}�-�$,�R�0E�-F�$G�$&�'<�$=�&(�)@�&A� (� 6� 6�r�:K�7L� M�!#�$6�!7�

�9�	�
 76  
 77  ��
 78  ��f��
 79  ��L�)�
 80  ���O�
 81  �%�T�X�X�n�f�%E�F�	
 82 83  ����/�
 84  ������3�

 85  � �-�-�d�<�.@�A�
 86  � �-�-�d�<�.@�A�
 87  �!�.�.�t�M�/B�C�
 88  ����.�!�4�
 89  ����.�"�5�
 90  ��(�(�?�B�7�
 91  � 2�
 92  �#'�(�(�+B�C�"H�
 93  �#�h�h�':�C�@�
 94  � !�H�H�%6��<�!
 95  �"$(�8�8�,D�b�#I�#
 96  �	
 97  ��
 98  
 99  s�A!F?c�R<�V^8�dQh/S[;R&S[;R&S[;R&S[;R&S[S[,;R&S[S[,;R&S[;R&S[;R&S[;R	&S[;R
100  &S[S[,;R&S[S[S[3,;R&S[S[,;R
&S[	;R&S[	;R&S[	;R&S[S[S[	3,;R&#)rRrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~)
101  rYrrrrr[rr	rNrZ)r\r]s"�r"r^rkKs�����I���O���L���0��$�#��%�%�&�c��8�'�,�>�-�.�>�/�0�?�1�2��3�8�s�)�9�9�:��S��>�?�;�@�-�.�L�A�B!�&�C�D�"�E�J� �K�L!��e��,�J�Mr!r) rrrrrrrrqrrr�listrsrr`rtrurvrwrx�dictryrzr{r|r}r~r��classmethodr�rar rbrcs@r"rereKs������!,� 0� 0�L�"&�K�"�4�8�K�!����>�J� ����>�J�!�(�,�,�?�K��L�$�D�9�L�$)�$�$?�M�27�t�1L��#&��"��!�O�/4�T�/J��
102  �
103  �@� 
104  �� 
105  �S�r!rec��a�]tRt^�toRt]PtRtRt	]
106  !]PR7t
]
107  !]PR7t^tRtRtRtV3RlRlt]V3RlR	l4tV3R
108  ltRtVtR#)
�Edgez�
109  Connection between bullets with typed relationship and strength.
110  
111  Edges represent the structure of knowledge - how ideas relate.
112  Edge existence can flow through permeability (as pattern),
113  but edge content (why things connect) stays private.
114  ��?rOFrfc�6<�V^8�dQhRS[S[S[3,/#rhrj)r\r]s"�r"r^�Edge.__annotate__�s���
115  �
116  ��c�3�h��
117  r!c�r�RVPRVPRVPRVPPRVP
118  RVPRVPP4RVPP4R	VPR
119  VPRVPRVP/#)
rmrn�source_uuidrS�	edge_type�weight�
120  confidencert�last_traversed�traversal_count�	predictedrU�formation_surprise)rnr�rSr�rr�r�rtr�r�r�r�rUr�)r�s&r"r��Edge.to_dict�s���
�D�I�I��4�+�+��4�+�+�����-�-��d�k�k��$�/�/��$�/�/�3�3�5��d�1�1�;�;�=��t�3�3�����!�4�#;�#;� �$�"9�"9�

121122  r!c�:<�V^8�dQhRS[S[S[3,RR/#)rRr�rir�rj)r\r]s"�r"r^r��s#���
123  �
124  �T�#�s�(�^�
125  ��
126  r!c��V!VR,VR,VR,\VPRR44VPRR4VPRR4\P!VR	,4\P!VR
127  ,4VPR^4VPRR
4VPRR4VPRR4R7#)r�rnr�rSr�r-r�r�r�rtr�r�r�FrUrfr�)rnr�rSr�r�r�rtr�r�r�rUr�)r$r�rr�)r�r�s&&r"r��Edge.from_dict�s�����f���]�+��]�+��t�x�x��\�B�C��8�8�H�c�*��x�x��c�2��-�-�d�<�.@�A�#�1�1�$�7G�2H�I� �H�H�%6��:��h�h�{�E�2� $���)>�� D�#�x�x�(<�c�B�

128129  r!c�<�V^8�dQh/S[;R&S[;R&S[;R&S[;R&S[;R&S[;R&S[;R&S[;R&S[;R	&S[;R
130  &S[;R&S[;R&#)
rRrnr�rSr�r�r�rtr�r�r�rUr�)rYr$rZrr[�bool)r\r]s"�r"r^r��s������I���������-��"
��#�$��%�*�>�+�,�B�-�.��/�4��5�6�$�7�8�#�9r!rN)rrrrrr$rAr�r�r�rrr`rtr�r�r�rUr�r�r�r�rar rbrcs@r"r�r��s�����#�-�-�I��F��J�!����>�J�$�X�\�\�B�N��O��I�!$�� #��
131  �
132  �"�
133  ��
134  �a�r!r�N)r�dataclassesrrr�enumr�typingrrrr	rr$rNrer�rr!r"�<module>r�s����)���,�,��$�� �t� �F������h
135  �h
136  ��h
137  �V�>
138  �>
139  ��>
140  r!