Skip to content

feat(life-events): add Life Events domain to Biotrackr #313

@willvelida

Description

@willvelida

Overview

Add the ability to record life events (illness, travel, special occasions, medication changes, injuries, etc.) to the user's profile. These events provide contextual data so AI agents can correlate health data patterns with real-life circumstances.

Scope

Full-stack feature spanning 4 PRs scoped to individual services:

  1. Biotrackr.LifeEvents.Api — New CRUD domain API (first write-capable domain API)
  2. Biotrackr.Mcp.Server — 3 read-only MCP tools for AI agent access
  3. Biotrackr.UI — Blazor CRUD page, form dialog, dashboard card, service layer CRUD methods
  4. Infrastructure & CI/CD — Bicep templates and GitHub Actions workflow

Key Design Decisions

  • Data Model: One document per event in shared records container with documentType = "LifeEvent"
  • Multi-day events: endDate always stored (= date for single-day events); interval overlap queries
  • Categories: 21 fixed categories (Medical, Lifestyle, Environmental, Emotional/Social, General) with optional free-text notes
  • Impact Areas: Optional impactAreas field (activity, sleep, food, vitals) for filtered MCP queries
  • Security: Input validation with ASI01 prompt injection scanning, rate limiting (30 writes/min), 64KB body limit
  • AI Integration: Zero changes to Chat API or Reporting API — MCP tools auto-discovered

Planning Documents

  • Research: .copilot-tracking/research/2026-04-23/life-events-feature-research.md
  • Plan: .copilot-tracking/plans/2026-04-23/life-events-feature-plan.instructions.md
  • Details: .copilot-tracking/details/2026-04-23/life-events-feature-details.md
  • Log: .copilot-tracking/plans/logs/2026-04-23/life-events-feature-log.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions