Sprint 30: end-of-sprint architecture refactor pass

This commit is contained in:
Bill
2026-02-17 10:42:36 -07:00
parent 67fc439ccd
commit 9a3b2d0c04
5 changed files with 58 additions and 3 deletions

View File

@@ -6,6 +6,8 @@
#include <string>
#include <vector>
#include "DebugValidationUtil.h"
struct Breakpoint {
std::string id;
std::string filePath;
@@ -96,7 +98,7 @@ private:
std::map<std::string, size_t> index_;
bool addBreakpoint(const Breakpoint& bp) {
if (bp.id.empty() || bp.filePath.empty() || bp.line <= 0) return false;
if (!hasRequiredDebugIds(bp.id, bp.filePath) || !isPositiveLine(bp.line)) return false;
if (index_.count(bp.id) != 0) return false;
breakpoints_.push_back(bp);
index_[bp.id] = breakpoints_.size() - 1;

View File

@@ -5,6 +5,8 @@
#include <string>
#include <vector>
#include "DebugValidationUtil.h"
struct DebugTargetContext {
std::string targetId;
std::string bufferId;
@@ -90,7 +92,7 @@ private:
const std::string& executablePath,
bool attached,
bool makeCurrent) {
if (targetId.empty() || bufferId.empty() || executablePath.empty()) return false;
if (!hasRequiredDebugIds(targetId, bufferId) || executablePath.empty()) return false;
if (state_.targets.count(targetId) != 0) return false;
DebugTargetContext context;

View File

@@ -0,0 +1,12 @@
#pragma once
// Sprint 30 refactor: shared debug validation helpers
#include <string>
inline bool hasRequiredDebugIds(const std::string& a, const std::string& b) {
return !a.empty() && !b.empty();
}
inline bool isPositiveLine(int line) {
return line > 0;
}

View File

@@ -4,6 +4,8 @@
#include <string>
#include <vector>
#include "DebugValidationUtil.h"
struct StackFrame {
std::string functionName;
std::string filePath;
@@ -52,7 +54,7 @@ private:
std::vector<StackFrame> out;
int index = 0;
for (const auto& f : frames) {
if (f.functionName.empty() || f.filePath.empty() || f.line <= 0) {
if (!hasRequiredDebugIds(f.functionName, f.filePath) || !isPositiveLine(f.line)) {
errors.push_back("invalid_frame:" + std::to_string(index));
++index;
continue;

View File

@@ -10118,3 +10118,40 @@ into phase-level and sprint-level outcomes with closure diagnostics.
- **New tests in this sprint plan:** 112/112 passing
- **Phase 30a (554-558):** 56/56 passing
- **Phase 30b (559-563):** 56/56 passing
### Sprint 30 End Refactor Pass (Architecture Compliance)
**Status:** PASS (112/112 tests revalidated)
Performed a focused post-sprint refactor against `ARCHITECTURE.md` constraints to
reduce validation duplication across Sprint 30 debug modules while preserving
header-only design and deterministic behavior.
**Files added:**
- `editor/src/DebugValidationUtil.h` - shared validation helpers:
- required debug/session/workflow id presence check
- positive source-line guard used by breakpoint/stack validation paths
**Files modified:**
- `editor/src/DebugSessionModel.h` - uses shared id validation utility for target/session lifecycle checks
- `editor/src/BreakpointSystem.h` - uses shared line-validation utility for breakpoint insertion guards
- `editor/src/ExceptionStackTraceCapture.h` - uses shared line-validation utility for frame validation
**Verification run:**
- `cmake --build editor/build-native --target step554_test step555_test step556_test step557_test step558_test step559_test step560_test step561_test step562_test step563_test` - PASS
- `./editor/build-native/step554_test` - PASS (12/12)
- `./editor/build-native/step555_test` - PASS (12/12)
- `./editor/build-native/step556_test` - PASS (12/12)
- `./editor/build-native/step557_test` - PASS (12/12)
- `./editor/build-native/step558_test` - PASS (8/8)
- `./editor/build-native/step559_test` - PASS (12/12)
- `./editor/build-native/step560_test` - PASS (12/12)
- `./editor/build-native/step561_test` - PASS (12/12)
- `./editor/build-native/step562_test` - PASS (12/12)
- `./editor/build-native/step563_test` - PASS (8/8)
**Architecture gate check:**
- `editor/src/DebugValidationUtil.h` within header-size limit (`12` <= `600`)
- `editor/src/DebugSessionModel.h` within header-size limit (`108` <= `600`)
- `editor/src/BreakpointSystem.h` within header-size limit (`120` <= `600`)
- `editor/src/ExceptionStackTraceCapture.h` within header-size limit (`73` <= `600`)
- Shared validation centralization reduces duplicated guard logic and keeps module boundaries aligned with `ARCHITECTURE.md`