pub fn run(
pack_root: &Path,
opts: &SyncOptions,
cancel: &CancellationToken,
) -> Result<SyncReport, SyncError>Expand description
Run a full sync over the pack tree rooted at pack_root.
Resolution rules:
- If
pack_rootis a directory the walker looks for<pack_root>/.grex/pack.yaml. - If
pack_rootends in.yaml/.ymlit is loaded verbatim. - Workspace defaults to the pack root directory itself when
opts.workspaceisNone. Children resolve as flat siblings of the parent pack root (since v1.1.0).
§Errors
Returns the first error that halts the pipeline — see SyncError for
the taxonomy.
cancel is the cooperative cancellation handle threaded through the
pipeline by feat-m7-1 stage 2. Stage 2 only wires the parameter; the
is_cancelled() polls land in stages 3-4 (scheduler + pack-lock
acquire). CLI callers pass a never-cancelled sentinel
(CancellationToken::new()); the MCP server passes a token tied to
the request lifetime.