You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The guardrails intentionally fail while known violations remain. This is expected and aligns with the no-wrapper/no-masking directive.
624
+
625
+
### Scope decision (legacy)
626
+
627
+
- Active compliance scope for `MVP-APP-006` is `Core`, `Desktop`, and `Android`.
628
+
-`src/McpServerManager` remains visible in audit documentation but is excluded from Phase 0 guardrail execution pending explicit deprecation/refactor work.
629
+
630
+
### Relationship to existing audit/blame sections
631
+
632
+
- The detailed findings and blame attribution earlier in this file remain the line-level source of truth for current non-compliance.
633
+
- The new docs above convert those findings into a tracked matrix and executable guardrails.
Status: Chat compliance tranche completed for tasks 9, 12, 13, 14, 15, 16, 17, 18, and 33 (MainWindow/Todo/Workspace epic work remains)
638
+
639
+
### Completed in this tranche
640
+
641
+
- Added chat application service interfaces and default implementations for:
642
+
- prompt template loading
643
+
- chat-related local file open/config file operations
644
+
- model discovery
645
+
- send orchestration contract (wrapper introduced for later migration)
646
+
- Replaced `Core/Commands/ChatCommands.cs` wrapper handlers with DTO/result-based handlers:
647
+
- no `ChatWindowViewModel` command payload properties remain
648
+
- no handlers call `ViewModel.*Internal(...)`
649
+
- Converted chat model discovery to a CQRS **query** handler/service path
650
+
- Refactored `Core/ViewModels/ChatWindowViewModel.cs` so these flows dispatch/apply results instead of owning file-open/prompt-load/model-discovery logic
651
+
- Moved chat send backend orchestration to CQRS command handler + app service (`ChatSendMessageHandler`)
652
+
- Added compliant `ChatWindowViewModelFactory` to own chat mediator/handler registration and config IO integration
653
+
- Refactored Desktop `MainWindow` code-behind to use the chat factory (removed direct chat service/config/VM construction)
654
+
655
+
### Remaining Chat-specific non-compliance in active scope
656
+
657
+
- None identified in the active Chat subsystem path after this tranche.
658
+
-`CancelSend()` remains in `ChatWindowViewModel` as UI cancellation-token ownership (allowed by current compliance spec).
659
+
- Legacy chat window path in `src/McpServerManager` remains out of active scope (see legacy scope decision doc).
note: 'Phase 0 + Chat refactor complete: Chat prompt/config/model/send flows, CQRS handlers, VM factory, and Desktop chat code-behind extraction are compliant. Remaining work is MainWindow/Todo/Workspace and cross-cutting validation.'
6
7
done: false
7
8
description:
8
9
- 'Refactor the codebase to full CQRS and code-behind compliance: ViewModels own UI state/projection only; all app logic moves to handlers/services.'
9
10
- Enforce correctness, completeness, and adherence; do not preserve non-compliant behavior behind wrapper handlers or proxy internal methods.
10
11
- Use the current HANDOFF audit and blame map as the baseline and update it continuously until final pass criteria are met for the declared scope.
12
+
remaining: 24 tasks remain (MainWindow/Todo/Workspace compliance refactors, central composition, checks, and validation).
11
13
technical-details:
12
14
- 'Target rule: no commands/queries carrying ViewModel references and no handlers invoking ViewModel internal methods.'
- 'Target rule: code-behind is UI-only (event wiring, control sync, layout persistence) except explicitly documented exceptions.'
15
17
- Migration must preserve behavior via phased refactors with build validation and manual smoke testing after each subsystem.
16
18
implementation-tasks:
17
19
- task: Publish a formal compliance spec defining allowed ViewModel responsibilities, allowed code-behind responsibilities, CQRS handler rules, and forbidden patterns.
18
-
done: false
20
+
done: true
19
21
- task: Convert the current audit into a tracked compliance matrix with status, target design, and replacement owner for each violation.
20
-
done: false
22
+
done: true
21
23
- task: 'Freeze architecture drift by documenting a temporary rule: no new ViewModel app logic and no commands/queries carrying ViewModel references.'
22
-
done: false
24
+
done: true
23
25
- task: 'Inventory every Core ViewModel app-logic method and classify by domain: network, filesystem, process, parsing, watcher, orchestration, composition.'
24
-
done: false
26
+
done: true
25
27
- task: Inventory every Core handler that calls ViewModel internals or accesses ViewModel fields/services and map a replacement design.
26
-
done: false
28
+
done: true
27
29
- task: Inventory all Desktop and Android code-behind paths and classify as UI-only, documented exception, or extraction required.
28
-
done: false
30
+
done: true
29
31
- task: Inventory all legacy project violations and decide per area whether to refactor or deprecate from compliance scope.
30
-
done: false
32
+
done: true
31
33
- task: Document and approve the final compliance-scope decision for the legacy project so success criteria are unambiguous.
32
-
done: false
34
+
done: true
33
35
- task: Define chat application service interfaces for prompt/config file operations, model discovery, and send orchestration.
34
-
done: false
36
+
done: true
35
37
- task: Define MainWindow application service interfaces for session loading, aggregation, JSON parsing/tree building, file previews, archive, shell launch, and AGENTS watcher.
36
38
done: false
37
39
- task: Define workspace catalog and health orchestration service interfaces currently owned by MainWindowViewModel.
38
40
done: false
39
41
- task: Define a compliant composition factory for ChatWindowViewModel creation outside Desktop MainWindow code-behind.
40
-
done: false
42
+
done: true
41
43
- task: Refactor ChatCommands payloads to primitives/DTOs only and remove ChatWindowViewModel references from commands.
42
-
done: false
44
+
done: true
43
45
- task: Replace ChatCommands handlers with service-backed handlers that return structured results rather than mutating ViewModel internals.
44
-
done: false
46
+
done: true
45
47
- task: Move chat prompt/config file IO and shell-open logic out of ChatWindowViewModel into dedicated services with explicit success/failure results.
46
-
done: false
48
+
done: true
47
49
- task: Move chat model discovery out of ChatWindowViewModel into a query handler and service adapter.
48
-
done: false
50
+
done: true
49
51
- task: Move chat send pipeline orchestration out of ChatWindowViewModel into a command handler/app service while preserving streaming and cancellation.
50
-
done: false
52
+
done: true
51
53
- task: Refactor ChatWindowViewModel to command/query dispatch plus UI state projection only and delete obsolete internal app-logic methods.
52
-
done: false
54
+
done: true
53
55
- task: Refactor MainWindow AllCommands so commands do not carry MainWindowViewModel and handlers do not call ViewModel internals.
54
56
done: false
55
57
- task: Refactor MainWindow AsyncCommands so handlers no longer access vm._mediator, vm services, or vm internal builder methods.
@@ -79,17 +81,17 @@ mvp-app:
79
81
- task: Introduce a central composition layer for Core ViewModels and handler/service registration that supports endpoint changes compliantly.
80
82
done: false
81
83
- task: Refactor Desktop MainWindow code-behind to remove chat service creation, config IO reads, and ChatWindowViewModel construction.
82
-
done: false
84
+
done: true
83
85
- task: Re-audit Desktop and Android code-behind and document any remaining explicit exceptions with rationale and approval.
84
86
done: false
85
87
- task: If legacy remains in scope, refactor legacy ViewModels and code-behind using the same patterns; otherwise mark legacy deprecated and excluded in docs/CI.
86
-
done: false
88
+
done: true
87
89
- task: Add architecture checks that fail CI when commands contain ViewModel properties or handlers invoke ViewModel internal methods.
88
-
done: false
90
+
done: true
89
91
- task: Add architecture checks that flag filesystem/process/network APIs in ViewModels except approved exceptions.
90
-
done: false
92
+
done: true
91
93
- task: Add a PR review checklist requiring confirmation of ViewModel, CQRS handler, and code-behind boundary compliance.
92
-
done: false
94
+
done: true
93
95
- task: Update HANDOFF audit and blame sections after each refactor phase to keep the remaining violation map current.
94
96
done: false
95
97
- task: Validate Desktop build and run manual smoke tests for Request Tracker, Todos, Workspaces, Logs, Chat, and AGENTS after each subsystem migration.
| CM-002 |`MainWindowViewModel` owns app logic | Network/file/process/parsing/watcher/timer/orchestration/composition logic in VM | VM reduced to UI state + dispatch; handlers/services own behavior |`MainWindowViewModel` + extracted services | Open |`src/McpServerManager.Core/ViewModels/MainWindowViewModel.cs`|
12
+
| CM-003 |`ChatWindowViewModel` owns app logic | Prompt/config file IO, shell-open, model discovery, send orchestration in VM | Chat app service interfaces + command/query handlers + VM projection only |`ChatWindowViewModel` + chat services | Open |`src/McpServerManager.Core/ViewModels/ChatWindowViewModel.cs`|
13
+
| CM-004 | VM-local composition roots | VMs construct MCP services and register handlers directly | Central composition layer/factory injects services/handlers |`TodoListViewModel`, `WorkspaceViewModel`, `MainWindowViewModel`, `ChatWindowViewModel`| Open |`src/McpServerManager.Core/ViewModels/TodoListViewModel.cs`, `src/McpServerManager.Core/ViewModels/WorkspaceViewModel.cs`|
14
+
| CM-005 | Desktop MainWindow code-behind owns app composition | Code-behind constructs chat VM and reads/writes config model path | Code-behind requests view model/factory result; no feature composition | Desktop host/app composition layer | Open |`src/McpServerManager.Desktop/Views/MainWindow.axaml.cs:248`|
15
+
| CM-006 | Code-behind exceptions not fully cataloged | Mixed UI-only and exceptions, no complete desktop/android inventory | Full inventory with classification and extraction backlog | Desktop + Android view inventory docs | Completed (Phase 0) |`docs/architecture/compliance/INVENTORY-CODE-BEHIND.md`|
16
+
| CM-007 | Legacy project compliance scope ambiguous | Legacy project still exists and is non-compliant; success criteria unclear | Explicit scope decision: exclude legacy from active compliance and CI checks until dedicated deprecation/refactor phase | Maintainers + epic owner | Completed (Phase 0 decision) |`docs/architecture/compliance/LEGACY-COMPLIANCE-SCOPE.md`|
17
+
| CM-008 | Architecture drift risk during refactor | New non-compliant patterns can be introduced while epic is open | Freeze rule + CI checks + PR checklist | Repo policy + CI | Completed (Phase 0) |`docs/architecture/compliance/COMPLIANCE-SPEC.md`, `.github/pull_request_template.md`, `tools/compliance/*`|
18
+
19
+
## Status Legend
20
+
21
+
-`Open`: Violation exists and refactor is not complete.
22
+
-`Completed (Phase 0)`: Baseline governance/inventory/scoping work completed.
23
+
-`In Progress`: Refactor underway with partial migration (none marked yet in this matrix).
0 commit comments