Files
last30days-skill/tests
Matt Van Horn 6acfc9017e feat: move stats footer into Python engine, harden synthesis voice contract
DO NOT MERGE until local validation passes on 3+ golden topics.

Problem: the magic footer ( All agents reported back!, emoji tree,
Top voices, Raw results saved) was composed by the synthesizer model
following a "Copy this EXACTLY" template buried 1150 lines into SKILL.md.
Under context pressure, Opus 4.7 dropped it. Three recent /last30days
runs (Opus 4.7, programming language for AI agents, Kanye West)
produced clean prose with no footer and used AI-slop section headers
(## The launch, ## Where it disappoints) instead of flowing paragraphs.

Fix:

1. render.py: new _render_emoji_footer() emits the deterministic footer
   as the final block of every compact output. Zero-count sources are
   omitted. Tree characters (├─ / └─) computed from populated-line
   count. The model no longer assembles the tree from text instructions.

2. render.py: new _site_name_for_url() and _format_web_line_sources()
   map URLs to clean publication names (Later, Buffer, CNN, etc.) so
   the 🌐 Web line is pre-assembled by Python.

3. last30days.py: compute_save_path_display() turns the save path into
   a ~/-relative string that the engine puts in the footer. Signature
   change: emit_output() and render_compact() both accept save_path.

4. SKILL.md synthesis contract rewritten:
   - Footer template DELETED. Replaced with instruction to include the
     engine footer block verbatim.
   - URL-to-site-name sub-block DELETED. Engine does this.
   - "Calculate actual totals" paragraph DELETED. Engine does this.
   - All em-dashes in the synthesis section replaced with ` - ` (single
     hyphen with spaces). Em-dashes are the most reliable AI-slop tell.
   - New rules: no ## markdown section headers in response body, no
     invented title line like "{Topic}: last 30 days", no bold section
     labels acting as headers. Bold-lead-in paragraph shape stays.
   - SELF-CHECK updated to verify footer presence, no em-dashes, no
     body-level headers.

Tests: 15 new tests covering footer emission, zero-source omission,
tree character placement, save-path threading, URL-to-name helper,
Web line formatting, Top voices combination, Polymarket line.

All 127 tests pass across render, rerank, cluster, briefing, CLI,
internals, fun-scoring.

Plan: docs/plans/2026-04-17-003-feat-deterministic-footer-plan.md

Local validation protocol (blocks merge):
- Run /last30days in a fresh Claude Code window on 5 golden topics
- Verify each output contains the footer block verbatim
- Verify zero ## body headers, zero em-dashes/en-dashes, zero invented
  title lines
- Report 5x8 pass/fail matrix; all 40 cells must be green before merge

🤖 Generated with Claude Opus 4.7 (1M context) via [Claude Code](https://claude.com/claude-code) + Compound Engineering v2.63.1

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 09:15:55 -04:00
..
2026-01-23 12:37:31 -08:00
2026-01-23 12:37:31 -08:00