From f04e2161b9008305ee5924572680a0a6417f6445 Mon Sep 17 00:00:00 2001 From: koen666 Date: Mon, 6 Apr 2026 21:46:23 +0800 Subject: [PATCH 1/3] Fix startup resilience for optional deps and schema state --- agents/domain_summary_agent.py | 4 ++-- db/evidence_graph.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/agents/domain_summary_agent.py b/agents/domain_summary_agent.py index b3f671e..8817cdf 100644 --- a/agents/domain_summary_agent.py +++ b/agents/domain_summary_agent.py @@ -1,6 +1,4 @@ """Generate plain-language domain summaries and research opportunities.""" -from agents.llm_client import call_llm_json - SYSTEM_PROMPT = """You explain research landscapes to non-specialists. @@ -44,6 +42,8 @@ def generate_domain_summary(node: dict, snapshot: dict) -> tuple[dict, int]: """Generate a node summary from structured evidence.""" + from agents.llm_client import call_llm_json + papers = snapshot.get("papers", []) paper_lines = [] for idx, paper in enumerate(papers[:12], start=1): diff --git a/db/evidence_graph.py b/db/evidence_graph.py index fd59714..f7f45a7 100644 --- a/db/evidence_graph.py +++ b/db/evidence_graph.py @@ -381,6 +381,12 @@ def _candidate_block_keys(entity: dict) -> set[str]: def list_merge_candidates(status: str = "pending", limit: int = 100, entity_type: str | None = None) -> list[dict]: """List merge candidates with display metadata.""" + table_exists = db.fetchone( + "SELECT name FROM sqlite_master WHERE type='table' AND name='entity_merge_candidates'" + ) + if not table_exists: + return [] + sql = """ SELECT emc.*, p.canonical_name AS primary_name, p.entity_type AS primary_type, @@ -453,6 +459,12 @@ def _collect_entity_context(entity_id: str, limit: int = 5) -> dict: def get_merge_candidate_context(candidate_id: int) -> dict | None: """Return a merge candidate plus supporting node/paper/relation context.""" + table_exists = db.fetchone( + "SELECT name FROM sqlite_master WHERE type='table' AND name='entity_merge_candidates'" + ) + if not table_exists: + return None + row = db.fetchone( """SELECT emc.*, p.canonical_name AS primary_name, p.entity_type AS primary_type, p.aliases AS primary_aliases, From 78a5b0ebcb57b45ced3d9e6d4905c599d30199fd Mon Sep 17 00:00:00 2001 From: koen666 Date: Tue, 7 Apr 2026 00:28:11 +0800 Subject: [PATCH 2/3] Add VS Code Power Query symbol settings --- .../excel-pq-symbols/excel-pq-symbols.json | 31 +++++++++++++++++++ .vscode/settings.json | 5 +++ 2 files changed, 36 insertions(+) create mode 100644 .vscode/excel-pq-symbols/excel-pq-symbols.json create mode 100644 .vscode/settings.json diff --git a/.vscode/excel-pq-symbols/excel-pq-symbols.json b/.vscode/excel-pq-symbols/excel-pq-symbols.json new file mode 100644 index 0000000..a94b204 --- /dev/null +++ b/.vscode/excel-pq-symbols/excel-pq-symbols.json @@ -0,0 +1,31 @@ +[ + { + "name": "Excel.CurrentWorkbook", + "documentation": { + "description": "Returns the contents of the current Excel workbook.", + "longDescription": "Returns tables, named ranges, and dynamic arrays. Unlike Excel.Workbook, it does not return sheets.", + "category": "Accessing data" + }, + "functionParameters": [], + "completionItemKind": 3, + "isDataSource": true, + "type": "table" + }, + { + "name": "Documentation", + "documentation": { + "description": "Contains properties for function documentation metadata", + "category": "Documentation" + }, + "functionParameters": [], + "completionItemKind": 9, + "isDataSource": false, + "type": "record", + "fields": { + "Name": { "type": "text" }, + "Description": { "type": "text" }, + "Parameters": { "type": "record" } + } + } + +] \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..10678e7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "powerquery.client.additionalSymbolsDirectories": [ + "/Users/heke/Deepgraph/.vscode/excel-pq-symbols" + ] +} \ No newline at end of file From d023e01df09d2688dc8aabf8c33fa25c4a29af74 Mon Sep 17 00:00:00 2001 From: koen666 Date: Tue, 7 Apr 2026 00:35:34 +0800 Subject: [PATCH 3/3] Add @koen666 to CLA signers --- cla-signers.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cla-signers.json b/cla-signers.json index 06f8c29..e6758e4 100644 --- a/cla-signers.json +++ b/cla-signers.json @@ -1,4 +1,8 @@ { "format_version": 1, - "signers": [] + "signers": [ + { + "github": "koen666" + } + ] }