Skip to content

cdp_repair_action

Self-repair an L3 reusable action whose Maestro replay failed with SELECTOR_NOT_FOUND. Loads the action from .rn-agent/actions/<actionId>.yaml, snapshots the live device, fuzzy-matches the failed testID against current testIDs (Levenshtein-based), and patches the YAML in place. Guardrails: refuses if a human edited the YAML since the agent last wrote (mtime check), refuses if the rolling-24h repair budget is exhausted (3 attempts/24h). On success, bumps revision, demotes status to “experimental” until the next clean replay re-validates, and appends a RepairRecord to the sidecar. Pass dryRun=true to preview the diff without writing.

NameTypeRequiredDefaultConstraintsDescription
actionIdunknownYesAction id matching <projectRoot>/.rn-agent/actions/<actionId>.yaml.
failedSelectorunknownYes
projectRootstringNoOverride project root (default: process.cwd()).
thresholdunknownNomin: 0, max: 1
dryRununknownNo
agentReasoningunknownNo
cdp_repair_action(actionId: <unknown>, failedSelector: <unknown>)