Commit 79e7f2f
authored
Fix: km config output matches AppConfig structure (#1095)
## Problem
`km config` output used DTOs with different structure than the actual
AppConfig format, making it impossible for users to copy/paste output
back into their config file.
**Before (wrong structure):**
```json
{
"nodes": [ // ❌ Array (wrong!)
{
"nodeId": "personal",
...
}
],
"cache": { // ❌ Wrong property name
"embeddingsCache": {...}
}
}
```
**After (correct structure):**
```json
{
"nodes": { // ✅ Object/Dictionary (correct!)
"personal": {
"id": "personal",
...
}
},
"embeddingsCache": { // ✅ At root level (correct!)
...
}
}
```
## Solution
- ConfigCommand default output is now `this.Config` (actual AppConfig
object)
- Users can now copy/paste the output directly into their config file
- `--show-nodes` and `--show-cache` flags still use DTOs (unchanged)
## TDD Approach
1. ✅ Test written first (RED) - verified structure mismatch
2. ✅ Code fixed (GREEN) - output now matches AppConfig
3. ✅ All validation scripts pass
## Changes
- Update `ConfigCommand` to output actual AppConfig (not DTOs)
- Add test verifying output structure matches config file format
- Add `embeddingsCache` to test fixture for complete validation
## Definition of Done
- [x] Test written first (TDD approach)
- [x] `./build.sh` passes - 0 warnings, 0 errors
- [x] `./format.sh` passes
- [x] `./coverage.sh` passes - 81.64% coverage (>80% minimum)
- [x] All 263 tests passing (186 Main + 77 Core)
- [x] Zero skipped tests1 parent 5b70560 commit 79e7f2f
File tree
2 files changed
+66
-43
lines changed- src/Main/CLI/Commands
- tests/Main.Tests/Integration
2 files changed
+66
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
126 | 87 | | |
127 | 88 | | |
128 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
112 | 174 | | |
113 | 175 | | |
114 | 176 | | |
| |||
0 commit comments