EvolveBlockExtractionResult

Models & Types · AiDotNet.Evolution.Programs

The outcome of scanning a program source for evolve-block markers.

For Beginners

This is the report you get back after looking for the editable region of a file. It tells you how many editable regions were found, hands you each one ready to rewrite, and explains anything that looked wrong. Check Status first: if it is Complete you can use Regions with confidence, and anything else means the file’s markers were damaged and you should probably ask for the code again rather than guess.

How It Works

The reference OpenEvolve parser returns only the list of well-formed blocks: a start marker with no matching end, a second start marker inside an open block, and a stray end marker are all discarded in silence, so a file that lost a marker looks exactly like a file that never had one. This result keeps the recovered Regions and additionally reports a Status naming the most severe anomaly plus one bounded human-readable Diagnostics entry per anomaly, so a caller can distinguish “this file has no evolve block” from “the model deleted my end marker” and respond differently.

When several anomalies occur the reported Status is the most severe one, ordered Unterminated, RestartedBlock, UnmatchedEnd, then Complete or NotPresent. Diagnostics are capped at 32 entries so a pathological response cannot bloat a checkpoint or a log.

Properties

Property Summary
EvolveBlockStatus Status { get; } Gets the most severe outcome observed while scanning the source.
IReadOnlyList<EvolveBlockRegion> Regions { get; } Gets the well-formed blocks, in the order their start markers appear.
IReadOnlyList<string> Diagnostics { get; } Gets bounded human-readable notes describing every anomaly that was found.
bool HasRegions { get; } Gets whether at least one well-formed block was recovered.
bool IsWellFormed { get; } Gets whether the source was free of marker anomalies.

Methods

Method Summary
bool TryGetPrimaryRegion(EvolveBlockRegion region) Gets the first well-formed block, which is the one a single-region rewrite targets.

Fields

Field Summary
int MaxDiagnostics The maximum number of diagnostics retained by one extraction.