@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
@@ -842,7 +842,7 @@ export function resolveAppModule(candidates, requested, { sourceKind = "" } = {}
842
842
  };
843
843
  }
844
844
 
845
- export const PROFILES = ["full", "ui-only", "incremental", "resume"];
845
+ export const PROFILES = ["full", "ui-only", "incremental"];
846
846
 
847
847
  /**
848
848
  * profile=incremental preconditions (scenario 3: a few pages into an existing HarmonyOS project), checked here so
@@ -12,7 +12,9 @@ import path from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
13
 
14
14
  import yaml from "./lib-yaml-lite.mjs";
15
+ import { productionActionErrors } from "./dag_action_catalog.mjs";
15
16
  import { validateGraph } from "./dag_graph.mjs";
17
+ import { evaluateSuccess } from "./dag_runner.mjs";
16
18
  import { parseArgs } from "./paths_preflight.mjs";
17
19
 
18
20
  const HERE = path.dirname(fileURLToPath(import.meta.url));
@@ -37,14 +39,18 @@ export const PROGRESS_POLICY_PHRASES_EN = [
37
39
 
38
40
  /** Required phrases of ask_run_config_once.prompt_template, as [zh, en]. */
39
41
  export const RUN_CONFIG_PROMPT_PHRASES = [
40
- ["Do not explain scheduling to the user", "Do not explain scheduling to the user"],
41
- ["no SCHEDULE_MODE", "no SCHEDULE_MODE"],
42
42
  ["Never put the human check gates and the run mode in the same question", "Never put the human check gates and the run mode in the same question"],
43
43
  // not in i18n/terms.json; wording of the English workflow copy
44
44
  ["After auto is chosen do not show gates that need a human check", "After auto is chosen do not show gates that need a human check"],
45
45
  ["selected by default", "selected by default"],
46
46
  ];
47
47
 
48
+ /** policy.human_interaction must keep the schedule-disclosure ban (platform overlays repeat it; the root must not lose it). */
49
+ export const SCHEDULE_DISCLOSURE_PHRASE = [
50
+ "Do not explain scheduling to the user, and do not ask about serial or parallel (no SCHEDULE_MODE)",
51
+ "Do not explain scheduling to the user, and do not ask about serial or parallel (no SCHEDULE_MODE)",
52
+ ];
53
+
48
54
  /** policy.context_budget / skill-node invoke sentences, as [zh, en]. */
49
55
  export const CONTEXT_BUDGET_PHRASE = ["must not end the run on its own because of the context budget", "must not end the run on its own because of the context budget"];
