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.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
id | string | Yes | Stable slug; becomes the filename and the M7 id field. Lower-case kebab-case (a-z, 0-9, hyphen). | ||
intent | string | Yes | One-line goal — surfaced verbatim by /list-learned-actions. Required. | ||
tags | array | No | Lower-case kebab-case keywords for filtering (e.g. [“tasks”, “create”, “regression”]). | ||
mutates | boolean | No | Does 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: experimental | active | deprecated` | No | |
bundleId | string | No | App bundle ID for the Maestro appId header. Strongly recommended — /run-action uses it to refuse cross-app replays. | ||
projectRoot | string | No | Override project root (default: process.cwd()). | ||
overwrite | boolean | No | If an action with this id already exists, replace it. Default false (refuse with hint). | ||
testName | string | No | Optional one-line description shown as a comment above the M7 header. Falls back to intent. | ||
produces | Record<string, unknown> | No | D1209 — 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>)