Zion Boggan zionboggan.com ↗

Surface raw vs merged prompt counts

The report showed only the post-merge node count (Prompts: 28), hiding
that the raw transcript had more turns folded in (continuations, re-issues,
near-duplicates). Add rawPromptCount to stats, show both in the report
session summary, and expose rawPrompts in tree.json.
3a3a1d6   Zion Boggan committed on Jun 13, 2026 (1 week ago)
src/render-json.js +1 -0
@@ -25,6 +25,7 @@ export function renderJson(tree, opts = {}) {
},
stats: {
prompts: stats.promptCount,
+ rawPrompts: stats.rawPromptCount,
sessions: stats.sessionCount,
days: stats.days,
corrections: stats.corrections,
src/report.js +7 -1
@@ -30,7 +30,13 @@ export function renderReportMarkdown(tree, opts = {}) {
lines.push('## Session summary');
lines.push('');
- lines.push(`- Prompts: ${tree.stats.promptCount}`);
+ const { promptCount, rawPromptCount } = tree.stats;
+ const foldedTurns = (rawPromptCount || promptCount) - promptCount;
+ lines.push(
+ foldedTurns > 0
+ ? `- Prompts: ${promptCount} (merged from ${rawPromptCount} raw turns; ${foldedTurns} continuation or duplicate turn${foldedTurns === 1 ? '' : 's'} folded in)`
+ : `- Prompts: ${promptCount}`
+ );
lines.push(`- Sessions: ${tree.stats.sessionCount}`);
if (tree.stats.days) lines.push(`- Active span: ${plural(tree.stats.days, 'day')}`);
if (tree.stats.corrections) lines.push(`- Corrections: ${tree.stats.corrections}`);
src/tree.js +1 -0
@@ -120,6 +120,7 @@ function computeStats(sessions, nodes) {
return {
promptCount: nodes.length,
+ rawPromptCount: sessions.reduce((acc, s) => acc + (s.prompts ? s.prompts.length : 0), 0),
sessionCount: sessions.filter((s) => s.prompts.length).length,
byKind,
corrections: byKind['correction'] || 0,