@buaa_smat/hometrans 26.0.5 → 26.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/README.md +249 -279
  2. package/agents/code-reviewer.md +1 -1
  3. package/dist/cli/editors.json +20 -0
  4. package/dist/platform/registry.js +1 -0
  5. package/dist/platform/validate.js +2 -1
  6. package/i18n/agents/code-reviewer.md +1 -1
  7. package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  8. package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  9. package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  10. package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  11. package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  12. package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  13. package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  14. package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  15. package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  16. package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  17. package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  18. package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
  19. package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
  20. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
  21. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  22. package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  23. package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
  24. package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  25. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  26. package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  27. package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  28. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
  29. package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  30. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  31. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  32. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  33. package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
  34. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  35. package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  36. package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  37. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  42. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  43. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  44. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  45. package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  46. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  47. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  48. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  49. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
  50. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  51. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  52. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  53. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  54. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  55. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  56. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  57. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  58. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  59. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  60. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  61. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  79. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  80. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  81. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  82. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  83. package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
  84. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
  85. package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
  86. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  87. package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
  88. package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
  89. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
  90. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  91. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  92. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
  93. package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  94. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  95. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
  96. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
  97. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  98. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
  99. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  100. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
  101. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
  102. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
  103. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
  104. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
  105. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
  106. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  107. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  108. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
  109. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
  110. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
  111. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
  112. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
  113. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  114. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  115. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  116. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  117. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  118. package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  119. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
  120. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
  122. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  123. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
  124. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  125. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
  126. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  127. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
  128. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  129. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  131. package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
  132. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  133. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  134. package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  135. package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  136. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
  137. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  138. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  139. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  140. package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  141. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  142. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
  143. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  144. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  145. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  146. package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
  147. package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
  148. package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
  149. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
  150. package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  151. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  152. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  153. package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  154. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  155. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
  156. package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
  157. package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  158. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  159. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  160. package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  161. package/package.json +2 -1
  162. package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  163. package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  164. package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
  165. package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
  166. package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
  167. package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
  168. package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
  169. package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  170. package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  171. package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  172. package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
  173. package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
  174. package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
  175. package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
  176. package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
  177. package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  178. package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
  179. package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
  180. package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
  181. package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
  182. package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
  183. package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  184. package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  185. package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  186. package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  187. package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  188. package/skills/a2h-app-migrate/SKILL.md +31 -14
  189. package/skills/a2h-app-migrate/references/stage-map.md +4 -2
  190. package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
  191. package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
  192. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
  193. package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
  194. package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
  195. package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
  196. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  197. package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
  198. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
  199. package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  200. package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
  201. package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
  202. package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
  203. package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
  204. package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  205. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  206. package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  207. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
  208. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  209. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
  210. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
  211. package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  212. package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  213. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  214. package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  215. package/skills/a2h-batch-ui-align/SKILL.md +14 -12
  216. package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  217. package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  218. package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  219. package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  220. package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  221. package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  222. package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  223. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  224. package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  225. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  226. package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  227. package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  228. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  229. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  230. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  231. package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
  232. package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  233. package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  234. package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  235. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  236. package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
  237. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  238. package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
  239. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
  240. package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
  241. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  242. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  243. package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
  244. package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
  245. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  246. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  247. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
  248. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  249. package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  250. package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  251. package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  252. package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  253. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  254. package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  255. package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  256. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  257. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  258. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  259. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  260. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  261. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  262. package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  263. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  264. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  265. package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  266. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  267. package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  268. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
  269. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
  270. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
  271. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
  272. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
  273. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  274. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  275. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
  276. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
  277. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
  278. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
  279. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  280. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
  281. package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
  282. package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
  283. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
  284. package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
  285. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
  286. package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
  287. package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
  288. package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
  289. package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  290. package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
  291. package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
  292. package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
  293. package/skills/a2h-page-specgen/SKILL.md +36 -5
  294. package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
  295. package/skills/a2h-page-specgen/references/evidence.md +2 -1
  296. package/skills/a2h-page-specgen/references/execution-model.md +13 -5
  297. package/skills/a2h-page-specgen/references/gates.md +33 -7
  298. package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  299. package/skills/a2h-page-specgen/references/spec-example.md +166 -32
  300. package/skills/a2h-page-specgen/references/spec-template.md +8 -5
  301. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
  302. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  303. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  304. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
  305. package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  306. package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
  307. package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  308. package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
  309. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
  310. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  311. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
  312. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
  313. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  314. package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
  315. package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
  316. package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
  317. package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
  318. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
  319. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
  320. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
  321. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
  322. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
  323. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  324. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  325. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
  326. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
  327. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
  328. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
  329. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
  330. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  331. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  332. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  333. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  334. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  335. package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  336. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
  337. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  338. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
  339. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  340. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
  341. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  342. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
  343. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
  344. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  345. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
  346. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  347. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  348. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
  349. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  350. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
  351. package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
  352. package/skills/a2h-resource-convert/SKILL.md +1 -1
  353. package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
  354. package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
  355. package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
  356. package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
  357. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  358. package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
  359. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  360. package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  361. package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  362. package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
  363. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  364. package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
  365. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
  366. package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  367. package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  368. package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  369. package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  370. package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
  371. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
  372. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  373. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
  374. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
  375. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
  376. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
  377. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
  378. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
  379. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
  380. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
  381. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
  382. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
  383. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
  384. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
  385. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
  386. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
  387. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
  388. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
  389. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
  390. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
  391. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
  392. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
  393. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
  394. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
  395. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  396. package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
  397. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
  398. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
  399. package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
  400. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  401. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
  402. package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
  403. package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
  404. package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
  405. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
  406. package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
  407. package/skills/a2h-spec-generate/references/input-formats.md +1 -1
  408. package/skills/a2h-utg-explorer/SKILL.md +11 -5
  409. package/skills/a2h-utg-explorer/references/architecture.md +37 -19
  410. package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
  411. package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
  412. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
  413. package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
  414. package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  415. package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
  416. package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
  417. package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
  418. package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
  419. package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
  420. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  421. package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
  422. package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
  423. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
  424. package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
  425. package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
  426. package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
  427. package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
  428. package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
  429. package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
  430. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  431. package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  432. package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
  433. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
  434. package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
  435. package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
  436. package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
  437. package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
  438. package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
  439. package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
  440. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
  441. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
  442. package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
  443. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
  444. package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
  445. package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
  446. package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
  447. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
  448. package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
  449. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  450. package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
  451. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
  452. package/skills/a2h-utg-static/SKILL.md +3 -3
  453. package/skills/a2h-utg-static/references/extractors.md +7 -0
  454. package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  455. package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  456. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
  457. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  458. package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
  459. package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
  460. package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
  461. package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
  462. package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  463. package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
  464. package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  465. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
  466. package/resource/convert_pipeline_process.svg +0 -114
  467. package/resource/project_architecture.svg +0 -120
  468. package/resource/set_environment.png +0 -0
  469. package/resource/set_multimodel.png +0 -0
  470. package/skills/a2h-app-migrate/references/specs.example.json +0 -19
  471. package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  472. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
@@ -1,5 +1,5 @@
1
1
  // skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts
2
- import { readFileSync } from 'node:fs';
2
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
3
3
  import * as path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { test } from 'node:test';
@@ -7,6 +7,7 @@ import assert from 'node:assert/strict';
7
7
 
8
8
  const HERE = path.dirname(fileURLToPath(import.meta.url));
9
9
  const file = (rel: string) => readFileSync(path.join(HERE, '..', rel), 'utf8');
10
+ const rootFile = (rel: string) => readFileSync(path.join(HERE, '..', '..', '..', rel), 'utf8');
10
11
 
