Repository navigation
Open
Labels
backlogLower priority / backlogLower priority / backlogenhancementNew feature or requestNew feature or request
Milestone
Description
Purpose
Ship replay and its lightweight test runner as an optional, first-party plugin in 0.22. Keep agent-device focused on device automation, while preserving explicit .ad workflows and agent-supervised repair for their users. Goal-based test orchestration and replay caching can remain in frameworks such as TesterArmy e2e; this extraction must not replace deterministic .ad execution with model-driven behavior.
Required behavior
- Keep
replay,test, replay export, their flags, and the relevant help/MCP/client schemas discoverable without installing executable plugin code. Label optional capabilities as plugins that require separate installation. - Keep a bundled catalog of vetted capability/package declarations. Use one declaration for help and missing-plugin recovery. The catalog describes capabilities; the runtime registry remains the authority for installed and working implementations. Do not infer an npm package from an unknown command or provider.
- When the plugin is absent, fail before device actions with a typed
plugin-not-installedreason, the exact package and installation command, and instructions to retry the original invocation with its arguments intact. For example, the error details include{ reason: "plugin-not-installed", package: "<chosen first-party package>", installCommand: "agent-device plugins add <chosen first-party package>" }. - Distinguish a missing installation from a selected package that fails loading, validation, or setup, and from a running daemon that retains an older plugin set. Preserve typed failure details and give the corresponding repair or restart instructions. Do not install packages or terminate sessions automatically.
- Preserve existing
.adsyntax, variable handling, source bundles, target identity verification, divergence reports, resume, session retention, repair transactions, timeouts, cancellation, suite results, reporters, and artifact behavior after explicit installation. Preserve all supported platform routes, including desktop platforms. - Keep sessions, device dispatch, selector/ref authority, recording authority, policy enforcement, cancellation, and cleanup with their existing core owners. Extract replay execution, suite orchestration, and format engines through explicit host contracts; do not give a plugin parallel ownership of session state.
- Specify the recording boundary: ordinary
open/close --save-scriptcapture remains usable in core; replay-specific repair requires the replay plugin. Keep shared.addata contracts independent of the executable engine. - Extend the plugin contract for replay capabilities instead of making a replay engine pretend to be a device provider. Integrate the separate replay-backend seam with managed plugin loading and lifecycle ownership. Do not retain a hidden bundled replay engine or silently fall back to a different engine.
- Choose and document the first-party package names, supported core/plugin version range, compatibility checks, and maintainer-owned validation before publication. Define where plugins must be installed when a client uses a remote or embedded daemon; local installation must not imply remote availability.
Observable completion conditions
- A clean core install lists the optional replay/test capability in help without importing its implementation.
- Missing-plugin text and JSON errors give an executable installation command and continuation instructions. CLI, MCP, and typed-client paths preserve the same failure classification.
- After installation, representative existing
.adscripts and suites work without rewriting; repair/resume and Maestro routes preserve their contracts. - Missing, broken, incompatible, and stale-daemon cases have distinct, tested recovery paths; unknown names do not produce guessed installation commands.
- Core no longer bundles replay execution, suite orchestration, or format engines. Package-closure evidence demonstrates the split without expanding startup imports or adding interaction round trips/captures.
- CI explicitly installs the required first-party plugins. Replay compatibility, provider integration, target-identity guarantees, and device lanes still exercise the extracted implementation.
- CLI help, plugin docs, migration instructions, owning ADRs, and package/layering checks describe the 0.22 boundaries. Existing scripts need installation, not a syntax migration.
Dependencies and sequencing
- Build on the TestMu help and missing-plugin guidance fix linked by its PR.
- Coordinate with Extract the Maestro engine as a plugin (0.22) #3377, which owns Maestro engine extraction and its existing backend seam. Share contracts and package loading rather than introducing competing registries or duplicating its work.
- Coordinate with refactor(provider-webdriver): ship BrowserStack as the
@agent-device/browserstackplugin #3309, refactor(provider-webdriver): ship AWS Device Farm as the@agent-device/aws-device-farmplugin #3310, and refactor(provider-limrun): ship Limrun as the@agent-device/limrunplugin #3311 for provider catalog entries and with 0.22: remove superseded plugin, client and environment APIs #3759 for removal of superseded plugin APIs in 0.22. - Read ADR 0012 for replay identity, divergence, resume, and repair, ADR 0015 for Maestro behavior/performance, ADR 0016/0017 for recording, and ADR 0034 for plugin lifecycle and failure isolation.
Metadata
Metadata
Assignees
Labels
backlogLower priority / backlogLower priority / backlogenhancementNew feature or requestNew feature or request
Activity
thymikee commentedon Nov 14, 2026
Pending native replay registry amendment — maintainer decision required
This proposal is moved here from PR #4535 to follow the repository ADR rule: proposals stay in the umbrella issue until accepted. ADR0034 remains an accepted record of its existing decisions; this comment does not accept or supersede them. The source deletion from that ADR is queued with the coordinated stack update and is not published yet.
Proposed 0.22 amendment: native execution on the replay backend
This amendment is proposed for #3871 and awaits maintainer acceptance.
The existing accepted provider contract and lifecycle rules retain their status.
The draft API adds native execution to
kind: 'replay-backend'with backendad.It does not add a plugin kind or a provider identity.
NATIVE_REPLAY_BACKENDdeclares this identity in the shared execution contract.ReplayEnginePlugin<'ad'>returns{ execution: { create() }, dispose? }from setup.Other backend ids return
{ replayBackend: { create(host) }, dispose? }.The setup validator checks this correspondence before inventory can report an active plugin.
A mismatch records
invalid_pluginand disposes rejected setup.The first backend claim remains claimed after failure.
Contracts own the inspection, step, suite and factory types.
Native
create()receives no format-backend host.runAdReplayreceives dispatch and progress ports throughAdReplayStepRuntime; it has no cancellation port.runReplayTestSuitereceives progress and cancellation dependencies, with replay dispatch supplied through itsrunReplaydependency.A format factory still receives
ReplayBackendHostfor source collection, execution and export.Both factories use the registry's claims, inventory, lazy creation, failure isolation and disposal.
Core retains session, selector, recording, repair and cleanup authority.
A separate native plugin kind would duplicate lifecycle and identity decisions.
A provider implementation would give an execution engine device ownership it does not need.
Both alternatives are rejected by this proposal.
The consequence is one backend identity with two backend-specific factory shapes.
The package factory and its routing consumer must land together so core does not retain a second engine delivery.
The execution-port wording above is corrected against the actual
ReplayExecution,AdReplayStepRuntime, andReplayTestRuntimeDependenciescontracts at 3e5030d. Native replay does not take a cancellation port; core dispatch retains that authority, and suite cancellation is supplied explicitly to suite execution.Publication/integration remains blocked on maintainer acceptance of this native extension and the separately recorded live, package and validation conditions. Both executable plugin packages remain private until the npm placeholder/trusted-publisher prerequisites are verified. No new runtime contract is being introduced by this documentation move.