-
Notifications
You must be signed in to change notification settings - Fork 6
fix: P0 items — LLM budget plumbing, bulk ingest, CCCS regex hardening #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
b8cbc50
9f4c97f
b4f0d10
7bb4359
70d2182
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1180,6 +1180,37 @@ def _drain_enrichment_queue(self) -> None: | |
| except Exception: | ||
| self._logger.warning("enrichment_drain_failed", exc_info=True) | ||
|
|
||
| def flush(self) -> None: | ||
| """Process all pending enrichment jobs synchronously (blocking). | ||
|
|
||
| Intended for bulk-ingest callers that passed ``sync=False`` to | ||
| :meth:`remember` and want to guarantee all enrichment work is | ||
| complete before returning (e.g. before exiting a CLI command or | ||
| integration test). | ||
|
|
||
| This is identical to the atexit drain but without a deadline — it | ||
| blocks until the queue is empty. | ||
| """ | ||
| while not self._enrichment_queue.empty(): | ||
| try: | ||
| job = self._enrichment_queue.get_nowait() | ||
| if job.defer: | ||
| self._enrichment_queue.task_done() | ||
| continue | ||
| if job.job_type == "neighbor_evolution": | ||
| self._run_evolution(job) | ||
| elif job.job_type == "llm_ner": | ||
| self._run_llm_ner(job) | ||
| else: | ||
| self._run_enrichment(job) | ||
| self._enrichment_queue.task_done() | ||
| except queue.Empty: | ||
|
Comment on lines
+1183
to
+1207
|
||
| break | ||
| except BackendClosedError: | ||
| return | ||
| except Exception: | ||
| self._logger.warning("enrichment_flush_failed", exc_info=True) | ||
|
|
||
| def evolve_note(self, note_id: str, sync: bool = False) -> dict | None: | ||
| """Trigger neighbor evolution for an existing note. | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.