ProposalProvenanceRecord
Models & Types · AiDotNet.Evolution.Programs.Provenance
Everything known about one request-and-answer round that a language model was asked to turn into a candidate program: who asked, what was asked, what came back, what it cost, and what the answer turned into.
For Beginners
This is one page of the lab notebook for an AI-driven search. It says: at this moment, we showed model M this prompt about program P, it replied with this text, the reply cost this many tokens and took this long, and the reply did or did not become a new program. Save these and you can answer “why does this program exist?” months later, or feed the whole record of successes and failures to a training process. Long text is trimmed and anything that looks like a password is replaced before it is written.
How It Works
A finished evolutionary run is a tree of programs whose scores are known and whose causes normally are
not. Recording one of these per attempt closes that gap: the archive says a program scored 0.83, and the
provenance stream says which parent it came from, which model produced it, on which attempt, from which prompt,
with which answer, at what token cost, and how long the call took. Chained through
ParentGenomeId and ChildGenomeId, the stream reconstructs the full lineage of any
program in the archive — the post-hoc audit and reinforcement-learning data-collection story the reference
implementation gets from its per-program JSON files and its checkpoint trace extractors.
Failed attempts are recorded too, and are the more interesting half. A run whose model answered with prose nine times out of ten looks, in the archive alone, exactly like a run that was merely unlucky; in the provenance stream the difference is one query. Upstream logs “No valid diffs found” and moves on, leaving nothing to count.
Every text field is bounded and every one that can carry model or program output is redacted before it gets
here, and re-bounded on construction so a hand-built record cannot smuggle an unbounded string into a file.
PromptTruncated and ResponseTruncated mark the cut so a reader never mistakes a
clipped prompt for the whole one. An API key is never part of this record: the operator that writes it has no
access to one, and the redaction pass replaces credential-shaped text on the way in.
Constructors
| Constructor | Summary |
|---|---|
ProposalProvenanceRecord(string proposalId, long evaluationId, string parentGenomeId, int attemptNumber, ProgramProposalOutcome outcome) |
Initializes a provenance record with the identity every record must carry. |
Properties
| Property | Summary |
|---|---|
DateTimeOffset RequestedAtUtc { get; set; } |
Gets when the request was issued, in UTC. |
IReadOnlyList<string> InspirationIds { get; set; } |
Gets the canonical identities of the programs offered to the model as inspiration. |
IReadOnlyList<string> ParentIds { get; set; } |
Gets the canonical identities of the parent’s own parents; empty for a seed program. |
ProgramProposalOutcome Outcome { get; } |
Gets what happened to the request. |
bool IsAccepted { get; } |
Gets whether this attempt produced a usable child program. |
bool PromptTruncated { get; set; } |
Gets whether PromptText was cut to fit its budget. |
bool ResponseTruncated { get; set; } |
Gets whether ResponseText was cut to fit its budget. |
double LatencyMilliseconds { get; set; } |
Gets how long the call took, in milliseconds; zero when it was not measured. |
int AttemptNumber { get; } |
Gets the one-based position of this request within its proposal. |
int InputTokens { get; set; } |
Gets the prompt tokens the provider reported, or zero when it reported none. |
int Island { get; set; } |
Gets the zero-based island the proposal targeted. |
int OutputTokens { get; set; } |
Gets the answer tokens the provider reported, or zero when it reported none. |
int SchemaVersion { get; } |
Gets the schema version this record was built against. |
int TotalTokens { get; } |
Gets the sum of the reported prompt and answer tokens. |
long EvaluationId { get; } |
Gets the evaluation identifier of the parent this proposal was derived from. |
long Generation { get; set; } |
Gets the logical generation the proposal belonged to. |
string ChildGenomeId { get; set; } |
Gets the canonical identity of the program this attempt produced; empty when it produced none. |
string Detail { get; set; } |
Gets a short, sanitized reason; empty when the attempt succeeded or carried no reason. |
string ModelId { get; set; } |
Gets the identifier of the model that answered, as the chat client reported it. |
string OperatorId { get; set; } |
Gets the identifier of the variation operator that made the request. |
string OperatorVersionHash { get; set; } |
Gets the operator’s version hash, which changes when its prompt or settings change. |
string ParentGenomeId { get; } |
Gets the canonical identity of the program the model was asked to improve. |
string PromptHash { get; set; } |
Gets a hash of the exact messages sent, so identical requests are recognisable without storing them. |
string PromptTemplateKey { get; set; } |
Gets the prompt template the request was rendered from. |
string PromptText { get; set; } |
Gets the redacted, bounded rendering of the messages that were sent. |
string ProposalId { get; } |
Gets the stable identifier of the proposal this attempt belongs to. |
string ResponseText { get; set; } |
Gets the redacted, bounded text the model answered with. |
Methods
| Method | Summary |
|---|---|
string ToString() |
Returns a description that never echoes prompt text, response text, or program source. |
Fields
| Field | Summary |
|---|---|
int CurrentSchemaVersion |
The schema version stamped on every serialized record. |
int MaxDetailLength |
The longest detail text retained; a longer reason is truncated. |
int MaxIdentifierLength |
The longest identifier retained; a longer one is truncated. |
int MaxRelatedIdentifiers |
The most parent or inspiration identifiers retained; extra entries are dropped. |
int MaxTextLength |
The longest prompt or response text retained; longer text is truncated. |