Skip to content

Stabilize CLI contracts and cut 0.2.0#13

Merged
Ring-wdr merged 3 commits intomainfrom
fix/post-rc3-cli-contracts
Mar 26, 2026
Merged

Stabilize CLI contracts and cut 0.2.0#13
Ring-wdr merged 3 commits intomainfrom
fix/post-rc3-cli-contracts

Conversation

@Ring-wdr
Copy link
Owner

Summary

  • restore and lock the post-rc3 search and interaction contracts
  • clarify untargeted interact press compatibility without breaking the API surface
  • promote the package from 0.1.35-rc.3 to 0.2.0

Validation

  • npm run build
  • npm test
  • npm run test:integration
  • npm run docs:build
  • npm pack --dry-run
  • npm publish --dry-run

Notes

  • publish workflow will use the npm latest tag for 0.2.0
  • local-only .omx/ and PERF_VALIDATION.md were intentionally excluded

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
@Ring-wdr Ring-wdr merged commit 6e77a15 into main Mar 26, 2026
4 checks passed
@Ring-wdr Ring-wdr deleted the fix/post-rc3-cli-contracts branch March 26, 2026 10:49
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +141 to +144
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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant