Motivation
blazerules' hot-reload contract: it compiles and validates the new YAML/lookups off the hot path, then swaps atomically only on success; a failed reload keeps the previous ruleset active and batches keep the ruleset observed at batch start.
aeb's --watch mode is the direct analogue. Today a change fires the affected-target walk and a narrowed rebuild. The gap: if an edited .build.ae fails to compile, the watch loop shouldn't leave the developer with a torn-down or half-built state — it should report the compile error and keep the last-good DAG/artifacts intact, so the editor round-trip is "fix the typo, save again, recover" rather than "now nothing builds."
Proposal
Give --watch a validate-then-swap contract:
- On a change event, run the scan +
transform-ae/compile of the affected .build.ae files before touching any live build state.
- If scan/compile fails: print the error, keep the previously-good DAG and
target/ artifacts, stay watching. Do not partially apply.
- If it succeeds: proceed with the narrowed rebuild as today (atomic swap of the DAG state).
- An in-flight rebuild triggered by an earlier event completes (or is cleanly superseded) before a newer event's rebuild starts — last-good is always coherent.
Acceptance criteria
Not being asked
Not asking for multi-version ruleset history or rollback-to-arbitrary-generation. Just last-good-survives-a-bad-edit, the blazerules "failed reload keeps previous active" guarantee.
Motivation
blazerules' hot-reload contract: it compiles and validates the new YAML/lookups off the hot path, then swaps atomically only on success; a failed reload keeps the previous ruleset active and batches keep the ruleset observed at batch start.
aeb's
--watchmode is the direct analogue. Today a change fires the affected-target walk and a narrowed rebuild. The gap: if an edited.build.aefails to compile, the watch loop shouldn't leave the developer with a torn-down or half-built state — it should report the compile error and keep the last-good DAG/artifacts intact, so the editor round-trip is "fix the typo, save again, recover" rather than "now nothing builds."Proposal
Give
--watcha validate-then-swap contract:transform-ae/compile of the affected.build.aefiles before touching any live build state.target/artifacts, stay watching. Do not partially apply.Acceptance criteria
.build.aeprints the compile error and leaves the last successfultarget/artifacts in place (verifiable: the prior binary still runs).aebre-invocation.--watchsection.Not being asked
Not asking for multi-version ruleset history or rollback-to-arbitrary-generation. Just last-good-survives-a-bad-edit, the blazerules "failed reload keeps previous active" guarantee.