(projectRoot, options = {})
| 217 | } |
| 218 | |
| 219 | function processDocSyncQueue(projectRoot, options = {}) { |
| 220 | const queuePath = path.join(projectRoot, '.planning', 'telemetry', 'doc-sync-queue.jsonl'); |
| 221 | const detail = readEntries(queuePath); |
| 222 | if (!detail.exists) { |
| 223 | return { |
| 224 | ok: true, |
| 225 | queuePath, |
| 226 | reportPath: null, |
| 227 | exists: false, |
| 228 | entries: 0, |
| 229 | malformed: 0, |
| 230 | summary: { pending: [], files: [], general: [], deleted: [] }, |
| 231 | }; |
| 232 | } |
| 233 | |
| 234 | const summary = summarizeEntries(projectRoot, detail.entries); |
| 235 | let reportPath = null; |
| 236 | if (!options.dryRun && (summary.pending.length > 0 || options.writeEmptyReport)) { |
| 237 | reportPath = writeReport(projectRoot, summary, options); |
| 238 | } |
| 239 | |
| 240 | if (!options.dryRun && summary.pending.length > 0) { |
| 241 | updateQueue(queuePath, detail.entries, summary, options); |
| 242 | } |
| 243 | |
| 244 | return { |
| 245 | ok: true, |
| 246 | queuePath, |
| 247 | reportPath, |
| 248 | exists: true, |
| 249 | entries: detail.entries.length, |
| 250 | malformed: detail.malformed, |
| 251 | summary, |
| 252 | }; |
| 253 | } |
| 254 | |
| 255 | function renderResult(result) { |
| 256 | if (!result.exists) return '[doc-sync] No queue file found - nothing to process.\n'; |
no test coverage detected