-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.json
More file actions
318 lines (318 loc) · 13.5 KB
/
tasks.json
File metadata and controls
318 lines (318 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
{
"tasks": [
{
"task": "Rewrite server.js with new architecture",
"description": "Rewrite Node.js server to use HTTP notification instead of file watching.",
"steps": [
{
"step": 1,
"description": "Implement state management (filename, svgContent, lastUpdate)"
},
{
"step": 2,
"description": "Create HTML template with filename title, SVG container, time display, and reminder"
},
{
"step": 3,
"description": "Implement GET / endpoint to serve the HTML page"
},
{
"step": 4,
"description": "Implement GET /svg endpoint to return cached SVG content"
},
{
"step": 5,
"description": "Implement GET /events SSE endpoint with update and shutdown event types"
},
{
"step": 6,
"description": "Implement POST /update endpoint to receive Neovim notifications"
},
{
"step": 7,
"description": "Implement POST /shutdown endpoint to notify browser closure"
},
{
"step": 8,
"description": "Remove fileWatcher code entirely"
}
],
"acceptance-criteria": "Server serves HTML page with title, centered SVG container, time display, and save reminder. GET /svg returns cached SVG content. GET /events provides SSE with update and shutdown event types. POST /update accepts {filename, filepath} and broadcasts update event via SSE. POST /shutdown broadcasts shutdown event to all connected clients. No fileWatcher code exists in server.js.",
"test-plan": {
"unit": [
"Server starts on specified port and responds to GET / with valid HTML",
"GET /svg returns 404 when no SVG is cached",
"GET /svg returns cached SVG content after POST /update",
"POST /update with valid data stores filename, reads file, caches SVG content, and returns 200",
"POST /update with missing file returns 404",
"POST /shutdown returns 200 and marks shutdown state",
"SSE client receives 'connected' comment on connect",
"SSE client receives 'update' event after POST /update is called",
"SSE client receives 'shutdown' event after POST /shutdown is called"
],
"integration": [
"Full flow: POST /update triggers SSE update event with correct filename and time",
"Full flow: POST /shutdown triggers SSE shutdown event and client can handle it"
],
"e2e-manual": [
"Open browser to server URL, verify HTML page renders correctly with all elements",
"Trigger POST /update, verify browser updates SVG and time without full page reload",
"Trigger POST /shutdown, verify browser displays shutdown message"
]
},
"skills": ["tdd-workflow", "testing-safe-protocol"],
"complete": true
},
{
"task": "Add HTTP client module for server communication",
"description": "Create a new Lua module to handle HTTP communication with the preview server.",
"steps": [
{
"step": 1,
"description": "Create lua/plantuml/http_client.lua module"
},
{
"step": 2,
"description": "Implement notify_update(host, port, filename, filepath) function"
},
{
"step": 3,
"description": "Implement notify_shutdown(host, port) function"
},
{
"step": 4,
"description": "Use vim.system() or curl for HTTP requests with proper error handling"
}
],
"acceptance-criteria": "Module exports notify_update() and notify_shutdown() functions. Functions are async and accept callbacks. HTTP errors are handled gracefully with vim.notify. Module uses vim.system() for HTTP requests when available, falls back to curl if needed.",
"test-plan": {
"unit": [
"notify_update() constructs correct POST request body with filename and filepath",
"notify_shutdown() sends POST request to /shutdown endpoint",
"HTTP error responses trigger vim.notify with error message",
"Module handles connection refused gracefully",
"Module handles timeout gracefully"
],
"integration": [
"notify_update() successfully communicates with running test server",
"notify_shutdown() successfully communicates with running test server"
],
"e2e-manual": []
},
"skills": ["tdd-workflow"],
"complete": true
},
{
"task": "Refactor preview.lua to use HTTP notification",
"description": "Update preview.lua to remove inject_script and use HTTP notification for SVG updates.",
"steps": [
{
"step": 1,
"description": "Remove inject_script() function entirely"
},
{
"step": 2,
"description": "Update preview_svg() to use new server flow and HTTP notification"
},
{
"step": 3,
"description": "Update refresh_svg_preview() to use HTTP notification instead of file watching"
},
{
"step": 4,
"description": "Add buffer switch detection in preview_svg() to update diagram when switching buffers"
},
{
"step": 5,
"description": "Track current preview filename to detect buffer changes"
},
{
"step": 6,
"description": "Update stop_svg_preview() to call HTTP notify_shutdown"
}
],
"acceptance-criteria": "inject_script() function is removed. preview_svg() generates SVG, starts server if needed, opens browser to server root URL (not direct SVG file), and sends HTTP POST /update. refresh_svg_preview() generates SVG and sends HTTP POST /update. When user switches to a different .puml buffer and saves, the preview updates to show the new diagram. stop_svg_preview() sends HTTP POST /shutdown before cleanup.",
"test-plan": {
"unit": [
"preview_svg() calls executor.run_plantuml() with correct arguments",
"preview_svg() does not call inject_script() (function removed)",
"preview_svg() opens browser to server root URL, not SVG file path",
"refresh_svg_preview() calls HTTP notify_update after PlantUML completes",
"stop_svg_preview() calls HTTP notify_shutdown",
"Buffer switch detection correctly identifies when preview should update"
],
"integration": [
"Full preview flow: preview_svg() generates SVG, server caches it, browser displays it",
"Refresh flow: save triggers refresh_svg_preview(), HTTP notification sent, browser updates",
"Buffer switch flow: switching to another .puml buffer and saving updates the preview"
],
"e2e-manual": [
"Open browser preview, modify .puml file, save, verify browser updates without full reload",
"Switch to another .puml buffer, save, verify browser shows the new diagram"
]
},
"skills": ["tdd-workflow", "systematic-debugging"],
"complete": true
},
{
"task": "Update server tests for new architecture",
"description": "Update test_server.lua to test the new server architecture.",
"steps": [
{
"step": 1,
"description": "Remove tests for fileWatcher functionality"
},
{
"step": 2,
"description": "Add tests for GET / endpoint returning HTML"
},
{
"step": 3,
"description": "Add tests for GET /svg endpoint"
},
{
"step": 4,
"description": "Add tests for POST /update endpoint"
},
{
"step": 5,
"description": "Add tests for POST /shutdown endpoint"
},
{
"step": 6,
"description": "Add tests for SSE event types (update, shutdown)"
}
],
"acceptance-criteria": "All fileWatcher-related tests removed. Tests exist for GET /, GET /svg, POST /update, POST /shutdown, and SSE event types. All tests pass when run with PlenaryBustedDirectory.",
"test-plan": {
"unit": [
"Test file is valid Lua and loads without errors",
"All describe blocks have at least one it block",
"All assertions use correct Plenary syntax"
],
"integration": [],
"e2e-manual": [
"Run tests: nvim --headless -c 'PlenaryBustedDirectory lua/tests/ {minimal_init = \"lua/tests/minimal_init.lua\"}'"
]
},
"skills": ["tdd-workflow", "testing-safe-protocol"],
"complete": true
},
{
"task": "Update preview tests for new architecture",
"description": "Update test_preview.lua to test the new preview flow without inject_script.",
"steps": [
{
"step": 1,
"description": "Remove tests for inject_script() function"
},
{
"step": 2,
"description": "Update SVG preview tests to mock HTTP client instead of inject_script"
},
{
"step": 3,
"description": "Add tests for buffer switch detection"
},
{
"step": 4,
"description": "Add tests for HTTP notification calls"
}
],
"acceptance-criteria": "All inject_script-related tests removed. Tests verify HTTP notify_update is called after SVG generation. Tests verify HTTP notify_shutdown is called when stopping preview. Tests verify buffer switch detection works correctly. All tests pass.",
"test-plan": {
"unit": [
"Test file is valid Lua and loads without errors",
"No references to inject_script in test file",
"HTTP client mocks are properly set up and torn down"
],
"integration": [],
"e2e-manual": [
"Run tests: nvim --headless -c 'PlenaryBustedDirectory lua/tests/ {minimal_init = \"lua/tests/minimal_init.lua\"}'"
]
},
"skills": ["tdd-workflow", "testing-safe-protocol"],
"complete": true
},
{
"task": "Integration test and documentation update",
"description": "Run full integration tests and update documentation to reflect new architecture.",
"steps": [
{
"step": 1,
"description": "Run all tests to verify no regressions"
},
{
"step": 2,
"description": "Manually test full preview workflow in Neovim"
},
{
"step": 3,
"description": "Update README_FOR_AGENT.md if needed"
},
{
"step": 4,
"description": "Verify other commands (CreateSVG, CreatePNG, CreateUTXT) still work"
}
],
"acceptance-criteria": "All tests pass. Manual testing confirms preview works correctly: browser opens with HTML page, save triggers update, SVG and time update without full page reload, buffer switch works, shutdown closes preview. Other commands (PlantumlCreateSVG, PlantumlCreatePNG, PlantumlCreateUTXT) still function correctly.",
"test-plan": {
"unit": [],
"integration": [
"All Plenary tests pass",
"PlantumlCreateSVG creates file in project/umlout/svg/",
"PlantumlCreatePNG creates file in project/umlout/png/",
"PlantumlCreateUTXT creates file in project/umlout/utxt/"
],
"e2e-manual": [
"Full workflow: :PlantumlPreview opens browser with HTML page containing title, centered SVG, time",
"Save .puml file: browser updates SVG and time without full page reload",
"Switch to another .puml buffer and save: browser shows new diagram",
"Close preview: browser shows shutdown message",
"Other commands still work: :PlantumlCreateSVG, :PlantumlCreatePNG, :PlantumlCreateUTXT"
]
},
"skills": ["verification-before-completion"],
"complete": true
},
{
"task": "Fix nested template literal syntax error",
"description": "Replace nested template string with single-quoted string to resolve JavaScript parsing error.",
"steps": [
{
"step": 1,
"description": "Locate the nested template literal in generateHTML function around line 146"
},
{
"step": 2,
"description": "Replace inner template string with single-quoted string concatenation"
},
{
"step": 3,
"description": "Verify Node.js can parse the file without syntax errors"
},
{
"step": 4,
"description": "Test server startup with node server/server.js --port 8912"
}
],
"acceptance-criteria": "Node.js parses server.js without SyntaxError. Server starts successfully and listens on specified port. No 'Unexpected identifier' errors appear in console.",
"test-plan": {
"unit": [
"Node.js --check server/server.js completes with exit code 0 (syntax validation only)",
"Node.js can require the file without throwing SyntaxError"
],
"integration": [
"Server starts on port 8912 and prints 'Server started on port 8912' to stdout",
"Server responds to GET / request with HTML content containing 'PlantUML Preview'"
],
"e2e-manual": [
"Execute :PlantumlPreview command in Neovim and verify browser opens with diagram preview",
"Verify no error messages appear in Neovim messages or terminal"
]
},
"skills": ["systematic-debugging", "verification-before-completion"],
"complete": true
}
]
}