# Parity Gates

## Purpose

Define hard pass/fail gates so CLI, tool, and runtime surfaces stay aligned.

## Parity Matrix

| Area | Modes | Surfaces | Gate |
|---|---|---|---|
| Session lifecycle | managed, extension, cdpConnect | CLI + tools + runtime | `launch/connect/disconnect/status` parity |
| Navigation + refs loop | managed, extension, cdpConnect | CLI + tools + runtime | `goto/wait/snapshot` parity |
| Interaction | managed, extension, cdpConnect | CLI + tools + runtime | click/type/select/scroll/press/check/uncheck parity |
| Targets + pages | managed, extension, cdpConnect | CLI + tools + runtime | target/page command parity |
| DOM + diagnostics + export | managed, extension, cdpConnect | CLI + tools + runtime | dom/perf/screenshot/screencast/browser replay/console/network/clone parity |
| Desktop observation | local desktop runtime | CLI + tools + daemon | desktop status/window/capture/accessibility parity |
| Relay channels | extension (default) + extension-legacy | `/ops` + `/cdp` | `/ops` namespace coverage + `/cdp` envelope compatibility |

## Surface Rules

- `rpc` is intentionally CLI-only (internal and unsafe).
- `opendevbrowser_prompting_guide`, `opendevbrowser_skill_list`, and `opendevbrowser_skill_load` are intentionally tool-only.
- Any new stable CLI runtime command must add a matching tool unless explicitly documented as CLI-only.
- Surface counts and command inventories are verified against `docs/SURFACE_REFERENCE.md`.

## Gate Commands

```bash
npm run test -- tests/parity-matrix.test.ts
npm run test -- tests/tools.test.ts tests/daemon-command.test.ts
npm run test -- tests/providers-performance-gate.test.ts
```

## Contract gates vs live release proof

- `tests/parity-matrix.test.ts` is contract coverage for CLI/tool/runtime surface parity.
- `node scripts/provider-direct-runs.mjs --release-gate --out artifacts/release/vX.Y.Z/provider-direct-runs.json` and `node scripts/live-regression-direct.mjs --release-gate --out artifacts/release/vX.Y.Z/live-regression-direct.json` are the live release-proof lane.
- Treat grouped contract checks and direct-run release proof as complementary, not interchangeable.

## Release Requirement

Ship only when parity tests pass and docs (`README.md`, `docs/CLI.md`, `docs/ARCHITECTURE.md`, `docs/SURFACE_REFERENCE.md`) reflect the same surface map.
Use `docs/RELEASE_RUNBOOK.md` and the current version-scoped release evidence ledger as the release gate source of truth.
