From 8e1ab25773b87cc370f529366443900777fa1856 Mon Sep 17 00:00:00 2001 From: ring-wdr Date: Thu, 26 Mar 2026 19:36:45 +0900 Subject: [PATCH 1/3] Restore post-rc3 CLI contracts for search and interaction flows This commit lands the contract fixes that were validated against the browser-backed harness and the manual 4310 scenario set. It wires `node search --limit` through the CLI/runtime boundary, restores structured truncation metadata, and makes `interact type` / `interact press` honor `--target-text` and `--role` instead of silently falling back or failing on selector-only assumptions. Constraint: Must preserve the published click/source contracts while extending type/press targeting Constraint: `.omx/` and PERF_VALIDATION.md are local-only and intentionally excluded Rejected: Patch only the runtime search response | CLI still ignored --limit and invalid limit 0 still succeeded Rejected: Add null-target guards only | would mask the missing targeting support instead of fixing it Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep the browser-backed harness aligned with the manual PR-check scenario set whenever interaction contracts change Tested: npm run build; npm test; npm run test:integration; manual 4310 session open/search/source/click/type/press validation Not-tested: Cross-platform manual interaction behavior outside the local Chromium-backed open-session path --- README.md | 10 +- docs/workflows.md | 7 +- scripts/run-integration-harness.mjs | 158 ++++++++++++++++++++++++++++ src/cli.js | 122 +++++++++++++++++---- src/runtime-script.js | 25 ++++- src/server.js | 90 +++++++++++----- test/run-tests.js | 54 ++++++++++ 7 files changed, 405 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 0bf384c..7cb7d92 100644 --- a/README.md +++ b/README.md @@ -159,13 +159,14 @@ rdt profiler export --session demo --compress - Use built-in `interact` commands before reaching for external Playwright helper scripts. - Current supported actions: - `rdt interact click --session (--selector | --text | --role ) [--nth ] [--strict] [--delivery auto|playwright|dom]` - - `rdt interact type --session --selector --text ` - - `rdt interact press --session --key [--selector ]` + - `rdt interact type --session (--selector | --target-text