Conversation
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
The remaining risk after the contract-restoration pass was not a broken code path but an ambiguous one: untargeted `interact press` was still supported for compatibility, yet its response copy implied selector-based targeting and it was not locked by explicit harness coverage. This commit makes that compatibility behavior explicit in responses, help text, and docs while adding regression checks for page-level press and invalid strict/nth usage without a target. Constraint: Keep untargeted press backward compatible instead of making press target-only Constraint: Follow the existing public response shape rather than inventing new target sentinel values Rejected: Require a target for every press action | higher safety, but a breaking change to an existing compatibility path Rejected: Leave untargeted press undocumented | keeps the risk of future accidental regression and misleading output Confidence: high Scope-risk: narrow Reversibility: clean Directive: If untargeted press is ever removed, update help/docs/harness in the same change and treat it as a breaking CLI contract change Tested: npm run build; npm test; npm run test:integration Not-tested: Manual untargeted press behavior on non-Chromium browsers or non-open transports
The search and interaction contracts are now validated through unit, integration, docs-build, pack, and publish dry-run lanes, so this version bump marks the first stable cut after the rc series. The bug report template is updated alongside the package metadata so the reported version examples match the released channel. Constraint: Publish workflow requires the GitHub release tag to match package.json exactly Constraint: Stable versions publish to the npm latest tag instead of next Rejected: Keep shipping rc builds | the CLI contracts are now stable enough to make the next stable line the source of truth Rejected: Bump only package.json | would leave package-lock and issue template inconsistent with the release line Confidence: high Scope-risk: narrow Reversibility: clean Directive: Future stable releases should update package metadata, release tag, and user-facing version examples in the same change Tested: npm run build; npm test; npm run test:integration; npm run docs:build; npm pack --dry-run; npm publish --dry-run Not-tested: End-to-end npm publish from GitHub release until the release is actually created from main
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec8d961c85
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| selector: targetKeys.includes("selector") && options.selector ? String(options.selector) : undefined, | ||
| text: targetKeys.includes("text") && options.text !== undefined ? String(options.text) : undefined, | ||
| targetText: targetKeys.includes("targetText") && options.targetText !== undefined ? String(options.targetText) : undefined, | ||
| role: targetKeys.includes("role") && options.role ? String(options.role) : undefined, |
There was a problem hiding this comment.
Treat empty selector/role as missing interact target
collectTargetingPayload considers a target present when the option is merely non-null, but this return block drops selector/role unless they are truthy. As a result, --selector '' (or an empty env-expanded role) passes the new target validation and then sends no target in the payload. For interact type this skips the intended CLI-side validation and only fails after a session call; for interact press it can degrade into an untargeted page-level keypress, which breaks the documented requirement that target modifiers apply only with an explicit target.
Useful? React with 👍 / 👎.
Summary
interact presscompatibility without breaking the API surface0.1.35-rc.3to0.2.0Validation
npm run buildnpm testnpm run test:integrationnpm run docs:buildnpm pack --dry-runnpm publish --dry-runNotes
latesttag for0.2.0.omx/andPERF_VALIDATION.mdwere intentionally excluded