Table of Contents

Class PresentationPlan

Namespace
MailFathom.Application.Discovery.Presentation
Assembly
MailFathom.Application.dll

What one Discover run produced: an ordered set of typed blocks, the sources behind them, and what the run knows about its own reach.

public sealed record PresentationPlan : IEquatable<PresentationPlan>
Inheritance
PresentationPlan
Implements
Inherited Members

Remarks

The contract between whatever composes an answer and whatever draws one. It is defined apart from both because two properties of it have to hold whoever is at either end.

It is closed. A plan holds blocks from the catalogue in PresentationBlockType and nothing else, and no part of it is markup, a template, an expression, or anything a client evaluates. That is what lets the client draw a plan with ordinary typed UI, and it is what keeps a model from proposing a presentation nobody wrote a renderer for.

It is versioned apart from the application. A deployment and a client are updated separately, so a client will meet a plan produced by a service ahead of it. SchemaVersion says which revision of this contract the plan was written against, and each block carries the revision of its own type, so a client can draw the blocks it knows, say what it cannot, and keep the rest of the run. Without both, the only safe answer to one unfamiliar block would be to discard the whole thing.

Citations are declared once, here, and referred to by name from the blocks that rest on them — so two facts drawn from one message are visibly the same source, and a client can list what a whole run rested on. The constructor refuses a plan whose blocks name a citation it does not declare, and refuses a backed block resting on a source the plan itself says nobody could read; those are the two ways a citation contract fails quietly rather than loudly.

Coverage is what the run says about its own reading rather than about any one block. A client reads a synchronized copy, so which accounts an answer drew on, how far the mail it drew on reached, and how current each of those accounts was are part of the answer rather than a footnote under it.

A plan is composed from somebody's correspondence and is sensitive throughout: its texts are quoted or summarized mail, its people are real people, and its citations name messages in a mailbox. It belongs in a response and nowhere else — never in a log line, a span attribute, or an exception message.

Constructors

PresentationPlan(int, IReadOnlyList<PresentationBlock>, IReadOnlyList<PresentationCitation>, IReadOnlyList<AccountCoverage>, IReadOnlyList<PresentationLimitation>)

Initializes what one run produced.

Fields

CurrentSchemaVersion

The revision of this contract that this build writes and understands.

MaxAccountsCovered

The greatest number of accounts one run may report having read.

MaxBlocks

The greatest number of blocks one plan may hold.

MaxCitations

The greatest number of citations one plan may declare.

Properties

Blocks

Gets the blocks, in the order they are read.

Citations

Gets the sources the blocks rest on, declared once each.

Coverage

Gets what the run read, one entry per account it drew on, which is empty where it drew on no account at all.

Limitations

Gets what the run knows about its own reach, which is empty where it reached everything it was asked about.

SchemaVersion

Gets the revision of this contract the plan was written against.

Methods

Compose(IReadOnlyList<PresentationBlock>, IReadOnlyList<PresentationCitation>, IReadOnlyList<AccountCoverage>, IReadOnlyList<PresentationLimitation>)

Composes a plan against the revision of the contract this build writes.

RestsOnDepictedSourcesOnly(PresentationBlock)

Reports whether every source one block rests on is a description of a picture rather than something somebody wrote.