Skip to content

Commit 7ea8dd9

Browse files
author
Mateusz
committed
feat(core): update backend refactoring specs, add analysis tools, and fix gemini retry
1 parent 15f43db commit 7ea8dd9

File tree

11 files changed

+1770
-295
lines changed

11 files changed

+1770
-295
lines changed

.kiro/specs/backend-service-refactoring/design.md

Lines changed: 192 additions & 75 deletions
Large diffs are not rendered by default.

.kiro/specs/backend-service-refactoring/requirements.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,18 @@ This document specifies the requirements for refactoring the `BackendService` cl
6363

6464
**User Story:** As a developer, I want the refactored code to maintain full test coverage, so that I can be confident the refactoring introduces no regressions.
6565

66-
#### Acceptance Criteria
67-
68-
1. WHEN the refactoring is complete THEN the system SHALL pass all existing unit tests without modification
69-
2. WHEN the refactoring is complete THEN the system SHALL pass all existing integration tests without modification
70-
3. WHEN new services are created THEN the system SHALL include unit tests for each new service
71-
4. WHEN the refactoring is complete THEN the test suite SHALL achieve zero test failures
72-
73-
### Requirement 5
74-
75-
**User Story:** As a developer, I want the stream formatting logic to be isolated, so that SSE encoding and chunk validation can be tested and modified independently.
66+
#### Acceptance Criteria
67+
68+
1. WHEN the refactoring is complete THEN the system SHALL pass all existing unit tests without modification
69+
2. WHEN the refactoring is complete THEN the system SHALL pass all existing integration tests without modification
70+
3. WHEN new services are created THEN the system SHALL include unit tests for each new service
71+
4. WHEN the refactoring is complete THEN the test suite SHALL achieve zero test failures
72+
5. WHEN responsibilities are extracted THEN BackendService SHALL retain existing helper/private methods with compatible signatures (e.g., `_stream_as_sse_bytes`, `_wrap_stream_for_usage`, `_apply_model_aliases`, `_apply_reasoning_config`, `_apply_uri_parameters`, planning phase helpers, lifecycle helpers, `_normalize_provider_exception`) as thin delegating wrappers so existing tests and scripts do not require changes
73+
6. WHEN helpers are delegated to extracted services THEN those services SHALL preserve the observable invariants documented in Design → “Invariants and Gotchas to Preserve”
74+
75+
### Requirement 5
76+
77+
**User Story:** As a developer, I want the stream formatting logic to be isolated, so that SSE encoding and chunk validation can be tested and modified independently.
7678

7779
#### Acceptance Criteria
7880

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"featureName": "backend-service-refactoring",
3+
"createdAt": "2025-12-12T00:00:00.000Z",
4+
"updatedAt": "2025-12-12T00:00:00.000Z",
5+
"status": "approved",
6+
"phases": {
7+
"requirements": {
8+
"status": "approved",
9+
"file": "requirements.md"
10+
},
11+
"design": {
12+
"status": "approved",
13+
"file": "design.md"
14+
},
15+
"tasks": {
16+
"status": "approved",
17+
"file": "tasks.md"
18+
}
19+
},
20+
"summary": {
21+
"description": "Refactor BackendService God Object into focused, single-responsibility services following SOLID principles",
22+
"totalTasks": 16,
23+
"totalSubtasks": 47,
24+
"newInterfaces": 8,
25+
"newServices": 8,
26+
"propertyTests": 14,
27+
"checkpoints": 3
28+
}
29+
}

.kiro/specs/backend-service-refactoring/tasks.md

Lines changed: 298 additions & 207 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)