@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
@@ -893,15 +893,43 @@ function registration(im: Png, cs: CoordSpace, nodes: Node[], skip: (n: Node) =>
893
893
  }
894
894
 
895
895
  /**
896
- * Every visible ImageView/ImageButton the reference shows, sampled at its **registered** position. phase5_check's
896
+ * Every visible image node the reference shows — ImageView/ImageButton, or an image-sized leaf of another class
897
+ * (Compose draws Image/Icon/AsyncImage as a bare android.view.View) — in view.xml and in each scroll frame,
898
+ * sampled at its **registered** position. phase5_check's
897
899
  * [icons] stage requires each key to be covered by an `// ICON: <key>` marker on an image-rendering line; an
898
900
  * `// ICON-OMIT:` is refused when the sample here says the icon is drawn on a solid background.
899
901
  */
900
902
  interface IconRow {
901
- key: string; node: number; rid: string; declaredPx: string; sampledPx: string; dy: number;
903
+ key: string; node: number; rid: string; desc: string; declaredPx: string; sampledPx: string; dy: number;
902
904
  ink: string; bg: string; inkShare: number; bgUniform: boolean; visible: boolean;
903
905
  /** subtree = dy of an anchor sharing a sub-window ancestor; fallback = drifted dy tried after a blank read; none = declared position. */
904
906
  dySource: 'subtree' | 'fallback' | 'none';
907
+ /** image = ImageView/ImageButton; leaf = an image-sized leaf of another class (Compose draws images as android.view.View). */
908
+ kind: 'image' | 'leaf';
909
+ /** Capture the row was sampled from: 0 = view.xml/screenshot.png, N = view_scroll_N.xml/screenshot_scroll_N.png. */
910
+ frame: number;
911
+ /** Other frames that showed the same icon (same key); set on the first row of the key only. */
912
+ frames?: number[];
913
+ }
914
+
915
+ /**
916
+ * Classes that never stand for a drawn image on their own: layout containers, text, input and stateful widgets
917
+ * (mapped by their own rules), and media surfaces. Everything else that is a leaf can be an image renderer — Compose
918
+ * `Image` / `Icon` / `AsyncImage` surface in uiautomator as a bare `android.view.View` with no children and no text.
919
+ */
920
+ const NOT_ICON_LEAF = /(Layout|ScrollView|RecyclerView|ListView|GridView|ViewPager2?|ViewGroup|ViewStub|WebView|TextView|EditText|CheckBox|RadioButton|Switch|ToggleButton|SeekBar|ProgressBar|Spinner|RatingBar|SurfaceView|TextureView|VideoView|ComposeView|Toolbar|CardView)$/;
921
+
922
+ /**
923
+ * Icon candidate test. ImageView/ImageButton keep the old rule (≥ minPx on the short side). Any other class must look
924
+ * like an image on its own: a leaf with empty text, ≥ minPx on both axes, at most maxPx on both (a full-size background
925
+ * or decoration View is not an icon), not wider than half the window, aspect ≤ 2.5 (dividers, bars and pills are out).
926
+ */
927
+ function iconCandidate(n: Node, minPx: number, maxPx: number, hasKids: (n: Node) => boolean, rootW: number): IconRow['kind'] | null {
928
+ if (/Image(View|Button)$/.test(n.cls)) { return Math.min(n.w, n.h) >= minPx ? 'image' : null; }
929
+ if (hasKids(n) || n.text.trim() || NOT_ICON_LEAF.test(n.cls)) { return null; }
930
+ if (n.w < minPx || n.h < minPx || n.w > maxPx || n.h > maxPx || n.w > rootW / 2) { return null; }
931
+ if (Math.max(n.w, n.h) / Math.min(n.w, n.h) > 2.5) { return null; }
932
+ return 'leaf';
905
933
  }
906
934
 
