feat(recipe-report): restructure page — priority-sorted wire table w/ CVE column, addendum, per-recipe changes

New page order: short lead -> the full wire table (sorted by priority-to-address,
CVE recipes first, new CVEs count column) -> Addendum (bullets of real special
issues, omitted if clean) -> Security Bulletin -> per-recipe "What changed".

- recipe-report.py: _table() gains a CVEs column + recipe-name linking; new
  _changes() helper; render() reordered; docstring SPEC SHAPE updated
  (cve/addendum/changes added, needs_attention/routine removed).
- recipe-report/SKILL.md + example-spec.json: new procedure, spec shape, and
  gold-standard template (2026-06-05, new format).
- launch-report.py: kickoff text reflects the new priority-ordered structure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
autonomic-bot
2026-06-05 17:06:43 +00:00
co-authored by Claude Opus 4.8
parent 49491fcb90
commit d31378b180
4 changed files with 528 additions and 47 deletions
+2 -2
View File
@@ -44,8 +44,8 @@ def build_kickoff(date):
f"Full spec: {WORKDIR}/.claude/skills/recipe-report/SKILL.md. Creds in {WORKDIR}/.testenv; "
f"reach the CI server with `ssh cc-ci`.\n"
f"You are READ-ONLY: review the latest /upgrade-all run + every recipe's open PRs + CI verdicts, "
f"classify needs-attention vs routine, and publish one HTML page per run to "
f"report.ci.commoninternet.net (+ regenerate the index). Public page — NO secrets/tokens/raw logs. "
f"order the wire table by priority-to-address (CVE recipes first), and publish one HTML page per "
f"run to report.ci.commoninternet.net (+ regenerate the index). Public page — NO secrets/tokens/raw logs. "
f"Never merge/edit/comment on PRs. When done, print the report URL + 'RECIPE REPORT COMPLETE' and "
f"go idle (do NOT loop)."
)
+62 -18
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
"""recipe-report — data + HTML helper for the weekly "Recipe Report" (/recipe-report skill).
A newspaper-style front page: masthead, an editorial LEAD (overall recipe-fleet state + what to focus
on), a SECURITY BULLETIN of critical-CVE upgrades up top, then needs-attention / routine, and the
comprehensive table ("the full wire") at the end.
A newspaper-style front page: masthead, a SHORT editorial LEAD, then the comprehensive table ("the
full wire" — priority-sorted, CVEs column), an ADDENDUM of special issues, a SECURITY BULLETIN, and a
per-recipe "what changed" section at the end.
Subcommands (the /recipe-report agent runs them around its own review/classification):
survey [DATE] JSON of the run + every recipe's open PRs + CI verdict + per-recipe upgrade
@@ -11,14 +11,22 @@ Subcommands (the /recipe-report agent runs them around its own review/classifica
render SPEC.json OUT.html render the agent's report spec -> a self-contained newspaper HTML page
publish OUT.html DATE copy to cc-ci:/var/lib/cc-ci-reports/week-DATE.html and regen the archive index
Page order: short lead → the full wire table (priority-sorted, CVEs column) → Addendum → Security
Bulletin → per-recipe "What changed".
SPEC SHAPE (the agent writes this JSON):
{"date":"YYYY-MM-DD","subtitle":"Week of <human date>",
"lead":"<editorial: overall fleet state + what to focus on; blank-line-separated paragraphs>",
"security":[{"title":"recipe — CVE-… (critical)","body":"what it fixes","links":[{"text":"PR #","url":""}]}],
"needs_attention":[{"title":"","body":"","links":[…]}],
"routine":[ {same shape} ],
"table":[{"recipe":"x","change":"a → b","status":"GREEN","ci":"build 154 ✓","ci_url":"",
"pr":"#4","pr_url":"","notes":""}]}
"lead":"<ONE short paragraph>",
"table":[{"recipe":"x","change":"a → b","status":"GREEN|FAILED|STALE|SKIPPED|UPTODATE",
"cve":16, # number of CVEs this PR fixes; 0/omit for none
"ci":"build 154 ✓","ci_url":"","pr":"#4","pr_url":"","notes":""}],
# ROWS SORTED by recommended priority to address — recipes WITH CVEs first, then failures,
# then stale-tests, then routine green, then up-to-date/skipped.
"addendum":["a special issue to look into (multiple open PRs, a CI-run oddity, a possible
improvement) …"], # only real issues — omit/empty if everything's clean
"security":[{"title":"recipe — CVE-… (high)","body":"what it fixes","links":[{"text":"PR #","url":""}]}],
"changes":[{"recipe":"x","body":"what changed in this recipe's PR","links":[{"text":"PR #4","url":""}]}]}
# one `changes` entry per recipe that has a PR this week.
PUBLIC PAGE — include only public-safe data (no secrets/tokens/raw logs).
"""
import base64, html, json, os, re, subprocess, sys, urllib.request
@@ -114,6 +122,11 @@ th{border-bottom:2px solid var(--rule);font-size:.72rem;text-transform:uppercase
footer{margin-top:2.6rem;border-top:4px double var(--rule);padding-top:.8rem;font-size:.82rem;color:var(--mut);text-align:center}
.idx{list-style:none;padding:0}.idx li{padding:.55rem 0;border-bottom:1px solid #d8d2c2;font-size:1.1rem}
.idx .d{color:var(--mut);font-size:.85rem;float:right}
td .cve{color:var(--red);font-weight:800}.muted{color:#999}
.addendum-h{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;margin:1.7rem 0 .3rem;color:var(--ink)}
ul.addendum{margin:.2rem 0 1.2rem 1.2rem;padding:0}ul.addendum li{margin:.35rem 0;line-height:1.55}
.change{margin:.8rem 0;padding-bottom:.7rem;border-bottom:1px solid #d8d2c2}
.change .ch{font-weight:700;font-size:1.12rem}.change .cb{margin:.2rem 0 .35rem;color:#2b2b2b}
"""
@@ -148,25 +161,48 @@ def _stories(items, repo_url=None):
f'<div class="b">{lk(it.get("body"))}</div>{_links(it.get("links"))}</div>' for it in items)
def _table(rows):
def _table(rows, repo_url=None):
if not rows:
return ""
head = "<tr><th>Recipe</th><th>Change</th><th>Status</th><th>CI</th><th>PR</th><th>Notes</th></tr>"
head = ("<tr><th>Recipe</th><th>Change</th><th>Status</th><th>CVEs</th>"
"<th>CI</th><th>PR</th><th>Notes</th></tr>")
trs = []
for r in rows:
scls = "s-" + str(r.get("status", "")).upper().replace("-", "").replace(" ", "")
name = _esc(r.get("recipe"))
if repo_url and r.get("recipe") in repo_url:
name = f'<a href="{repo_url[r["recipe"]]}">{name}</a>'
cve = r.get("cve")
cve_cell = (f'<span class="cve">{int(cve)}</span>' if isinstance(cve, (int, float)) and cve
else '<span class="muted">none</span>')
ci = _esc(r.get("ci"))
if r.get("ci_url"):
ci = f'<a href="{_esc(r["ci_url"])}">{ci}</a>'
pr = _esc(r.get("pr"))
if r.get("pr_url"):
pr = f'<a href="{_esc(r["pr_url"])}">{pr}</a>'
trs.append(f"<tr><td>{_esc(r.get('recipe'))}</td><td>{_esc(r.get('change'))}</td>"
f'<td class="{scls}">{_esc(r.get("status"))}</td><td>{ci}</td><td>{pr}</td>'
f"<td>{_esc(r.get('notes'))}</td></tr>")
trs.append(f"<tr><td>{name}</td><td>{_esc(r.get('change'))}</td>"
f'<td class="{scls}">{_esc(r.get("status"))}</td><td>{cve_cell}</td>'
f"<td>{ci}</td><td>{pr}</td><td>{_esc(r.get('notes'))}</td></tr>")
return f"<table>{head}{''.join(trs)}</table>"
def _changes(items, repo_url=None):
"""Per-recipe 'what changed' sections (one per recipe that has a PR)."""
if not items:
return ""
lk = (lambda x: _linkify_recipes(_esc(x), repo_url)) if repo_url else _esc
out = []
for c in items:
name = c.get("recipe")
hdr = _esc(name)
if repo_url and name in repo_url:
hdr = f'<a href="{repo_url[name]}">{hdr}</a>'
out.append(f'<div class="change"><div class="ch">{hdr}</div>'
f'<div class="cb">{lk(c.get("body"))}</div>{_links(c.get("links"))}</div>')
return "\n".join(out)
def _page(title, body):
return (f'<!doctype html><html lang="en"><head><meta charset="utf-8">'
f'<meta name="viewport" content="width=device-width,initial-scale=1">'
@@ -195,12 +231,20 @@ def render(spec_path, out_path):
f'<div class="dateline"><span>{_esc(sub)}</span>'
f'<span>report.ci.commoninternet.net</span><span>{gen}</span></div>'
f'<div class="lead">{lead}</div>')
# 1) the full wire — every recipe, in the agent's recommended priority order (CVEs first); CVEs column.
body += f'<h2>The full wire — every recipe, in priority order</h2>{_table(s.get("table"), repo_url)}'
# 2) addendum — special issues to look into (normal-size header); omitted entirely if there are none.
add = [a for a in (s.get("addendum") or []) if str(a).strip()]
if add:
body += ('<p class="addendum-h">Addendum</p><ul class="addendum">'
+ "".join(f"<li>{_linkify_recipes(_esc(b), repo_url)}</li>" for b in add) + "</ul>")
# 3) security bulletin
if s.get("security"):
body += ('<div class="bulletin"><div class="kicker">Security Bulletin</div>'
'<h2>🔒 Critical CVE upgrades — merge first</h2>' + _stories(s["security"], repo_url) + "</div>")
body += f'<h2>⚑ Needs attention</h2>{_stories(s.get("needs_attention"), repo_url)}'
body += f'<h2>Routine</h2><div class="cols">{_stories(s.get("routine"), repo_url)}</div>'
body += f'<h2>The full wire — every recipe</h2>{_table(s.get("table"))}'
'<h2>🔒 Critical CVE upgrades</h2>' + _stories(s["security"], repo_url) + "</div>")
# 4) what changed — a short section per recipe that has a PR
if s.get("changes"):
body += f'<h2>What changed</h2>{_changes(s.get("changes"), repo_url)}'
body += (f'<footer>The Recipe Report · generated {gen} · '
f'<a href="https://ci.commoninternet.net/">dashboard</a> · <a href="./">archive</a></footer>')
open(out_path, "w").write(_page("The Recipe Report — " + s["date"], body))