943acbc573
Durcit la convention de nommage des projets (dérive constatée : 'Sliding Automation', 'code_versioning'... au lieu des formes canoniques). - trilium_api.py : projets_canoniques() lit le référentiel = valeurs du label projet sur les notes de type=projet (source unique, pas de constante en dur). Note-projet CodeVersioning créée (manquait). - mcp_server.py : _valider_projet() branché dans les 6 tools de création (add_decision/history/backlog, new_conversation, create_entite, add_skill). Refuse un projet non canonique (suggestion si faute) ou inconnu (renvoi au processus de création de projet). Ne verrouille pas si référentiel illisible. - lint_audit.py : VAL-nommage aligné sur le référentiel (attrape casse, espace ET snake_case ; l'ancien 'contient un espace' ratait code_versioning). - Données : 79 notes ré-étiquetées vers les 3 formes canoniques. Quality by design : l'erreur de nommage devient impossible à l'écriture, le Lint n'est plus que le filet de sécurité.
73 lines
1.8 KiB
Cython
73 lines
1.8 KiB
Cython
@cython.no_gc_clear
|
|
cdef class UVCheck(UVHandle):
|
|
cdef _init(self, Loop loop, Handle h):
|
|
cdef int err
|
|
|
|
self._start_init(loop)
|
|
|
|
self._handle = <uv.uv_handle_t*>PyMem_RawMalloc(sizeof(uv.uv_check_t))
|
|
if self._handle is NULL:
|
|
self._abort_init()
|
|
raise MemoryError()
|
|
|
|
err = uv.uv_check_init(self._loop.uvloop, <uv.uv_check_t*>self._handle)
|
|
if err < 0:
|
|
self._abort_init()
|
|
raise convert_error(err)
|
|
|
|
self._finish_init()
|
|
|
|
self.h = h
|
|
self.running = 0
|
|
|
|
cdef inline stop(self):
|
|
cdef int err
|
|
|
|
if not self._is_alive():
|
|
self.running = 0
|
|
return
|
|
|
|
if self.running == 1:
|
|
err = uv.uv_check_stop(<uv.uv_check_t*>self._handle)
|
|
self.running = 0
|
|
if err < 0:
|
|
exc = convert_error(err)
|
|
self._fatal_error(exc, True)
|
|
return
|
|
|
|
cdef inline start(self):
|
|
cdef int err
|
|
|
|
self._ensure_alive()
|
|
|
|
if self.running == 0:
|
|
err = uv.uv_check_start(<uv.uv_check_t*>self._handle,
|
|
cb_check_callback)
|
|
if err < 0:
|
|
exc = convert_error(err)
|
|
self._fatal_error(exc, True)
|
|
return
|
|
self.running = 1
|
|
|
|
@staticmethod
|
|
cdef UVCheck new(Loop loop, Handle h):
|
|
cdef UVCheck handle
|
|
handle = UVCheck.__new__(UVCheck)
|
|
handle._init(loop, h)
|
|
return handle
|
|
|
|
|
|
cdef void cb_check_callback(
|
|
uv.uv_check_t* handle,
|
|
) noexcept with gil:
|
|
if __ensure_handle_data(<uv.uv_handle_t*>handle, "UVCheck callback") == 0:
|
|
return
|
|
|
|
cdef:
|
|
UVCheck check = <UVCheck> handle.data
|
|
Handle h = check.h
|
|
try:
|
|
h._run()
|
|
except BaseException as ex:
|
|
check._error(ex, False)
|