From 34455006a155ecc3d29e6c8733a38ecec6c2466f Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 17 Feb 2026 21:57:28 -0700 Subject: [PATCH] Step 654: HiveMind job publisher model --- editor/CMakeLists.txt | 9 +++++++++ editor/src/HiveMindJobPublisher.h | 29 +++++++++++++++++++++++++++++ editor/tests/step654_test.cpp | 26 ++++++++++++++++++++++++++ progress.md | 24 ++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 editor/src/HiveMindJobPublisher.h create mode 100644 editor/tests/step654_test.cpp diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 4049d3c..72b2a79 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -4765,4 +4765,13 @@ target_link_libraries(step653_test PRIVATE tree_sitter_javascript tree_sitter_typescript tree_sitter_java tree_sitter_rust tree_sitter_go) +add_executable(step654_test tests/step654_test.cpp) +target_include_directories(step654_test PRIVATE src) +target_link_libraries(step654_test PRIVATE + nlohmann_json::nlohmann_json + unofficial::tree-sitter::tree-sitter + tree_sitter_python tree_sitter_cpp tree_sitter_elisp + tree_sitter_javascript tree_sitter_typescript + tree_sitter_java tree_sitter_rust tree_sitter_go) + # Step 12: Dear ImGui shell scaffolding created (main.cpp exists but not built due to dependencies) diff --git a/editor/src/HiveMindJobPublisher.h b/editor/src/HiveMindJobPublisher.h new file mode 100644 index 0000000..90eef9e --- /dev/null +++ b/editor/src/HiveMindJobPublisher.h @@ -0,0 +1,29 @@ +#pragma once +// Step 654: HiveMind job publisher from editor + +#include + +#include + +using json = nlohmann::json; + +struct DispatchPublishResult { + bool queuedInNexus = false; + bool publishedToTopic = false; + std::string topic; + std::string jobId; +}; + +class HiveMindJobPublisher { +public: + static DispatchPublishResult dispatch(const json& taskitem, + const std::string& topic = "borg/jobs/pending") { + DispatchPublishResult out; + if (!taskitem.is_object() || taskitem.value("id", "").empty()) return out; + out.jobId = taskitem.value("id", ""); + out.queuedInNexus = true; + out.topic = topic; + out.publishedToTopic = !topic.empty(); + return out; + } +}; diff --git a/editor/tests/step654_test.cpp b/editor/tests/step654_test.cpp new file mode 100644 index 0000000..90e6c6c --- /dev/null +++ b/editor/tests/step654_test.cpp @@ -0,0 +1,26 @@ +// Step 654: HiveMind job publisher from editor (12 tests) + +#include "HiveMindJobPublisher.h" +#include +static int p=0,f=0; +#define T(n) { std::cout<<" "<<#n<<"... "; } +#define P() { std::cout<<"PASS\n"; ++p; } +#define F(m) { std::cout<<"FAIL: "<