diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 662df72..f520722 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -4036,4 +4036,13 @@ target_link_libraries(step572_test PRIVATE tree_sitter_javascript tree_sitter_typescript tree_sitter_java tree_sitter_rust tree_sitter_go) +add_executable(step573_test tests/step573_test.cpp) +target_include_directories(step573_test PRIVATE src) +target_link_libraries(step573_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/Sprint31IntegrationSummary.h b/editor/src/Sprint31IntegrationSummary.h new file mode 100644 index 0000000..1602237 --- /dev/null +++ b/editor/src/Sprint31IntegrationSummary.h @@ -0,0 +1,70 @@ +#pragma once +// Step 573: Sprint 31 Integration + Summary + +#include +#include + +struct Sprint31Signals { + bool memorySnapshotModel = false; // 564 + bool memoryInspectorUiModel = false; // 565 + bool allocationOwnershipTraceHooks = false; // 566 + bool leakCorruptionSignalBridge = false; // 567 + bool phase31aIntegration = false; // 568 + bool disassemblyRegisterView = false; // 569 + bool watchEvaluatorHardening = false; // 570 + bool timeTravelEventBuffer = false; // 571 + bool performanceProbeOverlay = false; // 572 +}; + +struct Sprint31IntegrationResult { + bool phase31aPass = false; + bool phase31bPass = false; + bool sprint31Pass = false; + std::vector notes; +}; + +class Sprint31IntegrationSummary { +public: + static Sprint31IntegrationResult summarize(const Sprint31Signals& s) { + Sprint31IntegrationResult r; + r.phase31aPass = s.memorySnapshotModel && + s.memoryInspectorUiModel && + s.allocationOwnershipTraceHooks && + s.leakCorruptionSignalBridge && + s.phase31aIntegration; + + r.phase31bPass = s.disassemblyRegisterView && + s.watchEvaluatorHardening && + s.timeTravelEventBuffer && + s.performanceProbeOverlay; + + r.sprint31Pass = r.phase31aPass && r.phase31bPass; + r.notes = buildNotes(s, r); + return r; + } + +private: + static std::vector buildNotes(const Sprint31Signals& s, + const Sprint31IntegrationResult& r) { + std::vector notes; + if (!s.memorySnapshotModel) notes.push_back("fail:step564_memory_snapshot_model"); + if (!s.memoryInspectorUiModel) notes.push_back("fail:step565_memory_inspector_ui_model"); + if (!s.allocationOwnershipTraceHooks) notes.push_back("fail:step566_allocation_ownership_trace_hooks"); + if (!s.leakCorruptionSignalBridge) notes.push_back("fail:step567_leak_corruption_signal_bridge"); + if (!s.phase31aIntegration) notes.push_back("fail:step568_phase31a_integration"); + if (!s.disassemblyRegisterView) notes.push_back("fail:step569_disassembly_register_view"); + if (!s.watchEvaluatorHardening) notes.push_back("fail:step570_watch_evaluator_hardening"); + if (!s.timeTravelEventBuffer) notes.push_back("fail:step571_time_travel_event_buffer"); + if (!s.performanceProbeOverlay) notes.push_back("fail:step572_performance_probe_overlay"); + + if (r.sprint31Pass) { + notes.push_back("sprint31:memory_reflection_workflow_ready"); + notes.push_back("sprint31:advanced_debug_views_stable"); + notes.push_back("sprint31:observability_surfaces_integrated"); + } else { + if (!r.phase31aPass) notes.push_back("phase31a:blocked"); + if (!r.phase31bPass) notes.push_back("phase31b:blocked"); + } + return notes; + } +}; diff --git a/editor/tests/step573_test.cpp b/editor/tests/step573_test.cpp new file mode 100644 index 0000000..8948c44 --- /dev/null +++ b/editor/tests/step573_test.cpp @@ -0,0 +1,128 @@ +// Step 573: Sprint 31 Integration + Summary (8 tests) + +#include "Sprint31IntegrationSummary.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 bool hasNote(const Sprint31IntegrationResult& r, const std::string& note) { + for (const auto& n : r.notes) if (n == note) return true; + return false; +} + +static Sprint31Signals allPass() { + Sprint31Signals s; + s.memorySnapshotModel = true; + s.memoryInspectorUiModel = true; + s.allocationOwnershipTraceHooks = true; + s.leakCorruptionSignalBridge = true; + s.phase31aIntegration = true; + s.disassemblyRegisterView = true; + s.watchEvaluatorHardening = true; + s.timeTravelEventBuffer = true; + s.performanceProbeOverlay = true; + return s; +} + +void test_all_signals_pass_sprint() { + TEST(all_signals_pass_sprint); + auto r = Sprint31IntegrationSummary::summarize(allPass()); + CHECK(r.phase31aPass, "phase31a should pass"); + CHECK(r.phase31bPass, "phase31b should pass"); + CHECK(r.sprint31Pass, "sprint31 should pass"); + PASS(); +} + +void test_phase31a_failure_blocks_sprint() { + TEST(phase31a_failure_blocks_sprint); + auto s = allPass(); + s.phase31aIntegration = false; + auto r = Sprint31IntegrationSummary::summarize(s); + CHECK(!r.phase31aPass, "phase31a should fail"); + CHECK(!r.sprint31Pass, "sprint31 should fail"); + CHECK(hasNote(r, "fail:step568_phase31a_integration"), "step568 failure note expected"); + PASS(); +} + +void test_phase31b_failure_blocks_sprint() { + TEST(phase31b_failure_blocks_sprint); + auto s = allPass(); + s.watchEvaluatorHardening = false; + auto r = Sprint31IntegrationSummary::summarize(s); + CHECK(!r.phase31bPass, "phase31b should fail"); + CHECK(!r.sprint31Pass, "sprint31 should fail"); + CHECK(hasNote(r, "fail:step570_watch_evaluator_hardening"), "step570 failure note expected"); + PASS(); +} + +void test_success_notes_emitted_on_full_pass() { + TEST(success_notes_emitted_on_full_pass); + auto r = Sprint31IntegrationSummary::summarize(allPass()); + CHECK(hasNote(r, "sprint31:memory_reflection_workflow_ready"), "success note missing"); + CHECK(hasNote(r, "sprint31:advanced_debug_views_stable"), "success note missing"); + CHECK(hasNote(r, "sprint31:observability_surfaces_integrated"), "success note missing"); + PASS(); +} + +void test_blocked_phase_notes_emitted_on_failure() { + TEST(blocked_phase_notes_emitted_on_failure); + auto s = allPass(); + s.memorySnapshotModel = false; + s.disassemblyRegisterView = false; + auto r = Sprint31IntegrationSummary::summarize(s); + CHECK(hasNote(r, "phase31a:blocked"), "phase31a blocked note expected"); + CHECK(hasNote(r, "phase31b:blocked"), "phase31b blocked note expected"); + PASS(); +} + +void test_multiple_failure_notes_aggregate() { + TEST(multiple_failure_notes_aggregate); + auto s = allPass(); + s.memoryInspectorUiModel = false; + s.leakCorruptionSignalBridge = false; + s.performanceProbeOverlay = false; + auto r = Sprint31IntegrationSummary::summarize(s); + CHECK(hasNote(r, "fail:step565_memory_inspector_ui_model"), "step565 failure note missing"); + CHECK(hasNote(r, "fail:step567_leak_corruption_signal_bridge"), "step567 failure note missing"); + CHECK(hasNote(r, "fail:step572_performance_probe_overlay"), "step572 failure note missing"); + PASS(); +} + +void test_all_false_signals_fail_all_phases() { + TEST(all_false_signals_fail_all_phases); + Sprint31Signals s; + auto r = Sprint31IntegrationSummary::summarize(s); + CHECK(!r.phase31aPass && !r.phase31bPass && !r.sprint31Pass, "all should fail"); + PASS(); +} + +void test_single_phase31b_failure_keeps_phase31a_passed() { + TEST(single_phase31b_failure_keeps_phase31a_passed); + auto s = allPass(); + s.timeTravelEventBuffer = false; + auto r = Sprint31IntegrationSummary::summarize(s); + CHECK(r.phase31aPass, "phase31a should remain pass"); + CHECK(!r.phase31bPass, "phase31b should fail"); + PASS(); +} + +int main() { + std::cout << "Step 573: Sprint 31 Integration + Summary\n"; + + test_all_signals_pass_sprint(); // 1 + test_phase31a_failure_blocks_sprint(); // 2 + test_phase31b_failure_blocks_sprint(); // 3 + test_success_notes_emitted_on_full_pass(); // 4 + test_blocked_phase_notes_emitted_on_failure(); // 5 + test_multiple_failure_notes_aggregate(); // 6 + test_all_false_signals_fail_all_phases(); // 7 + test_single_phase31b_failure_keeps_phase31a_passed();// 8 + + std::cout << "\nResults: " << passed << "/" << (passed + failed) << " passed\n"; + return failed == 0 ? 0 : 1; +} diff --git a/progress.md b/progress.md index c1f8c78..466a26e 100644 --- a/progress.md +++ b/progress.md @@ -10473,3 +10473,47 @@ runtime costs and exposes hotspot-ranked metadata for debug surfaces. - `editor/src/PerformanceProbeOverlay.h` within header-size limit (`110` <= `600`) - `editor/tests/step572_test.cpp` within test-file size guidance (`175` lines) - Header-only architecture and naming conventions remain aligned with `ARCHITECTURE.md` + +### Step 573: Sprint 31 Integration + Summary +**Status:** PASS (8/8 tests) + +Completes Sprint 31 integration by aggregating Phase 31a and 31b readiness signals +into phase/sprint pass states with closure diagnostics. + +**Files added:** +- `editor/src/Sprint31IntegrationSummary.h` - sprint integration module: + - aggregates Phase 31a and 31b step readiness signals + - computes phase pass flags and overall Sprint 31 pass flag + - emits per-step failure notes and phase blocked notes + - emits sprint readiness notes on full pass +- `editor/tests/step573_test.cpp` - 8 tests covering: + - full sprint pass path + - phase-specific failure blocking behavior + - success/failure note emission behavior + - multi-failure aggregation behavior + - all-false boundary behavior + - phase isolation behavior on single 31b failure + +**Files modified:** +- `editor/CMakeLists.txt` - `step573_test` target + +**Verification run:** +- `cmake -S editor -B editor/build-native` - PASS +- `cmake --build editor/build-native --target step573_test step572_test` - PASS +- `./editor/build-native/step573_test` - PASS (8/8) +- `./editor/build-native/step572_test` - PASS (12/12) regression coverage + +**Architecture gate check:** +- `editor/src/Sprint31IntegrationSummary.h` within header-size limit (`70` <= `600`) +- `editor/tests/step573_test.cpp` within test-file size guidance (`128` lines) +- Header-only architecture and naming conventions remain aligned with `ARCHITECTURE.md` + +**Phase 31b totals (569-573):** +- **Steps completed:** 5 +- **New tests in this phase plan:** 56/56 passing + +**Sprint 31 totals (564-573):** +- **Steps completed:** 10 +- **New tests in this sprint plan:** 112/112 passing +- **Phase 31a (564-568):** 56/56 passing +- **Phase 31b (569-573):** 56/56 passing