diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index f8ca837..1111571 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -4828,4 +4828,13 @@ target_link_libraries(step660_test PRIVATE tree_sitter_javascript tree_sitter_typescript tree_sitter_java tree_sitter_rust tree_sitter_go) +add_executable(step661_test tests/step661_test.cpp) +target_include_directories(step661_test PRIVATE src) +target_link_libraries(step661_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/PilotQueuePanelModel.h b/editor/src/PilotQueuePanelModel.h new file mode 100644 index 0000000..3b8d96e --- /dev/null +++ b/editor/src/PilotQueuePanelModel.h @@ -0,0 +1,39 @@ +#pragma once +// Step 661: Pilot queue panel model + +#include +#include + +enum class PilotDecision { Pending, Approved, Rejected, Modified }; + +struct PilotQueueItem { + std::string jobId; + std::string summary; + bool escalate = false; + double ambiguity = 0.0; + PilotDecision decision = PilotDecision::Pending; + std::string strategyNote; +}; + +class PilotQueuePanelModel { +public: + static bool needsHumanReview(const PilotQueueItem& item, double threshold = 0.5) { + return item.escalate || item.ambiguity > threshold; + } + + static void approve(PilotQueueItem* item) { + if (!item) return; + item->decision = PilotDecision::Approved; + } + + static void reject(PilotQueueItem* item) { + if (!item) return; + item->decision = PilotDecision::Rejected; + } + + static void modify(PilotQueueItem* item, const std::string& note) { + if (!item) return; + item->decision = PilotDecision::Modified; + item->strategyNote = note; + } +}; diff --git a/editor/tests/step661_test.cpp b/editor/tests/step661_test.cpp new file mode 100644 index 0000000..bbba3a9 --- /dev/null +++ b/editor/tests/step661_test.cpp @@ -0,0 +1,24 @@ +// Step 661: Pilot queue panel (12 tests) + +#include "PilotQueuePanelModel.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: "<