Skip to content

cdp_record_test_save_as_action

Promote the in-memory recording (started via cdp_record_test_start) into a first-class L3 reusable action. Writes Maestro YAML with full M7 metadata header (id, intent, tags, mutates, status, produces) to <project>/.rn-agent/actions/<id>.yaml and initialises the sidecar runtime state. Status defaults to “experimental” — first clean /run-action replay auto-promotes to “active”. Refuses if the id already exists unless overwrite=true. Distinct from cdp_record_test_save (which writes JSON to .rn-agent/recordings/) — that is for raw event archival; this is for shipping the recording as a replayable action. The optional produces field (D1209) records state postconditions — what state the action establishes when it runs cleanly — so downstream tasks can use it as a deterministic prologue.

NameTypeRequiredDefaultConstraintsDescription
idstringYesStable slug; becomes the filename and the M7 id field. Lower-case kebab-case (a-z, 0-9, hyphen).
intentstringYesOne-line goal — surfaced verbatim by /list-learned-actions. Required.
tagsarrayNoLower-case kebab-case keywords for filtering (e.g. [“tasks”, “create”, “regression”]).
mutatesbooleanNoDoes this flow leave persistent residue (created rows, toggled settings)? Required for /run-action safety pre-flight to know whether to confirm before replay.
status`enum: experimentalactivedeprecated`No
bundleIdstringNoApp bundle ID for the Maestro appId header. Strongly recommended — /run-action uses it to refuse cross-app replays.
projectRootstringNoOverride project root (default: process.cwd()).
overwritebooleanNoIf an action with this id already exists, replace it. Default false (refuse with hint).
testNamestringNoOptional one-line description shown as a comment above the M7 header. Falls back to intent.
producesRecord<string, unknown>NoD1209 — state postconditions this action establishes when it runs cleanly. Flat map of primitive values for hybrid composition (e.g. { authenticated: true, route: “home” }). Optional. Values containing commas or newlines are not supported; use multiple keys instead.
cdp_record_test_save_as_action(id: <string>, intent: <string>)