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
Summary
Add
include_significance: bool = FalsetoContentOptions. 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).
significanceis already computed in the pipeline (_compute_significance) but is not currently passed intochange_metadataor event metadata. No schema migration needed.Scope
Pipeline (
src/workers/pipeline.py):"significance": significancetochange_metadatadict (line ~298, alongsideadded/removed/modified)Content builder (
src/core/notifications/content.py):include_significance: bool = FalsetoContentOptions_build_significance_section(metadata)— renders"Significance: {pct}%"wherepct = int(metadata["significance"] * 100)significancekey is present in metadataDashboard (
src/dashboard/templates/partials/notification_content_options.html):Notes
change_detectedevents; silently omitted for otherssignificanceis a float 0–1; display as integer percentage (e.g.0.73→"73%")_compute_significanceclamps to [0, 1] so no bounds check needed at render time