Skip to content

fix(report): live-summary Yhteenveto excludes demoted content (ADR-0032/0033) - #58

Merged
MikkoNumminen merged 1 commit into
masterfrom
fix/summary-excludes-demoted
Jul 15, 2026
Merged

fix(report): live-summary Yhteenveto excludes demoted content (ADR-0032/0033)#58
MikkoNumminen merged 1 commit into
masterfrom
fix/summary-excludes-demoted

Conversation

@MikkoNumminen

Copy link
Copy Markdown
Owner

Problem

The whole-window Yhteenveto (the live-summary Overall narrative, served to the desk via /live/report) was synthesized over every structured item, including demoted rasismi/asiaton ones. SynthesizeThemeAsync hands the model a severity distribution and per-item excerpts with severity, so the model:

  • named moderated content in the lead summary with a rating — e.g. '<slur>' (korkea);
  • recited a severity distribution that counted demoted items (the inflated window total);
  • computed the Overall count and trend over demoted items too — and the desk "suunta" KPI tile reads report.overall.directionLabel, so it inherited the leak.

This violated ADR-0032 (demoted = unrated, excluded from severity aggregates) and ADR-0033 §3 (top of the page reflects real feedback only).

Fix

Synthesize the Overall over rated items only (structured.Where(i => !DemotedCategories.Contains(i.Structure.Category))): narrative, severity digest, excerpts, window total, trend, and needs-review count. reportSentiment already excluded demoted content. A window containing only demoted content now yields no Yhteenveto (the collapsed moderation count still shows) instead of a summary written about hostile content.

Server-side in ReportService, so every consumer of Overall inherits it.

Not a separate bug (verified)

The korkea+kriittinen and entries KPI tiles already compute over rated sections in every render path (desk phase A/B, management, snapshot); for genuinely-demoted items they count 0. The reported "5 kriittinen in the moderated category" was the leaked trend tile + the Yhteenveto's own polluted numbers, both fixed here.

Tests

  • New regression test SummaryMode_Overall_ExcludesDemotedContent_FromDigestCountAndTrend: asserts the demoted item's id/excerpt/critical severity never reach the synthesis digest and Overall.Count/FeedbackIds are rated-only.
  • Full FeedbackIntelligence.Api.Tests: 148 passed, 0 failed.

AI-first docs

YesADR-0033 §3 updated to state the Yhteenveto is part of the rated-only separation.

Known follow-ups (out of scope for this PR)

  • Standard /report path (management view + offline snapshot) still LLM-synthesizes demoted-category narratives with severity fed in, so a moderation card there could editorialize a slur's severity.
  • Moderation cards render a trend label including the severity-derived paheneva (worsening).
  • Desk phase-A transient: a demoted critical can flash as rated for the moment before /schema resolves, then self-heals.

…32/0033)

The whole-window Overall (Yhteenveto) was synthesized over every structured
item, including demoted rasismi/asiaton ones. SynthesizeThemeAsync feeds the
model a severity distribution and per-item excerpts with severity, so the lead
summary named moderated content with a rating ("'<slur>' (korkea)") and counted
its severities in the distribution; the Overall count and trend (the desk
"suunta" tile) were over all items too.

Synthesize the Overall over rated items only (excluding DemotedCategories):
narrative, severity digest, excerpts, window total, trend, and needs-review
count. reportSentiment already excluded demoted. A window of only demoted
content now yields no Yhteenveto (the moderation count still shows), instead of
a summary written about hostile content. This brings the lead summary in line
with ADR-0033 section 3 (top of page = real feedback only) and ADR-0032
(demoted = unrated, excluded from severity aggregates).

Adds a regression test asserting the demoted item's id/excerpt/critical severity
never reach the synthesis digest and Overall.Count/FeedbackIds are rated-only.
@MikkoNumminen
MikkoNumminen merged commit 1425e1b into master Jul 15, 2026
3 checks passed
@MikkoNumminen
MikkoNumminen deleted the fix/summary-excludes-demoted branch July 15, 2026 01:00
MikkoNumminen added a commit that referenced this pull request Jul 16, 2026
* chore: ignore local poro-findings.pdf export; record TODO #9 (deploy) done

The canonical Poro findings are docs/poro-findings.md; the root PDF is a
personal export, so gitignore it rather than track a binary. Also commits the
already-recorded TODO item #9 (rebuild+restart to pick up the #58/#59
demoted-content fixes, verified live 2026-07-15).

* docs: mark TODO #8 (SQLite security watch) done — resolved by #55

Bundled SQLite is now 3.50.4 (>= 3.50.2), clearing GHSA-2m69-gcr7-jv3q.
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.

1 participant