ProposalProvenanceReadResult
Models & Types ยท AiDotNet.Evolution.Programs.Provenance
What a read of a provenance stream produced, including what it could not use.
For Beginners
The result of loading the notes back from disk: the notes themselves, which files they came from, and an honest count of any lines that could not be read โ usually just the last one, when the program was stopped while writing.
How It Works
A stream written by a process that was killed mid-batch, or copied while a run was still going, can end in a
partial line. Refusing the whole file over its last line would throw away every complete record before it, so
the reader keeps what it can parse and reports the rest here: MalformedLineCount counts the lines
it skipped and HasIncompleteTail says whether the final line looked cut off rather than corrupt.
A caller that needs certainty can treat either as fatal; a caller doing analysis can carry on with a known
gap.
Constructors
| Constructor | Summary |
|---|---|
ProposalProvenanceReadResult(IReadOnlyList<ProposalProvenanceRecord> records, IReadOnlyList<string> files, int malformedLineCount, bool hasIncompleteTail, long bytesRead) |
Initializes a read result. |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<ProposalProvenanceRecord> Records { get; } |
Gets the records that parsed, in file and line order. |
IReadOnlyList<string> Files { get; } |
Gets the files that were read, in read order. |
bool HasIncompleteTail { get; } |
Gets whether the final line was unterminated and unparseable, the signature of an interrupted write. |
bool IsComplete { get; } |
Gets whether every non-empty line parsed. |
int MalformedLineCount { get; } |
Gets how many non-empty lines could not be parsed and were skipped. |
long BytesRead { get; } |
Gets how many bytes were read across every file. |
Methods
| Method | Summary |
|---|---|
string ToString() |
Returns the record count and the number of lines that were skipped. |