Skip to content

feat: content option — include change significance score (include_significance) #93

@gregoryfoster

Description

@gregoryfoster

Summary

Add include_significance: bool = False to ContentOptions. Surfaces the already-computed significance score as "Significance: 73%" in the notification body — lets recipients triage at a glance without reading the diff.

Context

Follows from #88 (notification content options Phase 1). significance is already computed in the pipeline (_compute_significance) but is not currently passed into change_metadata or event metadata. No schema migration needed.

Scope

Pipeline (src/workers/pipeline.py):

  • Add "significance": significance to change_metadata dict (line ~298, alongside added/removed/modified)

Content builder (src/core/notifications/content.py):

  • Add include_significance: bool = False to ContentOptions
  • Add _build_significance_section(metadata) — renders "Significance: {pct}%" where pct = int(metadata["significance"] * 100)
  • Only renders when significance key is present in metadata

Dashboard (src/dashboard/templates/partials/notification_content_options.html):

  • Add checkbox: "Change significance score"

Notes

  • Only meaningful for change_detected events; silently omitted for others
  • significance is a float 0–1; display as integer percentage (e.g. 0.73"73%")
  • _compute_significance clamps to [0, 1] so no bounds check needed at render time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions