Skip to content
docsv0.24.0

EditHandler

Edit a scaffolded class by exact find→replace pairs — the shape a measurement asked for. ── WHY PAIRS, AND WHY EXACTLY-ONCE ────────────────────────────────────────────────────────────── The first real session against the conformance gate (implement-first-landing.tsv, corrida 2) showed WHERE the model's priors leak: re-generating the whole file. Six landings were refused and the sixth regressed to the first one's defect — every full re-generation is a fresh chance to reintroduce everything the diagnostics had already killed. A find→replace pair that must match EXACTLY ONCE has no such surface: it touches the line it names, or it refuses. Ambiguity is refused too — applying a pair that matches twice would edit a place the request never named. Not unified diffs, deliberately: line numbers and context hunks are where models miss; exact substrings are mechanically verifiable and are the edit shape code models know best. ── ONE LANDING AUTHORITY ──────────────────────────────────────────────────────────────────────── This class produces the candidate content and DELEGATES the entire landing gate — syntax, strict types, class, namespace, static conformance, restore-on-failure — to {@see ImplementHandler}. A second gate here would be a second translation of «what may land», and two of those diverge on the case nobody tested.

EditHandler::__construct()

public function __construct(Milpa\DevTools\Support\RootResolver $roots = new RootResolver(), ?Milpa\DevTools\Operations\ImplementHandler $lander = null):

Parameters

Parameters of __construct()
NameTypeDescription
$rootsMilpa\DevTools\Support\RootResolver
$lander?Milpa\DevTools\Operations\ImplementHandler

EditHandler::handle()

public function handle(array $input): array

Apply exactly-once find→replace pairs to one scaffolded class, then land through implement's gate.

Parameters

Parameters of handle()
NameTypeDescription
$inputarray<string, mixed>