Files
AutopilotMonitor/src
Oliver Kieselbach 192a1e939b refactor(sessions): unify SessionSummary mapper + SessionsIndex projection; fix ImeAgentVersion/AdminMarkedAction drift
Audit findings #4 (SessionSummary mapper x3) and #3 dual-write Phase 1.

- Collapse the two ~99%-identical SessionSummary mappers into one core mapper
  taking the resolved sessionId (index vs primary differ only in that source).
- BuildSessionIndexEntity is now the single SessionsIndex projection manifest and
  a SUPERSET of every field the merge call sites write, so a StartedAt-shift full
  upsert can no longer drop a merged field (the recurring drift class, cf ab90423b).
- Fix two real bugs surfaced while grounding the design: ImeAgentVersion was never
  written to the index although search/MCP push an OData filter against it (filter
  matched nothing); UpdateSessionImeAgentVersionAsync now mirrors it. AdminMarkedAction
  (dashboard list badge) was merged but missing from the projection -> now included.
- SyncSessionIndexAsync funnels the upsert-vs-merge + IndexRowKey-resolution decision
  that was duplicated across the 3 StartedAt-shift branch sites.
- Correct the DeletionState doc-comment (it is primary-only, not index-surfaced).

The SessionsIndex is a full denormalized mirror of Sessions (different RowKey sort)
serving list/search/stats/raw directly; lean-drop would break /api/raw/sessions.

Backend build 0 warnings; full xUnit suite 2172/2172 (incl. new index-projection +
ImeAgentVersion-mirror tests). BuildSessionIndexEntity made internal for the test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 20:54:16 +02:00
..
2026-06-05 14:06:11 +02:00