@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
@@ -14,6 +14,7 @@ import {
14
14
  PROGRESS_POLICY_PHRASES,
15
15
  PROGRESS_POLICY_PHRASES_EN,
16
16
  RUN_CONFIG_PROMPT_PHRASES,
17
+ SCHEDULE_DISCLOSURE_PHRASE,
17
18
  } from "../scripts/validate_workflow.mjs";
18
19
 
19
20
  const HERE = path.dirname(fileURLToPath(import.meta.url));
@@ -38,6 +39,7 @@ function englishPhrased() {
38
39
  };
39
40
  PROGRESS_POLICY_PHRASES.forEach((zh, i) => swap(zh, PROGRESS_POLICY_PHRASES_EN[i]));
40
41
  for (const [zh, en] of RUN_CONFIG_PROMPT_PHRASES) swap(zh, en);
42
+ swap(SCHEDULE_DISCLOSURE_PHRASE[0], SCHEDULE_DISCLOSURE_PHRASE[1]);
41
43
  swap(CONTEXT_BUDGET_PHRASE[0], CONTEXT_BUDGET_PHRASE[1]);
42
44
  // the English copy capitalises the sentence; the check is case-insensitive
43
45
  swap(NOT_A_STOP_SENTENCE[0], `C${NOT_A_STOP_SENTENCE[1].slice(1)}`);