907
935
  function iconKey(n: Node): string {
@@ -914,10 +942,14 @@ function iconKey(n: Node): string {
914
942
  }
915
943
 
916
944
  function iconInventory(im: Png, cs: CoordSpace, nodes: Node[], tree: Node[], reg: Registration,
917
- minPx: number, skip: (n: Node) => boolean, root: Node): IconRow[] {
945
+ minPx: number, maxPx: number, skip: (n: Node) => boolean, root: Node, frame = 0): IconRow[] {
918
946
  const rows: IconRow[] = [];
947
+ const parents = new Set<number>(tree.map((t) => t.parent).filter((p): p is number => p !== null));
948
+ const at = new Map<Node, number>(tree.map((t, i) => [t, i]));
949
+ const hasKids = (n: Node): boolean => parents.has(at.get(n) ?? -1);
919
950
  for (const n of nodes) {
920
- if (!/Image(View|Button)$/.test(n.cls) || skip(n) || Math.min(n.w, n.h) < minPx) { continue; }
951
+ const kind = skip(n) ? null : iconCandidate(n, minPx, maxPx, hasKids, root.w);
952
+ if (!kind) { continue; }
921
953
  const r = toImgRect(im, cs, n);
922
954
  if (!r) { continue; }
923
955
  const sample = (dy: number): { c: ReturnType<typeof contrastColors>; y1: number; y2: number; visible: boolean } | null => {
@@ -942,14 +974,98 @@ function iconInventory(im: Png, cs: CoordSpace, nodes: Node[], tree: Node[], reg
942
974
  }
943
975
  if (!s) { continue; }
944
976
  const c = s.c, y1 = s.y1, y2 = s.y2;
945
- rows.push({ key: iconKey(n), node: n.idx, rid: n.rid, declaredPx: `[${r.x1},${r.y1}][${r.x2},${r.y2}]`,
977
+ rows.push({ key: iconKey(n), node: n.idx, rid: n.rid, desc: n.desc, declaredPx: `[${r.x1},${r.y1}][${r.x2},${r.y2}]`,
946
978
  sampledPx: `[${r.x1},${y1}][${r.x2},${y2}]`, dy, ink: c.ink, bg: c.bg,
947
979
  inkShare: Math.round(c.inkShare * 1e4) / 1e4, bgUniform: c.bgUniform,
948
- visible: s.visible, dySource });
980
+ visible: s.visible, dySource, kind, frame });
949
981
  }
950
982
  return rows;
951
983
  }
952
984
 
985
+ /** A scroll frame's icons plus how far its content scrolled from the primary capture (image px, null = unknown). */
986
+ interface FrameIcons { rows: IconRow[]; offsetPx: number | null; }
987
+
988
+ /**
989
+ * Scroll distance between two captures of one page: texts that occur once in each frame and moved by the same dy.
990
+ * Fixed chrome (toolbar title) does not move, so only non-zero dy values vote. Null when nothing moved or no text is shared.
991
+ */
992
+ function scrollDy(prev: Node[], cur: Node[]): number | null {
993
+ const once = (ns: Node[]): Map<string, Node> => {
994
+ const m = new Map<string, Node>(), dup = new Set<string>();
995
+ for (const n of ns) {
996
+ const t = n.text.trim();
997
+ if (!t) { continue; }
998
+ if (m.has(t)) { dup.add(t); } else { m.set(t, n); }
999
+ }
1000
+ for (const t of dup) { m.delete(t); }
1001
+ return m;
1002
+ };
1003
+ const a = once(prev), b = once(cur);
1004
+ const votes = new Map<number, number>();
1005
+ for (const [t, n] of b) {
1006
+ const p = a.get(t);
1007
+ if (!p || p.x1 !== n.x1) { continue; }
1008
+ const dy = p.y1 - n.y1;
1009
+ if (dy !== 0) { votes.set(dy, (votes.get(dy) ?? 0) + 1); }
1010
+ }
1011
+ let best: number | null = null, hits = 0;
1012
+ for (const [dy, c] of votes) { if (c > hits) { best = dy; hits = c; } }
1013
+ return best;
1014
+ }
1015
+
1016
+ const pxBox = (s: string): number[] => (s.match(/-?\d+/g) || []).map(Number);
1017
+
1018
+ /**
1019
+ * Merge the scroll frames' rows into the primary inventory. Primary rows stay as they are (list rows sharing a key
1020
+ * merge downstream in icon_coverage). The same icon across captures is found by resource-id, else content-desc, else
1021
+ * the same box — at the same screen place (fixed chrome repeats in every frame) or at the same place in the scrolled
1022
+ * content (box shifted by the frame's scroll offset, ±6px). A scroll frame adds at most one row per key: for an icon not
1023
+ * seen before, or when every earlier row of that key read blank and this frame draws it; an icon seen again only records
1024
+ * the frame in `frames`. A scroll frame's node index is not the primary's, so a new index key becomes `s<N>_node<idx>`.
1025
+ */
1026
+ function mergeFrameIcons(primary: IconRow[], frames: FrameIcons[]): IconRow[] {
1027
+ const out: IconRow[] = [...primary];
1028
+ const named = new Map<string, string>();
1029
+ const boxes: { b: number[]; contentY: number | null; key: string }[] = [];
1030
+ const remember = (r: IconRow, offset: number | null): void => {
1031
+ const name = r.rid ? 'r:' + r.rid : r.desc.trim() ? 'd:' + r.desc.trim() : '';
1032
+ if (name) { if (!named.has(name)) { named.set(name, r.key); } return; }
1033
+ const b = pxBox(r.declaredPx);
1034
+ boxes.push({ b, contentY: offset === null ? null : b[1] + offset, key: r.key });
1035
+ };
1036
+ const lookup = (r: IconRow, offset: number | null): string | undefined => {
1037
+ const name = r.rid ? 'r:' + r.rid : r.desc.trim() ? 'd:' + r.desc.trim() : '';
1038
+ if (name) { return named.get(name); }
1039
+ const b = pxBox(r.declaredPx);
1040
+ const sameSize = (o: number[]): boolean => o[0] === b[0] && o[2] === b[2] && o[3] - o[1] === b[3] - b[1];
1041
+ const fixed = boxes.find((x) => sameSize(x.b) && x.b[1] === b[1]);
1042
+ if (fixed) { return fixed.key; }
1043
+ if (offset === null) { return undefined; }
1044
+ return boxes.find((x) => sameSize(x.b) && x.contentY !== null && Math.abs(x.contentY - (b[1] + offset)) <= 6)?.key;
1045
+ };
1046
+ for (const r of primary) { remember(r, 0); }
1047
+ for (const { rows, offsetPx } of frames) {
1048
+ const best = new Map<string, IconRow>();
1049
+ for (const r0 of rows) {
1050
+ let key = lookup(r0, offsetPx);
1051
+ if (!key) {
1052
+ key = /^node\d+$/.test(r0.key) ? `s${r0.frame}_${r0.key}` : r0.key;
1053
+ remember({ ...r0, key }, offsetPx);
1054
+ }
1055
+ const r = { ...r0, key };
1056
+ const cur = best.get(key);
1057
+ if (!cur || (r.visible && (!cur.visible || (r.bgUniform && !cur.bgUniform)))) { best.set(key, r); }
1058
+ }
1059
+ for (const [key, r] of best) {
1060
+ const seen = out.filter((x) => x.key === key);
1061
+ if (!seen.length || (r.visible && !seen.some((x) => x.visible))) { out.push(r); continue; }
1062
+ const first = seen[0];
1063
+ first.frames = [...new Set([...(first.frames ?? []), r.frame])];
1064
+ }
1065
+ }
1066
+ return out;
1067
+ }
1068
+
953
1069
  function hexRgbArr(h: string): number[] {
954
1070
  return [1, 3, 5].map((i) => parseInt(h.slice(i, i + 2), 16));
955
1071
  }
@@ -1200,6 +1316,7 @@ function main(): void {
1200
1316
  let metaDensity: number | null = null;
1201
1317
  let metaScreen: ScreenSize | null = null;
1202
1318
  let metaStatusBarPx: number | null = null;
1319
+ const scrollFrames: { frame: number; shot: string; xml: string }[] = [];
1203
1320
  const cliDensity: number = parseFloat(arg('--density') || '0');
1204
1321
  if (fs.existsSync(metaP)) {
1205
1322
  try {
@@ -1208,6 +1325,15 @@ function main(): void {
1208
1325
  const root: string = path.dirname(dir);
1209
1326
  if (typeof meta.screenshot === 'string') { shot = path.resolve(root, meta.screenshot); }
1210
1327
  if (typeof meta.view_xml === 'string') { vx = path.resolve(root, meta.view_xml); }
1328
+ // Scroll captures (screenshots[i] pairs with view_xmls[i]); index 0 is the primary pair above.
1329
+ if (Array.isArray(meta.screenshots) && Array.isArray(meta.view_xmls)) {
1330
+ const ss = meta.screenshots as unknown[], xs = meta.view_xmls as unknown[];
1331
+ for (let i = 1; i < Math.min(ss.length, xs.length); i++) {
1332
+ if (typeof ss[i] === 'string' && typeof xs[i] === 'string') {
1333
+ scrollFrames.push({ frame: i, shot: path.resolve(root, ss[i] as string), xml: path.resolve(root, xs[i] as string) });
1334
+ }
1335
+ }
1336
+ }
1211
1337
  const dev = meta.device_info as Record<string, unknown> | undefined;
1212
1338
  if (dev && typeof dev.density === 'number' && dev.density > 0) {
1213
1339
  metaDensity = dev.density;
@@ -1392,9 +1518,40 @@ function main(): void {
1392
1518
  // Screenshot ↔ view-tree registration, then every visible icon sampled at its registered position
1393
1519
  const skipOcc = (n: Node): boolean => coverOf.has(n);
1394
1520
  const reg: Registration | null = im && cs ? registration(im, cs, nodes, skipOcc) : null;
1395
- const icons: IconRow[] = im && cs && reg
1396
- ? iconInventory(im, cs, nodes, tree, reg, d ? Math.round(16 * d) : 32, skipOcc, root) : [];
1521
+ // Icon size window: ≥16dp (all classes), ≤96dp for non-ImageView leaves (larger is a picture/background, not an icon)
1522
+ const iconMin: number = d ? Math.round(16 * d) : 32;
1523
+ const iconMax: number = d ? Math.round(96 * d) : 192;
1524
+ const primaryIcons: IconRow[] = im && cs && reg
1525
+ ? iconInventory(im, cs, nodes, tree, reg, iconMin, iconMax, skipOcc, root) : [];
1397
1526
  if (reg && reg.ok === false) { console.error('!! ' + reg.note); }
1527
+ // Content below the first viewport is only in the scroll frames: an icon there must be in the inventory too.
1528
+ const frameRows: FrameIcons[] = [];
1529
+ // Scroll offset of each frame from the primary, chained through the frames already read (frame 4 may share no text with view.xml)
1530
+ const seenTrees: { nodes: Node[]; offset: number | null }[] = [{ nodes, offset: 0 }];
1531
+ for (const f of im ? scrollFrames : []) {
1532
+ if (!fs.existsSync(f.shot) || !fs.existsSync(f.xml)) { continue; }
1533
+ try {
1534
+ const fim: Png = decodePng(f.shot);
1535
+ const ftree: Node[] = parseNodes(fs.readFileSync(f.xml, 'utf8'));
1536
+ const fnodes: Node[] = ftree.filter((n) => n.x1 >= 0 && n.y1 >= 0 && n.x2 >= 0 && n.y2 >= 0);
1537
+ if (!fnodes.length) { continue; }
1538
+ const fcs: CoordSpace = coordSpace(fim, fnodes[0], metaScreen);
1539
+ const fcover: Map<Node, Node> = occluders(ftree);
1540
+ const fskip = (n: Node): boolean => fcover.has(n);
1541
+ const freg: Registration = registration(fim, fcs, fnodes, fskip);
1542
+ let offset: number | null = null;
1543
+ for (let k = seenTrees.length - 1; k >= 0 && offset === null; k--) {
1544
+ const dy = seenTrees[k].offset === null ? null : scrollDy(seenTrees[k].nodes, fnodes);
1545
+ if (dy !== null) { offset = (seenTrees[k].offset as number) + dy; }
1546
+ }
1547
+ seenTrees.push({ nodes: fnodes, offset });
1548
+ frameRows.push({ rows: iconInventory(fim, fcs, fnodes, ftree, freg, iconMin, iconMax, fskip, fnodes[0], f.frame),
1549
+ offsetPx: offset === null ? null : Math.round(offset * fcs.sy) });
1550
+ } catch (e) {
1551
+ console.error(`!! scroll frame ${f.frame} skipped for icon_inventory — ${String(e)}`);
1552
+ }
1553
+ }
1554
+ const icons: IconRow[] = mergeFrameIcons(primaryIcons, frameRows);
1398
1555
 
1399
1556
  // Four-edge color sampling: for judging background/scrim compositing and edge tinting under immersion (values only, no judgment).
1400
1557
  // With a nav bar, bottom/center are sampled within the app content area, and the nav bar itself is listed separately as nav_bar.
@@ -1564,10 +1721,13 @@ function main(): void {
1564
1721
  `(${reg.anchors.length} anchors) — ${reg.note}`);
1565
1722
  }
1566
1723
  if (icons.length) {
1567
- console.log(` ${col('icons')}: ${icons.length} ImageView(s); each needs an "// ICON: <key>" marker in code (phase5 [icons])`);
1724
+ console.log(` ${col('icons')}: ${icons.length} image node(s) (ImageView/ImageButton, or an image-sized leaf such as a Compose View); ` +
1725
+ 'each needs an "// ICON: <key>" marker in code (phase5 [icons])');
1568
1726
  for (const ic of icons) {
1727
+ const label: string = ic.kind === 'leaf' && ic.desc.trim() ? ` "${ic.desc.trim().slice(0, 16)}"` : '';
1569
1728
  console.log(` ${ic.key.padEnd(24)} ${ic.visible ? 'VISIBLE' : 'blank '} ink ${ic.ink} ${(ic.inkShare * 100).toFixed(1)}% on ${ic.bg}` +
1570
- ` at ${ic.sampledPx}${ic.dy ? ' (shifted dy ' + ic.dy + (ic.dySource === 'fallback' ? ', fallback' : '') + ')' : ''}`);
1729
+ ` at ${ic.sampledPx}${ic.frame ? ' in scroll frame ' + ic.frame : ''}${label}` +
1730
+ `${ic.dy ? ' (shifted dy ' + ic.dy + (ic.dySource === 'fallback' ? ', fallback' : '') + ')' : ''}`);
1571
1731
  }
1572
1732
  }
1573
1733
  console.log(` ${col('regions')}: ${regions.length} / all nodes ${nodes.length}`);
@@ -28,9 +28,10 @@ import * as path from 'node:path';
28
28
  import { spawnSync } from 'node:child_process';
29
29
  import { fileURLToPath, pathToFileURL } from 'node:url';
30
30
 
31
- import { _reported, _replace, _uiModule, etsSplit, reportPath } from './group_watch.mjs';
31
+ import { _reported, _replace, _uiModule, etsRoots, etsSplit, reportPath } from './group_watch.mjs';
32
32
  import { textColorDiff } from './text_color_diff.mjs';
33
33
  import { iconCoverage } from './icon_coverage.mjs';
34
+ import { convertedNodes, effectCoverage, groupNodes, loadEffects } from './overlay_effects.mjs';
34
35
  import { degradeReasons, drawCoverage } from './draw_coverage.mjs';
35
36
  import { branchCoverage } from './branch_coverage.mjs';
36
37
 
@@ -847,6 +848,36 @@ export function check(hp, files, rnd = null, group = null, android = null, repor
847
848
  rep.blocking += rep.icons.gate.length;
848
849
  }
849
850
  }
851
+ // Overlay host effects (overlay_effects.mjs): each effect of an edge touching this group's members, or with
852
+ // --files (Step 5.5 / Step 6 re-check) of an edge touching any converted node, has an attached
853
+ // // EFFECT: <id> somewhere in the ets roots, or an EFFECT-OMIT with a basis. A UTG without host_effects: skipped.
854
+ rep.effects = { gate: [], cand: [], checked: 0 };
855
+ {
856
+ const uiInfo = String(or(get(progress, 'ui_info_root'), pjoin(meta, 'ui_info')));
857
+ const edges = loadEffects(uiInfo);
858
+ const members = group ? groupNodes(uiInfo, group) : null;
859
+ if (edges.length && (!group || members)) {
860
+ const shared = [];
861
+ // Every module's ETS root, not only those the given files live in: with module placement the effect
862
+ // code sits in a feature module the --files list may not name. A file is named as `files` names it
863
+ // (ETS-relative in the UI module, project-relative elsewhere), so same-named files of two modules differ.
864
+ const walkFx = (r, d) => {
865
+ let es = [];
866
+ try { es = fs.readdirSync(d, { withFileTypes: true }); } catch { return; }
867
+ for (const e of es) {
868
+ const p = path.join(d, e.name);
869
+ if (e.isDirectory()) walkFx(r, p);
870
+ else if (e.name.endsWith('.ets')) {
871
+ const name = (r === uiRoot ? path.relative(r, p) : path.relative(path.resolve(hp), p)).replace(/\\/g, '/');
872
+ try { shared.push([name, fs.readFileSync(p, 'utf8')]); } catch { /* skip */ }
873
+ }
874
+ }
875
+ };
876
+ for (const r of new Set([...resOf.keys(), ...etsRoots(hp, ets).map((x) => path.resolve(x))])) walkFx(r, r);
877
+ rep.effects = effectCoverage({ edges, members, converted: group ? null : convertedNodes(uiInfo), files: [...texts], shared });
878
+ rep.blocking += rep.effects.gate.length;
879
+ }
880
+ }
850
881
  // Custom drawing in reach of this group without a drawing Harmony counterpart, and degraded lines whose only reason
851
882
  // is one conversion-procedure.md rules out (draw_coverage.mjs). The report is --report, else the --group's own
852
883
  // (queue_logs/<GID>.report.md); with neither, waivers cannot be read and the reason check has nothing to read.
@@ -969,6 +1000,16 @@ export function render(rep) {
969
1000
  outp.push(' Fix: render the icon and put // ICON: <key> on (or up to 3 lines above) its Image/SymbolGlyph line; ICON-OMIT is refused when the reference measurably draws it');
970
1001
  }
971
1002
  }
1003
+ const fx = rep.effects;
1004
+ if (fx && fx.checked) {
1005
+ outp.push(`\n[effects] overlay host effects vs // EFFECT markers (${fx.checked} effects): GATE ${fx.gate.length} (blocking), CAND ${fx.cand.length}`);
1006
+ outp.push(...fx.gate.map((x) => ` ${x}`));
1007
+ outp.push(...fx.cand.map((x) => ` [cand] ${x}`));
1008
+ if (fx.gate.length) {
1009
+ outp.push(' Fix: implement the effect where the overlay opens / dismisses and put // EFFECT: <id> on (or up to 3 lines above) the statement; ' +
1010
+ 'an effect that must not be ported gets // EFFECT-OMIT: <id> — <basis>');
1011
+ }
1012
+ }
972
1013
  for (const [k, title] of sections) {
973
1014
  const v = or(rep[k], []);
974
1015
  outp.push(`\n[${k}] ${title}: ${v.length}`);
@@ -24,10 +24,14 @@ import { checkOverlayInLinearContainer } from './rules/overlay_in_linear.ts';
24
24
  import { checkMediaContentUsable } from './rules/media_content.ts';
25
25
  import { checkFullViewportTint, checkRasterTint, checkSvgTintChannel } from './rules/media_tint.ts';
26
26
  import { checkOffsetInScrollContent } from './rules/offset_in_scroll.ts';
27
+ import { checkSeeThroughScrollOverlay } from './rules/see_through_overlay.ts';
28
+ import { checkJavaIntDivision } from './rules/int_division.ts';
27
29
  import { checkOrphanComponents } from './rules/orphan_component.ts';
28
30
  import { checkPageReachability } from './rules/page_reachability.ts';
29
31
  import { checkPercentHeightInScroll } from './rules/percent_height_in_scroll.ts';
32
+ import { checkPctSizeInHuggingOrScrollParent } from './rules/width_fill.ts';
30
33
  import { checkRelativeContainerInScroll } from './rules/relative_container_height.ts';
34
+ import { checkRelativeContainerCycle } from './rules/relative_container_cycle.ts';
31
35
  import { checkPopupMenuBound, checkPopupMenuDefaultLook } from './rules/popup_menu.ts';
32
36
  import { checkRequestPermissions } from './rules/request_permission.ts';
33
37
  import { checkRootWeightWrapped } from './rules/root_weight.ts';
@@ -35,8 +39,11 @@ import { checkSafeAreaInClippingAncestor } from './rules/safe_area_clipping.ts';
35
39
  import { checkSharedChromePlacement } from './rules/shared_chrome.ts';
36
40
  import { checkShellContent } from './rules/shell_content.ts';
37
41
  import { checkStackOccludingSibling, loadColors } from './rules/stack_occluding.ts';
38
- import { checkHitTest } from './rules/hit_test.ts';
42
+ import { checkHitTest, checkStackSingleAxisSwallow } from './rules/hit_test.ts';
39
43
  import { checkEventDefaultClick } from './rules/event_default_click.ts';
44
+ import { checkClickHandlers } from './rules/click_handler.ts';
45
+ import { checkCanvasNegativeOffset, checkHiddenLayerChildrenHit, checkOpaqueLayerSafeArea, checkRefreshReentry, checkThemeParamUnread } from './rules/compose_semantics.ts';
46
+ import { checkInsetDoubleApplied } from './rules/inset_stacked.ts';
40
47
  import { checkWaterFlowSectionGaps } from './rules/waterflow_sections.ts';
41
48
  import { checkStaggeredLanes } from './rules/staggered_lanes.ts';
42
49
  import { checkSelfDrawnSheet } from './rules/self_drawn_sheet.ts';
@@ -132,6 +139,7 @@ export function main(): void {
132
139
  checkBlurMirrored(scans, androidDir);
133
140
  checkSurfaceStroke(scans, androidDir);
134
141
  checkLottieHost(scans, androidDir);
142
+ checkJavaIntDivision(scans, androidDir);
135
143
  }
136
144
  checkEntryRootBuiltin(scans);
137
145
  checkDialogControllerV2(scans);
@@ -144,18 +152,29 @@ export function main(): void {
144
152
  checkOverlayInLinearContainer(scans);
145
153
  checkSharedChromePlacement(scans);
146
154
  checkPercentHeightInScroll(scans);
155
+ checkPctSizeInHuggingOrScrollParent(scans);
147
156
  checkRelativeContainerInScroll(scans);
157
+ checkRelativeContainerCycle(scans);
148
158
  checkSafeAreaInClippingAncestor(scans);
149
159
  checkFixedSizeExpandSafeArea(scans);
150
160
  checkWideConstantWidth(scans);
151
161
  checkStackOccludingSibling(scans, loadColors(resRoots));
152
162
  checkHitTest(scans);
163
+ checkStackSingleAxisSwallow(scans);
153
164
  checkEventDefaultClick(scans);
165
+ checkClickHandlers(scans);
166
+ checkRefreshReentry(scans);
167
+ checkThemeParamUnread(scans);
168
+ checkHiddenLayerChildrenHit(scans);
169
+ checkCanvasNegativeOffset(scans);
170
+ checkOpaqueLayerSafeArea(scans);
171
+ checkInsetDoubleApplied(scans);
154
172
  checkWaterFlowSectionGaps(scans, androidDir);
155
173
  checkStaggeredLanes(scans, androidDir);
156
174
  checkSelfDrawnSheet(scans, androidDir);
157
175
  checkWindowSizeConstant(scans, androidDir);
158
176
  checkOffsetInScrollContent(scans);
177
+ checkSeeThroughScrollOverlay(scans);
159
178
  checkEntryRoute(scans, etsRoots);
160
179
  checkRequestPermissions(etsRoots, argOf('--sdk') || process.env.DEVECO_SDK_HOME || '');
161
180
  // .hometrans defaults to four levels above the first --ets root (<proj>/<module>/src/main/ets → <proj>);
@@ -19,6 +19,19 @@ export const meta: RuleMeta[] = [
19
19
  escape: null,
20
20
  cases: [],
21
21
  },
22
+ {
23
+ id: "border-object-resets-radius",
24
+ levels: ["GATE"],
25
+ invariant: "appearance",
26
+ card: "resources",
27
+ needs: [],
28
+ summary: "on one attribute chain a `.borderRadius(non-zero)` comes first and a later `.border({…})` call has no `radius` field, with no `.borderRadius()` after it — `.border()` resets the corner radius to 0, so the stroke / card renders square.",
29
+ fix: "put the radius into the border object: `.border({ width, color, radius })`; or move `.borderRadius()` after `.border()` (border doc: border's radius defaults to 0; when color/radius are omitted, borderColor/borderRadius only take effect if written after border). Separate setters `.borderWidth().borderColor().borderRadius()` are not affected.",
30
+ escape: null,
31
+ cases: [
32
+ "Measured (CoolMall password login / add to cart / spec card): `.borderRadius(24).border({ width: 1, color })` — outlined buttons and spec cards meant to be rounded rectangles render square; filled buttons (no .border()) are unaffected, so \"only bordered components lose their corners\".",
33
+ ],
34
+ },
22
35
  ];
23
36
  // fullsize-container moved to rules/hit_test.ts: it is judged on the layer structure, not on one chain.
24
37
 
@@ -33,6 +46,37 @@ export const RE_PCT_HEIGHT = /\.height\((['"])100%\1\)/;
33
46
 
34
47
  export const RE_H_MARGIN = /\.margin\(\s*\{[^}]*(left|right|start|end)\s*:/;
35
48
 
49
+ /** A borderRadius argument that is literally zero (no corner to lose): 0, 0vp, 0px, '0'. */
50
+ const RE_RADIUS_ZERO = /^\s*(['"]?)0(?:vp|px)?\1\s*$/;
51
+
52
+ /** The argument text of the call whose `(` is at blob[open] (balanced brackets), or null when unbalanced. */
53
+ function callArg(blob: string, open: number): string | null {
54
+ let depth: number = 0;
55
+ for (let j = open; j < blob.length; j++) {
56
+ const c: string = blob[j];
57
+ if (c === '(' || c === '{' || c === '[') { depth++; } else if (c === ')' || c === '}' || c === ']') {
58
+ depth--;
59
+ if (depth === 0) { return blob.slice(open + 1, j); }
60
+ }
61
+ }
62
+ return null;
63
+ }
64
+
65
+ /** One `.borderRadius(…)` or `.border(…)` call on a chain, in source order. */
66
+ interface BorderCall { kind: 'radius' | 'border'; at: number; arg: string }
67
+
68
+ /** Every `.borderRadius(…)` / `.border(…)` call in blob, in source order (`.borderWidth` etc. are not matched). */
69
+ function borderCalls(blob: string): BorderCall[] {
70
+ const out: BorderCall[] = [];
71
+ for (const m of blob.matchAll(/\.(borderRadius|border)\s*\(/g)) {
72
+ const at: number = m.index ?? 0;
73
+ const arg: string | null = callArg(blob, at + m[0].length - 1);
74
+ if (arg === null) { continue; }
75
+ out.push({ kind: m[1] === 'border' ? 'border' : 'radius', at, arg });
76
+ }
77
+ return out;
78
+ }
79
+
36
80
  export function checkAttrChains(fctx: FileCtx): void {
37
81
  const { file, rel, src, code, rawLines, codeLines, inBlock } = fctx;
38
82
  const chains: Chain[] = attributeChains(codeLines);
@@ -45,5 +89,42 @@ export function checkAttrChains(fctx: FileCtx): void {
45
89
  report('GATE', 'pct-width-with-hmargin', rel, ch.start,
46
90
  "width('100%') combined with left/right margin → 100% does not subtract the element's own margin, so it is wider than its parent and overflows on the right");
47
91
  }
92
+
93
+ // ---- GATE border-object-resets-radius: .borderRadius(x>0) before a .border({…}) that has no radius → radius reset to 0
94
+ //
95
+ // ArkUI .border() and .borderRadius() write the same corner-radius property; a .border({ width, color }) with no
96
+ // radius resets the corners to 0, so an earlier .borderRadius(24) is lost and the stroke/card renders square.
97
+ // (HarmonyOS border doc: set borderColor/borderRadius AFTER border for them to take effect.) The separate
98
+ // setters .borderWidth()/.borderColor()/.borderRadius() do not go through the object form and are not affected.
99
+ //
100
+ // The calls are replayed in order, so every .border() on the chain is judged against the radius in effect when it runs:
101
+ // a later .borderRadius() restores the corners (the recommended fix), and a .border({ radius }) sets them itself.
102
+ let radius: string | null = null; // the non-zero radius currently in effect, if known
103
+ let lost: { at: number; radius: string } | null = null;
104
+ for (const call of borderCalls(blob)) {
105
+ if (call.kind === 'radius') {
106
+ radius = RE_RADIUS_ZERO.test(call.arg) ? null : call.arg.trim();
107
+ lost = null;
108
+ continue;
109
+ }
110
+ const obj: string = call.arg.trim();
111
+ if (!obj.startsWith('{')) { radius = null; lost = null; continue; } // .border(value) / variable form: not provable
112
+ const own: RegExpExecArray | null = /\bradius\s*:\s*([^,}]+)/.exec(obj);
113
+ if (own !== null) { // the border object sets the corners itself
114
+ radius = RE_RADIUS_ZERO.test(own[1]) ? null : own[1].trim();
115
+ lost = null;
116
+ continue;
117
+ }
118
+ if (radius !== null) { lost = { at: call.at, radius }; }
119
+ radius = null;
120
+ }
121
+ if (lost !== null) {
122
+ const line: number = ch.start + (blob.slice(0, lost.at).match(/\n/g)?.length ?? 0);
123
+ report('GATE', 'border-object-resets-radius', rel, line,
124
+ `.borderRadius(${lost.radius}) is set earlier in this chain, then .border({…}) is called with no radius field — ` +
125
+ '.border() and .borderRadius() write the same corner-radius property, so .border({ width, color }) resets the corners to 0 and the ' +
126
+ 'earlier radius is lost (the stroke / card renders square). Put the radius inside the border object (.border({ width, color, radius })), ' +
127
+ 'or move .borderRadius() after .border()');
128
+ }
48
129
  }
49
130
  }
@@ -0,0 +1,140 @@
1
+ // static_check/rules/click_handler.ts — handlers that can never do anything: bound on a node that is constant
2
+ // HitTestMode.None (click-handler-untestable), or with an empty / comment-only body (empty-click-handler,
3
+ // downgraded to unwired-handler by an `// UNWIRED:` marker that names the Android handler).
4
+ //
5
+ // HitTestMode.None: the node itself does not respond to the touch test, so its own onClick / onTouch / gesture never
6
+ // fires. An empty `.onClick(() => {})` takes the tap (HitTestMode.Default) and drops it; when the Android handler
7
+ // is not empty that is an entry the worker disabled without saying so.
8
+
9
+ import { report } from '../core/findings.ts';
10
+ import { CONTROL_ROOTS, attrsWithArgs, lineOfIndex, matchBracket } from '../core/parse.ts';
11
+ import type { UiAttr } from '../core/parse.ts';
12
+ import { inAttrArgs, maskedOf } from '../core/scan.ts';
13
+ import type { FileScan } from '../core/scan.ts';
14
+ import type { RuleMeta } from '../core/meta.ts';
15
+ import { hasBasis } from './hit_test.ts';
16
+
17
+ /** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
18
+ export const meta: RuleMeta[] = [
19
+ {
20
+ id: "click-handler-untestable",
21
+ levels: ["GATE"],
22
+ invariant: "interaction",
23
+ card: "interaction",
24
+ needs: [],
25
+ summary: "the same node binds `.onClick` / `.onTouch` / `.gesture(TapGesture|LongPressGesture …)` (`parallelGesture` / `priorityGesture` included) and writes the constant `.hitTestBehavior(HitTestMode.None)`. An expression that switches on a condition (`this.x === undefined ? HitTestMode.None : HitTestMode.Default`) does not count.",
26
+ fix: "`HitTestMode.None` takes the node itself out of the touch test, so its own click / gesture never fires. Remove that `hitTestBehavior`, or make it switch on whether the callback is set. Never use None to disable an entry silently when its target page is not in the conversion set: keep the node clickable, write `// UNWIRED: <Android handler file:line> — <reason>` in the handler (see `empty-click-handler`) and list it in the batch report's manual follow-ups.",
27
+ escape: null,
28
+ cases: [
29
+ "Measured (ydweather ds-1126 home page): the top-right \"+\" `.onClick` held only a TODO(route) comment, and the node and its wrapping Row both wrote `.hitTestBehavior(HitTestMode.None)`; the Android handler calls MainViewModel.showCityManagerPage. The target page was missing from the UTG and the worker disabled the entry silently; build, GATE 0 and smoke all passed.",
30
+ ],
31
+ },
32
+ {
33
+ id: "empty-click-handler",
34
+ levels: ["GATE"],
35
+ invariant: "interaction",
36
+ card: "interaction",
37
+ needs: [],
38
+ summary: "the arrow body of `.onClick(…)`, or of `.onAction(…)` on a `TapGesture` / `LongPressGesture`, is empty or holds only comments (`TODO` included). Not reported with `// CLICK-SINK: <basis>` on the line, up to 3 lines above it, or inside the body.",
39
+ fix: "implement the body from the Android handler. When intercepting the tap is deliberate (a popup card area that absorbs taps so its scrim does not dismiss), write `// CLICK-SINK: <basis>` on the line or up to 3 lines above it. When the Android handler is not empty but its target (page, popup) is not in this conversion set, write `// UNWIRED: <Android handler file:line> — <reason>`: it is downgraded to CAND `unwired-handler` and must be listed in the batch report's manual follow-ups as an upstream UTG gap, never as done.",
40
+ escape: "// UNWIRED: <Android file:line> —",
41
+ cases: [
42
+ "Same as click-handler-untestable: the onClick of the \"+\" button held only a TODO comment.",
43
+ ],
44
+ },
45
+ {
46
+ id: "unwired-handler",
47
+ levels: ["CAND"],
48
+ invariant: "interaction",
49
+ card: "interaction",
50
+ needs: [],
51
+ summary: "an empty handler carries `// UNWIRED: <Android file:line> — <reason>`: Android implements it, but the target is not in this conversion set.",
52
+ fix: "no code change; each one must be listed in the batch report's manual follow-ups (an upstream UTG gap) and never counted as done. Once the target page is added to the UTG and converted, implement the body and drop the marker.",
53
+ escape: null,
54
+ cases: [],
55
+ },
56
+ ];
57
+
58
+ /** Arrow handler whose block body holds nothing but whitespace (code has comments blanked). */
59
+ const RE_EMPTY_ARROW: RegExp = /^\s*(?:\([^()]*\)|[A-Za-z_$][\w$]*)\s*(?::\s*void\s*)?=>\s*\{\s*\}\s*$/;
60
+ /** Gesture argument that recognises a tap or long press. */
61
+ const RE_TAP_GESTURE: RegExp = /(?<![\w$.])(?:TapGesture|LongPressGesture)\s*\(/;
62
+
63
+ const RE_SINK: RegExp = /\/\/\s*CLICK-SINK\s*[::]\s*(.*)$/;
64
+ /** `// UNWIRED: <file>:<line> — <reason>` (the dash may be —, – or -). */
65
+ const RE_UNWIRED: RegExp = /\/\/\s*UNWIRED\s*[::]\s*(.*)$/;
66
+ const RE_UNWIRED_FULL: RegExp = /^(\S+?:\d+(?:-\d+)?)\s*[—–-]+\s*(.+)$/;
67
+
68
+ /** First marker matching re on lines [from, to] (1-based) of src, its text after the colon. */
69
+ function markerIn(lines: string[], from: number, to: number, re: RegExp): string | null {
70
+ for (let i = Math.max(1, from); i <= Math.min(lines.length, to); i++) {
71
+ const m: RegExpExecArray | null = re.exec(lines[i - 1]);
72
+ if (m !== null) { return m[1].trim(); }
73
+ }
74
+ return null;
75
+ }
76
+
77
+ /** Whether hitTestBehavior args are the constant None (a conditional expression is not). */
78
+ const constNone = (args: string): boolean => /^\s*HitTestMode\.None\s*$/.test(args);
79
+
80
+ /** The node takes taps itself: onClick / onTouch, or a tap / long-press gesture. */
81
+ function tapHandler(attrs: UiAttr[]): UiAttr | undefined {
82
+ return attrs.find((a) => a.name === 'onClick' || a.name === 'onTouch' ||
83
+ (/^(?:gesture|parallelGesture|priorityGesture)$/.test(a.name) && RE_TAP_GESTURE.test(a.args)));
84
+ }
85
+
86
+ /** GATE click-handler-untestable: a tap handler on a node that is constant HitTestMode.None. */
87
+ function checkUntestable(s: FileScan, masked: string): void {
88
+ for (const m of masked.matchAll(/(?<![\w$.])([A-Z][\w$]*)\s*\(/g)) {
89
+ const pos: number = m.index ?? 0;
90
+ if (CONTROL_ROOTS.has(m[1]) || inAttrArgs(masked, pos) ||
91
+ /\b(?:new|struct|function|class|interface|extends|implements)\s+$/.test(masked.slice(Math.max(0, pos - 20), pos))) { continue; }
92
+ const attrs: UiAttr[] = attrsWithArgs(s.code, pos + m[0].length - 1);
93
+ const h: UiAttr | undefined = tapHandler(attrs);
94
+ const none: UiAttr | undefined = attrs.find((a) => a.name === 'hitTestBehavior' && constNone(a.args));
95
+ if (h === undefined || none === undefined) { continue; }
96
+ report('GATE', 'click-handler-untestable', s.rel, lineOfIndex(s.code, h.index),
97
+ `${m[1]} binds .${h.name} and is .hitTestBehavior(HitTestMode.None) (line ${lineOfIndex(s.code, none.index)}): ` +
98
+ 'None takes the node out of the touch test, so its own handler never fires. Remove the hitTestBehavior (or make it ' +
99
+ 'depend on whether the handler is set); an entry whose target is not converted keeps its tap and marks the handler ' +
100
+ '// UNWIRED: <android file:line> — <reason>');
101
+ }
102
+ }
103
+
104
+ /** GATE empty-click-handler / CAND unwired-handler: onClick or tap / long-press onAction with an empty body. */
105
+ function checkEmpty(s: FileScan, masked: string, lines: string[]): void {
106
+ for (const m of masked.matchAll(/\.(onClick|onAction)\s*\(/g)) {
107
+ const dot: number = m.index ?? 0;
108
+ if (m[1] === 'onAction' && !/(?<![\w$.])(?:TapGesture|LongPressGesture)\s*\([^()]*\)\s*(?:\.\s*[A-Za-z_$][\w$]*\s*\([^()]*\)\s*)*$/
109
+ .test(masked.slice(Math.max(0, dot - 200), dot))) { continue; }
110
+ const paren: number = dot + m[0].length - 1;
111
+ const close: number = matchBracket(masked, paren);
112
+ if (close < 0 || !RE_EMPTY_ARROW.test(s.code.slice(paren + 1, close))) { continue; }
113
+ const line: number = lineOfIndex(s.code, dot);
114
+ const last: number = lineOfIndex(s.code, close);
115
+ const sink: string | null = markerIn(lines, line - 3, last, RE_SINK);
116
+ if (sink !== null && hasBasis(sink)) { continue; }
117
+ const unwired: string | null = markerIn(lines, line - 3, last, RE_UNWIRED);
118
+ const full: RegExpExecArray | null = unwired === null ? null : RE_UNWIRED_FULL.exec(unwired);
119
+ if (full !== null && hasBasis(full[2])) {
120
+ report('CAND', 'unwired-handler', s.rel, line,
121
+ `.${m[1]} left empty, UNWIRED: Android ${full[1]} — ${full[2]}. List it in the batch report's manual follow-ups ` +
122
+ 'as an upstream UTG gap; it is not done');
123
+ continue;
124
+ }
125
+ const bad: string = unwired !== null ? ' The UNWIRED marker needs the Android handler file:line, a dash and a reason.'
126
+ : sink !== null ? ' The CLICK-SINK marker needs a basis.' : '';
127
+ report('GATE', 'empty-click-handler', s.rel, line,
128
+ `.${m[1]} has an empty (or comment-only) body: the tap is taken and dropped. Implement the Android handler; ` +
129
+ 'mark a deliberate tap sink // CLICK-SINK: <basis>, or a handler whose target is not converted ' +
130
+ `// UNWIRED: <android file:line> — <reason> (then list it in the batch report as an upstream UTG gap).${bad}`);
131
+ }
132
+ }
133
+
134
+ export function checkClickHandlers(scans: FileScan[]): void {
135
+ for (const s of scans) {
136
+ const masked: string = maskedOf(s);
137
+ checkUntestable(s, masked);
138
+ checkEmpty(s, masked, s.src.split(/\r?\n/));
139
+ }
140
+ }