Skip to content

feat(review): regenerate a public-safe summary when the narrative is withheld — a real summary on every review #9809

Description

@JSONbored

Problem

When every sentence of a review's narrative trips the public-safety sanitizer (routine for PRs touching this project's own scoring/gate code — an honest sentence says "score"/"ranking"), the published panel has no real summary. #9806 fixed the misattribution (it no longer claims a provider failure, and withheld-blockers vs clean-result get distinct honest sentences), but the reader still gets a fixed placeholder rather than a genuine summary.

Maintainer requirement: a real review summary every time — including clean, merge-ready PRs, where the summary is the merge-readiness indicator. Measured volume: 35 PRs held ai_review_inconclusive in 14 days; the withheld-narrative subset of those is the target.

Design

When composeAdvisoryNotes reaches the withheld-narrative branch (parse succeeded, nothing survived sanitization), make one additional small LLM call: rewrite the already-produced narrative for a public audience with a prompt that names the forbidden vocabulary classes, then run the rewrite through the same toPublicSafeBySentence sanitizer. Publish it only if it survives; otherwise keep #9806's honest fixed sentence as the floor.

Properties:

  • Never-echo preserved: the regenerated text passes the identical sanitizer gate before publication; the fixed sentence remains the fail-safe.
  • Bounded cost: fires only on the withheld branch (~2-3/day observed), one small completion each.
  • No new config: pure behavior improvement; self-hosters get it with the image.

Scope

  1. regeneratePublicSafeSummary(review, sanitizer) in src/services/ai-review.ts — prompt, single attempt, sanitize, fall back.
  2. Wire into the withheld branch from fix(review): report a withheld narrative honestly instead of as a provider failure #9806; keep the fixed-sentence fallback and the withheld-blockers wording rule (a withheld blocker must never read as clean).
  3. Telemetry: ai_review_summary_regenerated (success/fallback) so the regeneration rate is observable.
  4. Tests: regeneration survives the sanitizer → published; regeneration itself trips the sanitizer → fixed sentence; blockers-withheld case never reads clean.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions