MCPcopy Create free account
hub / github.com/EvoMap/evolver / formatRecentEvents

Function formatRecentEvents

src/gep/issueReporter.js:176–190  ·  view source on GitHub ↗
(events)

Source from the content-addressed store, hash-verified

174}
175
176function formatRecentEvents(events) {
177 if (!Array.isArray(events) || events.length === 0) return '_No recent events available._';
178 const failed = events.filter(function (e) { return e && e.outcome && e.outcome.status === 'failed'; });
179 const rows = failed.slice(-MAX_EVENTS).map(function (e, idx) {
180 const intent = e.intent || '-';
181 const gene = (Array.isArray(e.genes_used) && e.genes_used[0]) || '-';
182 const outcome = (e.outcome && e.outcome.status) || '-';
183 let reason = (e.outcome && e.outcome.reason) || '';
184 if (reason.length > 80) reason = reason.slice(0, 80) + '...';
185 reason = redactString(reason);
186 return '| ' + (idx + 1) + ' | ' + intent + ' | ' + gene + ' | ' + outcome + ' | ' + reason + ' |';
187 });
188 if (rows.length === 0) return '_No failed events in recent history._';
189 return '| # | Intent | Gene | Outcome | Reason |\n|---|--------|------|---------|--------|\n' + rows.join('\n');
190}
191
192function buildIssueBody(opts) {
193 const fp = opts.envFingerprint || captureEnvFingerprint();

Callers 1

buildIssueBodyFunction · 0.85

Calls 1

redactStringFunction · 0.85

Tested by

no test coverage detected