fix(report): live-summary Yhteenveto excludes demoted content (ADR-0032/0033) - #58
Merged
Merged
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The whole-window Yhteenveto (the live-summary
Overallnarrative, served to the desk via/live/report) was synthesized over every structured item, including demotedrasismi/asiatonones.SynthesizeThemeAsynchands the model a severity distribution and per-item excerpts with severity, so the model:'<slur>' (korkea);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
Overallover rated items only (structured.Where(i => !DemotedCategories.Contains(i.Structure.Category))): narrative, severity digest, excerpts, window total, trend, and needs-review count.reportSentimentalready 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 ofOverallinherits it.Not a separate bug (verified)
The
korkea+kriittinenand 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
SummaryMode_Overall_ExcludesDemotedContent_FromDigestCountAndTrend: asserts the demoted item's id/excerpt/criticalseverity never reach the synthesis digest andOverall.Count/FeedbackIdsare rated-only.FeedbackIntelligence.Api.Tests: 148 passed, 0 failed.AI-first docs
Yes —
ADR-0033 §3updated to state the Yhteenveto is part of the rated-only separation.Known follow-ups (out of scope for this PR)
/reportpath (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.paheneva(worsening)./schemaresolves, then self-heals.