Documentation
¶
Overview ¶
Mirror reconciliation (sty_e6e467fe).
The mirror is push-fed: a mutating verb flushes change events plus one snapshot before its store closes, fail-silent and under a bounded budget. A push that does not land — the service was restarting, down, or unreachable — was previously lost forever, because nothing ever re-requested state. A story that reached done through a release restart therefore left the UI showing the pre-restart frame indefinitely, which reads as a stuck story rather than a stale view.
CHOSEN SHAPE: reconcile on the SERVE side. The serving tier re-requests a full snapshot for every partition it renders — once at startup, then every mirror.DefaultReconcileInterval. This repairs EVERY dropped push, including ones the CLI never knew failed (a killed CLI, a network blip, a service that was simply down), and adds nothing to the mutating-verb path.
REJECTED: reconcile on the CLI side (retry, or drain before the restart converges). It repairs only pushes the CLI survived to notice, and it puts retry latency into every mutating verb — exactly what the fail-silent bounded budget exists to prevent.
The re-request EXECS THE CLI (`satelle workspace add`) rather than reading a repo database directly: the serve binary is forbidden from linking internal/cli, internal/app and internal/store (cmd/satelle-serve/deps_test.go), and internal/cli imports this package, so exec is the mechanism, not a preference. The CLI stays the sole reader of a per-repo database and the mirror stays a read-only view.
Package serve runs the push-fed mirror UI HTTP server (sty_80233c10). Shared by the dedicated satelle-serve binary and the deprecated `satelle serve` CLI alias so behaviour cannot drift.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Addr string // host, e.g. 127.0.0.1 or 0.0.0.0
Port int // 0 → global service config → DefaultWebPort
}
Options configures the mirror HTTP server.
type Reconciler ¶ added in v0.0.368
type Reconciler struct {
// Interval between passes; zero means mirror.DefaultReconcileInterval.
Interval time.Duration
// Timeout bounds a single re-seed; zero means reconcileTimeout.
Timeout time.Duration
// Targets lists the repo paths to re-request, newest resolution each pass so
// a partition added while serving is picked up without a restart.
Targets func(ctx context.Context) []string
// Reseed re-requests one repo's snapshot; nil means reseedViaCLI.
Reseed func(ctx context.Context, repoPath string) error
// Log receives a line when a repo STARTS failing, when its reason CHANGES,
// and when it recovers — never once per pass per failing repo (sty_a2162ee3).
// nil discards.
Log func(format string, args ...any)
// contains filtered or unexported fields
}
Reconciler re-requests a snapshot for each mirrored partition on an interval. Every collaborator is injectable so tests drive it without a real binary.
func (*Reconciler) Loop ¶ added in v0.0.368
func (r *Reconciler) Loop(ctx context.Context)
Loop reconciles once immediately — the pass that repairs a push dropped by the restart that just happened — then every interval until ctx ends. A failing repo is logged and never stops the loop.