pub async fn execute_apply(
args: &ApplyArgs,
config_service: &dyn ConfigService,
) -> Result<()>Expand description
Handle the cache apply subcommand.
Loads the cached dry-run results and replays the file operations without
calling the AI provider. Validates the file snapshot and target paths
before proceeding, prompts for confirmation unless --yes is supplied,
and aborts on non-TTY stdin without --yes.
§JSON output
In JSON mode (--output json):
- All informational
println!chatter on stdout is suppressed so the final envelope is the only document on the stream. - The interactive confirmation prompt is skipped: callers SHALL pass
--yes, otherwise an error envelope is emitted (prompting on stdout would corrupt the JSON document). - Each cache operation is applied individually so the per-file
isolation contract from the
machine-readable-outputspec can be honored: failures are recorded asitems[i].status = "error"with anCacheItemErrorpopulated fromSubXError::category/SubXError::machine_code/SubXError::user_friendly_message.
§Arguments
args- Parsedcache applyarguments controlling validation bypass, confirmation, and confidence filtering.config_service- Active configuration service for rebuilding theMatchConfigneeded by the engine replay path.