11
12
  test('shared-layer reference carries the F0 contract', () => {
12
13
  const md = file('references/shared-layer.md');
@@ -156,6 +157,96 @@ test('F0 permissions are gated by the wave specs, looked up in the docs, allowed
156
157
  assert.ok(file('SKILL.md').includes('entry_module_json5'));
157
158
  });
158
159
 
160
+ test('reply recovery is settle-based and never resumes a session', () => {
161
+ const rr = file('references/reply-recovery.md');
162
+ for (const needle of ['settle.ts', 'DISPATCH_AT', 'artifact_fresh', 'settled_empty',
163
+ 'settled_timeout', 'campaign_id', 'merge-base --is-ancestor', 'never reset',
164
+ 'manual recovery', 'QUIET_MS', 'SLICE_MS', 'WAIT_MS', '--init',
165
+ 'ownership-unchecked', 'none-but-head-moved', 'none-but-dirty-tree',
166
+ 'commit-not-on-head', 'future-mtime', 'SCAN_BUDGET', '--force',
167
+ 'activityTruncated', 'clockSkew', 'Never resume a session',
168
+ '660000', '200000', '-uall', 'superset',
169
+ 'reply_recovery_', 'b4-rebuild', 'build-breaker', 'homecheck-build']) {
170
+ assert.ok(rr.includes(needle), `references/reply-recovery.md missing ${needle}`);
171
+ }
172
+ // The old session-resume instructions must be gone; a correct "never resume"
173
+ // sentence must not trip the gate.
174
+ const old = ['resume the same session at most twice', 'Resume **the same session**',
175
+ 'sessionID: <the sessionID from the reply>'];
176
+ const sites = ['SKILL.md', 'references/shared-layer.md', 'references/coding-loop.md',
177
+ 'references/review-loop.md', 'references/post-loop.md', 'references/state-and-resume.md',
178
+ 'references/reply-recovery.md'];
179
+ for (const rel of sites) {
180
+ const md = file(rel);
181
+ for (const needle of old) {
182
+ assert.ok(!md.includes(needle), `${rel} still contains: ${needle}`);
183
+ }
184
+ }
185
+ for (const rel of sites.filter((r) => r !== 'references/reply-recovery.md')) {
186
+ assert.ok(file(rel).includes('reply-recovery.md'), `${rel} does not reference the ladder`);
187
+ }
188
+ assert.ok(file('references/shared-layer.md').includes('Finish in one turn'));
189
+ assert.ok(file('SKILL.md').includes('stop for manual recovery'));
190
+ assert.ok(file('references/post-loop.md').includes('summary.json'));
191
+ assert.ok(file('references/final-report-template.md').includes('Reply recovery'));
192
+ });
193
+
194
+ test('the English overlay mirrors the resume-free ladder', (t) => {
195
+ const root = path.join(HERE, '..', '..', '..');
196
+ if (!existsSync(path.join(root, 'i18n/skills/a2h-spec-design-pipeline/SKILL.md'))) {
197
+ t.skip('i18n overlay not present in this checkout');
198
+ return;
199
+ }
200
+ const sites = ['i18n/skills/a2h-spec-design-pipeline/SKILL.md',
201
+ 'i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md',
202
+ 'i18n/skills/a2h-spec-design-pipeline/references/review-loop.md',
203
+ 'i18n/skills/a2h-spec-design-pipeline/references/post-loop.md',
204
+ 'i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md'];
205
+ const old = ['resume the same session at most twice', 'Resume **the same session**',
206
+ 'sessionID: <the sessionID from the reply>'];
207
+ for (const rel of sites) {
208
+ const md = rootFile(rel);
209
+ for (const needle of old) assert.ok(!md.includes(needle), `${rel} still contains: ${needle}`);
210
+ assert.ok(md.includes('reply-recovery.md'), `${rel} does not reference the ladder`);
211
+ assert.ok(md.includes('settle.ts'), `${rel} does not name settle.ts`);
212
+ }
213
+ assert.ok(rootFile('i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md')
214
+ .includes('active ledger unit'));
215
+ assert.ok(rootFile('i18n/skills/a2h-spec-design-pipeline/SKILL.md')
216
+ .includes('deps_ready.ts`, `settle.ts`'));
217
+ });
218
+
219
+ test('the English overlay markdown contains no Chinese', (t) => {
220
+ const root = path.join(HERE, '..', '..', '..', 'i18n', 'skills', 'a2h-spec-design-pipeline');
221
+ if (!existsSync(root)) {
222
+ t.skip('i18n overlay not present in this checkout');
223
+ return;
224
+ }
225
+ const files: string[] = [];
226
+ const walk = (dir: string) => {
227
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
228
+ const full = path.join(dir, entry.name);
229
+ if (entry.isDirectory()) walk(full);
230
+ else if (entry.isFile() && entry.name.endsWith('.md')) files.push(full);
231
+ }
232
+ };
233
+ walk(root);
234
+ for (const file of files) {
235
+ const md = readFileSync(file, 'utf8');
236
+ assert.ok(!/[\u4e00-\u9fff\u3000-\u303f\uff00-\uffef]/.test(md),
237
+ `${path.relative(root, file)} contains Chinese/full-width punctuation; the i18n overlay is English-only`);
238
+ }
239
+ });
240
+
241
+ test('the settle script is referenced and inventoried', () => {
242
+ assert.ok(file('SKILL.md').includes('references/reply-recovery.md'));
243
+ const scripts = file('references/scripts.md');
244
+ for (const needle of ['scripts/settle.ts', 'scripts/test_settle.ts',
245
+ 'references/reply-recovery.md']) {
246
+ assert.ok(scripts.includes(needle), `references/scripts.md missing ${needle}`);
247
+ }
248
+ });
249
+
159
250
  test('M21: a held member released mid-wave gets its merged dependencies\' wiring on main first', () => {
160
251
  const loop = file('references/coding-loop.md');
161
252
  assert.match(loop, /Held release: wiring first/);
@@ -0,0 +1,137 @@
1
+ // Tests for rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js — the pure SQL
2
+ // identifier analysis behind the [sql-identifier-quoting] sub-code of
3
+ // @hometrans/arkui-runtime-pitfall.
4
+ //
5
+ // The precision rule under test: SQLite only accepts a keyword as an identifier when it is in its
6
+ // `%fallback` list, so `explain` / `offset` / `key` must stay silent while `from` / `order` / `index`
7
+ // must be flagged. A plain keyword list would mis-report the former.
8
+ import { test } from 'node:test';
9
+ import assert from 'node:assert/strict';
10
+ import { createRequire } from 'node:module';
11
+ import * as path from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
13
+
14
+ const requireFromHere = createRequire(import.meta.url);
15
+ const HERE = path.dirname(fileURLToPath(import.meta.url));
16
+ const RULES_DIR = path.join(HERE, '..', 'rules', 'migration-rules');
17
+ const mod = requireFromHere(path.join(RULES_DIR, 'lib', 'checker', 'sql', 'SqlIdentifierAnalysis.js'));
18
+
19
+ test('needsQuoting follows SQLite %fallback, not a blanket keyword list', () => {
20
+ for (const name of ['from', 'index', 'order', 'group', 'values', 'where', 'limit', 'join', 'on', 'to', 'set', 'select']) {
21
+ assert.equal(mod.needsQuoting(name), true, name);
22
+ }
23
+ for (const name of ['name', 'content', 'type', 'level', 'id', 'froms', 'group_index']) {
24
+ assert.equal(mod.needsQuoting(name), false, name);
25
+ }
26
+ // These are keywords but SQLite's fallback list accepts them as identifiers unquoted.
27
+ for (const name of ['explain', 'offset', 'key', 'first', 'last', 'row']) {
28
+ assert.equal(mod.needsQuoting(name), false, name);
29
+ }
30
+ assert.equal(mod.needsQuoting('first name'), true);
31
+ assert.equal(mod.needsQuoting('from2'), false);
32
+ });
33
+
34
+ test('ddlTables reads quoted and unquoted column definitions across string concatenation', () => {
35
+ const quoted = mod.ddlTables(
36
+ `export const DDL = 'CREATE TABLE IF NOT EXISTS "t" (' +\n` +
37
+ ` '"id" INTEGER NOT NULL, "content" TEXT NOT NULL, "from" TEXT NOT NULL, ' +\n` +
38
+ ` 'PRIMARY KEY("id"))';`);
39
+ assert.equal(quoted.length, 1);
40
+ assert.equal(quoted[0].table, 't');
41
+ const byName = Object.fromEntries(quoted[0].columns.map((c) => [c.name, c]));
42
+ assert.equal(byName.from.needsQuote, true);
43
+ assert.equal(byName.from.quoted, true);
44
+ assert.equal(byName.content.needsQuote, false);
45
+
46
+ const unquoted = mod.ddlTables(`const sql = \`CREATE TABLE t (id INTEGER, from TEXT, explain TEXT)\`;`);
47
+ assert.equal(unquoted.length, 1);
48
+ const names = unquoted[0].columns.map((c) => `${c.name}:${c.needsQuote}:${c.quoted}`);
49
+ assert.deepEqual(names, ['id:false:false', 'from:true:false', 'explain:false:false']);
50
+ });
51
+
52
+ test('valuesBucketKeys finds keys that need quoting', () => {
53
+ const keys = mod.valuesBucketKeys(
54
+ `const row: relationalStore.ValuesBucket = {\n` +
55
+ ` 'id': entity.id,\n` +
56
+ ` 'content': entity.content,\n` +
57
+ ` 'from': entity.from,\n` +
58
+ `};`);
59
+ assert.deepEqual(keys.map((k) => k.key), ['from']);
60
+ assert.equal(keys[0].line, 4);
61
+
62
+ const clean = mod.valuesBucketKeys(`const row: relationalStore.ValuesBucket = { 'id': 1, 'name': 'x' };`);
63
+ assert.deepEqual(clean, []);
64
+ });
65
+
66
+ test('rawInsertCalls finds the platform write primitives', () => {
67
+ const text = [
68
+ 'this.store.insert("t", row);',
69
+ 'this.store.batchInsert("t", rows);',
70
+ 'this.store.insertAll(rows);',
71
+ 'this.store.executeSql("SELECT 1");',
72
+ 'list.insert(0, item);',
73
+ ].join('\n');
74
+ assert.deepEqual(mod.rawInsertCalls(text).map((c) => c.api), ['insert', 'batchInsert', 'insertAll']);
75
+ });
76
+
77
+ test('raw insert table resolution keeps FTS mirrors silent and reports dynamic writes', () => {
78
+ const consts = mod.stringConstants(`export const TABLE_FTS: string = 'sample_table_fts';`);
79
+ const calls = mod.rawInsertCalls(
80
+ 'this.store.insert(TABLE_FTS, row);\n' +
81
+ 'this.store.batchInsert(this.table(), rows);\n' +
82
+ 'this.store.insertAll(rows);',
83
+ consts);
84
+ assert.deepEqual(calls.map((c) => [c.api, c.table]),
85
+ [['insert', 'sample_table_fts'], ['batchInsert', ''], ['insertAll', '']]);
86
+
87
+ const schema = mod.ddlTables(`const DDL = 'CREATE TABLE "sample_table" ("id" INTEGER, "from" TEXT)';`);
88
+ assert.deepEqual(mod.analyzeText('this.store.insert(TABLE_FTS, row);', schema, consts).map((f) => f.code), []);
89
+ assert.deepEqual(mod.analyzeText('this.store.insert(this.table(), row);', schema, consts).map((f) => f.code),
90
+ ['rdb-raw-insert']);
91
+ });
92
+
93
+ test('sqlLiteralFindings reports bare keyword identifiers in column positions', () => {
94
+ const cases = [
95
+ [`INSERT INTO t (id, from) VALUES (?,?)`, ['from']],
96
+ [`UPDATE t SET from = ? WHERE id = ?`, ['from']],
97
+ [`SELECT id, from FROM t`, ['from']],
98
+ ];
99
+ for (const [sql, expected] of cases) {
100
+ const found = mod.sqlLiteralFindings(`const q = '${sql}';`).map((f) => f.identifier);
101
+ assert.deepEqual(found, expected, sql);
102
+ }
103
+ for (const sql of [
104
+ `INSERT INTO t ("id", "from") VALUES (?,?)`,
105
+ `UPDATE t SET "from" = ? WHERE "id" = ?`,
106
+ `SELECT id, name FROM t`,
107
+ `SELECT id, explain FROM t`,
108
+ ]) {
109
+ assert.deepEqual(mod.sqlLiteralFindings(`const q = '${sql}';`), [], sql);
110
+ }
111
+ });
112
+
113
+ test('analyzeText combines DDL advisory, values-bucket key and raw insert', () => {
114
+ const schemaText =
115
+ `const DDL = 'CREATE TABLE IF NOT EXISTS "sample_table" (' +\n` +
116
+ ` '"id" INTEGER NOT NULL, "content" TEXT NOT NULL, "from" TEXT NOT NULL, ' +\n` +
117
+ ` 'PRIMARY KEY("id"))';`;
118
+ const daoText =
119
+ `class Dao {\n` +
120
+ ` save(e: E) {\n` +
121
+ ` const row: relationalStore.ValuesBucket = { 'id': e.id, 'content': e.content, 'from': e.from };\n` +
122
+ ` return this.store.insert('sample_table', row);\n` +
123
+ ` }\n` +
124
+ `}`;
125
+ const schema = mod.ddlTables(schemaText);
126
+ const schemaFindings = mod.analyzeText(schemaText, schema);
127
+ assert.deepEqual(schemaFindings.map((f) => f.code), ['ddl-column-needs-quote']);
128
+ assert.deepEqual(schemaFindings[0].identifiers, ['from']);
129
+
130
+ const daoFindings = mod.analyzeText(daoText, schema);
131
+ assert.deepEqual(daoFindings.map((f) => f.code), ['valuesbucket-key-needs-quote', 'rdb-raw-insert']);
132
+
133
+ const clean = mod.analyzeText(
134
+ `class Dao { save() { return this.store.executeSql('INSERT INTO "sample_table" ("id","from") VALUES (?,?)', []); } }`,
135
+ schema);
136
+ assert.deepEqual(clean, []);
137
+ });
@@ -6,7 +6,7 @@ Read this file at Step 0 item 1, before splitting `requirements_input` into indi
6
6
  - **Generic text type (`.txt` / `.md`)**: read the content directly. When the first non-empty line is not an Area metadata line, split on blank-line-separated paragraphs; each requirement starts with a title line followed by its description.
7
7
  - **App-reqgen text type (`.txt` / `.md`)**: select this mode when the first non-empty line matches `访问路径:<path>` or `访问路径:<path>`.
8
8
  - Treat the consecutive leading `访问路径` / `前置条件` / `区域说明` lines before the first blank line as Area metadata, never as a requirement. Require a non-empty access path.
9
- - **`控件:<controlRef>` lines are per-requirement identity metadata**: a block that opens with a `控件:` line carries that requirement's stable Control identity (e.g. `控件:control:weatherapp/interactive-control/3259f93bec43be1b69ac`); the value after `控件:` is the `controlRef`, and the requirement's title is the next non-metadata line. Record the `controlRef` with the requirement and carry it into the spec's identity line (Step 2.5); never treat the `控件:` line itself as title or body text. A `控件:` token that is not the opening line of its block is plain body text — it carries no identity and must not be stripped or promoted. Requirements without one (Excel-sourced, legacy REQ files) simply have no control identity — never invent one.
9
+ - **`控件:<controlRef>` lines are per-requirement identity metadata**: a block that opens with a `控件:` line carries that requirement's stable Control identity (e.g. `控件:control:demoapp/interactive-control/0123456789abcdef0123`); the value after `控件:` is the `controlRef`, and the requirement's title is the next non-metadata line. Record the `controlRef` with the requirement and carry it into the spec's identity line (Step 2.5); never treat the `控件:` line itself as title or body text. A `控件:` token that is not the opening line of its block is plain body text — it carries no identity and must not be stripped or promoted. Requirements without one (Excel-sourced, legacy REQ files) simply have no control identity — never invent one.
10
10
  - In the remaining text, identify each requirement's UI-path/title line and its following behavior description. A blank line followed by the next identifiable title starts a new requirement; blank lines inside a description do not split it. The title need not repeat the exact `访问路径` prefix: navigation wording and quotation marks may differ. Preserve each original title and body rather than rewriting them to match the metadata.
11
11
  - **Precondition propagation format**: prepend the `前置条件:<value>` line verbatim — label included — as the first line of the requirement's in-memory description, then the original body lines. Do not merge it into the body prose and do not drop the label.
12
12
  - If a requirement boundary cannot be identified, or body text has no identifiable title, report the ambiguous section and stop instead of guessing, merging requirements, or inventing a title.
@@ -9,7 +9,7 @@ Use this skill after `a2h-utg-static` (or with an existing static `utg.json`). I
9
9
 
10
10
  ## Run it end to end, without pausing
11
11
 
12
- The first round and every recovery class (A → retry → B/C → adopt → D → direct launch → report) run as ONE uninterrupted cycle. Never stop between stages to ask the user whether to continue; stop only for a genuine blocker (an account, another build, hardware). Drive it with:
12
+ The initial-state archive, the first round, state scheduling (S) and every recovery class (A → retry → B/C → adopt → D → direct launch → report → initial restored) run as ONE uninterrupted cycle. Never stop between stages to ask the user whether to continue; stop only for a genuine blocker (an account, another build, hardware). Drive it with:
13
13
 
14
14
  ```bash
15
15
  node scripts/run_cycle.mjs <campaign> --config <config.json> --static <utg.json> \
@@ -18,6 +18,12 @@ node scripts/run_cycle.mjs <campaign> --config <config.json> --static <utg.json>
18
18
 
19
19
  Stdout JSON appears only when the call ends; follow a running call in `<campaign>/cycle_progress.jsonl` (one JSON line per stage start/end, device phase start/end with its result, and call start/end/failure).
20
20
 
21
+ **Data states.** Which data the device holds decides which pages can render, so the cycle tracks it as evidence in `<campaign>/states.json` (`utg_explorer/states.mjs`):
22
+ - Before any device action, `d_prereqs.mjs initial` archives the app data the device was handed over with as `initial.tar` (`run-as`; every data-dir entry except `cache`, `code_cache` and `lib`, so logins in `app_webview` or `no_backup` are kept) and records the screen a cold launch shows on it (its landing). Without `run-as` the data cannot be archived: it is recorded as live-only, `config.user_state_protected` is set, and every `clear_app_data` / `restore_app_data` is refused from then on (no `pm clear`, no fresh base, so pages only first-launch data shows stay uncaptured and are reported). A release (non-debuggable) build therefore loses stage D: its recipes are extracted for review, none is applied. On a test device whose data nobody needs, set `config.allow_unarchived_wipe: true` before the cycle: no protection is set and D keeps its replay base (`pm clear` + replay). After every stage that changes the app data (the `fresh` snapshot, S, D) the cycle runs `restore-initial`, so requirement-free phases and their retries run on the data the first round saw. The exception is `allow_unarchived_wipe` without `run-as`: `initial` has no archive, `restore-initial` does nothing, and those phases run on whatever data the last S or D variant left. `initial.tar` covers the app's private data directory (`/data/data/<pkg>`) only. `pm clear` also wipes its device-protected storage (`/data/user_de/0/<pkg>`) and external `Android/data/<pkg>`, and the grant step after each clear grants runtime permissions the user had denied: `restore-initial` does not bring those back. A restore unpacks into a staging directory first and replaces the data only when that worked; a failed cycle runs `restore-initial` before it exits. An app installed but never launched has no data: `initial` is recorded as empty and `restore-initial` clears the data. The cycle ends with `d_prereqs.mjs restore-initial`, so the device goes back as it came.
23
+ - After the first round, `d_prereqs.mjs snapshot` takes first-launch data (`fresh`) with its landing; a recipe's snapshot becomes a state too, with the landing of its relaunch.
24
+ - Every verified capture is attributed to the state the device held then (clear / restore / snapshot actions in `events.jsonl` move it).
25
+ - **Stage S**, before A. `predicates.mjs extract` lists each distinct phase requirement once (`predicates_worklist.json`, reviewed like A–D). Answer each `key` with `verdict: "predicate"` and `clauses: [{page, rule?}]` (the requirement holds in a state when one clause matches a capture of `page` there; `rule` is `all` / `any` / `none` over `resource_name` / `text` / `content_desc`, each grounded in the page's layout, source texts or captures; pick evidence present ONLY when the requirement holds, e.g. a list row id, never the list container) or `verdict: "unevaluable"` with `why` (a code branch no screen shows: assumed, never proven). A page that the plan puts behind a requirement on its route proves it by rendering, with no review. `schedule_states.mjs` then adds variant phases `st-<state>-<n>`: every plan phase runs in a known state its requirements hold in (fixture: restore that state, or a plain launch on live data; probe: that state's landing), and every task that failed on its source page runs in a state that page rendered in. The cycle runs them (`state_phases.txt`), and again after D for the states D's recipes built. A state phase is never run on a guess; D only builds the states no known one satisfies.
26
+
21
27
  All stages, D included, run by default without asking the user. D needs `config.snapshot_dir` (and, for recipes that add feeds or other served files, `fixture_server_dir`, with `scripts/d_prereqs.mjs serve <dir> --config <config.json>` running: it picks the port, writes `fixture_server_url` for the device, sets up `adb reverse` on a real device, and `d_prereqs.mjs check` / `release` confirm it is up and drop the reverse afterwards); the cycle takes the base snapshot itself with `d_prereqs.mjs snapshot` when the directory has none (a `.tar` via `run-as` for a debuggable build, otherwise a `.replay.json` step chain rebuilt by `pm clear` + replay; see architecture.md), and skips D with a recorded reason when `snapshot_dir` is unset. `--skip D` (or `direct`) is an opt-out: it marks that stage done without running it and lists it under `skipped` in the output, for a run where the user has asked not to change app data.
22
28
 
23
29
  Each call advances as far as existing answers allow. It prints `waiting`: the worklist parts that still need answers, each with the `answers` path its reviewer must write. Reviews overlap (`--review overlap`, the default). Every stage of the round is extracted up front, so `waiting` lists the parts of **all** of them at once. The stages still apply and run on the device in order. `blocked_on` names the worklists the next stage needs. Then, immediately:
@@ -36,11 +42,11 @@ Each call advances as far as existing answers allow. It prints `waiting`: the wo
36
42
  - A device that never comes back ends the call with `DeviceDown`, and that phase is not marked done. Restart the cycle once the device is back.
37
43
  - While another explorer holds the device lock, `ensure` skips every recovery step (reconnect, adb restart, emulator restart would break its run) and reports it busy. The call ends with `DeviceDown` the same way, and a scheduled restart between rounds is skipped and noted.
38
44
  - A stage that runs past `UTG_STAGE_TIMEOUT_S` is killed. The cycle then kills what it left running (on Windows: `taskkill /T`, then its orphaned `adb shell` children) and removes the adb forwards it held.
39
- - `config.emulator.restart_every_h` restarts the emulator between rounds before it degrades. Measured on AntennaPod 10-15: after 9 h the emulator stopped answering, and ~45 min passed before anyone noticed.
45
+ - `config.emulator.restart_every_h` restarts the emulator between rounds before it degrades. Measured in practice: after 9 h the emulator stopped answering, and ~45 min passed before anyone noticed.
40
46
 
41
47
  Never restart the emulator from a foreground shell yourself: `device_health.mjs ensure --config <config.json> [--restart]` does it within a bounded time.
42
48
 
43
- **Answers carried across rounds.** At the end of a round, its direct-launch answers that schedule nothing (`skip` and the like) are kept with the item they answered. In the next round an unchanged item is merged from them and offered to no reviewer; `carried` in the cycle state counts them. A `launch` answer is reviewed again, because its node is still uncovered, so the launch failed. An item whose label, kind, `declared_at` or click path changed is reviewed again too. Measured on AntennaPod 10-15: round 2 re-reviewed all 78 items from scratch in 63 min.
49
+ **Answers carried across rounds.** At the end of a round, its direct-launch answers that schedule nothing (`skip` and the like) are kept with the item they answered. In the next round an unchanged item is merged from them and offered to no reviewer; `carried` in the cycle state counts them. A `launch` answer is reviewed again, because its node is still uncovered, so the launch failed. An item whose label, kind, `declared_at` or click path changed is reviewed again too. Measured in practice: round 2 re-reviewed all 78 items from scratch in 63 min.
44
50
 
45
51
  Phase budgets are sized to their task counts (`--budget-per-task`), so a phase does not stop early and need a rerun. A phase's cleanup never counts against its budget. A device phase that still fails after the first round is recorded under `failed_phases` and skipped, and the rest of its stage runs. `MAX_PHASE_FAILS` (3) failures in a row still end the call. Its `error` keeps the first and last 300 characters. A device lock held by another explorer is waited for (`config.device_lock_wait_s`, default 300 s); one still held ends the call with `DeviceDown` naming the owner (`Another explorer owns this device: pid N, campaign <path>, since <time>`), and the phase is not marked done. Such a phase is never listed in `failed_phases`; a plain re-run of the cycle runs it. Never hand-edit `cycle_state.json`: after a device failure listed in `failed_phases` is fixed, `--retry-failed` runs those phases again at the start of the call, even when their stage is already done, then rebuilds the report. One that fails again is listed again. Every apply and phase is checkpointed in `cycle_state.json`, so a re-run after a crash never re-applies a stage or re-runs a finished phase.
46
52
 
@@ -61,7 +67,7 @@ The steps below describe the individual stages that `run_cycle.mjs` runs.
61
67
  Pages that inflate the same layout (`layout-twin`) are resolved by their static opener: if the screen before was verified as a page with an edge to exactly one twin, that twin is verified (`layout-twin-opener`); `rejudge`/`recover apply` re-apply this to recorded evidence.
62
68
  Source recovery presses Back only when it can land on the task's source: the source must be a static ancestor of the current verified page (`opened_from`, a menu's owner, a panel's host), and the page must not be one where a Back has already left the app (learned from the event log, so it carries across phases and rounds); otherwise it relaunches directly. A fixture's `snapshot_app_data` / `save_replay` step whose archive already exists (written by an earlier run of the same phase) is kept and skipped, never overwritten.
63
69
  3. Configure device serial, package, launch_component, state probes and fixtures in `config.json`. Keep app data in campaign configuration. `page_rules[].family` may name a static node id; a unique positive rule then becomes auditable static mapping evidence. Unknown family ids remain dynamic-only. Never equate an incoming click label with the landing page; unresolved/ambiguous identity remains a gap.
64
- **State phases with no fixture/probe** run best-effort against the current device state by default **for a uni-app / hybrid app only** (its launcher is a `hybrid-page`, or every denominator page is one). A native app keeps the hard block, so D can still produce a recipe for the phase instead of a probe-less run spending its only attempt. An explicit `state_phase_fallback: true|false` overrides the default either way. Each such phase emits `state_probe_missing` and `environment_verified` with `scope: "best-effort: ..."`, so a page is never left permanently pending merely because no fixture was authored. When `snapshot_dir` is absent, D still extracts `recovery_d_worklist.json` for review instead of disappearing silently (recipes cannot be applied without a snapshot).
70
+ **State phases need no hand-written fixture or probe**: stage S schedules them from the state inventory (see "Data states" above), and one with requirements but no probe is never run directly (`unresolved prerequisites`). `state_phase_fallback` no longer exists. When `snapshot_dir` is absent, `d_prereqs.mjs initial` sets it to `<campaign>/snapshots`; D still extracts `recovery_d_worklist.json` for review when no recipe can be applied.
65
71
  4. Run `node scripts/run_device.mjs <campaign-dir> --config <config.json> --phase <phase-id> --tasks --budget 50`. Device I/O defaults to the fast path (u2 backend via the bundled `assets/u2.jar`, persistent adb shell, stable-UI settle; no extra install, see architecture.md to opt out). Screenshots always come from `adb exec-out screencap -p`. Keep one device session serialized; every action captures before/after package, window, UI tree, screenshot, and outcome. UIAutomator dumps use bounded retry by default (`ui_dump_retries: 3`, configurable) and verify the remote file before pulling it; transient dump/pull/parse failures are classified separately. Use verified fixtures to enter each phase rather than carrying state between unrelated phases.
66
72
  5. Run `scripts/report.mjs <campaign-dir>` for a baseline audit, then perform the recovery cycle below for every unresolved obligation. Do not stop at the first report or treat a screenshot count as page coverage.
67
73
  6. Supplement remaining gaps with `scripts/variant.mjs <campaign-dir> <variant.json> --config <config.json>`: verified fixtures, selected targets, bounded discovery routes, and explicit cleanup. For generic discovery, opt in with `discovery.enabled`, finite depth/state/action bounds, and positive `allow_actions` rules; unlisted actions are denied unless `allow_unlisted_actions` is explicitly true. Discovered endpoints remain separate from confirmed static edges. External adapters must emit `utg-event/1`; replay imported discoveries before confirming edges.
@@ -79,7 +85,7 @@ Use the existing screenshots, UI trees, action history, static page ownership, s
79
85
  1. **A: recover page identity offline.** Run `node scripts/recover.mjs extract <campaign-dir> --static <static-utg> --project <source-project> --package <app-package>`. For each `recovery_worklist.json` item, inspect its example screenshots and trees, the page's source and layouts, and conflicting captures. Write `recovery_answers.json` using source-owned positive anchors and any needed negative anchors. A `modal_title` anchor matches source text only in a dialog's `alertTitle` or `dialog_title`, avoiding a same-text preference row or menu item. Run `node scripts/recover.mjs apply <campaign-dir> --static <static-utg> --project <source-project> --package <app-package>`, then `node scripts/report.mjs <campaign-dir>`. Inspect `recovery_report.json`: repair rejected answers where evidence permits; leave genuinely ambiguous captures unresolved. Applying accepted rules rejudges all observations and can recover downstream replay obligations without device input. Skip `apply` when the worklist is empty.
80
86
  2. **Retry newly recognized replay hops.** Run `node scripts/recover_b.mjs retry-identities <campaign-dir> --config <config.json>` after A. It places tasks whose failed replay capture now proves the expected page into `recA-*` phases without altering their gestures. Execute every phase in `recovery_a_retry_phases.txt` with `run_device.mjs --tasks`, then report. Do not train a new gesture for an identity failure already resolved by A. A retry that gets one hop further can fail there on identity again: re-extract A, answer the new items, apply and retry again (`run_cycle.mjs` does this up to `A_PASSES` = 3 times per round). Such failures belong to A, not to B.
81
87
  3. **B and C: recover actions.** After A retries, run `node scripts/recover_b.mjs extract <campaign-dir> --static <static-utg> --project <source-project>` and the same command with `--class C`. Review the failed-step screenshot/tree, static trigger, source window and available controls; write `recovery_b_answers.json` and `recovery_c_answers.json`. For each nonempty class, run `node scripts/recover_b.mjs apply <campaign-dir> --config <config.json> --class <B-or-C>` (substitute `B` or `C`). Execute every phase listed in its `recovery_b_phases.txt` or `recovery_c_phases.txt` with `node scripts/run_device.mjs <campaign-dir> --config <config.json> --phase <phase-id> --tasks --budget <bounded-budget>`. Then run `node scripts/recover_b.mjs adopt <campaign-dir>` and `node scripts/report.mjs <campaign-dir>`. Only device-confirmed steps become learned steps; a proposed gesture is not coverage.
82
- 4. **D: recover data states.** Run `node scripts/recover_d.mjs extract <campaign-dir> --config <config.json>` after B/C verdicts. `recovery_d_worklist.json` holds keyed `items`: one per B/C item answered `unreachable`, and one per group of phases sharing the same `requires`, covering phases already `blocked` and still-`pending` phases that the config gives no fixture or probe. Large worklists split with `worklist_parts.mjs` like A–C. Answer each item by `key` with `verdict: "recipe"` (`tasks` default to the item's) or `verdict: "skipped"` and the reason; recipe ids and new fixture file names start with the item key. Write recipes only for states constructible with verified in-app steps and positive probes. When a recipe depends on background work with a network constraint (e.g. WorkManager requiring connectivity), verify that Android considers the device network `VALIDATED`; fixture-server reachability alone does not satisfy that constraint. Probe a source-backed completion signal, not text that also appears while the work is still pending. Probe texts must be on the target screen at rest: a sticky section title that only appears while scrolling, or a dialog's text, never matches after relaunch. When a recipe's steps run but its probe misses, the phase blocks `state-probe-failed` and `run_cycle.mjs` offers it back once as a `probe-revision` item carrying the screen's `visible_texts` and `screenshot`; answer `verdict: "revise"` with `probes` whose texts are all in `visible_texts` and tell the target state apart from the base one (apply rejects any other text), or `skipped` when that screen is not the wanted state. Every text or content_desc a recipe step taps must be copied exactly from the worklist's `screen_texts` (per page: the texts the device showed, then the page's source texts), from a value the recipe types, or from one of its new fixture files; apply rejects any other text and names the closest known one. When a recipe stops on a step whose control is not on screen, the phase blocks `fixture-step-failed` and the same pass offers it back once as a `step-revision` item carrying the recipe's steps, the screen's `visible_texts` and `screenshot`; answer `verdict: "revise"` with new `steps` (optionally `probe_steps`) whose tapped texts are in `visible_texts` or `screen_texts`, or `skipped`. Run `node scripts/recover_d.mjs apply <campaign-dir> --config <config.json>`, execute the phases in `recovery_d_phases.txt`, then rerun the report. Record account, hardware, external-app, or build-flavor requirements that cannot be established in this environment as explicit limitations.
88
+ 4. **D: recover data states.** Run `node scripts/recover_d.mjs extract <campaign-dir> --config <config.json>` after B/C verdicts. `recovery_d_worklist.json` holds keyed `items`: one per B/C item answered `unreachable`, and one per group of phases sharing the same `requires`, covering phases already `blocked` and still-`pending` phases that the config gives no fixture or probe. Large worklists split with `worklist_parts.mjs` like A–C. Answer each item by `key` with `verdict: "recipe"` (`tasks` default to the item's) or `verdict: "skipped"` and the reason; recipe ids and new fixture file names start with the item key. Write recipes only for states constructible with verified in-app steps and positive probes. `snapshot_landings` shows the screen each base lands on after relaunch (its state, page and texts): a recipe's steps start from that screen, and apply rejects a recipe whose steps only wait while its probe names an activity, text or id the base landing does not show (measured: six wait-only "device list" recipes on first-launch data, which lands on the agreement dialog, each failed on the device). When a recipe depends on background work with a network constraint (e.g. WorkManager requiring connectivity), verify that Android considers the device network `VALIDATED`; fixture-server reachability alone does not satisfy that constraint. Probe a source-backed completion signal, not text that also appears while the work is still pending. Probe texts must be on the target screen at rest: a sticky section title that only appears while scrolling, or a dialog's text, never matches after relaunch. When a recipe's steps run but its probe misses, the phase blocks `state-probe-failed` and `run_cycle.mjs` offers it back once as a `probe-revision` item carrying the screen's `visible_texts` and `screenshot`; answer `verdict: "revise"` with `probes` whose texts are all in `visible_texts` and tell the target state apart from the base one (apply rejects any other text), or `skipped` when that screen is not the wanted state. Every text or content_desc a recipe step taps must be copied exactly from the worklist's `screen_texts` (per page: the texts the device showed, then the page's source texts), from a value the recipe types, or from one of its new fixture files; apply rejects any other text and names the closest known one. When a recipe stops on a step whose control is not on screen, the phase blocks `fixture-step-failed` and the same pass offers it back once as a `step-revision` item carrying the recipe's steps, the screen's `visible_texts` and `screenshot`; answer `verdict: "revise"` with new `steps` (optionally `probe_steps`) whose tapped texts are in `visible_texts` or `screen_texts`, or `skipped`. Run `node scripts/recover_d.mjs apply <campaign-dir> --config <config.json>`, execute the phases in `recovery_d_phases.txt`, then rerun the report. Record account, hardware, external-app, or build-flavor requirements that cannot be established in this environment as explicit limitations.
83
89
  5. If recovered identities expose new B/C candidates, or verified state fixtures expose new tasks, repeat the affected extraction and replay while evidence-backed candidates remain and the device budget permits. Finish with the final report and the remaining gap reasons. Do not force-match unresolved screenshots or count unsupported tasks as confirmed pages.
84
90
 
85
91
  6. **Direct launch for pages no route reached.** Run `node scripts/direct_launch.mjs extract <campaign> --static <static-utg> --project <source-project>`. It lists each uncovered page and the exported Activities with the intent extras their own source reads (for example a host's fragment-selector key, an item id or a mode flag). Answer `direct_launch_answers.json` with `launch` (component, extras from `reads_extras` with values taken from source, at most 5 class-B steps, the configured phase whose state the page needs, and the dispatching source line) or `skip`. Then run `direct_launch.mjs apply <campaign> --config <config.json>` and execute `direct_launch_phases.txt`. These tasks confirm the page's own capture only and write no edge mapping. The report lists pages confirmed only this way under `mapped_via_direct_launch`. Build flavors, accounts, hardware and source-dead branches cannot be launched; record them as `skip`. A host Activity whose own source reads no intent extra, and whose bare launch was already verified to show one of its child pages, is answered `skip` by `extract` itself (`auto_skipped` in the worklist, `auto: true` in `direct_launch_report.json`). A reviewer could only reach that verdict, since any key would be invented, so reviewing such an item is pure cost. **uni-app / hybrid pages are never sent to review**: `extract` puts them in `auto_routes` and `apply` schedules the same deterministic route task (`uni.reLaunch`) that `compile_tasks.mjs` emits, under `p0-routes*`, with no `direct_launch_answers.json` needed.
@@ -109,10 +109,10 @@ variant JSON 必填 `id`、`requires`、`fixtures`、`probes`、`cleanup`;可
109
109
 
110
110
  长页面采用多视口证据,而非覆盖同名截图或默认拼接。utg.html 可切换状态、视口、所有原始观察,点击原图放大,展开对应组件树。相同组件树下图像可能变化,因此仍可查看每次原始采集。现有抓取为目标导航采集,不能证明已经从页顶滚至页底;多图不能等同完整长截图。离线 HTML 内嵌数据,无 CDN 或 fetch,分享时需带上 artifacts 目录。
111
111
 
112
- ## 补充能力(2026-09 AntennaPod 回归修复)
112
+ ## 补充能力(2026-09 回归修复)
113
113
 
114
114
  - **NL hint 编译**:`nl_hints` 中 `「」`/`“”`/`'…'` 引用的屏幕文字按子句顺序编译为多步点击;中间步(如底部栏「更多」弹出菜单)标记 `intermediate` 不校验页面;“任意一个/第一个…行/项/封面”编译为 `click_list_item`(点击唯一可滚动列表的首个可操作行);`〔id:name〕` 编译为资源 ID 选择器;以“(无需点击)”开头的提示视为自动步。与上一跳重复的前导描述子句会被去除,避免重复点击。
115
- - **`restore_app_data` fixture**:`{"type":"restore_app_data","archive":"<tar>","clear_dirs":[...]}` 以 `run-as` 恢复可调试包的私有数据快照(先 force-stop),用于可重复地进入“有订阅/正在播放”等内容阶段;快照是 campaign 输入,不自动生成。
115
+ - **`restore_app_data` fixture**:`{"type":"restore_app_data","archive":"<tar>","clear_dirs":"all"|[...]}` 以 `run-as` 恢复可调试包的私有数据快照(先 force-stop;`"all"` 先清空数据目录下除 `cache`/`code_cache`/`lib` 外的全部条目,`snapshot_app_data` 默认也归档这些条目),用于可重复地进入“有订阅/正在播放”等内容阶段;快照是 campaign 输入,不自动生成。
116
116
  - **不可调试包的回放快照**:`run-as` 不可用时(release 包、闭源 APK),快照改为 `<name>.replay.json`,内容是从清空数据开始重建该状态的步骤链。恢复 = `clear_app_data`(`pm clear`,同时重置运行时权限)→ 启动 → 重放步骤链;保存 = `save_replay`(步骤链 + 本配方步骤,只写 `snapshot_dir`,不覆盖)。D 配方的输出与其 base 同类;步骤链总长上限 60。`d_prereqs.mjs snapshot` 自动探测 `run-as` 选择模式,`config.snapshot_mode`(`auto`/`tar`/`replay`)可强制指定。
117
117
  - **启动隔离**:`restart` 启动附加 `-f 0x10008000`(NEW_TASK|CLEAR_TASK),避免应用任务栈中残留的系统设置/浏览器页挡在“新启动”前面;带 `component_fqn` 的隐式 VIEW/action 意图会以 `-n` 固定到目标组件。
118
118
  - **页面识别补充层级**:不同包名的前台页一律 `foreign-package`,不映射静态节点。包名以**抓到的控件树**为准(节点 `package` 多数票,`semantics.tree_package`),不以 `dumpsys window` 的前台组件为准:后者会滞后,刚启动或弹出系统选择器时它仍报本应用的 Activity,而 dump 下来的是文件选择器或桌面。以前这类观察会被 `exact-activity` 误判为本应用页面。观察记录的 `package` 字段即树的包名;二者不一致时,前台组件的包名另存为 `component_package`。`rejudge.mjs` 会按同一规则重判旧证据;偏好行只取 `android:id/title`(排除底部导航等常驻栏文字);工具栏标题唯一匹配 `unique-toolbar-title`(含 Compose 顶栏:无 Toolbar 类、无 id 的标题 TextView,位于窗口顶部 12% 内、不在可滚动容器中、同一父节点下左侧有可点击的导航图标,`semantics._composeTopBarTitle`);页面自身布局 ID 唯一组合 `own-layout-ids`(优先使用静态 `layout_ids`);运行时标题的弹窗按自身布局 ID 识别。字符串与偏好 XML 按全项目模块解析。
@@ -120,28 +120,46 @@ variant JSON 必填 `id`、`requires`、`fixtures`、`probes`、`cleanup`;可
120
120
  - **源页复用**:仅在精确页面身份匹配时复用当前界面;宿主 Activity 组件匹配不再视为已在源页。自动子区块(embedded section)无自身锚点时,可凭 `source_context`(最后一个手势目标)确认。
121
121
  - **`overflow_openers`**:配置的正向规则(如底部栏“更多”)在选择器找不到且滚动无果后各尝试一次,未命中则返回。除配置项外,运行器还会从活动自己的路线里**派生** opener:取各任务 replay 中距启动 `derived_opener_depth`(默认 1)步以内、且后面还有步骤的 `intermediate` 跳转的选择器组,按出现次数排序,最多 `max_derived_overflow_openers`(默认 4)个。一条路线已经要先点开的容器(底部栏“更多”、工具栏菜单),其他路线漏写这一步时也能被找到。不写任何应用专属词汇。
122
122
  - 点了 opener 仍没找到目标时:界面有变化才按 Back;如果 opener 换了 Activity,或进到一个不属于浮层类(menu/dialog/panel/overlay/ui-state/mode)的已验证页面,说明它是导航而不是容器,本次运行不再尝试它。
123
- - **等待内容加载**(`content_wait_seconds`,默认 10):动作后的截图若已识别页面、但看起来仍在加载(可见的近似正方形 `ProgressBar`;本应用可见文字里还留着未格式化的占位符 `%1$s` / `%2$d` / `%.1f` / `%02d` / `%1$tY` / 独立的 `%s`(`UNFORMATTED_TEXT`,即布局 `android:text` 默认值、数据回来前的样子;无位置参数的占位符两侧不能紧挨 ASCII 字母或数字(`5%d`、URL 的 `%20` 不算),中文紧挨可以(`体感%s`、`%d天`);输入框(EditText、AutoCompleteTextView、SearchAutoComplete)、列表行和 WebView 内的文字(RecyclerView / ListView / GridView / WebView 下,是绑定的数据)、超过 40 个字符的文字(是内容,不是布局默认值)除外;WeatherApp 首页每次启动后约 8 s 都是 `Feels like %1$s`,控件树静止,`settle()` 判不出来);或页面源码有 3 条以上固定文字、屏幕上至多 2 条带文字节点且其中至多 1 条命中),先不映射,每 0.5 秒重新截图直到内容出现。等满仍在加载就照样映射,`mapping` 事件带 `loading: true`;同一页面等满过一次后不再等待,直到某次截图看到它加载完成(说明只是加载慢,如首次拉数据超时),下次再等;这种宽限每页每轮只有一次,再次等满后本轮不再等待。一直转圈、常驻 `%s`、或在加载态与已加载之间来回切换(滚动遮住转圈)的页面因此每轮最多付两次等待。只在加载态截到的页面在 `report.md` 列入「仅在加载中截到的页面」。宽条形 `ProgressBar`(存储占用、下载进度)不算加载。
124
- - **等待转场空白帧**(`blank_wait_seconds`,默认 6):动作后截到本应用的一帧,自身可见节点既无文字、无描述、也没有可点击的控件,这是旧页面已经退出、新页面还没布局出来的转场帧,认不出任何页面,所以上面的加载等待不会生效。这种帧也先不映射,每 0.5 秒重新截图直到出现内容。它没有页面可以记录,所以一次等满不会取消下一次无关转场的等待;连续 3 次等满(`BLANK_RUN_OUTS`)说明这个应用的界面本身就是这样(看图页、画布),之后不再等待,中间只要有一次等到内容就重新计数。应用从未显示过带文字的界面时(无语义的 Canvas / Flutter 应用)不判空白帧;其他应用占据前台(桌面、系统对话框)也不算。实测(coolmall 2026-11-18):点商品列表的每一行都先截到 38 个裸 View 节点的空白帧,列表探测立刻判定没有一行打开商品详情;同样的点击后等 4 秒就到达了商品详情。
123
+ - **等待内容加载**(`content_wait_seconds`,默认 10):动作后的截图若已识别页面、但看起来仍在加载(可见的近似正方形 `ProgressBar`;本应用可见文字里还留着未格式化的占位符 `%1$s` / `%2$d` / `%.1f` / `%02d` / `%1$tY` / 独立的 `%s`(`UNFORMATTED_TEXT`,即布局 `android:text` 默认值、数据回来前的样子;无位置参数的占位符两侧不能紧挨 ASCII 字母或数字(`5%d`、URL 的 `%20` 不算),中文紧挨可以(`体感%s`、`%d天`);输入框(EditText、AutoCompleteTextView、SearchAutoComplete)、列表行和 WebView 内的文字(RecyclerView / ListView / GridView / WebView 下,是绑定的数据)、超过 40 个字符的文字(是内容,不是布局默认值)除外;某应用首页每次启动后约 8 s 可见文字都停留在含占位符的布局默认值,控件树静止,`settle()` 判不出来);或页面源码有 3 条以上固定文字、屏幕上至多 2 条带文字节点且其中至多 1 条命中),先不映射,每 0.5 秒重新截图直到内容出现。等满仍在加载就照样映射,`mapping` 事件带 `loading: true`;同一页面等满过一次后不再等待,直到某次截图看到它加载完成(说明只是加载慢,如首次拉数据超时),下次再等;这种宽限每页每轮只有一次,再次等满后本轮不再等待。一直转圈、常驻 `%s`、或在加载态与已加载之间来回切换(滚动遮住转圈)的页面因此每轮最多付两次等待。只在加载态截到的页面在 `report.md` 列入「仅在加载中截到的页面」。宽条形 `ProgressBar`(存储占用、下载进度)不算加载。
124
+ - **等待转场空白帧**(`blank_wait_seconds`,默认 6):动作后截到本应用的一帧,自身可见节点既无文字、无描述、也没有可点击的控件,这是旧页面已经退出、新页面还没布局出来的转场帧,认不出任何页面,所以上面的加载等待不会生效。这种帧也先不映射,每 0.5 秒重新截图直到出现内容。它没有页面可以记录,所以一次等满不会取消下一次无关转场的等待;连续 3 次等满(`BLANK_RUN_OUTS`)说明这个应用的界面本身就是这样(看图页、画布),之后不再等待,中间只要有一次等到内容就重新计数。应用从未显示过带文字的界面时(无语义的 Canvas / Flutter 应用)不判空白帧;其他应用占据前台(桌面、系统对话框)也不算。实测:点列表的每一行都先截到 38 个裸 View 节点的空白帧,列表探测立刻判定没有一行打开详情页;同样的点击后等 4 秒就到达了详情页。
125
125
  - **首次运行页桥接**(`launch_chain_wait_seconds`,默认 6):编译时任务记下启动后自动到达的页面(`launch_chain`,如 Splash → Main 中的 Main)和启动落地页(`launch_page`,Splash)。`source()` 启动后若仍停在 `launch_page`,先等它离开;随后若落在链外的页面(首次运行的 Guide),且有一个从该页进入链内页面的已编译任务,就先执行它(事件 `launch_bridge`,失败记 `launch_bridge_failed` 后交给源页检查)。每次启动落在链外都会桥接,出口通常会写入首次运行标记,之后的启动不再经过该页。
126
126
  - **off-path 边**:`a2h-utg-static` nl_hints 对没有 click path 终止于其上的无标签边给出的回答写在 `click_paths.json` `edge_hints`(键 `<source>|<target>|<trigger>`)。有 `nl_hint` 时编译为点击;回答 `not_clickable` 时编译为 `needs_external`,`compile_issues` 含 `edge-not-clickable`,C 类恢复跳过它。
127
127
  - **前缀熔断**(`prefix_memo`,默认开):同一次运行里,某任务的“启动 + 前 n 步 replay”因确定性原因失败后(`selector-not-found-after-bounded-scroll`、`replay-target-unverified:`、`ambiguous selector`、`list-item:`、单一滚动容器缺失),共享这个前缀的后续任务按“启动方式(清数据的 fresh / 未清的 warm)+ 落地页”判断:落地页可预知时(fresh 启动;warm 启动落在启动链页面上,或无启动链时连续两次 warm 启动落地相同)在清数据和启动之前就直接记 `failed`,否则启动一次、越过启动页(Splash)、在 `launchBridge` 之前取落地页再判断,相同才记 `failed`,原因相同,并带 `prefix_failed_from`(首个失败的任务)、`prefix_key`、`replay_index`、`prefix_before`(该步开始时的观察)。证据指向首次失败的那次观察。B 类抽取按 `replay_index` 和 `prefix_before` 定位失败步,这些任务与首个任务归入同一项,审阅一次即可。设备异常等瞬时失败不熔断。
128
- - **已验证路径替换失败前缀**(`reroute_replay`,默认开):replay 的第 i 步以上述确定性原因失败,而这一步指明了要到达的页面时,如果本轮在同一环境、同样的启动方式和落地页下,已有任务真正到达过该页面(截图识别成功,不只是推断),就把第 0 到 i 步换成那条已验证路径,重新执行一次;前缀熔断命中时也先尝试替换。每个任务只替换一次(替换后的任务带 `rerouted_from`),事件为 `replay_rerouted`;没有已验证路径时照旧失败或熔断。实测(coolmall 2026-11-18):未登录分支的任务都靠首页优惠券「立即领取」去登录页(选择器有歧义),而本轮其他任务已经从别的入口到过登录页,结果这一步后面的任务全部失败或被熔断。
129
- - **意外弹窗(interruption)**:控件树唯一根节点面积 < `modal_max_screen_share`(默认 0.85)且含可点控件,即视为浮层(AlertDialog、权限、评分、按流量刷新确认等)。浮层若不是当前任务的源页、目标页或 `source_context`,在选择器查找前、每次搜索滚动后、回放到源页后各检查一次,并依次处理:先用 `interruption_rules`(`{id?, when: <rule>, action}`);其次,被测应用自己的首启同意弹窗(text 或 content_desc 含隐私政策/用户协议/服务协议等,`CONSENT_RE`;WebView 正文只出现在 content_desc;节点无 package 视为本应用)点确认控件接受:`android:id/button1`(按完整 id 匹配;文字为「不同意」「拒绝」「退出」等拒绝义时不算,`CONSENT_DECLINE_RE`),没有时取自定义布局里非勾选类(CheckBox/Switch 等)、整段文字为「同意」「同意并继续」「我同意」「接受」/ Agree / Accept 的唯一节点(`CONSENT_POSITIVE_RE`,整段匹配,「不同意」「我已阅读并同意」不算);只有确认控件存在但不可点时才先勾选 CheckBox(「我已阅读并同意」):优先勾文字含同意/已阅读的第一个(每次勾一个,两个必勾框分两次勾;勾选不占 `max_interruption_dismissals` 次数),否则只在仅有一个未勾选框时勾它,多个都不含同意字样(「接收推送」)时不猜(`consent_default`,默认开,事件 `rule: consent-default`)。已认定是同意弹窗、找不到可点的确认控件,且弹窗上有拒绝出口(`android:id/button2`,或整段文字为「不同意」「拒绝并退出」等的控件,`CONSENT_DECLINE_RE`)时,不退回 Back/button2,原样留着,记一条 `outcome: unresolved` 的事件;没有拒绝出口的(「登录即同意《用户协议》」的一键登录半屏弹层)仍走通用的 Back。只在启动后、除弹窗处理和等待/滚动外还没做过任何动作时生效(`_launched`,`atom()` 维护;启动失败、每个任务开始和 `run()` 开始时清零):这是应用自己弹出的首启弹窗;任务点击后才出现的含协议字样的弹窗(「撤回同意」「注销账号」「登录即同意」)是对那次点击的确认,仍走 Back/button2。同意点击无效果时不再重试、也不退回 Back;再其次 Back,Back 关不掉时点 `android:id/button2`。同意弹窗不能走 Back/button2:Back 会关闭 Activity,button2 通常是「拒绝并退出」(where2study 11-04 实测:每个任务清数据后都遇到该弹窗,64 个任务 0 个确认)。确认控件文字不在上述范围内时,写一条 `interruption_rules`;每个浮层最多处理 `max_interruption_dismissals` 次(默认 2)。每次处理记一条 `interruption` 事件,内容包括前 6 段文字和所用动作,可用来补写规则。
130
- - **上滑不越过起点**:查找控件时,先向下滚,再向上滚回到起点就停(`_backAtOrigin`),不再多滑一次。列表顶部再上滑就是下拉刷新(SwipeRefreshLayout 等,开源 app 普遍使用),会触发联网、按流量提示等弹窗。AntennaPod 第 1 轮因此有 35/65 个任务失败、只覆盖 7 页。起点在列表中部、需要往上找时,设 `search_above_origin: true`。
131
- - **Pager 的 Tab 页**(2026-11-10,CoolMall 实测:分类/购物车两个 Tab 一直没截到):
128
+ - **已验证路径替换失败前缀**(`reroute_replay`,默认开):replay 的第 i 步以上述确定性原因失败,而这一步指明了要到达的页面时,如果本轮在同一环境、同样的启动方式和落地页下,已有任务真正到达过该页面(截图识别成功,不只是推断),就把第 0 到 i 步换成那条已验证路径,重新执行一次;前缀熔断命中时也先尝试替换。每个任务只替换一次(替换后的任务带 `rerouted_from`),事件为 `replay_rerouted`;没有已验证路径时照旧失败或熔断。实测:未登录分支的任务都经首页同一处有歧义的入口去登录页,而本轮其他任务已经从别的入口到过登录页,结果这一步后面的任务全部失败或被熔断。
129
+ - **意外弹窗(interruption)**:控件树唯一根节点面积 < `modal_max_screen_share`(默认 0.85)且含可点控件,即视为浮层(AlertDialog、权限、评分、按流量刷新确认等)。浮层若不是当前任务的源页、目标页或 `source_context`,在选择器查找前、每次搜索滚动后、回放到源页后各检查一次,并依次处理:先用 `interruption_rules`(`{id?, when: <rule>, action}`);其次,被测应用自己的首启同意弹窗(text 或 content_desc 含隐私政策/用户协议/服务协议等,`CONSENT_RE`;WebView 正文只出现在 content_desc;节点无 package 视为本应用)点确认控件接受:`android:id/button1`(按完整 id 匹配;文字为「不同意」「拒绝」「退出」等拒绝义时不算,`CONSENT_DECLINE_RE`),没有时取自定义布局里非勾选类(CheckBox/Switch 等)、整段文字为「同意」「同意并继续」「我同意」「接受」/ Agree / Accept 的唯一节点(`CONSENT_POSITIVE_RE`,整段匹配,「不同意」「我已阅读并同意」不算);只有确认控件存在但不可点时才先勾选 CheckBox(「我已阅读并同意」):优先勾文字含同意/已阅读的第一个(每次勾一个,两个必勾框分两次勾;勾选不占 `max_interruption_dismissals` 次数),否则只在仅有一个未勾选框时勾它,多个都不含同意字样(「接收推送」)时不猜(`consent_default`,默认开,事件 `rule: consent-default`)。已认定是同意弹窗、找不到可点的确认控件,且弹窗上有拒绝出口(`android:id/button2`,或整段文字为「不同意」「拒绝并退出」等的控件,`CONSENT_DECLINE_RE`)时,不退回 Back/button2,原样留着,记一条 `outcome: unresolved` 的事件;没有拒绝出口的(「登录即同意《用户协议》」的一键登录半屏弹层)仍走通用的 Back。只在启动后、除弹窗处理和等待/滚动外还没做过任何动作时生效(`_launched`,`atom()` 维护;启动失败、每个任务开始和 `run()` 开始时清零):这是应用自己弹出的首启弹窗;任务点击后才出现的含协议字样的弹窗(「撤回同意」「注销账号」「登录即同意」)是对那次点击的确认,仍走 Back/button2。同意点击无效果时不再重试、也不退回 Back;再其次 Back,Back 关不掉时点 `android:id/button2`。同意弹窗不能走 Back/button2:Back 会关闭 Activity,button2 通常是「拒绝并退出」(实测:某应用每个任务清数据后都遇到该弹窗,64 个任务 0 个确认)。确认控件文字不在上述范围内时,写一条 `interruption_rules`;每个浮层最多处理 `max_interruption_dismissals` 次(默认 2)。每次处理记一条 `interruption` 事件,内容包括前 6 段文字和所用动作,可用来补写规则。
130
+ - **上滑不越过起点**:查找控件时,先向下滚,再向上滚回到起点就停(`_backAtOrigin`),不再多滑一次。列表顶部再上滑就是下拉刷新(SwipeRefreshLayout 等,开源 app 普遍使用),会触发联网、按流量提示等弹窗。某应用第 1 轮因此有 35/65 个任务失败、只覆盖 7 页。起点在列表中部、需要往上找时,设 `search_above_origin: true`。
131
+ - **Pager 的 Tab 页**(实测:有两个 Tab 一直没截到):
132
132
  - 到达方式:`pager-swipe` 边若有点击路径提示「点击「X」标签」,就编译成点这个 Tab,任意页码一次点击即可到达;没有提示时才左右滑,每隔一页滑一次(`repeat` = 两页 `pager_index` 之差)。
133
133
  - 滑动起点:非抽屉的滑动从离边 1/5 屏宽处起滑,避开系统返回手势区;只有抽屉(`from_edge`)贴边起滑。
134
- - 页面识别:`tabLabelOf` 能从「…标签切换到…页」这类提示里取出 `tab_label`。底部一行里有两个以上已知 Tab 名时,整行(Compose NavigationBar)不计入正文,Tab 名「购物车」不会再把分类页认成商品详情。
134
+ - 页面识别:`tabLabelOf` 能从「…标签切换到…页」这类提示里取出 `tab_label`。底部一行里有两个以上已知 Tab 名时,整行(Compose NavigationBar)不计入正文,携带 Tab 名的页面不会再因这段文字被认成别的页面。
135
135
  - **框架文字本地化**:`More options` 等 AppCompat 无障碍文字按 `--locale` 生成本地化选择器,保留英文作为后备。
136
136
  - **不可驱动入口**:`external-surface` 入口编译为 `entry-requires-external-surface`;安装包中不存在的组件记为 `unsupported: entry-component-not-installed`,均为适配器限制而非页面不可达。
137
137
  - **存储**:`events.jsonl` 逐事件追加;`campaign.json` 最多每 `save_interval` 秒(默认 15)及每个任务结论时重写,避免大 campaign 每个动作全量序列化。
138
138
 
139
139
  ## 阶段划分与不可运行阶段(2026-09-29)
140
140
 
141
- - **任务级前置条件不再切分阶段**:`plan.mjs` 的 `TASK_LEVEL_KINDS`(`ui-state`,以及 `launch-intent:` 守卫)只记录在任务的 `task_preconditions` 上,不参与阶段分组。流程内状态(已输入文字、已打开筛选)由手势序列在同一环境中达到;启动参数由任务自身的启动动作携带。AntennaPod 上阶段数从 63 降为 19。失败时 `task_result.unmet_preconditions` 标明未达到的流程内状态。
142
- - **启动参数**:静态守卫带 `launch_extras`(键常量已解析为字面量、访问器类型、分支决定的布尔值)。`compile_tasks.mjs --launch-values <json>` 为只有 campaign 知道的值(例如某个单集 id)提供取值,可附 `requires` 让任务落到该值存在的阶段;缺少取值时编译为 `launch-extra-value-required:<key>`,不猜测。适配器按类型生成 `--ez/--el/--ei/--es` 参数并做字符白名单校验。
143
- - **面板内触发的跳转(`panel_routes.mjs`,2026-11-02)**:homegraph 把 helper 函数(如 `openNewTask()`)里的 `startActivity` 记在 helper 所属页面上,边上没有 trigger id,编译出的任务就在该页直接点目标页标签。如果这个 helper 的所有调用点都是同一个静态 panel 里控件的点击监听(证据:panel 的 `declared_at`/`evidence` 行里出现了该控件变量),`compile_tasks.mjs` 会在边任务的 `prelude`、以及经过这条边的回放步骤前,插入一步「点 panel 的 open-overlay 触发控件」(`intermediate: true`),并把面板内控件的 resource name 放到选择器最前面。只要还有一个调用点不在 panel 控件监听里,就不改写;opener 自身监听器里的调用(FAB 第一次点开速拨面板、面板打开时再点才新建)也算面板调用,因为面板仍要先打开。helper 不是 private、且别的源文件调用了它(`x.fn(`、`::fn`,或子类里不带限定的 `fn()`)时也不改写。路由按边记录:同一对页面还有别的无 trigger 边(例如菜单里的 `editTask`)时,那条边的任务不插入 opener,回放步骤分不清是哪条边,也不插入。回放时先找从当前页出发的路由;还没执行手势时,只额外接受启动页经 lifecycle/startDestination 等自动边到达的页面上的路由。被 hint 改写过的回放步骤,只有最后一步仍点面板成员时才插入 opener。需要 `--project`,源码每次编译只读一遍。Simple Calendar:`MainActivity → TaskActivity` 先点 `calendar_fab`,再点 `fab_task_label`/`fab_task_icon`,涉及 22 个任务。
144
- - **`close_phases.mjs`**:设备阶段结束后运行,把没有 fixture/探针的阶段标为 `blocked`,原因写明未满足的前置条件和其中的已编译任务数,报告不再显示为 `pending`。判定函数 `unrunnable(phase, config)` 也被 D 类抽取复用,让 D 在这一步之前就能看到这些阶段。
141
+ - **任务级前置条件不再切分阶段**:`plan.mjs` 的 `TASK_LEVEL_KINDS`(`ui-state`,以及 `launch-intent:` 守卫)只记录在任务的 `task_preconditions` 上,不参与阶段分组。流程内状态(已输入文字、已打开筛选)由手势序列在同一环境中达到;启动参数由任务自身的启动动作携带。实测应用上阶段数从 63 降为 19。失败时 `task_result.unmet_preconditions` 标明未达到的流程内状态。
142
+ - **启动参数**:静态守卫带 `launch_extras`(键常量已解析为字面量、访问器类型、分支决定的布尔值)。`compile_tasks.mjs --launch-values <json>` 为只有 campaign 知道的值(例如某个内容项 id)提供取值,可附 `requires` 让任务落到该值存在的阶段;缺少取值时编译为 `launch-extra-value-required:<key>`,不猜测。适配器按类型生成 `--ez/--el/--ei/--es` 参数并做字符白名单校验。
143
+ - **面板内触发的跳转(`panel_routes.mjs`,2026-11-02)**:homegraph 把 helper 函数(如 `openItem()`)里的 `startActivity` 记在 helper 所属页面上,边上没有 trigger id,编译出的任务就在该页直接点目标页标签。如果这个 helper 的所有调用点都是同一个静态 panel 里控件的点击监听(证据:panel 的 `declared_at`/`evidence` 行里出现了该控件变量),`compile_tasks.mjs` 会在边任务的 `prelude`、以及经过这条边的回放步骤前,插入一步「点 panel 的 open-overlay 触发控件」(`intermediate: true`),并把面板内控件的 resource name 放到选择器最前面。只要还有一个调用点不在 panel 控件监听里,就不改写;opener 自身监听器里的调用(FAB 第一次点开速拨面板、面板打开时再点才新建)也算面板调用,因为面板仍要先打开。helper 不是 private、且别的源文件调用了它(`x.fn(`、`::fn`,或子类里不带限定的 `fn()`)时也不改写。路由按边记录:同一对页面还有别的无 trigger 边(例如菜单里的编辑入口)时,那条边的任务不插入 opener,回放步骤分不清是哪条边,也不插入。回放时先找从当前页出发的路由;还没执行手势时,只额外接受启动页经 lifecycle/startDestination 等自动边到达的页面上的路由。被 hint 改写过的回放步骤,只有最后一步仍点面板成员时才插入 opener。需要 `--project`,源码每次编译只读一遍。某应用的跳转:先点 FAB 打开速拨面板,再点面板内的按钮才到目标页,两条这样的入口共涉及 22 个任务。
144
+ - **`close_phases.mjs`**:设备阶段结束后运行,把没有 fixture/探针、也没有被 S 阶段的状态变体服务(`schedule_states.mjs isServed`)的阶段标为 `blocked`,原因写明未满足的前置条件和其中的已编译任务数,报告不再显示为 `pending`。判定函数 `unrunnable(phase, config, doc)` 也被 D 类抽取复用,让 D 在这一步之前就能看到这些阶段。
145
+
146
+ ## 数据状态清单与按证据调度(2026-11-26)
147
+
148
+ 起因(universalapp TV,2026-11-25):设备交来时已登录且设备列表非空。`d_prereqs snapshot` 一上来 `pm clear`,登录态丢失;16 个状态阶段因为没配 fixture 被判 blocked,160 个任务一个没跑;D 的 6 个配方都是「`fresh.tar` + 等待」,而首次启动数据落在用户协议弹窗上,6 次探针全部失败。三处根因:前置条件是自然语言,从未在设备上判定;设备上的数据状态没有记录、可以随手丢弃;任务的执行状态在规划时写死。
149
+
150
+ - **状态清单** `states.json`(`utg_explorer/states.mjs`):每个状态记进入方式(归档 / 仅现场)、能否恢复、落地观察(冷启动后的界面:activity、识别出的页面、文字与 id)。`d_prereqs initial` 在任何设备动作之前记录 `initial`,`d_prereqs snapshot` 记录 `fresh`,D 配方的 `snapshot_app_data` 从事件日志派生出新状态(落地取其后的重启截图)。`timeline` 记录 d_prereqs 在运行器之外对数据的改动。`deriveStates` 按事件日志把每个已验证截图归到当时所处的状态。
151
+ - **不变量**:用户数据永不在无法恢复的情况下被抹掉。无 `run-as` 时 `initial` 只记为现场,`config.user_state_protected=true`,适配器拒绝所有 clear / restore。cycle 结束时 `d_prereqs restore-initial` 还原。
152
+ - **前置条件判定**(`requirementHolds`):(a) 路线证据:计划把某页放在该条件之后、且该条件不是该页自身的守卫,那么该页在此状态下渲染即证明条件成立(设备详情页只能从设备卡片进入);自身守卫不算(设备列表页在空列表时也渲染,登录页恰在未登录时渲染)。(b) 编译谓词 `predicates.json`:`predicates.mjs` 为每条不同的前置条件出一项审阅,答案是 `{page, rule?}` 子句(选择器必须出自该页布局、源码文字或截图),或 `unevaluable`(代码分支,屏幕上看不出:视为假设成立,不作为证据;全是假设的阶段不调度)。
153
+ - **调度**(`schedule_states.mjs`,S 阶段与 D 之后各跑一次):计划阶段的前置条件在某个已知状态下全部成立,就生成变体 `st-<state>-<n>`,fixture 进入该状态(现场直接启动,否则恢复归档),探针是该状态的落地规则(包名 + activity + 落地页自身布局 id,最多 3 个),原阶段记 `served_by`,D 和 close_phases 跳过它;变体 blocked 时交还 D。另外,在源页失败的任务(`source-unverified:<页>`)如果源页在别的状态下出现过,就调到那个状态执行。第一轮不再执行任何带前置条件的阶段,`state_phase_fallback` 删除。
154
+ - **D 的基底校验**:`recovery_d_worklist.json` 附 `snapshot_landings`;apply 时,只有等待步骤的配方,如果探针要求的 activity / 文字 / id 不在基底落地画面里,直接拒绝,不上真机。
155
+
156
+ ## 多宿主目标、空窗口树与路由内界面(2026-11-26)
157
+
158
+ 起因(某应用,Compose):面板弹窗只挂在预览页上(静态 UTG 只取最近宿主,已在 a2h-utg-static 修正),预览页依赖前置页的数据而进不去,6 个弹窗一个没截到,而 Main 已验证 94 次;另有 22 帧 Compose `Popup` 截图对应的 layout.xml 只有一个不可见根节点,被当成 `dynamic:*` 新页面。
159
+
160
+ - **多宿主**(`utg_explorer/hosts.mjs`):同一目标、同一机制族(open-overlay/show-dialog 一族,`surface-switch` 一族)有多个 source 时,编译期按「已验证 → 数据前置条件少 → replay 短」给宿主排序,任务带 `host_alternatives` / `host_rank`;没有自己点击路径的宿主借用同一 `trigger` file:line 兄弟边的手势(`provenance.gesture_from_host`)。运行期任务因宿主失败(源阶段失败、`target-unverified`、探测页未验证、空界面上选择器不可用、无源路径)且目标仍未覆盖时,同一阶段立即改走下一个宿主(`<id>@host-retry:<phase>`,事件 `host_retry`)。gap 原因末尾列出 `hosts tried: …`,`hosts_tried` 字段同步。
161
+ - **空窗口树**(`adapters.mjs`):截图非纯色而 dump 可见 app 节点少于 2 个时,稍等后重新 dump 全部窗口,取信息更多的树;仍为空且本会话 app 已出过正常树时,观察标 `tree_unreliable`,解析为 `tree-unreliable` 并 `candidate_for` 期望目标(事件 `candidate_capture`,`confirmed:false`)。这类观察不晋升 dynamic 节点(`promote_dynamic` 跳过),`final_utg` 记在期望节点的 `candidate_captures` 并报 `tree-unreliable-observations`。`tree_redump:false` 关闭重 dump。
162
+ - **路由内界面**:静态 UTG 新增 `in-route-surface` 节点(`surface:<Composable>`)与 `surface-switch` 边。编译按点击处理,`panel_routes` 不接管;语义判定时该界面自身正文出现在屏上就判为该界面(`in-route-surface-body-text`);运行器按原地打开处理,不视为离开宿主。
145
163
 
146
164
  ## 模型介入恢复 · A 类:离线学习页面身份(2026-09-29)
147
165
 
@@ -208,7 +226,7 @@ variant JSON 必填 `id`、`requires`、`fixtures`、`probes`、`cleanup`;可
208
226
 
209
227
  ## 模型介入恢复 · D 类:构造所需的数据状态(2026-09-29)
210
228
 
211
- 有些边在代码里存在,但只在测试快照没有的状态下才会出现,比如已下载的单集、未订阅的播客、刷新失败、搜索结果。B、C 类的审阅方已经把这些标为 `unreachable`,并从源码读出了出现的条件。`recover_d.mjs` 让模型给出一份**配方**来在应用内构造这种状态,具体包括:
229
+ 有些边在代码里存在,但只在测试快照没有的状态下才会出现,比如仅已下载数据才出现的入口、未登录或未订阅的状态、刷新失败、搜索结果。B、C 类的审阅方已经把这些标为 `unreachable`,并从源码读出了出现的条件。`recover_d.mjs` 让模型给出一份**配方**来在应用内构造这种状态,具体包括:
212
230
  - 从哪个已有快照开始;
213
231
  - 在应用内执行哪些步骤。动作词汇与 B 类相同,并新增 `type`(向前一步点过的输入框输入 ASCII 文字)和 `key`(只允许 ENTER、SEARCH、TAB、DEL);
214
232
  - 可选:向本地测试 feed 服务器**新增**文件,但不能修改已有文件;
@@ -230,7 +248,7 @@ variant JSON 必填 `id`、`requires`、`fixtures`、`probes`、`cleanup`;可
230
248
  运行器新增的动作:
231
249
  - `key`:白名单按键;
232
250
  - `snapshot_app_data`:只能写入 `config.snapshot_dir`。
233
- - `restore_app_data`:先校验归档,不完整时直接报错,不清空设备数据(`adb exec-in` 不回传设备端 tar 的退出码)。基础快照 `fresh.tar` 由 `d_prereqs.mjs snapshot` 在 `pm clear` 之后生成。
251
+ - `restore_app_data`:先校验归档,不完整时直接报错,不清空设备数据(`adb exec-in` 不回传设备端 tar 的退出码)。基础快照 `fresh.tar` 由 `d_prereqs.mjs snapshot` 在 `pm clear` 之后生成,生成前用户原有数据已由 `d_prereqs.mjs initial` 归档为 `initial.tar`;原有数据无法归档时(无 `run-as`)`config.user_state_protected` 为真,`clear_app_data` / `restore_app_data` 一律拒绝,`fresh` 不生成。
234
252
 
235
253
  `report.md` 新增两节:
236
254
  - **运行器能力缺口**:审阅方证明边存在,但运行器在自身规则内做不到,比如时间窗口短于一次观察;
@@ -253,7 +271,7 @@ D 的工作清单是带 `key` 的 `items`,可以用 `worklist_parts.mjs` 拆
253
271
 
254
272
  ## 节点覆盖模式(2026-10-04,默认)
255
273
 
256
- 目标是“每个静态节点都有自己的截图和组件树”时使用。按边规划时,一个节点有几条入边就会被跑几次;恢复各类也会反复审阅目标页早已截到的项。以 AntennaPod(APL1_explore_1003)实测:469 个任务结果里,140 个开始时目标页已有截图;B、C、D 中目标页已有截图的分别是 24/53、29/38、39/55。
274
+ 目标是“每个静态节点都有自己的截图和组件树”时使用。按边规划时,一个节点有几条入边就会被跑几次;恢复各类也会反复审阅目标页早已截到的项。以一次实测为例:469 个任务结果里,140 个开始时目标页已有截图;B、C、D 中目标页已有截图的分别是 24/53、29/38、39/55。
257
275
 
258
276
  - **默认是节点模式**。要按边验证时,config.json 设 `"coverage_mode": "edges"`,或 `run_device.mjs --coverage edges`(命令行优先于 config)。
259
277
  - **“已覆盖”的定义**(`utg_explorer/coverage.mjs` 中的 `covered_static_ids`):某个 `mapping` 事件对应的观察,其当前的 `static_resolution` 已验证为该节点,与 audit.mjs 统计 mapped 的规则相同。经源码关系确认的节点(宿主、默认子页、同布局孪生页)不算,因为它自己的界面从未被截到。
@@ -267,16 +285,16 @@ D 的工作清单是带 `key` 的 `items`,可以用 `worklist_parts.mjs` 拆
267
285
  - **审阅拆分**:`worklist_parts.mjs split <worklist> --size 10` 把 A、B、C、D 和直接启动的工作清单拆成小份并行审阅,`merge [--seed]` 合并;缺项、重复、未知键都会拒绝。D 类先按状态归组再拆(见 D 类一节)。
268
286
  - **事件时间戳**:每个事件带 `ts`(epoch 秒),报告可以据此计算阶段耗时;读取方忽略该字段。
269
287
 
270
- 在 APL1 记录上离线回放(不重跑设备)的结果:
288
+ 在一轮既有记录上离线回放(不重跑设备)的结果:
271
289
 
272
290
  | 指标 | 结果 |
273
291
  |---|---|
274
292
  | 任务内截图(运行时身份) | 少 26% |
275
293
  | 任务内截图(离线规则提前可用) | 少 35% |
276
294
  | 其中 C、D 类 | 少约 75% |
277
- | 跳过的 138 个任务导致丢失的节点 | 1 个(`menu:feeditemlist_context`,它自己的任务不会被跳过,仍会尝试) |
295
+ | 跳过的 138 个任务导致丢失的节点 | 1 个(一个上下文菜单页,它自己的任务不会被跳过,仍会尝试) |
278
296
  | 工作清单 B/C/D | 53/38/55 项 → 38/15/29 项 |
279
297
 
280
298
  代价是目标已覆盖的边不再尝试,验证的边会变少;需要边时再补跑一轮按边的任务。
281
299
 
282
- 设备实测(AntennaPod,APNODE_1004 对比 APL1_explore_1003):节点模式确认 114/141 页、验证 166/412 边,设备时间约 50 分钟;按边模式为 115/141 页、254/412 边、约 107 分钟。少的一个页面是 `menu:feeditemlist_context`,与离线回放的预测一致。
300
+ 设备实测(节点模式与按边模式各一轮):节点模式确认 114/141 页、验证 166/412 边,设备时间约 50 分钟;按边模式为 115/141 页、254/412 边、约 107 分钟。少的一个页面是一个上下文菜单页,与离线回放的预测一致。
@@ -84,6 +84,10 @@ export function audit(doc) {
84
84
  dset(out, n.id, 'transient: leaves by itself before the app is ready');
85
85
  }
86
86
  }
87
+ // Pages the legacy plan bypassed (a paywall, an orphan): no task was planned for them, so they are
88
+ // out of the denominator rather than gaps (plan.mjs `bypassNodeIds`). A mapped one counts as usual.
89
+ const bypass = new Set((Array.isArray(get(doc, 'bypass_nodes')) ? doc.bypass_nodes : []).filter((id) => !mapped.has(id)));
90
+ for (const id of bypass) { if (!Object.hasOwn(out, id)) { dset(out, id, 'bypass: planned out of coverage'); } }
87
91
  const att0 = attestedIds(doc, mapped); const att = {};
88
92
  for (const k of keysOf(att0)) { if (!Object.hasOwn(out, k)) { dset(att, k, att0[k]); } }
89
93
  // A node whose every confirming task was a direct launch: screen proven, in-app route not.
@@ -101,8 +105,8 @@ export function audit(doc) {
101
105
  }));
102
106
  // Only an endpoint that is no screen of this app takes its edges out of the denominator. A
103
107
  // non-navigable hybrid component is one: plan.mjs gives its edges no obligation (isNonNavigable).
104
- const gone = new Set(doc.nodes.filter((n) => truthy(get(n, 'out_of_scope')) || get(n, 'status') === 'unreachable'
105
- || isNonNavigable(n)).map((n) => n.id));
108
+ const gone = new Set([...doc.nodes.filter((n) => truthy(get(n, 'out_of_scope')) || get(n, 'status') === 'unreachable'
109
+ || isNonNavigable(n)).map((n) => n.id), ...bypass]);
106
110
  const inEdges = [];
107
111
  docEdges.forEach((e, i) => { if (!gone.has(get(e, 'source')) && !gone.has(get(e, 'target'))) { inEdges.push(i); } });
108
112
  const inSet = new Set(inEdges);
@@ -12,6 +12,7 @@ import * as path from 'node:path';
12
12
  import { pathToFileURL } from 'node:url';
13
13
  import { jsonLoads, jsonDumps, get, mget, truthy, pyStr, pJoin, pathStr, pyPrint, ArgumentParser, runMain } from './utg_explorer/_py.mjs';
14
14
  import { atomicWriteJson, readJson } from './utg_explorer/adapters.mjs';
15
+ import { isServed } from './schedule_states.mjs';
15
16
 
16
17
  /** requirement_text(r): "content", "[kind] text" for a JSON guard, else str(r). */
17
18
  export function requirementText(r) {
@@ -29,14 +30,16 @@ export function requirementText(r) {
29
30
  }
30
31
 
31
32
  /**
32
- * A phase no fixture/probe can enter: still pending (or unset), with requirements, and the config
33
- * lacks either its probes or its fixture. Shared with recover_d, which must see these phases
34
- * before this script marks them `blocked` at the end of the cycle.
33
+ * A phase no fixture/probe can enter: still pending (or unset), with requirements, the config
34
+ * lacks either its probes or its fixture, and no state phase serves it (schedule_states.mjs: a
35
+ * variant in a known state its requirements hold in, not blocked). Shared with recover_d, which
36
+ * must see these phases before this script marks them `blocked` at the end of the cycle.
35
37
  */
36
- export function unrunnable(p, cfg) {
38
+ export function unrunnable(p, cfg, doc = null) {
37
39
  const st = get(p, 'status');
38
40
  if (!(st === null || st === undefined || st === 'pending')) { return false; }
39
41
  if (!truthy(get(p, 'requires'))) { return false; }
42
+ if (doc && isServed(doc, p)) { return false; }
40
43
  return !(truthy(get(get(cfg, 'phase_probes', {}), p.id)) && truthy(get(get(cfg, 'fixtures', {}), p.id)));
41
44
  }
42
45
 
@@ -51,7 +54,7 @@ export function main(argv = process.argv.slice(2)) {
51
54
  const cfg = readJson(a.config);
52
55
  let closed = 0;
53
56
  for (const p of mget(doc, 'phases')) {
54
- if (!unrunnable(p, cfg)) { continue; }
57
+ if (!unrunnable(p, cfg, doc)) { continue; }
55
58
  const tasks = get(doc, 'tasks', []).filter((t) => mget(t, 'phase') === p.id);
56
59
  const compiled = tasks.filter((t) => mget(t, 'status') === 'compiled').length;
57
60
  p.status = 'blocked';