Table of Contents

Class MailAnsweringRunObservation

Namespace
MailFathom.Application.Retrieval.AskMail
Assembly
MailFathom.Application.dll

Collects what one answering run did, so the run can be recorded whether or not it produced an answer.

public sealed class MailAnsweringRunObservation
Inheritance
MailAnsweringRunObservation
Inherited Members

Remarks

It is created by the use case, handed to the answering port, and read back afterwards — including when the run threw. That is what it exists for. A run that failed on its third provider call has already retrieved somebody's mail, and a record built from the answer alone would say that run read nothing; the same is true of the span, whose counts and outcome are most worth having exactly when the run did not end cleanly.

Passing it in is deliberately explicit rather than resolved from the container. A run's record must describe one run, and an ambient value shared by whatever a scope happens to serve is one refactoring away from describing two.

It carries mail content in Passages for the length of the call and no longer, because the use case needs the passages to publish citations. Nothing derived from it is written to the record, to a log, or to a span except identifiers and counts.

It is not thread-safe and needs not be: the composition and the retrieval are written by the run, in order, and the outcome by the caller once the run has ended.

Constructors

MailAnsweringRunObservation(MailAnsweringRunId, MailboxScope, DateTimeOffset)

Initializes the observation of one run that is about to begin.

Properties

ChatEndpointAlias

Gets this deployment's own configured name for the chat endpoint the run was conducted through.

CitedEmailIds

Gets the emails the published answer named as its sources, in the order the response lists them.

CompletedAt

Gets when the run reached the ending it recorded, which is StartedAt until it has.

InstructionsVersion

Gets the version of the instruction the run was conducted under.

Outcome

Gets how the run ended.

Retrieval

Gets what the run's retrieval reached, which is Empty until a run reports otherwise.

RunId

Gets what identifies this run in every entry it leaves behind.

Scope

Gets the accounts and folders the run was allowed to read.

StartedAt

Gets when the run began.

Methods

RecordComposition(string, string)

Records what the run was composed against, before anything it could fail on.

RecordOutcome(MailAnsweringRunOutcome, IReadOnlyList<StoredEmailId>, DateTimeOffset)

Records how the run ended and which of the mail it read the answer went on to name.

RecordRetrieval(MailAnsweringRetrievalReport)

Records what the run's retrieval reached in total.