50
56
  export const NOT_A_STOP_SENTENCE = [
@@ -223,6 +229,43 @@ function pairKey(a, b) {
223
229
  return [a, b].sort().join("\0");
224
230
  }
225
231
 
232
+ function successPredicates(rules, out = new Set()) {
233
+ if (Array.isArray(rules)) {
234
+ for (const rule of rules) successPredicates(rule, out);
235
+ } else if (rules && typeof rules === "object") {
236
+ for (const [key, operand] of Object.entries(rules)) {
237
+ if (key === "when") continue;
238
+ out.add(key);
239
+ if (key === "all" || key === "any") successPredicates(operand, out);
240
+ }
241
+ }
242
+ return out;
243
+ }
244
+
245
+ /**
246
+ * Every success predicate, production runner.kind and lifecycle action (bootstrap / workspace / generic `actions`,
247
+ * skill before_run / after_run) the yaml names must be one the Runner / production executor implements. A mismatch
248
+ * otherwise surfaces only mid-run, as a blocked UNSUPPORTED_SUCCESS_RULE / UNSUPPORTED_PRODUCTION_ACTION on a customer machine.
249
+ */
250
+ export function lifecycleSupportErrors(doc) {
251
+ const errors = [];
252
+ for (const node of doc.nodes || []) {
253
+ for (const predicate of successPredicates(node.success)) {
254
+ try {
255
+ // A null operand exercises only the predicate dispatch: supported predicates reject it with their own
256
+ // operand error (or return false) and never run a script.
257
+ evaluateSuccess({ [predicate]: null }, {});
258
+ } catch (error) {
259
+ if (error?.code === "UNSUPPORTED_SUCCESS_RULE" && /Unsupported success predicate/.test(String(error.message))) {
260
+ errors.push(`${node.id}: success predicate \`${predicate}\` is not implemented by dag_runner.mjs`);
261
+ }
262
+ }
263
+ }
264
+ if (node.runner?.action === "production") errors.push(...productionActionErrors(node));
265
+ }
266
+ return errors;
267
+ }
268
+
226
269
  function main() {
227
270
  const args = parseArgs(process.argv.slice(2), {
228
271
  defaults: { yaml: DEFAULT_YAML },
@@ -472,6 +515,10 @@ function main() {
472
515
  errors.push(`ask_run_config_once.prompt_template must state: ${pair[0]}`);
473
516
  }
474
517
  }
518
+ const humanPolicy = String(doc.policy?.human_interaction || "");
519
+ if (!hasPhrase(humanPolicy, SCHEDULE_DISCLOSURE_PHRASE)) {
520
+ errors.push(`policy.human_interaction must state: ${SCHEDULE_DISCLOSURE_PHRASE[0]}`);
521
+ }
475
522
  if (prompt.includes("--schedule") || prompt.includes("schedule=parallel")) {
476
523
  errors.push("ask_run_config_once.prompt_template must no longer mention --schedule / schedule=parallel");
477
524
  }
@@ -594,6 +641,7 @@ function main() {
594
641
  errors.push(`policy.user_facing is missing chat progress template phrase: ${phrase}`);
595
642
  }
596
643
  }
644
+ if (doc.id === "a2h-app-migrate") errors.push(...lifecycleSupportErrors(doc));
597
645
  if (doc.id === "a2h-app-migrate") {
598
646
  const budget = String(doc.policy?.context_budget || "");
599
647
  if (!hasPhrase(budget, CONTEXT_BUDGET_PHRASE)) {
@@ -617,6 +665,7 @@ function main() {
617
665
  process.stdout.write("✅ force_skip targets valid\n");
618
666
  if (doc.id === "a2h-app-migrate") {
619
667
  process.stdout.write("✅ all production nodes use the fixed Runner kinds/order; reuse, gates, summaries and finalize ownership are valid\n");
668
+ process.stdout.write("✅ every success predicate, production runner.kind and lifecycle action is implemented by the Runner / executor\n");
620
669
  }
621
670
  process.stdout.write(
622
671
  `✅ no unregistered concurrent read/write races (${exempt.length} registered exemption(s), all still valid)\n`,
@@ -45,7 +45,7 @@ test("spec-design-pipeline: dispatch-hold liveness, stale-worktree release, fiel
45
45
  test("B1: the coder owns the per-chunk design; the pipeline has no B0", () => {
46
46
  const pipeline = read("skills/a2h-spec-design-pipeline/SKILL.md");
47
47
  assert.doesNotMatch(pipeline, /### B0/);
48
- assert.match(pipeline, /S0 → W0 → B1⇄B2/);
48
+ assert.match(pipeline, /S0 → F0 → W0 → B1⇄B2/);
49
49
  assert.match(pipeline, /stage_design_inputs\.ts/);
50
50
  const coder = read("skills/a2h-arkts-logic-coder/SKILL.md");
51
51
  assert.match(coder, /design-mode/);
@@ -99,8 +99,6 @@ test("workflow: interaction vars go through preflight and are backfilled; gate l
99
99
  assert.doesNotMatch(ask.prompt_template, /- `all`/);
100
100
  assert.doesNotMatch(ask.prompt_template, /- `none`/);
101
101
  assert.doesNotMatch(ask.prompt_template, /- `skip`/);
102
- assert.match(ask.prompt_template, /Do not explain scheduling to the user/);
103
- assert.match(ask.prompt_template, /no SCHEDULE_MODE/);
104
102
  assert.doesNotMatch(ask.prompt_template, /Tell the user: this run executes serially/);
105
103
  assert.match(ask.prompt_template, /Never put the human check gates and the run mode in the same question/);
106
104
  assert.match(ask.prompt_template, /After auto is chosen do not show gates that need a human check/);
@@ -143,7 +143,7 @@ test("bootstrap runs plan_resume first so the run dirs are resolved from the led
143
143
  // args / when unchanged: still only consumes SKILLS_ROOT / LEDGER / FROM_NODE / RESUME_BASE_PROFILE
144
144
  const plan = boot.actions.map((a) => a.plan_resume).find(Boolean);
145
145
  assert.match(plan.args, /--ledger \$\{LEDGER\} --from-node \$\{FROM_NODE\}/);
146
- assert.match(plan.when, /\$\{PROFILE\} == 'resume'/);
146
+ assert.equal(plan.when, "${FROM_NODE} != 'bootstrap'");
147
147
  assert.doesNotMatch(plan.exit_0, /last_engine/, "exit_0 no longer backfills the engine");
148
148
  // The engine carry-over actions are gone: bootstrap has no resolve_last_engine / resolve_case_id
149
149
  assert.equal(at("resolve_last_engine"), -1, names.join(","));
@@ -127,7 +127,7 @@ test("module_docs: the --scope project-source rationale names the field that act
127
127
  test("the orchestrator must not end the run because the context budget is tight", () => {
128
128
  const policy = doc.policy.context_budget;
129
129
  assert.match(policy, /must not end the run on its own because of the context budget/);
130
- assert.match(policy, /logic\.spec_pipeline ending the round to wait for background completion notifications/);
130
+ assert.match(policy, /The primary waiting for a sub-agent to return \(a blocking dispatch call\) is not a stop/);
131
131
  assert.match(policy, /must not be escalated into a voluntary wrap-up of the whole pipeline/);
132
132
  assert.match(SKILL, /must not end the run on its own because of the context budget/);
133
133
  assert.match(SKILL, /policy\.context_budget/);
@@ -50,7 +50,7 @@ test("workflow: explicit specs_json skips spec generation and is kept by adopt",
50
50
  const doc = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
51
51
  assert.match(doc.vars.SKIP_SPEC_GENERATE.set_true_when, /specs_json/);
52
52
  assert.equal(doc.profiles["logic-only"], undefined);
53
- assert.deepEqual(doc.vars.PROFILE.choices, ["full", "ui-only", "resume"]);
53
+ assert.deepEqual(doc.vars.PROFILE.choices, ["full", "ui-only", "incremental"]);
54
54
  const byId = Object.fromEntries(doc.nodes.map((n) => [n.id, n]));
55
55
  assert.match(byId["enrich.spec_gen"].skip_if, /SKIP_SPEC_GENERATE/);
56
56
  assert.match(byId["review.spec_gen"].skip_if, /SKIP_SPEC_GENERATE/);
@@ -120,11 +120,17 @@ test("workflow: every REUSE_* used by a node is mapped to probe entries; resume_
120
120
  assert.equal("CONVERSION_MODE" in doc.vars, false);
121
121
  });
122
122
 
123
- test("workflow: module_docs is primary_skill_inline; background notices are never gate confirmations", () => {
123
+ test("workflow: every skill node is a task_subagent; background notices are never gate confirmations", () => {
124
124
  const doc = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
125
125
  const byId = Object.fromEntries(doc.nodes.map((n) => [n.id, n]));
126
- assert.match(byId["enrich.module_docs"].dispatch, /primary_skill_inline/);
127
- assert.doesNotMatch(byId["enrich.module_docs"].dispatch, /task_subagent/);
126
+ for (const id of ["discover.arch", "discover.utg_static", "ui.batch", "enrich.module_docs", "logic.spec_pipeline"]) {
127
+ assert.equal(byId[id].dispatch, "task_subagent", id);
128
+ }
129
+ assert.match(byId["enrich.spec_gen"].dispatch, /primary_skill_inline(SPEC_ENGINE=spec-generate)/);
130
+ assert.match(byId["enrich.spec_gen"].invoke, /wait_mode=foreground/);
131
+ assert.match(byId["logic.spec_pipeline"].invoke, /WAIT_MODE=foreground/);
132
+ assert.equal("dispatch_inline" in doc.policy, false);
133
+ assert.match(doc.policy.dispatch, /needs_input/);
128
134
  assert.match(doc.policy.human_gate_protocol, /a notification is not an answer/);
129
135
  for (const id of ["review.arch", "review.spec_gen", "review.ui_batch"]) {
130
136
  assert.match(byId[id].invoke, /Per policy\.human_gate_protocol/, id);
@@ -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: Migration progress/);
65
- assert.match(r.stdout, /must state: Do not explain scheduling to the user/);
67
+ assert.match(r.stdout, /must state: Never put the human check gates and the run mode in the same question/);
66
68
  });
67
69
 
68
70
  test("ban on recommended labels 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 @@ Common implementation pitfalls:
4
4
  * The key generator of `ForEach` must include every field that affects how the item renders: if only `id` is used as the key, modifying the item's other fields in place (status, text) makes ArkUI reuse the old node and the UI does not update. The key should concatenate the fields that affect display (e.g. `${item.id}:${item.status}`), or replace the whole item object on modification and trigger an array update.
5
5
  * When passing a parent component's `@Builder` method to a child component's `@BuilderParam`, do not write it as a method reference (e.g. `content: this.listContent`): the Builder actually runs inside the child component, `this` points to the child, and reading the parent's state variables or ViewModel yields `undefined`, crashing at render time. This often shows up in loading/empty-state containers and only triggers when data comes back and the content state renders for the first time, so it is invisible on cold start. Wrap it in an arrow function when passing it to keep the parent's `this`: `content: (): void => { this.listContent() }`. The arrow body may **only call a @Builder**, never write a component directly: `content: () => { RefreshLayout({…}) }` compiles, but only @Builder bodies are compiled into UI code, so `RefreshLayout({…})` in an arrow body is a plain call of the component class and the slot crashes on render with `class constructor cannot called without 'new'`. Put the component in `@Builder listContent()` (or `@LocalBuilder`) and let the arrow only call it.
6
6
  * In `@ComponentV2`, modifying a field without `@Trace` does not refresh the UI and does not raise an error. A value computed from `@Param` in `aboutToAppear` is computed only once and will not update when the parent later passes a new value: compute such values in `build`, or use `@Computed`; if it must be stored as local state, watch the corresponding `@Param` with `@Monitor` and assign it there.
7
- * Text measurement results are px, not vp: `MeasureText.measureText` / `measureTextSize` (`@ohos.measure`) and the methods of the same name on `getUIContext().getMeasureUtils()` take `fontSize` in fp, but the returned width and height are both **px** (`.d.ts` `@returns`: "both in px"). Before comparing the result with a vp budget or passing it to `.width()`, convert it with `this.getUIContext().px2vp(...)`. Observed (where-to-study bottom navigation): comparing `measureTextSize().width` (px) directly with a vp cell width always concluded "does not fit" at 3.5x density, so the tab labels never showed on any device, and reviewers trusted a code comment claiming "vp output". Canvas `context.measureText()` returns vp by default; it is different, so do not carry experience over between them. For other APIs the `.d.ts` is authoritative; see the unit table in code-generation.md Implementation Principle 6. `scripts/check_units.ts` blocks this pattern.
7
+ * Text measurement results are px, not vp: `MeasureText.measureText` / `measureTextSize` (`@ohos.measure`) and the methods of the same name on `getUIContext().getMeasureUtils()` take `fontSize` in fp, but the returned width and height are both **px** (`.d.ts` `@returns`: "both in px"). Before comparing the result with a vp budget or passing it to `.width()`, convert it with `this.getUIContext().px2vp(...)`. Observed (one app's bottom navigation): comparing `measureTextSize().width` (px) directly with a vp cell width always concluded "does not fit" at 3.5x density, so the tab labels never showed on any device, and reviewers trusted a code comment claiming "vp output". Canvas `context.measureText()` returns vp by default; it is different, so do not carry experience over between them. For other APIs the `.d.ts` is authoritative; see the unit table in code-generation.md Implementation Principle 6. `scripts/check_units.ts` blocks this pattern.
8
8
  * Do not use `ForEach` for large lists (lists/grids of songs, messages, feeds, etc. that may have hundreds of entries): it creates all child nodes on first load, so with many entries the first frame stutters noticeably or even times out with a blank screen. Prefer `LazyForEach` + `IDataSource` to create on-screen nodes on demand; note that data-source changes must be notified through interfaces such as `notifyDataReload` / `notifyDataAdd` / `notifyDataChange` — replacing the whole array without notifying does not refresh the UI (a pitfall already seen when combined with `@Observed`/`@ObjectLink`). A small fixed set of options (menus, tabs) can still use `ForEach`.
9
9
  * Every value that crosses an "untyped boundary" into strongly typed code must be normalized as nullable; never assume it has a value: deserialization results, database rows, local caches and cross-page parameters all count. An ArkTS type is a compile-time annotation only — nothing is validated at runtime, `as T` fills in no default, and `null` enters the entity as-is; a mapping that tests only `=== undefined` misses it. On the read side that throws `TypeError` (a crash) at `.length`, iteration or a method call, and in numeric comparisons `null` is silently taken as 0; on the write side it is rejected by the non-null constraint and never reaches the database, or it is written to JSON and read back with missing values (a `null` inside an object stays `null`, while the key of an `undefined` property disappears entirely). Rule: always normalize inside the function that maps external data to the entity — add one first if it does not exist; declare the field `?: T | null` and use `??` to supply the type's default when it is missing (string `''`, number `0`, array `[]`, object `{}`); catch the whole object first, then normalize item by item, field by field; when reading a database, read per the column's nullable declaration instead of substituting an empty string or 0 for missing; use only `??` for fallbacks, never `||` or `if (!v)`, which treat a legitimate `0` or `''` as empty. Writing `=== null` on a non-null field is not a fallback: it misses `undefined` and is also reported as a comparison with no type overlap; the fix is to first change the declaration to `?: T | null`.
10
- * Never write a platform API from memory, and never pick a page from a single search-result list: parameter order, sync/async, the lifecycle (`create` → use → `destroy`/`off`) and the returned unit come from the local `.d.ts`; the call order and usage come from one section of the page via `scripts/state_doc.mjs search "<module or method>"` + `read-id "<documentId>" --section "<heading>" --max-lines 80` (an API page runs to a few thousand lines; reading all of it crowds out the code context; an overload list repeats the same heading, so `--section` returns every occurrence marked `<!-- section "request" 2/3 -->` — add `--occurrence <n>` to pick one). When this worktree already has a working call site for the same API: **shape** questions (parameter order, sync/async, lifecycle, returned unit) may copy it, and the `.d.ts` outranks the page; **meaning** questions (targets, ordering, grant level, boundaries, which key is addressed) still require the official page even when a call site exists, the page outranks the `.d.ts` there, and the record needs one sentence quoted from it; when the `phone 12+`-style tag beside the heading is above the project's `compatibleSdkVersion`, use the older overload or `canIUse` instead. When nothing resolves, record `api-docs: unavailable`, fall back to the `.d.ts` and this file, and never guess silently.
10
+ * Never write a platform API from memory, and never pick a page from a single search-result list: parameter order, sync/async, the lifecycle (`create` → use → `destroy`/`off`) and the returned unit come from the local `.d.ts` (a returned field's presence is part of that contract: a non-optional declaration does not guarantee a value, and when the field's JSDoc names a flag/option, confirm the call passes it); the call order and usage come from one section of the page via `scripts/state_doc.mjs search "<module or method>"` + `read-id "<documentId>" --section "<heading>" --max-lines 80` (an API page runs to a few thousand lines; reading all of it crowds out the code context; an overload list repeats the same heading, so `--section` returns every occurrence marked `<!-- section "request" 2/3 -->` — add `--occurrence <n>` to pick one). When this worktree already has a working call site for the same API: **shape** questions (parameter order, sync/async, lifecycle, returned unit) may copy it, and the `.d.ts` outranks the page; **meaning** questions (targets, ordering, grant level, boundaries, which key is addressed) still require the official page even when a call site exists, the page outranks the `.d.ts` there, and the record needs one sentence quoted from it; when the `phone 12+`-style tag beside the heading is above the project's `compatibleSdkVersion`, use the older overload or `canIUse` instead. Target the project's `compatibleSdkVersion` when reading docs; prefer a non-deprecated API - an API marked `@deprecated` in the `.d.ts` or the docs should be avoided in favour of the replacement the deprecation note names, and when it has to be used, record the reason and the planned replacement in the `conclusion` column of `## Platform API lookups`. When nothing resolves, record `api-docs: unavailable`, fall back to the `.d.ts` and this file, and never guess silently.
@@ -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 `## Android Code Reference` 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
 
@@ -135,9 +136,18 @@ rendered value, write `state-docs: not-applicable` to `{output-path}/state_docs_
135
136
  **Platform API doc gate.** Two classes — the class decides, not the writer's confidence.
136
137
 
137
138
  *Shape (soft).* A platform API guessed by analogy compiles and misbehaves at runtime (wrong param
138
- order, a missing `await`, a callback that fires too early). Run the steps below when the worktree has
139
- no working call site for the API and its parameter order/types, sync/async, lifecycle, return shape
140
- or error path is unclear; otherwise skip it and record `api-docs: not-applicable`.
139
+ order, a missing `await`, a callback that fires too early). Run the doc lookup below when the
140
+ worktree has no working call site for the API and its parameter order/types, sync/async, lifecycle,
141
+ return shape or error path is unclear; otherwise skip it and record `api-docs: not-applicable`.
142
+ Skipping the doc lookup never skips the returned-field check.
143
+
144
+ **Returned-field check (always, even with a working call site).** A non-optional field in `.d.ts`
145
+ is not proof it exists at runtime: its JSDoc may state a condition (a flag, option, or flag-mask
146
+ bit) that controls whether the field is populated. When a call's result is used, open the `.d.ts`
147
+ that declares the **returned type** and read the JSDoc of every field you access plus its parent
148
+ chain (no siblings); an existing call site does not exempt this — it may omit the flag. Read at
149
+ most 10 field comments per chunk; past that, record `unverified (budget)` for the rest. If a
150
+ condition is named, confirm the call satisfies it.
141
151
 
142
152
  *Semantics (mandatory).* A signature says what exists, not what a call means. Read one section of the
143
153
  official page — even when a working call site exists — for any call whose correctness depends on:
@@ -153,9 +163,10 @@ Read each distinct API once per chunk — dedupe by API, not by call site — at
153
163
  only from `SDK .d.ts`, does not satisfy this gate. Past the cap, or when the page cannot be read,
154
164
  record `api-docs: unavailable` with the key and continue; never record `available`.
155
165
 
156
- Source precedence: for **shape**, a working call site first, then `.d.ts`, then the official page; for
157
- **meaning**, the official page outranks both. A difference in behaviour (not existence) goes in
158
- `## Spec deviations`.
166
+ Source precedence: for **shape**, a working call site first, then `.d.ts`, then the official page;
167
+ the returned-field check is independent of that order and still needs the field's `.d.ts` JSDoc when
168
+ a call site exists. For **meaning**, the official page outranks both. A difference in behaviour (not
169
+ existence) goes in `## Spec deviations`.
159
170
 
160
171
  1. Search once for the module, not for prose: `node <skill-dir>/scripts/state_doc.mjs search
161
172
  "@ohos.net.http request" --limit 3`. Only the `harmonyos-guides` and `harmonyos-references`
@@ -177,13 +188,23 @@ Source precedence: for **shape**, a working call site first, then `.d.ts`, then
177
188
  3. Budget: at most 3 searches and 2 section reads per chunk for shape queries. Semantics reads are
178
189
  separate and deduped by API: one section per distinct API, at most 5 per chunk; the rest are
179
190
  recorded `api-docs: unavailable`.
180
- 4. Guard the API level: the doc tags a section `phone 12+ | 2in1 13+ …`. If the tag is above the
181
- project's `compatibleSdkVersion` (or the module's `minAPIVersion`), use the fallback the doc
182
- names (`canIUse`, an older overload, or a different API) instead of the newer call.
183
- 5. Record one row per lookup in the `## Platform API lookups` section of `state_docs_used.md`
184
- (`api | catalog | documentId or key | section | API level | conclusion`), plus one verdict line
191
+ 4. Read the API for the project's SDK version, and never use a deprecated one:
192
+ - Version: the doc tags a section `phone 12+ | 2in1 13+ …`. Read and take the shape the project's
193
+ `compatibleSdkVersion` (or the module's `minAPIVersion`) supports; a tag above it means use the
194
+ fallback the doc names (`canIUse`, an older overload, or a different API), not the newer call.
195
+ - Deprecation: prefer a non-deprecated API. An API a doc section or the `.d.ts` marks
196
+ `@deprecated` / "Deprecated" should be avoided even though it compiles; use the replacement the
197
+ deprecation note names, and when the deprecated API has to be used, record why and the planned
198
+ replacement in the `conclusion` column of `## Platform API lookups`.
199
+ 5. Record one row per **API** (not per call site) in the `## Platform API lookups` section of
200
+ `state_docs_used.md`:
201
+ `api | catalog | documentId or key | section | API level | returned fields | conclusion`.
202
+ Put checked conditional fields in `returned fields` (`field: requires <flag>; passed`, or `-`);
203
+ keep `conclusion` for the official-page sentence. A `.d.ts`-only row uses `catalog: SDK .d.ts`
204
+ with `section`/`conclusion` as `-`; it is shape evidence only and never by itself yields
185
205
  `api-docs: available`.
186
- - Not needed → `api-docs: not-applicable`.
206
+ - No semantics lookup needed → `api-docs: not-applicable`.
207
+ - A required semantics page was read → `api-docs: available`.
187
208
  - `api-docs-mode: unavailable` (the dispatcher's field), the wrapper exits non-zero, or the
188
209
  section is not found → `api-docs: unavailable`, record the failed query/ID and the error, then
189
210
  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 "incremental migration", "migrate the short-video player page", "fill in a module's missing pages", 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`.
@@ -209,6 +208,7 @@ Exit 0 is required. It checks, per page, that every declared screenshot/view tre
209
208
 
210
209
  - **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.
211
210
  - **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.
211
+ - **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`).
212
212
  - **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.
213
213
  - **4.4** Resolve shared facts once, as `Project Fact (<name>)` 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.
214
214
 
@@ -260,7 +260,7 @@ If a task-tracking tool is available, create one task per page, with already-`do
260
260
 
261
261
  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.
262
262
  - **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.
263
- - **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.
263
+ - **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.
264
264
 
265
265
  ## Step 6 — Static Check, Build, Smoke Gate
266
266
 
@@ -326,9 +326,9 @@ node ./scripts/detach.mjs stop ${harmony_project_dir} --name fixture_server #
326
326
  node <a2h-utg-explorer>/scripts/d_prereqs.mjs release --config ${harmony_project_dir}/.hometrans/utg_explore/config.json # only if that config.json exists
327
327
  ```
328
328
 
329
- **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.
329
+ **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.
330
330
 
331
- 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.
331
+ 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.
332
332
 
333
333
  Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.md`:
334
334
 
@@ -342,6 +342,7 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
342
342
  1. **Per-page results** — one row per group, giving:
343
343
  - page ids, `tier`, `status`, `output` files and the one-line `summary`;
344
344
  - `error` for failed pages;
345
+ - 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;
345
346
  - a mark on every page whose evidence was parent-reconstructed.
346
347
  2. **Build status** — the outcomes of Steps 6.1, 6.2 and 6.3, including `[CANDIDATES]` reviewed but deliberately not "fixed", with the reason.
347
348
  In incremental mode, also list the 6.1 `[BASELINE]` section: defects that were in the project before this run, left as they were.
@@ -357,6 +358,7 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
357
358
  - **Degraded items (`degraded`)** — icons that could not be sourced (Phase 4.3 L3), and transitions declared but not implemented (Transition Implementation Evidence). 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.
358
359
  - **Pending fetch (`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 `degraded`: these need only a download, whereas an L3 needs new artwork.
359
360
  - **Unfixed `error`-severity resource-fidelity rows** — anything the Step 2 gate flagged that was accepted rather than repaired.
361
+ - **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.
360
362
  - **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).
361
363
 
362
364
  ## Key Constraints
@@ -366,7 +368,7 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
366
368
  - **Work through the Common Mistranslations Cheat Sheet 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.
367
369
  - **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.
368
370
  - **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.
369
- - **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*.
371
+ - **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*.
370
372
  - **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.
371
373
  - **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.
372
374
  - **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` taken as "top-left"** | In ArkUI's nine-grid, `Start` = left + vertically centered; top-left is `TopStart` | `Scroll` content shorter than the viewport floats in the middle of the screen | → the `Scroll` paragraph of Phase 5 "Text Alignment Evidence"; GATE `scroll-align-not-top` |
34
34
  | **Vertical `Scroll` left without `.align()` because "the SDK has no Scroll.align" or "the content always exceeds the viewport"** | `align` is not in `scroll.d.ts` (it is in `CommonMethod`); the reference frame happens to be a full page of data | With few items the whole list floats mid-viewport (category goods start at left-middle, Android at top-left) | `.align(Alignment.TopStart)`; data-driven content is GATE `scroll-align-default-center`, downgraded only by `// SCROLL-CENTER:` |
35
35
  | **`LazyRow` translated to an unsized horizontal `Scroll`** | Only the scroll direction was considered, not the width; the parent card `Column` has no `alignItems` | Less than a screen of content sits centered, Android starts at the left | Horizontal Scroll `.width('100%').align(Alignment.Start)`; GATE `hscroll-centered-in-column` |
36
+ | **The top bar's navigation / action slots translated into one `SpaceBetween` `Row`, with the back button inside an `if`** | Compose `TopAppBar(navigationIcon, actions)` has one slot on each side, and the handiest translation is `Row().justifyContent(FlexAlign.SpaceBetween)` with two children; the reference screenshot happens to be the route that shows a back button | Without the back button the Row has only the actions child, and SpaceBetween puts a single child at the start: an "Edit" button on the right moves to the left | Lay it out as slots: leading slot (the back button inside the `if`), `Blank().layoutWeight(1)`, trailing slot; or a same-width placeholder in an `else`. GATE `space-between-optional-lead` |
@@ -7,6 +7,7 @@
7
7
  - **Font-size units of custom-drawn text**: `Paint.textSize` is in px; source code usually converts with `sp(N)` / `dp(N)` / `applyDimension(...)`. The font size unit of ArkUI `CanvasRenderingContext2D.font` can only be `px` or `vp` and must be written explicitly (SDK `canvas.d.ts`), where `px` means **physical pixels**. So `sp(N)` must become `` `${N}vp` ``; to follow system font scaling, write `` `${this.getUIContext().fp2px(N)}px` ``. You **must not** attach the sp number directly to `px`. Coordinates in the same Canvas are vp by default, so with the wrong unit the layout positions are still right and only the text is noticeably smaller (about 38% of the original at density 2.625), and the geometry self-checks all pass. Custom-drawn text has no node in the view tree and no measurement; the group pack's "Canvas-drawn text" section lists every `drawText` and the source of its font size — compare them one by one. Mechanical backstop: GATE `canvas-font-px-literal`.
8
8
  - **Coordinate units of custom-drawn geometry**: the unit of `CanvasRenderingContext2D` is determined only by its constructor: `new CanvasRenderingContext2D(settings, unit?)`; `unit` defaults to `LengthMetricsUnit.DEFAULT`, **which is vp** (SDK `canvas.d.ts` constructor; `Graphics.d.ts` `DEFAULT = 0 // Length in vp`). Coordinates, `lineWidth`, `setLineDash` and the return value of `measureText()` are all in vp. Write Android's `dp(N)` as plain `N`; **do not** additionally multiply by `vp2px(1)` / `densityPixels`, and do not divide `measureText().width` by the density either. When you really need physical pixels, construct it as `new CanvasRenderingContext2D(settings, LengthMetricsUnit.PX)` (`import { LengthMetricsUnit } from '@kit.ArkUI'`) instead of multiplying by the density by hand. There is **no** `ctx.units` property and **no** `CanvasUnit` enum. When coordinates are multiplied by the density once too often, boxes and lines are enlarged by the density factor, content outside a fixed-width Canvas is clipped, and `vp` font sizes do not scale along; compilation, smoke and geometry self-checks all pass. Mechanical backstop: GATE `canvas-coord-density-scaled`; `ctx.units =` / `CanvasUnit` hits GATE `sdk-api-nonexistent`.
9
9
  - **`Path` / clip-path commands are in px**: the SVG path strings of `Path({ commands })`, `.commands()`, `new Path({ commands })` used as a `.clip()` / `.clipShape()` argument, and `PathShape({ commands })` are all in **physical pixels** (SDK `path.d.ts`: "The unit is px"), whereas `Path`'s `width`/`height` and `Area.width/height` from `onAreaChange` are vp. Building commands from vp numbers shrinks the clip region to 1/density. In Compose, `clip(GenericShape { … })` and `drawBehind { path… }` work in px (`size` itself is px); when porting, convert the same geometry with `vp2px()` before building the commands. Mechanical backstop: GATE `path-commands-vp`.
10
+ - **Content drawn outside the canvas**: Compose `Canvas` / `drawBehind` does not clip by default, so the source often draws a selection bubble or value label above the canvas top edge (negative y), into space the layout reserves above the canvas (for example `Spacer(24.dp)` followed by `Canvas`, with the bubble at `y = -14.dp`). ArkUI `Canvas` draws only inside the component; copying the negative coordinate puts the bubble out of place and over the text above it. Fold the reserved space into the canvas height (grow the canvas by the same amount and shift every y down), or make the bubble a separate layer outside the canvas (`Stack`, with a `position` computed from the selected point). Mechanical backstop: CAND `canvas-negative-draw-offset`.
10
11
 
11
12
  ## Common Mistranslations (undetectable at compile time)
12
13
 
@@ -16,10 +16,41 @@ Register each as "trigger condition → changed property → start/end values".
16
16
 
17
17
  **Criterion (cross-check with snapshots, not by gut feel)**: if the bounds or size of the same `resource-id` change between `view_scroll_n.xml` snapshots and the change **cannot be explained by scroll displacement** (e.g. the whole block gets shorter rather than moving up as a whole), that is transition evidence — and a matching entry must exist in this list. Conversely, every entry in the list must have its implementation status stated in Phase 5.
18
18
 
19
- **End-point substitution (mandatory for interpolated transitions)**: when a transition is written as "start/end constants + progress interpolation", the start constant is seen only on the first frame and the end constant shows only after a scroll/tap. For every interpolated position/size, compute the actual rectangle at progress = 0 and = 1 from the HarmonyOS-side coordinate origin (`cards/geometry.md` "Hard requirement (coordinate system)"), and compare it one by one with the bounds of the same `resource-id` in the start and end snapshots (converted to safe-area vp); list it as an "element → end point → computed interval → snapshot interval" table in "Transition Implementation Evidence". If an end point cannot be computed or does not match, that transition must not be labeled `implemented`.
19
+ **End-point substitution (mandatory for interpolated transitions)**: when a transition is written as "start/end constants + progress interpolation", the start constant is seen only on the first frame and the end constant shows only after a scroll/tap. For every interpolated position/size, compute the actual rectangle at progress = 0 and = 1 from the HarmonyOS-side coordinate origin (`cards/geometry.md` "Hard requirement (coordinate system)"), and compare it one by one with the bounds of the same `resource-id` in the start and end snapshots (converted to safe-area vp); list it as an "element → end point → computed interval → snapshot interval" table in "Transition Implementation Evidence". If an end point cannot be computed or does not match, that transition must not be labeled `implemented`. **Substitute opacity / alpha too**: for every `opacity` computed from a progress value, substitute p = 0 and p = 1 into both the HarmonyOS expression and the Android source expression (run it with `node -e`, no mental arithmetic) and write both results on one row; for a page without snapshots (source-only) the source expression's result is the reference. A mismatch at either end fails (typical: a constant sub-expression was simplified and lost its sign, so a row meant to be hidden shows on the first screen).
20
20
 
21
21
  Typical consequence of skipping this section: the static first screen is completely correct, but as soon as you scroll/tap/switch it behaves differently from the source app, while every static check passes with full marks.
22
22
 
23
+ **MotionLayout collapsing header (`OnSwipe` + content constrained to the header's bottom): the header consumes the drag, the content never passes under the header**: the usual Android form is a scene whose `OnSwipe(dragUp, touchAnchorId=<content container>)` drives `startHeader → endHeader`, a content container constrained `Top_toBottomOf=@toolbar`, and header layers (the `toolbar` color, a full-size header `ImageView`) that are children of the MotionLayout itself. So when the header collapses, the content's top edge moves up with it and **the content never goes under the header**; the header's color and image always cover its own area. Build the HarmonyOS side on the same constraint:
24
+
25
+ ```ts
26
+ // H_MAX / H_MIN = header height of startHeader / endHeader (safe-area vp), progress = (H_MAX - headerH) / (H_MAX - H_MIN)
27
+ Column() {
28
+ XxxHeader({ progress: this.progress() }) // the root paints its own color + header image, opacity driven by progress
29
+ .height(this.headerH)
30
+ Scroll(this.scroller) { /* content, no spacer at the top */ }
31
+ .layoutWeight(1) // the viewport starts at the header's bottom edge = Top_toBottomOf=@toolbar
32
+ .onScrollFrameBegin((offset: number) => {
33
+ // offset > 0: the content is about to move up, collapse the header first
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: pulling back, expand the header once the content is at the top
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` receives the scroll amount about to happen, and the Scroll scrolls by the `offsetRemain` it returns (Scroll API doc). So while the header is not fully collapsed the content does not move, and only after that does it scroll, which matches how `OnSwipe` feels. Inside a `Refresh` (`SwipeRefreshLayout`), only the pull left over once the header is fully expanded and the content is at the top goes to the refresh. When the header background extends into the status bar, the extension layer at the page root covers only the status-bar strip (`cards/window.md` ③); the header paints its safe-area part itself.
51
+
52
+ **Do not** build it as "a same-height spacer at the top of the Scroll + the header as a sibling overlay + progress derived in `onDidScroll`": the content scrolls under the header, and if any header layer lacks a background, the cards show through the header text. GATE `scroll-driven-overlay-see-through`. If the overlay structure really has to stay, the header root must paint all of Android's opaque header layers itself.
53
+
23
54
  **State-branch list — compare captured states against screenshots, and compare branch by branch against source only for uncaptured ones**: reference snapshots cover only some states (mode tabs, expanded/collapsed, empty/with data…). Every `ui-state` in `ATTACHED_NODES`, and every branch in this page's source that renders differently by state, must be registered as one row "state → condition (`file:line`) → build/draw calls in that branch → evidence". Fill the evidence column from `REFERENCE_SCREENSHOTS`: when the state has its own `###` group, write its frame paths and **convert and verify against those frames** (treated the same as the main state, including all Phase 5 measurements); write `not-captured` for a state without a group. Uncaptured states have no screenshot to compare against and **can only be checked branch by branch against the source**, so the calls in each branch must be listed completely:
24
55
 
25
56
  - Layout branches: `if (mode == DAY) addView(...)`, `when (selectedMode)`, etc. — list the Views added/hidden in each branch;