From 27c7a6f641b0491ed10354df1f9ebd469c2b42fb Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Wed, 7 Jan 2026 00:09:09 +0400 Subject: [PATCH 01/11] double getter stub --- src/cutils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cutils.cpp b/src/cutils.cpp index cd11595..9880a9c 100644 --- a/src/cutils.cpp +++ b/src/cutils.cpp @@ -43,6 +43,12 @@ namespace utils { { return sqlite3_column_int64(ref(), i); } +#if 0 + double SqliteStmt::getDouble(int i) const + { + + } +#endif } std::string utils::currentTimestamp() From a58dff2a761ab328e4999dfde014e3743b6fc4ed Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Wed, 7 Jan 2026 00:09:50 +0400 Subject: [PATCH 02/11] Fix in related file handling --- src/httpserver.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 8e1d55f..f1ebd05 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -447,8 +447,14 @@ namespace { allFullSources = sources; for (const auto &src : sources) { auto relations = app.sourceProcessor().filterRelatedSources(trackedSources, src); - vecAddIfUnique(relSources, relations); - vecAddIfUnique(allFullSources, relations); + //vecAddIfUnique(relSources, relations); + //vecAddIfUnique(allFullSources, relations); + for (const auto &rel : relations) { + if (!vecContains(sources, rel)) { + vecAddIfUnique(relSources, rel); + vecAddIfUnique(allFullSources, rel); + } + } } for (const auto &rel : relSources) { @@ -1100,7 +1106,7 @@ bool HttpServer::startServer() std::string prefix = request["prefix"].get(); std::string suffix = request["suffix"].get(); std::string filename = request.value("filename", std::string{}); - filename = std::filesystem::path(filename).lexically_normal().string(); + filename = std::filesystem::path(filename).lexically_normal().generic_string(); if (request.value("encoding", "") == "base64") { prefix = base64_decode(prefix); @@ -1116,10 +1122,10 @@ bool HttpServer::startServer() const auto searchResults = processInputResults(imp->app_, apiConfig, prefix, {}, {filename}, contextSizeRatio, {}, nullptr); - LOG_MSG << "Generating FIM with prefix length " << prefix.size() << " and suffix length " << suffix.size(); + LOG_MSG << "Generating FIM with prefix length" << prefix.size() << "and suffix length" << suffix.size(); CompletionClient completionClient(apiConfig, imp->app_.settings().generationTimeoutMs(), imp->app_); std::string fullResponse = completionClient.generateFim(prefix, suffix, stops, temperature, maxTokens, searchResults.first); - LOG_MSG << "[FIM] Generated tokens: " << imp->app_.tokenizer().countTokensWithVocab(fullResponse); + LOG_MSG << "[FIM] Generated tokens:" << imp->app_.tokenizer().countTokensWithVocab(fullResponse); json response = { {"completion", fullResponse} }; res.set_content(response.dump(), "application/json"); Impl::requestCounter_++; From c61cebe6d44e42a444fdb6b23f02014b8d1fee58 Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Wed, 7 Jan 2026 00:10:05 +0400 Subject: [PATCH 03/11] minor change --- .../assets/phenixcode_projects/settings.json | 46 +++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/ui/dashboard/webview/assets/phenixcode_projects/settings.json b/ui/dashboard/webview/assets/phenixcode_projects/settings.json index 12f38fe..dbb61ba 100644 --- a/ui/dashboard/webview/assets/phenixcode_projects/settings.json +++ b/ui/dashboard/webview/assets/phenixcode_projects/settings.json @@ -43,10 +43,28 @@ "output": 0 } }, + { + "api_key": "", + "api_url": "http://127.0.0.1:8587/v1/chat/completions", + "enabled": true, + "id": "local-fim-gemma", + "model": "codegemma-2b-fim", + "name": "Local", + "pricing_tpm": { + "input": 0, + "output": 0 + }, + "fim": { + "api_url": "http://127.0.0.1:8587/v1/completions", + "format": "<|fim_prefix|>{}<|fim_suffix|>{}<|fim_middle|>", + "file_divider_token": "<|file_separator|>", + "stop_tokens": ["return", "<|fim_prefix|>", "<|fim_middle|>"] + } + }, { "api_key": "${MISTRAL_API_KEY}", "api_url": "https://api.mistral.ai/v1/chat/completions", - "id": "mistral-devstral", + "id": "mistral-devstral-small", "model": "devstral-small-latest", "name": "Mistral", "pricing_tpm": { @@ -77,8 +95,8 @@ { "api_key": "${GEMINI_API_KEY}", "api_url": "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions", - "id": "gemini-2.0-flash", - "model": "gemini-2.0-flash", + "id": "gemini-2.5-flash", + "model": "gemini-2.5-flash", "name": "Gemini", "pricing_tpm": { "input": 0.1, @@ -125,7 +143,21 @@ "output": 0.6 }, "context_length": 128000 - } + }, + { + "api_key": "${MINIMAX_API_KEY}", + "api_url": "https://api.x.ai/v1/chat/completions", + "context_length": 204000, + "enabled": true, + "id": "minimax-m2.1", + "model": "MiniMax-M2.1", + "name": "Minimax", + "pricing_tpm": { + "cached_input": 0.03, + "input": 0.3, + "output": 1.2 + } + }, ], "current_api": "mistral-devstral", "timeout_ms": 120000, @@ -166,9 +198,7 @@ "paths":[ { "exclude": [ - "*/dist/*", - "*/test/*", - "*/3rdparty/*" + ], "extensions": [], "path": "./", @@ -183,7 +213,7 @@ "*/debug/*", "*/release/*", "*/lib/*", "*/docker/*", "*/fonts/*", "*/images/*", "*/test/*","*/tests/*", "*/example/*", "*/examples/*", "*/obj/*", "*/build_dbg/*", "*/build_rel/*", - "*/bin/*" + "*/bin/*", "*/dist/*", "*/test/*", "*/3rdparty/*" ], "encoding": "utf-8", "max_file_size_mb": 10 From d8db62dcec547226f48e9d42622f28adaf0f00ab Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Wed, 7 Jan 2026 00:10:37 +0400 Subject: [PATCH 04/11] minor change - removing extra spacing in log texts --- src/inference.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/inference.cpp b/src/inference.cpp index 7ab226a..260a5f9 100644 --- a/src/inference.cpp +++ b/src/inference.cpp @@ -46,7 +46,7 @@ std::pair InferenceClient::Impl::httpClientForUr urlToClient_.emplace(schemaHostPort, std::move(client)); return { ptr, path }; } catch (const std::exception &e) { - LOG_MSG << "Error initializing http client for " << schemaHostPort << ": " << e.what(); + LOG_MSG << "Error initializing http client for" << schemaHostPort << ":" << e.what(); return { nullptr, "" }; } } @@ -112,7 +112,7 @@ void EmbeddingClient::generateEmbeddings(const std::vector &texts, for (size_t j = 0; j < texts.size(); j ++) { assert(j < response.size()); if (response.size() <= j) { - LOG_MSG << "Not enough entries in the embedding response (asked for" << texts.size() << " but got" << response.size() << "). Skipped"; + LOG_MSG << "Not enough entries in the embedding response (asked for" << texts.size() << "but got" << response.size() << "). Skipped"; break; } const auto &item = response[j]; @@ -138,10 +138,9 @@ void EmbeddingClient::generateEmbeddings(const std::vector &texts, //float l2Norm = calculateL2Norm(embedding); //std::cout << "[l2norm] " << l2Norm << std::endl; } catch (const nlohmann::json::exception &e) { - LOG_MSG << "JSON parsing error: " << e.what(); + LOG_MSG << "JSON parsing error:" << e.what(); throw std::runtime_error("Failed to parse server response"); } catch (const std::exception &e) { - //LOG_MSG << "Error generating embeddings: " << e.what(); throw; } } @@ -262,7 +261,7 @@ namespace { } } } catch (const std::exception &e) { - LOG_MSG << "Error parsing chunk: " << e.what() << " in: " << jsonStr; + LOG_MSG << "Error parsing chunk" << e.what() << " in" << jsonStr; } } } @@ -387,7 +386,7 @@ std::string CompletionClient::generateCompletion( } } } catch (const std::exception &e) { - LOG_MSG << "Error parsing chunk: " << e.what() << " in: " << jsonStr; + LOG_MSG << "Error parsing chunk" << e.what() << "in" << jsonStr; } } } @@ -535,7 +534,7 @@ std::string CompletionClient::generateFim( // fallback, assuming the response is SSE stream fullResponse = processSSEData(res->body.c_str(), res->body.length(), nullptr); } catch (const std::exception &ex) { - LOG_MSG << "Error processing response: " << ex.what(); + LOG_MSG << "Error processing response:" << ex.what(); } } if (!fullResponse.empty()) { @@ -607,6 +606,6 @@ std::string CompletionClient::buildContext(const std::vector &sear nofTokens += labelTokens + contentTokens; context += fileDivider + labeledFull + "\n\n"; } - LOG_MSG << "[context] Total tokens in context: " << nofTokens; + LOG_MSG << "[context] Total tokens in context:" << nofTokens; return context; } From ddebb0a76f591da46934c987de6ab6296095c867 Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sat, 10 Jan 2026 00:06:22 +0400 Subject: [PATCH 05/11] basic unit tests --- src/tests.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/tests.cpp diff --git a/src/tests.cpp b/src/tests.cpp new file mode 100644 index 0000000..05dcfc6 --- /dev/null +++ b/src/tests.cpp @@ -0,0 +1,68 @@ +#include "cutils.h" + +#include +#include +#include + +namespace { + + struct TestCase { + const char *name; + std::string input; + std::string expected; + }; + + bool test_stripMarkdownFromCodeBlock(const TestCase &t) { + auto out = utils::stripMarkdownFromCodeBlock(t.input); + bool ok = (out == t.expected); + if (ok) { + std::cout << "[PASS] " << t.name << "\n"; + } else { + utils::stripMarkdownFromCodeBlock(t.input); + + std::cout << "[FAIL] " << t.name << "\n"; + std::cout << " input : " << t.input << "\n"; + std::cout << " expected: " << t.expected << "\n"; + std::cout << " got : " << out << "\n"; + } + return ok; + } + +} // anonymous namespace + + +void runUnitTests() { + std::vector tests = { + { "short_string_less_than_6", "abc", "abc" }, + { "not_starting_with_fence", "`` code ```", "`` code ```" }, + { "single_line_fenced", "```code```", "code" }, + { "fenced_with_language_and_trailing_newline", + "```cpp\nint x = 1;\n```", + "int x = 1;" }, + { "fenced_without_language", + "```\nline\n```", + "line" }, + { "closing_fence_with_trailing_whitespace", + "```py\nprint(1)\n``` \n", + "print(1)" }, + { "closing_fence_with_extra_content_after => unchanged", + "```js\nvar a = 2;\n```\nEXTRA", + "```js\nvar a = 2;\n```\nEXTRA" }, + { "no_closing_fence => unchanged", + "```cpp\nint a = 0;\n", + "```cpp\nint a = 0;\n" }, + { "empty_inner_block_behaviour (implementation returns original)", + "```\n```", + "```\n```" }, + { "language_with_surrounding_whitespace", + "``` cpp \nvoid f();\n\n```", + "void f();\n" } + }; + + int passed = 0; + for (const auto &t : tests) { + if (test_stripMarkdownFromCodeBlock(t)) ++passed; + } + + std::cout << "\nSummary: " << passed << " / " << tests.size() << " passed.\n"; +} \ No newline at end of file From ef5e031751d2ae7257543b124e9bfce98d8eab94 Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sat, 10 Jan 2026 00:06:43 +0400 Subject: [PATCH 06/11] added src/tests.cpp --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1d9b51..8f1bea1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ add_executable(${PROJECT_NAME} src/auth.cpp src/instregistry.cpp src/cutils.cpp + src/tests.cpp ) # Link libraries From 56a18d296721b2dea8547a018c08e502cffde28d Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sat, 10 Jan 2026 00:07:13 +0400 Subject: [PATCH 07/11] running unit tests in debug builds --- src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 439804b..52e9246 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,10 @@ #include "app.h" #include +#ifdef _DEBUG +extern void runUnitTests(); +#endif + //#define TEST_CHUNKING #ifdef TEST_CHUNKING @@ -60,5 +64,9 @@ int main(int argc, char *argv[]) { #endif +#ifdef _DEBUG + runUnitTests(); +#endif + return App::run(argc, argv); } \ No newline at end of file From 9b83b00236541441ca3e53a4107b9f4c09991cfc Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sat, 10 Jan 2026 00:07:55 +0400 Subject: [PATCH 08/11] Better RAAI for instance register/unregister. Better logs --- include/instregistry.h | 6 --- src/app.cpp | 1 - src/cutils.cpp | 59 ++++++++++++++++------------ src/instregistry.cpp | 88 +++++++++++++++++++++++------------------- 4 files changed, 83 insertions(+), 71 deletions(-) diff --git a/include/instregistry.h b/include/instregistry.h index 3aaa97f..d8606ab 100644 --- a/include/instregistry.h +++ b/include/instregistry.h @@ -22,15 +22,9 @@ class InstanceRegistry { InstanceRegistry(InstanceRegistry &&) = default; InstanceRegistry &operator=(InstanceRegistry &&) = default; - void startHeartbeat(); - void stopHeartbeat(); std::vector getActiveInstances() const; std::string getInstanceId() const; -private: - void registerInstance(int port, int watchInterval, const Settings &settings); - void unregister(); - private: struct Impl; std::unique_ptr imp; diff --git a/src/app.cpp b/src/app.cpp index 18c6863..a831a59 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -837,7 +837,6 @@ void App::serve(int suggestedPort, bool watch, int interval, const std::string & if (0 < newPort) { imp->registry_ = std::make_unique(newPort, watch ? interval : 0, settings()); try { - imp->registry_->startHeartbeat(); LOG_MSG << "\nStarting HTTP API server on port " << newPort << "..."; imp->httpServer_->startServer(); } catch (const std::exception &e) { diff --git a/src/cutils.cpp b/src/cutils.cpp index 9880a9c..a495af4 100644 --- a/src/cutils.cpp +++ b/src/cutils.cpp @@ -16,6 +16,26 @@ #include #endif +namespace { + void trimmedViewLeading(std::string_view &v) { + size_t start = 0; + size_t end = v.size(); + while (start < end && std::isspace(static_cast(v[start]))) ++start; + v = v.substr(start, end - start); + } + + void trimmedViewTrailing(std::string_view &v) { + size_t end = v.size(); + while (end > 0 && std::isspace(static_cast(v[end - 1]))) --end; + v = v.substr(0, end); + } + + void trimmedView(std::string_view &v) { + trimmedViewLeading(v); + trimmedViewTrailing(v); + } +} // anonymous namespace + namespace utils { SqliteStmt::~SqliteStmt() { @@ -217,17 +237,16 @@ std::string utils::addLineComments(std::string_view code, std::string_view filen std::string utils::stripMarkdownFromCodeBlock(std::string_view code) { - if (code.length() < 6) { // too short for ```...\n``` + auto codeTrimmed = code; + trimmedView(codeTrimmed); + if (codeTrimmed.length() < 6) { return std::string(code); } - - if (!code.starts_with("```")) { + if (!codeTrimmed.starts_with("```")) { return std::string(code); } - - // Find the end of the opening fence line - size_t fence_end = code.find('\n', 3); - if (fence_end == std::string_view::npos) { + size_t fenceEnd = code.find('\n', 3); + if (fenceEnd == std::string_view::npos) { // No newline after opening ``` -> maybe single-line or malformed if (code.ends_with("```")) { // ```code``` @@ -237,25 +256,17 @@ std::string utils::stripMarkdownFromCodeBlock(std::string_view code) } // Extract language tag if present (e.g. "cpp", "python", empty) - std::string_view lang = code.substr(3, fence_end - 3); - // Trim whitespace from lang (optional, but helps robustness) - while (!lang.empty() && std::isspace(static_cast(lang.front()))) { - lang.remove_prefix(1); - } - while (!lang.empty() && std::isspace(static_cast(lang.back()))) { - lang.remove_suffix(1); - } + std::string_view lang = code.substr(3, fenceEnd - 3); + trimmedView(lang); - // Now find closing fence // We look for \n``` at the end, possibly followed by optional whitespace/newline - size_t closing_pos = code.rfind("\n```"); - if (closing_pos == std::string_view::npos || closing_pos <= fence_end) { - // No matching closing fence found + size_t closingPos = code.rfind("\n```"); + if (closingPos == std::string_view::npos || closingPos <= fenceEnd) { return std::string(code); } // Check if the closing fence is at the end (or only whitespace after) - std::string_view tail = code.substr(closing_pos + 4); // after \n``` + std::string_view tail = code.substr(closingPos + 4); // after \n``` bool tail_is_empty_or_ws = tail.empty() || std::all_of(tail.begin(), tail.end(), [](unsigned char c) { return std::isspace(c); }); @@ -265,12 +276,10 @@ std::string utils::stripMarkdownFromCodeBlock(std::string_view code) return std::string(code); } - // Extract content between opening fence newline and closing fence - size_t content_start = fence_end + 1; - size_t content_length = closing_pos - content_start; + size_t contentStart = fenceEnd + 1; + size_t contentLength = closingPos - contentStart; - std::string_view inner = code.substr(content_start, content_length); + std::string_view inner = code.substr(contentStart, contentLength); - // If the inner content ends with newline before closing fence, keep it consistent return std::string(inner); } diff --git a/src/instregistry.cpp b/src/instregistry.cpp index 27a4bf9..89f6cbb 100644 --- a/src/instregistry.cpp +++ b/src/instregistry.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -109,23 +110,33 @@ struct InstanceRegistry::Impl { std::atomic_bool running_{ false }; sqlite3 *db_{ nullptr }; mutable std::mutex dbMutex_; - bool bRegistered_ = false; - explicit Impl(const std::string &path) - : registryPath_(path) { + explicit Impl(const std::string &path) : registryPath_(path) + { if (path.empty()) { registryPath_ = getRegistryPath(); } - instanceId_ = generateInstanceId(); initializeDatabase(); } + Impl(const std::string &path, int port, int watchInterval, const Settings &settings) : Impl(path) + { + if (db_) { + instanceId_ = generateInstanceId(); + cleanStaleInstances(); + logAuditTrail(events::Startup, "Instance registry-tracking started"); + registerInstance(port, watchInterval, settings); + startHeartbeat(); + } + } + ~Impl() { - stopHeartbeat(); - if (bRegistered_) - unregister(); if (db_) { - logAuditTrail(events::Shutdown, "Instance registry shutting down"); + if (!instanceId_.empty()) { + stopHeartbeat(); + unregister(); + logAuditTrail(events::Shutdown, "Instance registry-tracking ended"); + } sqlite3_close(db_); } } @@ -140,6 +151,7 @@ struct InstanceRegistry::Impl { int rc = sqlite3_open(registryPath_.c_str(), &db_); if (rc != SQLITE_OK) { LOG_MSG << "[REGISTRY] Failed to open registry database:" << sqlite3_errmsg(db_); + db_ = nullptr; throw std::runtime_error("Failed to open registry database"); } @@ -195,11 +207,6 @@ struct InstanceRegistry::Impl { sqlite3_free(errMsg); throw std::runtime_error("Failed to create database tables"); } - - logAuditTrail(events::Startup, "Instance registry initialized"); - - // Clean up stale instances on startup - cleanStaleInstances(); } static std::string generateInstanceId() { @@ -242,10 +249,35 @@ struct InstanceRegistry::Impl { std::lock_guard lock(dbMutex_); { + // Step 0: Identify and log instances with old heartbeats before deletion + const char *selectOldSQL = "SELECT id, pid, name, last_heartbeat FROM instances WHERE id != ? AND(strftime('%s', 'now') - last_heartbeat) > 120"; + utils::SqliteStmt selectStmt(db_); + int rc = sqlite3_prepare_v2(db_, selectOldSQL, -1, &selectStmt.ref(), nullptr); + if (rc != SQLITE_OK) { + LOG_MSG << "[REGISTRY] Failed to prepare select statement for stale instances:" << sqlite3_errmsg(db_); + return; + } + sqlite3_bind_text(selectStmt.ref(), 1, instanceId_.c_str(), -1, SQLITE_STATIC); + + std::vector staleInstances; + while (sqlite3_step(selectStmt.ref()) == SQLITE_ROW) { + nlohmann::json instance; + instance["id"] = reinterpret_cast(sqlite3_column_text(selectStmt.ref(), 0)); + instance["pid"] = sqlite3_column_int(selectStmt.ref(), 1); + instance["name"] = reinterpret_cast(sqlite3_column_text(selectStmt.ref(), 2)); + instance["last_heartbeat"] = sqlite3_column_int64(selectStmt.ref(), 3); + staleInstances.push_back(instance); + } + + for (const auto &inst : staleInstances) { + LOG_MSG << "[REGISTRY] Stale instance to be deleted: id=" << inst["id"] << ", pid=" << inst["pid"] << ", name=" << inst["name"]; + logAuditTrail(events::Cleanup, "Stale instance to be deleted", inst); + } + // Step 1: Remove instances with old heartbeats const char *cleanOldSQL = "DELETE FROM instances WHERE id != ? AND(strftime('%s', 'now') - last_heartbeat) > 120"; utils::SqliteStmt stmt(db_); - int rc = sqlite3_prepare_v2(db_, cleanOldSQL, -1, &stmt.ref(), nullptr); + rc = sqlite3_prepare_v2(db_, cleanOldSQL, -1, &stmt.ref(), nullptr); if (rc != SQLITE_OK) { LOG_MSG << "[REGISTRY] Failed to prepare clean statement:" << sqlite3_errmsg(db_); return; @@ -295,7 +327,7 @@ struct InstanceRegistry::Impl { if (0 < sqlite3_changes(db_)) { LOG_MSG << "[REGISTRY] Deleted stale instance with dead process:" << id; - logAuditTrail(events::Cleanup, "Deleted stale instance with dead process: " + id); + logAuditTrail(events::Cleanup, "Deleted stale instance with dead process", { id }); } } } @@ -371,7 +403,7 @@ struct InstanceRegistry::Impl { } if (0 < sqlite3_changes(db_)) { LOG_MSG << "[REGISTRY] Unregistered instance:" << instanceId_; - logAuditTrail(events::Unregister, "Unregistered instance"); + logAuditTrail(events::Unregister, "Unregistered instance", { instanceId_ }); } else { LOG_MSG << "[REGISTRY] Instance not found for unregistration:" << instanceId_; } @@ -491,34 +523,12 @@ InstanceRegistry::InstanceRegistry(const std::string ®istryPath) } InstanceRegistry::InstanceRegistry(int port, int watchInterval, const Settings &settings, const std::string ®istryPath) - : imp(std::make_unique(registryPath)) + : imp(std::make_unique(registryPath, port, watchInterval, settings)) { - imp->bRegistered_ = true; - registerInstance(port, watchInterval, settings); } InstanceRegistry::~InstanceRegistry() = default; -void InstanceRegistry::registerInstance(int port, int watchInterval, const Settings &settings) -{ - imp->registerInstance(port, watchInterval, settings); -} - -void InstanceRegistry::unregister() -{ - imp->unregister(); -} - -void InstanceRegistry::startHeartbeat() -{ - imp->startHeartbeat(); -} - -void InstanceRegistry::stopHeartbeat() -{ - imp->stopHeartbeat(); -} - std::vector InstanceRegistry::getActiveInstances() const { return imp->getActiveInstances(); From eaddf11168ded7c5fe7bd998744783d1eff9eae6 Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sat, 10 Jan 2026 20:26:37 +0400 Subject: [PATCH 09/11] temporary minor change --- ui/dashboard/webview/admconfig.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/dashboard/webview/admconfig.json b/ui/dashboard/webview/admconfig.json index 3d7f601..b0b79b9 100644 --- a/ui/dashboard/webview/admconfig.json +++ b/ui/dashboard/webview/admconfig.json @@ -1,21 +1,21 @@ { "uiPrefs": [ - { - "key": "WatchForChanges", - "value": "0" - }, { "key": "darkOrLight", "value": "light" }, { - "key": "EmbedderExecutablePath", - "value": "../../../../build_dbg/Debug/phenixcode-core.exe" + "key": "WatchForChanges", + "value": "0" }, { "key": "theme", "value": "hamlindigo" }, + { + "key": "EmbedderExecutablePath", + "value": "../../../../build_dbg/Debug/phenixcode-core.exe" + }, { "key": "EmbedderSettingsFilePaths", "value": "[\"./settings.json\"]" From 4ba4b037092244f5e4122f03c580b4080d504559 Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sat, 10 Jan 2026 20:27:06 +0400 Subject: [PATCH 10/11] Added */cmake-build/* to exclusions --- assets/settings.json | 6 ++---- assets/settings.template.json | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/assets/settings.json b/assets/settings.json index dbb61ba..8b7fdd2 100644 --- a/assets/settings.json +++ b/assets/settings.json @@ -197,9 +197,7 @@ "project_description": "", "paths":[ { - "exclude": [ - - ], + "exclude": [], "extensions": [], "path": "./", "recursive": true, @@ -213,7 +211,7 @@ "*/debug/*", "*/release/*", "*/lib/*", "*/docker/*", "*/fonts/*", "*/images/*", "*/test/*","*/tests/*", "*/example/*", "*/examples/*", "*/obj/*", "*/build_dbg/*", "*/build_rel/*", - "*/bin/*", "*/dist/*", "*/test/*", "*/3rdparty/*" + "*/bin/*", "*/dist/*", "*/test/*", "*/3rdparty/*", "*/cmake-build/*" ], "encoding": "utf-8", "max_file_size_mb": 10 diff --git a/assets/settings.template.json b/assets/settings.template.json index 90e4dec..f4621d0 100644 --- a/assets/settings.template.json +++ b/assets/settings.template.json @@ -212,8 +212,7 @@ "project_description": "", "paths":[ { - "exclude": [ - ], + "exclude": [], "extensions": [], "path": "./", "recursive": true, @@ -227,7 +226,7 @@ "*/debug/*", "*/release/*", "*/lib/*", "*/docker/*", "*/fonts/*", "*/images/*", "*/test/*","*/tests/*", "*/example/*", "*/examples/*", "*/obj/*", "*/build_dbg/*", "*/build_rel/*", - "*/dist/*", "*/test/*", "*/3rdparty/*" + "*/dist/*", "*/test/*", "*/3rdparty/*", "*/cmake-build/*" ], "encoding": "utf-8", "max_file_size_mb": 10 From c764664753de5286eb765971891262e5779717e5 Mon Sep 17 00:00:00 2001 From: Arman Sahakyan Date: Sun, 11 Jan 2026 01:27:31 +0400 Subject: [PATCH 11/11] Fixed propery gui update after add/remove of excludes/extensions etc. --- .../spa-svelte/src/lib/widgets/project-panels/Database.svelte | 2 +- .../spa-svelte/src/lib/widgets/project-panels/Embedding.svelte | 1 + .../spa-svelte/src/lib/widgets/project-panels/Generation.svelte | 1 + .../spa-svelte/src/lib/widgets/project-panels/Source.svelte | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Database.svelte b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Database.svelte index e0cf05c..b85115a 100644 --- a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Database.svelte +++ b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Database.svelte @@ -3,7 +3,7 @@ import * as icons from "@lucide/svelte"; import { selectedProject } from "../../store"; import type { DatabaseSettings } from "../../../app"; - import { helper_checkPathExists, helper_saveProjectSettings, isParentDirValid } from "../../utils"; + import { helper_saveProjectSettings, isParentDirValid } from "../../utils"; const projectTitle = $derived($selectedProject?.jsonData.source.project_title); diff --git a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Embedding.svelte b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Embedding.svelte index ac1fa5a..738a9d0 100644 --- a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Embedding.svelte +++ b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Embedding.svelte @@ -87,6 +87,7 @@ function onChange() { if ($selectedProject) { + $selectedProject = $selectedProject; helper_saveProjectSettings($selectedProject); } } diff --git a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Generation.svelte b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Generation.svelte index d00351d..e2abef3 100644 --- a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Generation.svelte +++ b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Generation.svelte @@ -81,6 +81,7 @@ function onChange() { if ($selectedProject) { + $selectedProject = $selectedProject; helper_saveProjectSettings($selectedProject); } } diff --git a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Source.svelte b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Source.svelte index 724eb7f..4a0c26b 100644 --- a/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Source.svelte +++ b/ui/dashboard/spa-svelte/src/lib/widgets/project-panels/Source.svelte @@ -17,6 +17,7 @@ function onChange() { if ($selectedProject) { + $selectedProject = $selectedProject; helper_saveProjectSettings($selectedProject); } }