IProgramArtifactStore
Interfaces · AiDotNet.Interfaces
Stores and retrieves the evidence an evaluation produced, keyed by the genome that produced it.
Known implementations: FileSystemProgramArtifactStore
For Beginners
This is a filing cabinet for whatever your candidate programs printed or wrote while
being scored. File it with StoreAsync under the program’s identifier, look it up later with
GetAsync, see what is on file without reading it with ListAsync, and throw out old
paperwork with PurgeAsync. Without it, everything a program printed is lost the moment the run
ends, which is exactly when you want to read it.
How It Works
Artifacts are the difference between “this program scored 0.2” and “this program scored 0.2 and here is the
exception it threw”. The reference OpenEvolve database keeps them beside the program record and splits them by
size (openevolve/database.py``store_artifacts): content at or below
artifact_size_threshold is serialized into the record, and anything larger is written to a per-program
directory. This interface is the same contract expressed as a store a task or an observer owns, so artifacts do
not have to travel through the evolution engine’s own state to be durable.
Implementations must be safe for concurrent use, must never execute or interpret artifact content, and must
bound what they accept, because artifact content is produced by code a model wrote. Retrieval is by genome
identifier, which is the canonical hash of the program’s normalized source, so a checkpointed run can go back to
the evidence for any candidate it recorded. PurgeAsync is the retention hook: a long run
accumulates artifacts indefinitely otherwise.
Methods
| Method | Summary |
|---|---|
Task<IReadOnlyList<ProgramArtifact>> GetAsync(string genomeId, CancellationToken cancellationToken) |
Retrieves every artifact stored for one genome. |
Task<IReadOnlyList<ProgramArtifactDescriptor>> ListAsync(string genomeId, CancellationToken cancellationToken) |
Lists what is stored for one genome without reading the content. |
Task<IReadOnlyList<ProgramArtifactDescriptor>> StoreAsync(string genomeId, IEnumerable<ProgramArtifact> artifacts, CancellationToken cancellationToken) |
Stores artifacts for one genome, merging with anything already stored under the same names. |
Task<ProgramArtifact> GetAsync(string genomeId, string name, CancellationToken cancellationToken) |
Retrieves one named artifact for one genome. |
Task<bool> RemoveAsync(string genomeId, CancellationToken cancellationToken) |
Removes every artifact stored for one genome. |
Task<int> PurgeAsync(DateTimeOffset utcNow, CancellationToken cancellationToken) |
Applies the retention policy, removing artifacts that are too old or beyond the retained count. |