Expand description
Sync orchestrator — M3 Stage B slice 6.
Glues the building blocks shipped in slices 1–5b into a single runnable pipeline:
- Walk a pack tree via
crate::tree::sync_meta+crate::tree::build_graph+FsPackLoader+ aGitBackend. - Run plan-phase validators (manifest-level + graph-level).
- Execute every action via a pluggable
ActionExecutor(PlanExecutorfor dry-run,FsExecutorfor wet-run). - Record each step as an
Event::Syncentry in the pack-root’s.grex/events.jsonlevent log.
§Traversal order
Nodes are executed in depth-first post-order: children fully install
before their parent. Rationale: parent packs commonly require: artifacts
created by children (e.g. a parent symlink whose src lives inside a
child). Running the root last matches the overlay-style dotfile-install
intent authors expect, and it matches how walker.walk is structured
(children are hydrated before the recursion returns).
§Decoupling
The CLI crate drives this module through a thin run() entry point;
SyncOptions is #[non_exhaustive] so new knobs (parallelism, filter
expressions, ref overrides) can land in later milestones without breaking
CLI callers. Errors aggregate into SyncError with a small, stable
variant set.
Structs§
- Dangling
Start - One
ActionStartedevent in the manifest log that has no matchingActionCompletedorActionHaltedpeer. - Halted
Context - Rich context attached to a
SyncError::Haltedvariant. - Recovery
Report - Summary of teardown artifacts found under a pack root before a sync begins.
- Sync
Options - Inputs to
run. - Sync
Report - Outcome of a
runinvocation. - Sync
Step - One executed (or planned) action step in a sync run.
- Workspace
Migration - One legacy-layout migration attempt.
outcomedistinguishes the move-succeeded case from the don’t-clobber-user-data case so CLI renderers can present different advice to the operator.
Enums§
- Migration
Outcome - Outcome of one legacy-layout migration attempt.
- Sync
Error - Error taxonomy surfaced by
run.
Functions§
- pack_
display_ name - Re-export a cheap helper so CLI renderers can label halted steps by node name without reaching into the graph twice.
- run
- Run a full sync over the pack tree rooted at
pack_root. - scan_
recovery - Walk
workspaceand the manifest log to find crash-recovery artifacts. - teardown
- Run a full teardown over the pack tree rooted at
pack_root.