From 6abc7c6e8f3fdeebbccb04b1a54e3769395f238f Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 17 Feb 2026 21:01:03 -0700 Subject: [PATCH] Add step 623 sprint 36 integration summary --- editor/CMakeLists.txt | 9 ++ editor/src/Sprint36IntegrationSummary.h | 79 +++++++++++++++ editor/tests/step623_test.cpp | 122 ++++++++++++++++++++++++ progress.md | 63 ++++++++++++ 4 files changed, 273 insertions(+) create mode 100644 editor/src/Sprint36IntegrationSummary.h create mode 100644 editor/tests/step623_test.cpp diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index a97c95a..51051c2 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -4486,4 +4486,13 @@ target_link_libraries(step622_test PRIVATE tree_sitter_javascript tree_sitter_typescript tree_sitter_java tree_sitter_rust tree_sitter_go) +add_executable(step623_test tests/step623_test.cpp) +target_include_directories(step623_test PRIVATE src) +target_link_libraries(step623_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/Sprint36IntegrationSummary.h b/editor/src/Sprint36IntegrationSummary.h new file mode 100644 index 0000000..3c3cde5 --- /dev/null +++ b/editor/src/Sprint36IntegrationSummary.h @@ -0,0 +1,79 @@ +#pragma once +// Step 623: Sprint 36 Integration Summary + +#include "MCPServer.h" + +#include +#include + +struct Sprint36IntegrationResult { + bool initializeOk = false; + bool intakeOk = false; + bool generateOk = false; + bool queueOk = false; + bool queueReady = false; + int taskCount = 0; + int readyCount = 0; + int escalateCount = 0; + std::vector blockers; +}; + +class Sprint36IntegrationSummary { +public: + static Sprint36IntegrationResult run(const std::string& markdown) { + Sprint36IntegrationResult out; + MCPServer mcp; + + json initReq = { + {"jsonrpc", "2.0"}, + {"id", 1}, + {"method", "initialize"}, + {"params", {{"protocolVersion", "2024-11-05"}}} + }; + json initResp = mcp.handleRequest(initReq); + out.initializeOk = initResp.contains("result") && + initResp["result"].contains("instructions") && + initResp["result"]["instructions"].is_string() && + !initResp["result"].value("instructions", "").empty(); + + json intake = callTool(mcp, "whetstone_architect_intake", {{"markdown", markdown}}); + out.intakeOk = intake.value("success", false); + if (!out.intakeOk) return out; + + json generated = callTool(mcp, "whetstone_generate_taskitems", { + {"normalizedRequirements", intake["normalizedRequirements"]}, + {"conflicts", intake["conflicts"]} + }); + out.generateOk = generated.value("success", false); + if (!out.generateOk) return out; + + json queue = callTool(mcp, "whetstone_queue_ready", { + {"tasks", generated["tasks"]}, + {"normalizedRequirements", intake["normalizedRequirements"]} + }); + out.queueOk = queue.value("success", false); + if (!out.queueOk) return out; + + out.queueReady = queue.value("ready", false); + out.taskCount = (int)generated["tasks"].size(); + out.readyCount = queue.value("readyCount", 0); + out.escalateCount = queue.value("escalateCount", 0); + for (const auto& blocker : queue["blockers"]) { + out.blockers.push_back(blocker.get()); + } + return out; + } + +private: + static json callTool(MCPServer& mcp, const std::string& name, const json& args) { + json req = { + {"jsonrpc", "2.0"}, + {"id", 1}, + {"method", "tools/call"}, + {"params", {{"name", name}, {"arguments", args}}} + }; + json resp = mcp.handleRequest(req); + std::string text = resp["result"]["content"][0].value("text", "{}"); + return json::parse(text); + } +}; diff --git a/editor/tests/step623_test.cpp b/editor/tests/step623_test.cpp new file mode 100644 index 0000000..ea57fc9 --- /dev/null +++ b/editor/tests/step623_test.cpp @@ -0,0 +1,122 @@ +// Step 623: Sprint 36 integration + summary (8 tests) + +#include "Sprint36IntegrationSummary.h" + +#include + +static int passed = 0, failed = 0; +#define TEST(name) { std::cout << " " << #name << "... "; } +#define PASS() { std::cout << "PASS\n"; ++passed; } +#define FAIL(msg) { std::cout << "FAIL: " << msg << "\n"; ++failed; } +#define CHECK(cond, msg) if (!(cond)) { FAIL(msg); return; } else {} + +static std::string clearSpec() { + return + "## Goals\n" + "- Build architect intake pipeline\n" + "\n" + "## Constraints\n" + "- Keep tool registration deterministic\n" + "\n" + "## Dependencies\n" + "- cmake\n" + "\n" + "## Acceptance Criteria\n" + "- queue readiness can be computed\n"; +} + +static std::string riskySpec() { + return + "## Goals\n" + "- maybe improve pipeline maybe maybe\n" + "\n" + "## Constraints\n" + "- Do not use dynamic allocation in hot path\n" + "- Use dynamic allocation in hot path for warmup\n" + "\n" + "## Dependencies\n" + "- maybe add dependency\n" + "\n" + "## Acceptance Criteria\n" + "- maybe pass tests\n"; +} + +static bool hasBlocker(const Sprint36IntegrationResult& r, const std::string& blocker) { + for (const auto& b : r.blockers) if (b == blocker) return true; + return false; +} + +void test_initialize_instructions_available() { + TEST(initialize_instructions_available); + auto result = Sprint36IntegrationSummary::run(clearSpec()); + CHECK(result.initializeOk, "initialize instructions should be available"); + PASS(); +} + +void test_intake_stage_succeeds_for_clear_spec() { + TEST(intake_stage_succeeds_for_clear_spec); + auto result = Sprint36IntegrationSummary::run(clearSpec()); + CHECK(result.intakeOk, "intake should succeed"); + PASS(); +} + +void test_generate_stage_succeeds_for_clear_spec() { + TEST(generate_stage_succeeds_for_clear_spec); + auto result = Sprint36IntegrationSummary::run(clearSpec()); + CHECK(result.generateOk, "generate should succeed"); + PASS(); +} + +void test_queue_stage_succeeds_for_clear_spec() { + TEST(queue_stage_succeeds_for_clear_spec); + auto result = Sprint36IntegrationSummary::run(clearSpec()); + CHECK(result.queueOk, "queue should succeed"); + PASS(); +} + +void test_clear_spec_is_queue_ready() { + TEST(clear_spec_is_queue_ready); + auto result = Sprint36IntegrationSummary::run(clearSpec()); + CHECK(result.queueReady, "clear spec should be queue ready"); + CHECK(result.readyCount >= 1, "readyCount should be >= 1"); + PASS(); +} + +void test_summary_exposes_task_count() { + TEST(summary_exposes_task_count); + auto result = Sprint36IntegrationSummary::run(clearSpec()); + CHECK(result.taskCount >= 1, "taskCount should be >= 1"); + PASS(); +} + +void test_risky_spec_not_queue_ready() { + TEST(risky_spec_not_queue_ready); + auto result = Sprint36IntegrationSummary::run(riskySpec()); + CHECK(result.intakeOk && result.generateOk && result.queueOk, "all stages should execute"); + CHECK(!result.queueReady, "risky spec should not be queue ready"); + CHECK(result.escalateCount >= 1, "escalateCount should be >= 1"); + PASS(); +} + +void test_risky_spec_has_escalation_blocker() { + TEST(risky_spec_has_escalation_blocker); + auto result = Sprint36IntegrationSummary::run(riskySpec()); + CHECK(hasBlocker(result, "escalations_present"), "expected escalations_present blocker"); + PASS(); +} + +int main() { + std::cout << "Step 623: Sprint 36 integration + summary\n"; + + test_initialize_instructions_available(); // 1 + test_intake_stage_succeeds_for_clear_spec(); // 2 + test_generate_stage_succeeds_for_clear_spec(); // 3 + test_queue_stage_succeeds_for_clear_spec(); // 4 + test_clear_spec_is_queue_ready(); // 5 + test_summary_exposes_task_count(); // 6 + test_risky_spec_not_queue_ready(); // 7 + test_risky_spec_has_escalation_blocker(); // 8 + + std::cout << "\nResults: " << passed << "/" << (passed + failed) << " passed\n"; + return failed == 0 ? 0 : 1; +} diff --git a/progress.md b/progress.md index 54681f4..ef21b57 100644 --- a/progress.md +++ b/progress.md @@ -12354,3 +12354,66 @@ match the registered MCP tool surface, including Sprint 36 tools and Sprint **Architecture gate check:** - `editor/tests/step622_test.cpp` within test-file size guidance (`142` lines) - Tool catalog refresh does not violate header-only or naming constraints in `ARCHITECTURE.md` + +### Step 623: Sprint 36 Integration + Summary +**Status:** PASS (8/8 tests) + +Adds a Sprint 36 summary runner validating a fresh MCP initialize handshake +(with instructions) followed by architect intake, taskitem generation, and +queue readiness evaluation in one flow. + +**Files added:** +- `editor/src/Sprint36IntegrationSummary.h` - summary integration runner: + - initialize instructions presence check + - 614→615→616 stage orchestration and summary extraction +- `editor/tests/step623_test.cpp` - 8 tests covering: + - initialize instructions availability + - stage-by-stage success for clear spec + - queue readiness/task summary checks + - risky-spec escalation blocker behavior + +**Files modified:** +- `editor/CMakeLists.txt` - `step623_test` target + +**Verification run:** +- `cmake -S editor -B editor/build-native` - PASS +- `cmake --build editor/build-native --target step623_test step622_test` - PASS +- `./editor/build-native/step623_test` - PASS (8/8) +- `./editor/build-native/step622_test` - PASS (8/8) regression coverage + +**Architecture gate check:** +- `editor/src/Sprint36IntegrationSummary.h` within header-size limit (`79` <= `600`) +- `editor/tests/step623_test.cpp` within test-file size guidance (`122` lines) +- Header-only architecture and naming conventions remain aligned with `ARCHITECTURE.md` + +## Sprint 36 Refactor Pass (Architecture Compliance) +**Status:** PASS + +Completed end-of-sprint architecture audit for Steps 614-623. No refactor was +required because Sprint 36 modules remained within constraints. + +**Verification run (full sprint matrix):** +- `cmake -S editor -B editor/build-native` - PASS +- `cmake --build editor/build-native --target step614_test step615_test step616_test step617_test step618_test step619_test step620_test step621_test step622_test step623_test` - PASS +- `./editor/build-native/step614_test` - PASS (12/12) +- `./editor/build-native/step615_test` - PASS (12/12) +- `./editor/build-native/step616_test` - PASS (12/12) +- `./editor/build-native/step617_test` - PASS (12/12) +- `./editor/build-native/step618_test` - PASS (8/8) +- `./editor/build-native/step619_test` - PASS (12/12) +- `./editor/build-native/step620_test` - PASS (12/12) +- `./editor/build-native/step621_test` - PASS (12/12) +- `./editor/build-native/step622_test` - PASS (8/8) +- `./editor/build-native/step623_test` - PASS (8/8) +- Sprint 36 matrix total: **108/108 passing** + +**Architecture gate check (Sprint 36 files):** +- `editor/src/MCPServer.h` (`551` <= `600`) +- `editor/src/mcp/RegisterArchitectIntakeTools.h` (`552` <= `600`) +- `editor/src/MCPProjectConfig.h` (`128` <= `600`) +- `editor/src/mcp_main.cpp` (`184` <= `1500`) +- `editor/src/headless_rpc/DispatchPart3.h` (`494` <= `600`) +- `editor/src/AgentPermissionPolicy.h` (`132` <= `600`) +- `editor/src/Sprint36aIntegration.h` (`71` <= `600`) +- `editor/src/Sprint36IntegrationSummary.h` (`79` <= `600`) +- Naming conventions and header-only architecture constraints remain aligned with `ARCHITECTURE.md`