fix(bridge): verify typed native value readbacks #815
<!-- clawsweeper-pr-ack:opened item=815 -->
🦞👀
ClawSweeper picked this up.
Pull request received. I will update this pull request when review starts.
<!-- clawsweeper-review-progress:start -->
ClawSweeper review complete
ClawSweeper finished reviewing this revision. The review result is being finalized.
View the workflow run.
<!-- clawsweeper-review-progress:end -->
PR Summary
<!-- CURSOR_SUMMARY -->
Medium Risk
Changes signed Bridge set-value receipt binding and native mutation verification semantics; malformed witnesses are rejected, but regressions could affect remote value mutations and retry safety.
Overview
Fixes cases where native accessibility set-value succeeded but Bridge rejected the result because newValue had to exactly match the request (e.g. slider readback 57.99999999999999 vs requested 58).
Native automation now attaches an optional ElementValueVerification witness (resolved kind, tagged readback, legacy presentation) on value and selected-only mutations, with shared coercion/comparison in ElementValueMutationSemantics. Bridge binds signed setValue responses to that witness when clients negotiate setValueVerification (protocol ≥1.37); without it, exact-string binding remains. Responses are validated before legacy projection strips the witness and restores historical presentation for old decoders.
Coercion is tightened: integer strings use exact decimal/scientific parsing (no lossy Double), fractional Boolean readbacks fail verification, and text fields stay literal. CI adds native and Bridge contract suites; docs and changelog describe the behavior.
<sup>Reviewed by Cursor Bugbot for commit 003eee48f2c07e53f3b75f28023361ee962d3a1e. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>
<!-- /CURSOR_SUMMARY -->
Legacy readback contract rejects integral doubles
Medium Severity
<!-- DESCRIPTION START -->ElementValueReadback.displayString renders an integral double as an integer string, and the host now copies that into newValue. After projectingSetValueVerification drops the witness, Bridge still requires newValue to equal the request's own displayString, so a literal "58.0" request fails even when the native readback was exactly 58.0. The write can succeed on the host while an older or receiptless client rejects the signed result.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: e97bcf63-72bf-474d-8212-c9390656544c -->
<!-- LOCATIONS START
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/Core/Protocols/ElementValueVerification.swift#L30-L33
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/UI/UIAutomationService+ElementActions.swift#L86-L88
Core/PeekabooCore/Sources/PeekabooBridge/PeekabooBridgeOperationResultContracts.swift#L760-L763
LOCATIONS END -->
<details>
<summary>Additional Locations (2)</summary>
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/UI/UIAutomationService+ElementActions.swift#L86-L88Core/PeekabooCore/Sources/PeekabooBridge/PeekabooBridgeOperationResultContracts.swift#L760-L763</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmVhNTMwYjEzLWMxODctNGYyMC05YzQxLWY2MDc1YzE5MGY0MiIsImVuY3J5cHRpb25LZXkiOiJOWVZUdG9MVDc0WnhZN3oweU9Dd2hfbVo5UTZWYWRsSXpmYWpwVm9uY1d3IiwiYnJhbmNoIjoiY29kZXgvc2V0LXZhbHVlLXJlYWRiYWNrLXdpdG5lc3MiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmVhNTMwYjEzLWMxODctNGYyMC05YzQxLWY2MDc1YzE5MGY0MiIsImVuY3J5cHRpb25LZXkiOiJOWVZUdG9MVDc0WnhZN3oweU9Dd2hfbVo5UTZWYWRsSXpmYWpwVm9uY1d3IiwiYnJhbmNoIjoiY29kZXgvc2V0LXZhbHVlLXJlYWRiYWNrLXdpdG5lc3MiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwck51bWJlciI6ODE1LCJjb21taXRTaGEiOiIzOWRjNDc3YmFlMzgyOGU2M2M0MmRkNzZiZTVjMjg5ZmRkMWQ2ZjU2IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit 39dc477bae3828e63c42dd76be5c289fdd1d6f56. Configure here.</sup>
<!-- BUGBOT_REVIEW -->
<!-- BUGBOT_REVIEW_STALE -->
Stale Bugbot comment from a previous run.
Codex review: needs maintainer review before merge. _Reviewed September 25, 2026, 4:04 PM ET / 20:04 UTC (Revision 5)._
ClawSweeper review
What this changes
The branch carries typed native set-value readbacks through Bridge signed results, preserves older clients’ response format, and adds regression tests, CI coverage, and documentation.
Merge readiness
✅ Ready for maintainer review
Keep open. Current main still rejects a rounded value that native automation can verify. The current PR head has production-path receipt proof, and the earlier Boolean-readback finding has been addressed. No remaining actionable defect was established.
Priority: P2
Reviewed head: 003eee48f2c07e53f3b75f28023361ee962d3a1e
Review scores
| Measure | Result | What it means |
|---|---|---|
| Overall readiness | 🦞 diamond lobster (5/6) | The patch has focused boundary checks, compatibility coverage, and an exact-head production transport trace; its native desktop qualification remains outside the supplied proof. |
| Proof confidence | 🦞 diamond lobster (5/6) | Sufficient (terminal): The exact-head terminal trace exercises a real Bridge host and client over a private socket with injected automation: valid readbacks yield checked signed receipts, while three invalid readbacks fail without a retained or archived receipt. Native tests supplement that transport proof; live Accessibility and default permissions were not exercised. Existing-style receipt and old-decoder digest tests support stored-result compatibility. |
| Patch quality | 🦞 diamond lobster (5/6) | No actionable review findings were identified. |
Verification
| Check | Result | Evidence |
|---|---|---|
| Real behavior | Verified | Sufficient (terminal): The exact-head terminal trace exercises a real Bridge host and client over a private socket with injected automation: valid readbacks yield checked signed receipts, while three invalid readbacks fail without a retained or archived receipt. Native tests supplement that transport proof; live Accessibility and default permissions were not exercised. Existing-style receipt and old-decoder digest tests support stored-result compatibility. |
| Evidence reviewed | 7 items | Current-main gap: Fetched main still requires an exact set-value presentation and has no typed witness file; its native setter already permits floating-point readbacks within tolerance.<br>Native verification: The setter captures the readback from the write and constructs the witness from that observation; postvalidation uses the same witness rather than taking another read.<br>Signed-result boundary: Bridge binds a present witness to the original request, action, target, and displayed readback; absent witnesses retain exact legacy matching. The host validates before removing a witness for non-offering clients and before signing. |
| Findings | None | None. |
| Security | None | None. |
How this fits together
Peekaboo’s CLI and MCP set-value requests reach a macOS Accessibility element through native automation, sometimes via Bridge. Bridge checks the host’s result before reporting the write as verified and issuing a signed receipt.
flowchart LR
A[CLI or MCP value request] --> B[Bridge client]
B --> C[Authenticated session and capability]
C --> D[Bridge host]
D --> E[Native Accessibility setter]
E --> F[Typed readback check]
F --> G[Signed result or legacy response]
Before merge
None.
<details>
<summary><strong>Agent review details</strong></summary>
Security
None.
Review metrics
| Metric | Value | Why it matters |
|---|---|---|
| Swift source and test growth | production +315 net lines, tests +1446 net lines | The production growth implements a shared witness and comparison policy; most added lines cover native, wire, and host/client behavior. |
Technical review
Best possible solution:
Keep native coercion and readback comparison in one policy, let capable Bridge clients use the typed witness, and preserve exact legacy response binding.
Do we have a high-confidence way to reproduce the issue?
Yes, from source: native verification allows a slider request for 58 to read back 57.99999999999999, while current main’s Bridge binder requires an exact presentation. I did not execute a live desktop reproduction.
Is this the best way to solve the issue?
Yes. The shared native comparison and typed witness repair that mismatch without applying numeric-string tolerance to literal text, while legacy projection preserves older clients’ exact contract.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning high; reviewed against b1d3bb62a366.
Labels
Label changes:
No label changes.
Label justifications:
P2: This repairs a bounded Bridge set-value failure without evidence of a broader runtime outage.merge-risk: 🚨 compatibility: Integer-control hexadecimal strings that incidentally worked before will be refused; the collaborator explicitly accepted and documented that upgrade change.merge-risk: 🚨 security-boundary: Typed evidence now participates in deciding whether a remote result receives a signed success receipt, a boundary covered by negative receipt and tampering tests.rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The exact-head terminal trace exercises a real Bridge host and client over a private socket with injected automation: valid readbacks yield checked signed receipts, while three invalid readbacks fail without a retained or archived receipt. Native tests supplement that transport proof; live Accessibility and default permissions were not exercised. Existing-style receipt and old-decoder digest tests support stored-result compatibility.proof: sufficient: Contributor real behavior proof is sufficient. The exact-head terminal trace exercises a real Bridge host and client over a private socket with injected automation: valid readbacks yield checked signed receipts, while three invalid readbacks fail without a retained or archived receipt. Native tests supplement that transport proof; live Accessibility and default permissions were not exercised. Existing-style receipt and old-decoder digest tests support stored-result compatibility.Evidence
What I checked:
Core/PeekabooCore/Sources/PeekabooBridge/PeekabooBridgeOperationResultContracts.swift:760, b1d3bb62a366)Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/UI/ActionInputDriver.swift:458, 003eee48f2c0)Core/PeekabooCore/Sources/PeekabooBridge/PeekabooBridgeOperationResultContracts.swift:760, 003eee48f2c0)Core/PeekabooCore/Tests/PeekabooTests/PeekabooBridgeSetValueHostClientTests.swift:67, 003eee48f2c0)Core/PeekabooCore/Tests/PeekabooBridgeTests/PeekabooBridgeSetValueVerificationWireTests.swift:112, 003eee48f2c0)docs/commands/set-value.md:28, 003eee48f2c0)Likely related people:
Rating scale
| Score | Internal tier | Crab rank | Meaning |
|---:|:---:|---|---|
| 6/6 | S | 🦀 challenger crab | Exceptional readiness |
| 5/6 | A | 🦞 diamond lobster | Very strong readiness |
| 4/6 | B | 🐚 platinum hermit | Good normal PR; ordinary maintainer review |
| 3/6 | C | 🦐 gold shrimp | Useful, but confidence is limited |
| 2/6 | D | 🦪 silver shellfish | Proof or implementation needs work |
| 1/6 | F | 🧂 unranked krab | Not merge-ready |
| N/A | NA | 🌊 off-meta tidepool | Rating does not apply |
Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.
Workflow
@clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.@clawsweeper review to request a fresh review only.@clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.@clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.History
<details>
<summary>Review history (4 earlier review cycles)</summary>
<!-- clawsweeper-review-history v=1 total=4 -->
</details>
</details>
<!-- clawsweeper-verdict:needs-human item=815 sha=003eee48f2c07e53f3b75f28023361ee962d3a1e confidence=high updated_at=2026-09-25T20:02:55Z reviewed_at=2026-09-25T20:04:42.763Z lease_owner=github-run-36183268958-1 lease_comment_id=5838674230 source_revision=5acbd5189a6a884b7e9ef78a98db624665177f5405bde598ee01594a42d7eebf live_verification=absent -->
<!-- clawsweeper-review-state:ready item=815 sha=003eee48f2c07e53f3b75f28023361ee962d3a1e v=1 -->
<!-- clawsweeper-review-version item=815 reviewed_at=2026-09-25T20:04:42.763Z sha=003eee48f2c07e53f3b75f28023361ee962d3a1e source_revision=5acbd5189a6a884b7e9ef78a98db624665177f5405bde598ee01594a42d7eebf lease_owner=github-run-36183268958-1 lease_comment_id=5838674230 v=1 -->
<!-- clawsweeper-review item=815 -->
<!-- BUGBOT_REVIEW -->
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
<!-- BUGBOT_FIX_ALL -->
<a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo4MWM1YmEwZi01ZTBhLTQ2N2ItYTk0NC00ZTI2YTI3YjM0YTciLCJlbmNyeXB0aW9uS2V5IjoidDhHQTRkTlZCdHBITGkyS3FzSGhURFhPa0ltdkRMNXMwaVdsQU5zS1RfUSIsImJyYW5jaCI6ImNvZGV4L3NldC12YWx1ZS1yZWFkYmFjay13aXRuZXNzIiwicmVwb093bmVyIjoib3BlbmNsYXciLCJyZXBvTmFtZSI6IlBlZWthYm9vIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
<!-- /BUGBOT_FIX_ALL -->
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
<sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.</sup>
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->
<sup>Reviewed by Cursor Bugbot for commit 9dada4c1b4f6fcf02b2cb5618c26fa593cc57574. Configure here.</sup>
Zero-one values break old clients
High Severity
<!-- DESCRIPTION START -->
Legacy projection replaces newValue with legacyPresentation from describe(), and that helper’s Bool-first NSNumber cast turns native 0 and 1 into false/true. Older clients still require an exact match to the requested display string, so attested set-value of 0 or 1 fails after the write already succeeded.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: f41ecde6-5387-41cc-a887-4b6820cb0358 -->
<!-- LOCATIONS START
Core/PeekabooCore/Sources/PeekabooBridge/PeekabooBridgeResponse+SetValueVerification.swift#L7-L21
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/Core/Protocols/ElementValueVerification.swift#L188-L198
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/UI/ActionInputDriver.swift#L451-L476
LOCATIONS END -->
<details>
<summary>Additional Locations (2)</summary>
Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/Core/Protocols/ElementValueVerification.swift#L188-L198Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/UI/ActionInputDriver.swift#L451-L476</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmE1NDA4OTU0LTA3NTctNDlhOS1iYWVmLTQ5NjEyZDQwOWFiMyIsImVuY3J5cHRpb25LZXkiOiJsQlNlb3FtOVQ5VFQwc1RVdTc3UHZHR1hDRXVLai00M0o0SG8xZ3hMcmdZIiwiYnJhbmNoIjoiY29kZXgvc2V0LXZhbHVlLXJlYWRiYWNrLXdpdG5lc3MiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmE1NDA4OTU0LTA3NTctNDlhOS1iYWVmLTQ5NjEyZDQwOWFiMyIsImVuY3J5cHRpb25LZXkiOiJsQlNlb3FtOVQ5VFQwc1RVdTc3UHZHR1hDRXVLai00M0o0SG8xZ3hMcmdZIiwiYnJhbmNoIjoiY29kZXgvc2V0LXZhbHVlLXJlYWRiYWNrLXdpdG5lc3MiLCJyZXBvT3duZXIiOiJvcGVuY2xhdyIsInJlcG9OYW1lIjoiUGVla2Fib28iLCJwck51bWJlciI6ODE1LCJjb21taXRTaGEiOiI5ZGFkYTRjMWI0ZjZmY2YwMmIyY2I1NjE4YzI2ZmE1OTNjYzU3NTc0IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit 9dada4c1b4f6fcf02b2cb5618c26fa593cc57574. Configure here.</sup>
Checked against the actual native baseline and addressed the compatibility class in 9dada4c1b4f6fcf02b2cb5618c26fa593cc57574. Native AX values are boxed CFNumbers/NSNumbers. The old safeValueDescription checks Bool, then Int, before Double, so native NSNumber(58.0) already rendered as "58" on e3463aba4; the literal numeric-control request "58.0" was already rejected by the old exact binder. Text-field strings remain literal on both paths.
There was a real related regression for native numeric 0/1 and Boolean requests. The repair captures legacyPresentation from the same raw observation, validates it and the original typed request before projection, then restores it only for non-offering clients. Raw Swift Double/Float spellings and signed zero are also covered. The native suite passes 26 declarations/55 cases and the Bridge suites pass 18 tests, including the previously failing compatibility case and signed old-decoder byte checks. No request text is copied into the observed value.
This exact non-offering-client behavior is pre-existing, not introduced by the repair. On e3463aba4, the default native value reader already used the same Bool-first formatter: native numeric 0/1 rendered as "false"/"true". Consequently, the old exact binder rejected numeric requests whose display strings were "0"/"1", while Boolean false/true requests could succeed.
The current projection intentionally preserves that old contract. Normalizing the old-client result to 0/1 would break those previously successful Boolean requests. Current offering clients use the attested typed readback and accept the native numeric verification; non-offering clients retain exact legacy matching. The new regression first failed for the native Boolean requests and now passes, and separate tests reject fabricated legacy rendering or attempts to bypass typed request validation before stripping.
The baseline formatter was moved unchanged into the shared helper; it was not newly introduced here: https://github.com/openclaw/Peekaboo/blob/e3463aba4f221974e8df2385266368e12c1ee020/Core/PeekabooAutomationKit/Sources/PeekabooAutomationKit/Services/UI/UIAutomationService%2BElementActions.swift#L396
Accepted the fractional-Boolean finding. This was inherited native behavior, but the old Bridge exact-string check rejected the resulting presentation; the new typed witness must not promote that mismatch into signed success. The fix belongs in the shared native comparison owner: actual Boolean or exact numeric 0/1 only, with no truncation or tolerance for Boolean readbacks.
Regression tests now reproduce the native and signed failures before the fix. The same audit found lossy integer-string fallback through Double (for example, a large decimal integer rounding to its neighbor), which is being replaced with bounded exact decimal/scientific integer conversion. Literal text and floating-point control semantics remain separate.
This PR remains held until those repairs pass native, signed-wire, and an inert production host/client signing-path harness, followed by full-candidate review and fresh exact-head CI. The harness uses synthetic automation and a private local socket; it does not claim live desktop or all-app parity. The unrelated hosted library filesystem failure is also preserved, and assertions will not be weakened for that failure.
The final-head PR body now includes the captured production host/client output and a link to the passing exact-head Core CI job. All three injected invalid observations produced DesktopActionFailure with retained=false, archived=false; the same passing test checks all three allowed signed receipts and their attestation/integrity. The source/transport proof is explicitly synthetic, not live AX or default TCC qualification.
Maintainer decision: accept the documented exact decimal/scientific integer-input restriction. Baseline docs/help/schema do not promise hexadecimal input. The previous floating-point fallback could round hexadecimal integers as well, so it should not be retained as a compatibility path. Callers using hexadecimal strings for integer-resolved controls must supply an exact decimal equivalent or a typed integer without converting through floating point. This is an intentional upgrade change, not a claim of universal external-client compatibility.
No production or test source changed after the reviewed 003eee48f2c07e53f3b75f28023361ee962d3a1e head.
@clawsweeper re-review
<!-- clawsweeper-command-ack:5838627895 -->
<!-- clawsweeper-command-status:815:re_review:command-5838627895-muhdrkwo-c5b2b5aa82a17ca7eff7ac2fd398be9686572dacbacda834857b40b967354b56 -->
🦞👀
Exact review queued.
<!-- clawsweeper-command-progress:start -->
Re-review progress:
<!-- clawsweeper-command-progress:end -->
Landed as 4f584990748f7e46687b396d1ec382af2af0ff81 after verifying the exact reviewed head 003eee48f2c07e53f3b75f28023361ee962d3a1e and its merge tree. Visible main was pulled without recursing into submodules; the landed tree exactly matches the locally tested combined tree below.
Native verification and signed Bridge binding now share one scalar comparison owner and the same typed observation. This removes the redundant post-verification AX read and fixes rounded numeric or selected-only observations being rejected merely because their rendered text/action differed. Authenticated capability negotiation and validated old-client projection preserve the existing witness-free receipt contract.
Review also caught a real inherited truncation hazard: fractional numeric readbacks could masquerade as Boolean success. That is now exact Boolean or numeric 0/1 only. Integer string coercion no longer passes through lossy floating point. The intentional exact decimal/scientific contract and hexadecimal migration guidance are documented in this PR.
Verification at the final head:
The earlier superseded-head library failure showed widespread hosted filesystem EIO writes, including unchanged tests and later manifests; it was not established to be disk-full. No assertions were weakened for it. The final-head replacement passed. This does not claim live AX effects, default GUI trust/TCC, separate-process isolation, or full desktop parity. The Unreleased changelog and command/Bridge documentation are included; no release publication.
An additional local combined-tree pass with #814 tested tree 3d980d51f2ce2d541135f6564ede7cd0ed03e3c6: 37 declarations / 40 expanded cases passed. All committed submodules, all 14 resolved dependency revisions, and the cache's source paths were verified. The second command reused the artifacts built by the first. These commands ran from the task-owned combined worktree with /bin/bash and login disabled:
set -o pipefail
PEEKABOO_INCLUDE_AUTOMATION_TESTS=false PEEKABOO_INCLUDE_AMBIENT_STATE_TESTS=false PEEKABOO_RUN_INPUT_AUTOMATION_TESTS=false RUN_AUTOMATION_READ=false RUN_LOCAL_TESTS=false INTEGRATION_TESTS=0 swift test --package-path Core/PeekabooCore --scratch-path /private/tmp/peekaboo-current-performance-cleanup/Core/PeekabooCore/.build --skip-update --disable-automatic-resolution --no-parallel --jobs 4 --filter '^PeekabooBridgeTests[.](PeekabooBridgeSetValueVerificationTests|PeekabooBridgeSetValueVerificationWireTests)/|^PeekabooTests[.]PeekabooBridgeSetValueHostClientTests/' 2>&1 | tee /private/tmp/peekaboo-combined-814-815.MUUCdT-bridge.log
PEEKABOO_INCLUDE_AUTOMATION_TESTS=false PEEKABOO_INCLUDE_AMBIENT_STATE_TESTS=false PEEKABOO_RUN_INPUT_AUTOMATION_TESTS=false RUN_AUTOMATION_READ=false RUN_LOCAL_TESTS=false INTEGRATION_TESTS=0 swift test --package-path Core/PeekabooCore --scratch-path /private/tmp/peekaboo-current-performance-cleanup/Core/PeekabooCore/.build --skip-build --disable-automatic-resolution --no-parallel --filter 'Explicit false mutation dispatch survives failed result summarization|Capture and image traces classify only focus-capable requests as mutations|Native capture success receipt reaches execution trace through the real agent bridge|Trace allowlists audit fields and omits all content-bearing values|Trace replaces arbitrary field names with stable ordinals at every object depth|SnapshotInvalidationMetadataTests|Browser tool legacy client refuses connect and mapped mutation without outcomes|Browser tool namespaces provider metadata and strips reserved semantic claims|Browser tool rejects mutation result without canonical outcome|Browser tool allows outcome-free result from read-only provider call|Legacy browser reads cannot promote provider metadata claims|UI element double zero has stable canonical bytes|Bridge JSON double zero has stable canonical bytes recursively|setValue semantic planning follows canonical numeric values without coercing strings' 2>&1 | tee /private/tmp/peekaboo-combined-814-815.MUUCdT-trace-provider-canonical.log
steipete
Summary
A native value mutation can be verified successfully and then rejected by Bridge because the observed presentation is not an exact copy of the requested text. For example, a slider can read back
57.99999999999999after a request for58. Selected-only controls also useAXSelected, whereas the previous Bridge rule requiredAXSetValue.Keep coercion and comparison in the native automation owner, and carry a typed witness from the exact observation that verified the mutation. Bridge uses those shared rules while still checking the target, action, presentation, anchor, canonical outcome, and signed receipt. Text stays literal and integer-typed readbacks retain exact precision; there is no generic numeric-string relaxation. The service no longer performs a second read to construct a potentially different reported value.
The optional witness is negotiated through an authenticated client offer and projected out before signing for older clients. The host captures the historical presentation from the same raw observation and restores it only for non-offering clients, after validating the original typed request and rendering. Missing witnesses retain the existing strict legacy contract; malformed or inconsistent witnesses are rejected. Raw and receiptless response projections remain compatible. This adds no input route, activation, mutation replay, protocol-version bump, or dependency change.
Compatibility review found a real edge: the old native formatter renders boxed numeric
0/1asfalse/true. The repair preserves those successful old-client Boolean requests without treating arbitrary text as numeric. The reported native58.0example already rendered as58on the old path; separate raw Swift/Float and signed-zero forms are covered too.The new signing boundary must not inherit lossy native conversions that the old exact Bridge check happened to mask. Boolean readbacks now require actual Boolean or exact numeric
0/1; fractional values are not truncated. Integer-control string coercion keeps its fast integer path and uses bounded exact decimal/scientific conversion instead of passing through Double. Fractional tails, underflow-to-zero, overflow, malformed forms, and undocumented hexadecimal fallback are refused before writing. Literal text and floating-point control semantics remain separate.Verification
DesktopActionFailure, and left no retained or archived receipt. Own-process identity was supplied explicitly; trust checks were not weakened. This does not test real AX effects, default TCC grants, separate-process isolation, or live desktop parity.Updates Bridge and set-value documentation plus the Unreleased changelog. No release publication.
Final receipt proof and compatibility decision
Captured output from the final
003eee48f2c07e53f3b75f28023361ee962d3a1elocal run is below (build chatter and unrelated suite output omitted; test lines unchanged). The production host/client test checks three positive signed receipts withvalidateIntegrity()and the negotiated attestation, then exercises the three rejected observations shown here. The rejected calls reach the injected provider; none produces a retained or archived receipt. Positive receipts are asserted, not printed individually.The exact-head test defines the observed cases: valid numeric Boolean
0/1and rounded slider57.99999999999999for58; rejected Boolean0.5/1.5and integer text1.0000000000000001observed as1. This is production transport/handshake/signing/receipt proof with synthetic automation and permissions, not live AX, default TCC, or separate-process isolation proof. The final-head Core CI job also passed and runs this same required suite with nonzero-test guards.Maintainer decision for this repair: accept the documented exact decimal/scientific integer-input contract. Baseline docs, CLI help, and MCP schema do not promise hexadecimal strings; their acceptance arose incidentally from the lossy
Doublefallback. Keeping that fallback would preserve the precision defect, while adding a second radix parser would add complexity without an identified documented consumer contract. This intentionally narrows integer-control string input; it is not claimed to be transparent to every external integration. Upgrade affected calls by supplying an exact in-range decimal integer (for example16instead of0x10), or a typed integer through the SDK/MCP. Literal text and floating-point controls retain their distinct semantics. Rejection happens before the write, and existing stored receipts/absent-witness exact matching remain supported.