Skip to content

feat(insights): every growth report is an artifact, drawn by one renderer - #689

Merged
5hirish merged 3 commits into
mainfrom
feat/growth-report-artifacts
Dec 5, 2026
Merged

5hirish merged 3 commits into
mainfrom
feat/growth-report-artifacts

Conversation

@5hirish

@5hirish 5hirish commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

What and why

Every growth report is now an artifact the agent fills, and one renderer draws all four. After #645 only Search growth worked that way. Growth overview, Social posts and Product were still written as blocks and rows on every run, held to a second contract in the backend and drawn by a second renderer in the app.

Before After
How the agent writes a report Search: a run. The other three: blocks and rows A run of the template's artifact, all four
Contracts in the backend Run contract + block contract Run contract only
Renderers in the app ArtifactView + GrowthReportView ArtifactView
Reports stored in the old shape Old renderer Read into their artifact by an adapter
  • Three artifacts (growth-overview, social-posts, product-growth), each with a layout, data schema, sample, fixture runs and a fill skill. Same section titles and sources as the templates had.
  • Two catalogue blocks: a ranked bar list (channels, posts, a funnel, views by platform; any share is worked out by the app) and a plain-text table column.
  • Deleted: agents/insights/report.py, the block contract and its plan; GrowthReportView, the unused AnalyticsReport and lib/analyticsReport.js.
  • Old reports still open. lib/legacyGrowthReport.js reads a stored block report into its template's artifact. It reads and does not repair: a part that does not fit is left out, and a report whose headline numbers cannot be read shows its verdict and asks to be refreshed.
  • One shape for the shared parts. Headline, signals, actions, sources and a series are identical across the four, and a backend test fails if they drift. Home's tile reads any of them.

Closes #646

Area

  • backend/ — FastAPI / Python
  • app/ — Next.js
  • desktop/ — Tauri shell / sidecar
  • site/ — static marketing site
  • CI / tooling / docs

Launch

Launch: changelog only, because the reports read the same; what changes for a person is the failure case and that old reports keep opening.

Verification

On the tree merged with today's main:

backend  pytest -q -m "not live" tests        3390 passed, 1 skipped
backend  ruff, dump_prompts.py --check        clean, up to date
app      npm test                             723 passed (62 files)
app      check:parity, check:i18n, typecheck  pass; artifacts OK for all 7
app      check:layout (chromium)              16 screens at 7 widths
app      build                                compiled

Looked at every new report at 390 and 1152 (light and dark) through /preview: growth-overview-report, social-posts-report, product-growth-report, product-growth-quiet-report, growth-report-stored-before, growth-report-stored-unreadable. No overflow, no console errors.

CI ran WebKit; every check is green.

One real run of each new report on the eval's synthetic site (Search Console, Google Analytics and Google Ads; Gemini 3.8 Flash):

Report Sources Stored Filled Left empty and named in what could not be checked Cost
Growth overview GSC, GA4, Ads first try headline, traffic, channels, search, signals, actions posts, product $0.082
Social posts GA4 only first try headline, signals, actions posts, platforms, referrals $0.073
Product GA4 only first try headline, signals, actions funnel, events, friction, experiments $0.083

Each read its fill skill before fetching and invented nothing for a part its sources could not fill. The synthetic site has no scheduler posts and no product analytics, so Social and Product were tested on the missing-source case; their full shape is covered by the fixture runs.

  • I ran the checks for the areas I touched (see CONTRIBUTING.md)
  • I added or updated tests covering the behaviour that changed
  • I read the AGENTS.md for each directory I edited
  • I read my own diff back looking for the reason to reject it, and read it against the code around it (STYLE.md)

Things that need a second look

  • Views by platform was a pie chart; it is now bars with each platform's share. Same data, the shape the chart rules already prefer.
  • The fill skills name PostHog's daily sessions for the traffic and referral lines. Google Analytics' landing-page pull has no days, so with only GA the line is left out and named in what could not be checked.
  • ReadSkill still has no activity row. Only unattended report runs mount it.

AI assistance

  • An AI coding agent wrote or substantially shaped this change
  • I have read every line of this diff and can explain why each part is there

Generated by Claude Code

…erer (#646)

After #645 only Search growth was an artifact the agent fills. Growth
overview, Social posts and Product were still written as blocks and rows
together on every run, held to a separate block contract in the backend
and drawn by a second renderer in the app. Two ways to produce and draw the
same kind of report is what the artifact format exists to end.

- Three artifacts, each with its layout, data schema, sample, fixture runs
  and fill skill: growth-overview, social-posts, product-growth. Same
  section titles and sources as the templates had.
- Two catalogue blocks: a ranked bar list (channels, posts, a funnel,
  views by platform, with each value's share of the total or of the first
  worked out by the app) and a plain-text table column.
- The block contract is gone: report.py, REPORT_CONTRACT, the block plan
  and its parser. Every template names its artifact, and a report run
  always returns a run held to that artifact's schema, with one repair
  turn.
- The old renderer is gone: GrowthReportView, the unused AnalyticsReport
  and lib/analyticsReport.js. A report stored in the block shape is read
  into its template's artifact (lib/legacyGrowthReport.js), so every
  stored report still opens through the same layout. It reads and does not
  repair: a part that does not fit is left out, and one whose headline
  numbers cannot be read shows its verdict and asks to be refreshed.
- A table column no row has a value for is left out, as an empty block
  is: an old report has no earlier period, so no Change column of dashes.
- The four reports' shared parts (headline, signals, actions, sources, a
  series) have the same shape, and a backend test fails if they drift:
  Home's tile reads any of them and a refresh compares runs field by field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016C6UbjwKPR3p9kJueobNsY
…today (#646)

check_docs.py holds a kept-current document's Updated line to the date of
its last change; the #646 commit landed on 2026-12-05.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016C6UbjwKPR3p9kJueobNsY
@5hirish
5hirish marked this pull request as ready for review December 5, 2026 12:37
@5hirish
5hirish merged commit 6883e29 into main Dec 5, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Growth reports: the other three as artifacts, and one renderer

2 participants