(queuePath, entries, summary, options = {})
| 200 | } |
| 201 | |
| 202 | function updateQueue(queuePath, entries, summary, options = {}) { |
| 203 | const now = options.now || new Date().toISOString(); |
| 204 | const fileSet = new Set(summary.files.map(item => item.file)); |
| 205 | const deletedSet = new Set(summary.deleted); |
| 206 | const generalSet = new Set(summary.general); |
| 207 | |
| 208 | const updated = entries.map((entry) => { |
| 209 | if (!ACTIONABLE_STATUSES.has(entry.status)) return entry; |
| 210 | if (entry.file && fileSet.has(entry.file)) return { ...entry, status: 'surfaced', surfacedAt: now }; |
| 211 | if (deletedSet.has(entry)) return { ...entry, status: 'skipped-deleted', surfacedAt: now }; |
| 212 | if (generalSet.has(entry)) return { ...entry, status: 'surfaced', surfacedAt: now }; |
| 213 | return entry; |
| 214 | }); |
| 215 | |
| 216 | fs.writeFileSync(queuePath, updated.map(entry => JSON.stringify(entry)).join('\n') + (updated.length ? '\n' : ''), 'utf8'); |
| 217 | } |
| 218 | |
| 219 | function processDocSyncQueue(projectRoot, options = {}) { |
| 220 | const queuePath = path.join(projectRoot, '.planning', 'telemetry', 'doc-sync-queue.jsonl'); |
no outgoing calls
no test coverage detected