Plans are easy.
Reality moving underneath them is not.
One distributed application rollout. Five moments. The exact scenario is backed by the runnable
Forge.ServiceProvisioning.Sample and its tests.
The request looks simple until you make the transition explicit.
The application already has an database, API and legacy worker. The new desired state keeps the database, updates the API, removes the legacy worker and introduces a policy engine plus telemetry.
ServiceComponentSync.Plan(current, desired)
Forge turns the gap into a typed plan.
Instead of one opaque “update service” instruction, the transition becomes inspectable. The api update also carries its generated Delta, so the reason for the update remains available.
The plan still is not execution.
The sample's RolloutPlanBuilder is application code. It translates structural
Forge results into the operation model this fictional distributed application understands.
Knowing the operations is not enough. Order can be part of correctness.
The policy-engine depends on the api operation. Telemetry depends on the policy-engine. Forge calculates deterministic execution waves without performing any operation.
Turn it into data before execution.
SyncManifest creates a versioned portable description. ManifestDigest
gives that exact plan a canonical SHA-256 identity for approval, storage or delayed execution.
sha256: …
The dangerous assumption is that the world still looks like it did during planning.
Before the stored plan executes, another process applies an emergency api change. The old plan is structurally valid—but it is no longer valid against current reality.
Reject the stale plan.
ManifestPreconditions.Validate(...) reports api as changed since planning.
Forge does not make an old plan safe by optimism. It gives the application evidence that the assumptions behind the plan no longer hold.
Replanning gets harder once work has crossed the execution boundary.
Now imagine the first plan already started. A second desired state arrives. Simply discarding the old plan would lie about reality, because completed and running work still exists.
ExecutedReplanner.Replan(...)Completed equivalent work remains part of reality.
The running operation's semantics changed. Application policy must decide what happens next.
Waiting operation can be cancelled before it starts.
Pending removal can be cancelled because the item is desired again.
A newly required operation enters the next plan.
Make the transition explicit before side effects make it irreversible.
Delta explains the semantic change. Sync reconciles desired state. Dependencies make order explicit. Manifests preserve plan identity. Preconditions catch drift. Execution-aware replanning respects work already in motion.
The story is executable.
The repository sample and dedicated test project assert the structural plan, dependency waves, manifest round-trip, stale-state rejection and execution-aware replan outcomes.