Outcome
Implement the PullOptions.Init branch and its injected command-handler path without introducing a second public Pull API.
Context
The public contract is Pull(ctx, PullOptions{Init: bool}). Initialization reuses the source and initial-artifact plan from plain Pull, then adds a database lock, a fresh stable-snapshot comparison, and history recording without executing bootstrap SQL.
In scope
- Provide an internal, testable initialization orchestrator used when
PullOptions.Init is true.
- Acquire the migration lock and validate empty history plus dialect-specific quiescence.
- Re-introspect under the stable-state window and compare with the exact managed bootstrap artifact.
- Record that artifact as applied without executing its SQL.
- Return the ratified
PullResult initialization fields and stable diagnostics through the shared Pull handler.
Out of scope
- A separate exported
PullInit function or independent result contract.
- Reimplementing normal Pull introspection, rendering, or initial-artifact planning.
- Exposing final CLI registration.
Acceptance criteria
Outcome
Implement the
PullOptions.Initbranch and its injected command-handler path without introducing a second public Pull API.Context
The public contract is
Pull(ctx, PullOptions{Init: bool}). Initialization reuses the source and initial-artifact plan from plain Pull, then adds a database lock, a fresh stable-snapshot comparison, and history recording without executing bootstrap SQL.In scope
PullOptions.Initis true.PullResultinitialization fields and stable diagnostics through the shared Pull handler.Out of scope
PullInitfunction or independent result contract.Acceptance criteria
Init: truerefuses non-empty history, incompatible local artifacts, or non-quiescent state before history mutation.