Skip to main content

Module force_resync

Module force_resync 

Source
Expand description

Agent-safe force-resync for stale path-dependency roots (bd-session-history-remediation-ocv9i.8.3).

When stale dependency roots block verification, an agent needs ONE supported command that invalidates the worker-side cache for those roots, resyncs the closure, and explains what changed — without ever deleting worker data outside an RCH-managed root. This module plans that invalidation (plan_force_resync) with a hard safety guard (every target must live strictly under the RCH-managed base, and the base itself can never be the target), and reports the outcome (apply_force_resync) — deferring safely, with no destructive action, when the worker is unreachable.

Structs§

ForceResyncPlan
A safety-checked force-resync plan.
ForceResyncReport
The agent-facing report of a force-resync.
InvalidationAction
A planned, safety-checked cache invalidation.
RefusedInvalidation
A refused invalidation (its target would escape the RCH-managed root).
StaleRoot
A stale root to force-resync: its local project root and the worker-side RCH-managed cache path that should be invalidated.

Enums§

ResyncOutcome
Outcome of applying a force-resync plan.

Functions§

apply_force_resync
Apply a plan, gated on worker reachability. When the worker is unreachable the resync is deferred and NO invalidation is reported (no destructive action is taken). The actual rm + resync transfer is performed by the caller using report.invalidated; this models the safe decision + report.
is_safe_invalidation_target
Whether target is a safe invalidation target under managed_base: it must be strictly inside the base (never the base itself, never an ancestor, never an escaping .. path).
plan_force_resync
Plan the force-resync: each stale root whose worker cache path is safely under managed_base becomes an invalidation; any other is refused (never invalidated) so no worker data outside the managed root is ever touched.