← Back to Pull requests

fix(notice): dedupe warnings per warning, drop settled rows, consume stale result files #3916

Open
unknown opened this pull request with 329 lines diff across 4 files
View on GitHub
unknown unknown commented on Oct 25, 2026 13:19 UTC
Author

Summary

  • The notice router keyed its dedupe on one sha over a whole owner group, so any owner re-resolution that re-partitioned the same rows minted a new key and re-mailed already-delivered warnings; keys are now per warning, so a delivered warning stays deduped until its cause text changes or the 24h quiet window lapses.

  • A result file was renamed to .shown only when every owner group it fed reached a terminal state, so one undelivered group held a stale file open forever; a file older than one reconcile period (900s, matching the SessionStart writer's own throttle) is now consumed after its delivery attempt.

  • Rows naming a node that is done or superseded drop at consume time, so a stale file cannot keep routing a settled node's warning.

  • The same warning repeated inside one group (two buckets, two roots) now mails once instead of once per row.
  • Changes

  • crates/fno-agents/src/notice_route.rs: per-warning sent keys (warning_fingerprint, sent_recently_in, unsent_of, record_sent_many), a settled-node filter in consume_file backed by the world read the pass already holds, mtime-based stale consumption (RECONCILE_PERIOD_S, consume_decision, file_age_secs), and one mail line per distinct warning.

  • Question pages keep their set-level identity (filename and subject); a delivered page records every member warning's key so the group dedupes independently afterward.

  • In-file tests extended: settled-row drop, key identity and cause change, re-partition immunity with the window boundary, the stale consume decision, in-group dedupe, all-settled consumption, and unroutable payloads staying on disk.
  • Test Plan

  • cargo test -p fno-agents notice_route (CI runs it; local runs stay barred by the machine-wide build freeze)

  • cargo fmt --check on the changed file (CI)
  • Out of scope

  • Worktree-root result files that no pass sweeps stay untouched by this fix; adding worktree roots to the sweep is a separate decision - tracked as x-b707
  • Test delta

    | Language | Added | Removed | Net |
    |---|---:|---:|---:|
    | Python | 0 | 0 | 0 |
    | Rust | 1 | 0 | 1 |
    | Shell | 0 | 0 | 0 |
    | Total | 1 | 0 | +1 |

    Audited owners: crates/fno-agents/src/notice_route.rs (no cut: the one added test pins seven distinct contracts - settled-row drop, key identity under cause change, re-partition immunity with the window boundary, the stale consume decision, in-group dedupe, all-settled consumption, and unroutable-payload retention - and replaces no existing assertion; the two prior test fns are untouched)

    Review

    Reviewed at 0a2035a66e: 2 rounds, 3 findings disposed.

    Fixes x-3569

    Diff: 329 lines (+246 / -83) across 4 files Reviewer: chatgpt-codex-connector[bot] Review duration: 3m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.42) × (1 − Review Confidence (0.27)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 329 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 40% · Reviewer familiarity: 35%
    27%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #3916"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 27.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.1% (MEDIUM) · Higher = larger blast radius
    42.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 27.2% · Lower = rushed or shallow review
    27.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.6% · Safe to merge
    30.6%
    Repository