Native E2E Harness
Wardian uses a native Tauri/WebDriver harness for tests that must exercise real IPC, PTY behavior, provider spawning, or terminal rendering. Browser-only Playwright tests are not sufficient evidence for those areas.
Setup
Use Node.js 24 LTS for the native suite. Canonical state evidence checks use the built-in node:sqlite module, which is unavailable in Node.js 20. The nightly workflow verifies SQLite support before building the app.
Run the cross-platform setup command:
npm run setup:e2e:nativeThe setup script:
- verifies
cargois available - installs
tauri-driverwhen missing - checks for a native WebDriver
- on Windows, can download a matching
msedgedriver.exeintotools/e2e-native/ - on macOS/Linux, prints the WebDriver package or
WARDIAN_NATIVE_WEBDRIVERguidance when automatic setup is not reliable
Windows downloads use Node.js and extract with the system tar.exe under SystemRoot/System32. Setup does not load PowerShell archive modules, so an inherited PSModulePath cannot select an incompatible ZIP implementation.
e2e-native/tests/claude-mod-delivery-native.test.mjs is an opt-in real-Claude acceptance probe (WARDIAN_E2E_REAL_CLAUDE_MOD=1). It requires a prebuilt app with terminal-trace, a frontend built with VITE_WARDIAN_TERMINAL_DEBUG=1, and an explicitly selected catalogue model in WARDIAN_E2E_CLAUDE_MOD_MODEL. The probe retains its provider version, inbox records, terminal trace and result report in separate isolated homes. It verifies an editable draft survives a correlated peer delivery without delivery keystrokes, then verifies the hooks-disabled terminal fallback and its recorded reason. A skipped probe is not native acceptance evidence. Set WARDIAN_E2E_CLAUDE_MOD_COMPOSER=1 with the same prerequisites to run only the single-prompt composer case. It verifies the claimed interaction in the provider transcript, the visible prompt and answer, and zero terminal writes during the send.
The legacy command is kept as an alias:
npm run setup:e2e:native:windowsGenerated driver artifacts belong under tools/e2e-native/ and are ignored by git.
Native artifact selection is fail-closed. Cargo metadata supplies the effective target directory, including CARGO_TARGET_DIR and Cargo config overrides; a stale repository-local target/ binary is not selected. Set WARDIAN_NATIVE_APP=<artifact-path> only when using a deliberate custom app artifact. Relative values are resolved from the repository root, and a missing, empty, or directory override stops before WebDriver/provider startup. The setup script also verifies package-local @tauri-apps/cli and selenium-webdriver resolution before driver setup.
POSIX shell:
WARDIAN_NATIVE_APP=<artifact-path> npm run test:e2e:native:fast -- <native-test-file>PowerShell:
$env:WARDIAN_NATIVE_APP = '<artifact-path>'
npm run test:e2e:native:fast -- <native-test-file>For a prebuilt app and its matching CLI, also set WARDIAN_NATIVE_CLI and WARDIAN_NATIVE_SKIP_BUILD=1. The CLI must have the platform executable name (wardian-cli.exe on Windows, wardian-cli on POSIX) and match the CLI in the app's packaged resources. Invalid pairs stop before Cargo metadata, isolated home preparation, or driver startup. App-backed runs without this override freeze the CLI packaged with the app, then validate the copied pair before launch. A later Cargo debug build cannot replace an app's staged release CLI. All maintained CLI setup callers check paired and skip-build inputs before Cargo entry. They revalidate the already-frozen CLI against the app's packaged bytes; missing or mismatched inputs fail without a compiler fallback. Missing, nonregular, or conflicting packaged CLIs fail before copying the run's binaries. Equivalent direct and nested copies retain the app loader's direct path precedence. CLI-only runs and explicit post-build CLI freezing retain Cargo's effective target selection, including its preference for a debug CLI.
POSIX shell:
WARDIAN_NATIVE_SKIP_BUILD=1 \
WARDIAN_NATIVE_APP='<absolute-app-path>' \
WARDIAN_NATIVE_CLI='<absolute-paired-cli-path>' \
npm run test:e2e:native:fast -- <native-test-file>PowerShell:
$env:WARDIAN_NATIVE_SKIP_BUILD = '1'
$env:WARDIAN_NATIVE_APP = '<absolute-app-path>'
$env:WARDIAN_NATIVE_CLI = '<absolute-paired-cli-path>'
npm run test:e2e:native:fast -- <native-test-file>Pair validation follows the app's maintained resource loader: Windows uses the executable directory; macOS bundles use Contents/Resources; Linux bundles carry usr/lib/Wardian alongside usr/bin. Ordinary Cargo target/<profile> and target/<triple>/<profile> outputs with .cargo-lock use the executable directory. Within the resource root, the installed CLI is selected from bin/ first, then resources/bin/. Isolated POSIX pairs must carry their own resources rather than use a separate system installation. The run freezes the app's runtime and the CLI file, then checks the copied pair. Libraries or resources adjacent to the separate CLI are not imported. Windows pairs also retain the declared agent_prompts/ and _up_/scripts/ folders at their original relative paths. Repeated freezes preserve existing resource files and copy missing leaves; unrelated compiler outputs stay outside the frozen runtime.
e2e-native/tests/artifact-presentation-native.test.mjs proves the artifact control path with real IPC: an isolated mock agent presents an authorized Markdown file through the built CLI, Wardian routes a non-focused Files tab, the renderer opens the canonical file, and the same artifact restores after a native app relaunch.
Running
Run the native mock-provider suite:
npm run test:e2e:nativeOn Windows, the harness launches the installed Tauri CLI through Node for builds. This preserves the inline build configuration when a test is launched directly with Node, without npm's environment variables. The test runner also passes test paths directly to Node, including paths containing spaces.
For rapid iteration after you already have a current native build, reuse the existing binary instead of rebuilding on every run:
npm run test:e2e:native:fastUse the fast command only after rebuilding the native binary for Rust or bundled-asset changes:
npm run tauri -- build --debug --no-bundleYou can also target a specific file:
npm run test:e2e:native:fast -- e2e-native/tests/opencode-native.test.mjsRemote client TLS fixture
remote-client-tls-fixture.test.mjs is in the CI tier. It checks the scoped TLS fixture, absolute readiness deadline, owned acceptance lifecycle, raw mock transcript oracle, independent Node-client barrier, and socket cleanup without starting the app or a provider. remote-client-conformance.test.mjs is in the nightly tier because it starts the native app and mock provider, then launches Chromium profiles for the unpinned and SPKI-pinned checks. The nightly workflow installs Playwright Chromium after npm ci.
Run the scoped TLS fixture checks without starting Wardian or a provider:
POSIX shell:
node --test e2e-native/tests/remote-client-tls-fixture.test.mjsPowerShell:
node --test e2e-native/tests/remote-client-tls-fixture.test.mjsThe fixture rejects WebSocket upgrades by default. Its opt-in forwarding covers only the existing PWA status and terminal stream paths, preserves the upstream handshake error, and drains pending sockets when closed. A controlled transport test server also returns a standards-valid WebSocket 101 so the fixture's tunnel can be checked with opaque bytes and both upgrade head buffers. This proves fixture transport only; it does not prove gateway authentication or real PWA WebSocket acceptance. The fixture uses an in-memory certificate trusted explicitly by Node clients; it does not change the system trust store. Its ready record freezes the HTTPS origin, leaf certificate SHA-256, and base64 SHA-256 of the leaf SPKI for the lifetime of that fixture.
The paired-client browser conformance test uses a fresh, explicitly owned Chromium user-data directory. An unpinned browser must reject the fixture certificate. The pinned browser receives only --ignore-certificate-errors-spki-list=<base64-sha256-spki> for that generated leaf. Chromium applies this test-only exception before hostname validation, so the browser run does not prove hostname verification. Independent Node requests trust the exact fixture certificate with ca: certificatePem and rejectUnauthorized: true; negative controls require rejection for a wrong TLS hostname and an unrelated bundled root. No global trust or generic ignoreHTTPSErrors setting is used.
Run the paired-client browser and native-gateway conformance test with a prebuilt app and its matching CLI:
Install Playwright Chromium before running the browser conformance test:
POSIX shell:
npx playwright install chromiumPowerShell:
npx playwright install chromiumPOSIX shell:
WARDIAN_NATIVE_SKIP_BUILD=1 \
WARDIAN_NATIVE_APP='<absolute-app-path>' \
WARDIAN_NATIVE_CLI='<absolute-paired-cli-path>' \
npm run test:e2e:native:fast -- e2e-native/tests/remote-client-conformance.test.mjsPowerShell:
$env:WARDIAN_NATIVE_SKIP_BUILD = '1'
$env:WARDIAN_NATIVE_APP = '<absolute-app-path>'
$env:WARDIAN_NATIVE_CLI = '<absolute-paired-cli-path>'
npm run test:e2e:native:fast -- e2e-native/tests/remote-client-conformance.test.mjsSet WARDIAN_NATIVE_WEBDRIVER to a compatible WebDriver binary when automatic driver discovery is unavailable. The conformance test owns its HUD origin and passes that exact value to createNativeAcceptanceFixture({ hudOrigin, sourceCommit, sourceDeltaDigest }). The factory writes that origin into the isolated gateway allowlist, starts and owns the native session and TLS boundary, and exposes a bounded context with the gateway and certificate pins. Its session-bound controls create an offer, approve only a matching request freshly read from that native session, revoke the fixture's approved device, release the external hold, and close owned resources. Approval checks the exact gateway and HUD origins, paired-client credential kind and audience, submitted public-key fingerprint, and requested grants before invoking native approval. The conformance test opts into a separate test-support handle for mock-agent setup, same-home restart, and redacted response-header observations; external HUD consumers receive only the bounded context and session-bound controls.
The browser generates a non-extractable P-256 private CryptoKey, exports only its public SPKI, submits the offer, signs the gateway challenge, and exchanges the signature for a client token. The factory and sanitized remote_client_acceptance_ready record do not expose the browser key, bearer, or native driver handle. Readiness is emitted only after gateway health, an authorized roster, and the 80-event Chat response are verified. The release control settles the bounded hold; closing aborts and joins active pairing and hold work before closing owned resources. createRemoteClientAcceptanceFixture remains the lower-level lifecycle primitive; its Node pairClient helper is a unit-test baseline and is not the browser acceptance path.
POSIX shell:
export WARDIAN_NATIVE_WEBDRIVER='<absolute-webdriver-path>'PowerShell:
$env:WARDIAN_NATIVE_WEBDRIVER = '<absolute-webdriver-path>'This conformance route remains independent of the app's OS trust store and is test-only evidence. Do not use its Chromium SPKI exception as a production certificate policy. The paired-client run uses the mock provider to create a multi-page Chat transcript, then checks recent and opaque older pages, lazy detail chunks, and source-row renewal through the HTTPS client boundary. It also exercises explicit chat:send approval, durable namespace reuse after reauthentication, same-key operation status and duplicate admission, conflict responses for changed target/body/mode, and request-size limits. The app-free TLS fixture separately starts two independent Node client processes behind a shared barrier. The send conformance check starts two independent browser workers behind a shared GO barrier, then crosses the production native gateway and isolated state.db into an interactive mock provider. It verifies exactly one user input and assistant echo in the raw mock-transcript.jsonl, snapshots the bytes before a same-home backend restart, then reauthenticates the same device and verifies the same idempotency key adds no provider transcript event. The Chat readiness loop has one 120-second monotonic deadline covering requests and sleeps. These checks do not establish behavior for a real provider.
The current fixture does not simulate a process crash between provider input and durable outcome publication. A future debug-only fault hook should pause after the PTY submit-key write, flush, and completion acknowledgement at src-tauri/src/manager/spawn.rs, and after delivery_transaction.rs returns submit_key_sent / submitted_unconfirmed, but before src-tauri/src/delivery/live_surface.rs durably publishes the accepted outcome. The supervisor would terminate only the frozen, birth-identified app process for the explicit mock HOME, session, and intent while the original 30-second intent deadline remains active. Recovery evidence must show the dispatching intent becoming submitted_unconfirmed and eligible for reconciliation only; it must not replay provider input. A normal harness close does not exercise this crash boundary. No hook or crash injection is part of the current fixture.
Replacement roster contention
The focused replacement roster admission test holds the real core roster barrier while clear_agent_session prepares its replacement runtime. It uses the native app shell and Tauri IPC directly, with no workbench presentation assertions. It checks that exactly one replacement candidate starts, no replacement journal appears before admission, list_agents remains usable, and the candidate commits with a new provider session after the holder releases the barrier.
Build the standalone holder utility through the Rust cache launcher. Use the compiler-artifact JSON record whose target name is replacement_roster_barrier_holder; pass its executable value to the native runner. Both full and fast native runs require this prebuilt helper and fail when its path is missing or invalid. The fast runner also skips the app build. The utility does nothing unless it receives the explicit --hold argument; standard Cargo test arguments leave it inactive. Native execution passes only --hold after validating the exact prebuilt executable path.
npm run rust:cache -- cargo test -p wardian-core --test replacement_roster_barrier_holder --no-run --message-format=json
WARDIAN_NATIVE_ROSTER_BARRIER_HOLDER='<compiler-artifact executable>' WARDIAN_NATIVE_SKIP_BUILD=1 npm run test:e2e:native:fast -- e2e-native/tests/replacement-roster-admission-native.test.mjsPowerShell:
npm run rust:cache -- cargo test -p wardian-core --test replacement_roster_barrier_holder --no-run --message-format=json
$env:WARDIAN_NATIVE_ROSTER_BARRIER_HOLDER = '<compiler-artifact executable>'
$env:WARDIAN_NATIVE_SKIP_BUILD = '1'
npm run test:e2e:native:fast -- e2e-native/tests/replacement-roster-admission-native.test.mjsThe holder requires WARDIAN_HOME, WARDIAN_E2E_NATIVE_HOME, and its explicit WARDIAN_NATIVE_ROSTER_BARRIER_HOME to resolve to the same harness-owned home. It checks the native harness owner record and run ID, then waits for a matching nonce release from the test or EOF. The native harness sends the exact release and joins the holder before continuing. Do not point it at a normal user home.
HTTP fixture cleanup
Browser fixtures use closeHttpFixture from e2e-native/lib/httpFixture.mjs to stop their HTTP listener and close only that server's accepted HTTP connections. The close starts before the connections are drained. A live browser can keep a socket open without sending a request, so awaiting server.close() alone can block the later after hook that stops the browser. Register cleanup after the fixture starts; call it after the fixture's assertions have completed.
The CI-tier connection and after-hook regression runs without Tauri or a provider. Run it directly with Node:
node --test e2e-native/tests/http-fixture-cleanup.test.mjsPowerShell:
node --test e2e-native/tests/http-fixture-cleanup.test.mjsRunner input contracts before App launch
When changing a native-run wrapper, test the runtime producer's serialized output through the exact frozen consumer and shell that the run will invoke. Use harmless owned fixtures before occupying the shared native slot. Replace only the final App/provider launch; keep the complete preceding input path unchanged, including argument construction, serialization, initialization, every actual file read and all admission checks.
A SourceOnly admission mode must call the same runtime producer and validate its complete output. Rebuilding input from an already accepted parent inventory misses runtime-only entries. Sharing a consumer, passing a producer/consumer composition test or checking an initial input prefix proves only that subset. For example, a copied package can pass composition while omitting the transport plan, protocol manifest or strict-root initialization that a later pre-App branch reads. Exercise those reads and validations in the same whole-path positive, without bypasses or reconstructed intermediate inputs.
Retain that complete unchanged pre-App positive and focused negatives for the changed boundary in the project's normal tests and CI. Cover:
- Zero, one and multiple arguments or entries. Empty strings, spaces, quotes and trailing backslashes must survive the actual serialized argument consumer.
- Identity timestamps as literal strings, preserving every fractional digit. Compare process births from the same API. A lower-precision projection cannot establish an exact birth match or physical closure.
- Pins for every literal path the consumer actually reads, including required aliases, metadata, transport plans and protocol manifests. Enforce the required file attributes, including read-only metadata, as well as hashes.
- Strict ancestor and root validation against the real package layout. An equivalent filename or a file outside the admitted root does not qualify the literal read. Exercise missing reads, wrong ancestors/roots and changed attributes as focused negatives, with refusal before App launch.
- Outer control metadata outside the inner run's reserved output namespace. Test collisions as negatives; preserve the namespace guard.
The maintained Windows supervisor regression is a bounded argv contract test:
node --test scripts/native-e2e-windows-supervisor.test.mjsPowerShell (Windows):
node --test scripts/native-e2e-windows-supervisor.test.mjsIt uses the actual createWindowsSupervisorPlan producer and native-e2e-windows-supervisor.ps1 consumer under Windows PowerShell 5.1 (powershell.exe). An owned compiled recorder accepts genuinely zero child arguments; the suite checks 0/1/N round trips, literal seven-fraction ISO identity strings, child exit codes, malformed input, launch failure and Job cleanup. The existing Windows CI job runs it after Node setup; non-Windows runs skip it explicitly. Preserve the canonical shell, argument quoting and Job ownership. PowerShell 7-only JSON switches such as -DateKind do not apply to this consumer.
These tests establish the supervisor boundary only. They do not qualify a private QA package's complete runtime producer or pre-App path, and the zero-argument fix does not repair missing inputs, initialization or namespace conflicts elsewhere. Label composition and prefix checks as partial evidence. Even a complete pre-App contract pass does not establish normal product behavior. This contract adds no permission or acknowledgement step for unchanged, already-qualified work.
Concurrent runs
Two native runs can execute at the same time. Every run claims its own resources automatically, so nothing has to be chosen by hand:
- Ports. The driver and its child native driver each get a port reserved from the OS at startup, passed through as
--portand--native-port. There is no fixed port any more, so a second run cannot collide with the first. - Home. Each run gets
wardian-e2e-native-<runId>under the OS temp directory. The runner pins that value once and hands it to every child, so the runner and harness never disagree about which home is in play. - Cleanup. A run ends only the process tree it started. It does not search for processes by command line, so an unrelated process is never terminated because its command line happens to mention the home path.
Both npm run test:e2e:native and the runner script activate this. Nothing needs a free port picked in advance.
Using an explicit home
Set WARDIAN_E2E_NATIVE_HOME to keep a run's state for inspection:
WARDIAN_E2E_NATIVE_HOME=/tmp/wardian-e2e-native-inspect npm run test:e2e:nativePowerShell:
$env:WARDIAN_E2E_NATIVE_HOME = "$env:TEMP\wardian-e2e-native-inspect"
npm run test:e2e:nativeThe path must be under the OS temp directory and begin with wardian-e2e-native, or sit under .tmp/e2e-native in the repository. The harness resets the home it is given, and that guard is what stops a reset from reaching an unrelated directory. The harness checks this guard before acquiring the home lock. Rejecting an unsafe path leaves its directories, contents, and existing lock unchanged.
A run writes .native-e2e-lock/owner.json into its home and removes it on exit. The harness snapshots the lock object returned by acquireHomeLock(...).lock. When a supervised child finishes a proven shutdown, it releases the lock only if the current claim is its own. A live claim with the same run id and the same pid as that snapshot is the upstream runner's claim; the child records home_lock_released: false and home_lock_release_deferred: true, then the runner releases the claim after the child exits. A normal child-owned release records home_lock_release_deferred: false. A foreign, malformed, or changed claim remains locked and fails cleanup confirmation.
A second run pointed at the same explicit home is refused before anything is deleted or terminated. Give each concurrent run its own home, or leave the variable unset.
If a previous run crashed, its lock is left behind. The next run reports the stale lock and proceeds. It does not terminate processes that run may have orphaned, because they cannot be told apart from unrelated processes without the kind of command-line matching that caused cross-run kills.
Endpoint ownership
A run refuses to use a driver endpoint it cannot prove it owns. After the port answers, the harness resolves the pid listening on it and requires that pid to be the driver it started or one of that driver's children. A live listener left by something else fails the run instead of being adopted, and a driver that exits before binding is reported rather than treated as ready.
Some capture and chat helper scripts still assume the old fixed port. They read the port from the harness session instead: harness.driverPort and harness.nativeDriverPort.
For manual validation, run the same native harness in visible watch mode:
npm run test:e2e:native:watch -- e2e-native/tests/cli-shared-state-native.test.mjsWatch mode reuses the current native binary, prints named test steps, pauses briefly between watch steps, and keeps the WebView open until you press Enter. Set WARDIAN_E2E_STEP_DELAY_MS to change the pause length, or set WARDIAN_E2E_WATCH_KEEP_OPEN=0 to close the window automatically.
If the WebView shows a localhost:1420 connection failure, the fast/watch runner is using a binary that expects the Vite dev server. Either start npm run vite or rebuild the native debug app first:
npm run tauri -- build --debug --no-bundleUse this layer when validating:
- workbench JSON persistence, backup rotation, restart recovery, or safe mode
- terminal scrollback or renderer behavior
- Tauri
invokecommands - PTY-backed input/output
- desktop/remote presentation ownership, geometry, snapshots, or event order
- provider spawn, resume, or shutdown behavior
- app and CLI shared-state behavior through isolated
WARDIAN_HOME - automation behavior that depends on native runtime state
The CLI shared-state smoke can be run directly:
npm run test:e2e:native:fast -- e2e-native/tests/cli-shared-state-native.test.mjsIt starts the native app with an isolated WARDIAN_HOME, creates agents through both Tauri IPC and live CLI control, then runs the local wardian-cli binary against the same home. The smoke asserts live app state is readable, explicit agent spawn --provider --class works, agent wait --until observes the requested status, and lifecycle commands affect the running app. The CLI still falls back to state.db when the desktop app is not running.
The control fixture captures Mock Init events before each spawn, clone and resume. It requires the launch's agent and provider identities, a fresh Init, and release of persisted conversation exclusion before seeding status or exercising lifecycle commands. A seeded visible status does not prove startup completion. Skip-build and explicit paired runs consume the harness's frozen CLI without another Cargo build; the control case records the consumed app and CLI hashes and sizes.
Workbench and Terminal Presentation Package
After building current native assets, run the focused package:
npm run tauri -- build --debug --no-bundle
npm run test:e2e:native:workbenchIt proves four native boundaries with an isolated Wardian home:
- exact workbench primary/backup bytes, restart, corrupt-file fallback, and future-schema preservation;
- desktop terminal owner/mirror activation races, timeouts, stale lease rejection, ordered output, and stable canonical geometry;
- closing all workbench presentations leaves the agent runtime live, while safe mode preserves the durable split tree byte-for-byte;
- authenticated desktop-to-remote-to-desktop transfer and socket liveness.
The related browser package remains useful for navigation and layout only:
npm run test:e2e:workbenchDo not use its mocked transport to claim native file durability, PTY resize, lease enforcement, remote authentication, or provider behavior.
Real Providers
Real-provider checks are opt-in. Keep them isolated and use them for every provider-runtime claim. The mock provider can prove Wardian-owned behavior such as routing, queueing, rendering, state sharing, and deterministic PTY plumbing. It cannot prove that a real provider CLI accepts input, exposes a ready prompt, clears a compose field, resumes a session, or responds through its real transcript path.
Never make a mock-backed test spoof a real provider identity to validate Codex, Claude, Gemini, OpenCode, Antigravity, or Pi behavior. If a test would need that, write an opt-in real-provider native E2E test or leave a skipped test with // @real-provider-only.
WARDIAN_E2E_REAL_OPENCODE=1 WARDIAN_E2E_REAL_WORKSPACE=<absolute-workspace-path> npm run test:e2e:nativeFor the opt-in Antigravity smoke:
WARDIAN_E2E_REAL_ANTIGRAVITY=1 WARDIAN_E2E_REAL_WORKSPACE=<absolute-workspace-path> npm run test:e2e:native:fast -- e2e-native/tests/antigravity-native.test.mjsOn PowerShell, use the same placeholder with a Windows absolute path:
$env:WARDIAN_E2E_REAL_OPENCODE='1'
$env:WARDIAN_E2E_REAL_WORKSPACE='<absolute-workspace-path>'
npm run test:e2e:nativePowerShell Antigravity smoke:
$env:WARDIAN_E2E_REAL_ANTIGRAVITY='1'
$env:WARDIAN_E2E_REAL_WORKSPACE='<absolute-workspace-path>'
npm run test:e2e:native:fast -- e2e-native/tests/antigravity-native.test.mjsThe harness uses an isolated WARDIAN_HOME by default, so native E2E runs should not modify production <wardian-home> state.
Automatic inbound reply acceptance
automatic-inbound-reply-real-native.test.mjs requires an explicit real-provider grant and paired frozen artifacts. On Windows, its existing Node gate requests the Cmd shell family. Before provider startup, the fixture checks Cmd resolution against the app-server child PATH construction and verifies the exact Node executable. It does not change PATH, sandbox policy, or provider defaults.
An absolute shell request selects a shell family in Codex; it does not pin the selected executable. The private report retains the worker's native tool calls and outputs. A remote execution environment that rejects Cmd fails the case without a fallback or replay. A remotely attached TUI alone does not establish that tool-execution mode. Only the real delayed reply and subsequent FYI wake establish messaging acceptance.
Claude Inbox Stop-hook acceptance
This one-turn probe verifies that an interactive Claude Stop event produces one durable canonical Inbox item, and that a workspace-defined Stop hook runs alongside Wardian's injected hook. It does not modify the user's Claude settings or copy authentication data. Select an explicitly preflighted model; haiku is the lowest-priced model in Anthropic's current public API lineup.
PowerShell:
$env:WARDIAN_E2E_REAL_CLAUDE_INBOX = '1'
$env:WARDIAN_E2E_CLAUDE_INBOX_MODEL = 'haiku'
$env:WARDIAN_NATIVE_SKIP_BUILD = '1'
$env:WARDIAN_NATIVE_APP = '<absolute-isolated-artifact-path>'
node scripts/run-native-e2e-fast.mjs e2e-native/tests/claude-inbox-stop-real-native.test.mjsThe test refreshes the catalog before provider spawn, submits exactly one short prompt, correlates the provider-authored transcript with the hook's prompt_id, and checks the persisted response and event timestamp source. It writes private evidence under the isolated test home. Run provider probes serially.
Real Provider PTY Rendering Lab
Use the rendering lab when investigating issue #110 class failures: line wrapping, row bleed, stale terminal geometry after resize, resize/minimize/maximize lag, or whole-app slowdown with real provider PTYs. This suite is real-provider-only and defaults to Codex and Claude when WARDIAN_E2E_RENDERING_PROVIDERS is unset.
POSIX shell:
export WARDIAN_E2E_REAL_RENDERING=1
export WARDIAN_E2E_RENDERING_PROVIDERS=codex,claude
export WARDIAN_E2E_REAL_WORKSPACE=<absolute-workspace-path>
export WARDIAN_E2E_RENDERING_EXPECT_RESPONSE_TEXT=WARDIAN_SCROLL_050
VITE_WARDIAN_TERMINAL_DEBUG=1 npm run tauri -- build --debug --no-bundle
npm run test:e2e:native:fast -- e2e-native/tests/real-provider-rendering-native.test.mjsPowerShell:
$env:WARDIAN_E2E_REAL_RENDERING = '1'
$env:WARDIAN_E2E_RENDERING_PROVIDERS = 'codex,claude'
$env:WARDIAN_E2E_REAL_WORKSPACE = '<absolute-workspace-path>'
$env:WARDIAN_E2E_RENDERING_EXPECT_RESPONSE_TEXT = 'WARDIAN_SCROLL_050'
$env:VITE_WARDIAN_TERMINAL_DEBUG = '1'
npm run tauri -- build --debug --no-bundle
npm run test:e2e:native:fast -- e2e-native/tests/real-provider-rendering-native.test.mjsFor screenshot evidence that may be published, set WARDIAN_E2E_RENDERING_MASK_PRIVATE_ROWS=1. The harness hides terminal rows containing the workspace directory or managed-home path only while capturing PNG screenshots, then restores the live terminal. The JSON and raw-output artifacts remain private and may still contain paths. Set WARDIAN_E2E_RENDERING_SUBMIT_INPUT=0 to inspect a typed draft without sending a provider turn.
The provider list also accepts pi. Include it in WARDIAN_E2E_RENDERING_PROVIDERS for a Pi rendering run, and set WARDIAN_E2E_RENDERING_PI_MODEL when the test should use a specific configured Pi model.
Provider function conformance
The provider function matrix records real acceptance separately from fixture tests, setup blockers, and intentional omissions. Keep paid provider runs serialized under their execution owner. The shared harness allocates per-session WebDriver ports, verifies listener ownership, and freezes the app and CLI into the run-owned home. Supply an already packaged artifact and an explicit model from the current provider catalog. The suite does not build the application or choose a default model.
WARDIAN_E2E_REAL_CHAT_CONFORMANCE=1 \
WARDIAN_E2E_CHAT_PROVIDERS=claude \
WARDIAN_E2E_CHAT_CLAUDE_MODEL='<verified-low-cost-model>' \
WARDIAN_NATIVE_APP='<absolute-packaged-app-path>' \
node scripts/run-native-e2e.mjs e2e-native/tests/provider-chat-conformance-real-native.test.mjsPowerShell:
$env:WARDIAN_E2E_REAL_CHAT_CONFORMANCE = '1'
$env:WARDIAN_E2E_CHAT_PROVIDERS = 'claude'
$env:WARDIAN_E2E_CHAT_CLAUDE_MODEL = '<verified-low-cost-model>'
$env:WARDIAN_NATIVE_APP = '<absolute-packaged-app-path>'
node scripts/run-native-e2e.mjs e2e-native/tests/provider-chat-conformance-real-native.test.mjsProvider selection accepts claude, codex, opencode, antigravity, and pi. Set the corresponding WARDIAN_E2E_CHAT_<PROVIDER>_MODEL for every selected provider. WARDIAN_E2E_CHAT_EXTENDED_INPUTS=1 adds multiline, trailing-newline, and long-paste assertions. WARDIAN_E2E_CHAT_CATALOG_ONLY=1 performs discovery without starting provider turns. WARDIAN_E2E_CHAT_CODEX_STARTUP_DIAGNOSTIC=1 allows 180 seconds instead of 90 before any prompt; it does not change delivery timeouts or resolve a model choice automatically.
On Windows, the Codex scratch-read case explicitly uses cmd.exe. Native evidence showed that the installed WindowsApps PowerShell could not launch inside Codex's sandbox. This constraint is recorded with the result; the test does not change sandbox or approval policy.
The separate context suite uses WARDIAN_E2E_REAL_CONTEXT_PERMISSIONS=1, one WARDIAN_E2E_CONTEXT_PROVIDERS value, and its explicit WARDIAN_E2E_CONTEXT_<PROVIDER>_MODEL. It exercises managed class instructions, Wardian skill deployment, approval rejection before provider invocation, and inherited headless session boundaries. Independent provider-native records bind each headless answer to its request and session. Normalized automation output or saved agent configuration alone cannot establish that identity.
For canonical task delivery, use the maintained provider-delivery native acceptance procedure. The separate Codex v2 Native acceptance procedure covers the Codex v2 sender/receiver suite; its configuration and claims are separate from this provider-delivery matrix. The documented Claude/Antigravity composer exceptions remain separate results.
The delivery suite limits Claude to Bash and an empty strict MCP configuration, and disables its cross-session messaging tools. This qualifies the canonical CLI reply through the composer exception; it does not qualify Claude MCP delivery or provider-native collaboration tools. These limits apply only to the test agent.
The older provider-native-broker-real-native.test.mjs integration path uses the retired wardian send command. Its retained reports describe historical builds; that path cannot qualify the current canonical messaging implementation. Run real-provider suites through scripts/run-native-e2e.mjs so the supervisor owns the isolated home lock and child processes.
These suites retain disposable Wardian homes under .tmp/e2e-native/, with artifact/harness hashes and per-case observations. Raw logs and screenshots stay local. Publish only sanitized evidence. A native provider can also write to its ordinary session store; do not describe Wardian-home isolation as isolation of all provider-owned history.
Freeze a packaged runtime before verification commands that compile Cargo test targets. Those commands can replace the same debug executable with a dev-URL build. Check the artifact hash when associating a run with a source change.
Provider-delivery native acceptance
The maintained provider-delivery real-native harness is e2e-native/tests/provider-delivery-real-native.test.mjs. Its real-provider opt-in and provider/case/native-route settings are documented in Provider readiness. Against a frozen packaged app and matching CLI, a bounded selected-provider run is:
WARDIAN_E2E_REAL_DELIVERY=1 \
WARDIAN_E2E_DELIVERY_ALLOW_PARTIAL=1 \
WARDIAN_E2E_DELIVERY_PROVIDERS=<provider-list> \
WARDIAN_E2E_DELIVERY_CASES=<case-list> \
WARDIAN_E2E_DELIVERY_NATIVE_PROVIDERS=<native-provider-list> \
WARDIAN_E2E_REAL_WORKSPACE=<absolute-workspace-path> \
WARDIAN_NATIVE_SKIP_BUILD=1 \
WARDIAN_NATIVE_APP=<absolute-packaged-app-path> \
npm run test:e2e:native:fast -- e2e-native/tests/provider-delivery-real-native.test.mjsPowerShell:
$env:WARDIAN_E2E_REAL_DELIVERY = '1'
$env:WARDIAN_E2E_DELIVERY_ALLOW_PARTIAL = '1'
$env:WARDIAN_E2E_DELIVERY_PROVIDERS = '<provider-list>'
$env:WARDIAN_E2E_DELIVERY_CASES = '<case-list>'
$env:WARDIAN_E2E_DELIVERY_NATIVE_PROVIDERS = '<native-provider-list>'
$env:WARDIAN_E2E_REAL_WORKSPACE = '<absolute-workspace-path>'
$env:WARDIAN_NATIVE_SKIP_BUILD = '1'
$env:WARDIAN_NATIVE_APP = '<absolute-packaged-app-path>'
npm run test:e2e:native:fast -- e2e-native/tests/provider-delivery-real-native.test.mjsThe Provider readiness guide documents the full matrix, case names, and Claude/Antigravity composer-exception setting. Acceptance requires an actual provider-authored reply correlated to the Wardian request and bound to the observed provider session, generation, and native evidence. Setup, a task claim, a receipt, a terminal echo, a historical receipt, or mock-provider output alone does not qualify as native acceptance.
Long-habitat acceptance gate
Issue #1285 adds an explicit opt-in gate to the maintained provider-delivery suite. Set WARDIAN_E2E_ASSERT_LONG_HABITAT=1 only when the selected run includes both codex and claude. The managed habitat path under test is <wardian-home>/agents/<agent-id>/habitat/workspace; its computed UTF-16 path must exceed the observed Windows limit. WARDIAN_E2E_REAL_WORKSPACE may remain a short external project folder. The gate checks the returned AgentConfig.folder and records the managed path length separately from the actual provider CWD before the first paid provider prompt. Claude uses the managed habitat path through the owned short alias and therefore requires the alias record, alias workspace target, pause/resume reuse, and exact cleanup after owned agent deletion. Codex uses the short external project folder as its actual provider CWD and requires no habitat alias; it verifies long-home publication, captures the nonempty runtime request values separately from the restored persistent baseline leaves, including explicit absence for leaves that were not persisted. It checks launch-journal cleanup and baseline preservation across pause/resume. For Codex, runtime proof requires one owned rollout whose completed turn has a matching turn_context model and effort, plus the user and provider-authored marker on that same turn. A request hash or terminal footer does not qualify model selection.
Before explicit owned-agent deletion, the helper writes a bounded private report containing hashed transcript fields, provider/archive identity counts, relative habitat paths, cwd-length evidence, and separate baseline presence/value hashes and request value hashes. Codex also retains the bounded selected model/effort and hashed thread/turn identities before deletion. Claude's report includes alias ownership identities and exact cleanup; Codex's report records that no alias was expected and retains the short provider CWD alongside the long managed-habitat path evidence. Reports include the CWD mode, measured managed path length, and measured external/provider CWD length. The long managed path is evidence about Wardian habitat publication; it does not claim that the provider process CWD was over the Windows limit. Both paths verify pause/resume identity, the normal provider turn, joined owned-agent deletion, and retention of the external workspace marker. The helper does not claim that normal agent removal preserves the removed agent's local habitat or provider archive. Direct child GetCurrentDirectory observation is not required; the provider CWD mode is reported from the inspected provider spawn wiring and provider-specific filesystem evidence. A Codex report therefore says explicitly that the managed habitat path is long while the actual provider CWD is the short external workspace.
Choose a disposable Wardian home whose own path is commonly about 205–231 UTF-16 units, then use a short external project folder. The managed agents/<agent-id>/habitat/workspace suffix supplies the boundary pressure while the project path stays short, isolating the managed habitat path from the actual provider CWD.
Run the offline helper exercise without an app or provider:
node --test e2e-native/tests/provider-long-path-evidence.test.mjsFor the paid acceptance run, add the gate and a private evidence root to the maintained provider-delivery command above:
WARDIAN_E2E_ASSERT_LONG_HABITAT=1 \
WARDIAN_E2E_LONG_HABITAT_EVIDENCE_ROOT=<absolute-private-evidence-root> \
WARDIAN_E2E_DELIVERY_ALLOW_PARTIAL=1 \
WARDIAN_E2E_DELIVERY_PROVIDERS=codex,claude \
npm run test:e2e:native:fast -- e2e-native/tests/provider-delivery-real-native.test.mjsPowerShell:
$env:WARDIAN_E2E_ASSERT_LONG_HABITAT = '1'
$env:WARDIAN_E2E_LONG_HABITAT_EVIDENCE_ROOT = '<absolute-private-evidence-root>'
$env:WARDIAN_E2E_DELIVERY_ALLOW_PARTIAL = '1'
$env:WARDIAN_E2E_DELIVERY_PROVIDERS = 'codex,claude'
npm run test:e2e:native:fast -- e2e-native/tests/provider-delivery-real-native.test.mjsKeep the evidence root private and retain its bounded report before the explicit deletion step removes agent-local state. The offline test uses a disposable Windows junction fixture; it does not establish real-provider or packaged-app acceptance.
Attached runs use an input-only block that prevents composer/task input while keeping the attached runtime and native provider owner alive. Privileged control replies remain available; terminal pause or termination is not the acceptance mechanism. Failed or uncertain submissions remain failed or uncertain and are never replayed. Provider outcomes are evaluated separately, so one result does not establish acceptance for every provider.
Wardian retains the canonical ask_... request identity for correlation. OpenCode receives a distinct deterministic msg_... provider message identity at its adapter boundary; evidence must keep those identities bound rather than substituting one for the other.
Rendering evidence
The run writes Wardian-side evidence under e2e/screenshots/real-provider-rendering/<run-id>/. Each provider directory includes JSON and screenshots for initial, settled, narrow, resized, wide, card-level card-maximized and card-restored, window-level minimized, restored-after-minimize, maximized, restored-after-maximize, rapid-resize-final, scrolled-top, cleared-immediate, paused, and resumed.
When WARDIAN_E2E_RENDERING_INPUT_TEXT is unset, the lab submits a compact default prompt that asks the provider to print exactly 50 lines from WARDIAN_SCROLL_001 through WARDIAN_SCROLL_050. This keeps the typed prompt from polluting scrollback with a second copy of the audit rows while still requiring WARDIAN_SCROLL_050 in the provider response.
Each state JSON records the xterm parser rows, DOM rows, card/screen/viewport rectangles, terminal debug columns and rows, renderer cell metrics, native window rectangle, browser viewport metrics, app-shell rectangle, screenshot timestamps, artifact timestamps, and row-stability timing. Resize and disruptive-action states also record before/after native window rectangles, before/after browser viewport metrics, before/after terminal debug geometry, action duration, stable-row duration, and any exposed fit or resize counters.
The full native runner enables VITE_WARDIAN_TERMINAL_DEBUG=1 while it builds the app for this lab. test:e2e:native:fast intentionally reuses a prebuilt native app, so build the debug app with that Vite flag first; otherwise the Wardian-side terminal debug snapshots will be unavailable.
The lab checks the terminal debug API after the Agents overview mounts and before spawning audit agents. It records debug-preflight.json in the evidence directory and fails with the build prerequisite when instrumentation is missing. A Rust debug executable can contain a production Vite frontend; setting the flag only when launching that executable does not change its compiled assets. Passing this preflight proves only that instrumentation is available. Real-provider response, presentation ownership, and before/after resize evidence remain required.
When terminal history exists, the lab also captures <state>-scrollback-top and, for deeper history, <state>-scrollback-mid artifacts. These are intentionally not limited to the visible bottom viewport; use them to diagnose row bleed, wrapped-line corruption, stale geometry, and defects that only appear higher in scrollback after resize, card maximize/restore, clear, pause, or resume flows.
Useful tuning variables:
WARDIAN_E2E_RENDERING_WINDOW_WIDTH=1920
WARDIAN_E2E_RENDERING_WINDOW_HEIGHT=1080
WARDIAN_E2E_RENDERING_RESIZED_WIDTH=980
WARDIAN_E2E_RENDERING_RESIZED_HEIGHT=980
WARDIAN_E2E_RENDERING_WIDE_WIDTH=1920
WARDIAN_E2E_RENDERING_WIDE_HEIGHT=1080
WARDIAN_E2E_RENDERING_RAPID_SEQUENCE=1040x900,1320x1040,1160x980,980x980
WARDIAN_E2E_RENDERING_ROW_HEIGHT=900
WARDIAN_E2E_TERMINAL_FONT_SIZE=10
WARDIAN_E2E_RENDERING_STABLE_ROWS_QUIET_MS=750
WARDIAN_E2E_RENDERING_SETTLE_TIMEOUT_MS=10000
WARDIAN_E2E_RENDERING_POST_INPUT_WAIT_MS=0
WARDIAN_E2E_RENDERING_SUBMIT_INPUT=1
WARDIAN_E2E_RENDERING_SUBMIT_SEQUENCE=\r
WARDIAN_E2E_RENDERING_POST_SUBMIT_WAIT_MS=8000
WARDIAN_E2E_RENDERING_EXPECT_RESPONSE_TEXT=<optional-response-marker>
WARDIAN_E2E_RENDERING_CODEX_MODEL=<optional-codex-model>
WARDIAN_E2E_RENDERING_CLAUDE_MODEL=<optional-claude-model>
WARDIAN_E2E_RENDERING_OPENCODE_MODEL=opencode/deepseek-v4-flash-free
WARDIAN_E2E_RENDERING_PI_MODEL=<optional-pi-model>The default initial, settled, and wide visual states use a 1920x1080 desktop window so PR evidence resembles a normal fullscreen desktop. Keep the smaller resized, narrow, rapid-resize, geometry sweep, and outside-terminal sizes when the test is deliberately proving wrapping, cramped layout, or resize behavior.
The lab sends the configured input text as PTY keystrokes and, by default, submits it with carriage return (\r). This is intentional: the real-provider run must create actual conversation history before resize, scrollback, clear, pause, and resume evidence is captured. When WARDIAN_E2E_RENDERING_INPUT_TEXT is unset, the default prompt asks the provider to print 50 numbered lines from WARDIAN_SCROLL_001 through WARDIAN_SCROLL_050, and the expected response marker defaults to WARDIAN_SCROLL_050. For custom deterministic history checks, make the input text ask for a short marker and set WARDIAN_E2E_RENDERING_EXPECT_RESPONSE_TEXT to that marker. Set WARDIAN_E2E_RENDERING_SUBMIT_INPUT=0 only when intentionally inspecting prompt-editing behavior without a completed provider turn.
For OpenCode rendering runs, the lab defaults to the free remote OpenCode model opencode/deepseek-v4-flash-free so the provider does not fall back to local model backends such as LM Studio. Override WARDIAN_E2E_RENDERING_OPENCODE_MODEL only when intentionally testing a different OpenCode model.
The lab fails the run for obvious Wardian-side evidence problems before manual screenshot inspection: non-empty screenshot requirements, missing fixed audit text after resize, unchanged columns when a resize state expects a geometry change, screen rectangle mismatch against xterm cell metrics, paused-buffer mismatch, and rendered rows that do not stabilize before the settle timeout. Outside-terminal parity is still captured separately with scripts/capture-outside-provider-rendering.ps1 when side-by-side native Windows Terminal evidence is needed.
Windows WebView2 profile isolation
The maintained chat-turn-change-native case uses the opt-in Mock chat_acceptance scenario. Its ordinary plain Roster click reveals the agent in Agents Overview; explicit Open is a separate route that can create an AgentSession. The driver and passive observer share one exact-owner container resolver for the visible Overview card or actual AgentSession. It verifies the current workbench, surface and selected tab/tabpanel linkage, and rejects hidden, detached, stale, foreign or ambiguous containers. Closing and reopening uses that actual parent tab and the normal Roster action. No context-menu Open substitutes for the timed primary click, and no transcript/page prewarm occurs. The normal build publishes an inert, versioned, owner-bound page-loader subscription before React mounts. With no matching subscriber it retains no history and attaches no Promise handlers. The stable loader invokes the SDK once and returns its exact Promise. An active passive observer receives the original arguments and Promise, records actual scope and row identity, and requires positive activation before the trusted Roster action. It does not replace Tauri's immutable internal invoke function. Subscriber faults are isolated from the product and exposed as an explicit failure count. Disposal releases the subscription and DOM listeners and retires late settlements and frames. Runtime coverage is PAGE_LOADER_ONLY; a separate source call-site inventory checks ordinary routing. Broader legacy/all-IPC runtime coverage is UNOBSERVED. An empty page-call ledger cannot qualify no-prewarm or admitted-body evidence. Passive markers on the existing Chat scroll region and message row expose the page actually admitted by the consumer and its rendered event/member identity. The observer matches these markers to the actual response, including conversation, generation, nullable source epoch, opaque window revision and admission. A returned response alone cannot qualify an unadmitted page. Both animation-frame witnesses also retain the same actual container, panel and tab nodes; reused body/scroll nodes cannot hide a container replacement. Any display-slot alias requires the response's actual alias proof. Usability freshly validates the same painted node and row identity, scope, members, window and DOM references through both frames. Another equal-text row becoming first cannot replace that subject. matchingBodySlots remains a reported diagnostic count; it is neither identity nor a unique-body-slot claim. Changes to unrelated matching rows do not invalidate an otherwise valid latched subject. Durable scope requires real conversation and generation IDs. A validated recent preview instead uses its producer-issued recent admission and retains every actual nullable canonical hint. The original preview receipt and current consumer DOM must match owner, admission, revision and the complete nullable tuple. Missing admission does not make null durable IDs valid for a target receipt. Preview paint proves recent-capability scope; it does not grant canonical-ready, Older, detail or renewal authority. A matching empty unchanged response can retain the original current target receipt while its actual admitted scope stays the same.
An empty unscoped reset is retained only as control evidence: matching owner, valid revision, explicit null conversation/generation/epoch, and no admission, rows or authority. It fences earlier receipts and pending frame proofs. It grants no endpoint or qualification; a fresh scoped producer reply must pass two stable frames before a new endpoint can be stamped. Malformed claimed scopes remain errors. Bounded rejection records retain field shapes and available request context without transcript or identifier values.
The timing observer classifies only the exact desktop rejection chat source temporarily busy with a known original page-request sequence, dispatch time, operation and phase as a pending retry. The SDK promise and normal product retry remain unchanged. Every rejection still increments the raw error count; at most eight structural records and 8 KiB are retained. Other errors and unknown request association remain fatal. Recovery requires a normal request dispatched after the rejection, a validated target matching the current admitted DOM, and two fresh frames without a visible direct-child transcript alert. Old replies and empty reset controls cannot recover it. Pending retry or a current transcript alert blocks usability, qualification, endpoint waits and final acceptance, even when earlier endpoint timestamps exist. The reported latency remains the first healthy usable witness. A busy error before it delays that witness under the original opening budget. An error after it preserves the historical timestamps and metrics, but final acceptance still requires fresh post-rejection target health and, for qualified cases, fresh canonical frame proof. Recovery qualification is recorded separately; old qualification cannot satisfy that gate. No late recovery input or renewed probe deadline is required to preserve an already healthy first usability witness.
The historical V7 chat-preview-identity-native opening ruler also recognized a source-backed answer in the provisional shared renderer. It requires one unambiguous producer item/event-reference binding, the literal answer anchor and turn key in the DOM, and matching consumer session, conversation, generation, epoch, admission and revision across both frame witnesses. Bridge and item admissions must equal the page admission. Both desktop and Remote require the consumer scope marker. This proves provisional readability and usability; canonical qualification still requires the existing non-provisional, completed canonical answer. A preview-to-qualified interval can describe capture promotion in place and does not by itself prove a source-representation switch or anchor preservation. Those behaviors need their separate regression evidence.
V8 native Chat opening and qualified handoff
For a candidate-only check of archive-generation rollover, the existing test also accepts WARDIAN_E2E_CHAT_PREVIEW_MINIMAL_TIMING=1. It runs three saved-active pending cold/warm pairs per surface using a prebuilt release app and CLI. Its separate report retains first usable in milliseconds, source switch count and the largest signed anchor displacement in CSS pixels, with the outcome for each opening. A failed opening stays in its scheduled slot. The complete V8 report continues to use its existing writer and evidence policy.
The compact cold/warm pairs use independent app homes and Remote browser profiles between repetitions. To check repeated Remote navigation, set WARDIAN_E2E_CHAT_PREVIEW_REMOTE_REOPENS=1 with the same prebuilt release and synthetic pending fixture inputs. The runner opens Chat cold, reopens it warm, then performs five more back-and-open cycles in the same authenticated browser session and app home. Capture must still be pending at each click. Each opening gets one input attempt and retains its own outcome in the compact report.
The Remote report records first usability when the native response, visible answer and trusted composer input pass their frame checks. A later indexing reply or gateway failure stays in the passive observation and does not replace the first-usable evidence. The report includes the observed renderer sequence and separately records directly witnessed source switches. A zero switch count can occur when the shared renderer is present from the start or when an intervening frame lacks the matching producer receipt. The renderer sequence alone grants no anchor or handoff proof.
The current harness revision is v9-retention-selector-diagnostics. It uses the unchanged V8 endpoint predicates, numeric ruler version, workload, probe, clocks, budgets and authority checks. Historical V8 artifacts remain immutable and receive no new credit from this revision.
V8 separates the first usable opening (M1) from producer-qualified handoff (M2). Historical V7 freezes, failed cohorts and null accepted metrics remain unchanged. The same V8 ruler runs against normal release main and candidate artifacts. Each artifact uses its own compiled producer fixture seeder and persisted schema. Raw source generation, counts, padding and successful body are common; producer IDs and source record ordinals remain opaque across versions.
M1 starts at the trusted normal Roster click and includes an ordinary Switch to Chat action when needed. It requires a current-phase owned native page response, literal native backing IDs and source/body evidence, separately visible recent narrative in the selected agent view, and trusted unsent composer input followed by two stable animation frames. The exact probe is synthetic-unsent-timing-probe (29 characters); Enter is never sent. M1 is strictly under 1,000 ms. API-only responses, spinners, empty resets, hidden/foreign views, stale requests and synthetic input receive no credit. Wire evidence and visible content are separate observations. Body text never assigns a DOM ID or alias. Main Remote lacks consumer scope/row DOM markers; V8 neither adds nor infers them. Existing markers, when present, must agree with the actual current response.
Both sources use the versioned saved-active-auto-restore-v1 fixture lifecycle with the quiet synthetic Codex PATH peer. Staging opts into savedActiveRestore: true and writes desired is_off: false before app startup; default staging remains saved-Off. The ordinary backend restores the existing literal native session through its resume policy. It must earn the real owner, ordinary TUI attachment, exclusive Idle thread and direct-input readiness. The composer must really be enabled. Saved config or roster online state alone does not prove native-owner readiness; the separate fixture-readiness diagnostic must establish it before measurement. No DOM/status/config enablement, Mock substitution or wheel probe can satisfy V8 M1. The peer tests synthetic startup and unsent input only, not real Codex inference or delivery. Pin its corrected JS/transport, interpreter and dependency hashes.
V8 opts into upstreamStorage: true when staging the raw fixture. Its physical source starts under <wardian-home>/agents/<session-id>/synthetic-provider-home/.codex/sessions, and that owned plain .codex directory is the application's explicit upstream CODEX_HOME. Default staging retains the historical local-session layout. Staging locally and then projecting into a different upstream can copy the file, invalidating its certified physical identity even when its bytes match.
Saved-active mode invokes neither build_agent_cli_command nor resume_agent: normal owner startup prepares the projection. After actual backend Idle readiness, verify that managed sessions resolves to the staged upstream directory and that source bytes, body hash and device/file identity match the pre-app witness. Retain those checks through cleanup and ordinary compaction. Reuse an existing provider directory only for this opt-in owned plain upstream; reject linked or foreign ancestors. Keep source/capture/peer guards intact and retain failed diagnostic roots. These filesystem checks do not establish native-owner readiness or measurement credit.
Strict cleanup must retain one successful native pause_agent request and its actual null reply for the exact fixture agent, followed by one read-only roster check confirming that same agent is Off. Empty selection, another agent's reply, driver exit or a zero-process Job receipt cannot substitute for the pause reply. Pause failure still requires driver cleanup and remains a failed cleanup.
This lifecycle applies identically to baseline and candidate: qualified 128-turn/padding-128 and pending 12,000-turn/padding-1,024 workloads, source/body proofs, cold first-Chat and warm reopen definitions, trusted input/frames, budgets and M1/M2 gates stay fixed. No retry, resampling, retroactive credit or alternate fixture is permitted after a saved-active validation failure; that failure blocks PR3. The saved-Off/manual-resume path remains uncovered under issue #1778, with R07 retained as failed evidence. A later Off-path follow-up is separate from PR3's merge gate.
M2 retains the stronger consumer scope, producer-issued admission, turn/item, event-reference and source-evidence checks across two fresh frames. Provisional items require matching page, bridge and item admissions and an exact answer anchor. Both provisional and canonical items must match the owned fixture source key and the independently captured native-identity epoch. Page, event metadata and item epoch agreement alone cannot establish ownership. The epoch is the digest of the serialized native identity, not the source-content hash. A record key must be the literal physical source reference or explicit producer physical-owner identity. A merged display representative may keep another physical owner only through its exact bounded producer member certificate. Without that physical witness or certificate, the returned event ID grants no owner evidence: it may be a logical display ID. Text and derived canonical keys never establish that relation. Canonical completion is reported separately; provisional paint never becomes canonical credit. The runner observes for 30 seconds from the original click on both sources. M2 has no one-second SLO. Candidate handoff is required; absent main support is reported N/A_LEGACY_UNSUPPORTED, never manufactured qualification. The Legacy-to-bound producer source switch is counted separately from a same-item provisional-to-canonical in-place replacement. At most one of each is allowed; promotion inside the shared renderer is not a second source switch. The ruler tracks literal item, turn and source identities and provenance, complete returned aliases/window order, bounded frame geometry and real disclosure expansion state. It can request the real disclosure for an already shared provisional opening. Eight awareness hints are not an 80-row membership proof. Missing anchor/expansion witnesses, changed bound identity, regression, repeat promotion, blank or mixed frames, extra reflows or exhausted bounds leave continuity unproven. A genuinely canonical first frame is labeled CANONICAL_FIRST_FRAME, with no handoff or expansion-preservation claim. Zero observed changes in a provisional shared view do not automatically prove continuity.
An ordinary M1 readable timeout, input timeout or exhausted fixed probe window retains its failure and null accepted metric. Passive M2 observation continues until the original click plus 30 seconds, without new input, another opening or a new deadline. Its separate component result remains available even when M1 fails. No M2 frame or transition after that absolute cutoff receives credit. Authority, setup and fatal observer failures still trigger immediate owned cleanup.
Before the first V8 cohort, the typed outcome protocol distinguishes an ordinary M1 miss from a fatal cycle failure. Only the actual opening flow can mark its original exception after the full passive M2 window and every handoff guard has passed. The case remains FAILED, with null accepted metrics and the same error and cause. Codes, messages and caller-supplied fields cannot supply this origin. The surface records post-source-verification PASS only after its real source assertion. Its existing final errors-length assertion emits an ordinary-only summary only when every recorded error is exactly one marked opening miss; source assertions, passive errors, unknown origins and count mismatches do not qualify. Cleanup operation results remain separate from supervisor closure.
After the final report is persisted, one bounded stdout outcome record binds the root classification to that report's SHA-256. Typed classification still requires exact ordinary case/surface/error accounting, source and observer checks, completed cleanup and the matching joined, active-zero, closed Job receipt. It does not authorize another native run. Missing or mixed evidence remains a stop.
The remaining operational authorization is one reviewed diagnostic followed by one last reviewed fixed 48-opening cohort, each requiring a separate parent GO. There are no extra trials, retries, resampling or retroactive credit. After the last cohort, failure to obtain an accepted series stops runtime for any reason and returns the merge decision to the user. This is an operator policy, not a new persisted counter, inferred permission or authority supplied by an outcome label.
The one diagnostic uses the existing test with all of these selectors:
| Environment selector | Value |
|---|---|
WARDIAN_CHAT_PREVIEW_DIAGNOSTIC | 1 |
WARDIAN_CHAT_PREVIEW_DIAGNOSTIC_DESKTOP_PENDING | 1 |
WARDIAN_CHAT_PREVIEW_FIXTURES | pending |
WARDIAN_CHAT_PREVIEW_SOURCE_ROLE | baseline |
That selector rejects other roles/modes, runs Desktop cold then warm only, and keeps accepted metrics, M1 and M2 null even if the endpoint operation succeeds. It changes no source/body/capture proof, trusted interaction, frame or cleanup gate. The selector itself is not a GO. No native execution is authorized merely by setting these variables.
Selector diagnostics record bounded scalar counts, stage reasons and first/last failures from the actual owned-host, single-visible-scroll, exact-visible-body and text-range-intersection predicates. Counts describe selector calls, not animation-frame counts. They retain no body text, DOM fragments or mutations and never supply a healthy endpoint. Diagnostic DOM capture uses the same single visible scroll rather than the first matching scroll.
Report retention is minified and remains capped at 512 KiB. Passing observations keep the original raw SHA-256/byte count, phase identity/frame/probe/continuity facts and the negative fields consumed by outcome predicates. Failed observations and each immediate predecessor retain raw evidence, including the full receipt ledger once per case. The duplicated phases history is removed; each case keeps its current phase. This storage view does not mutate in-memory verdicts or typed error provenance, and existing outcome readers consume the same negative fields. It introduces no interning, table/codec layer or relaxed proof.
If required raw evidence still exceeds 512 KiB, the writer reports exact measured_bytes and limit_bytes, refuses the write and leaves the previous partial intact. It never raises the cap, truncates failures or invents a complete report. Such an overflow remains a failed run with an explicit retention gap.
Controls fence old receipts and in-flight frames. A later exact current response needs fresh health frames. Busy recovery preserves a properly healthy first M1 timestamp but cannot bypass current health or fresh M2 proof. Subject replacement requires fresh trusted input and frames, with at most three attempts in the same absolute five-second probe window. No deadline or initial clock is reset.
Before App startup, the runner checks a predeclared fixture-generation fingerprint and literal byte count for each surface/mode. Fresh fixed-width 16-hex run IDs use the ordinary default home resolver. Case homes are siblings with the fixed three-byte suffixes d-p, r-p, d-q, r-q, retaining each home's required wardian-e2e-native-* prefix and all ownership fences. Native agent/session IDs remain UUID36. A cohort parent supplies the same existing WARDIAN_E2E_RUN_ID after claiming the absent default base with acquireHomeLock before Node spawn. The child accepts that base only with a matching live readable lock on an otherwise empty plain root; sibling cases remain absent. The earlier literal no-HOME assumption was incompatible with the maintained supervisor's receipt scope. Its existing WARDIAN_E2E_NATIVE_HOME is accepted only with the supplied valid 16-hex run ID and a literal value exactly equal to defaultNativeE2EHome for that run, followed by the live lock-only/plain-base check before preparation. Foreign, missing-run, malformed, dirty, dead or mismatched explicit homes still fail. There is no preload, new environment namespace or supervisor-guard change. The parent retains its lease through the matching joined/active-zero Job receipt and then releases it with releaseHomeLock. Standalone absence of a supplied run ID keeps the existing fresh-base path. Pin one new owned short TEMP/TMP container for both sources; with a seven-byte ASCII Windows root, all four compact sockets are 103 bytes, below the strict 108-byte capacity. Reject a longer socket or any existing base/case home before preparation; never reset a collision or resample its run ID. This preflight creates no home or reservation. Equal workspace path encoding lengths prevent per-turn cwd size bias. Literal source hashes and identities remain unmodified. A mismatch fails before the click, with no post-run exclusion or source normalization. Preparation remains bounded to 180 seconds per home. Independent process/home/profile cold and same-process warm reopen definitions remain; fixture write/hash/read warms the OS filesystem cache.
The comparison protocol predeclares three complete cycles per source in order Main1, PR3-1, PR3-2, Main2, Main3, PR3-3. Each has eight pending/qualified × desktop/authenticated Remote × cold/warm openings (48 M1 observations). Freeze both normal release pairs, source-specific seeders and the common V8 ruler before the first opening. Preserve every setup failure, null accepted metric and outlier; never union subsets from old cohorts or adapt the counts, order or gates. For each label, use only all three main observations to calculate its usable-time range and the median of their six observed readable/usable RAF-pair intervals. The empirical noise band is the larger of those two values. After all six cycles, report candidate-minus-main median, both raw ranges and every individual miss. Candidate must satisfy the absolute M1 target and not exceed main beyond that band. Main misses remain separate preexisting observations. This low-N empirical guard supplies neither a confidence interval nor a speedup claim. A failed fixture, authority, observer or cleanup gate stops later cycles under the frozen plan; ordinary measured M1 misses remain in the fixed comparison, never retried.
Runner configuration adds WARDIAN_CHAT_PREVIEW_SOURCE_ROLE=baseline|candidate, WARDIAN_CHAT_PREVIEW_FIXTURE_SHAPES=<absolute-json-file>, WARDIAN_CHAT_PREVIEW_PEER_PYTHON=<pinned-python-executable> and an explicit WARDIAN_CHAT_PREVIEW_PEER_TRANSPORT. The shapes JSON maps desktop-pending, remote-pending, desktop-qualified and remote-qualified to {generation_sha256, source_bytes}. Existing explicit frozen app/CLI, artifact manifest, source-specific seeder and skip-build settings remain required. This configuration is not permission to launch a measurement. DOM software-frame witnesses do not prove physical scanout; maintained cleanup retains the existing limited supervisor-closure statement. CPU/job/disk snapshots are context only.
Readable timing retains the independent full raw assistant body/hash in the RPC proof. Before App startup, the existing Markdown parser prepares a bounded rendered-text witness; plain Mock text retains whole-text matching. The actual witness text range must intersect the Chat viewport through two animation frames. A body without a safe independent witness fails fixture eligibility before App startup, rather than being reported as a UI latency failure.
Off agents normally open directly in Chat. The explicit-toggle timestamp remains null for that route, with a separate observed automatic-exposure timestamp. Live Terminal measurements retain the trusted Chat toggle. The original trusted Roster selection/open clock must satisfy both readable and usable endpoints in less than one second; neither route resets it. Usability requires trusted unsent composer input, or actual scrolling when the owned viewport has overflow. The owned visible enabled empty composer is preferred even for overflowing Saved views. Only the unsent probe is typed, without Enter, clearing or overwriting a draft, submission, model discovery or wake. If no safe composer exists, an overflowing owned viewport uses a trusted wheel. Its baseline comes from the existing DOM metadata read before the action, so compositor scrolling before the event handler cannot erase it. Both an actual trusted event inside that region and an offset change are required. An ordinary subject replacement cancels the old probe and pending frame proof. The replacement must pass fresh admitted paint frames and receive its own trusted input or wheel; old input never credits a new scope or DOM subject. Each opening permits at most three probe attempts within one absolute five-second probe window. The original Roster, readable and usable clocks never reset. An unchanged subject with no scroll movement is not retried. No safe control, an exhausted attempt cap, or an expired deadline fails honestly. Content-free attempt evidence retains the selected wheel delta and baseline, actual trusted event delta, current scroll and subject predicates, and frame/invalidation times, capped at three records/4 KiB. The fixture never toggles Off Chat away or loads history to manufacture activation or overflow. Both paint and trusted interaction retain the same admitted body and scope through two animation frames. Live cold/warm and small Mock Saved-Off cold/warm reopens are separate measurements. Each reopen uses the normal Roster action. Raw log inspection warms the filesystem, so these measurements do not establish OS-cold performance.
Desktop and remote/PWA Chat keep their existing opening refresh burst for an already validated, admitted recent preview even when it contains earlier rows. Two provisional rows do not establish that the recent window is complete. Both consumers use the same existing minimum-of-interval-and-100ms spacing and original first-second budget; canonical nonempty windows keep their ordinary cadence and remote backoff. Preview admission comes from the current selected recent window, without granting Older authority or restarting the clock on unchanged responses, visibility changes or rejected foreign pages. This intentionally permits more bounded recent metadata requests. Hook/store fake-timer checks and one public React/Dockview partial-preview integration establish consumer behavior; they do not establish native latency sufficiency, unchanged physical IO or provider speed.
Ordinary telemetry also offers valid live JSONL source observations to the existing background capture coordinator, independently of the status transition and parser mtime watermark. The coordinator admits first or changed observations, coalesces in-flight work, suppresses workers for unchanged settled sources, and retains failed work for a later ordinary tick. Capture keeps runtime, source identity and logging-policy revalidation. Backend regressions exercise live sampled processes, the raw Mock history fixture and the normal queued recent prelude with the full 80-row preview cohort. Canonical handoff still requires exact current-head coverage and a real Older cursor. The proof reuses hash-validated seek nodes within one request under the existing read limits; a deeper-history regression also covers a real head with at least 1,000 headers. These checks do not establish a historical native failure cause or native timing acceptance.
Roster click, container lookup and mode lookup failures retain bounded failure-only registry and container/tab ownership/visibility metadata, including ambiguity. This capture reads no Chat body, performs no prewarm and preserves the original exception and unmeasured endpoints even if the secondary capture fails. Toggle, paint, input, usability and assertion failures also retain bounded DOM-only metadata: mode, mounted Chat or suspended placeholder, ownership/tab geometry, scope/member presence, observer activation and request/settlement/error counters. These later captures make no registry or other IPC request, preserve the original exception and NULL endpoints, and do not retry or extend the measurement deadline. They also retain the chosen control and reason, planned/current composer flags, latched-subject validity versus the current first candidate, and actual wheel baseline/event/after offsets with received/changed flags, without body or draft text. Failure-only candidate facts also retain the bounded actual DOM scope and field presence, scope mode, first rejection gate, target presence/index, real scroll and text-range intersection. Member counts distinguish the total from the first 64 captured rows and report truncation; 64 is a diagnostic bound, not a renderer limit. These facts use the existing write-boundary redaction once and cannot set endpoints, move the viewport or dispatch another request. The same result also retains passive timing diagnostics. commandTiming is the current measurement's bounded record, including a failed measurement; successful phases retain that record as controllerTiming and in the at-most-six-entry phaseTimings map before returning, so a later failure preserves earlier actual page/controller timing. No missing historical record is reconstructed. Its nine fixed spans cover the paint wait, scroll lookup, interaction planner, displayed/enabled/value checks, complete sendKeys, wheel action and usability wait. Each has controller-monotonic startedAt, finishedAt and durationMs, with finally recording rejected operations. Unused or unavailable values remain null. endpointObservation is EVENT_NOTIFICATION: waits.paintAt and waits.usableAt retain actual bounded async callback wait counts and controller durations. Owned surface/mode discovery also uses one executeAsyncScript call (controlDiscovery: OWNED_DOM_NOTIFICATION). Its six preToggle spans retain Roster lookup/click, discovery, native displayed wait, title read and conditional native click, including rejected operations. discovery records actual attempts, native displayed predicate checks and page capture time. Unused operations remain null. The full input probe, display/enabled/value checks, wheel alternative and original two-frame guards are preserved. Global Selenium timeout and polling settings are unchanged.
The existing observer installs one waiter and checks an already accepted endpoint in the same WebView turn. It binds owner, facade version/token, current phase object, ordinal/label and endpoint field. Only original accepted publication can complete it; the compact acknowledgement grants no body or scope authority. Rearm, disposal, observer fault, duplicate waiter and expiry fail closed and clear timer/callback references before completion. Each sequential wait uses the remaining original absolute five-second controller budget, checked again after transport returns; the page timer only bounds callback lifetime. It never resets that deadline, samples a body, dispatches input, or adds a frame/request.
Discovery shares that single waiter and requires the original trusted finite Roster timestamp plus the same exact owner/facade/token/phase binding. It checks already-ready state synchronously, then uses the existing DOM observer's normal notifications. It returns only the unique current selected visible owned surface and mode button as real Element references. Missing, hidden, ambiguous, foreign, stale, reset or retired controls cannot qualify. Normal React/Dockview mounting provides the child-list notification; no separate signal or polling loop is added. After transport, the controller still runs the actual native isDisplayed wait, reads the actual title, requires the live Terminal toggle and conditionally calls the native click. Serialization or stale-element failures remain failures, with no selector fallback or JavaScript click. Browser coverage exercises the serialized callback against real DOM and preserves both references; native transport and subsecond acceptance require their separate native run.
Page-clock captureAtPage is appended to the existing observation read; page.paintCaptureAtPage and page.usableCaptureAtPage retain each wait's last owned-phase capture. plannedAtPage comes from the existing interaction planner. completeTrustedProbeAt records the existing trusted, owned, focused full-input acceptance; it alone proves neither a stable body nor usability. trustedWheelAt belongs only to the existing trusted wheel path. usableFrame1At is captured in the first existing usability frame and published only when the original second frame accepts the same phase/body. usableFrame2At aliases that original usable endpoint timestamp. Reset, stale and disposed callbacks cannot publish those frame stamps into another phase. Failure metadata retains the same page scalars. Compare page timestamps only with page timestamps, and controller durations only within their controller clock. Spans can overlap page frames and must not be summed with them. These scalar diagnostics contain no body or draft text, use the existing single redaction boundary, and never replace an original result or error. Structural tests establish unchanged commands, guards and frame scheduling; they do not establish zero instrumentation overhead or native latency improvement. At existing realm teardown, the one disposal operation returns a separate actual post-unsubscribe token/status and callback/error counters before closing the realm. The last pre-disposal observation is retained separately. Missing historical acknowledgements and unassigned historical wheel failures remain unobserved; a new controlled green does not establish the cause or success of an older native case.
After timing, genuine wheel/button actions load Older pages through opaque cursors and expand the declared 60,000-byte body. The fixture preserves both Edit/work turns and distinct equal-text assistant turns. Preview retirement is reported only when actually observed; a canonical-first response leaves that transition unrun. Startup and cleanup errors fail the case. App-free tests in harness-invoke.test.mjs check observer boundaries and raw fixture grammar; they do not establish native normalization, latency, saved-Off, UI, or provider acceptance. Native execution still requires a matching built App/CLI bundle and exclusive owned runtime resources. Results stay in the isolated home's artifacts/chat-normal-flow/ directory with identity strings hashed.
The same case accepts an optional WARDIAN_CHAT_SAVED_FIXTURE_MANIFEST value of <absolute-fixture-manifest>. This external data-only Saved witness is labelled separately from the small Mock restart. Its bounded manifest, selected configuration, independent recent-body oracle, original identities and every archive/index/artifact hash are validated before staging into a freshly claimed home, before the first app start. The source archive and index remain unchanged. The staged configuration is Off, uses the owned fixture folder and Test class, and retains its source logging policy. The agent array is staged at <owned-home>/settings/state.json for normal startup restore. Empty owned CODEX_HOME and CLAUDE_CONFIG_DIR directories isolate the fixture's provider configuration; no original native source, user configuration, auth, junction or logging override is imported. Directory overrides do not establish zero internal credential-store reads. Effective policy is recorded after measurement. Validation/staging warms the filesystem. The independent target must be visible naturally; a final-80 eligibility declaration alone cannot qualify a viewport, and the test never scrolls the target into view before timing. Missing lineage, scope or viewport proof fails honestly.
If the Roster selection fails, the case captures bounded registry and Roster DOM metadata after that failure. Its two-second passive registry deadline cannot replace the original error, retry the activation, or produce a timing sample. Explicit native run IDs matching the owned home claim also enable bounded [native-provider-discovery] records in wardian_debug.log. They describe the existing command, original child identity when known, and actual outcome without logging provider output or unexpected argument values. These diagnostics confer no readiness or authorization. Missing identity or witness evidence leaves provider isolation unqualified.
Final native qualification also requires the approved caller's original process handle/full birth identity, bounded actual exit, positive stdout/stderr EOF and owned Job-empty closure receipts. The existing harness termination timer and kill-on-close supervisor do not provide that complete receipt. This ownership hook must be resolved before a qualification run; the case's private result labels observed endpoints separately from unproved closure. A timer-only cleanup cannot establish PASS. This fixture does not establish OS-cold or real-provider performance, greater-than-64-KiB body continuation, native finite-renewal ACK/physical-read counts, HTTPS conformance or PWA behavior; those retain their existing verification layers.
Every Windows session started by the native harness creates a unique .webview2-* directory beneath its locked native test home. The driver child receives WEBVIEW2_USER_DATA_FOLDER pointing there; the parent environment and the desktop app's default profile are unchanged. The same path is passed through tauri:options.webviewOptions.userDataFolder, because EdgeDriver otherwise selects its own temporary profile outside the test home. The home lock must belong to the run and have a live owner before the profile is created. Each restart gets a fresh browser profile while Wardian's persisted state remains in the same home.
This applies to all native targets using startNativeSession, including direct test invocations. Profiles follow the existing test-home retention policy; do not clear the default desktop profile or close another app to run tests. Microsoft documents the child environment override as replacing the API's user-data-folder argument. An effective-profile check must observe the owned browser child's --user-data-dir value; an environment value alone does not prove what the runtime used. See also Microsoft's EdgeDriver WebView options.