MCPcopy Create free account
hub / github.com/SethGammon/Citadel / updateQueue

Function updateQueue

hooks_src/doc-sync.js:202–217  ·  view source on GitHub ↗
(queuePath, entries, summary, options = {})

Source from the content-addressed store, hash-verified

200}
201
202function 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
219function processDocSyncQueue(projectRoot, options = {}) {
220 const queuePath = path.join(projectRoot, '.planning', 'telemetry', 'doc-sync-queue.jsonl');

Callers 1

processDocSyncQueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected