Repository navigation
Description
Problem & intent
New report: /Users/new/Developer/GitHub/MAWS/plugin/cua/dogfood-feedback/l6-artifacts.md, extra-slot item 13: selectText on a ProseMirror document selected an offset passage instead of the requested phrase; coordinate drag selected the intended range. Verdict: plausible range-space mismatch; list markers/callout labels are the reporter’s hypothesis, not established root cause.
At d95261f, native/engine/Sources/Engine/TextSelection.swift reads the target element’s own AXValue and optional attributed string; matches rendered Markdown with source mapping or falls back to plain UTF-16 indices, then writes AXSelectedTextRange on that same element. It does not verify the selected substring afterward. Therefore “it searches a global document value instead of the element” is not supported; differing AX string/range spaces or rich-editor representation remain plausible.
This finding shares the select_text contract with open #190 (not-found/refusal wording) and #194 (minimized successful-write/read-back). Rather than let a third independent patch alter this contract, this ticket owns their coordinated contract review together with the new rich-editor range case. The existing findings remain distinct, not duplicates.
Constraints
Do not silently alter #190’s oracle or declare #194’s successful writes failures. No automatic document replacement/deletion following uncertain selection. Preserve prefix/suffix disambiguation, UTF-16 units, background driving and unsupported-readback behavior. No owner GUI or content needed.
Success criteria
- Establish shared select_text rules for source text, source-to-range mapping, write acceptance, observed selected text/range and explicit unknown read-back.
- Reproduce with an owned ProseMirror-style fixture containing lists, callouts, inline styles and surrogate pairs; compare AXValue, attributed text, AXSelectedTextRange and selected substring independently.
- Repair demonstrated offset errors or refuse an unsupported mapping before a destructive follow-up; never treat a successful AX write as proof the intended substring was selected.
- Reconcile Reconcile Chrome selectText.notText refusal wording with its expected contract #190 and Fix minimized TextEdit selection read-back without refusing the successful AX write #194 as bounded slices of this contract and record which tests each owns, avoiding competing rewrites.
- Include ambiguous matches, cursor-before/after, minimized exposed elements and unavailable read-back.
Open questions
Does the browser expose a different AX range coordinate space, stale attributed value, synthetic marker text, or a faulty source map? Do not select a fix without the fixture evidence.
Decision log
2026-10-23: Read #190/#194 and searched selectText range/TextSelection.swift. This is the third finding on the same contract, so the new finding and required consolidation are registered together rather than another isolated patch. Category bug; state ready-for-architect; parent N/A; blocked-by N/A.
Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
Activity