@@ -58,11 +60,11 @@ test("the zh workflow still validates unchanged", () => {
58
60
  test("missing English phrases are still reported (by their zh name)", () => {
59
61
  let raw = englishPhrased();
60
62
  raw = raw.replaceAll("Migration progress", "Progress title");
61
- raw = raw.replaceAll("Do not explain scheduling to the user", "Scheduling may be explained");
63
+ raw = raw.replaceAll("Never put the human check gates and the run mode in the same question", "Human check gates and the run mode may share one question");
62
64
  const r = validateText(raw);
63
65
  assert.notEqual(r.status, 0);
64
66
  assert.match(r.stdout, /chat progress template phrase: 迁移进度/);
65
- assert.match(r.stdout, /must state: 不要向用户说明调度/);
67
+ assert.match(r.stdout, /must state: 禁止把人工检查闸门和运行方式放在同一次提问/);
66
68
  });
67
69
 
68
70
  test("ban on 推荐 also catches 'recommended' in any case", () => {
@@ -34,7 +34,8 @@ extraction to the commit.
34
34
  **API-reference** catalogue answered during the same Initialization probe. This gate is soft:
35
35
  `unavailable` skips the API lookups (use the local `.d.ts` and `references/ISSUES.md`) and
36
36
  records `api-docs: unavailable`. It never gates the chunk and never changes the
37
- `state-docs` verdict.
37
+ `state-docs` verdict. Lookups target the project's SDK version, and a non-deprecated API is
38
+ preferred.
38
39
  - `harmonyos-project-path` (abs) — target HarmonyOS project (the worktree under a pipeline dispatch): the
39
40
  tree you edit, and the only truth for what exists on this branch.
40
41
  - `android-project-path` (optional, abs) — Android source project root, consulted as a **reference**
@@ -148,11 +149,11 @@ extraction to the commit.
148
149
 
149
150
  **Platform API doc gate (shape: soft; semantics: mandatory).** `references/code-generation.md`
150
151
  Step 2 owns the trigger, commands, precedence and record. A working call site may satisfy a shape
151
- query; a call whose correctness depends on meaning — targets, ordering, capability level, units,
152
- addressed keys — must read the official page, and its record needs one verbatim sentence from it
153
- (a `SDK .d.ts` row does not count). Never record `available` without that sentence. A failed read
154
- is recorded `unavailable` and the chunk continues — the gate never blocks; only the shape half is
155
- skippable.
152
+ doc lookup but never the returned-field JSDoc check; a call whose correctness depends on meaning
153
+ — targets, ordering, capability level, units, addressed keys — must read the official page, and
154
+ its record needs one verbatim sentence from it (a `SDK .d.ts` row does not count). Never record
155
+ `available` without that sentence. A failed read is recorded `unavailable` and the chunk continues
156
+ — the gate never blocks; only the shape doc lookup (not the returned-field check) is skippable.
156
157
 
157
158
  Do the code generation, its scenario self-check (up to 3 iterations), and its
158
159
  MVVM + px/vp unit hook checks. Do not re-plan or override that workflow.
@@ -292,7 +293,7 @@ extraction to the commit.
292
293
  - `{output-path}/state_docs_used.md` — written by the doc gates: one row per state
293
294
  value (`value | scope | decorator | doc key`) plus `state-docs: available` / `unavailable` /
294
295
  `not-applicable` (the last when the chunk touches no UI state), and a `## Platform API lookups`
295
- section (one row per lookup, or "none") plus `api-docs: available` / `unavailable` /
296
+ section (one row per API, not per call site, or "none") plus `api-docs: available` / `unavailable` /
296
297
  `not-applicable`. The two verdict lines are independent: a missing or `unavailable` API line never
297
298
  changes the `state-docs` verdict the pipeline reads.
298
299
 
@@ -4,7 +4,7 @@
4
4
  * `ForEach` 的 key 生成函数必须包含所有会影响该项渲染的字段:只用 `id` 作 key 时,原地修改该项其他字段(状态、文案)后 ArkUI 会复用旧节点,界面不更新。key 应拼接影响显示的字段(如 `${item.id}:${item.status}`),或在修改时整体替换该项对象并触发数组更新。
5
5
  * 把父组件的 `@Builder` 方法传给子组件的 `@BuilderParam` 时,不能写成方法引用(如 `content: this.listContent`):Builder 实际在子组件里执行,`this` 指向子组件,读父组件的状态变量或 ViewModel 会得到 `undefined`,渲染时直接崩溃。这类问题常出在加载态/空态容器上,只有数据返回、首次渲染内容态时才触发,冷启动看不出来。传参时用箭头函数包一层以保留父组件的 `this`:`content: (): void => { this.listContent() }`。箭头函数体里**只能调用 @Builder**,不能直接写组件:`content: () => { RefreshLayout({…}) }` 能编译,但只有 @Builder 函数体会被编译成 UI 代码,箭头函数里的 `RefreshLayout({…})` 是对组件类的普通调用,渲染到该槽位即抛 `class constructor cannot called without 'new'` 闪退。组件写进 `@Builder listContent()`(或 `@LocalBuilder`),箭头函数只调它。
6
6
  * `@ComponentV2` 中,没有 `@Trace` 的字段被修改时 UI 不刷新,也不报错。在 `aboutToAppear` 里根据 `@Param` 算出来的值只算一次,父组件之后传入新值也不会更新:这类值放到 `build` 里计算,或用 `@Computed`;必须存成本地状态的,用 `@Monitor` 监听对应的 `@Param` 再赋值。
7
- * 文本测量结果是 px,不是 vp:`MeasureText.measureText` / `measureTextSize`(`@ohos.measure`)和 `getUIContext().getMeasureUtils()` 的同名方法,入参 `fontSize` 是 fp,但返回的宽高都是 **px**(`.d.ts` `@returns`:"both in px")。拿它和 vp 预算比较、或传给 `.width()` 之前,必须先 `this.getUIContext().px2vp(...)` 换算。实测(where-to-study 底部导航):把 `measureTextSize().width`(px)直接与 vp 格宽比较,在 3.5 倍密度下永远判定“放不下”,标签文字在任何设备上都不显示,而评审信了代码注释里“vp 输出”的说法。Canvas 的 `context.measureText()` 默认返回 vp,和它不同,不要混用经验。其他 API 的单位以 `.d.ts` 为准,见 code-generation.md Implementation Principle 6 的单位表;`scripts/check_units.ts` 会拦截这类写法。
7
+ * 文本测量结果是 px,不是 vp:`MeasureText.measureText` / `measureTextSize`(`@ohos.measure`)和 `getUIContext().getMeasureUtils()` 的同名方法,入参 `fontSize` 是 fp,但返回的宽高都是 **px**(`.d.ts` `@returns`:"both in px")。拿它和 vp 预算比较、或传给 `.width()` 之前,必须先 `this.getUIContext().px2vp(...)` 换算。实测(某应用底部导航):把 `measureTextSize().width`(px)直接与 vp 格宽比较,在 3.5 倍密度下永远判定“放不下”,标签文字在任何设备上都不显示,而评审信了代码注释里“vp 输出”的说法。Canvas 的 `context.measureText()` 默认返回 vp,和它不同,不要混用经验。其他 API 的单位以 `.d.ts` 为准,见 code-generation.md Implementation Principle 6 的单位表;`scripts/check_units.ts` 会拦截这类写法。
8
8
  * 大量列表(歌曲、消息、动态等可能上百条的列表/网格)不要用 `ForEach`:它首次加载就创建全部子节点,条目多时首帧卡顿明显甚至白屏超时。优先 `LazyForEach` + `IDataSource` 按需创建屏幕内节点;注意数据源变更必须经 `notifyDataReload` / `notifyDataAdd` / `notifyDataChange` 等接口通知,整体替换数组而不通知时 UI 不刷新(配合 `@Observed`/`@ObjectLink` 时是已见过的坑)。固定少量选项(菜单、页签)仍用 `ForEach` 即可。
9
9
  * 跨「无类型边界」进入强类型代码的值一律按可空归一,不允许假设有值:反序列化结果、数据库行、本地缓存、跨页传参都算。ArkTS 的类型只是编译期标注,运行时不做校验,`as T` 不会补默认值,`null` 会原样进入实体;映射只判 `=== undefined` 就漏了它——读侧在 `.length`、遍历、方法调用处抛 `TypeError`(闪退),数值比较则把 `null` 静默当 0;写侧被非空约束拒绝而写不进库,或写进 JSON 后读回缺值(对象内的 `null` 仍是 `null`,`undefined` 属性的键直接消失)。规则:归一一律写在做「外部数据→实体」映射的那个函数里,没有就先补一个;字段声明成 `?: T | null`,缺失时用 `??` 取类型默认值(字符串 `''`、数值 `0`、数组 `[]`、对象 `{}`),整体兜住后再逐项、逐字段归一;读库按列的可空声明取值,不要用空串或 0 冒充缺失;兜底只用 `??`,不要 `||` 或 `if (!v)`,它们会把合法的 `0`、`''` 当空值。非空字段上写 `=== null` 不算兜底:漏掉 `undefined`,还会被判为无重叠比较;正解是先把声明改成 `?: T | null`。
10
- * 平台 API 别凭记忆写,也别凭一次搜索结果选页:参数顺序、同步/异步、生命周期(create → use → destroy/off)和返回值单位以本地 `.d.ts` 为准,调用顺序与用法用 `scripts/state_doc.mjs search "<模块或方法>"` + `read-id "<documentId>" --section "<小节标题>" --max-lines 80` 取一段(API 页动辄两三千行,整页读会把正文上下文挤掉;重载会重复同名小节,`--section` 会把几个同名小节全带出来并标 `<!-- section "request" 2/3 -->`,要挑某一个时加 `--occurrence <n>`)。工作区里已有同一 API 的可用调用点时:**形状**问题(参数顺序、同步/异步、生命周期、返回值单位)可直接照抄、`.d.ts` 优先于文档;**含义**问题(作用目标、执行顺序、权限等级、边界、读写哪个键)即使有调用点也必须读官方页面,并以页面为准,记录里摘一句原文;小节标题旁的 `phone 12+` 之类标签高于工程 `compatibleSdkVersion` 时改用低版本重载或 `canIUse`。查不到就记 `api-docs: unavailable`,走 `.d.ts` 和本文件继续,不要静默猜。
10
+ * 平台 API 别凭记忆写,也别凭一次搜索结果选页:参数顺序、同步/异步、生命周期(create → use → destroy/off)和返回值单位以本地 `.d.ts` 为准(返回字段的可得性也是契约:非可选声明不代表运行期有值,字段注释写了 flag/option 条件时先确认调用满足),调用顺序与用法用 `scripts/state_doc.mjs search "<模块或方法>"` + `read-id "<documentId>" --section "<小节标题>" --max-lines 80` 取一段(API 页动辄两三千行,整页读会把正文上下文挤掉;重载会重复同名小节,`--section` 会把几个同名小节全带出来并标 `<!-- section "request" 2/3 -->`,要挑某一个时加 `--occurrence <n>`)。工作区里已有同一 API 的可用调用点时:**形状**问题(参数顺序、同步/异步、生命周期、返回值单位)可直接照抄、`.d.ts` 优先于文档;**含义**问题(作用目标、执行顺序、权限等级、边界、读写哪个键)即使有调用点也必须读官方页面,并以页面为准,记录里摘一句原文;小节标题旁的 `phone 12+` 之类标签高于工程 `compatibleSdkVersion` 时改用低版本重载或 `canIUse`。查文档时按工程 `compatibleSdkVersion` 选版本;优先使用非废弃 API——`.d.ts` 或文档标注 `@deprecated` 的 API 尽量不用,改用弃用说明给出的替代,确需使用时在 `## Platform API lookups` 的 `conclusion` 写明原因与后续替换计划。查不到就记 `api-docs: unavailable`,走 `.d.ts` 和本文件继续,不要静默猜。
@@ -70,6 +70,7 @@ Implementation principles conclude the principles that must be strictly followed
70
70
  **A dependent request inherits an unavailable upstream.** A request is dependent when its URL, headers or body use a value from an earlier response (including a credential such as a login token). When that upstream produced no evidence, do not attempt the dependent request and do not spend its budget: record `network-evidence: unavailable (upstream <request> unavailable)` and name the blocked chain in the self-check.
71
71
  **Probe only idempotent read-only exchanges.** Only HTTP GET/HEAD, or a query/command the source declares read-only, may be replayed. Never send a side-effecting exchange to a real service — POST/PUT/PATCH/DELETE, login, SMS/verification code, order, payment, delete, a notification push, or any state-changing command/frame: batch waves may hit the same endpoint from several chunks and duplicate the effect. Record `network-evidence: unavailable (side-effecting)` for it, take its body from the spec or, where the spec is open, from the anchored source (read the code that fills the payload; never send it); when neither settles it, report the gap instead of probing.
72
72
  This is never a gate: skip it when no route exists or no protocol-appropriate probe is available, and stop after 3 failed attempts **for that request** (retry only after correcting the request's own inputs; a protocol-level rejection — a non-2xx status, a non-OK gRPC status, or an error command/frame — is evidence, not a retry). Record one `network-evidence: <request> → <result> (verified)` line per request, where `<result>` is the status code, gRPC status, or response command/frame, or `network-evidence: unavailable (<reason>)` (again one per request) in the Step 3 self-check; only a scenario truly undecidable without the response becomes `issues.md` `missing_proof`. Never commit probe-only code, a token, or a captured payload.
73
+ 10. **A missing library/SDK/API never excuses skipping logic**: when no HarmonyOS third-party library, SDK module or platform API covers a step, implement that business logic yourself, following the spec's scenario steps and — where a `## 安卓代码参考` anchor exists — that Android code. Leaving a scenario step unimplemented because the dependency is absent is forbidden.
73
74
 
74
75
  ## ArkTS Code Generate Workflow
75
76
 
@@ -140,9 +141,18 @@ rendered value, write `state-docs: not-applicable` to `{output-path}/state_docs_
140
141
  **Platform API doc gate.** Two classes — the class decides, not the writer's confidence.
141
142
 
142
143
  *Shape (soft).* A platform API guessed by analogy compiles and misbehaves at runtime (wrong param
143
- order, a missing `await`, a callback that fires too early). Run the steps below when the worktree has
144
- no working call site for the API and its parameter order/types, sync/async, lifecycle, return shape
145
- or error path is unclear; otherwise skip it and record `api-docs: not-applicable`.
144
+ order, a missing `await`, a callback that fires too early). Run the doc lookup below when the
145
+ worktree has no working call site for the API and its parameter order/types, sync/async, lifecycle,
146
+ return shape or error path is unclear; otherwise skip it and record `api-docs: not-applicable`.
147
+ Skipping the doc lookup never skips the returned-field check.
148
+
149
+ **Returned-field check (always, even with a working call site).** A non-optional field in `.d.ts`
150
+ is not proof it exists at runtime: its JSDoc may state a condition (a flag, option, or flag-mask
151
+ bit) that controls whether the field is populated. When a call's result is used, open the `.d.ts`
152
+ that declares the **returned type** and read the JSDoc of every field you access plus its parent
153
+ chain (no siblings); an existing call site does not exempt this — it may omit the flag. Read at
154
+ most 10 field comments per chunk; past that, record `unverified (budget)` for the rest. If a
155
+ condition is named, confirm the call satisfies it.
146
156
 
147
157
  *Semantics (mandatory).* A signature says what exists, not what a call means. Read one section of the
148
158
  official page — even when a working call site exists — for any call whose correctness depends on:
@@ -158,9 +168,10 @@ Read each distinct API once per chunk — dedupe by API, not by call site — at
158
168
  only from `SDK .d.ts`, does not satisfy this gate. Past the cap, or when the page cannot be read,
159
169
  record `api-docs: unavailable` with the key and continue; never record `available`.
160
170
 
161
- Source precedence: for **shape**, a working call site first, then `.d.ts`, then the official page; for
162
- **meaning**, the official page outranks both. A difference in behaviour (not existence) goes in
163
- `## Spec deviations`.
171
+ Source precedence: for **shape**, a working call site first, then `.d.ts`, then the official page;
172
+ the returned-field check is independent of that order and still needs the field's `.d.ts` JSDoc when
173
+ a call site exists. For **meaning**, the official page outranks both. A difference in behaviour (not
174
+ existence) goes in `## Spec deviations`.
164
175
 
165
176
  1. Search once for the module, not for prose: `node <skill-dir>/scripts/state_doc.mjs search
166
177
  "@ohos.net.http request" --limit 3`. Only the `harmonyos-guides` and `harmonyos-references`
@@ -182,13 +193,23 @@ Source precedence: for **shape**, a working call site first, then `.d.ts`, then
182
193
  3. Budget: at most 3 searches and 2 section reads per chunk for shape queries. Semantics reads are
183
194
  separate and deduped by API: one section per distinct API, at most 5 per chunk; the rest are
184
195
  recorded `api-docs: unavailable`.
185
- 4. Guard the API level: the doc tags a section `phone 12+ | 2in1 13+ …`. If the tag is above the
186
- project's `compatibleSdkVersion` (or the module's `minAPIVersion`), use the fallback the doc
187
- names (`canIUse`, an older overload, or a different API) instead of the newer call.
188
- 5. Record one row per lookup in the `## Platform API lookups` section of `state_docs_used.md`
189
- (`api | catalog | documentId or key | section | API level | conclusion`), plus one verdict line
196
+ 4. Read the API for the project's SDK version, and never use a deprecated one:
197
+ - Version: the doc tags a section `phone 12+ | 2in1 13+ …`. Read and take the shape the project's
198
+ `compatibleSdkVersion` (or the module's `minAPIVersion`) supports; a tag above it means use the
199
+ fallback the doc names (`canIUse`, an older overload, or a different API), not the newer call.
200
+ - Deprecation: prefer a non-deprecated API. An API a doc section or the `.d.ts` marks
201
+ `@deprecated` / "Deprecated" should be avoided even though it compiles; use the replacement the
202
+ deprecation note names, and when the deprecated API has to be used, record why and the planned
203
+ replacement in the `conclusion` column of `## Platform API lookups`.
204
+ 5. Record one row per **API** (not per call site) in the `## Platform API lookups` section of
205
+ `state_docs_used.md`:
206
+ `api | catalog | documentId or key | section | API level | returned fields | conclusion`.
207
+ Put checked conditional fields in `returned fields` (`field: requires <flag>; passed`, or `-`);
208
+ keep `conclusion` for the official-page sentence. A `.d.ts`-only row uses `catalog: SDK .d.ts`
209
+ with `section`/`conclusion` as `-`; it is shape evidence only and never by itself yields
190
210
  `api-docs: available`.
191
- - Not needed → `api-docs: not-applicable`.
211
+ - No semantics lookup needed → `api-docs: not-applicable`.
212
+ - A required semantics page was read → `api-docs: available`.
192
213
  - `api-docs-mode: unavailable` (the dispatcher's field), the wrapper exits non-zero, or the
193
214
  section is not found → `api-docs: unavailable`, record the failed query/ID and the error, then
194
215
  continue from the `.d.ts` and `references/ISSUES.md`. Never block the chunk and never guess
@@ -16,12 +16,11 @@ Two modes share one conversion engine:
16
16
  1. **Full batch mode** (default) — convert every page of the app. The user supplies an Android project and a Harmony project (usually empty or scaffold-only). Follow this document top to bottom.
17
17
  2. **Incremental mode** — the user already has a working HarmonyOS version and wants only a specific page, or the missing pages of one semantic module. Trigger on "增量迁移", "迁移短视频播放页", "把某个模块缺失的页面补齐", or any request naming a page/screen/module instead of the whole app.
18
18
 
19
- **Full mode is not linear: capture and conversion overlap.** Plan the run (and the todo list) as three concurrent tracks, not as Steps 2 → 3 → 4 → 5:
19
+ **Capture and conversion do not overlap.** Plan the run (and the todo list) as two tracks, not as Steps 2 → 3 → 4 → 5:
20
20
  - **resources** (Step 2) runs as a background agent from the start;
21
- - **capture** (Steps 3.1–3.2) runs in the parent;
22
- - **conversion** (Steps 4–5) starts at the first `run_cycle.mjs` return after Step 2 is joined (Step 3.2 item 5, "Convert while exploring"); its background sub-agents, scheduled by `group_queue.mjs`, convert while capture continues.
21
+ - **capture** (Steps 3.1–3.2) runs in the parent.
23
22
 
24
- Following the steps linearly leaves conversion idle for the whole capture, which can take hours.
23
+ **Conversion** (Steps 4–5) starts only after `run_cycle.mjs` prints `finished: true` (Step 3.2 item 5), so it converts the final page set once, with no page being recaptured underneath it.
25
24
 
26
25
  **Incremental mode** runs `./references/incremental-scope.md` **I1–I5** (scope resolution, gap analysis, mandatory user confirmation, targeted capture). I5 runs the same `a2h-utg-explorer` cycle as Step 3.2, limited to the scope (`plan.mjs --scope`), and builds the plan with `build_conversion_set.mjs --scope --existing`; it needs no crawler and no model key. I1–I5 replace Steps 3.2–3.3 and the page discovery at the top of Step 4. Step 3.1 still covers the whole app, unless `reuse_static_workspace` was copied in (Step 3.1). Steps 0–2 run in both modes with the deltas noted inline. Everything from Step 4.1 onward is **identical in both modes and must not be forked**; in particular do not skip 4.3, or the scope's animations are dropped.
27
26
 
@@ -124,7 +123,7 @@ node <a2h-resource-convert-skill>/scripts/svg_fidelity_check.ts \
124
123
 
125
124
  ## Step 3 — Page Capture
126
125
 
127
- **Read [references/step3-capture.md](references/step3-capture.md) in full before starting Step 3.** It is the complete procedure: reviewer prompts and waves, every `config.json` field, the fixture server, the recovery classes, "Convert while exploring", plan refresh and backfill, the export layout and the `pages.json` fallback. The checklist below does not replace it.
126
+ **Read [references/step3-capture.md](references/step3-capture.md) in full before starting Step 3.** It is the complete procedure: reviewer prompts and waves, every `config.json` field, the fixture server, the recovery classes, the post-cycle conversion, plan refresh and backfill, the export layout and the `pages.json` fallback. The checklist below does not replace it.
128
127
 
129
128
  ### Step 3.1 — Static UTG Skeleton (both modes, whole app)
130
129
 
@@ -152,14 +151,14 @@ The parent drives `a2h-utg-explorer`'s `run_cycle.mjs` from its `scripts/` direc
152
151
  2. **Plan and compile.** `node plan.mjs $S/utg.json $C`, review `C/plan.md`, then `node compile_tasks.mjs $S/utg.json $C --project <android_project_dir> --locale <device locale>`.
153
152
  3. **Write `$C/config.json`** — `serial`, `package`, `launch_component`, `"adb": "<ADB_PATH>"` when the caller passed `ADB_PATH`, empty fixtures for phases whose `requires` is empty, `snapshot_dir` / `fixture_server_dir` — then **start the fixture server** with `detach.mjs start … --name fixture_server --service`. `d_prereqs.mjs check` must exit 0 before the first cycle.
154
153
  4. **Run the cycle.** Always in the background: `node <this skill>/scripts/detach.mjs start ${harmony_project_dir} --name run_cycle -- node run_cycle.mjs $C --config $C/config.json --static $S/utg.json --project <android_project_dir> --package <app package>`. While `finished` is false, dispatch a reviewer for every `waiting` part not yet dispatched (at most `--max-agents`, `blocked_on` first) and start the cycle again once every `blocked_on` worklist is complete. Never ask the user between calls. Recovery A–D and direct launch run inside the cycle without confirmation; pass `--skip D` only when the user forbids app-data changes.
155
- 5. **Export and build the conversion set** after **every** `run_cycle.mjs` return:
154
+ 5. **Export and build the conversion set once `run_cycle.mjs` prints `finished: true`:**
156
155
 
157
156
  ```bash
158
157
  node <this skill>/scripts/export_ui_info.mjs $C --static-ws $S --out <ui_info_root>
159
- node <this skill>/scripts/build_conversion_set.mjs $S --ui-info <ui_info_root> # --exploring until finished
158
+ node <this skill>/scripts/build_conversion_set.mjs $S --ui-info <ui_info_root>
160
159
  ```
161
160
 
162
- **Convert while exploring.** Once Step 2's report exists: the first time run Step 4.4's `shell_contract.mjs`, Step 4.3 and `group_queue.mjs init`; every time, build packs and prompts for new groups and run one pass of the Step 5.4 loop before the next reviewer wave. When `finished` is true, run both commands once more without `--exploring`.
161
+ **Convert after the cycle finishes.** Once Step 2's report exists, run Step 4.4's `shell_contract.mjs`, Step 4.3 and `group_queue.mjs init`, then build packs and prompts for the groups and enter the Step 5.4 loop.
163
162
  6. **Stop the fixture server** once `finished: true`, or when Step 3.2 is abandoned: `detach.mjs stop ${harmony_project_dir} --name fixture_server`, then `d_prereqs.mjs release --config $C/config.json`. Step 7 repeats this unconditionally (after stopping `run_cycle`), so a run that ends before `finished` does not leave it running.
164
163
 
165
164
  Record for Step 7: coverage from `report.md`, phase states and `skipped` stages, `export_manifest.json` counts, `deferred_human.json`, and `conversion_set.json`'s `summary`.
@@ -210,6 +209,7 @@ Exit 0 is required. It checks, per page, that every declared screenshot/view tre
210
209
 
211
210
  - **4.1** Page set: incremental → I5's `pages.json`; else the user's list; else `pages.json` in file order (full mode always); Glob only without `pages.json`. Read each declared screenshot / view tree by its exact path, **all** frames of `screenshots` / `view_xmls`; a failed read marks the page `failed` with that path. Source-only pages check `source_hints` under `android_project_dir` instead.
212
211
  - **4.2** Groups come from `conversion_set.json` → `plan`; do not regroup by hand. Review once and report to the user: `entry_node`, `warning` groups, spurious `after` chains. Persist `plan.groups` into `batch_progress.json` on the first run.
212
+ - **Module placement.** When the project has a design doc (`project_design.md` with a `模块语义` table), the architecture decides each group's module, not the conversion agent. Run `node ./scripts/module_placement.mjs prepare --hp ${harmony_project_dir}`, fill `.hometrans/module_placement.json` from its worklist (every group gets the module whose semantics describe it, a member described by another module goes under `members`, and a UI module that receives nothing gets a reason under `unassigned`), then run `check` until it exits 0. Re-run `build_conversion_set.mjs`: each group then carries `module` / `member_modules`, and its `predicted_writes` are module-prefixed. Without a design doc `prepare` says so and every group stays in `${ui_module}` (`summary.placement: missing`).
213
213
  - **4.3** Grep (never Read) `resource_mapping.md` for "Lottie Animation Resources". No match → never mention Lottie. `Unknown` and multi-host rows go to Step 7.
214
214
  - **4.4** Resolve shared facts once, as `项目事实(<名>)` headings with citations (facts, not answers): `shell_contract.mjs` once before any prompt, `measure_pack.ts` per captured directory of each group (member pages and captured attached states: `<GID>.evidence.json`), `group_pack.mjs build` once per batch.
215
215
 
@@ -261,7 +261,7 @@ If a task-tracking tool is available, create one task per page, with already-`do
261
261
 
262
262
  7. **The shared registry surface is parent-owned while any other group is in flight.** Every concurrently dispatched group's prompt states: do not edit `main_pages.json`, `resources/**/element/*.json`, `oh-package*.json5`, `module.json5` or the ability's `loadContent()`. Instead, list the additions in the report under `registry_requests`. The parent applies each group's requests when that group is released, one group at a time. Merge, never overwrite: an existing name with a different value is a conflict, so keep the existing value and record it in the report.
263
263
  - **5.4** Never dispatch blocking waves. `Q init` once, then one pass per parent turn: release (`Q reap` → `Q release`), lease and dispatch (`Q lease`, pass `message` verbatim, `Q bind`), verify every `returned_unverified` group (`phase5_check.mjs --group`, `Q verified --summary`, which marks its pages `done` in `batch_progress.json`, then `group_commit.mjs`), then `Q wait` with a shell timeout above 9 min. Go on only when `summary.idle` is true, nothing is unverified and `summary.stuck` is empty.
264
- - **5.5** One background sub-agent (Step 0.1) does the wiring: confirm every `registry_requests` was applied, wire self-contained components and shell hosts, and wire navigation from `navigates_to`. No group is in flight any more, so this agent may edit the registry surface of Rule 7. The parent writes `${harmony_project_dir}/.hometrans/work/prompts/wiring.md` (the Step 5.5 procedure of step5-convert.md plus its inputs), dispatches it the way Step 2 is dispatched, and joins on `.hometrans/work/wiring.report.md`. **Gate (parent re-checks after the join):** `orphan-component` is zero, and `phase5_check.mjs --files <every file changed since the last group commit>` has `blocking` 0, and `node scripts/shell_requests.mjs verify --hp ${harmony_project_dir}` exits 0 (every ledger id answered, every deleted `.ets` has its merge line), before Step 6. Run `shell_requests.mjs collect` before writing `wiring.md` and put its table in the prompt; carry every `deferred` row into Step 7's Manual Follow-up TODOs. Take that file list from `git status --porcelain` (modified and untracked), not from the report: a file the agent edited but left out of the report would otherwise skip the gate and still be committed. The parent then commits the wiring.
264
+ - **5.5** One background sub-agent (Step 0.1) does the wiring: confirm every `registry_requests` was applied, wire self-contained components and shell hosts, and wire navigation from `navigates_to`. No group is in flight any more, so this agent may edit the registry surface of Rule 7. The parent writes `${harmony_project_dir}/.hometrans/work/prompts/wiring.md` (the Step 5.5 procedure of step5-convert.md plus its inputs), dispatches it the way Step 2 is dispatched, and joins on `.hometrans/work/wiring.report.md`. **Entry gate:** `node scripts/group_queue.mjs status ${harmony_project_dir} --assert-settled` exits 0 (no group left open; see step5-convert.md item 5). After a `Q stop`, it cannot pass: skip Steps 5.5 and 6 and write the Step 7 report. **Gate (parent re-checks after the join):** `orphan-component` is zero, and `phase5_check.mjs --files <every file changed since the last group commit>` has `blocking` 0, and `node scripts/shell_requests.mjs verify --hp ${harmony_project_dir}` exits 0 (every ledger id answered, every deleted `.ets` has its merge line), before Step 6. Run `shell_requests.mjs collect` before writing `wiring.md` and put its table in the prompt; carry every `deferred` row into Step 7's Manual Follow-up TODOs. Take that file list from `git status --porcelain` (modified and untracked), not from the report: a file the agent edited but left out of the report would otherwise skip the gate and still be committed. The parent then commits the wiring.
265
265
 
266
266
  ## Step 6 — Static Check, Build, Smoke Gate
267
267
 
@@ -327,9 +327,9 @@ node ./scripts/detach.mjs stop ${harmony_project_dir} --name fixture_server #
327
327
  node <a2h-utg-explorer>/scripts/d_prereqs.mjs release --config ${harmony_project_dir}/.hometrans/utg_explore/config.json # only if that config.json exists
328
328
  ```
329
329
 
330
- **Order matters.** On an early exit `run_cycle` may still be running in the background (converting while exploring, a gate stops the run, a hand-off with groups `pending`). Stopping the server under it makes every recovery D recipe hit a closed URL and be recorded as "state cannot be built" (cf. Step 3.2's `check` rule). So end the cycle first: `stop` returns only after the wrapper has recorded the cycle's exit (or after 15 s, when it kills the wrapper too), and it is a no-op when the cycle is not `running`. To keep the cycle's results instead, wait until `detach.mjs status ${harmony_project_dir} --name run_cycle` no longer shows `running`, then stop the server.
330
+ **Order matters.** On an early exit `run_cycle` may still be running in the background (a gate stops the run, a hand-off with groups `pending`). Stopping the server under it makes every recovery D recipe hit a closed URL and be recorded as "state cannot be built" (cf. Step 3.2's `check` rule). So end the cycle first: `stop` returns only after the wrapper has recorded the cycle's exit (or after 15 s, when it kills the wrapper too), and it is a no-op when the cycle is not `running`. To keep the cycle's results instead, wait until `detach.mjs status ${harmony_project_dir} --name run_cycle` no longer shows `running`, then stop the server.
331
331
 
332
- The fixture server is a `--service` job: nothing else ends it, and Step 3.2.6 fires only on `finished: true`, which a run that converts while exploring may never reach. `stop` is idempotent (`state: unknown` / not `running` → no-op), so call it blindly. A later re-run of Step 3.2 starts the server again on the same port.
332
+ The fixture server is a `--service` job: nothing else ends it, and Step 3.2.6 fires only on `finished: true`, which a run that stops early never reaches. `stop` is idempotent (`state: unknown` / not `running` → no-op), so call it blindly. A later re-run of Step 3.2 starts the server again on the same port.
333
333
 
334
334
  Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.md`:
335
335
 
@@ -343,6 +343,7 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
343
343
  1. **Per-page results** — one row per group, giving:
344
344
  - page ids, `tier`, `status`, `output` files and the one-line `summary`;
345
345
  - `error` for failed pages;
346
+ - every group `Q status` still lists under `open`, with the `stop` record (`by`, `reason`) when the batch was stopped: these pages were not converted. Return `"ok": false` in that case, so the caller does not take a partial batch for a finished one;
346
347
  - a mark on every page whose evidence was parent-reconstructed.
347
348
  2. **Build status** — the outcomes of Steps 6.1, 6.2 and 6.3, including `[CANDIDATES]` reviewed but deliberately not "fixed", with the reason.
348
349
  In incremental mode, also list the 6.1 `[BASELINE]` section: defects that were in the project before this run, left as they were.
@@ -358,6 +359,7 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
358
359
  - **Degraded items (`已降级`)** — icons that could not be sourced (Phase 4.3 L3), and transitions declared but not implemented (过渡实现证据). They may ship degraded, but not unmentioned: paste the output of `node <skill>/scripts/draw_coverage.mjs degraded ${harmony_project_dir}` (every such line of every group report, verbatim) instead of choosing items by hand.
359
360
  - **Pending fetch (`待拉取`)** — Phase 4.3 **L2.5-Remote** icons. Give the original web path, the absolute URL, the suggested media name, and what the page renders meanwhile. Keep this list separate from `已降级`: these need only a download, whereas an L3 needs new artwork.
360
361
  - **Unfixed `error`-severity resource-fidelity rows** — anything the Step 2 gate flagged that was accepted rather than repaired.
362
+ - **Unwired entries (upstream UTG gaps)** — every `// UNWIRED:` marker still in the code (`grep -rn "// UNWIRED:" <ets roots>`, the static check's CAND `unwired-handler` lists the same set), with the `.ets` file:line, the Android handler file:line and the missing target. Each is an entry Android implements whose target page or overlay the UTG never reached: list it as a gap to fix in the static UTG and convert, never as done, and never fold it into another item.
361
363
  - **Smoke-gate items** — every non-`PASS` verdict: unresolved `FAIL_*` (verdict + evidence path + fixes attempted), `SKIPPED_*` (the reason) and `DEPLOY_ERROR` (the gate's message and any instruction it carries).
362
364
 
363
365
  ## Key Constraints
@@ -367,7 +369,7 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
367
369
  - **Work through the 常见误译速查 table** at the end of Phase 5 before declaring a page done. It is the static backstop; the only runtime check is Step 6.3's cold start.
368
370
  - **Edit `.ets` / `.json5` / `.json` only with the file edit/write tools, or a script that reads and writes UTF-8 explicitly.** Never `Get-Content … -replace … | Set-Content` or `(Get-Content f) -replace` in Windows PowerShell 5.1: it reads UTF-8 without BOM as the ANSI code page (GBK) and writes it back mangled.
369
371
  - **Do not hand-roll a route loop; use `scripts/capture_fast.mjs`.** It is the compliant fast path for a hybrid/uni-app shell: route jump, content-stable wait, real scroll probe, every scroll frame, `capture_quality`, and a resumable state file. If Step 3.2's route/task machinery cannot finish, this is the replacement — not a `screencap` + one `uiautomator dump` loop.
370
- - **Any capture path must pass `scripts/capture_audit.mjs` (exit 0) before Step 4.** That includes a capture made by another tool and a directory the user supplied. The audit is what makes `captured` a verified claim: every declared screenshot/view tree exists and is paired, the primary frame is not blank, `pages.json` still lists every captured page, and no scrolling page claims a completion it cannot prove (a partial sweep is listed as degraded, not hidden). A hand-rolled loop that writes "captured" dirs with blank frames or only the first viewport is how 26 pages were converted from a white rectangle and the `life` page lost its below-fold sections. Waiting for a fixed `sleep` after a route jump is not a readiness test: the frame has to *show* content, and the scroll has to *move*.
372
+ - **Any capture path must pass `scripts/capture_audit.mjs` (exit 0) before Step 4.** That includes a capture made by another tool and a directory the user supplied. The audit is what makes `captured` a verified claim: every declared screenshot/view tree exists and is paired, the primary frame is not blank, `pages.json` still lists every captured page, and no scrolling page claims a completion it cannot prove (a partial sweep is listed as degraded, not hidden). Waiting for a fixed `sleep` after a route jump is not a readiness test: the frame has to *show* content, and the scroll has to *move*.
371
373
  - **Never treat a route jump or a settled view tree as "page rendered".** For a hybrid app the view tree is one WebView node, so "stable" is immediate and "no `%1$s` placeholder" is always true. Readiness for those pages is decided by the frame (pixels), never by the tree.
372
374
  - **Incremental mode never overwrites a `placeholder` page without a backup.** Copy the existing `.ets` to `${harmony_project_dir}/.hometrans/backup/<timestamp>/<path relative to the project>` before the sub-agent writes, and report the path in §0b. Backups never go into the source tree: a `.bak` next to the page, or under `resources/` (contract item 2), would be committed with the conversion and shipped in the patch; `.hometrans/` is gitignored.
373
375
  - **Incremental mode may edit `loadContent()` and the app entry, and GATE `entry-route-not-converted` stays in force.** A migrated page that is routable but never reachable from the ability is invisible work. But if reconciling the route would change which screen an existing app opens on, say so and let the user decide.
@@ -33,3 +33,4 @@
33
33
  | **`Alignment.Start` 被当成「左上」** | ArkUI 九宫格 `Start` = 左 + 垂直居中,左上是 `TopStart` | `Scroll` 内容短于视口时悬在屏幕中部 | → Phase 5「文字对齐证据」的 `Scroll` 段;GATE `scroll-align-not-top` |
34
34
  | **纵向 `Scroll` 不写 `.align()`,理由是「SDK 没有 Scroll.align」或「内容恒超视口」** | 在 `scroll.d.ts` 里搜不到 `align`(它在 `CommonMethod`);参考帧恰好是满屏数据 | 列表条数少时整列悬在视口中部(分类商品页从左-中排起,安卓从左上) | `.align(Alignment.TopStart)`;数据驱动内容 GATE `scroll-align-default-center`,降级只认 `// SCROLL-CENTER:` |
35
35
  | **`LazyRow` 译成未定宽的横向 `Scroll`** | 只关注滚动方向,没看宽度;父卡片 `Column` 又没写 `alignItems` | 内容不足一屏时整排居中,安卓从左排起 | 横向 Scroll `.width('100%').align(Alignment.Start)`;GATE `hscroll-centered-in-column` |
36
+ | **顶栏的导航 / 动作两个槽位译成一个 `SpaceBetween` 的 `Row`,返回按钮包在 `if` 里** | Compose `TopAppBar(navigationIcon, actions)` 两个槽位一左一右,最顺手的译法是 `Row().justifyContent(FlexAlign.SpaceBetween)` 放两个子节点;参考截图恰好是带返回按钮的那条路由 | 不显示返回按钮时 Row 只剩 actions 一个子节点,SpaceBetween 把单个子节点放在起始端:右侧的「编辑」等按钮跑到左边 | 槽位布局:起始槽(`if` 里的返回按钮)、`Blank().layoutWeight(1)`、末端槽依次排列;或在 `else` 里放同宽占位。GATE `space-between-optional-lead` |
@@ -7,6 +7,7 @@
7
7
  - **自绘文字的字号单位**:`Paint.textSize` 是 px,源码一般写成 `sp(N)` / `dp(N)` / `applyDimension(...)` 换算。ArkUI `CanvasRenderingContext2D.font` 的字号单位只能是 `px` 或 `vp`,并且必须写明(SDK `canvas.d.ts`),其中 `px` 是**物理像素**。所以 `sp(N)` 要写成 `` `${N}vp` ``;要跟随系统字体缩放,就写 `` `${this.getUIContext().fp2px(N)}px` ``。**不能**把 sp 的数值直接接上 `px`。同一个 Canvas 的坐标默认按 vp 计,单位写错时排版位置照样正确,只有字小了一圈(density 2.625 时约为原来的 38%),几何自检会全部通过。自绘文字在 view tree 里没有节点,也没有 measurement;group pack 的「Canvas-drawn text」一节会列出每个 `drawText` 及其字号来源,逐条对照即可。机械兜底:GATE `canvas-font-px-literal`。
8
8
  - **自绘几何的坐标单位**:`CanvasRenderingContext2D` 的单位只由构造参数决定:`new CanvasRenderingContext2D(settings, unit?)`,`unit` 缺省为 `LengthMetricsUnit.DEFAULT`,**即 vp**(SDK `canvas.d.ts` 构造函数;`Graphics.d.ts` `DEFAULT = 0 // Length in vp`)。坐标、`lineWidth`、`setLineDash`、`measureText()` 的返回值都按 vp。Android 的 `dp(N)` 直接写 `N`,**不要**再乘 `vp2px(1)` / `densityPixels`,`measureText().width` 也不要再除以密度。确实需要物理像素时,构造为 `new CanvasRenderingContext2D(settings, LengthMetricsUnit.PX)`(`import { LengthMetricsUnit } from '@kit.ArkUI'`),不要手工乘密度。**没有** `ctx.units` 属性,也**没有** `CanvasUnit` 枚举。坐标多乘一次密度时,框、线放大 density 倍,定宽 Canvas 外侧的内容被裁掉,而 `vp` 字号不随之放大,编译、smoke、几何自检全部通过。机械兜底:GATE `canvas-coord-density-scaled`,`ctx.units =` / `CanvasUnit` 命中 GATE `sdk-api-nonexistent`。
9
9
  - **`Path` / 裁剪路径的 commands 单位是 px**:`Path({ commands })`、`.commands()`、`new Path({ commands })` 作 `.clip()` / `.clipShape()` 参数、`PathShape({ commands })` 的 SVG 路径串单位都是**物理像素**(SDK `path.d.ts`:「The unit is px」),而 `Path` 的 `width`/`height` 与 `onAreaChange` 给的 `Area.width/height` 是 vp。用 vp 数值拼 commands 时裁剪区缩小为 1/density。Compose 的 `clip(GenericShape { … })`、`drawBehind { path… }` 里是 px(`size` 本身就是 px),移植时同一几何要用 `vp2px()` 换算后再拼进 commands。机械兜底:GATE `path-commands-vp`。
10
+ - **画到画布外的内容**:Compose 的 `Canvas` / `drawBehind` 默认不裁剪,源码常把选中气泡、数值标签画在画布上沿之外(负 y),借用布局里在画布上方预留的空白(如 `Spacer(24.dp)` 后接 `Canvas`,气泡 `y = -14.dp`)。ArkUI `Canvas` 只在组件自身范围内绘制,照抄负坐标后气泡不在原位,还会压住上方的文字。移植时把预留的空白并进画布高度(画布加高同样的值,所有 y 整体下移),或者把气泡做成画布外的独立层(`Stack` 叠放,按选中点算 `position`)。机械兜底:CAND `canvas-negative-draw-offset`。
10
11
 
11
12
  ## 常见误译(编译期无法发现)
12
13
 
@@ -16,10 +16,41 @@
16
16
 
17
17
  **判据(用快照交叉验证,不靠自觉)**:`view_scroll_n.xml` 中同一 `resource-id` 的 bounds 或尺寸若在快照之间变化,且该变化**不能由滚动位移解释**(例如整块高度变小、而非整块上移),即为过渡证据 —— 必须能在本清单里找到对应条目。反之,清单里的每一条都要在 Phase 5 说明其实现状态。
18
18
 
19
- **端点回代(插值过渡必做)**:把过渡写成「起止常量 + 进度插值」时,起点常量只在首帧被看见,终点常量要滚动/点击后才显形。对每个插值的位置/尺寸,在鸿蒙侧的坐标原点下(`cards/geometry.md`「硬性要求(坐标系)」)算出进度 = 0 与 = 1 时的实际矩形,与起止两份快照里同一 `resource-id` 的 bounds 逐个对照(换算成安全区 vp);列成「元素 → 端点 → 算出区间 → 快照区间」表写进「过渡实现证据」。端点算不出或对不上,该过渡不得标 `已实现`。
19
+ **端点回代(插值过渡必做)**:把过渡写成「起止常量 + 进度插值」时,起点常量只在首帧被看见,终点常量要滚动/点击后才显形。对每个插值的位置/尺寸,在鸿蒙侧的坐标原点下(`cards/geometry.md`「硬性要求(坐标系)」)算出进度 = 0 与 = 1 时的实际矩形,与起止两份快照里同一 `resource-id` 的 bounds 逐个对照(换算成安全区 vp);列成「元素 → 端点 → 算出区间 → 快照区间」表写进「过渡实现证据」。端点算不出或对不上,该过渡不得标 `已实现`。**透明度 / alpha 同样要回代**:每个由进度算出的 `opacity`,把 p = 0 和 p = 1 分别代入鸿蒙侧表达式和 Android 源码表达式(用 `node -e` 跑出来,不心算),两边结果写在同一行;没有快照的页面(source-only)就以源码表达式的结果为准。两边在任一端点不一致即失败(典型:常量子式被化简后丢了符号,本应隐藏的一行在首屏就显示)。
20
20
 
21
21
  漏掉本节的典型后果:静态首屏完全正确,一旦滚动/点击/切换就与源 App 行为不同,而所有静态检查项均满分通过。
22
22
 
23
+ **MotionLayout 折叠头部(`OnSwipe` + 内容约束在头部底边)—— 头部消费滑动量,内容不从头部底下穿过**:Android 的典型写法是 scene 里 `OnSwipe(dragUp, touchAnchorId=<内容容器>)` 驱动 `startHeader → endHeader`,内容容器约束为 `Top_toBottomOf=@toolbar`,头部各层(`toolbar` 底色、铺满的头图 `ImageView`)都是 MotionLayout 自己的子 View。所以头部收起时,内容区的顶边跟着上移,**内容永远不会进到头部底下**;头部的底色和头图一直盖在它自己的区域里。鸿蒙侧按同一个约束关系来搭:
24
+
25
+ ```ts
26
+ // H_MAX / H_MIN = startHeader / endHeader 的头部高度(安全区 vp),progress = (H_MAX - headerH) / (H_MAX - H_MIN)
27
+ Column() {
28
+ XxxHeader({ progress: this.progress() }) // 根自己画底色 + 头图,透明度由 progress 驱动
29
+ .height(this.headerH)
30
+ Scroll(this.scroller) { /* 内容,没有顶部占位 */ }
31
+ .layoutWeight(1) // 可视区从头部底边开始 = Top_toBottomOf=@toolbar
32
+ .onScrollFrameBegin((offset: number) => {
33
+ // offset > 0:内容要往上走,先收头部
34
+ if (offset > 0 && this.headerH > H_MIN) {
35
+ const used: number = Math.min(offset, this.headerH - H_MIN);
36
+ this.headerH -= used;
37
+ return { offsetRemain: offset - used };
38
+ }
39
+ // offset < 0:往回拉,内容已经到顶时再展开头部
40
+ if (offset < 0 && this.scroller.currentOffset().yOffset <= 0 && this.headerH < H_MAX) {
41
+ const used: number = Math.min(-offset, H_MAX - this.headerH);
42
+ this.headerH += used;
43
+ return { offsetRemain: offset + used };
44
+ }
45
+ return { offsetRemain: offset };
46
+ })
47
+ }
48
+ ```
49
+
50
+ `onScrollFrameBegin` 的参数是即将发生的滚动量,Scroll 按返回的 `offsetRemain` 滚(Scroll API 文档)。所以头部没收完时内容一动不动,收完之后才开始滚,和 `OnSwipe` 的手感一致。外面套 `Refresh`(`SwipeRefreshLayout`)时,头部完全展开、内容也在顶部之后,剩余的下拉才交给刷新。头部背景要延伸到状态栏时,页根那层延伸背景只负责状态栏那一条(`cards/window.md` ③),头部在安全区内的部分由头部自己画。
51
+
52
+ **不要**写成「Scroll 顶部放一个等高占位 + 头部做成兄弟覆盖层 + `onDidScroll` 换算 progress」:内容会从头部底下滚过去,头部只要有一层没画背景,卡片就会透过头部文字露出来。GATE `scroll-driven-overlay-see-through`。如果确实要保留覆盖层结构,头部根节点必须自己画出 Android 头部的全部不透明层。
53
+
23
54
  **状态分支清单 —— 有截图的状态对截图,没截到的才逐分支对照源码**:参考快照只覆盖一部分状态(模式页签、展开/收起、空/有数据……)。`ATTACHED_NODES` 里的每个 `ui-state`、以及本页源码里每个按状态切换渲染的分支,都要登记成一行「状态 → 判断条件(`文件:行号`)→ 该分支下的构建/绘制调用 → 证据」。证据一栏按 `REFERENCE_SCREENSHOTS` 填写:该状态有自己的 `###` 分组时,写它的帧路径,并**按这些帧转换和核对**(与主状态同等对待,含 Phase 5 各项实测);没有分组的状态写「未捕获」。未捕获的状态没有截图可对,**只能靠源码分支逐条对照**,所以必须把分支里的调用列全:
24
55
 
25
56
  - 布局分支:`if (mode == DAY) addView(...)`、`when (selectedMode)` 等,列出每个分支里新增/隐藏的 View;
@@ -24,7 +24,7 @@
24
24
  | 负 margin(如 `layout_marginTop="-30dp"`) | 保留为负值 `.margin({top:-30})` 或 `.offset({y:-30})`,并在报告中说明用途 | 直接丢弃 → 该块及其后所有内容整体下移,常见于「顶部区域上移贴合状态栏」的场景 |
25
25
  | 元素自身的 `margin` | 落在**该元素**上 | 提升为父容器 `padding` → 影响同级所有子元素,同级元素被一起推移 |
26
26
  | `layout_constraintStart_toEndOf="parent"` (被推出可见区) | 该状态下不渲染,或按需 `.visibility()` | 当作普通约束照译 → 元素错误地留在屏内 |
27
- | `layout_height="wrap_content"` 的 ConstraintLayout 卡片(子节点 `Top_toTopOf="parent"` / `Bottom_toBottomOf="parent"`,如「图标纵向居中 + 右侧两行文字」) | `Row { Image; Column { 标题; 数值 } }`(`alignItems(VerticalAlign.Center)` 即纵向居中),角落元素用 `Stack` + `Alignment`;确需 `RelativeContainer` 时,纵向只锚兄弟节点(首个子节点不写纵向 alignRules,默认贴顶)并写 `.height('auto')`,或写参考 view tree 实测高度 | 逐条照译 alignRules 锚 `'__container__'` 的 top/bottom → RelativeContainer 文档:该方向有子组件以容器为锚点时 `"auto"` / `wrapContent` **不生效**、视为未设高度(容器高与子组件布局循环依赖,FAQ faqs-arkui-318);容器在 Scroll 里被撑到远高于 Android 的内容高度。补一个 `.height('auto')` 也修不好。GATE `relative-container-unsized-in-scroll` |
27
+ | `layout_height="wrap_content"` 的 ConstraintLayout 卡片(子节点 `Top_toTopOf="parent"` / `Bottom_toBottomOf="parent"`,如「图标纵向居中 + 右侧两行文字」) | `Row { Image; Column { 标题; 数值 } }`(`alignItems(VerticalAlign.Center)` 即纵向居中),角落元素用 `Stack` + `Alignment`;确需 `RelativeContainer` 时,纵向只锚兄弟节点(首个子节点不写纵向 alignRules,默认贴顶)并写 `.height('auto')`,或写参考 view tree 实测高度;兄弟锚定只能单向:文字列横向锚了图标,图标就不能再纵向 `center` 锚文字列(链除外:同一方向相邻组件首尾互锚 + 链头 `.chainMode()` 是文档允许的写法) | 逐条照译 alignRules 锚 `'__container__'` 的 top/bottom → RelativeContainer 文档:该方向有子组件以容器为锚点时 `"auto"` / `wrapContent` **不生效**、视为未设高度(容器高与子组件布局循环依赖,FAQ faqs-arkui-318);容器在 Scroll 里被撑到远高于 Android 的内容高度。补一个 `.height('auto')` 也修不好。GATE `relative-container-unsized-in-scroll`;改成「图标纵向锚文字列 + 文字列横向锚图标」→ 互相依赖,RelativeContainer 文档:环形依赖时子组件全部不绘制,卡片只剩背景(空胶囊,view tree `children: []`),编译与冒烟全过。GATE `relative-container-anchor-cycle` |
28
28
  | 二维约束:某元素只与**部分**兄弟共用一段纵向区间(如右下角的「箭头 + 差值」链只贴 `parent` 底、`start_toEndOf` 第二行文字;第一行标题右侧不受约束) | 保留二维关系:`RelativeContainer` + `.alignRules()`;或 `Stack`,角落元素按 `Alignment.BottomEnd` 等单独排,主体 `Row/Column` 撑满 | 拆成一维 `Row [图标][Column(标题, 数值).layoutWeight(1)][角落元素]` → 角落元素在**整个高度**上占一列,标题可用宽度被扣掉,`wrap_content` 的单行标题折成两行、卡片变高;照抄属性逐项都对,编译与检查全过 |
29
29
  | **固定 dp 尺寸** + `layout_constraintEnd_toEndOf="parent"` + `layout_marginEnd`(右锚定;`Bottom_toBottomOf` 同理为下锚定) | 表达为**对齐关系**而非坐标:`RelativeContainer` + `.alignRules()`(见 layout mapping 表 `ConstraintLayout → RelativeContainer`);或父 `Stack` 用 `Alignment.TopEnd` + 子 `.margin({right})`;或由父容器实测宽度推导 `x = parentWidth - marginEnd - childWidth` | 按参考分辨率算出绝对偏移写成 `.position({x: <常量>})` → 该常量**只在参考设备宽度上成立**,换到更窄的屏幕时元素右侧**移出可视区被裁切**。尺寸维度无歧义(dp 是显式的),最易漏检;或用撑满父容器的容器(`width('100%')` + `height('100%')` + 贴边对齐)承载该锚定 → 视觉正确,但它成为兄弟节点中的**最上层**,吞掉其下所有可点击元素的命中测试(`hitTestBehavior` 取默认值即响应命中),该区域点击全部失效 |
30
30
 
@@ -66,7 +66,7 @@ measure_summary 的 `dialog panel` 行为准(不是带背景 inset 的 window
66
66
  | `.width('100%')` 与 `.margin({left,right})` 叠加 | 直觉认为 `100%` 会自动扣掉 margin | 实际宽度 = 父宽 + 左右 margin,**右侧溢出**、圆角被裁 | 搜同一元素上同时出现 `width('100%')` 与左右 `margin`;改为父 `padding` 或 `layoutWeight(1)` |
67
67
  | **`0dp` + `layout_weight` 译成多个兄弟都 `width('100%')`** | 等分页签每个都"撑满自己那格",逐个看都对 | 第一个兄弟吃满整行,其余被挤出屏幕 | 权重一律 `.layoutWeight(n)`,`@Builder` 根节点同理。GATE `main-axis-pct-siblings` |
68
68
  | **竖向 `LinearLayout` 里的卡片不写宽度** | Android 子 View 不写 LayoutParams 也是满宽,源码里看不到 `MATCH_PARENT` | ArkUI `Column` 的子节点默认按内容收缩:每张卡宽度不同、右缘参差不齐,整页看起来"排版很乱" | 卡片 `.width('100%')`;tree-only 页按 group pack 的几何表(`full` 行)核对。GATE `card-width-wraps` |
69
- | **`wrap_content` 卡片译成未定高的 `RelativeContainer`,子节点锚容器上下边** | 二维约束一律译成 RelativeContainer(上表「二维约束」行)、以为它像 ConstraintLayout 一样按内容求高 | 卡片在 Scroll 里被撑高(天气首页日出/日落、信息卡);`.height('auto')` 在纵向锚容器时同样无效 | → 上表「`wrap_content` 的 ConstraintLayout 卡片」行。GATE `relative-container-unsized-in-scroll` |
69
+ | **`wrap_content` 卡片译成未定高的 `RelativeContainer`,子节点锚容器上下边** | 二维约束一律译成 RelativeContainer(上表「二维约束」行)、以为它像 ConstraintLayout 一样按内容求高 | 卡片在 Scroll 里被撑高;`.height('auto')` 在纵向锚容器时同样无效 | → 上表「`wrap_content` 的 ConstraintLayout 卡片」行。GATE `relative-container-unsized-in-scroll` |
70
70
  | **整卡蒙层写成 `.overlay('<颜色>')`** | `percent-height-in-scroll` 拦下 Stack 蒙层的 `'100%'` 后,改用 overlay 并以为字符串是颜色 | 色值当文字画在卡片左上角(「transparent」「#66FFFFFF」),蒙层不画 | `.overlay(@Builder)`,builder 根 `width/height('100%')` + `backgroundColor` + `hitTestBehavior(HitTestMode.Transparent)`。GATE `overlay-string-color` |
71
71
  | **WRAP 父 + MATCH 子译成 `constraintSize({ minHeight })` 父 + `'100%'` 子** | Android 的两遍测量会让 MATCH_PARENT 子在 WRAP_CONTENT 父里回落为内容高度,逐属性照译看着等价 | ArkUI 的百分比按上层约束解析,在 Scroll 里约等于视口,组件被撑得特别长;共享组件一错,多处同时出问题 | 子节点去掉 `'100%'`,改用 `alignItems` + `min…`。GATE `pct-in-auto-size-parent` |
72
72
  | 用父容器尺寸充当子元素的约束尺寸 | Android `0dp` + 约束被当成「填满父容器」 | 区域偏大/偏高,挤压后续内容 | 拿参考 view tree 的实测尺寸与父容器比;不等就不能用 `'100%'` |
@@ -83,3 +83,4 @@ measure_summary 的 `dialog panel` 行为准(不是带背景 inset 的 window
83
83
  | **`BasicTextField` 译成定高 `TextInput` 却没写 `.padding()`** | Compose `BasicTextField` / 无装饰 `EditText` 没有内边距,照抄 `height(24)` 看着就是 1:1 | ArkUI `TextInput`/`TextArea` 默认 padding 上下 8vp、左右 16vp(下划线模式上下 12vp),24vp 高只剩 8vp 给 16fp 文字:**输入文字只显示上半截**;左缘还多出 16vp | 对应 `.padding(0)`(文档建议同时 `.borderRadius(0)` 防光标被截);要留内距就把高度写成行高 + padding。GATE `text-input-default-padding-clips` |
84
84
  | **只靠背景显示的空容器没写宽或高** | Android `View` 的 `match_parent` / 约束尺寸来自父布局,背景图跟着 View 尺寸画;ArkUI 宽高缺省时取子组件内容的尺寸,空容器就是 0,`.background()` / `.backgroundImage()` 不参与测量 | 背景层宽度 0,头图、底色、分隔条整块不显示 | 每个没有子节点、只靠 background* / 渐变显示的容器两轴都要有尺寸来源(`'100%'` / 显式值 / `layoutWeight` / `size`);GATE `bg-only-container-collapsed` |
85
85
  | **`layout_weight` 译到自定义组件的 build() 根节点上** | Android 的 `layout_weight` 写在 View 自己身上,逐属性照译恰好落到组件内部根节点;调用处不链属性时它还真能生效 | 调用处一链属性(`.margin()`、`.onClick()` 都算),组件被套上 `__Common__` 节点,父 `Row`/`Column` 读不到权重:组件按内容收缩,**行尾留白** | 权重写在**调用处** `Cell({ … }).layoutWeight(1)`,**同时**内部根节点在父主轴上撑满(父 Row → `.width('100%')`);只移权重不撑满,背景仍按内容收缩。`@Builder` 内联展开,不受影响。GATE `layout-weight-on-component-root` |
86
+ | **`WaterFlow` 的 `FlowItem` 不写交叉轴尺寸** | `columnsTemplate('1fr 1fr')` 已经分好列,看起来不必再给 FlowItem 写宽度;子卡片照 Compose `fillMaxWidth()` 写 `.width('100%')` | 列宽不作为百分比基准传下去,卡片的 `'100%'` 按整个 WaterFlow 计算:卡片约等于整屏宽,`aspectRatio` 主图成了整屏宽的方图,相邻列的卡片盖在溢出部分上,列间距和卡片内边距都看不见 | 竖向瀑布流 `FlowItem() { … }.width('100%')`(横向写 `.height('100%')`),与 SDK 示例一致。GATE `flowitem-no-cross-size` |
@@ -7,6 +7,10 @@
7
7
  |---|---|---|
8
8
  | `stack-swallows-taps` (GATE) | `conversion-procedure.md` Phase 5「交互可达性证据」;API 参考《枚举说明》HitTestMode、FAQ faqs-arkui-549 | Stack 里后画的撑满层自身和子树都不收事件,却盖住前面的可点击兄弟:Default 会阻塞兄弟节点,有没有 onClick 都一样。加 `.hitTestBehavior(HitTestMode.None)` |
9
9
  | `fullsize-container` (GATE/CAND) | 同上 | 检查器按层叠结构证明不了不吞点击的撑满节点。GATE 只能靠改代码或检查器核验的标记 `// HIT-TEST: blocks-input:` / `covers-below:` 关闭,EVIDENCE 文字关不掉;CAND 是检查器看不到的部分(范围外组件、zIndex、无调用处) |
10
+ | `hidden-layer-children-hit` (GATE/CAND) | 交互映射表 HitTestMode 行;原子映射表 AnimatedVisibility 行;API 参考《枚举说明》HitTestMode | 用 opacity 隐藏、`hitTestBehavior` 在 None 和 Default 间切换的整层,子节点仍收点击。Android 不组合就用 `if` 卸载,过渡期间保留就用 `BLOCK_DESCENDANTS` |
11
+ | `refresh-programmatic-reentry` (GATE/CAND) | 布局映射表「下拉刷新(SwipeRefreshLayout)映射」第 4 条 | 代码把 `refreshing` 置为 true 也会触发 `onRefreshing`。用 `onStateChange` 区分用户下拉 |
12
+ | `click-handler-untestable` (GATE) | `conversion-procedure.md` Phase 4「入口不得静默禁用」;API 参考《枚举说明》HitTestMode | 常量 `HitTestMode.None` 让节点自身不参与触摸测试,同一节点上的 onClick / 手势永远不触发。目标未转换时保留可点击节点,写 `// UNWIRED:` 标记 |
13
+ | `empty-click-handler` (GATE) / `unwired-handler` (CAND) | 同上 | 空或只有注释的处理函数收走点击后什么都不做。照 Android 实现;故意拦截写 `// CLICK-SINK: <依据>`;目标不在转换集写 `// UNWIRED: <Android 文件:行> — <原因>`,降为 CAND 并进 Step 7 人工跟进项 |
10
14
  | `a11y-content-desc-unobservable` (GATE/CAND) | `references/checker-rules.md` 本条 | `uitest` 视图树只导出 `accessibilityDescription`。纯图标/符号控件补 `.accessibilityDescription(X)`,与 Android `content-desc` 同值 |
11
15
  | `orphan-component` (GATE) | `step5-convert.md` Step 5.5「Gate」与 self-contained 组件接线 | 没被 import 或实例化的 `export struct` 永远不会渲染:在宿主页 import、实例化,并把触发器接到它的显示开关上 |
12
16
  | `converted-page-unreachable` (GATE) | `step5-convert.md` Step 5.5「wire navigation to real pages」 | 沿 `conversion_set.json` 每页的 `navigates_to`,给每条指向已转换页的边写真实的 `router.pushUrl` 或组件切换,并登记 `main_pages.json` |
@@ -9,7 +9,25 @@
9
9
 
10
10
  **颜色运算 —— 不手写混色函数**:Android 的 `ColorUtils.blendARGB` / `setAlphaComponent` / `Color.parseColor`,以及 Compose 的 `Color.copy(alpha = x)` / `Color(0x…).copy(alpha = …)` / `colorResource(…).copy(alpha = …)`,一律用本 skill 的 `assets/ColorUtils.ets`。**两种 alpha 量纲不能混**:Compose `copy(alpha = 0.5f)` 是 0..1,对应 `withAlpha(c, 0.5)`;Android `ColorUtils.setAlphaComponent(c, 128)` 是 0..255,对应 `setAlphaComponent(c, 128)`。把 Compose 的 `0.5` 传给 `setAlphaComponent` 只得到 alpha 字节 `00`/`01`,颜色几乎全透明(禁用态按钮整块消失),GATE `alpha-scale-mismatch`;asset 版本把算出来的非整数 alpha(如 `0.3 * 255`)四舍五入到最近的字节,不抛错,超出 0..255 才抛错。ArkUI 颜色串是 `#AARRGGBB`,**alpha 在前**;把 alpha 两位拼在 `#RRGGBB` **后面**得到的 `#RRGGBBAA` 合法、不报错,但会被读成另一种颜色(`'#000000' + '1A'` = `#0000001A` → alpha 00,全透明;`'#FFFFFF1A'` → 不透明黄)。GATE `color-alpha-appended`。工程里没有 `<module>/src/main/ets/common/ColorUtils.ets` 时**原样复制**过去,不改写、不另起一份。它已对 androidx 逐位测过(含 `(int)` 截断:`blend(#FFFFFF, #E5E5EA, .62)` = `#EEEEF1`,四舍五入会得 `#EFEFF2`)。输入全是固定 Palette 值的混色,优先**预计算成字面量常量**并在注释写出来源公式。EVIDENCE 里的「公式回代一致」必须是**跑出来的**输出(如 `node -e`),不接受心算。
11
11
 
12
- **图标来源分级 —— 逐个图标判定并在报告中标注级别**:
12
+ **按参数分支的颜色 —— 两个分支都要译**:Compose 组件常按参数取色,`colorResource(if (isDark) R.color.color_white else R.color.color_black).copy(alpha = 0.5f)`。译文要保留这个参数和分支:`.fontColor(this.isDark ? 'rgba(255,255,255,0.5)' : 'rgba(0,0,0,0.5)')`,并在每个调用处把参数传下去。只看截图或只读一个调用处,容易只留下白色那一支;放到浅色背景上,文字、边框、图标就看不清。声明了参数却没读它是 GATE `theme-param-unread`;外壳契约 `theme.mode` 不是 static 时,`'rgba(…)'` 和 `'#…'` 一样算写死的颜色(GATE `theme-color-literal`)。
13
+
14
+ **先判图片来源 —— 数据绑定图片不是图标,不走 L1–L3**:分级之前,先看 Android 侧每张图的图源从哪里来。
15
+
16
+ - **数据绑定**:图源是运行时数据(后端下发的 URL、数据库字段、用户选的图)。Compose 的 `AsyncImage(model = …)`、`SubcomposeAsyncImage(model = …)`、`Image(painter = rememberAsyncImagePainter(<url>))`(Coil)、`GlideImage(model = …)`;View 的 `Glide.with(…).load(<url/字段>)`、`Picasso.get().load(…)`、Coil `imageView.load(…)`、`setImageURI` / `setImageBitmap` 取自模型字段、DataBinding 的 `app:imageUrl="@{item.icon}"` 一类 BindingAdapter。判据:`model =` / `load(…)` / painter 的实参是表达式(字段、变量、拼接串),不是 `R.drawable.x`、`painterResource(R.drawable.x)` 或 `Icons.*`。
17
+ - **素材**:图源是编进 APK 的资源或库符号。只有这类走下面的 L1 → L2 → L2.5 → L3。
18
+
19
+ 数据绑定图片的做法:
20
+
21
+ 1. 映射为 `Image(<URL 字段>)`(`string` URL 或 `PixelMap`),字段沿用 Android 模型的同名字段(`AsyncImage(model = item.ext?.icon)` → `Image(this.item.ext.icon)`)。
22
+ 2. `.objectFit()` 取自 Android 的缩放参数:ImageView 按 `mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md` 1.3.1 的 ScaleType 表;Compose `contentScale`:`Crop` → `ImageFit.Cover`、`Fit` → `ImageFit.Contain`、`FillBounds` → `ImageFit.Fill`、`Inside` → `ImageFit.ScaleDown`、`None` → `ImageFit.None`。`AsyncImage` 不写 `contentScale` 时默认是 `Fit`,而 ArkUI `Image` 默认是 `Cover`,所以必须显式写 `.objectFit(ImageFit.Contain)`。
23
+ 3. 占位与失败图照抄 Android:Compose `placeholder` / `error` / `fallback`,Glide `.placeholder()` / `.error()` / `.fallback()`。加载中的占位用 `.alt(<资源>)`;error 图与 placeholder 不同时,用 `.onError()` 置状态变量,把图源切到 error 资源。Android 没写占位就不加。这些占位资源本身是素材,按 L1–L3 分级。
24
+ 4. 网络权限:URL 是 http(s) 时需要 `ohos.permission.INTERNET`(system_grant,不需要 `reason`)。先查 `module.json5` 的 `requestPermissions` 是否已有。没有时:还有其他组在并发转换,就不要改 `module.json5`(Step 5 调度规则 7),在报告的 `shell requests` 里写一条「`module.json5` requestPermissions 增加 `ohos.permission.INTERNET`,原因:数据绑定图片 `<Android 文件:行号>`」,由 Step 5.5 wiring 应用;单组串行、允许编辑注册面时直接加 `{ "name": "ohos.permission.INTERNET" }`。
25
+ 5. mock 数据:该字段必须是有代表性的 URL,**不得为空串**。优先用 Android 源码、测试夹具或接口文档里出现过的真实 URL 格式,并在上方写 `// TODO(data-layer): mock URL,接入数据层后由 <Android 来源 文件:行号> 提供`。空串让参考截图里有图的位置变成空白。
26
+ 6. 渲染该图的 `Image` 行照常写 `// ICON: <key>`(Compose 的图在视图树里是无子节点的 `android.view.View`,measure_pack 会把它列进 `icon_inventory`)。
27
+
28
+ **数据绑定图片被判成 L3、写成空的 `Row()` / `Blank()` / 固定尺寸占位而没有 `Image`、或按名字挑一张本地 media 顶替,都判定失败。**
29
+
30
+ **图标来源分级 —— 逐个图标判定并在报告中标注级别**(只对素材图片):
13
31
 
14
32
  `res/drawable` 里没有对应 `<vector>` 是**常态而非异常**:Compose 的 `Icons.Outlined.*`、Phosphor、Feather 等是编译进库的 `ImageVector`,Step 2 只转 `res/`,转不出它们。此时必须走分级,不得自行发明降级方式。
15
33
 
@@ -28,10 +28,22 @@
28
28
 
29
29
  **底部弹层(`ModalBottomSheet` / `BottomSheetDialog` / `BottomSheetScaffold`)—— 用 `bindSheet`,自绘不是外观对不上的出口**:Android 的 Material 底部弹层除了外观,还带着一组行为:下拉面板关闭、点遮罩关闭、返回键关闭、面板高度受窗口限制。`bindSheet` / `UIContext.openBindSheet` 自带这些行为。外观差异用选项解决:`dragBar: false` 后系统不再画指示条,在 builder 里画 Android 的指示条(如 40×4dp、圆角 2),**不算画两遍**;面板色写 `backgroundColor`,圆角写 `radius`,高度写 `height` / `detents`,遮罩色写 `maskColor`。所以「系统指示条和 Android 的不一样」不能作为改判 (a) 自绘的理由。确实要自绘(Stack + 遮罩 + 面板)时,报告的部件归属表里这一行必须逐项列出原控件的行为及实现位置:拖动关闭(`PanGesture({ direction: PanDirection.Down })`,跟手位移,超过阈值或速度时调用关闭回调)、点遮罩关闭、返回键关闭(`onBackPress` / 宿主拦截)、面板最大高度。缺一项就是 `需上报`,不能写成已实现。GATE `self-drawn-sheet-no-drag-dismiss`。
30
30
 
31
+ **弹层打开时的高度看 `sheetState`,不看 modifier**:Compose `ModalBottomSheet` 的初始高度由 `rememberModalBottomSheetState(skipPartiallyExpanded = …)` 决定;`Modifier.fillMaxHeight()` 只说明面板**最多**能拉到多高。
32
+
33
+ | Android | `bindSheet` 选项 | 依据 |
34
+ |---|---|---|
35
+ | `skipPartiallyExpanded = false`(默认值) | `detents: [SheetSize.MEDIUM, SheetSize.LARGE]`:先停在半屏,可以拖到全屏 | 半模态文档:「元组中第一个高度为初始高度」;设置了 `detents` 时 `height` 无效 |
36
+ | `skipPartiallyExpanded = true` | `height: SheetSize.LARGE`(不写 `detents`) | 一开始就全屏展开 |
37
+ | `BottomSheetDialog` + `behavior.state = STATE_EXPANDED` / `skipCollapsed = true` | `height: SheetSize.LARGE` | 同上 |
38
+
31
39
  **部件归属判 (a) 自绘时,行为一并接管**:上面三类判定只问了装饰「画几遍、像不像」。改判 (a) 自绘、原子组件不再实例化后,原子组件自带的**交互行为**也一起没了(拖动关闭、惯性、键盘避让、返回键、无障碍角色),编译、截图对比、GATE 都看不出来。所以 (a) 行除了图形结构,还要列出「原控件自带行为 → 自绘实现的 `文件:行号`」,任一行为没有实现位置的,标 `需上报`。
32
40
 
41
+ **`showClose` 显式写,不留默认**:`bindSheet` 的 `showClose` 默认 `true`,系统在面板右上角画一个关闭按钮。Android 的 Material `ModalBottomSheet` / `BottomSheetDialog` 没有这个按钮,所以默认写 `showClose: false`(只传两个参数的 `bindSheet` 也要补上选项);源侧在标题栏右上角自己画了关闭图标时,图标留在 builder 里,同样写 `showClose: false`,否则会出现两个。只有源侧确实有关闭按钮、且改用系统按钮代替时才写 `true`。GATE `sheet-show-close-unset`。
42
+
33
43
  **一个节点只挂一个半模态 / 全模态**:`bindSheet` / `bindContentCover` 由所挂节点托管,一个节点只维护一个模态生命周期;同一属性链上挂两个,其中一个刚弹出就被关掉(「点一下闪一下就没了」),编译与冒烟都看不出来。Compose 里每个 `ModalBottomSheet` 有自己的 state,对应到 ArkUI 是各自独立的宿主节点:挂到各自的触发节点上,或各包一层空容器作宿主;弹层多时改用 `UIContext.openBindSheet` / `closeBindSheet` 管理。Step 5.5 接线追加弹层时同样适用。GATE `multiple-overlay-binds-same-node`。
34
44
 
45
+ **弹层 builder 直接传 `this.X()`,关闭要回写状态**:`bindSheet(isShow, this.X(), …)` 的第二参只能写 builder 调用,编译器把它改写成 `{ builder: … }`;写成 `() => { this.X() }` 会原样下传成裸函数,弹层静默不出现(GATE `overlay-builder-arrow-arg`)。箭头写法只用于自定义组件的 `@BuilderParam`。isShow 没有 `$$` / `!!` 双向绑定时,用户下滑或点蒙层关闭后状态停在 true,第二次打不开:在 options 里加 `onDisappear` 把宿主状态拉回 false(GATE `sheet-isshow-no-writeback`);`bindContentCover` 的第三参写成 `{ modalTransition, onDisappear }`,不要只传 `ModalTransition.X`。
46
+
35
47
  **系统弹窗与菜单 —— 锚定用原生机制,外观跟源主题走**:Android `PopupMenu` / `ContextMenu` / 锚定在按钮上的 `ListPopupWindow`、`AlertDialog.Builder` / `MaterialAlertDialogBuilder` 是框架控件,**外观由 Android 应用主题决定**,不是由「系统」决定;换到 ArkUI 后,「系统外观」就成了鸿蒙的外观。映射表写「直接映射」只说明 API 对得上,外观并不一致。
36
48
 
37
49
  - **菜单**:锚定一律在**触发组件上**写 `.bindMenu(...)`(长按菜单用 `.bindContextMenu(...)`),**禁止**用状态变量驱动的 overlay 自绘(宽度、圆角、分隔线、阴影、位置都没有来源,也不锚定按钮;GATE `popup-menu-not-bound`)。外观上,参数传 `@Builder` 返回 `Menu(){ MenuItem() }`,按下面的优先级取值,**不传 `MenuElement[]`**,因为那样渲染的是鸿蒙系统菜单(GATE `popup-menu-default-look`)。
@@ -47,7 +59,7 @@
47
59
  | `Theme.Material3*` | 圆角 28dp;内边距 24dp;标题 24sp 靠起始边;正文 14sp `onSurfaceVariant`;**句首大写**(不转大写)`colorPrimary` 文字按钮,靠结束边 | 圆角 4dp;`surfaceContainer` 底;上下内边距 8dp;行高 48dp;16sp(BodyLarge);内缩 16dp |
48
60
  | `Theme.Holo*` / `Theme.DeviceDefault*` / 无法识别 | 厂商外观,以 capture 为准;没有 capture 时标 `需上报` | 同左 |
49
61
 
50
- 表中 Material3 / MaterialComponents 两行取自 MDC 源码(`theme/res/values/themes_base.xml` 及 `menu/`、`dialog/` 资源),Theme.Material / AppCompat 两行是 AOSP framework / AppCompat 默认值;有 capture 时一律以 `measure_pack` 为准。
62
+ 有 capture 时一律以 `measure_pack` 为准。
51
63
 
52
64
  **主题来源的已知局限**:检查器只读 `<application android:theme>`(SplashScreen 启动主题会沿 `postSplashScreenTheme` 找到真正的应用主题)。Activity 自己的 `android:theme`、以及 `AlertDialog.Builder(context, R.style.X)` / `MaterialAlertDialogBuilder(context, R.style.X)` 显式传入的对话框主题都**不会**被读到,这时报告里的主题链可能与实际不符:转换时先看该对话框/菜单所在 Activity 与构造参数,有显式主题就按它取值。
53
65
 
@@ -10,11 +10,11 @@
10
10
  检索范围优先本页宿主 Activity 及其 Application/基类;宿主自身没有时,命中项属于别的 Activity(如崩溃页、全屏阅读页)**不能**算作本页的证据。
11
11
  **禁止用截图推断本项**:「截图里状态栏可见」「内容起点在状态栏下方」都**不能**推出非沉浸式 —— edge-to-edge 页面会自行对 insets 做 padding,其截图形态与非沉浸式**完全同形**,该判据在沉浸式场景下必然误判。截图只能用于交叉印证,不能作为①的依据。
12
12
  ② **窗口层**:固定为默认布局 —— `EntryAbility` **不调用** `setWindowLayoutFullScreen`(可设 `setWindowSystemBarProperties` 改栏前景色)。内容由系统排在安全区、自动避让状态栏与导航条。本项只需写明「窗口层默认布局」,调用了 `setWindowLayoutFullScreen(true)` 即判定失败(`window-fullscreen-layout` GATE)。
13
- ③ **组件层**:①为沉浸式时,贴着系统栏的 chrome 只把**背景**延伸进去 —— 壳/页根 `.background(<色>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] })`,底部 chrome `[LayoutSafeAreaEdge.BOTTOM]`;内容本身必须画进状态栏的(全屏封面、视频)在该组件上用 `expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])`。**两种写法在 `Refresh` / `Scroll` / `List` 里面都不生效**(这些容器 `clip` 默认 true,裁掉延伸部分,GATE `safe-area-in-clipping-ancestor`):贴栏 chrome 位于这些容器里时(下拉刷新里的折叠头部),把它的背景放到页根下、容器之外的单独一层,高度用同一状态驱动并设 `.hitTestBehavior(HitTestMode.None)`,内容留在原处。**这一层必须写 `.width('100%')`**:它通常是没有子节点的空容器,宽高缺省时取子组件尺寸(尺寸设置文档),空容器即为 0,`.background()` 不参与测量,不写宽度整层不显示(GATE `bg-only-container-collapsed`)。它所在的页根 `Stack` 写 `alignContent: Alignment.TopStart`,否则定高的背景层被垂直居中。**这一层的高度是安全区内的高度(与内容层同值),用 `.background(<色或 @Builder>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] })` 画**:背景区域在组件之上再加一个状态栏高,组件布局不变。**不要**用固定高度 + `expandSafeArea`:固定宽高(或 `'auto'`)扩展后尺寸不变,组件整体上移一个栏高,底边跟着上移(安全区域文档 expandSafeArea 约束;GATE/CAND `fixed-size-expand-safe-area`)。`@Builder` 背景不随 builder 内部状态更新,渐隐等 `opacity` 设在这一层自身上。
13
+ ③ **组件层**:①为沉浸式时,贴着系统栏的 chrome 只把**背景**延伸进去 —— 壳/页根 `.background(<色>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] })`,底部 chrome `[LayoutSafeAreaEdge.BOTTOM]`;内容本身必须画进状态栏的(全屏封面、视频)在该组件上用 `expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])`。**两种写法在 `Refresh` / `Scroll` / `List` 里面都不生效**(这些容器 `clip` 默认 true,裁掉延伸部分,GATE `safe-area-in-clipping-ancestor`):贴栏 chrome 位于这些容器里时(下拉刷新里的折叠头部),把它的背景放到页根下、容器之外的单独一层,高度用同一状态驱动并设 `.hitTestBehavior(HitTestMode.None)`,内容留在原处。**这一层必须写 `.width('100%')`**:它通常是没有子节点的空容器,宽高缺省时取子组件尺寸(尺寸设置文档),空容器即为 0,`.background()` 不参与测量,不写宽度整层不显示(GATE `bg-only-container-collapsed`)。它所在的页根 `Stack` 写 `alignContent: Alignment.TopStart`,否则定高的背景层被垂直居中。**这一层的高度是安全区内的高度(与内容层同值),用 `.background(<色或 @Builder>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] })` 画**:背景区域在组件之上再加一个状态栏高,组件布局不变。**不要**用固定高度 + `expandSafeArea`:固定宽高(或 `'auto'`)扩展后尺寸不变,组件整体上移一个栏高,底边跟着上移(安全区域文档 expandSafeArea 约束;GATE/CAND `fixed-size-expand-safe-area`)。`@Builder` 背景不随 builder 内部状态更新,渐隐等 `opacity` 设在这一层自身上。**这一层在 z 序上位于 `Refresh` / `Scroll` 之下**,只能露出那些容器上方的空白:如果滚动内容会经过头部区域(Scroll 顶部有等高占位、头部是兄弟覆盖层),内容就会画在这层背景之上,头部看起来是透明的。所以它只负责状态栏那一条;头部在安全区内的部分,由头部组件根节点自己再画一次同样的层(底色 + 头图,opacity 由同一状态驱动),或者按 `cards/dynamics.md`「MotionLayout 折叠头部」把内容区放到头部下方,让内容根本不经过头部(GATE `scroll-driven-overlay-see-through`)。**叠放的整页要和下层延伸同样的边**:页根 `Stack` 里下层(天气渐变、背景图)延伸进了底部导航栏,上面那一层不透明的整页(城市列表、设置页)的背景也要延伸到 BOTTOM,写 `.background(<色>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP, LayoutSafeAreaEdge.BOTTOM] })`;只写 TOP 时底部导航栏会露出下层(GATE `opaque-layer-safe-area-mismatch`)。
14
14
  **栏下逐层**:「背景」指 Android 在系统栏区域里**实际画出来的全部层**,不只是一个底色。按 z 序逐层列出栏下区域(屏幕 y < 状态栏高)的绘制者 —— 容器底色、铺满的 `ImageView`(头图,常配 `scaleType=fitXY/centerCrop`)、渐变/shape、遮罩 —— 每一层都要进延伸层:颜色层用 `.background(<色>, …)`,图片层用 `.background(<画该图的 @Builder>, …)`(或在延伸层里叠一层同尺寸 `Image`),多层就在延伸层里按原 z 序叠。依据写 Android 布局 `文件:行号`(该 View 的约束贴 `parent` 顶、或负 `marginTop` 把它推到栏下)。只搬了最底下的色块、而上面的图留在裁剪容器里时,状态栏只显示纯色 —— `safe-area-in-clipping-ancestor` 抓不到(那张图本身没写安全区 API),CAND `backdrop-image-in-clipping-ancestor` 会列出可疑的铺满 `Image`。
15
15
  全出血内容用 `expandSafeArea` 时同样不能是固定高度,用百分比高度。①为非沉浸式时写明「未使用」。列出实际所在 `文件:行号`;壳宿主的 Fragment 页由壳承担,写明引用壳的行号。
16
16
  ④ ①②③ 三者是否等价。
17
- **关键**:任何页面/组件都**不得读取系统栏高度**(`getWindowAvoidArea` 的 SYSTEM / NAVIGATION_INDICATOR / CUTOUT、`on('avoidAreaChange')`、栏高 AppStorage 键)或按栏高 padding —— 默认布局已由系统避让,再加就是重复;Android 的 `fitsSystemWindows` / insets padding 在鸿蒙侧**没有对应物**,不翻译。键盘避让(`TYPE_KEYBOARD`)不受此限。违反即 `system-bar-height-read` GATE。此前的「窗口层全屏 + 每页读栏高 padding」方案实测失败:页面在 `aboutToAppear` 读一次栏高(V2 没有 `@StorageProp`,读到的 0 不再更新),全批顶栏落进状态栏、被状态栏窗口吞掉点击,编译与跨页一致性全过。
17
+ **关键**:任何页面/组件都**不得读取系统栏高度**(`getWindowAvoidArea` 的 SYSTEM / NAVIGATION_INDICATOR / CUTOUT、`on('avoidAreaChange')`、栏高 AppStorage 键)或按栏高 padding —— 默认布局已由系统避让,再加就是重复;Android 的 `fitsSystemWindows` / insets padding 在鸿蒙侧**没有对应物**,不翻译。键盘避让(`TYPE_KEYBOARD`)不受此限。违反即 `system-bar-height-read` GATE。
18
18
  **页间一致性只是提示,不是通过路径。** ①与④冲突时**以①为准**。基线(既有页面、`EntryAbility`)**不构成**①的证据 —— 基线只说明"现状如何",不说明"Android 侧是什么"。
19
19
  当①判定为沉浸式、而基线页面全部非沉浸式时,正确做法是**补齐组件层背景延伸**,**不是**跟随基线保持非沉浸式,也**不是**改窗口层。「与 base 保持一致」在这种情形下是把错误固化,且因为全批一致,跨页比对会满分通过 —— 这正是本项最常见的漏检路径:①用截图误判成非沉浸式,④用"与基线一致"确认,两步都"有据",结论却是错的。
20
20
  若确实决定不实现沉浸式(例如①零命中),需在报告中写明①的检索结果作为依据。此项漏检的典型表现是顶栏落进状态栏(与时间/电量重叠、点不到),或状态栏条带与页面底色割裂。