Files
meeting-assistant/openspec/changes/attach-calendar-metadata-to-active-meeting/design.md
T
codex 1a341f1eaa
PR and Push Build/Test / build-and-test (push) Successful in 15m2s
feat: attach calendar metadata to active meetings
2026-08-05 11:58:25 +02:00

70 lines
5.7 KiB
Markdown

## Context
Standalone Outlook enrichment already selects a single suitable Teams appointment and already contains a fixed five-minute upcoming-start window, but that behavior is not represented in the accepted specification. The selector intentionally returns no metadata when the suitable candidates are ambiguous. Calendar notifications avoid that ambiguity because each notification carries one cached appointment and its metadata.
The prompt scheduler currently offers `Record` and `Skip`. Choosing `Record` while a meeting is active stops that meeting and starts a new run with the prompted metadata. Metadata application is currently private to recording startup/background lookup, so the scheduler has no safe way to enrich the active run in place.
## Goals / Non-Goals
**Goals:**
- Specify and preserve the existing five-minute pre-start Outlook metadata grace period.
- Preserve conservative standalone selection when more than one appointment is suitable.
- Offer an appointment-specific metadata action only when a recording is active and the prompt carries metadata.
- Apply that metadata atomically to the active run without interrupting capture or transcription.
- Prevent a slower standalone Outlook lookup from overwriting explicitly attached prompt metadata.
- Reuse existing attendee canonicalization, attendee-added workflow transformations, attendee import limits, and artifact rendering.
**Non-Goals:**
- Automatically choose among concurrent appointments.
- Change the existing `Yes` behavior that finishes the current recording and starts the prompted appointment as a new recording.
- Add a new workflow trigger or replay an already-completed lifecycle state transition.
- Guarantee an exact action-button row layout that the native Windows toast renderer does not expose to the application.
## Decisions
### Keep the five-minute grace period in the shared candidate selector
The current selector already treats exactly one appointment starting within five minutes as eligible when there is no suitable overlap. The change will codify this behavior in OpenSpec and retain its behavior test. Candidate selection remains conservative: multiple suitable overlaps or multiple upcoming candidates return no selection.
This keeps manual enrichment independent of the calendar prompt cache. Using the prompt cache for all metadata lookup was considered, but it would couple ordinary recording startup to an optional hosted feature and its sync freshness.
### Put active-recording capability on the prompt request
The scheduler will snapshot whether the prompt can attach metadata when it calls the prompt service. The Windows adapter will add a third `Add metadata to current meeting` background action after the existing `Yes` and `No` actions only when that flag is true. The response enum will carry a distinct attach result, so the callback still identifies the exact cached appointment.
The native toast API controls final action layout and does not provide a reliable per-button full-row placement contract. Adding the action after the two short actions gives the renderer the best available ordering while keeping the label explicit.
### Add one coordinator operation for explicit active-run metadata
`IMeetingPromptRecordingController` will expose an attach operation backed by `MeetingRecordingCoordinator`. Under the coordinator gate, it will require a currently capturing run, mark that run as explicitly assigned, re-read the latest meeting note, apply the shared metadata rules, save the note, and refresh assistant-context and transcript metadata. Capture and transcription continue unchanged.
Centralizing the mutation in the coordinator keeps run ownership, artifact paths, profile options, and serialization under the same synchronization boundary. Direct file mutation from the scheduler was rejected because it could race recording lifecycle writes and would bypass attendee normalization and workflow transformations.
### Explicit prompt metadata wins over background lookup
Each recording run will track whether appointment metadata was explicitly assigned. The background Outlook task will check this flag before and after acquiring the coordinator gate. If explicit prompt metadata has already been attached, the background result is discarded. If the background update wins the gate first, the later explicit action overwrites it, so the user's appointment choice remains authoritative.
### Do not replay lifecycle transitions
Attendee-added transformations run as part of the shared metadata application path. The meeting has already transitioned from `collecting metadata` to `transcribing`, so the attach action will not fabricate or replay that state transition. Existing live speaker matching already observes changes to meeting-note attendees.
## Risks / Trade-offs
[Native toast may not render the third action as a full-width row] -> Keep it as the final, clearly labelled action and let Windows choose the physical layout.
[The recording stops before the user activates the notification] -> Recheck active capture under the coordinator gate and leave artifacts unchanged if there is no current recording.
[Metadata attachment replaces title and attendee metadata] -> Reuse the established prompted-start semantics so the selected appointment becomes authoritative while preserving the note body and other user-authored content.
[A delayed background lookup races the explicit action] -> Record explicit assignment on the run and make the explicit appointment win regardless of completion order.
## Migration Plan
No data or configuration migration is required. The notification gains one conditional action, and existing `Yes`/`No` activation arguments remain valid. Rollback removes the action and coordinator method without changing stored meeting artifacts.
## Open Questions
None.