Compare commits

..
6 changed files with 424 additions and 12 deletions
@@ -248,6 +248,8 @@ class GoAutoAccessibilityService : AccessibilityService(), UiDriver, PddCollecto
checked = node.isChecked,
enabled = node.isEnabled,
visible = node.isVisibleToUser,
hintText = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) node.hintText?.toString() else null,
showingHintText = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) node.isShowingHintText else null,
)
for (index in 0 until node.childCount) {
node.getChild(index)?.let { snapshot(it, "$path/$index", path) }
@@ -27,6 +27,9 @@ data class SnapshotNode(
val checked: Boolean,
val enabled: Boolean,
val visible: Boolean,
// In-memory accessibility metadata; not part of result or diagnostic payloads.
val hintText: String? = null,
val showingHintText: Boolean? = null,
) {
val label: String get() = text?.trim().takeUnless { it.isNullOrEmpty() }
?: contentDescription?.trim().orEmpty()
@@ -509,16 +509,12 @@ class PurchaseLiveAutomation(
val modify = addressModifyTargets(panel)
if (modify.size != 1) fail("PURCHASE_ADDRESS_EDIT_AMBIGUOUS", "没有找到唯一的地址修改按钮,未创建订单")
click(modify.single(), "修改地址")
val edit = waitFor("PURCHASE_ADDRESS_EDIT_TIMEOUT", "地址编辑页面打开超时,未创建订单") { snapshot ->
snapshot.nodes.any { it.visible && it.label.replace(" ", "").contains("详细地址") }
}
val editors = shippingAddressEditors(edit)
if (editors.size != 1) fail("PURCHASE_ADDRESS_UPDATE_FAILED", "没有找到唯一的详细地址输入框,未创建订单")
val current = editors.single().label.trim()
val editor = waitForInitialAddressEditor()
val current = editor.text.orEmpty().trim()
val body = current.split(Regex("[-_]"), limit = 2).firstOrNull()?.trim().orEmpty()
if (body.isBlank()) fail("PURCHASE_ADDRESS_UPDATE_FAILED", "当前详细地址无效,未创建订单")
val expected = body + suffix
if (driver.inputFresh(editors.single(), expected) != FreshActionResult.SUCCESS) fail("PURCHASE_ADDRESS_UPDATE_FAILED", "详细地址修改失败,未创建订单")
if (driver.inputFresh(editor, expected) != FreshActionResult.SUCCESS) fail("PURCHASE_ADDRESS_UPDATE_FAILED", "详细地址修改失败,未创建订单")
val stable = waitFor("PURCHASE_ADDRESS_INPUT_MISMATCH", "详细地址修改后回读不一致,未创建订单") { snapshot ->
snapshot.nodes.count { it.visible && it.enabled && it.className?.endsWith("EditText") == true && it.label == expected } == 1
}
@@ -539,6 +535,47 @@ class PurchaseLiveAutomation(
return ShippingAddressProof(expected, suffix)
}
/** Initial readiness only; return the same sampled node for the original value and fresh input anchor. */
private fun waitForInitialAddressEditor(): SnapshotNode {
fun isHint(editor: SnapshotNode): Boolean {
val hint = editor.hintText?.trim().orEmpty()
return editor.showingHintText == true || (hint.isNotEmpty() && editor.text?.trim() == hint)
}
var titleSeen = false
var structural = emptyList<SnapshotNode>()
var readyCount = 0
repeat(50) {
val snapshot = driver.capture()
pageProblem(snapshot)
val labels = snapshot.nodes.filter { it.visible && it.label.replace(" ", "").contains("详细地址") }
titleSeen = titleSeen || labels.isNotEmpty()
// Keep the existing same-row/rightward region, but count empty and disabled inputs too.
// Their presence is structural ambiguity, even when just one input is ready.
structural = snapshot.nodes.filter { editor ->
editor.visible && editor.className?.endsWith("EditText") == true &&
labels.any { label ->
editor.bounds.top <= label.bounds.bottom &&
editor.bounds.bottom >= label.bounds.top &&
editor.bounds.left >= label.bounds.left
}
}.distinctBy { it.path }
readyCount = structural.count { it.enabled && !it.text.isNullOrBlank() && !isHint(it) }
if (structural.size == 1 && readyCount == 1) return structural.single()
pause(200)
}
val reason = when {
!titleSeen -> "title_missing"
structural.isEmpty() -> "editor_missing"
structural.size > 1 -> "editor_ambiguous"
!structural.single().enabled -> "editor_disabled"
structural.single().text.isNullOrBlank() -> "editor_empty"
else -> "editor_hint"
}
val diagnostic = "stage=address_editor_ready;reason=$reason;titleSeen=$titleSeen;structural=${structural.size};ready=$readyCount"
if (!titleSeen) fail("PURCHASE_ADDRESS_EDIT_TIMEOUT", "地址编辑页面打开超时,未创建订单 [$diagnostic]")
fail("PURCHASE_ADDRESS_UPDATE_FAILED", "详细地址输入框未就绪,未创建订单 [$diagnostic]")
}
private fun isPurchaseConfirmationPanel(snapshot: UiSnapshot): Boolean {
if (snapshot.packageName != PDD_PACKAGE || shippingAddressEditors(snapshot).isNotEmpty()) return false
val screen = PddScreenParser.parse(snapshot, PurchaseRehearsalExecutor.DEFAULT_COLLECTOR, "", null)
@@ -219,6 +219,338 @@ class PurchaseLiveAutomationTest {
assertFalse(driver.clicked.any { it.contains("支付") })
}
@Test
fun `address editor waits for an input arriving after its title`() {
assertDelayedAddressEditor { snapshot, sample ->
if (sample <= 4) snapshot.copy(nodes = snapshot.nodes.filterNot { it.path == "editor-address" }) else snapshot
}
}
@Test
fun `address editor waits for a populated value`() {
assertDelayedAddressEditor { snapshot, sample ->
snapshot.changeAddressEditor { if (sample <= 4) it.copy(text = " ") else it }
}
}
@Test
fun `address editor description cannot substitute for empty text`() {
for (text in listOf(null, "", " ")) {
assertAddressEditorTimeout("editor_empty", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor { it.copy(text = text, contentDescription = "合成说明占位标记") }
}
}
}
@Test
fun `address editor waits until hint is replaced by real text`() {
assertDelayedAddressEditor { snapshot, sample ->
snapshot.changeAddressEditor {
it.copy(
text = if (sample <= 4) "合成提示占位标记" else it.text,
hintText = "合成提示占位标记",
showingHintText = sample <= 4,
)
}
}
}
@Test
fun `address editor persistent hint text fails after the full budget`() {
assertAddressEditorTimeout("editor_hint", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor {
it.copy(text = "合成提示占位标记", hintText = "合成提示占位标记", showingHintText = true)
}
}
}
@Test
fun `address editor rejects text equal to trimmed hint despite false or absent showing flag`() {
for (showing in listOf(false, null)) {
assertAddressEditorTimeout("editor_hint", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor {
it.copy(text = " 合成提示占位标记 ", hintText = " 合成提示占位标记 ", showingHintText = showing)
}
}
}
}
@Test
fun `address editor showing hint flag blocks nonmatching or missing hint text`() {
for (hint in listOf(null, "", "合成提示占位标记")) {
assertAddressEditorTimeout("editor_hint", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor { it.copy(hintText = hint, showingHintText = true) }
}
}
}
@Test
fun `address editor empty text remains empty even when hint and description are present`() {
assertAddressEditorTimeout("editor_empty", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor {
it.copy(text = " ", contentDescription = "合成说明占位标记", hintText = "合成提示占位标记", showingHintText = true)
}
}
}
@Test
fun `address editor missing hint metadata remains compatible and uses actual text`() {
val driver = LiveDriver(initialEditFrame = { snapshot, _ ->
snapshot.changeAddressEditor {
assertEquals(null, it.hintText)
assertEquals(null, it.showingHintText)
it.copy(text = " 合成真实地址-old ", contentDescription = "合成说明占位标记")
}
})
val proof = PurchaseLiveAutomation(driver, pause = {}).updateShippingAddress("_cg366")
assertEquals("合成真实地址_cg366", proof.expectedAddress)
assertEquals(1, driver.initialEditCaptures)
assertTrue(driver.lastInputTarget === driver.lastInitialEditSnapshot?.nodes?.single { it.path == "editor-address" })
assertAddressEditorActions(driver, saved = true)
}
@Test
fun `address editor accepts actual text with absent false or blank hint metadata`() {
for (showing in listOf(null, false)) {
for (hint in listOf(null, "", " ", "合成提示占位标记")) {
val driver = LiveDriver(initialEditFrame = { snapshot, _ ->
snapshot.changeAddressEditor { it.copy(hintText = hint, showingHintText = showing) }
})
val proof = PurchaseLiveAutomation(driver, pause = {}).updateShippingAddress("_cg366")
assertTrue(proof.expectedAddress.endsWith("_cg366"))
assertEquals(1, driver.initialEditCaptures)
assertAddressEditorActions(driver, saved = true)
}
}
}
@Test
fun `address editor waits for an enabled input`() {
assertDelayedAddressEditor { snapshot, sample ->
snapshot.changeAddressEditor { if (sample <= 4) it.copy(enabled = false) else it }
}
}
@Test
fun `address editor tolerates more than three ambiguous frames before unique readiness`() {
assertDelayedAddressEditor { snapshot, sample ->
if (sample <= 4) snapshot.withSecondAddressEditor() else snapshot
}
}
@Test
fun `address editor uses the value and node from the successful readiness frame`() {
val driver = LiveDriver(initialEditFrame = { snapshot, sample ->
snapshot.changeAddressEditor { it.copy(text = if (sample == 1) "" else "合成地址第${sample}帧-old") }
})
val proof = PurchaseLiveAutomation(driver, pause = {}).updateShippingAddress("_cg366")
assertEquals("合成地址第2帧_cg366", proof.expectedAddress)
assertEquals(2, driver.initialEditCaptures)
assertTrue(driver.lastInputTarget === driver.lastInitialEditSnapshot?.nodes?.single { it.path == "editor-address" })
assertAddressEditorActions(driver, saved = true)
}
@Test
fun `address editor structural ambiguity waits full budget even with only one ready input`() {
for (second in listOf<(SnapshotNode) -> SnapshotNode>(
{ it.copy(text = "") }, { it.copy(enabled = false) },
)) {
assertAddressEditorTimeout("editor_ambiguous", structural = 2, ready = 1) { snapshot, _ ->
snapshot.withSecondAddressEditor(second)
}
}
}
@Test
fun `address editor final zero inputs reports scalar missing reason`() {
assertAddressEditorTimeout("editor_missing", 0, 0) { snapshot, _ ->
snapshot.copy(nodes = snapshot.nodes.filterNot { it.path == "editor-address" })
}
}
@Test
fun `address editor final empty input reports scalar empty reason`() {
assertAddressEditorTimeout("editor_empty", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor { it.copy(text = " ") }
}
}
@Test
fun `address editor final disabled input reports scalar disabled reason`() {
assertAddressEditorTimeout("editor_disabled", 1, 0) { snapshot, _ ->
snapshot.changeAddressEditor { it.copy(enabled = false) }
}
}
@Test
fun `address editor final multiple inputs reports scalar ambiguity reason`() {
assertAddressEditorTimeout("editor_ambiguous", 2, 2) { snapshot, _ -> snapshot.withSecondAddressEditor() }
}
@Test
fun `address editor never seeing a title keeps edit timeout and one shared budget`() {
assertAddressEditorTimeout("title_missing", 0, 0, titleSeen = false) { snapshot, _ ->
snapshot.copy(nodes = snapshot.nodes.filterNot { it.path == "detail" })
}
}
@Test
fun `address editor remembers a title even when the final snapshot is empty`() {
assertAddressEditorTimeout("editor_missing", 0, 0) { snapshot, sample ->
if (sample == 1) snapshot.copy(nodes = snapshot.nodes.filterNot { it.path == "editor-address" })
else snapshot.copy(nodes = emptyList())
}
}
@Test
fun `address editor late title does not start a second wait budget`() {
assertAddressEditorTimeout("editor_empty", 1, 0) { snapshot, sample ->
val emptyEditor = snapshot.changeAddressEditor { it.copy(text = "") }
if (sample < 50) emptyEditor.copy(nodes = emptyEditor.nodes.filterNot { it.path == "detail" }) else emptyEditor
}
}
@Test
fun `address editor can become ready on the final sample of its shared budget`() {
val driver = LiveDriver(initialEditFrame = { snapshot, sample ->
if (sample < 50) snapshot.copy(nodes = emptyList()) else snapshot
})
val editPauses = mutableListOf<Long>()
PurchaseLiveAutomation(driver, pause = {
if (driver.currentPage == "edit" && driver.inputCount == 0) editPauses += it
}).updateShippingAddress("_cg366")
assertEquals(50, driver.initialEditCaptures)
assertEquals(listOf(500L) + List(49) { 200L }, editPauses)
assertAddressEditorActions(driver, saved = true)
}
@Test
fun `address editor excludes recipient phone invisible and leftward inputs and deduplicates paths`() {
val driver = LiveDriver(initialEditFrame = { snapshot, _ ->
val editor = snapshot.nodes.single { it.path == "editor-address" }
snapshot.copy(nodes = snapshot.nodes + listOf(
editor,
editor.copy(path = "hidden-input", visible = false),
editor.copy(path = "left-input", bounds = NodeBounds(0, 390, 10, 480)),
))
})
PurchaseLiveAutomation(driver, pause = {}).updateShippingAddress("_cg366")
assertEquals(1, driver.initialEditCaptures)
assertEquals("editor-address", driver.lastInputTargetPath)
assertAddressEditorActions(driver, saved = true)
}
@Test
fun `address editor small screen row overlap remains ambiguous`() {
assertAddressEditorTimeout("editor_ambiguous", 2, 2) { snapshot, _ ->
snapshot.copy(nodes = snapshot.nodes.map {
if (it.path == "editor-phone") it.copy(bounds = NodeBounds(180, 360, 900, 410)) else it
})
}
}
@Test
fun `address editor fresh input failures never retry or save`() {
for (result in FreshActionResult.values().filter { it != FreshActionResult.SUCCESS }) {
val driver = LiveDriver(inputResult = result)
val error = runCatching { PurchaseLiveAutomation(driver, pause = {}).updateShippingAddress("_cg366") }
.exceptionOrNull() as PurchaseLiveException
assertEquals("PURCHASE_ADDRESS_UPDATE_FAILED", error.code)
assertEquals(1, driver.inputCount)
assertEquals(1, driver.initialEditCaptures)
assertEquals(listOf("138****5678", "修改"), driver.clicked)
assertEquals(0, driver.backCount)
assertEquals(0, driver.scopedSwipes + driver.genericSwipes + driver.submitClicks)
}
}
@Test
fun `address editor page safety problem interrupts readiness without input`() {
val driver = LiveDriver(initialEditFrame = { snapshot, sample ->
if (sample == 1) snapshot.changeAddressEditor { it.copy(text = "") }
else snapshot.copy(nodes = snapshot.nodes.map { if (it.path == "title") it.copy(text = "立即支付") else it })
})
val error = runCatching { PurchaseLiveAutomation(driver, pause = {}).updateShippingAddress("_cg366") }
.exceptionOrNull() as PurchaseLiveException
assertEquals("PURCHASE_PAYMENT_FORBIDDEN", error.code)
assertEquals(2, driver.initialEditCaptures)
assertAddressEditorActions(driver, saved = false)
}
private fun assertDelayedAddressEditor(frame: (UiSnapshot, Int) -> UiSnapshot) {
val driver = LiveDriver(initialEditFrame = frame)
val editPauses = mutableListOf<Long>()
val automation = PurchaseLiveAutomation(driver, pause = {
if (driver.currentPage == "edit" && driver.inputCount == 0) editPauses += it
})
val proof = automation.updateShippingAddress("_cg366")
assertTrue(proof.expectedAddress.endsWith("_cg366"))
assertEquals(5, driver.initialEditCaptures)
assertEquals(listOf(500L, 200L, 200L, 200L, 200L), editPauses)
assertEquals("editor-address", driver.lastInputTargetPath)
assertAddressEditorActions(driver, saved = true)
}
private fun assertAddressEditorTimeout(
reason: String,
structural: Int,
ready: Int,
titleSeen: Boolean = true,
frame: (UiSnapshot, Int) -> UiSnapshot,
) {
val driver = LiveDriver(initialEditFrame = frame)
val diagnostics = mutableListOf<String>()
val editPauses = mutableListOf<Long>()
val automation = PurchaseLiveAutomation(driver, pause = {
if (driver.currentPage == "edit" && driver.inputCount == 0) editPauses += it
}, panelDiagnostic = diagnostics::add)
val failure = runCatching { automation.updateShippingAddress("_cg366") }.exceptionOrNull()
assertTrue("Readiness must fail without changing the address", failure is PurchaseLiveException)
val error = failure as PurchaseLiveException
assertEquals(if (titleSeen) "PURCHASE_ADDRESS_UPDATE_FAILED" else "PURCHASE_ADDRESS_EDIT_TIMEOUT", error.code)
val diagnostic = "stage=address_editor_ready;reason=$reason;titleSeen=$titleSeen;structural=$structural;ready=$ready"
assertTrue(error.message.orEmpty(), error.message.orEmpty().endsWith("[$diagnostic]"))
assertEquals(50, driver.initialEditCaptures)
assertEquals(listOf(500L) + List(50) { 200L }, editPauses)
val emitted = error.message.orEmpty() + diagnostics.joinToString()
listOf("广东", "骏景", "测试收货人", "13800000000", "editor-address", "_cg366", "合成提示占位标记", "合成说明占位标记").forEach {
assertFalse("Sensitive fixture value in readiness diagnostics", emitted.contains(it))
}
assertAddressEditorActions(driver, saved = false)
}
private fun assertAddressEditorActions(driver: LiveDriver, saved: Boolean) {
assertEquals(if (saved) 1 else 0, driver.inputCount)
assertEquals(listOf("138****5678", "修改") + if (saved) listOf("保存") else emptyList(), driver.clicked)
assertEquals(if (saved) 1 else 0, driver.backCount)
assertEquals(1, driver.addressPathClicks)
assertEquals(0, driver.addressTaps + driver.genericSwipes + driver.scopedSwipes + driver.submitClicks)
}
private fun UiSnapshot.changeAddressEditor(change: (SnapshotNode) -> SnapshotNode): UiSnapshot =
copy(nodes = nodes.map { if (it.path == "editor-address") change(it) else it })
private fun UiSnapshot.withSecondAddressEditor(change: (SnapshotNode) -> SnapshotNode = { it }): UiSnapshot =
copy(nodes = nodes + change(nodes.single { it.path == "editor-address" }.copy(path = "editor-address-2")))
@Test
fun `split confirmation address keeps the unique saved task suffix proof`() {
val driver = LiveDriver(splitConfirmationAddress = true)
@@ -788,6 +1120,8 @@ class PurchaseLiveAutomationTest {
private val orderDetailEntryAfterSubmit: Boolean = false,
private val orderDetailEvidenceBelowFold: Boolean = false,
private val duplicateOrderDetailEntry: Boolean = false,
private val initialEditFrame: (UiSnapshot, Int) -> UiSnapshot = { snapshot, _ -> snapshot },
private val inputResult: FreshActionResult = FreshActionResult.SUCCESS,
postSubmitCaptureSequence: List<String> = emptyList(),
) : PurchaseUiDriver {
private var page = "confirmation"
@@ -802,6 +1136,10 @@ class PurchaseLiveAutomationTest {
var addressTaps = 0
var addressPathClicks = 0
var lastInputTargetPath: String? = null
var lastInputTarget: SnapshotNode? = null
var lastInitialEditSnapshot: UiSnapshot? = null
var initialEditCaptures = 0
var inputCount = 0
var backCount = 0
var postSubmitBackCount = 0
var pddRestoreCount = 0
@@ -814,7 +1152,12 @@ class PurchaseLiveAutomationTest {
postSubmitCaptureCount++
if (pendingPostSubmitPages.isNotEmpty()) page = pendingPostSubmitPages.removeAt(0)
}
return currentSnapshot()
val snapshot = currentSnapshot()
if (page == "edit" && inputCount == 0) {
initialEditCaptures++
return initialEditFrame(snapshot, initialEditCaptures).also { lastInitialEditSnapshot = it }
}
return snapshot
}
private fun currentSnapshot(): UiSnapshot = when (page) {
@@ -986,7 +1329,10 @@ class PurchaseLiveAutomationTest {
}
override fun inputFresh(target: SnapshotNode, value: String): FreshActionResult {
inputCount++
lastInputTarget = target
lastInputTargetPath = target.path
if (inputResult != FreshActionResult.SUCCESS) return inputResult
address = value
return FreshActionResult.SUCCESS
}
+15 -2
View File
@@ -2,8 +2,8 @@
generated: true (请先修改 Gitea Wiki,禁止直接编辑本文件)
wiki_page: Troubleshooting
wiki_url: https://git.ilapage.cn/OPC/goauto/wiki/Troubleshooting
wiki_revision: ac3a0b74704f398cec54149267089c87c8375a3e
synchronized_at: 2026-10-06T09:50:33Z
wiki_revision: b096c5a86f3ce0f9dbf3dc0591f7b5cf69f711c7
synchronized_at: 2026-10-08T03:01:08Z
<!-- gitea-wiki-mirror:end -->
# 故障排查
@@ -114,3 +114,16 @@ adb -s <serial> shell run-as cn.ilapage.goauto.agent sqlite3 -readonly databases
- 保留现有加载、错误提示、取消和旧请求隔离逻辑,不增加自动重试。慢请求在 10~60 秒间完成时不再被原 10 秒客户端预算提前中止;超过 60 秒仍会超时,上游更短的超时也可能先终止请求。
- 此调整不优化后端执行速度。处理阶段筛选当前先加载候选并计算阶段、后分页;不选店铺且采购类型为全部时,候选可能很大。遇到持续慢查询,应另行分析候选预筛选与数据库执行计划,不能据此认为延长前端预算已解决后端性能问题。
- 只需发布包含该提交的 Web 资源即可生效,不要求数据库迁移、Android 安装或后端参数变更;发布仍需人工授权。
## Android 地址编辑页控件就绪等待(#366,环节②)
实现绑定 `7fdfe04658d16a05ebcb016ee964a7263eb74802`,位于独立工单分支,未合并 main、未装机或发布;合成测试与 APK 构建结果见 #366 工单,不代表真机采购验收。只修改点击“修改”后等待详细地址输入框就绪的环节;地址列表识别(①)仍缺真实单/多地址列表证据,保存退出(③)、返回与最终复核(④)不改。
- 标题出现不再立即触发输入框缺失失败。在“详细地址”标签的既有同排区域,统计可见 EditText 的 structural 数量(包括空值/禁用)及其 enabled、实际 text 非空且未判为 hint 的子集 ready 数量。只有 structural=1 且 ready=1 才继续,读取的地址与就绪判定来自同一帧;后续 inputFresh 仍重新定位且只尝试一次。
- 原地址只读取同帧实际 text.trim(),不使用 contentDescription 补空。API 26+ 捕获内存 hintText / showingHintText;showingHintText=true 或 text.trim() 等于非空 hintText.trim() 时不就绪,继续等待。全局 label 和其他调用方的语义保持不变,这两个新增元数据不落盘、不上报、不记日志。
- API <26 或应用未正确提供 hint 元数据时,不能完全区分非空 text 是提示还是实际值;仅凭此修复不能保证所有设备/页面的提示文字均被识别,不使用提示词猜测。
- 沿用单轮最多 50 次采样、原 200ms 暂停及点击后的既有暂停。不再叠加标题等待与控件等待,不设置“三次多候选即失败”;采样与解析另有耗时,不能将其表述为严格 10 秒墙钟超时。既有安全异常仍可提前终止。
- 等待超时使用现有错误码:从未观察到详细地址标题为 PURCHASE_ADDRESS_EDIT_TIMEOUT;曾见标题但候选未就绪/不唯一为 PURCHASE_ADDRESS_UPDATE_FAILED。titleSeen 跨帧保留,因此最后一帧空树不会抹掉此前的标题证据。
- 诊断仅含固定 stage=address_editor_ready、reason 分类以及 titleSeen、structural、ready 标量,不含地址、收货人、电话或节点文本。具体原因以实现和测试中的固定分类为准;这不是新增 SQLite 字段或上传接口。
- 收货人/电话不能作为备用目标;区域重叠造成歧义时不输入、不保存。无额外点击、滑动、返回、保存或下单重试,正常单次动作路径保持。
- 此修复不能证明历史失败均因慢加载,也不解决保存地址后返回超时。识别①不能仅凭“不是规格面板+无提交按钮”推断已进入地址列表:两项都依赖同一个面板解析结果。
+13 -2
View File
@@ -2,8 +2,8 @@
generated: true (请先修改 Gitea Wiki,禁止直接编辑本文件)
wiki_page: Android-Agent-API-Contract
wiki_url: https://git.ilapage.cn/OPC/goauto/wiki/Android-Agent-API-Contract.-
wiki_revision: 640da0a86bf1057d418dbeb062c07a84cb5b1d8e
synchronized_at: 2026-10-08T01:42:56Z
wiki_revision: f97ac6b8784fc200ee68e9e2eb4a1201296049f0
synchronized_at: 2026-10-08T03:01:11Z
<!-- gitea-wiki-mirror:end -->
<!-- gitea-wiki-mirror:start -->
@@ -641,6 +641,17 @@ Agent 主动提交 `order_result_unknown` 时保持订单号和下单时间为
| `PURCHASE_ORDER_RESULT_UNKNOWN` | 无法确认订单是否创建,请人工检查 |
| `PURCHASE_PAYMENT_FORBIDDEN` | 系统禁止自动付款 |
### 地址编辑页初始等待诊断(#366,环节②)
实现绑定 `7fdfe04658d16a05ebcb016ee964a7263eb74802`(工单分支,尚未合并 main 或发布)。本修订只细化 Android 点击“修改”后的输入框等待及错误说明,不增加 HTTP 字段、数据库字段或错误码,不改变任务结果提交、设备/任务/规则关联和保存后的最终复核。
- 一个现有 50 次采样预算内,只有详细地址区域可见 EditText 的结构候选数为 1,且其中 enabled、实际 text 非空并排除明确 hint 的就绪候选数也为 1,才允许后续既有单次输入;结构计数包括空值和禁用候选。
- ready 和原地址不使用 contentDescription 补空;showingHintText=true 或实际 text.trim() 等于非空 hintText.trim() 时排除。hintText / showingHintText 仅为 API 26+ 的内存节点元数据,低版本为 null,不新增持久化或上传字段,不改变全局 label。应用缺失/错误的 hint 元数据或 API <26 时无法完全区分提示与实际值。
- 超时从未观察到“详细地址”标题时沿用 `PURCHASE_ADDRESS_EDIT_TIMEOUT`;曾见标题但输入框缺失、为空、仅显示 hint、禁用或存在歧义时沿用 `PURCHASE_ADDRESS_UPDATE_FAILED`。
- 此等待失败的 `errorMessage` 可附固定诊断 `stage=address_editor_ready;reason=<固定分类>;titleSeen=<布尔>;structural=<数量>;ready=<数量>`。reason 为 `title_missing`、`editor_missing`、`editor_ambiguous`、`editor_disabled`、`editor_empty` 或 `editor_hint`;titleSeen 累计保留,数量取最后采样帧,不包含地址值、收货人、电话及节点文本。
- 既有页面安全异常优先失败,不必耗尽预算;`inputFresh` 失败仍不重试。其它使用 `PURCHASE_ADDRESS_UPDATE_FAILED` 的路径保持原义,不要求它们附本段诊断。
- ①地址列表识别仍待真实场景证据,③保存退出、④返回与最终复核不改;本段不代表整单完成或真机验收。
## Agent 当前设备任务历史(#90)
四个只读接口统一使用设备注册所得的 Device Token,只返回该 Token 对应设备最近 30 天内的任务;设备 A 查询设备 B 的任务时按不存在处理,不泄露任务是否存在。