fix: decode raw JSON locator paths and report field errors - #52
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
PR SummaryLow Risk Overview Command parsing moves into README and Reviewed by Cursor Bugbot for commit 2640158. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 11:33 PM ET / August 29, 2026, 03:33 UTC. ClawSweeper reviewWhat this changesThe branch makes raw JSON locators accept documented path-only navigation hints, preserves detailed decoding errors, clarifies protocol names, and adds regression coverage. Merge readinessThis collaborator-authored PR is a focused candidate fix for the still-open raw JSON decoding report. Source, tests, and the supplied real-CLI evidence support the repair; review the two in-progress checks on this exact head before merging. Priority: P2 Review scores
Verification
How this fits togetherAXorcist’s raw command accepts JSON envelopes from arguments, standard input, or files, decodes them into accessibility commands, and returns structured results. Locator parsing feeds query/action dispatch to the Accessibility library. flowchart LR
Input[Raw JSON input] --> Decode[Protocol decoder]
Decode --> Locator[Locator parsing]
Locator --> Command[Accessibility command]
Command --> Dispatch[AXorcist dispatch]
Dispatch --> Result[JSON result or field error]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the compatible decoder and error-reporting repair after the exact-head checks complete, allowing the linked raw-protocol report to close through the merge. Do we have a high-confidence way to reproduce the issue? Yes. The supplied evidence records real current-main CLI reproduction across JSON argument, standard-input, and file entrypoints, and the added tests map directly to the decoded locator and error paths. Is this the best way to solve the issue? Yes. The patch restores the documented wire format at the decoding boundary and preserves existing command names rather than adding duplicate aliases or changing action behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 87242ce526e4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
The report in #51 exposes two problems hidden by the generic raw JSON error. The human CLI names
tree/findare not protocol commands (collectAll/query), and theirapp/depthoptions are namedapplication/max_depthin JSON. Valid query and action payloads decode on both v0.1.6 and current main; this is not an all-command v0.1.6 regression.There are reproducible locator defects: synthesized decoding requires
criteriaeven for a documented path-only locator, and the CLI's snake-case decoder transformspath_from_rootinto a key that the locator never reads. A malformed array entry also loses its actual error when the CLI retries the entire input as an object.This change decodes path-only locators, preserves navigation hints under both default and snake-case decoding, retains the published
path_from_rootencoding, and reports the failing field path without replacing array-entry errors. README examples and raw help explain the CLI/protocol mapping. It adds no command aliases and does not change action implementations.Proof:
dba24f0) and unmodified main (87242ce) with the real CLI across--json,--stdin, and--file. Valid non-ping commands reach dispatch; path-only locators fail and malformed paths are ignored before the fix.swift test -j 4passed (207 tests reported in the main test target; 5 in the conversion target). Eighteen opt-in UI automation tests were skipped. Independent live Dockquery/collectAllreads succeeded before and after the fix, including both slices of the fixed universal binary.make checkwith the repository-pinned SwiftFormat/SwiftLint,shellcheck scripts/*.sh, andscripts/build-release-artifact.sh 0.1.6 --adhocpassed. Verified archive contents/checksum, both architectures, code signature, version output, and generated Homebrew formula syntax. The artifact was local validation only; no release was published.Fixes #51