Skip to content

US-332: Goal Progress Analytics Event

1. Story Title

Emit analytics event on goal status progression

2. Context / Background

Performance insights require tracking goal status transitions over time.

3. User Persona

Primary: Mark – Employee Secondary: Manager (aggregate analytics consumer)

4. Problem Statement

Lack of structured telemetry for goal progression blocks analytics dashboards & improvement metrics.

5. Desired Outcome

When goal status changes, system emits GoalStatusChanged analytics event with relevant attributes.

6. Business Value

Enables performance velocity metrics; informs coaching patterns.

7. Scope (In / Out)

In: event emission on status change, dedup safeguards, essential attributes (goalId, ownerId, previousStatus, newStatus, timestamp). Out: Sentiment analysis of descriptions, cross-team aggregation service.

8. Acceptance Criteria (BDD)

Scenario: Status change emits event
  Given a goal with status Planned
  When employee updates status to In Progress
  Then GoalStatusChanged event emitted

Scenario: No event on identical status
  Given goal status In Progress
  When employee sets In Progress again
  Then no event emitted

Scenario: Missing mandatory attributes blocked
  Given an update lacks ownerId context
  When processing occurs
  Then event emission aborted
  And validation error logged

Scenario: Rapid successive changes emit distinct events
  Given status changes twice in one minute
  When updates occur
  Then two distinct events emitted

9. UX Notes / References

Goal status dropdown; no extra UI beyond existing change action.

10. Data / Domain Model Impact

No schema change; adds analytics emission hook.

11. NFR Touchpoints

  • Performance: emission overhead negligible (<10ms).
  • Observability: events trace-linked to user action.
  • Security: event excludes sensitive content.

12. Dependencies

Existing goal CRUD (US-331); analytics emitter; permission service.

13. Risks & Mitigations

Risk Impact Probability Mitigation
Event spam from toggling Noisy analytics Medium Debounce advisory (monitor)
Missing previousStatus Incomplete analytics Low Capture before mutation

14. Estimation Support

  1. Hook insertion
  2. Event payload definition
  3. Dedup guard
  4. Tests

15. Analytics / Success Metrics

Goal status transition counts; cycle time between Planned → Completed.

16. Rollout / Release Strategy

Silent release; backfill historical status transitions optional later.

17. Definition of Ready Checklist

  • Event schema finalized

18. Definition of Done Checklist

  • Tests implemented
  • Event visible in pipeline
  • Docs updated (events-schema)

19. Open Questions

  1. Include alignmentRef changes as separate event?
  2. Need Completed reason taxonomy?

Version: 1.0