|
1 | 1 | # Verification: Confirm a paste into an empty-looking web editor whose placeholder disappears |
2 | 2 |
|
3 | | -**Status:** draft |
4 | | -**Approved-by:** — |
5 | | -**Approved-date:** — |
| 3 | +**Status:** approved |
| 4 | +**Approved-by:** Owner, chat answer "批准" (2026-11-04 11:17 UTC+8), accepting the residual risk of the waived hardware run; merge of #144 and the v0.0.63 tag authorized |
| 5 | +**Approved-date:** 2026-11-04 |
6 | 6 | **Upstream:** [plan.md](plan.md) |
7 | 7 |
|
8 | | -Not started. Batch 0 (read-only measurement) is recorded in the spec and in `evidence/batch0-shapes.txt`; nothing has |
9 | | -been implemented, so nothing here shows the fix works yet. |
| 8 | +The automated half is done. **The hardware matrix was not run**: the owner chose not to test and delegated the |
| 9 | +judgement (see "Hardware verification"). This file proves the rule against the measured shapes, not a live ChatGPT |
| 10 | +dictation. That is a stated, owner-accepted residual risk. |
| 11 | + |
| 12 | +## What was implemented (plan items A–E) |
| 13 | + |
| 14 | +| Item | Result | |
| 15 | +|---|---| |
| 16 | +| A. `DeliveryExpectation.acceptedDocuments` | Done. The primary expected document is kept; for an empty-looking web content editor at range `(0, 0)` with a non-empty replacement, the replacement alone is a second accepted value. The original document is filtered out of the set, so an unchanged field is never accepted. The lone-`"\n"` rule is unchanged. | |
| 17 | +| B. `DeliveryTextObservation` | Done. `observe(accepting:)` takes the set, polls as before (25 ms, 3 s) and returns the last readable value; `confirm` is a thin wrapper with the old signature. | |
| 18 | +| C. `NativeDeliveryTarget` | Done. `confirm` and `insertionAnchor` use the accepted set; no new write path. | |
| 19 | +| D. Counts-only diagnostic (D5) | Done. On a timeout `DeliveryShapeDiagnostic.summary` produces numbers and flags only, logged once as `Delivery unconfirmed shape: …` when the receipt is `uncertain`. | |
| 20 | +| E. Mutation checks | Done, see below. | |
| 21 | + |
| 22 | +## Automated evidence |
| 23 | + |
| 24 | +- `swift test` on this branch: 631 tests, 26 skipped, 0 failures (second full run). |
| 25 | +- First full run had 1 failure in `VoiceEditingNativeE2EPresentationTests.testRealSession…NativePointerRestores…`, a |
| 26 | + real-window test that clicks with a real pointer and asserts the frontmost application is unchanged at the end. At |
| 27 | + the end of that run another app (Feishu) was frontmost instead of the one that started it. The same test passed on |
| 28 | + the base commit without these changes, then passed twice on this branch, and the full suite then passed. This is |
| 29 | + recorded as environmental interference with a real-pointer test, not proven as such; the cause was not isolated. |
| 30 | +- `bash scripts/ci-basic-checks.sh`: passed. `bash scripts/sdlc-checks.sh`: passed. |
| 31 | +- Mutation checks, each run with `swift test --filter UtterMacServicesTests.DeliveryExpectationTests` and restored |
| 32 | + afterwards (the restored suite passes): |
| 33 | + |
| 34 | +| Mutation | Suite result | Failing tests point at | |
| 35 | +|---|---|---| |
| 36 | +| Never add the replacement-only candidate | failed | the measured empty-composer shape and the draft-with-line-feed case | |
| 37 | +| Drop the `(0, 0)` guard | failed | the "no extra candidate away from the start" cases | |
| 38 | +| Drop the "never accept the original" filter | failed | the unchanged-field case and the delete case (an empty replacement would otherwise accept the original) | |
| 39 | +| Drop the web-content-editor guard | failed | the native-editor case | |
| 40 | + |
| 41 | +## Not covered by unit tests |
| 42 | + |
| 43 | +- The AX-bound wiring in `NativeDeliveryTarget` (reading the live field, anchoring a restore) has no unit test: it |
| 44 | + needs a real focused element. The pure rule, the observation loop and the diagnostic are covered; the wiring is |
| 45 | + covered only by the hardware matrix below. |
| 46 | +- Multi-paragraph text in ChatGPT, ChatGPT in a browser tab, and the second cause of `uncertain` (T3 with text before |
| 47 | + the caret). The diagnostic is there to measure the latter; no fix is claimed. |
| 48 | + |
| 49 | +## Hardware verification (spec Batch 3) — NOT RUN, owner waived |
| 50 | + |
| 51 | +The spec asked for a verifier who is not the implementer, on a release-style build of this branch, with the installed |
| 52 | +Utter 0.0.62 replaced for the run. |
| 53 | + |
| 54 | +| Case | Runs | Result | |
| 55 | +|---|---|---| |
| 56 | +| ChatGPT, empty composer | 10 | not run | |
| 57 | +| ChatGPT, caret at end of existing text | 10 | not run | |
| 58 | +| ChatGPT, caret in the middle | 5 | not run | |
| 59 | +| Cursor, T3, Dia, TextEdit unchanged | 1 each | not run | |
| 60 | +| Forced non-landing case still reports `uncertain` | 1 | not run | |
| 61 | + |
| 62 | +Verifier: the implementing assistant. **Waivers:** the owner waived an independent verifier and allowed the installed |
| 63 | +Utter 0.0.62 to be replaced for the run, with the owner re-granting permissions afterwards (chat answer "批准", |
| 64 | +2026-11-03 23:28 UTC+8). Later the owner answered "你凭根据感觉来搞吧,不要我实测了" (2026-11-04 02:44 UTC+8): no |
| 65 | +owner testing, judgement delegated. The verification stage itself still needs the owner's approval. |
| 66 | + |
| 67 | +### Judgement in place of the run (assistant's, not evidence) |
| 68 | + |
| 69 | +- The accepted value for the empty composer is the exact shape recorded from the owner's ChatGPT in |
| 70 | + `evidence/batch0-shapes.txt` (12 units before, the replacement alone after); the rule is pinned to those numbers by |
| 71 | + tests and four mutation kills, and it never accepts the original value, so an unchanged field still ends `uncertain`. |
| 72 | +- Anything the rule does not recognise falls back to the old behaviour (`uncertain`), so a wrong guess costs a |
| 73 | + notice, not a wrongly reported insertion. |
| 74 | +- Combined with the compatibility change (no merge conflicts), every test bundle except `OpenTypeTests` passes locally |
| 75 | + and an ad-hoc `0.0.63` app builds; this branch's CI passed on its own head. |
| 76 | +- After release, the first ChatGPT dictation into an empty composer settles it: `inserted` instead of `uncertain`. If |
| 77 | + `uncertain` still appears, the new `Delivery unconfirmed shape:` log line records the numbers to fix it with. |
| 78 | + |
| 79 | +## Rollback |
| 80 | + |
| 81 | +Revert the change commits. The previous behavior is the unconfirmed notice on empty ChatGPT composers. The hidden |
| 82 | +switch `deliveryWebEditorPasteDisabled` also disables the new rule. |
0 commit comments