From 8fad1937bb7b98617ef5d4bf60a6e81052fe3ae9 Mon Sep 17 00:00:00 2001 From: PJ Date: Tue, 18 Aug 2026 20:22:39 +0530 Subject: [PATCH] fix(conformance): g4 reads a doubling out of what the field grew by The whole-value check misses a driver that typed the value twice onto content the field already held, which is the append-vs-replace shape the recorded value used to catch before it was redacted. What the field grew by over the snapshot the action was chosen against is the same signal and needs no typed value. Checked against every recorded trace under conformance/runs: 485 traces, 299 of them carrying an InputText, none newly failing. --- conformance/gates.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/conformance/gates.sh b/conformance/gates.sh index 6208cce..29664ef 100755 --- a/conformance/gates.sh +++ b/conformance/gates.sh @@ -164,9 +164,10 @@ gate_clear_state() { # placeholder (internal/verifier/redaction.go), and android reports that fact # for nothing, so on that backend every InputText records the placeholder. The # OBSERVED value is never redacted, and a field holding one string twice over is -# the doubling itself. A value that is a single character repeated is exempt: -# the input corpus types "a" 4096 times and a pair of spaces, and neither can be -# told apart from its own doubling. +# the doubling itself, whether that is the whole value or what the value grew by +# over the snapshot the action was chosen against. A value that is a single +# character repeated is exempt: the input corpus types "a" 4096 times and a pair +# of spaces, and neither can be told apart from its own doubling. gate_no_doubled_text() { local run_directory="$1" local trace_file="${run_directory}/trace.jsonl" @@ -200,10 +201,16 @@ gate_no_doubled_text() { | ($current.next_action.text // "") as $typed | (($next.hierarchy.elements // []) | map(select(.resourceId == $field)) | first) as $element + | (($current.hierarchy.elements // []) + | map(select(.resourceId == $field)) | first) as $before | if $element != null then (($element.attrs.text // $element.text // "")) as $value + | (($before.attrs.text // $before.text // "")) as $previous + | (if $previous != "" and ($value | startswith($previous)) + then $value[($previous | length):] else "" end) as $appended | if self_doubled($value) + or self_doubled($appended) or ($typed != "" and $typed != $redacted and ($value | contains($typed + $typed))) then . + [{field: $field, value: $value}]