@buaa_smat/hometrans 26.0.1 → 26.0.3

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 (1053) hide show
  1. package/README.md +14 -7
  2. package/agents/code-reviewer.md +25 -138
  3. package/dist/cli/index.js +4 -1
  4. package/dist/cli/init.js +131 -26
  5. package/dist/cli/uninstall.js +5 -5
  6. package/dist/platform/language.js +77 -0
  7. package/env-requirements.json +30 -5
  8. package/i18n/FILE-NAMES.md +9 -0
  9. package/i18n/agents/code-reviewer.md +364 -0
  10. package/i18n/agents/model-render-worker.md +38 -0
  11. package/i18n/agents/specgen-worker.md +18 -0
  12. package/i18n/commands/hometrans.md +17 -0
  13. package/i18n/skills/a2h-app-migrate/SKILL.md +198 -0
  14. package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
  15. package/i18n/skills/a2h-app-migrate/references/specs.example.json +19 -0
  16. package/i18n/skills/a2h-app-migrate/references/stage-map.md +50 -0
  17. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +1760 -0
  18. package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
  19. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1588 -0
  20. package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +657 -0
  21. package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
  22. package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
  23. package/i18n/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
  24. package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
  25. package/i18n/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
  26. package/i18n/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
  27. package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
  28. package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
  29. package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
  30. package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
  31. package/i18n/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
  32. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
  33. package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
  34. package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
  35. package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
  36. package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
  37. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
  38. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
  39. package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
  40. package/i18n/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
  41. package/i18n/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
  42. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +171 -0
  43. package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
  44. package/i18n/skills/a2h-arch-generate/SKILL.md +375 -0
  45. package/i18n/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
  46. package/i18n/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
  47. package/i18n/skills/a2h-arch-generate/references/arkts-mvvm-v2.md +1407 -0
  48. package/i18n/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
  49. package/i18n/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
  50. package/i18n/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
  51. package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
  52. package/i18n/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
  53. package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
  54. package/i18n/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
  55. package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
  56. package/i18n/skills/a2h-arch-generate/references/source-baseline.md +93 -0
  57. package/i18n/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +360 -0
  58. package/i18n/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +798 -0
  59. package/i18n/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
  60. package/i18n/skills/a2h-arch-generate/scripts/module_create/generate.mjs +639 -0
  61. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
  62. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
  63. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
  64. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
  65. package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
  66. package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
  67. package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1261 -0
  68. package/i18n/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
  69. package/i18n/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +851 -0
  70. package/i18n/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +982 -0
  71. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +9 -0
  72. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +192 -0
  73. package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +303 -0
  74. package/i18n/skills/a2h-arkts-logic-coder/scripts/design/move_spec_technical_reference.mjs +162 -0
  75. package/i18n/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +298 -0
  76. package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +587 -0
  77. package/i18n/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
  78. package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
  79. package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
  80. package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
  81. package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
  82. package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
  83. package/i18n/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
  84. package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
  85. package/i18n/skills/a2h-batch-ui-align/SKILL.md +323 -0
  86. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -0
  87. package/i18n/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
  88. package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
  89. package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
  90. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +80 -0
  91. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
  92. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +87 -0
  93. package/i18n/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
  94. package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
  95. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +57 -0
  96. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
  97. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +705 -0
  98. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +417 -0
  99. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
  100. package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
  101. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2549 -0
  102. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +560 -0
  103. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +148 -0
  104. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +220 -0
  105. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +28 -0
  106. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +216 -0
  107. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +203 -0
  108. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +210 -0
  109. package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
  110. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1748 -0
  111. package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
  112. package/i18n/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +245 -0
  113. package/i18n/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
  114. package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1787 -0
  115. package/i18n/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
  116. package/i18n/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
  117. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1836 -0
  118. package/i18n/skills/a2h-batch-ui-align/scripts/image_probe.mjs +405 -0
  119. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1406 -0
  120. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1226 -0
  121. package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1220 -0
  122. package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +412 -0
  123. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
  124. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +18 -0
  125. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +173 -0
  126. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -0
  127. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
  128. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +67 -0
  129. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
  130. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
  131. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
  132. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +136 -0
  133. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
  134. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +109 -0
  135. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
  136. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
  137. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
  138. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
  139. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
  140. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
  141. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
  142. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
  143. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
  144. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +551 -0
  145. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
  146. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +374 -0
  147. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
  148. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
  149. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
  150. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
  151. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
  152. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +80 -0
  153. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +137 -0
  154. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
  155. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
  156. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
  157. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +97 -0
  158. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
  159. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -0
  160. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
  161. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
  162. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
  163. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
  164. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
  165. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
  166. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
  167. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
  168. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
  169. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
  170. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
  171. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
  172. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
  173. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +67 -0
  174. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
  175. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
  176. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
  177. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
  178. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
  179. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
  180. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
  181. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
  182. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
  183. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
  184. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +560 -0
  185. package/i18n/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +245 -0
  186. package/i18n/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
  187. package/i18n/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
  188. package/i18n/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
  189. package/i18n/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
  190. package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
  191. package/i18n/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
  192. package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
  193. package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
  194. package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
  195. package/i18n/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
  196. package/i18n/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
  197. package/i18n/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
  198. package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +59 -0
  199. package/i18n/skills/a2h-dashboard-render/SKILL.md +73 -0
  200. package/i18n/skills/a2h-dashboard-render/references/artifact-contract.jsonc +117 -0
  201. package/i18n/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
  202. package/i18n/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
  203. package/i18n/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
  204. package/i18n/skills/a2h-dashboard-render/scripts/dashboard.mjs +3245 -0
  205. package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +2048 -0
  206. package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
  207. package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
  208. package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
  209. package/i18n/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
  210. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
  211. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
  212. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +154 -0
  213. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
  214. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
  215. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
  216. package/i18n/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
  217. package/i18n/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
  218. package/i18n/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
  219. package/i18n/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
  220. package/i18n/skills/a2h-fix-build-errors/SKILL.md +304 -0
  221. package/i18n/skills/a2h-fix-build-errors/references/arkts-strict-patterns.md +219 -0
  222. package/i18n/skills/a2h-fix-build-errors/references/rdb-entity-pattern.md +131 -0
  223. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +227 -0
  224. package/i18n/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
  225. package/i18n/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
  226. package/i18n/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
  227. package/i18n/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
  228. package/i18n/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
  229. package/i18n/skills/a2h-page-specgen/SKILL.md +136 -0
  230. package/i18n/skills/a2h-page-specgen/references/body-language.md +177 -0
  231. package/i18n/skills/a2h-page-specgen/references/gates.md +262 -0
  232. package/i18n/skills/a2h-page-specgen/references/page-inventory.md +173 -0
  233. package/i18n/skills/a2h-page-specgen/references/spec-template.md +207 -0
  234. package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
  235. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
  236. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +576 -0
  237. package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +138 -0
  238. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +262 -0
  239. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +176 -0
  240. package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +248 -0
  241. package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
  242. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +506 -0
  243. package/i18n/skills/a2h-page-specgen/scripts/render.mjs +299 -0
  244. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +616 -0
  245. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +234 -0
  246. package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1166 -0
  247. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
  248. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +8 -0
  249. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +7 -0
  250. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +8 -0
  251. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
  252. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
  253. package/i18n/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
  254. package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
  255. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +271 -0
  256. package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
  257. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
  258. package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
  259. package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +83 -0
  260. package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
  261. package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
  262. package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
  263. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +77 -0
  264. package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +419 -0
  265. package/i18n/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
  266. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
  267. package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
  268. package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +511 -0
  269. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
  270. package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
  271. package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
  272. package/i18n/skills/a2h-resource-convert/SKILL.md +367 -0
  273. package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +335 -0
  274. package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
  275. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +219 -0
  276. package/i18n/skills/a2h-resource-convert/references/resource-mapping-rules.md +493 -0
  277. package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
  278. package/i18n/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
  279. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +2532 -0
  280. package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
  281. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +278 -0
  282. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +260 -0
  283. package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +163 -0
  284. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +44 -0
  285. package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
  286. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +589 -0
  287. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +506 -0
  288. package/i18n/skills/a2h-spec-generate/SKILL.md +375 -0
  289. package/i18n/skills/a2h-spec-generate/references/batch-mode.md +215 -0
  290. package/i18n/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
  291. package/i18n/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
  292. package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +184 -0
  293. package/i18n/skills/a2h-spec-generate/references/input-formats.md +27 -0
  294. package/i18n/skills/a2h-spec-generate/references/library-evidence.md +3 -0
  295. package/i18n/skills/a2h-spec-generate/references/method-discipline.md +64 -0
  296. package/i18n/skills/a2h-spec-generate/references/optional-gates.json +45 -0
  297. package/i18n/skills/a2h-spec-generate/references/recall-guide.md +84 -0
  298. package/i18n/skills/a2h-spec-generate/references/recall-terse.md +3 -0
  299. package/i18n/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
  300. package/i18n/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
  301. package/i18n/skills/a2h-spec-generate/references/review-checklist.md +22 -0
  302. package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
  303. package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
  304. package/i18n/skills/a2h-spec-generate/references/spec-samples.md +65 -0
  305. package/i18n/skills/a2h-spec-generate/references/specs.schema.json +85 -0
  306. package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +145 -0
  307. package/i18n/skills/a2h-spec-generate/references/transfer-file.md +5 -0
  308. package/i18n/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
  309. package/i18n/skills/a2h-spec-generate/references/worker-rules.md +129 -0
  310. package/i18n/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +702 -0
  311. package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +515 -0
  312. package/i18n/skills/a2h-spec-generate/scripts/collect-specs.mjs +727 -0
  313. package/i18n/skills/a2h-spec-generate/scripts/feature-stem.mjs +151 -0
  314. package/i18n/skills/a2h-spec-generate/scripts/parse_requirements.ts +515 -0
  315. package/i18n/skills/a2h-spec-generate/scripts/prepare-facts.mjs +313 -0
  316. package/i18n/skills/a2h-spec-generate/scripts/publish-specs.mjs +354 -0
  317. package/i18n/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +669 -0
  318. package/i18n/skills/a2h-spec-generate/scripts/render-tasks.mjs +385 -0
  319. package/i18n/skills/a2h-spec-generate/scripts/report.mjs +136 -0
  320. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
  321. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
  322. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
  323. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
  324. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1265 -0
  325. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1057 -0
  326. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +565 -0
  327. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +544 -0
  328. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
  329. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +317 -0
  330. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +707 -0
  331. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +436 -0
  332. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +608 -0
  333. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +650 -0
  334. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +178 -0
  335. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
  336. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +912 -0
  337. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +279 -0
  338. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +163 -0
  339. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
  340. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +256 -0
  341. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
  342. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
  343. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
  344. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
  345. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
  346. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
  347. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +340 -0
  348. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1857 -0
  349. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +262 -0
  350. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +722 -0
  351. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
  352. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
  353. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
  354. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
  355. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
  356. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
  357. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
  358. package/i18n/skills/a2h-spec-generate/template/REQ.txt +22 -0
  359. package/i18n/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
  360. package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +847 -0
  361. package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +415 -0
  362. package/i18n/skills/a2h-spec-generate/test/collect-specs.test.mjs +808 -0
  363. package/i18n/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
  364. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
  365. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
  366. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
  367. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
  368. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
  369. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
  370. package/i18n/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
  371. package/i18n/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
  372. package/i18n/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
  373. package/i18n/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
  374. package/i18n/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
  375. package/i18n/skills/a2h-spec-generate/test/report.test.mjs +47 -0
  376. package/i18n/skills/a2h-utg-explorer/SKILL.md +120 -0
  377. package/i18n/skills/a2h-utg-explorer/references/architecture.md +279 -0
  378. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +918 -0
  379. package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +446 -0
  380. package/i18n/skills/a2h-utg-explorer/scripts/hint_check.mjs +147 -0
  381. package/i18n/skills/a2h-utg-explorer/scripts/hint_source.mjs +119 -0
  382. package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
  383. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +380 -0
  384. package/i18n/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
  385. package/i18n/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
  386. package/i18n/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
  387. package/i18n/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
  388. package/i18n/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
  389. package/i18n/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
  390. package/i18n/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
  391. package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
  392. package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
  393. package/i18n/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
  394. package/i18n/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
  395. package/i18n/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
  396. package/i18n/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
  397. package/i18n/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
  398. package/i18n/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
  399. package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
  400. package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
  401. package/i18n/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
  402. package/i18n/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
  403. package/i18n/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
  404. package/i18n/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
  405. package/i18n/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
  406. package/i18n/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
  407. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1412 -0
  408. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2037 -0
  409. package/i18n/skills/a2h-utg-static/SKILL.md +368 -0
  410. package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
  411. package/i18n/skills/a2h-utg-static/references/view-interactions.md +215 -0
  412. package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +2120 -0
  413. package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
  414. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +609 -0
  415. package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +250 -0
  416. package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +374 -0
  417. package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
  418. package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
  419. package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
  420. package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
  421. package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +913 -0
  422. package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +517 -0
  423. package/i18n/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
  424. package/i18n/skills/a2h-utg-static/scripts/static_prior.mjs +956 -0
  425. package/i18n/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
  426. package/i18n/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
  427. package/i18n/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
  428. package/i18n/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
  429. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +108 -0
  430. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +289 -0
  431. package/i18n/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
  432. package/i18n/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
  433. package/i18n/skills/a2h-utg-static/scripts/tests/test_fresh_branch_guard.mjs +49 -0
  434. package/i18n/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +136 -0
  435. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
  436. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
  437. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
  438. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
  439. package/i18n/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
  440. package/i18n/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
  441. package/i18n/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
  442. package/i18n/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +368 -0
  443. package/i18n/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
  444. package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
  445. package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
  446. package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
  447. package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_off_path.mjs +67 -0
  448. package/i18n/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
  449. package/i18n/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
  450. package/i18n/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
  451. package/i18n/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
  452. package/i18n/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
  453. package/i18n/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
  454. package/i18n/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +61 -0
  455. package/i18n/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
  456. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_data_table.mjs +340 -0
  457. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_relative_url.mjs +125 -0
  458. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
  459. package/i18n/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
  460. package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1351 -0
  461. package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
  462. package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
  463. package/package.json +13 -160
  464. package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
  465. package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
  466. package/skills/a2h-app-migrate/SKILL.md +17 -6
  467. package/skills/a2h-app-migrate/references/config.example.json +1 -0
  468. package/skills/a2h-app-migrate/references/stage-map.md +3 -1
  469. package/skills/a2h-app-migrate/references/workflow.yaml +138 -47
  470. package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +1 -2
  471. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +105 -39
  472. package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +7 -8
  473. package/skills/a2h-app-migrate/scripts/ledger.mjs +17 -5
  474. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +43 -7
  475. package/skills/a2h-app-migrate/scripts/run_dir.mjs +127 -41
  476. package/skills/a2h-app-migrate/scripts/spec_layout.mjs +2 -0
  477. package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +38 -0
  478. package/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
  479. package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
  480. package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
  481. package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
  482. package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
  483. package/skills/a2h-app-migrate/test/test_devecocli_docs_preflight.mjs +32 -0
  484. package/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
  485. package/skills/a2h-app-migrate/test/test_entry_guards.mjs +102 -0
  486. package/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
  487. package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
  488. package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
  489. package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
  490. package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +51 -0
  491. package/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
  492. package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +91 -0
  493. package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
  494. package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
  495. package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +111 -0
  496. package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -0
  497. package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
  498. package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
  499. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
  500. package/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
  501. package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
  502. package/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
  503. package/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
  504. package/skills/a2h-app-migrate/test/test_spec_engine_acceptance.mjs +94 -0
  505. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +147 -0
  506. package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
  507. package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
  508. package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +344 -0
  509. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
  510. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -0
  511. package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
  512. package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
  513. package/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
  514. package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +41 -0
  515. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +178 -0
  516. package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
  517. package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
  518. package/skills/a2h-arch-generate/SKILL.md +1 -1
  519. package/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
  520. package/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
  521. package/skills/a2h-arch-generate/references/homegraph-workflow.md +15 -6
  522. package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
  523. package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
  524. package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
  525. package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +33 -40
  526. package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +2 -3
  527. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
  528. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
  529. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
  530. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
  531. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
  532. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
  533. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
  534. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
  535. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
  536. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
  537. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
  538. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
  539. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
  540. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
  541. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
  542. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
  543. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
  544. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
  545. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
  546. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
  547. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
  548. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
  549. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
  550. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
  551. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
  552. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
  553. package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
  554. package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1260 -0
  555. package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +191 -0
  556. package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
  557. package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
  558. package/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
  559. package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +138 -0
  560. package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
  561. package/skills/a2h-arkts-logic-coder/SKILL.md +21 -2
  562. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -0
  563. package/skills/a2h-arkts-logic-coder/references/code-generation.md +62 -0
  564. package/skills/a2h-arkts-logic-coder/references/spec-design.md +4 -0
  565. package/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +22 -25
  566. package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +583 -0
  567. package/skills/a2h-arkts-logic-coder/test/golden/inspect_happy.json +20 -0
  568. package/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
  569. package/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
  570. package/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
  571. package/skills/a2h-arkts-logic-coder/test/golden/resolve_cases.json +36 -0
  572. package/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
  573. package/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
  574. package/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
  575. package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
  576. package/skills/a2h-batch-ui-align/SKILL.md +6 -4
  577. package/skills/a2h-batch-ui-align/references/cards/geometry.md +1 -1
  578. package/skills/a2h-batch-ui-align/references/cards/resources.md +4 -0
  579. package/skills/a2h-batch-ui-align/references/cards/widgets.md +22 -3
  580. package/skills/a2h-batch-ui-align/references/checker-rules.md +66 -3
  581. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +45 -8
  582. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -5
  583. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +2 -2
  584. package/skills/a2h-batch-ui-align/references/step4-prepare.md +4 -2
  585. package/skills/a2h-batch-ui-align/references/step5-convert.md +7 -5
  586. package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
  587. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +84 -7
  588. package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
  589. package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +229 -0
  590. package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1 -2
  591. package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
  592. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +88 -26
  593. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +305 -12
  594. package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
  595. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +8 -9
  596. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +18 -5
  597. package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +103 -3
  598. package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
  599. package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
  600. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +14 -8
  601. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +8 -0
  602. package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
  603. package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +2 -2
  604. package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +84 -19
  605. package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +11 -4
  606. package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +2 -2
  607. package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
  608. package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +5 -5
  609. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
  610. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +66 -2
  611. package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
  612. package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
  613. package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
  614. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
  615. package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
  616. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +6 -0
  617. package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -0
  618. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
  619. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +312 -0
  620. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
  621. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
  622. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
  623. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
  624. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
  625. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
  626. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
  627. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +235 -0
  628. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
  629. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
  630. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_safearea.test.mjs +742 -0
  631. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
  632. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +86 -0
  633. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
  634. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +567 -0
  635. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
  636. package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -0
  637. package/skills/a2h-batch-ui-align/scripts/tests/detect_paradigm.test.mjs +260 -0
  638. package/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +244 -0
  639. package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +420 -0
  640. package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
  641. package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
  642. package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
  643. package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
  644. package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
  645. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1628 -0
  646. package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
  647. package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
  648. package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
  649. package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
  650. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
  651. package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
  652. package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
  653. package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +297 -0
  654. package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
  655. package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
  656. package/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
  657. package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
  658. package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
  659. package/skills/a2h-dashboard-render/scripts/dashboard.mjs +12 -14
  660. package/skills/a2h-dashboard-render/scripts/device_capture.mjs +29 -30
  661. package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
  662. package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
  663. package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
  664. package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
  665. package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
  666. package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
  667. package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
  668. package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
  669. package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
  670. package/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +203 -0
  671. package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
  672. package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
  673. package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
  674. package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
  675. package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
  676. package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
  677. package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
  678. package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
  679. package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
  680. package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
  681. package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
  682. package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
  683. package/skills/a2h-page-specgen/SKILL.md +136 -0
  684. package/skills/a2h-page-specgen/references/body-language.md +177 -0
  685. package/skills/a2h-page-specgen/references/evidence.md +70 -0
  686. package/skills/a2h-page-specgen/references/execution-model.md +255 -0
  687. package/skills/a2h-page-specgen/references/footprint-and-grouping.md +250 -0
  688. package/skills/a2h-page-specgen/references/gates.md +255 -0
  689. package/skills/a2h-page-specgen/references/page-inventory.md +173 -0
  690. package/skills/a2h-page-specgen/references/spec-template.md +207 -0
  691. package/skills/a2h-page-specgen/scripts/dispatch.mjs +209 -0
  692. package/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
  693. package/skills/a2h-page-specgen/scripts/finalize.mjs +422 -0
  694. package/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
  695. package/skills/a2h-page-specgen/scripts/gate.mjs +558 -0
  696. package/skills/a2h-page-specgen/scripts/interactions.mjs +137 -0
  697. package/skills/a2h-page-specgen/scripts/inventory.mjs +269 -0
  698. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +255 -0
  699. package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
  700. package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +137 -0
  701. package/skills/a2h-page-specgen/scripts/lib/footprint-roles.mjs +278 -0
  702. package/skills/a2h-page-specgen/scripts/lib/fsx.mjs +79 -0
  703. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +175 -0
  704. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +355 -0
  705. package/skills/a2h-page-specgen/scripts/lib/prose.mjs +234 -0
  706. package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
  707. package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +391 -0
  708. package/skills/a2h-page-specgen/scripts/lib/symbols.mjs +125 -0
  709. package/skills/a2h-page-specgen/scripts/lib/utg-io.mjs +110 -0
  710. package/skills/a2h-page-specgen/scripts/lib/waker-event-store.mjs +658 -0
  711. package/skills/a2h-page-specgen/scripts/prepare.mjs +492 -0
  712. package/skills/a2h-page-specgen/scripts/render.mjs +317 -0
  713. package/skills/a2h-page-specgen/scripts/report.mjs +7 -0
  714. package/skills/a2h-page-specgen/scripts/submission.mjs +532 -0
  715. package/skills/a2h-page-specgen/scripts/submit.mjs +79 -0
  716. package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
  717. package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +590 -0
  718. package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
  719. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +207 -0
  720. package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
  721. package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1164 -0
  722. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
  723. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Api.kt +20 -0
  724. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/BothAnnotations.kt +28 -0
  725. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Cache.kt +7 -0
  726. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Comments.kt +26 -0
  727. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Mmkv.kt +7 -0
  728. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Models.kt +19 -0
  729. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Pair.kt +7 -0
  730. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Prefs.kt +9 -0
  731. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Room.kt +11 -0
  732. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Sample.kt +43 -0
  733. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Templates.kt +34 -0
  734. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Timeouts.kt +8 -0
  735. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/androidTest/Helper.kt +5 -0
  736. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/build.gradle.kts +16 -0
  737. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/en.js.txt +5 -0
  738. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +4 -0
  739. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/libs.versions.toml +14 -0
  740. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/package.json +10 -0
  741. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values/strings.xml +10 -0
  742. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +4 -0
  743. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-land/strings.xml +5 -0
  744. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-night/strings.xml +5 -0
  745. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-v21/strings.xml +4 -0
  746. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +4 -0
  747. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/test/Legacy.kt +4 -0
  748. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/weather.proto +11 -0
  749. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/AppPreferences.kt +13 -0
  750. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/SettingsViewModel.kt +16 -0
  751. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-dao/src/UserDao.kt +28 -0
  752. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/base/strings.xml +6 -0
  753. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/fil/strings.xml +6 -0
  754. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/arrays.xml +25 -0
  755. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/strings.xml +10 -0
  756. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/xml/prefs.xml +27 -0
  757. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Api.java +19 -0
  758. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Datastore.kt +12 -0
  759. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Settings.java +13 -0
  760. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/forecast.js +14 -0
  761. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/store.js +14 -0
  762. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/BasePreferences.kt +13 -0
  763. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/Screen.kt +14 -0
  764. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/UiPreferences.kt +8 -0
  765. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-retrofit/src/AuthAPI.kt +26 -0
  766. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/AndroidManifest.xml +20 -0
  767. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/feature/auth/navigation/ScreenRoute.kt +8 -0
  768. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/pages.json +19 -0
  769. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/components/Widget.vue +11 -0
  770. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/detail/detail.vue +14 -0
  771. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/index/index.vue +24 -0
  772. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/store/userStore.js +11 -0
  773. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/uni_modules/uview-ui/components/u-thing.js +5 -0
  774. package/skills/a2h-page-specgen/scripts/test/fixtures/fp.mkdb.mjs +144 -0
  775. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +94 -0
  776. package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
  777. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyListeners.java +12 -0
  778. package/skills/a2h-page-specgen/scripts/test/fixtures/src/PlainActivity.java +3 -0
  779. package/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
  780. package/skills/a2h-page-specgen/scripts/test/fixtures/utg/fold-chain/utg.json +12 -0
  781. package/skills/a2h-page-specgen/scripts/test/fixtures/utg/utg.json +34 -0
  782. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
  783. package/skills/a2h-page-specgen/scripts/test/footprint-roles.test.mjs +172 -0
  784. package/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
  785. package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
  786. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +222 -0
  787. package/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
  788. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
  789. package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
  790. package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +45 -0
  791. package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
  792. package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
  793. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
  794. package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
  795. package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +120 -0
  796. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +68 -0
  797. package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +390 -0
  798. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +167 -0
  799. package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
  800. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
  801. package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
  802. package/skills/a2h-page-specgen/scripts/test/render.test.mjs +503 -0
  803. package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
  804. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
  805. package/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
  806. package/skills/a2h-page-specgen/scripts/test/waker-event-store.test.mjs +1365 -0
  807. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
  808. package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1979 -0
  809. package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +313 -0
  810. package/skills/a2h-page-specgen/scripts/waker.mjs +1234 -0
  811. package/skills/a2h-page-specgen/scripts/watchdog.mjs +298 -0
  812. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +49 -51
  813. package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
  814. package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
  815. package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
  816. package/skills/a2h-spec-design-pipeline/SKILL.md +79 -78
  817. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +51 -12
  818. package/skills/a2h-spec-design-pipeline/references/execution-model.md +24 -6
  819. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +3 -2
  820. package/skills/a2h-spec-design-pipeline/references/initialization.md +15 -4
  821. package/skills/a2h-spec-design-pipeline/references/merge-queue.md +82 -41
  822. package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +61 -0
  823. package/skills/a2h-spec-design-pipeline/references/scripts.md +19 -10
  824. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +267 -0
  825. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +61 -8
  826. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +62 -13
  827. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +8 -0
  828. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +8 -0
  829. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +55 -0
  830. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +60 -0
  831. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/HttpExtraDataEmptyStringCheck.js +488 -0
  832. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +11 -0
  833. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +17 -0
  834. package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
  835. package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +40 -5
  836. package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +18 -0
  837. package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +74 -0
  838. package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +1 -1
  839. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +1 -1
  840. package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
  841. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +128 -5
  842. package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +98 -35
  843. package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +218 -37
  844. package/skills/a2h-spec-design-pipeline/scripts/lib/shared_classes.ts +113 -0
  845. package/skills/a2h-spec-design-pipeline/scripts/lib/shared_docs.ts +202 -0
  846. package/skills/a2h-spec-design-pipeline/scripts/lib/wiring.ts +58 -0
  847. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +6 -7
  848. package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
  849. package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +348 -0
  850. package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
  851. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +15 -5
  852. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +7 -2
  853. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +104 -1
  854. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +24 -0
  855. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +394 -0
  856. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +24 -1
  857. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +14 -0
  858. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +163 -5
  859. package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +15 -7
  860. package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
  861. package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +350 -0
  862. package/skills/a2h-spec-design-pipeline/scripts/test_scan_shared.ts +996 -0
  863. package/skills/a2h-spec-design-pipeline/scripts/test_shared_classes.ts +80 -0
  864. package/skills/a2h-spec-design-pipeline/scripts/test_shared_docs.ts +205 -0
  865. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +121 -0
  866. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_e2e.ts +85 -0
  867. package/skills/a2h-spec-design-pipeline/scripts/test_validate_shared_manifest.ts +720 -0
  868. package/skills/a2h-spec-design-pipeline/scripts/test_wiring.ts +40 -0
  869. package/skills/a2h-spec-design-pipeline/scripts/validate_shared_manifest.ts +566 -0
  870. package/skills/a2h-spec-generate/SKILL.md +87 -21
  871. package/skills/a2h-spec-generate/references/batch-mode.md +78 -17
  872. package/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
  873. package/skills/a2h-spec-generate/references/fusion-task-contract.md +7 -0
  874. package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
  875. package/skills/a2h-spec-generate/references/synthesis-rules.md +4 -2
  876. package/skills/a2h-spec-generate/references/worker-rules.md +6 -3
  877. package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +4 -5
  878. package/skills/a2h-spec-generate/scripts/check_spec.ts +145 -14
  879. package/skills/a2h-spec-generate/scripts/collect-specs.mjs +261 -19
  880. package/skills/a2h-spec-generate/scripts/dispatch-watch.mjs +1168 -0
  881. package/skills/a2h-spec-generate/scripts/feature-stem.mjs +1 -2
  882. package/skills/a2h-spec-generate/scripts/publish-specs.mjs +1 -2
  883. package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +1 -2
  884. package/skills/a2h-spec-generate/scripts/render-tasks.mjs +25 -46
  885. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +26 -27
  886. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +3 -6
  887. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +31 -32
  888. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +2 -3
  889. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +15 -26
  890. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +102 -81
  891. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +39 -19
  892. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +12 -13
  893. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
  894. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +35 -196
  895. package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +3 -1
  896. package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +22 -96
  897. package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +3 -4
  898. package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +1 -1
  899. package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +74 -7
  900. package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +51 -7
  901. package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +42 -111
  902. package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +1 -20
  903. package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1 -2
  904. package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +3 -4
  905. package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
  906. package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
  907. package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
  908. package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
  909. package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/zip.ts +63 -0
  910. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +650 -0
  911. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
  912. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
  913. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
  914. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-seed.test.ts +195 -0
  915. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
  916. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +347 -0
  917. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1948 -0
  918. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-library-evidence.test.ts +239 -0
  919. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +277 -0
  920. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +844 -0
  921. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
  922. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
  923. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
  924. package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
  925. package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
  926. package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
  927. package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
  928. package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
  929. package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
  930. package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
  931. package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
  932. package/skills/a2h-spec-generate/scripts/reqgen/test/zip.test.ts +61 -0
  933. package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +879 -0
  934. package/skills/a2h-spec-generate/test/check-spec.test.ts +430 -0
  935. package/skills/a2h-spec-generate/test/collect-specs.test.mjs +811 -0
  936. package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
  937. package/skills/a2h-spec-generate/test/dispatch-watch.test.mjs +606 -0
  938. package/skills/a2h-spec-generate/test/ensure-index.test.mjs +230 -0
  939. package/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
  940. package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
  941. package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
  942. package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
  943. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
  944. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
  945. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
  946. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
  947. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
  948. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
  949. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
  950. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
  951. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
  952. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
  953. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
  954. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
  955. package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
  956. package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
  957. package/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
  958. package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +182 -0
  959. package/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
  960. package/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
  961. package/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
  962. package/skills/a2h-spec-generate/test/report.test.mjs +47 -0
  963. package/skills/a2h-utg-explorer/references/architecture.md +4 -0
  964. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +64 -80
  965. package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
  966. package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
  967. package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
  968. package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
  969. package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +244 -0
  970. package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
  971. package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
  972. package/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
  973. package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
  974. package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +231 -0
  975. package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
  976. package/skills/a2h-utg-explorer/scripts/tests/device_locale_identity.test.mjs +77 -0
  977. package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
  978. package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
  979. package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +137 -0
  980. package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
  981. package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
  982. package/skills/a2h-utg-explorer/scripts/tests/fresh_state_plan.test.mjs +78 -0
  983. package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
  984. package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
  985. package/skills/a2h-utg-explorer/scripts/tests/holds_without_data_parity.test.mjs +26 -0
  986. package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
  987. package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
  988. package/skills/a2h-utg-explorer/scripts/tests/launch_failure.test.mjs +40 -0
  989. package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
  990. package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
  991. package/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
  992. package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
  993. package/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
  994. package/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
  995. package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
  996. package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
  997. package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
  998. package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
  999. package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
  1000. package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
  1001. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +454 -0
  1002. package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
  1003. package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
  1004. package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
  1005. package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
  1006. package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +142 -0
  1007. package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
  1008. package/skills/a2h-utg-explorer/scripts/tests/string_tables_twin_ties.test.mjs +83 -0
  1009. package/skills/a2h-utg-explorer/scripts/tests/tar_fixture.mjs +12 -0
  1010. package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
  1011. package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
  1012. package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
  1013. package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
  1014. package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
  1015. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +13 -3
  1016. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +107 -65
  1017. package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +155 -0
  1018. package/skills/a2h-utg-static/scripts/assemble.mjs +28 -3
  1019. package/skills/a2h-utg-static/scripts/click_paths.mjs +19 -20
  1020. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +102 -2
  1021. package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
  1022. package/skills/a2h-utg-static/scripts/nl_hints.mjs +2 -3
  1023. package/skills/a2h-utg-static/scripts/presenter_nav.mjs +1 -2
  1024. package/skills/a2h-utg-static/scripts/route_interceptor.mjs +21 -7
  1025. package/skills/a2h-utg-static/scripts/static_prior.mjs +26 -29
  1026. package/skills/a2h-utg-static/scripts/tests/test_activity_gates.mjs +84 -0
  1027. package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
  1028. package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
  1029. package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
  1030. package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
  1031. package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
  1032. package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
  1033. package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
  1034. package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
  1035. package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
  1036. package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
  1037. package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
  1038. package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
  1039. package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
  1040. package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
  1041. package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
  1042. package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +0 -5
  1043. package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +0 -54
  1044. package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
  1045. package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
  1046. package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
  1047. package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
  1048. package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
  1049. package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
  1050. package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
  1051. package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
  1052. package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
  1053. package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
@@ -0,0 +1,1760 @@
1
+ # a2h-app-migrate — declarative workflow (the single authoritative source for the topology)
2
+ # Leaf skills follow the a2h-* naming.
3
+ # The HTML flowchart should be generated from this file — do not hand-edit the chart as the source.
4
+
5
+ version: 2
6
+ id: a2h-app-migrate
7
+ skill_root_var: SKILLS_ROOT
8
+
9
+ policy:
10
+ # ui.batch is the only device:true node in the whole graph (Android device, adb), so "at most 1 device at a time" is currently guaranteed by the topology itself.
11
+ # The HarmonyOS-side cold-start smoke test (hdc) runs once each in discover.arch G10 / ui.batch Step 6.3 / the spec_pipeline wrap-up:
12
+ # arch comes before the ui.batch / logic chains (needs chain); the latter two sit in post_utg and the logic segment, so they never hold the same HarmonyOS device at once.
13
+ # If more device nodes are added in the future, there must be needs edges between them; they must not go into the same parallel_group.
14
+ max_devices: 1
15
+ # Clamping is implemented by env_preflight.resolveRunKnobs; the back-filled SPEC_CONCURRENCY is already clamped, so pass it through as is.
16
+ # SPEC_CONCURRENCY is passed to a2h-spec-generate as concurrency= (the number of concurrent fused per-Area workers),
17
+ # and **must be clamped to this cap**: values above 8 become 8, non-positive integers become the default 8.
18
+ max_spec_generate_concurrency: 8
19
+ default_task_type: generalPurpose
20
+ # Context length is compacted by the host. The model must not treat it as a stop condition.
21
+ context_budget: |
22
+ The model must not end the run on its own because of the context budget.
23
+ Context budget, context window, remaining tokens, a growing session, imminent compaction or completed compaction are neither a node terminal state nor a pipeline terminal state.
24
+ They must not be used as grounds to:
25
+ · stop the current node or later nodes, or record a node that has not finished as done / skipped / failed;
26
+ · announce to the user that the migration is over, ask for a new session, or ask to resume with profile=resume;
27
+ · skip nodes, merge steps, or enter logic.finalize early to save context;
28
+ · ask the user whether to stop first because of context.
29
+ The only allowed stops are the conditions already written in this workflow: hard_stop, waiting at a human gate, a leaf returning per fail_matrix,
30
+ and logic.spec_pipeline ending the round to wait for background completion notifications. In the latter case, after being woken by a notification the event loop must continue;
31
+ it is neither the end of the migration nor the end of the node.
32
+ Also, with SPEC_ENGINE=page-specgen, enrich.spec_gen may end the round while its event loop waits for a background waker or sub-agent completion notification;
33
+ once notified it must return to that event loop — that is neither the node ending nor the migration ending.
34
+ After the host compacts or summarizes the session, continue from the current step according to the ledger and node artifacts; do not treat compaction as completion.
35
+ The invoke of every skill node must start with: context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish.
36
+ If a leaf still returns citing the context budget, handle it per that node's fail_matrix; it must not be escalated into a voluntary wrap-up of the whole pipeline.
37
+ # Meaning of each fail_matrix value (the executor interprets them only as written here; do not improvise).
38
+ # What to do when a leaf skill "wants to ask the user" mid-run (referenced by the [unattended contract] in each node's invoke).
39
+ leaf_questions: |
40
+ Known questions are **answered in advance** by the orchestrator and written into the corresponding node's invoke / task prompt:
41
+ · a2h-arch-generate "ask the user before running homegraph init / sync" (including harmony-project-inspection's "ask before sync when the index is stale")
42
+ -> allowed on the HMOS side (a2h-spec-generate and module_docs build .homegraph in ${HMOS} anyway; there is no "write one place less if declined" option);
43
+ on the ANDROID side do not ask and do not run it — discover.android_index has already built and synced it (the user was told during the ask_run_config_once round).
44
+ · application module (a2h-spec-generate's application-module, a2h-resource-convert's app module)
45
+ -> always use ${APP_MODULE} (decided by preflight: automatic when unique, app_module= must be given when there are several); both chains use the same value.
46
+ · a2h-coldstart-smoke-gate needs devecocli auth login only on a real device (hdc target is not `127.0.0.1:`) that is unsigned;
47
+ emulator-only requires no login and must not prompt for login. When a real device needs login: under auto or in a sub-agent do not ask; per its rules record
48
+ DEPLOY_ERROR and continue, with the report suggesting a smoke rerun after login; under interactive and inline in the primary session the user may be asked to log in.
49
+ · Paths such as DEVECO_HOME / APK / adb device: already resolved by preflight and passed as is; leaves must not ask again.
50
+ · All main-flow leaves are Node; preflight no longer probes / back-fills Python. If a leaf document still says `python3 …` / `python …`, follow that skill's own convention; the orchestrator provides no interpreter path.
51
+ · a2h-spec-generate (UTG mode):
52
+ - HomeGraph maintenance in Step 1 **only allows sync** (once before prepare); when init / a full index is needed
53
+ (index missing / unusable / status not complete and sync cannot fill it) -> do not rebuild; this node fails, with the note quoting Step 1 verbatim
54
+ (the index is maintained by discover.android_index; rebuilding is up to preflight/the user);
55
+ - other questions follow the general contract below.
56
+ · a2h-page-specgen (SPEC_ENGINE=page-specgen):
57
+ - this engine does not ask the user; the three required parameters (source root / utg-workspace / hmos-project) and --out are already given;
58
+ - homegraph missing / stale / unusable -> it may init / index / sync by prepare's own rules
59
+ (by then ui.batch is terminal, the Android index is normalized by discover.android_index, so this is normally an empty sync);
60
+ - ledger busy -> report ok:false after the leaf's three retries; lock / conflict / unrecoverable events -> hard-block immediately;
61
+ - version / environment hard failures are not fixed inside the node; report them as is (preflight already blocks homegraph ≥ 1.5.2).
62
+ Other unexpected questions: may be asked only when INTERACTION_MODE=interactive **and** the leaf runs inline in the primary;
63
+ auto or a Task sub-agent -> do not ask; continue with the safe default in that skill's document; no default -> return
64
+ { "ok": false, "note": "<question>: <evidence>" } and handle per fail_matrix. Never stop the whole pipeline just to be able to ask.
65
+ failure_semantics: |
66
+ hard_stop: node fails -> the whole pipeline stops, reporting the failure reason and how to resume.
67
+ hard_stop_unless_logic_skipped: same as hard_stop; but when SKIP_LOGIC is true (or the profile has force_skipped the logic chain) it is treated as skipped.
68
+ ledger: ${LEDGER} is append-only and kept across runs (profile=resume relies on it to know the original run's profile and each node's terminal state). boot.workspace records run_start;
69
+ **every node** records one line when it reaches a terminal state: node ${SKILLS_ROOT}/a2h-app-migrate/scripts/ledger.mjs --ledger ${LEDGER} --node <id>
70
+ --status done|reused|skipped|failed [--reason <reason>] (skipped because artifacts are reused -> reused; skipped via skip_if / force_skip -> skipped).
71
+ bootstrap itself records done after boot.workspace writes run_start (the ledger cannot be written to disk before that).
72
+ ui.batch / enrich.spec_gen / logic.spec_pipeline: **immediately after** recording the ledger (within the same terminal-state step,
73
+ with the terminal state already fixed) run write_resume_summary.mjs, passing the status just written to the ledger verbatim as --status,
74
+ together with --ledger ${LEDGER} (writes run_at = this round's run_start.at, so the previous round is not misread):
75
+ ui.batch → --work ${WORK} --node ui.batch --hmos ${HMOS} --status <s> --ledger ${LEDGER}
76
+ enrich.spec_gen → --work ${WORK} --node enrich.spec_gen --run-dir ${RUN_DIR} --status <s> --ledger ${LEDGER}
77
+ logic.spec_pipeline → --work ${WORK} --node logic.spec_pipeline --hmos ${HMOS} --status <s> --ledger ${LEDGER}
78
+ status=skipped -> write an ok:false tombstone (do not project page counts / waves that may still be from the previous round in the leaf);
79
+ done|failed|reused -> project from the leaf artifacts. If writing fails, try to write a tombstone instead; if that fails too, delete the old file.
80
+ **Do not** hang it on after_run: success has not been judged then, so --status is not known yet; and the skip path never runs after_run.
81
+ enrich.spec_gen's after_run keeps only refresh_run_dir (RUN_DIR must be back-filled before success).
82
+ A failure to write the summary only records a warning and does not change the node terminal state (see policy.resume_from).
83
+ A fresh run (not resume) runs, after boot.workspace records run_start,
84
+ write_resume_summary.mjs --work ${WORK} --clear-stale to clear the three old summaries.
85
+ soft_continue: node fails -> record --status failed --reason <reason> as above; the node terminal state is failed;
86
+ downstream nodes that depend on it are **scheduled as usual** and run in the degraded way written in their own invoke (if none is written, they are treated as unaffected);
87
+ the final report of logic.finalize must list every soft_continue failure.
88
+ Publishing with holes ≠ failure: when the run semantics of enrich.spec_gen are incomplete (holes inside an Area), it publishes with holes per the deveco-cli contract and records the gaps
89
+ (specs.json `completeness: "incomplete-known"` + `incomplete{...}`); the node still succeeds and downstream consumes as usual; the gaps must also go into the final report.
90
+ ui.batch fails -> review.ui_batch takes the --upstream-failed branch (see that node); a UI failure must not hard-stop the logic chain.
91
+ human_interaction: |
92
+ adopt_fallback_only + staged_human_gates
93
+ · Initialization: ask_run_config_once (INTERACTION_MODE + INTERACTIVE_GATES only under interactive + reuse)
94
+ The UI chain always runs (except when reusing existing artifacts). It must come **before** run_env_preflight: whether preflight treats the APK and an online adb device as hard requirements
95
+ depends on reuse and the profile. Scheduling is fixed serial.
96
+ Do not explain scheduling to the user.
97
+ · INTERACTION_MODE=auto -> fully automatic: no human_gate asks; it goes straight to --write-confirmed;
98
+ INTERACTIVE_GATES is forced to empty (any passed value is ignored). After auto is chosen, never show or ask about gates that need a human check again.
99
+ After initialization questions are answered, nobody is waited for.
100
+ · INTERACTION_MODE=interactive -> proactive: after the run mode is answered, ask separately which human_gates to stop at this round
101
+ (the allowlist is written into INTERACTIVE_GATES). Never put these gates in the same question as the run mode.
102
+ There are only the three options below, in fixed order; they must all appear, none may be added or removed, and do not add all / none / skip:
103
+ 1) review.arch — after discover_par ends / before utg_snapshot (the three architecture documents)
104
+ 2) review.spec_gen — after enrich.spec_gen / before adopt.specs_json (SPEC + specs.json)
105
+ 3) review.ui_batch — after ui.batch / before barrier.l2_enrich (pages.json + batch_report)
106
+ No answer to this question -> all three selected by default. With selections -> record only the selected gate ids, comma-separated, in the order above.
107
+ Gates inside the allowlist: wait for human confirmation before writing the checkpoint.
108
+ Gates outside the allowlist: the node still runs and goes straight to --write-confirmed (do not skip the node, otherwise nobody writes the checkpoint).
109
+ · Checkpoint lifecycle: it only means "this version of the artifacts is confirmed" and is kept across runs. The producing nodes (discover.arch /
110
+ enrich.spec_gen / ui.batch) invalidate it in their own before_run **right before actually executing**; it is not cleared when artifacts are reused or skipped.
111
+ --write-confirmed always comes with --confirmed-by (auto = automatic confirmation / user = confirmed by the user's reply).
112
+ When INTERACTIVE_GATES is not passed explicitly and mode=interactive, ask this item separately after the run mode; no answer -> all three above selected by default.
113
+ With mode=auto this question is omitted entirely and INTERACTIVE_GATES is recorded as an empty string.
114
+ An empty list passed explicitly on the command line still means everything is confirmed automatically.
115
+ · If the user has already passed INTERACTION_MODE explicitly, that dimension is not asked again;
116
+ if INTERACTIVE_GATES has already been passed explicitly (and mode=interactive), the gate selection dimension is not asked again.
117
+ With mode=auto, even if the user passed INTERACTIVE_GATES, it is forced to empty, and the human check options are not shown.
118
+ · Whether a gate uses --write-confirmed: INTERACTION_MODE==auto, or the gate node id is not in INTERACTIVE_GATES.
119
+ · Do not insert unrelated pauses other than gates between ui.batch and enrich.spec_gen:
120
+ the two must stay adjacent, with only review.ui_batch allowed in between.
121
+ review.ui_batch hangs after ui.batch's terminal state; review.spec_gen hangs after enrich.spec_gen's terminal state.
122
+ # Common answer protocol for the three review.* gates. Each node's invoke only states that gate's differences; the common steps always follow this.
123
+ human_gate_protocol: |
124
+ · To the user: first send this node's user_facing.ask (or the ask_failed agreed for that node); on automatic confirmation send user_facing.auto and no done.
125
+ Use user_facing.name as the title.
126
+ · Confirm: reply `confirm`/`continue`/`ok` -> rerun the gate script with the same arguments plus `--write-confirmed --confirmed-by user` to write the checkpoint, then continue.
127
+ · Rerun: first set the REUSE_* for this gate to false (otherwise skip_if skips the producing node and the same artifacts are shown again and again),
128
+ then go back to the producing node; it first runs before_run (clears this gate's checkpoint, see human_interaction · checkpoint lifecycle).
129
+ · Automatic confirmation: INTERACTION_MODE=auto, or this node id is not in INTERACTIVE_GATES -> run the node as usual,
130
+ going straight to `--write-confirmed --confirmed-by auto`. Never skip the node because of automatic confirmation (if skipped, nobody writes the checkpoint).
131
+ review.arch is **not** skip_if'd because of REUSE_DISCOVER_ARCH: what is reused is the three documents, not the confirmation itself;
132
+ when the checkpoint is missing / stale the gate must run as usual to rewrite it or ask again (downstream utg_snapshot's --assert-ready depends on it).
133
+ With an already valid checkpoint the gate script itself exits 0, at almost zero cost.
134
+ · If woken by a background completion notification while waiting -> handle the notification, fill the slot, and restate that this gate is still awaiting confirmation; a notification is not an answer and must not be used to write the checkpoint.
135
+ # The single rule for the host's image-reading capability. Observed on WeatherApp 1104: when the host does not accept images, a sub-agent reading one PNG permanently breaks its session
136
+ # (invalid messages.content.type, and resuming hits the same error); the orchestrator could only add ad-hoc bans on the spot, and each skill had its own rule.
137
+ image_read: |
138
+ Image-read probing has two layers that **do not reuse each other's verdict**:
139
+ 1) **bootstrap.probe_image_read** (env probe, after preflight): sets this run's IMAGE_READ for tip only;
140
+ **never** pass the verdict to ui.batch (never pass `image_read=`).
141
+ **Skip when this run will not run ui.batch** (`REUSE_UI_BATCH == true`: resume after UI is done, or start config
142
+ chose to reuse UI) — then bootstrap skips probe_image_read / tip_image_read_false.
143
+ 2) **ui.batch (a2h-batch-ui-align Step 1)**: when UI actually runs this round, **probe again** and write
144
+ `${HMOS}/.hometrans/work/host_caps.json` — that verdict alone drives screenshot visual comparison.
145
+ enrich.spec_gen / logic.spec_pipeline do **not** receive or use the image-read verdict.
146
+ IMAGE_READ is **run-scoped only**: every run defaults to probe; never back-fill from MANIFEST / host_caps / a prior run.
147
+ · bootstrap false → must run tip_image_read_false (tip only, no waiting): after switching to multimodal, **open a new
148
+ session and re-enter the original command**; never force true / never tip the user to pass `image_read=`. No tip when true.
149
+ · ui.batch probe true: read screenshots per procedure; false: no-image block + text evidence; mid-run miss → treat remaining as false.
150
+ # Inline scheduling rules (node invokes only reference them, never restate them).
151
+ dispatch_inline: |
152
+ Scheduling is fixed serial; ui.batch -> enrich.spec_gen (only review.ui_batch allowed in between).
153
+ discover.arch, discover.utg_static, ui.batch, enrich.spec_gen, logic.spec_pipeline always use dispatch: primary_skill_inline:
154
+ the skill tool loads into the current primary; wrapping in a Task is **forbidden**; new_session is **not** used, and **no** separate session is opened.
155
+ The orchestrator must not expand a leaf's internal Stages/waves; a leaf's internal workers are managed by the leaf itself.
156
+ discover.arch = discover leg 1 (build the shell / design the architecture); discover.utg_static = leg 2 (starts only after arch's terminal state, in both modes).
157
+ ui.batch = serial leg 1 (enrich.spec_gen only gets its turn after its terminal state);
158
+ enrich.spec_gen = serial leg 2 (must wait for ui.batch's terminal state and for review.ui_batch to pass).
159
+ logic.spec_pipeline has its own hard reason for "must be inline" (B1/B2 wait for background notifications): see that node's comment; the general prohibition still follows this entry.
160
+ # The only wording the primary session uses to report progress to the user. Node ids remain for scheduling, the ledger and resume arguments only.
161
+ user_facing: |
162
+ The only shape of a chat progress message (fixed title "Migration progress"; no separate progress narration;
163
+ check marks / In progress / the sentence below the checklist follow the progress checklist rules below):
164
+
165
+ Migration progress
166
+ 1. ✓ Name
167
+ 2. Name (In progress)
168
+ 3. Name
169
+
170
+ When several leaves change at the same moment: refresh the same progress checklist; do not send several "node X reached a terminal state" messages in a row.
171
+ Granularity stops at orchestration nodes starting/reaching a terminal state; do not go into leaf internals (Step / page / chunk); never push mid-run changes of batch_progress.json
172
+ or spec_pipeline_state.json into the chat.
173
+
174
+ When telling the user about a node's progress or terminal state, use only that node's user_facing, with its name as the title.
175
+ Do not use node ids, skill names, UTG, depth or dispatch as titles, and do not paste the JSON returned by a leaf verbatim to the user.
176
+ A node id is appended at the end only when the user wants to resume or rerun, e.g. "to redo only this step, the start point is ui.batch".
177
+ The Markdown table output by preflight is still shown to the user as is. user_facing does not replace that table.
178
+ Curly braces are field names, taken only from the JSON returned by that node or the JSON of the completion check script.
179
+ When a field is missing, delete the sentence containing it (sentences separated by periods); do not leave empty brackets, and do not make up numbers.
180
+ Exception for {gaps}: when there are no gaps fill in "nothing missing" and keep the sentence.
181
+ Which status sentence to pick:
182
+ · A node with announce=always sends doing when it starts. A node with announce=fail_only says nothing separately on success.
183
+ · Reused artifacts send reused; skipped via skip_if sends skipped.
184
+ · ok false sends failed, with {reason} being the reason recorded by that node.
185
+ · Success with a complete list sends done.
186
+ · Success with gaps sends incomplete. Gaps come from specs.json's incomplete: which feature areas were not delivered, which pages did not match,
187
+ which candidates were not resolved. When there is only unverified, write {gaps} as "the list is real, but the completeness marker was not written, so what is missing cannot be named".
188
+ Do not describe a success with gaps as a complete page set.
189
+ · When a gate needs a person to wait, send ask. After the user confirms, send the done sentence.
190
+ Automatic confirmation sends auto and no done.
191
+ review.ui_batch sends ask_failed instead of ask when upstream failed or the gate script exited 2.
192
+ · build_status / final_build are kept verbatim and explained per the parentheses in the copy. Only SUCCESS counts as a successful build.
193
+ When UI conversion and the feature list finish at the same time, check both lines, and below the list write the UI conversion sentence first, then the feature list sentence.
194
+ Nodes with announce=fail_only (startup check, working directory, code index, fixed page relations, join, adopt spec list)
195
+ do not flood the chat on success; they send failed only on failure. They are not in the progress checklist.
196
+ Review the architecture notes, review the converted UI, review the feature list, and signing are not in the progress checklist either. These steps still run as usual.
197
+ When waiting is needed, the node's ask is still sent; the list does not get an extra line for it.
198
+ The body of logic.finalize's report is still written in full per that node's invoke, with stage names taken from each user_facing.name.
199
+ Progress checklist (policy.progress_checklist, fixed order):
200
+ Sent once after the startup config is settled. After that, whenever a step on the list starts or reaches a terminal state, resend the whole list; do not start a separate progress message.
201
+ Items skipped or not run this round do not appear; the rest are renumbered from 1 in list order, with no gaps in numbering.
202
+ Each line is "No. Name". Finished ones get a check mark: "No. ✓ Name".
203
+ Finished includes done, success with gaps, reused, gate confirmed or automatically confirmed. With gaps it is still checked; the gaps go in the sentence below the list.
204
+ Carried over from last time: "No. ✓ Name (from last run)".
205
+ In progress: "No. Name (In progress)". Two steps running at the same time are both marked In progress.
206
+ Not started yet: just "No. Name".
207
+ Not achieved: no check mark, write "No. Name (not done)", with the reason given by that node's failed sentence below the list.
208
+ Below the list add only the user_facing sentence of the step that just changed. Names on the list use only user_facing.name.
209
+ # Migration progress shown to the user. Nodes not in this list take no sequence number.
210
+ # Review the architecture notes / review the converted UI / review the feature list / signing are deliberately not here.
211
+ progress_checklist:
212
+ - discover.arch
213
+ - discover.utg_static
214
+ - ui.batch
215
+ - enrich.spec_gen
216
+ - enrich.module_docs
217
+ - logic.spec_pipeline
218
+ - logic.finalize
219
+ artifact_reuse: |
220
+ See the probe table of bootstrap.probe_all_artifacts (8 items).
221
+ Per-item checkpoints: ui.batch reads batch_progress.json; logic.spec_pipeline reads spec_pipeline_state.json.
222
+ The run directory of enrich.spec_gen is managed by run_dir.mjs: the pointer (${WORK}/reqgen/current.json) records
223
+ "which run is current"; resume decisions / gates / adopt all find this run's artifacts through it.
224
+ · Each fresh run gets a new ${WORK}/reqgen/run-<timestamp>; an unfinished run reuses the same directory when resumed
225
+ (a2h-spec-generate prepare's rule: a new run must be an empty directory; a fingerprint mismatch requires a new run). Old runs are kept, not deleted.
226
+ "**Atomic whole package** / rerun on the same output": when rerunning with the same output=${RUN_DIR}, prepare reuses existing artifacts if the input fingerprint
227
+ matches; on fingerprint drift that run directory is **never reused** — there is no "rerun only some pages" granularity (when needed, use
228
+ a2h-spec-generate directly + a --scope file placed outside the run directory to delimit the range).
229
+ resume_from: |
230
+ profile=resume (or an explicit FROM_NODE≠bootstrap) = resume from FROM_NODE, decided by bootstrap.plan_resume (resume_plan.mjs):
231
+ · FROM_NODE must be an id in nodes (not bootstrap), otherwise hard_stop (do not guess the closest node).
232
+ · **Inherit the original run's profile** (the last non-resume run_start in the ledger) and set PROFILE to it — lane trimming, force_skip,
233
+ and preflight all follow the original profile; switching profile when resuming is not allowed (resume_base_profile differs from the original run -> hard_stop). When the ledger is missing
234
+ (WORK deleted / old version) the user must give resume_base_profile=full|ui-only, otherwise hard_stop.
235
+ · **spec engine** (SPEC_ENGINE) is written into the pointer and the ledger with the run (run_start.spec_engine): a resume inherits the original run's engine
236
+ (resume_plan.mjs's JSON.spec_engine); if the user explicitly passes a different spec_engine -> exit 2 hard_stop —
237
+ switching engines = a new run (the two engines never share one run directory); an engine recorded in the ledger that is not recognized is likewise exit 2.
238
+ · Whenever spec_engine came from the command line, the executor must set SPEC_ENGINE_GIVEN=true; otherwise an attempted engine switch on resume is silently inherited instead of refused.
239
+ · bootstrap still runs in full (preflight / variable back-fill are redone), but reuse is not asked: each REUSE_* is decided by plan_resume's JSON.reuse —
240
+ those trimmed by the original profile are still skipped; FROM_NODE itself and its downstream run as usual (false); those skipped / soft-failed in the original run keep the original result,
241
+ are not rerun and require no artifacts (true, JSON.inherited tells the user); ancestors finished in the original run must be reused, and an incomplete probe hard_stops
242
+ (JSON.require_probes); finished sibling nodes are reused if their probe is complete ("probe"), otherwise they run as usual.
243
+ · Gates / adopt / barrier among the ancestors: run as usual (cheap, and they verify artifacts). review.arch runs as usual even with REUSE_DISCOVER_ARCH:
244
+ reused documents ≠ reused confirmation; with a valid checkpoint the gate script lets it pass directly; when missing / stale it rewrites or asks again,
245
+ so downstream utg_snapshot --assert-ready does not hard_stop.
246
+ · discover.utg_snapshot: when spec runs this round, run ensure_utg_snapshot.mjs — it computes sha256 only over the contract files
247
+ (utg.json + click_paths.json); if they match the snapshot it skips the copy, if they differ / the snapshot is missing it copies over the whole tree;
248
+ when spec does not run this round this action is skipped (success when is relaxed). No more blindly skipping the copy based on REUSE_DISCOVER_UTG alone.
249
+ · **Read-only resume summaries** (they do not replace the leaf's source of truth): ui.batch / enrich.spec_gen / logic.spec_pipeline, when recording the ledger,
250
+ also write ${WORK}/resume_summaries/<node>.json (with run_at; skipped is a tombstone). Wiring in
251
+ policy.failure_semantics · ledger; **not** hung on after_run. A fresh run first does --clear-stale.
252
+ A write failure only records a warning, no hard_stop. At the start of a resume use
253
+ node …/write_resume_summary.mjs --work ${WORK} --show [--ledger ${LEDGER}]
254
+ to read one progress sentence (JSON.line; tombstones / mismatched run_at go to stale); **never** use the summaries to decide REUSE_*,
255
+ and never use them to replace the leaf checkpoint protocol. The source of truth is still the leaf artifacts.
256
+ parallel_rule: |
257
+ parallel_group: discover_par — arch and utg_static both run inline in the primary, fixed serial arch -> utg_static (both modes, see policy.dispatch_inline); resource conversion is run by ui.batch Step 2 via a2h-resource-convert (avoids a write race with the arch scaffold on build-profile.json5).
258
+ post_utg segment: discover.utg_snapshot -> parallel_group post_utg (topology group name kept; scheduling in policy.dispatch_inline).
259
+ · Zero write intersection: spec_gen only reads ${UTG_SNAPSHOT} and only writes ${RUN_DIR}.
260
+ · After ui.batch returns: first pass review.ui_batch -> enrich.spec_gen (kept adjacent); enrich.module_docs comes after enrich.spec_gen.
261
+
262
+
263
+ ⚙ discover_par is fixed serial arch -> utg_static (both run inline in the primary, see policy.dispatch_inline):
264
+ scaffold_new (HMOS does not exist / is empty / contains only .git·.DS_Store; emptiness is judged like create_project, ignoring those two; only .hometrans left -> preflight FAIL)
265
+ requires arch to build the shell first, otherwise boot.workspace / utg_static would dirty the directory. Handling: paths_preflight does a non-destructive probe;
266
+ boot.workspace needs discover.arch when ${SERIALIZE_DISCOVER}; utg_static hangs off boot.workspace.
267
+ So existing_project and scaffold_new both run arch -> utg_static (scaffold_new additionally goes through boot.workspace in between).
268
+ ⚠ validate_workflow performs the race check on maximum parallelism (ignoring conditional_needs).
269
+
270
+ ⚠ The two static UTG directories are always kept separate. discover.utg_static writes ${UTG_DIR} (default ${WORK}/utg_static).
271
+ ui.batch only writes ${UI_UTG_DIR} (${HMOS}/.hometrans/utg_static, hard-coded by a2h-batch-ui-align).
272
+ When discover actually finished this round, check_utg_static_done passed, and the lang in the summary matches the device locale,
273
+ ui.batch **copies** ${UTG_DIR} into ${UI_UTG_DIR}, skips Step 3.1 and continues capturing from Step 3.2.
274
+ When discover is skipped (ui-only / spec skipped or reused / SKIP_LOGIC / REUSE_DISCOVER_UTG), the workspace is unfinished,
275
+ or lang does not match (prompts defaulting to en cannot be used against a Chinese-locale device), Step 3.1 reruns by itself in ${UI_UTG_DIR}.
276
+ Do not point the two nodes at the same directory: when discover is reused, the snapshot would be recopied from a directory modified by UI, and the spec input would change.
277
+ enrich.spec_gen **only reads** ${UTG_SNAPSHOT} (frozen by discover.utg_snapshot), never ${UTG_DIR} —
278
+ so it never picks up a skeleton that Step 3.1 is rewriting.
279
+ Remaining write partitions (each node owns one private subdirectory under ${HMOS}/.hometrans; no cross writes):
280
+ arch -> ${HMOS}/ source tree + .hometrans/arch_generate/
281
+ utg_static -> ${UTG_DIR} (default .hometrans/app-migrate/utg_static/, inside ${WORK})
282
+ spec_gen → .hometrans/app-migrate/reqgen/ (owned exclusively by the current engine; page-specgen's plan/facts/drafts/prompts/ledger/state/waker also live under its publish root)
283
+ android_index -> ${ANDROID}/.homegraph/ (built once by discover.android_index, read-only for the other nodes;
284
+ spec_gen does only one empty sync before prepare (SPEC_ENGINE=spec-generate), see concurrency_exemptions)
285
+ ui.batch -> ${HMOS}/ source tree + .hometrans/{utg_static,ui_info,resource_mapping.md,work/resources.report.md} (Step 2 runs a2h-resource-convert)
286
+ module_docs -> .hometrans/{project_design.md,module_understanding/,<source module path>/}
287
+ spec_pipeline -> .hometrans/spec_design/ (SPEC_DESIGN_G<G>_c<k>.md, design_map.md)
288
+ The two engines never share one run directory (the pointer is owned per engine = SPEC_ENGINE; switching engines = a new run).
289
+ Coarse declarations (${HMOS}/) rely on node-level path_excludes to carve out other nodes' private subtrees, enforced by validate_workflow.mjs.
290
+
291
+ enrich.module_docs depends only on discover.arch + ui.batch (**not on enrich.spec_gen**).
292
+ Under serial scheduling it comes after enrich.spec_gen.
293
+ Stage 4 (logic.spec_pipeline) starts only after both ui.batch and enrich.spec_gen reach terminal states.
294
+ spec_order_boundary: |
295
+ The **only producer** of specs.json is the leaf inside enrich.spec_gen (picked by SPEC_ENGINE):
296
+ · spec-generate → a2h-spec-generate (publish-specs);
297
+ · page-specgen → a2h-page-specgen (finalize.mjs).
298
+ The list consumed downstream is the page-grouped root ${SPEC_DIR} (<run>/generation/pages) published by the leaf's Step 5b:
299
+ regroup-by-page folds the idx-root SPECs into page directories according to the frozen topology, and publish-specs publishes specs.json
300
+ at the pages root; list order = numeric-aware path order (page directory order -> file name), and the so-id is the
301
+ 1-based position in that order (a brand-new campaign key — the root must not change mid-campaign, or the commit-message so-id
302
+ resume would lose track). The idx root (<run>/generation/specs) is only an internal anchor of the leaf; the orchestrator does not consume it.
303
+ The orchestrator and every other node are **forbidden** to assemble specs.json by hand, and also forbidden to start a separate Task for any SPEC generation engine (a2h-spec-generate / a2h-page-specgen).
304
+ subagent_depth_budget: |
305
+ See policy.dispatch_inline.
306
+
307
+ # scripts/validate_workflow.mjs enumerates every node pair with "no ordering on the DAG" and compares the expanded path
308
+ # prefixes of their reads/writes. Coarse declarations (such as ui.batch's ${HMOS}/) use the node-level `path_excludes` to carve out
309
+ # other nodes' private subtrees precisely; any remaining overlap that cannot be carved out must be registered in concurrency_exemptions with the reason it is safe,
310
+ # and any unregistered overlap is treated as a race. Stale exemptions are reported as errors too — do not keep them.
311
+ # If a new entry appears when adding/changing a node, prove it is safe before registering it; do not just loosen the check.
312
+ concurrency_exemptions:
313
+ - pair: [enrich.spec_gen, ui.batch]
314
+ overlap: "${ANDROID}/.homegraph/"
315
+ why: |
316
+ The index is built and synced by discover.android_index (their common ancestor); no node in the post_utg segment changes the Android source.
317
+ enrich.spec_gen's only write to it at this point is a sync (SPEC_ENGINE=spec-generate: a2h-spec-generate does it once before prepare in UTG mode),
318
+ which is an empty sync when the source is unchanged; when init / a full index is needed this node fails directly without rebuilding
319
+ (see the corresponding entry in policy.leaf_questions). ui.batch only reads (android_index_ready=true).
320
+ With SPEC_ENGINE=page-specgen the node's first prepare may run init / index / sync (the same ensureIndex rules);
321
+ ui.batch is already terminal in this segment (policy.dispatch_inline, adjacent serial), so there is no concurrent reader.
322
+
323
+ profiles:
324
+ full:
325
+ description: "discover -> enrich (post_utg: UI -> Spec fixed serial) -> logic pipeline"
326
+ include_lanes: [boot, discover, enrich, adopt, logic, finalize]
327
+ ui-only:
328
+ description: discover + UI batch alignment (does not run the SPEC generation pipeline)
329
+ # finalize is kept as usual: it is the only place that summarizes soft_continue failures in the ledger (policy.failure_semantics requires them to be listed);
330
+ # under ui-only it only reports the UI chain status + failure summary, does not build and does not read logic state (see logic.finalize steps 0 / 2 / 4).
331
+ include_lanes: [boot, discover, enrich, finalize]
332
+ # The enrich lane holds both enrich.spec_gen / enrich.module_docs, so include_lanes alone cannot trim it;
333
+ # it must be excluded precisely by **node id**.
334
+ force_skip: [discover.utg_static, enrich.spec_gen, review.spec_gen, enrich.module_docs, barrier.l2_enrich, adopt, logic]
335
+ resume:
336
+ description: resume from FROM_NODE
337
+ include_lanes: all
338
+
339
+ vars:
340
+ ANDROID: { required: true, from: android_project_dir }
341
+ HMOS: { required: true, from: harmony_project_dir }
342
+ # Required when the UI chain actually runs (ui-align / resource-convert both treat it as required and would "ask the user", while ui.batch often runs as a sub-agent that cannot ask).
343
+ # When missing, it is merged into the ask_run_config_once round; preflight --apk checks existence / absolute path / .apk / zip signature.
344
+ APK_PATH: { required: false, required_when: "${REUSE_UI_BATCH} != true", from: apk_path, default: null }
345
+ # Android application module (Gradle name, e.g. :app). Preflight detects it: filled in automatically if unique; multiple and unspecified -> preflight FAIL.
346
+ # The same value is passed to ui.batch (a2h-resource-convert in Step 2) and enrich.spec_gen (a2h-spec-generate),
347
+ # see policy.leaf_questions.
348
+ APP_MODULE: { required: false, from: app_module, default: null, set_by: "env_preflight → app_module" }
349
+ # DevEco install root: preflight resolves it from env DEVECO_HOME / DEVECO_SDK_HOME / OHOS_SDK_PATH / ~/.hometrans/config.json and checks the directory layout.
350
+ # Passed as is to every leaf that builds — their own lookup chains differ (build-fixer does not read config.json and asks the user when it finds nothing).
351
+ DEVECO_HOME: { required: false, default: "", set_by: "env_preflight → deveco_home" }
352
+ # adb and device used for capture: resolved by preflight (adb = config ADB_PATH or PATH; device = adb_serial= / ANDROID_SERIAL / the only online device,
353
+ # several online and none specified -> FAIL), passed as is to ui.batch. Leaves must not hard-code emulator-xxxx or pick a device themselves.
354
+ ADB_SERIAL: { required: false, from: adb_serial, default: "", set_by: "env_preflight → adb_serial" }
355
+ ADB_PATH: { required: false, default: "", set_by: "env_preflight → adb_path" }
356
+ WORK: { required: false, from: workspace_dir, default: "${HMOS}/.hometrans/app-migrate" }
357
+ SPECS_JSON: { required: false, from: specs_json, default: "${SPEC_DIR}/specs.json" }
358
+ # User explicitly passed specs_json -> set to false, so preflight actually validates the file they gave;
359
+ # not passed -> keep true; preflight only shows the default path as "to be produced" and does not fail because it does not exist.
360
+ SPECS_JSON_IS_DEFAULT: { required: false, default: true, set_false_when: "user explicitly provides specs_json" }
361
+ # ↓ back-filled from the output of bootstrap's env_preflight (report.hmos_mode / report.serialize_discover)
362
+ HMOS_MODE: { required: false, default: "", set_by: "env_preflight -> hmos_mode (scaffold_new | existing_project)" }
363
+ SERIALIZE_DISCOVER: { required: false, default: false, set_by: "env_preflight -> serialize_discover (= HMOS_MODE == scaffold_new)" }
364
+ PROFILE: { required: false, from: profile, default: full, choices: [full, ui-only, resume], set_by: "env_preflight -> profile (back-filled after validation)" }
365
+ # Start node id for profile=resume (semantics in policy.resume_from); default bootstrap = run from the beginning.
366
+ FROM_NODE: { required: false, from: [from_node, from_stage], default: bootstrap }
367
+ # Profile of the original run when resuming: only needed when the ledger is missing (WORK deleted / old version); when the ledger has a record it is used only for cross-checking (see policy.resume_from).
368
+ RESUME_BASE_PROFILE: { required: false, from: resume_base_profile, default: "" }
369
+ LAYERED_ARCHITECTURE: { required: false, default: true }
370
+ ARCH_SCOPE: { required: false, default: full } # a2h-arch-generate --scope: full | backend
371
+ FOLLOW_SOURCE: { required: false, default: true } # a2h-arch-generate --follow-source
372
+ # ui.batch capture needs an adb device. Reuse existing UI artifacts with REUSE_UI_BATCH.
373
+ SKIP_LOGIC: { required: false, from: skip_logic, default: false }
374
+ # The Homegraph CLI is a global dependency, and spec generation only accepts it; packages in reqgen/node_modules are not required.
375
+ # bootstrap's env_preflight runs `homegraph --version`;
376
+ # if it is not on PATH, first `npm i -g homegraph arkanalyzer`, then verify again. Still unavailable -> exit 1 Hard-Stop.
377
+ # Do not leave "command not found" to be discovered in module_docs / spec_pipeline.
378
+ # When spec generation runs this round: preflight also checks homegraph >= 1.5.2 (reqgen's minimum); below that reqgen hard-stops and
379
+ # asks the user to run a global ht init — in auto mode nobody can handle that mid-run, so FAIL early.
380
+ # The leaf skill only accepts --engine-mode (no --engine); the in-project .homegraph/ index is still initialized by the leaf itself.
381
+ ENGINE_MODE: { required: false, from: engine_mode, default: auto, choices: [auto, off, required], set_by: "env_preflight → engine_mode" }
382
+ # SPEC generation engine: defaults to a2h-page-specgen (one SPEC per page, strict all-or-nothing: a failed leaf fails the node, no publishing with holes); spec-generate is the optional engine (the fused chain).
383
+ # The engine is written into the run pointer and the ledger; a resume inherits it, and an explicit switch is a hard_stop (policy.resume_from).
384
+ SPEC_ENGINE: { required: false, from: spec_engine, default: page-specgen, choices: [spec-generate, page-specgen], set_by: "env_preflight → spec_engine" }
385
+ # Whether the user gave spec_engine explicitly; a resume only checks "the engine must not change" when it was explicit.
386
+ SPEC_ENGINE_GIVEN: { required: false, default: false, set_true_when: "the user explicitly passes spec_engine" }
387
+ DESIGN_DIR: { required: false, default: "${HMOS}/.hometrans/spec_design" }
388
+ # Forwarded to a2h-spec-design-pipeline; groups are cut by the SPEC's ./<page>/ page directories (the leaf default is used when not passed).
389
+ WAVE_WIDTH: { required: false, from: wave_width, default: 10 } # groups per wave
390
+ MAX_SCENARIOS_PER_CHUNK: { required: false, from: max_scenarios_per_chunk, default: 32 } # scenarios per coding chunk
391
+ REUSE_ALL: { required: false, from: reuse_all, default: ask }
392
+ # discover.arch / discover.utg_static are reused separately (the old alias reuse_discover is used as the value for both).
393
+ REUSE_DISCOVER_ARCH: { required: false, from: [reuse_discover_arch, reuse_discover], default: ask }
394
+ REUSE_DISCOVER_UTG: { required: false, from: [reuse_discover_utg, reuse_discover], default: ask }
395
+ SKIP_DISCOVER_ARCH: { required: false, default: false }
396
+ REUSE_SPEC_GENERATE: { required: false, from: reuse_spec_generate, default: ask }
397
+ # User explicitly provides specs_json -> set to true: use that list directly; enrich.spec_gen / review.spec_gen are skipped
398
+ #(otherwise spec_gen would still run for hours despite the given list, and its output would overwrite the user's choice).
399
+ SKIP_SPEC_GENERATE: { required: false, default: false, set_true_when: "user explicitly provides specs_json" }
400
+ REUSE_UI_BATCH: { required: false, from: reuse_ui_batch, default: ask }
401
+ REUSE_MODULE_DOCS: { required: false, from: reuse_module_docs, default: ask }
402
+ SKIP_MODULE_DOCS: { required: false, default: false }
403
+ REUSE_LOGIC_PIPELINE: { required: false, from: reuse_logic_pipeline, default: ask }
404
+ SKIP_LOGIC_PIPELINE: { required: false, default: false }
405
+ # Semantics and question rules in policy.human_interaction. Default ask -> bootstrap.ask_run_config_once asks; after answering it can only be auto|interactive.
406
+ INTERACTION_MODE: { required: false, from: [interaction_mode, run_mode], default: ask }
407
+ # Env-probe image-read verdict (true|false). Default probe -> bootstrap.probe_image_read; tip only, never passed to ui.batch. See policy.image_read.
408
+ IMAGE_READ: { required: false, from: image_read, default: probe, set_by: "bootstrap.probe_image_read" }
409
+ # Semantics in policy.human_interaction (interactive allowlist; auto forces an empty string).
410
+ INTERACTIVE_GATES: { required: false, from: [interactive_gates], default: ask }
411
+ # -> a2h-spec-generate concurrency= (number of concurrent fused per-Area workers); cap 8
412
+ #(policy.max_spec_generate_concurrency, clamped by env_preflight).
413
+ SPEC_CONCURRENCY: { required: false, from: spec_concurrency, default: 8 }
414
+ # No longer hard-coded: bootstrap back-fills it from the pointer with run_dir.mjs --show (pointer ${WORK}/reqgen/current.json);
415
+ # decided by run_dir.mjs before enrich.spec_gen starts (an unfinished run is resumed, otherwise a new one is created).
416
+ # Used as is when the user explicitly gives run_dir=. <run-id> is only a placeholder.
417
+ RUN_DIR: { required: false, from: run_dir, default: "${WORK}/reqgen/<run-id>", set_by: "run_dir.mjs (pointer ${WORK}/reqgen/current.json)" }
418
+ # Private output directory of discover.utg_static. Do **not** set it to ${UI_UTG_DIR}. ui.batch only copies into it; the two nodes never write the same directory.
419
+ UTG_DIR: { required: false, default: "${WORK}/utg_static" }
420
+ # UTG directory used by a2h-batch-ui-align (copy target, or write directory when Step 3.1 reruns; Step 3.2 only reads it); not configurable.
421
+ UI_UTG_DIR: "${HMOS}/.hometrans/utg_static"
422
+ # enrich.spec_gen only reads this frozen snapshot; for its partitioning against ${UTG_DIR}/${UI_UTG_DIR} see policy.parallel_rule.
423
+ # Placed under ${WORK} (not under ${RUN_DIR}): the run layout is owned exclusively by a2h-spec-generate (see spec_layout.mjs).
424
+ UTG_SNAPSHOT: "${WORK}/utg_snapshot"
425
+ UI_INFO_ROOT: { required: false, default: "${HMOS}/.hometrans/ui_info" } # ui.batch capture artifact root (written by a2h-utg-explorer's export_ui_info.mjs, organized by build_conversion_set.mjs; pages.json lives here, not in UTG_DIR)
426
+ HOMETRANS_DIR: "${HMOS}/.hometrans"
427
+ # SPEC_DIR is derived from the run layout and cannot be specified independently (back-filled together with RUN_DIR by run_dir.mjs). There is no REQ_DIR.
428
+ SPEC_DIR: { required: false, default: "${RUN_DIR}/generation/pages", set_by: "run_dir.mjs → spec_dir" }
429
+ CHECKPOINT_DIR: "${WORK}/checkpoints"
430
+ MANIFEST: "${WORK}/migrate-manifest.md"
431
+ LEDGER: "${WORK}/stage-ledger.jsonl"
432
+ # Read-only resume summaries derived from node terminal states (policy.resume_from); they do not replace leaf progress/state.
433
+ RESUME_SUMMARIES_DIR: "${WORK}/resume_summaries"
434
+ # a2h-arch-generate states explicitly "analysis artifacts live under <target_project_dir>/.hometrans/arch_generate".
435
+ # Must not be written into the Android source tree.
436
+ ARCH_ARTIFACTS: "${HOMETRANS_DIR}/arch_generate"
437
+ LOGIC_REPORT: "${WORK}/logic-convert-report.md"
438
+
439
+ # Lane ids use semantic names, not L0/L1/L2 — those letters denote test levels in this repo, and reusing them would be confusing.
440
+ # Lane ids map one-to-one to node id prefixes: the enrich lane holds enrich.* nodes, and so on.
441
+ lanes:
442
+ - { id: boot, name: Startup }
443
+ - { id: discover, name: Discover, parallel_group: discover_par }
444
+ - { id: enrich, name: Enrich, parallel_group: post_utg }
445
+ - { id: adopt, name: Adopt specs.json }
446
+ - { id: logic, name: Logic pipeline }
447
+ - { id: finalize, name: Logic wrap-up }
448
+
449
+ nodes:
450
+
451
+ - id: bootstrap
452
+ lane: boot
453
+ type: local
454
+ user_facing:
455
+ announce: fail_only
456
+ name: Startup check
457
+ done: "Startup check passed; starting the migration the way you chose."
458
+ failed: "Startup check did not pass: {reason}. Fix the items in the check table above and rerun."
459
+ needs: []
460
+ # ⚠ The action order is meaningful; two constraints:
461
+ # 1) probe + ask must come **before** run_env_preflight — which keys/devices preflight treats as hard requirements
462
+ # depends on the reuse answers and the profile. Running preflight before asking would make a user who reuses UI artifacts
463
+ # Hard-Stop before even being asked for the apk. There is no switch that skips the whole UI chain.
464
+ # 2) Any **disk-writing** action (ensure_dirs / init_manifest / init_ledger) must come **after** preflight —
465
+ # preflight is the only place that checks "HMOS is a valid HarmonyOS project" and "WORK must not be inside the ANDROID source tree";
466
+ # creating directories/writing files before it passes means dropping junk into a path that may be judged invalid.
467
+ # probe_all_artifacts only does file_exists (plus the read-only check scripts in the entries) and writes nothing, so it can come before preflight.
468
+ actions:
469
+ # profile=resume / FROM_NODE≠bootstrap: read the original run's profile and node terminal states from the ledger to decide each REUSE_*
470
+ # (policy.resume_from). Reads only the ledger and does not depend on the run directory; must come before resolve_run_dir_show /
471
+ # describe_run_dir — they back-fill RUN_DIR / SPEC_DIR from the pointer; if this came after them, probe 3 / specs_json_required
472
+ # would judge with the wrong directory and hard_stop right away. It also comes before probe: PROFILE must first be switched to the original run's profile,
473
+ # and the later reuse decisions / preflight all follow it.
474
+ - plan_resume:
475
+ when: "${PROFILE} == resume or ${FROM_NODE} != bootstrap"
476
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/resume_plan.mjs"
477
+ runner: node
478
+ args: "--workflow ${SKILLS_ROOT}/a2h-app-migrate/references/workflow.yaml --ledger ${LEDGER} --from-node ${FROM_NODE} [--base-profile ${RESUME_BASE_PROFILE} only when non-empty] --engine ${SPEC_ENGINE} --engine-given ${SPEC_ENGINE_GIVEN}"
479
+ exit_0: |
480
+ PROFILE = JSON.base_profile (lanes are then trimmed by it and it is passed to preflight); SPEC_ENGINE = JSON.spec_engine (the original run's engine; an explicit switch already exited 2 inside the script);
481
+ for each REUSE_X in JSON.reuse:
482
+ true / false are used directly; "probe" -> true if that variable's probe items are done, otherwise false.
483
+ The probe items in JSON.require_probes must be done, otherwise hard_stop and list the missing artifacts;
484
+ tell the user JSON.inherited (skips / failures carried over from the original run, not rerun) verbatim. ask_run_config_once no longer asks about reuse.
485
+ exit_2: hard_stop # FROM_NODE invalid / resume switched profile: tell the user JSON.error verbatim
486
+ exit_3: hard_stop # no original run record: ask the user to add resume_base_profile=full|ui-only and rerun
487
+ # When the ANDROID given by the user is not the project root, do not wait for preflight to FAIL before asking again. Only when the APK path contains
488
+ # `/build/outputs/apk`, walk up from that prefix to find settings.gradle and substitute it. Without that marker, no substitution
489
+ # (avoids walking all the way up to an unrelated project at the drive root when the APK sits elsewhere). Read-only; comes before every action that uses ANDROID.
490
+ - infer_android_root:
491
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/infer_android_root.mjs"
492
+ runner: node
493
+ args: "--android ${ANDROID} --apk ${APK_PATH}"
494
+ exit_0: |
495
+ JSON.replaced is true -> ANDROID = JSON.android; tell the user JSON.note verbatim and do not ask about the path again.
496
+ false -> keep the ANDROID the user gave (the APK path has no /build/outputs/apk, or the given path itself is a valid project root).
497
+ exit_2: hard_stop
498
+ # Both the checkpoint probe and preflight need to know the run directory of "this" spec generation (read-only pointer, nothing written).
499
+ # Skipped when the user explicitly gave run_dir=. exit 1 = no pointer yet (first run) -> RUN_DIR stays undetermined,
500
+ # and probe item 3 is naturally "none"; exit 2 = argument error -> hard_stop.
501
+ # SPEC_DIR in the exit_0 JSON must match the layout; do not assemble it separately.
502
+ - resolve_run_dir_show:
503
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs"
504
+ runner: node
505
+ args: "--work ${WORK} --show --json --engine ${SPEC_ENGINE}"
506
+ skip_if: "user explicitly provided a non-empty run_dir"
507
+ exit_0: "RUN_DIR = JSON.run_dir; SPEC_DIR = JSON.spec_dir"
508
+ exit_1: "no pointer yet (first run / pointer unreadable): RUN_DIR / SPEC_DIR keep their original values without being overwritten; continue (probe 3 is naturally unfinished)"
509
+ exit_2: hard_stop # argument error (tell the user stderr verbatim)
510
+ # When the user explicitly gave run_dir=: derive SPEC_DIR from the layout read-only, without touching the pointer.
511
+ # when requires "non-empty": passing an empty run_dir= makes the whole `${RUN_DIR}` vanish and parseArgs reports Missing value —
512
+ # that is an orchestrator rendering problem unrelated to the user's run_dir; do not let it become a blocker.
513
+ - describe_run_dir:
514
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs"
515
+ runner: node
516
+ args: "--work ${WORK} --describe ${RUN_DIR} --engine ${SPEC_ENGINE}"
517
+ when: "user explicitly provided a non-empty run_dir"
518
+ exit_0: "SPEC_DIR = JSON.spec_dir (a run given explicitly by the user is always non-empty)"
519
+ exit_2: hard_stop # argument error (tell the user stderr verbatim)
520
+ - probe_all_artifacts:
521
+ entries:
522
+ # Same criterion as success: file present ≠ finished (a failed stage / running only Phase A also leaves utg.json + click_paths.json).
523
+ 1: { node: discover.utg_static, skill: a2h-utg-static, all: ["${UTG_DIR}/utg.json", "${UTG_DIR}/click_paths.json"], check: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_utg_static_done.mjs", args: "--workspace ${UTG_DIR}" } }
524
+ 2: { node: discover.arch, skill: a2h-arch-generate, all: ["${HOMETRANS_DIR}/project_design.md", "${HOMETRANS_DIR}/database_design.md", "${HOMETRANS_DIR}/preferences_design.md"], check: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_arch_done.mjs", args: "--hmos ${HMOS}" } }
525
+ # specs.json present ≠ finished: publishing with holes is a legal terminal state (check still exits 0), but only parsing the list tells
526
+ # complete / incomplete-known / no field, so file existence alone is not enough.
527
+ 3: { node: enrich.spec_gen, skill: "a2h-spec-generate | a2h-page-specgen (by ${SPEC_ENGINE})", all: ["${SPEC_DIR}/specs.json"], check: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_spec_gen_done.mjs", args: "--run-dir ${RUN_DIR}" } }
528
+ # Report present ≠ full UI done: incremental mode also writes batch_report.md (batch_progress.json records mode: incremental).
529
+ # check requires mode == full and no pending pages.
530
+ 4: { node: ui.batch, skill: a2h-batch-ui-align, all: ["${HMOS}/.hometrans/batch_report.md"], check: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_ui_batch_done.mjs", args: "--hmos ${HMOS}" } }
531
+ # Do not judge module_docs by ${HOMETRANS_DIR}/project_design.md: arch writes the same file first,
532
+ # so module_docs would be misjudged as done as soon as arch finishes. Use the incremental state file that only module_docs Step 7 writes.
533
+ 5: { node: enrich.module_docs, skill: a2h-module-semantic-docs, all: ["${HOMETRANS_DIR}/module_understanding/.module_semantic_docs_state.json"] }
534
+ 6: { node: adopt.specs_json, skill: "(adopt)", any: ["${SPECS_JSON}", "${SPEC_DIR}/specs.json"] }
535
+ # state is written in pipeline I1 (plan_groups --emit-state), so file present ≠ finished;
536
+ # the check command must also exit 0 (all groups terminal, no unfinished chunk, Finalization has written state.finalization).
537
+ # exit 1 -> treated as unfinished; re-inline the pipeline and let its own Mid-flight resume pick up (do not delete state;
538
+ # when only Finalization is missing it goes straight to smoke + Finalization). exit 3 (all groups failed) -> finished but failed, not reusable;
539
+ # handled by before_run when the node runs (resuming as is can achieve nothing; only a new round or skipping this round).
540
+ # exit 4 -> hard fingerprint mismatch (specs.json content sha256 / specs_json|android|design_dir paths;
541
+ # e.g. so-ids reordered after spec_gen fills gaps): not reusable; before_run archives the old campaign before the node runs.
542
+ # Exception (upgrade compatibility in check_spec_pipeline_done): for a **finished** campaign, a drift of the specs_json **path**
543
+ # (layout upgrade from the idx root -> the Step 5b page root) is downgraded to soft_stale — the output is already merged, and archiving to rerun would only
544
+ # produce duplicate code; same path but changed sha (list rewritten) is still exit 4. An unfinished campaign that changes root is still
545
+ # exit 4 (so-id discipline: never resume under a new root).
546
+ # Drift of soft knobs (wave_width / max_scenarios_per_chunk / engine_mode) only yields a soft_stale warning,
547
+ # never raises exit 4 — an unfinished campaign still goes Mid-flight, and a finished one can still be REUSEd.
548
+ 7: { node: logic.spec_pipeline, skill: a2h-spec-design-pipeline, all: ["${HMOS}/.hometrans/spec_pipeline_state.json"], check: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs", args: "--state ${HMOS}/.hometrans/spec_pipeline_state.json --specs-json ${SPECS_JSON} --android ${ANDROID} --design-dir ${DESIGN_DIR} --wave-width ${WAVE_WIDTH} --max-scenarios-per-chunk ${MAX_SCENARIOS_PER_CHUNK} --engine-mode ${ENGINE_MODE}" } }
549
+ 8: { node: logic.finalize, skill: "(report)", all: ["${LOGIC_REPORT}"] }
550
+ # Startup questions: run mode + (interactive only) human review gates + reuse + run config. No scheduling parameters.
551
+ - ask_run_config_once:
552
+ interaction:
553
+ mode_var: INTERACTION_MODE
554
+ choices: [auto, interactive]
555
+ # Must ask when the user did not pass it explicitly. Option labels are only auto / interactive; do not add "recommended".
556
+ # prompt_default is back-filled only when the user does not answer; do not put it in the option text.
557
+ prompt_default: interactive
558
+ skip_if_already_set: true
559
+ # Option semantics in policy.human_interaction; only machine fields are kept here.
560
+ meaning:
561
+ auto: "see policy.human_interaction (auto)."
562
+ interactive: "see policy.human_interaction (interactive)."
563
+ interactive_gates:
564
+ var: INTERACTIVE_GATES
565
+ # When to ask / option set / all selected by default / cleared under auto: see policy.human_interaction.
566
+ # choices must match the human_gate:true nodes (enforced by validate_workflow).
567
+ multiple: true
568
+ optional: true
569
+ choices: [review.arch, review.spec_gen, review.ui_batch]
570
+ prompt_default: review.arch,review.spec_gen,review.ui_batch
571
+ ask_only_when: "${INTERACTION_MODE} == interactive"
572
+ skip_if_already_set: true
573
+ force_empty_when: "${INTERACTION_MODE} == auto"
574
+ # When unanswered, record first and then pass to preflight: auto -> empty string; interactive -> prompt_default (see policy.human_interaction).
575
+ unanswered: { auto: "", interactive: "review.arch,review.spec_gen,review.ui_batch" }
576
+ meaning: "see policy.human_interaction (INTERACTIVE_GATES)."
577
+ reuse:
578
+ mode_var: REUSE_ALL
579
+ write_manifest: adoption checkpoint
580
+ # Probe item (number in probe_all_artifacts) -> the REUSE_* variable it decides. When one variable covers several items, **all** must probe as done for it to be true.
581
+ # 6 (adopt.specs_json) / 8 (logic.finalize) have no variable: adoption and the report are redone every round (cheap, and they must reflect this round's result).
582
+ map:
583
+ REUSE_DISCOVER_UTG: [1]
584
+ REUSE_DISCOVER_ARCH: [2]
585
+ REUSE_SPEC_GENERATE: [3]
586
+ REUSE_UI_BATCH: [4]
587
+ REUSE_MODULE_DOCS: [5]
588
+ REUSE_LOGIC_PIPELINE: [7]
589
+ # Expansion rules (after this round of questions, each REUSE_* can only be true / false, never ask again):
590
+ # REUSE_ALL=all -> each variable = whether all the probe items it covers are done (missing artifacts can only be rerun);
591
+ # REUSE_ALL=none -> all false;
592
+ # per-item answers -> follow the user's answers, but an answer of true whose probe items are unfinished is forced to false and explained in the receipt;
593
+ # a REUSE_X already given on the command line is not asked again; one still at ask (the user did not answer it) -> false (rerunning is safest).
594
+ # With profile=resume it is decided by policy.resume_from, not asked here.
595
+ # The UI chain always runs. There is no switch that skips the whole UI chain; reusing existing artifacts goes through REUSE_UI_BATCH.
596
+ config_vars: []
597
+ # When the UI chain will run (UI not reused) and the command line did not give apk_path, ask for it in the same round.
598
+ ask_if_missing: { APK_PATH: "${APK_PATH} == null and ${REUSE_UI_BATCH} != true" }
599
+ # Question script (user-visible options). Full rules in policy.human_interaction; this template must keep the validate assertion phrases.
600
+ prompt_template: |
601
+ [a2h-app-migrate startup config]
602
+ Details in policy.human_interaction. Do not explain scheduling to the user, and do not ask about serial or parallel (no SCHEDULE_MODE).
603
+ Never put the human check gates and the run mode in the same question.
604
+ 1) Run mode INTERACTION_MODE (required, single choice; do not include the human check options in this question):
605
+ - `auto` — fully automatic. After auto is chosen do not show gates that need a human check; INTERACTIVE_GATES is recorded as an empty string.
606
+ - `interactive` — proactive: after the run mode is answered, ask separately which checkpoints to stop at
607
+ Skip this item when INTERACTION_MODE was passed on the command line.
608
+ 2) Only when the run mode is interactive and INTERACTIVE_GATES was not passed on the command line, ask in a separate question.
609
+ After auto is chosen do not show gates that need a human check; omit this item entirely.
610
+ INTERACTIVE_GATES (multiple choice; all selected by default when unanswered)
611
+ When calling the question tool, optional=true and multiple=true are required.
612
+ There are only the 3 options below, in this order; none may be omitted, and do not add all, none or skip:
613
+ - `review.arch` — review the architecture notes (project structure, database, preferences)
614
+ - `review.spec_gen` — review the feature list (unfinished features are listed)
615
+ - `review.ui_batch` — review the converted UI
616
+ When unanswered all three are selected by default. Semantics of selected / unselected in policy.human_interaction.
617
+ 3) Whether to reuse the artifacts already detected (REUSE_* / reuse all / rerun all)
618
+ May be in the same question as item 1; do not merge item 2 into it.
619
+ 4) If the UI chain will run and apk_path was not passed: the absolute path of the Android APK (the only source for resource conversion)
620
+ (FYI, no reply needed) This run builds a .homegraph code index under both the Android project and the HarmonyOS project directories
621
+ (arch / spec generation / semantic docs all depend on it).
622
+ When only HarmonyOS emulators are connected (all hdc targets are 127.0.0.1:), devecocli login is not checked and devecocli auth login is not required.
623
+ With a real device and an unsigned project, or when the logic chain runs this round and it is not "emulator only", preflight checks whether you are logged in;
624
+ if not logged in it fails directly; run devecocli auth login first.
625
+ When an online target is an emulator (127.0.0.1:), preflight pings a public IP through hdc shell to check the emulator's internet connectivity; unreachable is only a WARN. Real devices are not checked.
626
+ If INTERACTION_MODE was already passed on the command line, skip item 1;
627
+ if INTERACTIVE_GATES was already passed (and mode=interactive), skip item 2.
628
+ With mode=auto item 2 must not appear.
629
+ # When apk_path is obtained only in this round, the inference at entry did not have the APK yet. Infer once more before preflight, to avoid a wrong path failing preflight and then asking again.
630
+ - infer_android_root_after_config:
631
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/infer_android_root.mjs"
632
+ runner: node
633
+ args: "--android ${ANDROID} --apk ${APK_PATH}"
634
+ exit_0: |
635
+ Same rules as infer_android_root. JSON.replaced is true -> ANDROID = JSON.android; tell the user JSON.note,
636
+ and rerun probe_all_artifacts (read-only) with the new ANDROID before entering preflight. Never wait for preflight to FAIL before asking for the Android path again.
637
+ exit_2: hard_stop
638
+ - run_env_preflight:
639
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/env_preflight.mjs"
640
+ runner: node
641
+ mandatory: true
642
+ exit_nonzero: hard_stop
643
+ # The output mode is fixed to --report: a Markdown table (shown to the user as is) + a last line `PREFLIGHT_VARS {json}`.
644
+ # Do not use --markdown-only (table only; all the variables back-filled below would be lost).
645
+ output: report
646
+ # Argument rendering rules (apply to all args):
647
+ # - Render each argument as a **single token** `--key=<value>`, quoting the whole token when the value has spaces; pass `--key=` even when the value is empty,
648
+ # do not omit it, and do not write `--key` followed by an empty string (it swallows the next argument; parseArgs reports Missing value, exit 2).
649
+ # - When the value is an expression (containing or / and / not / ==), first **evaluate it to true or false** and then pass it; passing the expression text,
650
+ # the script reports `--x takes true/false` or `Unexpected value(s)`, exit 2, hard_stop.
651
+ args:
652
+ android: "${ANDROID}"
653
+ hmos: "${HMOS}"
654
+ work: "${WORK}"
655
+ run_dir: "${RUN_DIR}"
656
+ ui_info_root: "${UI_INFO_ROOT}"
657
+ skills_root: "${SKILLS_ROOT}"
658
+ profile: "${PROFILE}"
659
+ # Run knobs: preflight validates enum / positive integer / cap and clamps (SPEC_CONCURRENCY per policy.max_spec_generate_concurrency),
660
+ # normalized values are back-filled via PREFLIGHT_VARS — leaves only ever get legal values and never fail hours later in I1.
661
+ engine_mode: "${ENGINE_MODE}"
662
+ wave_width: "${WAVE_WIDTH}"
663
+ max_scenarios_per_chunk: "${MAX_SCENARIOS_PER_CHUNK}"
664
+ spec_concurrency: "${SPEC_CONCURRENCY}"
665
+ spec_engine: "${SPEC_ENGINE}"
666
+ specs_json: "${SPECS_JSON}"
667
+ specs_json_is_default: "${SPECS_JSON_IS_DEFAULT}"
668
+ # spec_gen not run this round but the logic chain will run -> specs.json at the default path must already exist (an explicit path is validated strictly on its own)
669
+ specs_json_required: "(${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true) and not ${SKIP_LOGIC}"
670
+ # The following three make preflight check only what the nodes running this round need (will run and would fail if missing -> FAIL)
671
+ skip_logic: "${SKIP_LOGIC}"
672
+ skip_spec_gen: "${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true"
673
+ skip_utg_static: "${REUSE_DISCOVER_UTG} == true or ${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true or ${PROFILE} == ui-only"
674
+ skip_arch: "${REUSE_DISCOVER_ARCH} == true or ${SKIP_DISCOVER_ARCH}"
675
+ # module_docs is not affected by SKIP_LOGIC (only ui-only's force_skip and the two items below trim it)
676
+ skip_module_docs: "${SKIP_MODULE_DOCS} or ${REUSE_MODULE_DOCS} == true"
677
+ # Logic pipeline not run this round (reused / skipped) -> devecocli login not required; also not required when it runs but the project already has a signing config.
678
+ # Emulator-only (all hdc targets are 127.0.0.1:) is likewise not required; preflight decides from the online targets, so no switch needs to be passed here.
679
+ skip_logic_pipeline: "${SKIP_LOGIC_PIPELINE} or ${REUSE_LOGIC_PIPELINE} == true"
680
+ # UI artifacts reused -> ui.batch does not run, and neither APK nor adb is a hard requirement
681
+ ui_reused: "${REUSE_UI_BATCH} == true"
682
+ apk: "${APK_PATH}"
683
+ app_module: "${APP_MODULE}"
684
+ adb_serial: "${ADB_SERIAL}"
685
+ # Semantics in policy.human_interaction; strictly validated by preflight and back-filled via PREFLIGHT_VARS.
686
+ # When INTERACTIVE_GATES is empty, pass --interactive-gates= (empty value).
687
+ interaction_mode: "${INTERACTION_MODE}"
688
+ interactive_gates: "${INTERACTIVE_GATES}"
689
+ # Back-fill the variables decided by preflight, used by conditional edges (boot.workspace ← SERIALIZE_DISCOVER).
690
+ # The source can **only** be the same-named fields of the last --report line `PREFLIGHT_VARS {json}`; do not infer from the table text;
691
+ # missing line or unparsable JSON -> treated as preflight failure (hard_stop).
692
+ - set_vars_from_preflight:
693
+ source: PREFLIGHT_VARS
694
+ # When these fields are empty strings they are **not back-filled** and keep their original values: an empty ADB_SERIAL = no device probed this round,
695
+ # and overwriting would also lose a serial the user gave explicitly.
696
+ keep_when_empty: [ADB_SERIAL]
697
+ HMOS_MODE: hmos_mode
698
+ SERIALIZE_DISCOVER: serialize_discover
699
+ APP_MODULE: app_module
700
+ DEVECO_HOME: deveco_home
701
+ ADB_SERIAL: adb_serial
702
+ ADB_PATH: adb_path
703
+ PROFILE: profile
704
+ ENGINE_MODE: engine_mode
705
+ WAVE_WIDTH: wave_width
706
+ MAX_SCENARIOS_PER_CHUNK: max_scenarios_per_chunk
707
+ SPEC_CONCURRENCY: spec_concurrency
708
+ SPEC_ENGINE: spec_engine
709
+ # Every later gate's "does it include review.xxx" check compares item by item exactly against this normalized value (comma-separated), never against the raw user input
710
+ INTERACTION_MODE: interaction_mode
711
+ INTERACTIVE_GATES: interactive_gates
712
+ # Env image-read probe (semantics in policy.image_read). Skip when this run will not run ui.batch (REUSE_UI_BATCH) or IMAGE_READ is already not probe.
713
+ # Verdict is for tip only — **never** pass it to ui.batch; the leaf Step 1 probes again.
714
+ - probe_image_read:
715
+ skip_when: "${IMAGE_READ} != probe or ${REUSE_UI_BATCH} == true"
716
+ steps: |
717
+ 1) node ${SKILLS_ROOT}/a2h-batch-ui-align/scripts/image_probe.mjs prepare --dir <PROBE_DIR>
718
+ -> stdout is one JSON line {image, state, prompt}. (Shares the same script with a2h-batch-ui-align Step 1; do not pass --hp, the verdict goes only to the orchestrator tip.)
719
+ PROBE_DIR must be inside the project directory the sub-agents read anyway, not the system temp directory: when the host only allows reading the workspace, a sub-agent
720
+ denied reading the temp directory would be judged image_read=false. HMOS_MODE == existing_project -> ${WORK}/image_probe;
721
+ scaffold_new -> ${ANDROID}/.hometrans-image-probe (${HMOS} cannot be written yet at this point, see policy.parallel_rule).
722
+ 2) Dispatch **one throwaway sub-agent** (the host's sub-agent tool, foreground, not background; do not reuse any session), using JSON.prompt as is for the prompt.
723
+ **The primary session must never read this image itself**: when the host does not accept images the session is permanently broken, and the orchestrator itself goes down.
724
+ 3) node ${SKILLS_ROOT}/a2h-batch-ui-align/scripts/image_probe.mjs verify --state <state> --reply-file <reply file> --cleanup
725
+ (--cleanup: after judging, delete the whole <PROBE_DIR> with the probe image, state, marker file and anything else in it, leaving no trace in the project.)
726
+ First write the sub-agent's verbatim reply (or the text of the call error, e.g. invalid messages.content.type) into a file and pass that; do not put it in quotes on the command line (errors are often JSON, containing quotes, $, backticks). On an error the verdict is false as well.
727
+ -> IMAGE_READ = JSON.image_read (true|false); reason may go into this run's MANIFEST preflight section for
728
+ reference, but must **not** become cross-run config — the next run still starts IMAGE_READ at default probe;
729
+ must **not** be passed to ui.batch.
730
+ The reply file may live in <PROBE_DIR> (it is removed with it); do not write it anywhere else under ${ANDROID} or ${HMOS}.
731
+ 4) Anything unexpected in this step (script non-zero, sub-agent tool unavailable) -> IMAGE_READ = false and record the reason; no hard_stop.
732
+ 5) **Always run this last, whatever happened above** (it does nothing when step 3 already removed everything):
733
+ node ${SKILLS_ROOT}/a2h-batch-ui-align/scripts/image_probe.mjs cleanup --dir <PROBE_DIR>
734
+ -> stdout {removed, left}. If left is not null (e.g. a file locked on Windows), delete the whole <PROBE_DIR> with the shell and continue;
735
+ if that also fails, record the path in this run's MANIFEST preflight section; no hard_stop.
736
+ # When IMAGE_READ=false, tip only — do not wait; skip when true / still probe / this run skips UI.
737
+ # Must follow probe_image_read: evaluate skip_when against the post-probe IMAGE_READ; never in parallel or earlier.
738
+ - tip_image_read_false:
739
+ skip_when: "${IMAGE_READ} != false or ${REUSE_UI_BATCH} == true"
740
+ tip: |
741
+ Tip the user and **continue immediately** (no hard_stop, no waiting, do not change this run's IMAGE_READ). The message must say:
742
+ "This session's model/host cannot recognise images. If UI runs this round, the leaf will probe again; if it still cannot read images, it will proceed without screenshots.
743
+ If you want the model to recognise screenshots, switch the editor to a multimodal model
744
+ (Qwen3.8-Max, Kimi-K3, Opus-5 recommended), enable vision/image input, then **open a new session**
745
+ and re-enter the original migrate command — the image-read verdict is run-scoped and not kept across runs."
746
+ success: [{ env_preflight_passed: true }]
747
+ on_fail: hard_stop
748
+
749
+ # The reason for the conditional edge is in policy.parallel_rule (under scaffold_new this node must wait for discover.arch).
750
+ - id: boot.workspace
751
+ lane: boot
752
+ type: local
753
+ user_facing:
754
+ announce: fail_only
755
+ name: Working directory
756
+ done: "This round's working directory is ready."
757
+ failed: "The working directory could not be set up: {reason}."
758
+ needs: [bootstrap]
759
+ conditional_needs:
760
+ - when: "${SERIALIZE_DISCOVER}"
761
+ add: [discover.arch]
762
+ why: |
763
+ scaffold_new: ${HMOS} does not exist or is empty, and discover.arch runs devecocli create on it,
764
+ which requires the directory to be "absent or empty". Once this node creates ${WORK}/${CHECKPOINT_DIR} first, that step is bound to fail.
765
+ writes:
766
+ work: "${WORK}/"
767
+ actions:
768
+ # Do not pre-create SPEC_DIR: the run layout is owned exclusively by the leaf (a2h-spec-generate requires prepare to get a brand-new empty run workspace).
769
+ - ensure_dirs: ["${WORK}", "${CHECKPOINT_DIR}", "${RESUME_SUMMARIES_DIR}"]
770
+ - init_manifest: "${MANIFEST}" # write bootstrap's preflight table into MANIFEST
771
+ # Append only, never clear: profile=resume reads the previous run's records (the ledger item in policy.failure_semantics)
772
+ - init_ledger:
773
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/ledger.mjs"
774
+ runner: node
775
+ args: "--ledger ${LEDGER} --start --profile ${PROFILE} --from-node ${FROM_NODE} --engine ${SPEC_ENGINE}"
776
+ # Not resuming: clear the previous round's resume_summaries so the opening does not read out stale page counts / waves (when resuming keep them so people can see where it stopped).
777
+ - clear_stale_resume_summaries:
778
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/write_resume_summary.mjs"
779
+ runner: node
780
+ args: "--work ${WORK} --clear-stale"
781
+ when: "${FROM_NODE} == null or ${FROM_NODE} == '' or ${FROM_NODE} == bootstrap"
782
+ exit_other: continue
783
+ success:
784
+ - all:
785
+ - dir_exists: "${WORK}"
786
+ - file_exists: "${MANIFEST}"
787
+ on_fail: hard_stop
788
+
789
+ # The Android-side homegraph index is built/synced only here; downstream only reads it (except the empty sync before enrich.spec_gen prepare
790
+ # with SPEC_ENGINE=spec-generate; page-specgen may init / index / sync on its first prepare, see concurrency_exemptions).
791
+ # Writes only ${ANDROID}/.homegraph/, so it can come before discover.arch (the scaffold_new constraint only concerns HMOS).
792
+ - id: discover.android_index
793
+ lane: discover
794
+ type: local
795
+ user_facing:
796
+ announce: fail_only
797
+ name: Code index
798
+ done: "The code index of the Android project is ready. Sorting out page relations and writing the feature list later both use it."
799
+ failed: "The code index of the Android project could not be built: {reason}. Page relations and the feature list both read it, so we stop here first."
800
+ needs: [bootstrap]
801
+ writes: { android_index: "${ANDROID}/.homegraph/" }
802
+ actions:
803
+ # Consistent with a2h-spec-generate's reqgen index maintenance rules: init only the first time; full index only when index.state is not complete, reindexRecommended,
804
+ # or the index builder differs from the current CLI version (builtWithVersion ≠ version); sync once every time.
805
+ # The version rule closes the loop with spec_gen's exact gate (it requires indexed_with_version to equal the installed package exactly, otherwise the deterministic scanner is skipped for the whole run).
806
+ # Do not hand-write homegraph commands instead of it (especially not an unconditional index rebuild).
807
+ - ensure_android_index:
808
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/android_index.mjs"
809
+ runner: node
810
+ args: "--android ${ANDROID}"
811
+ exit_nonzero: "failure: tell the user JSON.error verbatim (common: homegraph too old -> ht init; index locked -> homegraph unlock ${ANDROID})"
812
+ success:
813
+ - script_exit_0: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/android_index.mjs", args: "--android ${ANDROID} --check" }
814
+ on_fail: hard_stop
815
+
816
+ - id: discover.utg_static
817
+ lane: discover
818
+ type: skill
819
+ # Same Node version as ui.batch Step 3.1 (so page node ids are consistent across the two chains of the same App).
820
+ skill: a2h-utg-static
821
+ user_facing:
822
+ announce: always
823
+ name: Page relations
824
+ doing: "Sorting out every page from the Android source, and how pages navigate to each other. This step only produces these relations; the HarmonyOS UI is changed later during UI conversion."
825
+ done: "Page relations are sorted out. {nodes} pages, {edges} navigations. Nothing missing. The feature list will use these relations later."
826
+ failed: "Page relations were not finished: {reason}. Without these relations the feature list cannot be written."
827
+ reused: "Page relations were not redone this round; the result from last time is reused."
828
+ skipped: "No feature list this round, so page relations were not sorted out."
829
+ dispatch: "primary_skill_inline"
830
+ # Hangs off boot.workspace: scaffold_new serialization propagates through it, see policy.parallel_rule.
831
+ needs: [boot.workspace, discover.android_index]
832
+ parallel_group: discover_par
833
+ # The only consumer is discover.utg_snapshot -> enrich.spec_gen (the UI chain uses its own ${UI_UTG_DIR}). When spec generation does not run this round
834
+ #(skipped / reused / ui-only) it is just a critical path in front of review.arch; do not run it.
835
+ skip_if: "${REUSE_DISCOVER_UTG} == true or ${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true or ${PROFILE} == ui-only"
836
+ reads: { android_index: "${ANDROID}/.homegraph/" }
837
+ writes: { workspace: "${UTG_DIR}/", utg: "${UTG_DIR}/utg.json", click_paths: "${UTG_DIR}/click_paths.json" }
838
+ # The driver's exit code is not trustworthy: a failed stage still exits 0; checking file existence alone is fooled by Phase B artifacts left from the previous round;
839
+ # when the worklist is empty, Phase A says "continuing into phase B" but Phase B did not actually run.
840
+ # Everything is delegated to check_utg_static_done.mjs (reads pipeline_summary.json: every stage of this run is 0, not --skip-llm,
841
+ # reached phase_plan / _ui_elements, Phase B artifacts not older than utg.json).
842
+ success:
843
+ - any:
844
+ - all:
845
+ - file_exists: "${UTG_DIR}/utg.json"
846
+ - script_exit_0: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_utg_static_done.mjs", args: "--workspace ${UTG_DIR}" }
847
+ - skipped: true
848
+ invoke: |
849
+ Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish (policy.context_budget).
850
+ Use skill `${SKILLS_ROOT}/a2h-utg-static` (read SKILL.md in full). Pure Node (>= 22.18), no Python needed.
851
+ All commands run in the `${SKILLS_ROOT}/a2h-utg-static/scripts` directory, and --workspace **must** be passed explicitly
852
+ (by default it would land in <ANDROID>/utg_static_output, inside the Android source tree):
853
+ 0) Before **every** driver call (steps 1 and 3, including reruns), first delete the previous summary:
854
+ node ${SKILLS_ROOT}/a2h-app-migrate/scripts/check_utg_static_done.mjs --workspace ${UTG_DIR} --reset
855
+ if the driver exits before writing the summary, a leftover complete summary from the previous round would be judged complete by step 4.
856
+ The Android-side homegraph index has already been built and synced by discover.android_index; do **not** init / sync / index again.
857
+ Language: every run_pipeline.mjs writes this run's --lang into pipeline_summary.json (en when not passed, or the env var UTG_LANG).
858
+ When the UI chain runs this round (${REUSE_UI_BATCH} != true), first get the device locale,
859
+ and pass the same --lang to **both** Phase A and Phase B below:
860
+ <adb> [-s ${ADB_SERIAL}] shell getprop persist.sys.locale
861
+ <adb> = ${ADB_PATH} when non-empty, otherwise adb on PATH; add -s only when ${ADB_SERIAL} is non-empty.
862
+ Pass --lang only when the output is non-empty after trimming whitespace. If it cannot be obtained do not pass it, and do not fail this node because of it
863
+ (ui.batch will rerun Step 3.1 by itself in ${UI_UTG_DIR} because lang does not match).
864
+ When the UI chain does not run this round, do not look for a device for --lang.
865
+ 1) Phase A:
866
+ node run_pipeline.mjs ${ANDROID} --workspace ${UTG_DIR} [--lang <locale>]
867
+ The run halts at three worklists: view_interactions, state_guard, nl_hints (empty worklists are answered automatically and do not halt).
868
+ Answers from the previous round carry over automatically: Phase A moves the old answers to ${UTG_DIR}/_prev_answers/, and questions whose evidence did not change are carried in directly
869
+ (carry_report.json lists carried / remaining); the rest are split into parts of 40 questions each, and the halt output lists line by line
870
+ `<stage>_worklist.partN.json -> <stage>_answers.partN.json`.
871
+ 2) Answering (the review sections of SKILL.md; all three are REQUIRED):
872
+ - Each part is answered independently, one reviewer per part, all dispatched at once. Answers are written as {"items": [...]}, copying each item's key verbatim.
873
+ · This node is inline in the primary; dispatch reviewers with the primary session's Task / subagent.
874
+ · If the tool list has neither task nor subagent: do not answer everything yourself and return ok:true. Return
875
+ { "ok": false, "note": "no task/subagent tool; worklist reviewers cannot be dispatched" }.
876
+ - view_interactions: judge category per references/view-interactions.md; anything with insufficient evidence is unresolved;
877
+ - nl_hints: fill nl_hint / action_override / evidence per item; evidence must be a single bare file:line, and hints use the App's own UI language;
878
+ - state_guard: answer guard_kind + guard_text + evidence per page; evidence may only be one of the candidate lines given in that item's code_window;
879
+ when unsure always abstain:true; do not guess.
880
+ After all parts are answered, merge them (rejects missing questions / duplicates / unknown keys, naming the stage and the missing keys in the error; re-answer only those parts):
881
+ node worklist_parts.mjs merge ${UTG_DIR}
882
+ After merging, ${UTG_DIR} should contain view_interactions_answers.json, state_guard_answers.json, nl_hints_answers.json.
883
+ 3) Phase B:
884
+ node run_pipeline.mjs ${ANDROID} --workspace ${UTG_DIR} --resume [--lang <the same locale>]
885
+ --skip-llm is **forbidden** (degraded run: click instructions degrade to code names, and downstream spec_gen gets click_paths that "look complete but are not executable").
886
+ 4) Completion check (**mandatory**; driver exit 0 does not mean success):
887
+ node ${SKILLS_ROOT}/a2h-app-migrate/scripts/check_utg_static_done.mjs --workspace ${UTG_DIR}
888
+ exit 0 -> done; exit 1 -> look at next in the JSON:
889
+ · resume -> only Phase B is missing (including the case where Phase A did not really enter Phase B because the worklists were empty): run step 3 once more,
890
+ then check again; still non-zero -> failure;
891
+ · rerun -> a stage in failed_stages failed or was degraded by --skip-llm: read the corresponding ${UTG_DIR}/<stage>.log;
892
+ if fixable (e.g. blocked by security software) rerun 1)–4) as a whole (answered questions carry over automatically), otherwise fail with failed_stages in the note.
893
+ exit 2 (summary missing / unparsable) -> failure. Write the sanity line from the JSON verbatim into the returned note.
894
+ Do not modify ${HMOS} business source, and do not write ${ANDROID} (including .homegraph/).
895
+ When finished, return only JSON:
896
+ { "ok": true, "utg_workspace": "${UTG_DIR}", "nodes": N, "edges": M,
897
+ "view_interactions_answered": v, "nl_hints_answered": a, "state_guard_answered": b, "state_guard_abstained": c }
898
+ or { "ok": false, "note": "..." }.
899
+
900
+ - id: discover.arch
901
+ lane: discover
902
+ type: skill
903
+ skill: a2h-arch-generate
904
+ user_facing:
905
+ announce: always
906
+ name: Project architecture
907
+ doing: "Setting up the HarmonyOS project, and writing how the project is split, how data is stored and how preferences are stored."
908
+ done: "The HarmonyOS project and the three architecture notes are written, covering how the project is split, how data is stored and how preferences are stored. The files are in the .hometrans directory of the HarmonyOS project. Nothing missing. Next you can review these three notes."
909
+ failed: "The HarmonyOS project or the architecture notes were not finished: {reason}. UI conversion and writing the feature list will both stop here."
910
+ reused: "Architecture was not redone this round; the existing HarmonyOS project and three architecture notes are reused."
911
+ skipped: "No architecture generation this round."
912
+ # Not hung off boot.workspace: under scaffold_new it must touch ${HMOS} first, see policy.parallel_rule.
913
+ needs: [bootstrap, discover.android_index]
914
+ parallel_group: discover_par
915
+ dispatch: "primary_skill_inline"
916
+ skip_if: "${REUSE_DISCOVER_ARCH} == true or ${SKIP_DISCOVER_ARCH}"
917
+ # Clear the gate checkpoint right before actually executing (lifecycle in policy.human_interaction).
918
+ before_run:
919
+ - clear_gate_checkpoint:
920
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
921
+ runner: node
922
+ # Also move the existing three formal documents to ${HOMETRANS_DIR}/arch_archive/<ts>/: a2h-arch-generate's routing returns skipped
923
+ # as soon as it sees any one of them (and has no force flag); without archiving, "rerun arch" / "do not reuse discover" are both no-ops.
924
+ # Exception: when generate_state.stage == shell_created (design done, scaffold not yet successful) do not archive; routing goes resume=scaffold to only fill in the scaffold.
925
+ args: "--gate arch --hmos ${HMOS} --checkpoint ${CHECKPOINT_DIR}/arch-reviewed.ok --clear-checkpoint --archive-stale-report"
926
+ writes:
927
+ project_design: "${HOMETRANS_DIR}/project_design.md"
928
+ database_design: "${HOMETRANS_DIR}/database_design.md"
929
+ preferences_design: "${HOMETRANS_DIR}/preferences_design.md"
930
+ project: "${HMOS}/" # Step 1 creates the project shell + Step 9 scaffold mounts the module tree
931
+ artifacts: "${ARCH_ARTIFACTS}"
932
+ reads: { android_index: "${ANDROID}/.homegraph/" }
933
+ # The scaffold only touches the HarmonyOS source tree and never writes into the nodes' private workspaces under .hometrans.
934
+ path_excludes: ["${UTG_DIR}/", "${UI_UTG_DIR}/", "${WORK}/", "${UI_INFO_ROOT}/"]
935
+ success:
936
+ - any:
937
+ # Looking only at the three documents would judge "documents written, G9 scaffold failed" as success (the new project stays an empty shell);
938
+ # check_arch_done.mjs additionally requires generate_state.json to be absent or stage=scaffolded.
939
+ - script_exit_0: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_arch_done.mjs", args: "--hmos ${HMOS}" }
940
+ - skipped: true
941
+ invoke: |
942
+ Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish (policy.context_budget).
943
+ Use skill `${SKILLS_ROOT}/a2h-arch-generate`.
944
+ /a2h-arch-generate ${ANDROID}
945
+ --target-project-dir ${HMOS}
946
+ --layered-architecture ${LAYERED_ARCHITECTURE}
947
+ [--scope ${ARCH_SCOPE}] # full (default) | backend
948
+ [--follow-source ${FOLLOW_SOURCE}] # true (default) | false
949
+ [--app-module ${APP_MODULE}] # only when APP_MODULE is non-empty; a multi-application project that does not pass it reports an ambiguity in Step 2
950
+ ⚠ Only the flags above are accepted; forbidden arguments are listed in stage-map.md "Orchestrator argument notes".
951
+ Artifacts: analysis intermediates in ${ARCH_ARTIFACTS} (= ${HMOS}/.hometrans/arch_generate);
952
+ the three formal documents are written directly under ${HOMETRANS_DIR}/ (project_design.md / database_design.md /
953
+ preferences_design.md, all lowercase) and are no longer copied to the ${HMOS}/ root.
954
+ target-project-dir must be a pure ASCII path (devecocli create rejects Chinese characters/spaces).
955
+ Rerun (before_run has archived the old documents): the previous generate completed scaffold (generate_state.json stage=scaffolded)
956
+ or it is an existing project anyway -> routing goes reconcile, redoing the design based on the existing project, and does **not** rebuild the shell;
957
+ the previous generate failed midway after building the shell (stage=shell_created) -> routing still goes generate and skips shell creation, continuing with design + scaffold.
958
+ The archived old documents are in ${HOMETRANS_DIR}/arch_archive/<ts>/.
959
+ A project_design.md previously refreshed by enrich.module_docs is archived with them; module_docs must run again to refresh it.
960
+ [Unattended contract (policy.leaf_questions)]
961
+ · The index of the source repo (${ANDROID}) has already been built and synced by discover.android_index: do **not** run homegraph
962
+ init / sync / index on ${ANDROID} again (discover.utg_static, running in parallel, is reading it); just use it;
963
+ · For the HarmonyOS project (${HMOS}), "ask the user before running homegraph init / sync" (also sync when the index is stale) -> already permitted; run it directly without asking;
964
+ · When the generate-mode cold-start smoke test hits login -> auto / sub-agent records DEPLOY_ERROR and continues;
965
+ · Other questions follow policy.leaf_questions.
966
+ When finished, return only JSON: { "ok": true, "project_design": "..." } or a failure note.
967
+
968
+ # Architecture human gate — after discover_par joins, before freezing the UTG snapshot.
969
+ # A wrong architecture skews UI/Spec/logic entirely; wait inside the allowlist, otherwise write the checkpoint directly.
970
+ - id: review.arch
971
+ lane: discover
972
+ type: adopt
973
+ needs: [discover.arch, discover.utg_static]
974
+ also_needs_group: discover_par
975
+ human_gate: true
976
+ user_facing:
977
+ announce: always
978
+ name: Review the architecture notes
979
+ ask: "Please review the three notes on project structure, database and preferences. Reply 'confirm' to continue. Reply 'rerun' to rewrite these three notes based on the existing project; the project already built is kept."
980
+ auto: "The architecture notes were confirmed in auto mode; continuing with the next steps."
981
+ done: "The architecture notes are confirmed; continuing with the next steps."
982
+ failed: "The architecture notes are not confirmed yet: {reason}. UI conversion will not start and the feature list will not be written until they are confirmed."
983
+ skipped: "The architecture notes are not reviewed this round."
984
+ # Not skipped because of REUSE_DISCOVER_ARCH: reused documents ≠ confirmed. When the checkpoint is valid the gate script exits 0 directly;
985
+ # when missing / stale, rewrite it or ask again, otherwise downstream utg_snapshot --assert-ready will hard_stop (policy.human_gate_protocol).
986
+ gate_checkpoint: "${CHECKPOINT_DIR}/arch-reviewed.ok"
987
+ writes: { checkpoint: "${CHECKPOINT_DIR}/arch-reviewed.ok" }
988
+ actions:
989
+ - run_human_review_gate:
990
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
991
+ runner: node
992
+ # Do not skip the node because of auto: see policy.human_gate_protocol.
993
+ args: "--gate arch --hmos ${HMOS} --checkpoint ${CHECKPOINT_DIR}/arch-reviewed.ok [--write-confirmed --confirmed-by auto when ${INTERACTION_MODE} == auto or ${INTERACTIVE_GATES} does not contain review.arch]"
994
+ success:
995
+ - any:
996
+ - file_exists: "${CHECKPOINT_DIR}/arch-reviewed.ok"
997
+ - skipped: true
998
+ invoke: |
999
+ Per policy.human_gate_protocol. Run this node as usual even with REUSE_DISCOVER_ARCH (do not skip_if).
1000
+ The paths of these three notes can be attached:
1001
+ - ${HOMETRANS_DIR}/project_design.md
1002
+ - ${HOMETRANS_DIR}/database_design.md
1003
+ - ${HOMETRANS_DIR}/preferences_design.md
1004
+ `rerun` -> first set REUSE_DISCOVER_ARCH=false, go back to discover.arch (before_run clears the checkpoint and archives the three documents
1005
+ to ${HOMETRANS_DIR}/arch_archive/<ts>/; if the project shell already exists it reconciles and does not rebuild the shell).
1006
+
1007
+ # Freeze a read-only UTG snapshot. Partitioning and contract in policy.parallel_rule (UTG_DIR / UI_UTG_DIR / UTG_SNAPSHOT).
1008
+ - id: discover.utg_snapshot
1009
+ lane: discover
1010
+ type: local
1011
+ needs: [review.arch]
1012
+ summary: freeze ${UTG_DIR} into ${UTG_SNAPSHOT}, read-only for enrich.spec_gen
1013
+ user_facing:
1014
+ announce: fail_only
1015
+ name: Fixed page relations
1016
+ done: "The page relations used for this round's feature list are now fixed. UI conversion later changes its own page directory and will not touch this copy."
1017
+ failed: "The page relations used for this round's feature list could not be fixed: {reason}. Stopping here first."
1018
+ skipped: "No feature list this round, so the page relations were not saved separately."
1019
+ # Snapshot contract (utgHash stability): ensure skips the copy when the contract file digest matches, and an overwriting copy is
1020
+ # byte-stable when ${UTG_DIR} is unchanged; rerunning this node alone does **not** drift spec generation's UTG fingerprint.
1021
+ # Drift only comes from a discover recapture (UTG_DIR content changes) — when resuming, existing discover artifacts are always reused
1022
+ # (checkpoint kept) unless the user explicitly asks for a recapture; after a recapture the UTG content changes -> spec generation reruns because of
1023
+ # fingerprint drift, which is the expected cost and must be stated to the user.
1024
+ writes: { snapshot: "${UTG_SNAPSHOT}" }
1025
+ precondition:
1026
+ run: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
1027
+ runner: node
1028
+ args: "--gate arch --hmos ${HMOS} --checkpoint ${CHECKPOINT_DIR}/arch-reviewed.ok --assert-ready"
1029
+ exit_nonzero: hard_stop
1030
+ # The whole node cannot be skipped: the arch gate assertion in precondition also guards ui.batch. When spec does not run this round, skip
1031
+ # ensure; when spec runs, the script decides by the contract digest whether to skip the copy or overwrite (a hand-edited UTG_DIR is recopied too).
1032
+ actions:
1033
+ - ensure_utg_snapshot:
1034
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/ensure_utg_snapshot.mjs"
1035
+ runner: node
1036
+ args: "--from ${UTG_DIR} --to ${UTG_SNAPSHOT}"
1037
+ when: "not (${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true or ${PROFILE} == ui-only)"
1038
+ exit_nonzero: hard_stop
1039
+ success:
1040
+ - any:
1041
+ - all:
1042
+ - file_exists: "${UTG_SNAPSHOT}/utg.json"
1043
+ - file_exists: "${UTG_SNAPSHOT}/click_paths.json"
1044
+ - when: "${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true or ${PROFILE} == ui-only"
1045
+ on_fail: hard_stop
1046
+
1047
+ # The leaf skill is dispatched by SPEC_ENGINE (skill_by_engine): spec-generate = a2h-spec-generate (internal steps of a single skill:
1048
+ # prepare -> fused per-Area worker -> check-fused-spec -> finalize -> collect-specs -> publish-specs);
1049
+ # page-specgen = a2h-page-specgen (prepare -> waker rearm -> event loop -> finalize); dispatch in policy.dispatch_inline.
1050
+ - id: enrich.spec_gen
1051
+ lane: enrich
1052
+ type: skill
1053
+ skill: ${SPEC_ENGINE} → skill_by_engine
1054
+ skill_by_engine: { spec-generate: a2h-spec-generate, page-specgen: a2h-page-specgen }
1055
+ user_facing:
1056
+ announce: always
1057
+ name: Feature list
1058
+ doing: "Writing a list of what each feature must do, based on the Android source and page navigation. The HarmonyOS business code will be written from this list later. This step does not change the UI."
1059
+ done: "The feature list is written: {spec_count} specs, {manifest_items} items in the list. Nothing missing. The HarmonyOS business code will be written from this list next."
1060
+ incomplete: "The feature list is written, but there are still gaps: {gaps}. We will continue with the current list, and these gaps will appear in the final report."
1061
+ failed: "The feature list could not be written: {reason}. Business logic cannot start without the list."
1062
+ reused: "The feature list was not rewritten this round; the existing one is reused."
1063
+ skipped: "No feature list this round."
1064
+ parallel_group: post_utg
1065
+ dispatch: "primary_skill_inline"
1066
+ needs: [discover.utg_snapshot]
1067
+ skip_if: "${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE} or ${REUSE_SPEC_GENERATE} == true"
1068
+ # Clear the gate checkpoint right before actually executing (lifecycle in policy.human_interaction).
1069
+ before_run:
1070
+ - clear_gate_checkpoint:
1071
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
1072
+ runner: node
1073
+ args: "--gate spec_gen --checkpoint ${CHECKPOINT_DIR}/spec-gen-reviewed.ok --clear-checkpoint"
1074
+ # Decide this run's directory and write the pointer; the stdout JSON back-fills RUN_DIR (SPEC_DIR is derived from it).
1075
+ # Unfinished run -> resumed; finished, or the user chose to rerun spec_gen / rerun everything (adds --fresh) -> new run-<timestamp>.
1076
+ - resolve_run_dir:
1077
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs"
1078
+ runner: node
1079
+ args: "--work ${WORK} [--run-dir ${RUN_DIR} only when the user provided it explicitly] [--fresh when the user chose to rerun spec_gen or rerun everything] --engine ${SPEC_ENGINE}"
1080
+ exit_0: "RUN_DIR = JSON.run_dir; SPEC_DIR = JSON.spec_dir; RUN_MODE = JSON.mode"
1081
+ exit_2: hard_stop
1082
+ # After the leaf returns and before judging success, executed by the **primary**: the run directory may have changed inside the leaf
1083
+ # (input fingerprint drift -> --fresh retry / the actual returned directory differs from the expected one -> --record). The primary must back-fill
1084
+ # RUN_DIR / SPEC_DIR, otherwise success / review.spec_gen / adopt.specs_json would read the old run.
1085
+ # Resume summaries are not written here — they hang off the ledger terminal-state step (policy.failure_semantics · ledger).
1086
+ after_run:
1087
+ - refresh_run_dir:
1088
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs"
1089
+ runner: node
1090
+ args: "--work ${WORK} --show --json --engine ${SPEC_ENGINE}"
1091
+ exit_0: "RUN_DIR = JSON.run_dir; SPEC_DIR = JSON.spec_dir (when different from what the leaf returned, the pointer wins, and it is recorded in the ledger)"
1092
+ exit_1: "no pointer: **keep the empty value** (success fails because ${SPEC_DIR}/specs.json does not exist) — never fall back to the previous round's run directory"
1093
+ reads:
1094
+ android: "${ANDROID}"
1095
+ utg_workspace: "${UTG_SNAPSHOT}" # read-only snapshot, **not** ${UTG_DIR}
1096
+ writes:
1097
+ run_dir: "${RUN_DIR}" # page-specgen's private workspace (plan/facts/drafts/prompts/ledger/state/waker) also lives under this root
1098
+ spec_batches_root: "${SPEC_DIR}"
1099
+ specs_json: "${SPEC_DIR}/specs.json"
1100
+ resume_summary: "${RESUME_SUMMARIES_DIR}/enrich.spec_gen.json" # derived when recording the ledger; after_run only does refresh_run_dir
1101
+ # The Android-side index is built by discover.android_index; with SPEC_ENGINE=spec-generate this node still writes it: one fixed sync before prepare.
1102
+ # An empty sync when the source is unchanged (read-only concurrency with ui.batch is in concurrency_exemptions).
1103
+ # Cases where spec-generate needs init / a full index rebuild are not handled in this node (see invoke / policy.leaf_questions);
1104
+ # page-specgen may init / index / sync itself on its first prepare (see the page-specgen block of invoke).
1105
+ android_index: "${ANDROID}/.homegraph/"
1106
+ success:
1107
+ - any:
1108
+ - all:
1109
+ - file_exists: "${SPEC_DIR}/specs.json"
1110
+ - glob_nonempty: "${SPEC_DIR}/*/*-SPEC.md"
1111
+ - skipped: true
1112
+ invoke: |
1113
+ Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish (policy.context_budget).
1114
+ [dispatch] see policy.dispatch_inline (this node = serial leg 2).
1115
+ This node picks its leaf from SPEC_ENGINE (skill_by_engine): spec-generate -> the `══ SPEC_ENGINE=spec-generate ══` section below;
1116
+ page-specgen -> run the `══ SPEC_ENGINE=page-specgen ══` section. Run only the section that matches SPEC_ENGINE.
1117
+ ══ SPEC_ENGINE=spec-generate ══
1118
+ skill name: a2h-spec-generate (path `${SKILLS_ROOT}/a2h-spec-generate`).
1119
+ [task prompt / inline arguments — same content]
1120
+ Arguments:
1121
+ ${ANDROID}
1122
+ utg-workspace=${UTG_SNAPSHOT}
1123
+ output=${RUN_DIR}
1124
+ concurrency=${SPEC_CONCURRENCY}
1125
+ application-module=${APP_MODULE} (omit the argument when empty; the skill's Step 0 decides: for Android, take the Gradle name from the unique match between the UTG source anchors and the module directory; for UniApp, the most stable of appid/package name/directory slug; when several are equally plausible or evidence is insufficient, stop per policy.leaf_questions; do not guess from the build tool)
1126
+ hmos-project=${HMOS} (passed as --registry-root to the publish-specs run at the Step 5b pages root, declaring the page-grouped root in
1127
+ ${HMOS}/.hometrans/artifact-registry.jsonl — the registry is last-wins and the board resolves the **last** spec_root
1128
+ declaration, so it must land on the pages root; the publish at the idx root does not take --registry-root)
1129
+ [Unattended contract (policy.leaf_questions)]
1130
+ · application-module uses ${APP_MODULE} (empty = unconventional layout, decided by a2h-spec-generate's own rules);
1131
+ the source scope is the whole ${ANDROID} project — do not ask the user about either of these;
1132
+ · Ambiguous requirement scope: stop per a2h-spec-generate's rules and report that page; do not ask;
1133
+ · Other questions follow policy.leaf_questions.
1134
+ utg-workspace must be ${UTG_SNAPSHOT} (read-only snapshot; ${UTG_DIR}/${UI_UTG_DIR} are forbidden, see policy.parallel_rule).
1135
+ The snapshot already contains utg.json + click_paths.json (validated in Step 0).
1136
+ HomeGraph: ${ANDROID}/.homegraph/ only allows an **empty sync** (once before prepare, built into the leaf's Step 1);
1137
+ when init / a full index is needed, **do not rebuild** — this node fails and reports Step 1 verbatim
1138
+ (the index is built and synced by discover.android_index; rebuilding is up to preflight/the user, see concurrency_exemptions).
1139
+ Internal steps of the single skill: prepare (freeze the UTG, generate an area-fusion task for each Area) -> fused per-Area worker
1140
+ (merging + SPEC writing in the same session) -> check-fused-spec (L1 self-check) -> finalize (L2 mints identity,
1141
+ publishes generation/spec-bindings.json) -> collect-specs -> publish-specs (idx root) ->
1142
+ **Step 5b**: regroup-by-page (folds the idx-root SPECs into page directories according to the frozen topology) ->
1143
+ publish-specs (pages root = ${SPEC_DIR}, publishing the specs.json consumed downstream).
1144
+ Concurrency of fused / review workers is managed by the skill per concurrency=; the orchestrator must not expand its internal steps.
1145
+ The orchestrator is **forbidden** to start a separate a2h-spec-generate Task — this node's dispatch already decides how it runs.
1146
+ The output layout is owned exclusively by the skill ("Do not modify the <run-directory> layout"):
1147
+ ${SPEC_DIR}/<page>/<stem>-SPEC.md (page-grouped root; page names come from topology labels or pages-map.json)
1148
+ ${SPEC_DIR}/specs.json <- the list published by Step 5b at the pages root (the adoption source for SPECS_JSON)
1149
+ The idx root <run>/generation/specs is an internal anchor of the leaf (so-id minting order); the orchestrator and downstream no longer read it.
1150
+ Checkpoint resume: rerun with the same output=${RUN_DIR}; prepare reuses existing artifacts when the input fingerprint matches,
1151
+ dispatching only unfinished fused / review tasks; input fingerprint drift -> that run directory is never reused (see policy.artifact_reuse).
1152
+ Run directory (see before_run.resolve_run_dir):
1153
+ · The run_dir returned by the skill differs from ${RUN_DIR} -> the actual one wins: node ${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs --work ${WORK} --record <actual> --engine ${SPEC_ENGINE},
1154
+ and update RUN_DIR (later gates / adopt all read this one); note it in the report;
1155
+ · a2h-spec-generate stops because of "input fingerprint drift / workspace not empty" (prepare refuses to reuse that run directory) -> do not fail right away: run_dir.mjs --work ${WORK} --fresh --engine ${SPEC_ENGINE}
1156
+ creates a new directory and retries automatically **once**; only a second failure is handled per fail_matrix.
1157
+ Publish gate (**following the deveco-cli contract**: incomplete semantics do **not abort**, but the gaps must be recorded and explained in the report;
1158
+ when run-report.json is marked negative handle it per the branches below; hand-editing artifacts and skipping finalize are **forbidden**):
1159
+ · When marked negative (finalize itself exits non-zero and names the reason), collect-specs / publish-specs (idx root) and Step 5b's regroup-by-page / publish-specs (pages root) run to completion as usual —
1160
+ `--allow-incomplete` is added only to collect-specs and the two publish-specs runs; regroup-by-page has **no** gate flag, and passing that flag to it exits 2 (unknown argument);
1161
+ specs.json records `completeness: "incomplete-known"` + `incomplete{areas,failedShards,unresolved,unresolvedReasonCodes}`,
1162
+ the node still counts as successful and **does not block downstream** (adopt / logic.spec_pipeline consume as usual; the gaps go into the finalize report).
1163
+ · finalize crashes before committing the marker (run-report.json missing -> verdict unknown; after H3/H6 it necessarily ends up here):
1164
+ collect-specs / the two publish-specs runs likewise complete with `--allow-incomplete` (regroup-by-page as usual, no gate flag), and specs.json records
1165
+ `completeness: "incomplete-known"` + `incomplete{unverified:true}` (a real run, marker not committed,
1166
+ gaps cannot be named item by item) — publishing a list without a completeness field to pose as a hand-written batch list is **forbidden** (N3).
1167
+ · Real failure signal = finalize exits non-zero + collect-specs / publish-specs still refuse under `--allow-incomplete`
1168
+ (or the regroup-by-page process exits non-zero, collect-specs reports "declared SPEC cannot be read", 0 SPECs) -> report ok:false verbatim;
1169
+ masking it with --allow-incomplete is **not allowed**.
1170
+ When finished, the primary returns to migrate scheduling; it outputs only JSON:
1171
+ { "ok": true, "run_dir": "${RUN_DIR}", "specs_json": "${SPEC_DIR}/specs.json",
1172
+ "spec_count": M, "manifest_items": P, "published": true,
1173
+ "completeness": "complete" | "incomplete-known",
1174
+ "incomplete": { areas, failedShards, unresolved, unresolvedReasonCodes } (or, when finalize did not commit the marker,
1175
+ only { unverified: true } — the run really exists but crashed before the marker, so the gaps cannot be named item by item)}.
1176
+ The gaps must be named in the final reply (which Areas were not delivered / which candidates were not resolved); incomplete-known must not be described as a complete page set.
1177
+ ══ SPEC_ENGINE=page-specgen ══
1178
+ skill name: a2h-page-specgen (path `${SKILLS_ROOT}/a2h-page-specgen`; read its SKILL.md in full and
1179
+ follow its Orchestration Loop / event protocol exactly; the orchestrator does not restate or rewrite that protocol).
1180
+ If this section conflicts with ${SKILLS_ROOT}/a2h-page-specgen/SKILL.md, the leaf SKILL.md wins;
1181
+ this section only fixes the entry commands, the arguments and the success / failure criteria.
1182
+ Arguments:
1183
+ ${ANDROID}
1184
+ ${UTG_SNAPSHOT}
1185
+ ${HMOS}
1186
+ --out ${SPEC_DIR}
1187
+ --concurrency ${SPEC_CONCURRENCY}
1188
+ --chunk-budget ${MAX_SCENARIOS_PER_CHUNK}
1189
+ --engine-mode ${ENGINE_MODE}
1190
+ --design-dir ${DESIGN_DIR}
1191
+ For this engine's forbidden arguments see stage-map.md "Notes on orchestrator arguments"; pass only the switches listed above.
1192
+ Execution order:
1193
+ 1) node scripts/prepare.mjs ${ANDROID} ${UTG_SNAPSHOT} ${HMOS} --out ${SPEC_DIR}
1194
+ --concurrency ${SPEC_CONCURRENCY} --chunk-budget ${MAX_SCENARIOS_PER_CHUNK}
1195
+ --engine-mode ${ENGINE_MODE} --design-dir ${DESIGN_DIR}
1196
+ 2) node scripts/waker.mjs ${SPEC_DIR} rearm # prepare writes waker.stop first, so this step is mandatory
1197
+ 3) advance per SKILL.md's loop (watchdog --reconcile --json -> handle error/invalid -> claim ->
1198
+ background Agent (its prompt carries the token) -> dispatch confirm -> wait for the notification -> back to watchdog)
1199
+ 4) complete with the evidence cleared -> node scripts/finalize.mjs ${SPEC_DIR}
1200
+ [Unattended contract (policy.leaf_questions)]
1201
+ This engine does not ask; homegraph init/index/sync is allowed; a busy ledger is reported after three retries; lock/conflict -> hard-block.
1202
+ ${SPEC_DIR} is the shared publish root: plan.json / facts/ / drafts/ / prompts/ / ledger.jsonl / state.json /
1203
+ waker.* / report.md / grouping-report.json are all this engine's private workspace; downstream only reads specs.json and */*-SPEC.md.
1204
+ Completion:
1205
+ · finalize exit 0 -> success (the success criteria are unchanged);
1206
+ · finalize exit 1 (gate failure) -> the node fails: report the failing groups from ${SPEC_DIR}/report.md verbatim, then
1207
+ node ${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs --work ${WORK} --abandon --engine ${SPEC_ENGINE};
1208
+ never turn it into a success, never publish partial specs, never hand-edit specs.json;
1209
+ · prepare non-zero (including plan_version drift / a non-empty non-strict-v2 workspace) -> first
1210
+ node ${SKILLS_ROOT}/a2h-app-migrate/scripts/run_dir.mjs --work ${WORK} --fresh --engine ${SPEC_ENGINE}
1211
+ to obtain a new RUN_DIR / SPEC_DIR and retry **once**; a second failure -> ok:false;
1212
+ · watchdog not complete / lock timeout / conflict -> not complete; do not rearm automatically.
1213
+ · Before returning ok:false, run `run_dir.mjs --abandon` (the finalize-failure branch above already lists it);
1214
+ skipping it leaves this run's partial specs.json to be judged finished by the next probe 3 and reused.
1215
+ Returns JSON: { "ok": true, "run_dir": "${RUN_DIR}", "specs_json": "${SPEC_DIR}/specs.json",
1216
+ "spec_count": M, "manifest_items": P } or { "ok": false, "note": "..." }.
1217
+
1218
+ # Spec chain human gate — dispatched after enrich.spec_gen reaches a terminal state.
1219
+ - id: review.spec_gen
1220
+ lane: adopt
1221
+ type: adopt
1222
+ needs: [enrich.spec_gen]
1223
+ skip_if: "${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE}"
1224
+ human_gate: true
1225
+ user_facing:
1226
+ announce: always
1227
+ name: Review the feature list
1228
+ ask: "Please review this feature list; it says what each feature must do. What is missing: {gaps}. Business code is written from it only after you reply 'confirm'. Reply 'rerun' to rewrite the list, still using the page relations fixed in this round."
1229
+ auto: "The feature list was confirmed in auto mode. What is missing: {gaps}."
1230
+ done: "The feature list is confirmed."
1231
+ failed: "The feature list is not confirmed yet: {reason}. Business logic will not be written from this list until it is confirmed."
1232
+ gate_checkpoint: "${CHECKPOINT_DIR}/spec-gen-reviewed.ok"
1233
+ writes: { checkpoint: "${CHECKPOINT_DIR}/spec-gen-reviewed.ok" }
1234
+ actions:
1235
+ - run_human_review_gate:
1236
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
1237
+ runner: node
1238
+ # Do not skip: see policy.human_gate_protocol. Delivery evidence: specs.json completeness / incomplete.
1239
+ args: "--gate spec_gen --specs-json ${SPEC_DIR}/specs.json --checkpoint ${CHECKPOINT_DIR}/spec-gen-reviewed.ok [--write-confirmed --confirmed-by auto when ${INTERACTION_MODE} == auto or ${INTERACTIVE_GATES} does not contain review.spec_gen]"
1240
+ success:
1241
+ - any:
1242
+ - file_exists: "${CHECKPOINT_DIR}/spec-gen-reviewed.ok"
1243
+ - skipped: true
1244
+ invoke: |
1245
+ Per policy.human_gate_protocol.
1246
+ Write {gaps} item by item from the evidence below: who did not deliver, which page did not match; when there are no gaps fill in "nothing missing".
1247
+ Ask the user to confirm the SPEC scope, the specs.json order and whether requirements were cut before adopting the list. Use user_facing.ask for what is said to the user; do not read this line out verbatim.
1248
+ These paths can be attached:
1249
+ - ${SPEC_DIR}/specs.json
1250
+ - ${SPEC_DIR}/<page>/<stem>-SPEC.md (page directories under the publish root; page names come from topology labels or pages-map.json)
1251
+ When specs.json has `completeness == "incomplete-known"`, the gaps in `incomplete{areas,failedShards,unresolved,…}` must be listed as well
1252
+ (publishing with holes is allowed, but it must **not** be adopted as a complete page set; on auto confirmation the gaps must also be named in the receipt).
1253
+ `rerun` -> first set REUSE_SPEC_GENERATE=false, go back to enrich.spec_gen (before_run clears the checkpoint;
1254
+ resolve_run_dir takes --fresh — "rerun" is a new generation, not a resume of the previous one).
1255
+ ⚠ It only goes back to enrich.spec_gen and still reads this round's ${UTG_SNAPSHOT} — **fixing the UTG does not take effect this way**.
1256
+ To use a fixed UTG: end this round and rerun migrate with reuse_discover_utg=false.
1257
+
1258
+ - id: ui.batch
1259
+ lane: enrich
1260
+ type: skill
1261
+ skill: a2h-batch-ui-align
1262
+ user_facing:
1263
+ announce: always
1264
+ name: UI conversion
1265
+ doing: "Converting the Android pages into HarmonyOS UI: first move icons and resources, then generate the UI page by page, and finally try to build and open the app."
1266
+ done: "UI conversion is done. {pages_processed} pages processed, {pages_failed} of them not converted. Build result is {build_status} (SUCCESS = passed, PARTIAL = some problems, FAILED = did not pass). The app-launch check result is {smoke_verdict}. Recorded in .hometrans/batch_report.md of the HarmonyOS project."
1267
+ failed: "UI conversion was not finished: {reason}. The pages already converted are still there. The business logic steps will continue. You can drop this batch of UI and continue, or redo UI conversion from the checkpoint."
1268
+ reused: "The UI was not redone this round; the pages converted last time are reused."
1269
+ parallel_group: post_utg
1270
+ dispatch: "primary_skill_inline"
1271
+ needs: [discover.utg_snapshot, discover.arch]
1272
+ also_needs_group: discover_par
1273
+ skip_if: "${REUSE_UI_BATCH} == true"
1274
+ # Clear the gate checkpoint right before actually executing (lifecycle in policy.human_interaction).
1275
+ before_run:
1276
+ - clear_gate_checkpoint:
1277
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
1278
+ runner: node
1279
+ # Also rename and archive the previous round's batch_report.md: this node's success check / checkpoint probe / review.ui_batch only trust it,
1280
+ # and without archiving, a mid-run failure this round would be masked as success by the old report. batch_progress.json is left alone (the skill's checkpoint resume needs it).
1281
+ args: "--gate ui_batch --hmos ${HMOS} --checkpoint ${CHECKPOINT_DIR}/ui-batch-reviewed.ok --clear-checkpoint --archive-stale-report"
1282
+ device: true
1283
+ # Step 3.1 only reads the Android-side index (android_index_ready=true, no more init / full rebuild).
1284
+ reads: { android_index: "${ANDROID}/.homegraph/" }
1285
+ writes:
1286
+ utg: "${UI_UTG_DIR}/" # written in Step 3.1 (separate from discover.utg_static's ${UTG_DIR}; unchanged when a stages.capture.done resume skips Step 3)
1287
+ ui_info: "${UI_INFO_ROOT}/" # Step 3.2 capture artifacts and pages.json (written by export_ui_info.mjs; Step 3.3 only verifies, generating a fallback when missing)
1288
+ pages: "${HMOS}/"
1289
+ progress: "${HMOS}/.hometrans/batch_progress.json"
1290
+ resume_summary: "${RESUME_SUMMARIES_DIR}/ui.batch.json" # derived when recording the ledger; lands in ${WORK}/, consistent with path_excludes
1291
+ # `pages: ${HMOS}/` is a coarse declaration of the "HarmonyOS source tree" and does not include the orchestration workspace.
1292
+ # Here **other nodes'** private subdirectories under .hometrans are carved out explicitly, so that validate_workflow.mjs
1293
+ # can still catch real races (the two precise declarations utg / ui_info above are not exempted along with them).
1294
+ path_excludes: ["${WORK}/"]
1295
+ success:
1296
+ - any:
1297
+ - file_exists: "${HMOS}/.hometrans/batch_report.md"
1298
+ - skipped: true
1299
+ invoke: |
1300
+ Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish (policy.context_budget).
1301
+ [dispatch] see policy.dispatch_inline (this node = serial leg 1).
1302
+ skill name: a2h-batch-ui-align (path `${SKILLS_ROOT}/a2h-batch-ui-align`).
1303
+ [task prompt / inline arguments — same content]
1304
+ Arguments:
1305
+ android_project_dir=${ANDROID}
1306
+ harmony_project_dir=${HMOS}
1307
+ apk_path=${APK_PATH} # already validated by preflight (exists / absolute path / .apk / zip signature); never guess or search for the APK yourself
1308
+ [app_module=${APP_MODULE} only when APP_MODULE is non-empty] # Gradle path (:app); ui-align Step 2 forwards it verbatim to a2h-resource-convert
1309
+ [ADB_PATH=${ADB_PATH} ADB_SERIAL=${ADB_SERIAL} only when non-empty] # Step 3.2 explorer capture (including incremental I5) uses this one device
1310
+ [DEVECO_HOME=${DEVECO_HOME} only when non-empty] # adopted directly by ui-align Step 0, and passed to a2h-fix-build-errors as deveco_studio_path
1311
+ android_index_ready=true # discover.android_index has built and synced ${ANDROID}/.homegraph; Step 3.1 must not init / index again
1312
+ # Never pass image_read= (policy.image_read): a2h-batch-ui-align Step 1 probes again and writes host_caps.json
1313
+ [reuse_static_workspace=${UTG_DIR} only when discover.utg_static actually ran this round]
1314
+ # if any of the following is true it did not run this round; **do not pass** this argument, and Step 3.1 runs by itself:
1315
+ # ${REUSE_DISCOVER_UTG} / ${SKIP_LOGIC} / ${SKIP_SPEC_GENERATE} / ${REUSE_SPEC_GENERATE} == true / ${PROFILE} == ui-only
1316
+ [takeover_allowed=true only when this migrate has already run ui.batch once: this round's ledger records ui.batch as failed, or review.ui_batch chose "rerun"]
1317
+ [Unattended contract (policy.leaf_questions)]
1318
+ · The app module for Step 2 a2h-resource-convert is the app_module passed above (the same as the spec chain); do not ask the user;
1319
+ · Step 0's DEVECO_HOME and Step 1's three paths are all given; do not ask again;
1320
+ · When the Step 6.3 cold-start smoke test hits login -> auto / sub-agent records DEPLOY_ERROR in the Step 7 TODOs and continues;
1321
+ · `group_queue.mjs init` refuses to start ("another parent session may still be driving this campaign": a background job
1322
+ such as run_cycle is still running, reviewer answers bound within 20 minutes are incomplete, or a running group is still active) — ui-align requires asking the user:
1323
+ - interactive and this node is inline in the primary -> ask per ui-align's rules (only monitor / stop that session and then --takeover);
1324
+ - otherwise look at takeover_allowed: true (the signs come from this migrate's own previous ui.batch, which has already ended) -> first stop
1325
+ the background jobs with state=running in ${HMOS}/.hometrans/jobs/*.json (by their pid: Windows `taskkill /T /F /PID <pid>`,
1326
+ others `kill <pid>`), then `init --takeover`;
1327
+ - no takeover_allowed (the signs may come from another session the user opened) -> **do not take over**; return { "ok": false, "note": "<init output verbatim>" }
1328
+ (soft_continue), and review.ui_batch's failure branch hands it to the user;
1329
+ · Other questions follow policy.leaf_questions.
1330
+ [Checkpoint resume — decided before "full run"; never ignore existing progress because of "full mode"]
1331
+ Read ${HMOS}/.hometrans/batch_progress.json. If the file exists and the Resume identity matches
1332
+ (harmony_project_dir=${HMOS} ∧ mode=full; this node only runs full and does not count incremental scope):
1333
+ it **must** go through a2h-batch-ui-align "Resume from progress"; archiving progress to start a new campaign is **forbidden**,
1334
+ and reading "run Step 0–7 in full" as recapturing/reconverting from scratch is **forbidden**:
1335
+ · pages with status=done whose output still exists -> Step 5 skipped; pending/failed -> redone;
1336
+ · stages.resources.done and resource_mapping.md present -> **skip Step 2** (rerunning would wipe already-merged resources);
1337
+ · stages.capture.done and ${UI_INFO_ROOT}/pages.json present -> **rerunning Step 3 (3.1–3.3) is forbidden**
1338
+ (recapturing changes the page_NNNN_* numbering, and none of the done pages keys would match);
1339
+ · without stages.capture.done: within a full campaign run_cycle.mjs continues capturing from cycle_state; it is not a new round.
1340
+ Only when the user explicitly asks this round to "reconvert resources" / "recapture" may progress be archived and restarted (this orchestration does not ask for that by default).
1341
+ progress missing, or not matching (different HMOS / mode≠full) -> run as a new campaign below; do not misuse someone else's progress.
1342
+ [Step path for a new campaign / resume catch-up] mode=full (not ui-align's MODE=incremental):
1343
+ - Step 0: resolve DEVECO_HOME (already passed);
1344
+ - Step 1: parse arguments, locate modules, decide the V1/V2 state management paradigm;
1345
+ - Step 2–6: skip or run according to the stages / pages above — resource conversion (Step 2 runs a2h-resource-convert,
1346
+ dispatched in the background in full mode) -> (when Step 3 is not skipped) UTG + device capture + pages.json -> page discovery -> page-by-page conversion ->
1347
+ static check/build/cold-start smoke;
1348
+ for a new campaign that needs capture: Step 3.2 always captures via a2h-utg-explorer (run_cycle.mjs);
1349
+ - Step 7: **must** write ${HMOS}/.hometrans/batch_report.md (this node's success check and checkpoint probe only trust it),
1350
+ and write Step 3.2's deferred_human.json, unassigned Lottie, degraded/pending-fetch icons, and every non-PASS smoke verdict
1351
+ (FAIL_* / SKIPPED_* / DEPLOY_ERROR) into the Manual Follow-up TODOs — anything left out is silently lost.
1352
+ Step 3.1 (only when Step 3 was **not** skipped this round because of stages.capture.done):
1353
+ when reuse_static_workspace is passed, first run, under ui-align's scripts conventions,
1354
+ node ${SKILLS_ROOT}/a2h-app-migrate/scripts/reuse_static_utg.mjs --from ${UTG_DIR} --to ${UI_UTG_DIR} --lang <device locale>
1355
+ (the locale comes from the same getprop used by discover). exit 0 -> already copied into ${UI_UTG_DIR}; skip Step 3.1's run_pipeline / reviewers and continue capturing from Step 3.2.
1356
+ Non-zero (unfinished, lang mismatched or missing, directories overlapping) -> do not switch to ${UTG_DIR}; run the full Step 3.1 yourself in ${UI_UTG_DIR}.
1357
+ When reuse_static_workspace is not passed, also run Step 3.1 yourself. In both cases only ${UI_UTG_DIR} is written, never back to ${UTG_DIR}
1358
+ (spec only reads ${UTG_SNAPSHOT}, see policy.parallel_rule).
1359
+ Per-page/group conversion sub-agents are managed by this skill itself (Task): this session is the primary; per a2h-batch-ui-align Step 0.1
1360
+ use task / subagent to dispatch the resource, reviewer and conversion sub-agents in the background; do not change this to page-by-page serial work inside the session.
1361
+ The prompts sent to those sub-agents still forbid them from dispatching further sub-agents (they are the last layer).
1362
+ If this session's tool list has neither task nor subagent: do not convert page by page inside this session to fake success. Return
1363
+ { "ok": false, "note": "no task/subagent tool; conversion workers cannot be dispatched" }.
1364
+ When finished, the primary returns to migrate scheduling; it outputs only JSON:
1365
+ { "ok": true, "pages_processed": N, "pages_failed": F, "build_status": "SUCCESS|PARTIAL|FAILED",
1366
+ "smoke_verdict": "<a2h-coldstart-smoke-gate verdict>", "batch_report": "${HMOS}/.hometrans/batch_report.md" }.
1367
+
1368
+ # UI human gate — after ui.batch reaches a terminal state (may interleave with the following enrich.spec_gen / module_docs).
1369
+ - id: review.ui_batch
1370
+ lane: enrich
1371
+ type: adopt
1372
+ needs: [ui.batch]
1373
+ human_gate: true
1374
+ user_facing:
1375
+ announce: always
1376
+ name: Review the converted UI
1377
+ ask: "Please review the converted UI and the conversion record: how many pages were processed, which pages failed, and the results of building and opening the app. Reply 'confirm' to continue."
1378
+ ask_failed: "UI conversion was not finished: {reason}. Reply 'drop UI, continue' to go on writing business logic. Reply 'rerun' to continue converting pages from the checkpoint."
1379
+ auto: "The UI conversion result was confirmed in auto mode."
1380
+ done: "The UI conversion result is confirmed."
1381
+ failed: "The UI conversion result is not confirmed yet: {reason}. The later join will not start until it is confirmed."
1382
+ gate_checkpoint: "${CHECKPOINT_DIR}/ui-batch-reviewed.ok"
1383
+ writes: { checkpoint: "${CHECKPOINT_DIR}/ui-batch-reviewed.ok" }
1384
+ actions:
1385
+ - run_human_review_gate:
1386
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
1387
+ runner: node
1388
+ # Do not skip: see policy.human_gate_protocol.
1389
+ args: "--gate ui_batch --hmos ${HMOS} --ui-info-root ${UI_INFO_ROOT} --checkpoint ${CHECKPOINT_DIR}/ui-batch-reviewed.ok [--write-confirmed --confirmed-by auto when ${INTERACTION_MODE} == auto or ${INTERACTIVE_GATES} does not contain review.ui_batch]"
1390
+ # When ui.batch's terminal state is failed (soft_continue), or the call above exits 2 (artifacts incomplete / pending pages),
1391
+ # take the failure branch instead: same --checkpoint, plus --upstream-failed --reason "<failure reason / previous stderr>"
1392
+ # (under auto or when not in the allowlist also add --write-confirmed --confirmed-by auto). exit 2 must not directly fail this node.
1393
+ on_upstream_failed: "--gate ui_batch --hmos ${HMOS} --ui-info-root ${UI_INFO_ROOT} --checkpoint ${CHECKPOINT_DIR}/ui-batch-reviewed.ok --upstream-failed --reason <reason> [--write-confirmed --confirmed-by auto under the same condition as above]"
1394
+ success:
1395
+ - any:
1396
+ - file_exists: "${CHECKPOINT_DIR}/ui-batch-reviewed.ok"
1397
+ - skipped: true
1398
+ invoke: |
1399
+ Per policy.human_gate_protocol. When upstream failed (--upstream-failed, or the gate script exited 2) send user_facing.ask_failed instead of ask.
1400
+ The script only trusts this round's batch_report.md (pages.json does not count), and exits 2 if batch_progress.json has pending pages;
1401
+ when it passes it prints page statistics (done / failed), failed pages, and a build and smoke summary — put these numbers into the user_facing sentence and show them to the user under interactive.
1402
+ These paths can be attached:
1403
+ - ${UI_INFO_ROOT}/pages.json
1404
+ - ${HMOS}/.hometrans/batch_report.md
1405
+ - ${HMOS}/.hometrans/batch_progress.json
1406
+ `rerun` -> first set REUSE_UI_BATCH=false, go back to ui.batch.
1407
+ ── UI chain failure (ui.batch failed, or exit 2 above) ──
1408
+ run the on_upstream_failed command instead and give the failure reason to the user verbatim:
1409
+ `drop UI, continue` -> run once more with `--write-confirmed --confirmed-by user`; the checkpoint records ui_status=failed and the pipeline continues;
1410
+ `rerun` -> first set REUSE_UI_BATCH=false, go back to ui.batch (the skill resumes from the checkpoint in batch_progress.json).
1411
+ auto / not in the allowlist: go straight to --write-confirmed --confirmed-by auto without waiting.
1412
+
1413
+ - id: enrich.module_docs
1414
+ lane: enrich
1415
+ type: skill
1416
+ skill: a2h-module-semantic-docs
1417
+ user_facing:
1418
+ announce: always
1419
+ name: Module notes
1420
+ doing: "Reading the code already in the HarmonyOS project, writing a paragraph on what each part is responsible for, and making the project architecture notes match this code. This step does not write new business code."
1421
+ done: "The module notes are written, covering {modules_updated} parts. The project architecture notes were updated to match the existing code. Nothing missing."
1422
+ failed: "The module notes were not finished: {reason}. Missing these notes does not block writing business logic later."
1423
+ reused: "The module notes were not rewritten this round; the result from last time is reused."
1424
+ skipped: "No module notes this round."
1425
+ # **Does not depend on enrich.spec_gen**: this node only reads the ${HMOS} source, spec_gen only writes ${RUN_DIR}; they do not intersect.
1426
+ # Scheduling is fixed serial: after enrich.spec_gen — must not be inserted between ui.batch and spec_gen
1427
+ # (needs still only hangs off ui.batch; start order in policy.parallel_rule / schedule_hint).
1428
+ needs: [discover.arch, ui.batch]
1429
+ dispatch: "primary_skill_inline"
1430
+ skip_if: "${SKIP_MODULE_DOCS} or ${REUSE_MODULE_DOCS} == true"
1431
+ # The state file is kept across runs (it is the incremental baseline for --incremental preserve and must not be deleted); checking existence alone lets the previous round pose as success.
1432
+ # Record the time before starting; success requires the state file to be no older than it.
1433
+ before_run:
1434
+ - mark_module_docs_start:
1435
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_module_docs_done.mjs"
1436
+ runner: node
1437
+ args: "--hmos ${HMOS} --marker ${CHECKPOINT_DIR}/module-docs-started.json --mark"
1438
+ reads: { hmos: "${HMOS}" }
1439
+ # project_design.md is first written by discover.arch and **refreshed** by this node from the current code (the skill's design intent).
1440
+ # The two have a needs ordering, so this is not a concurrent race; but whether this node ran cannot be judged by this file (see success).
1441
+ writes:
1442
+ project_design: "${HOMETRANS_DIR}/project_design.md"
1443
+ module_docs: "${HOMETRANS_DIR}/<module_path>/module_design.md"
1444
+ scanner: "${HOMETRANS_DIR}/module_understanding/"
1445
+ state: "${HOMETRANS_DIR}/module_understanding/.module_semantic_docs_state.json"
1446
+ # SKILL.md starts with homegraph init -i <HMOS>. The other writers of the HMOS-side index (discover.arch reconcile, logic.spec_pipeline)
1447
+ # all have a needs ordering with this node, and spec generation only indexes the Android side — declared here so validate_workflow reports any new concurrent writer later.
1448
+ hmos_index: "${HMOS}/.homegraph/"
1449
+ # module_docs' <module_path> mirrors the **source module path**; the scanner does not treat artifact directories such as app-migrate/,
1450
+ # utg_static/, ui_info/ as source modules. Carved out explicitly so the coarse declaration does not swallow real races.
1451
+ path_excludes: ["${WORK}/", "${UTG_DIR}/", "${UI_UTG_DIR}/", "${UI_INFO_ROOT}/"]
1452
+ # Success = Step 7 commit_module_state.mjs writes the incremental state file (written atomically only after document validation passes).
1453
+ # Do not look only at project_design.md: discover.arch has already written it, which would make a failed module_docs "succeed" too.
1454
+ # Nor only at the state file existing: it is kept across runs and must be written after this run started (the check script compares against before_run's marker).
1455
+ success:
1456
+ - any:
1457
+ - all:
1458
+ - file_exists: "${HOMETRANS_DIR}/module_understanding/.module_semantic_docs_state.json"
1459
+ - script_exit_0: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_module_docs_done.mjs", args: "--hmos ${HMOS} --marker ${CHECKPOINT_DIR}/module-docs-started.json" }
1460
+ - skipped: true
1461
+ invoke: |
1462
+ Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish (policy.context_budget).
1463
+ Use skill `${SKILLS_ROOT}/a2h-module-semantic-docs`.
1464
+ a2h-module-semantic-docs ${HMOS}
1465
+ --engine-mode ${ENGINE_MODE}
1466
+ --incremental preserve
1467
+ --scope project-source
1468
+ The skill accepts only these three optional arguments; forbidden arguments are listed in stage-map.md "Orchestrator argument notes". The output directory is fixed to ${HOMETRANS_DIR}/.
1469
+ --scope project-source is the leaf default but is still passed explicitly: only --scope ask stops to ask for the write scope (the scan result's
1470
+ requires_scope_confirmation=true); passing it explicitly prevents the executor from switching to ask on its own. (requires_user_input is fixed to false in the scanner and is unrelated.)
1471
+ This node **refreshes** the ${HOMETRANS_DIR}/project_design.md written by discover.arch (the skill's design intent) —
1472
+ **merging** into arch's target architecture per its Step 5 rule 6 (keeping the # HAP/HAR comments and directories not yet created); it must not be replaced wholesale with the current source tree;
1473
+ and generates ${HOMETRANS_DIR}/<module_path>/module_design.md per module_update_plan.
1474
+ It must run through Step 7 (commit_module_state.mjs).
1475
+ When ui.batch fails (soft_continue) this node **runs as usual**: it only scans the existing ${HMOS} source, and a few missing UI pages do not matter.
1476
+ Return only JSON: { "ok": true, "project_design": "...", "modules_updated": N } or { "ok": false, "note": "..." }.
1477
+
1478
+ - id: barrier.l2_enrich
1479
+ lane: enrich
1480
+ type: local
1481
+ # The ui side waits for review.ui_batch (which implies ui.batch; under force_skip that need is satisfied by the skipped terminal state).
1482
+ # The spec side still waits for enrich.spec_gen (review.spec_gen is gated separately before adopt and can wrap up outside this barrier).
1483
+ # Do not run --assert-ready again here: the gate itself exiting 1 is enough to stop the interactive path.
1484
+ # When UI fails, review.ui_batch's checkpoint carries ui_status=failed — that is also a terminal state, and the barrier passes as usual;
1485
+ # the same holds for failed terminal states (soft_continue) of ui.batch / enrich.module_docs; do not hard_stop because of them.
1486
+ needs: [enrich.spec_gen, review.ui_batch, enrich.module_docs]
1487
+ summary: join barrier — adopt/logic are allowed only after ui.batch and enrich.spec_gen are both terminal, the UI gate is confirmed, and module_docs is terminal
1488
+ user_facing:
1489
+ announce: fail_only
1490
+ name: Join
1491
+ done: "UI conversion, the feature list and the module notes have all finished."
1492
+ failed: "UI conversion, the feature list or the module notes have not all arrived yet: {reason}. Business logic is not written yet."
1493
+ success: [{ all_needs_terminal: true }]
1494
+ on_fail: hard_stop
1495
+
1496
+ # Signing prerequisite — a2h-spec-design-pipeline I2 requires app.signingConfigs in build-profile.json5; if missing it aborts the whole
1497
+ # logic chain. Preflight does not check signing (often there is no project yet at the start). With emulators only, no confirmation and no devecocli login is required;
1498
+ # login is confirmed only when there is a real device, or when the logic chain runs this round and it is not emulator-only.
1499
+ # The shell was just created by arch, so it certainly has no signing; with a real device or no HarmonyOS device, generate it once before the logic chain. Emulator-only and not logged in -> do not generate.
1500
+ - id: adopt.signing
1501
+ lane: adopt
1502
+ type: local
1503
+ user_facing:
1504
+ announce: always
1505
+ name: Signing
1506
+ doing: "Checking the signing config of the HarmonyOS project. Installing on a real device needs it."
1507
+ done: "The signing config is complete. If build-profile.json5 was changed this round, the change has been committed to the HarmonyOS project."
1508
+ failed: "Signing is not configured yet: {reason}."
1509
+ skipped: "No business logic this round, so signing was not checked."
1510
+ needs: [barrier.l2_enrich]
1511
+ skip_if: "${SKIP_LOGIC} or ${SKIP_LOGIC_PIPELINE} or ${REUSE_LOGIC_PIPELINE} == true"
1512
+ writes: { build_profile: "${HMOS}/build-profile.json5" }
1513
+ success:
1514
+ - any:
1515
+ - script_exit_0: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_signing.mjs", args: "--hmos ${HMOS}" }
1516
+ - skipped: true
1517
+ invoke: |
1518
+ 0. Before starting, note whether `git -C ${HMOS} status --porcelain -- build-profile.json5` is empty (needed in step 4 below).
1519
+ 1. node ${SKILLS_ROOT}/a2h-app-migrate/scripts/check_signing.mjs --hmos ${HMOS}
1520
+ exit 0 -> signing exists and the product being built references it (when this node changed nothing it succeeds directly and skips step 4). exit 2 -> build-profile.json5 does not exist; this node fails.
1521
+ exit 3 -> app.signingConfigs exists but the product (JSON.product) does not reference it: add to that product
1522
+ `"signingConfig": "<JSON.configs[0]>"` (add only this one field; no need to regenerate signing), then rerun step 1.
1523
+ With only the definition and no reference, the build produces an unsigned HAP (a2h-fix-build-errors also judges by the reference), which cannot be installed on a real device.
1524
+ 2. exit 1 -> first look at `hdc list targets` (dropping empty lines and `[Empty]`).
1525
+ · There are targets and all start with `127.0.0.1:` (emulators only) -> do not ask the user to run `devecocli auth login`.
1526
+ Then look at `devecocli auth status` (the exit code may still be 0 when not logged in; body text `Not logged in` means not logged in):
1527
+ not logged in -> do not run `devecocli signature generate`. This node fails (soft_continue),
1528
+ with the reason "emulator only, devecocli auth login not required; signing not generated".
1529
+ logged in -> `devecocli signature generate` may be run (this is not asking for login), then rerun step 1 to verify.
1530
+ · There is a real device, or no HarmonyOS device at all -> run `devecocli signature generate` under ${HMOS}
1531
+ (same as the real-device signing step of a2h-coldstart-smoke-gate), then rerun step 1 to verify
1532
+ (still exit 3 after generating -> add the reference per the previous item).
1533
+ 3. Generation fails and says login is needed (only when the previous step really ran signature generate):
1534
+ · emulator only -> do not ask the user to run `devecocli auth login`. This node fails (soft_continue),
1535
+ with the reason "emulator only, devecocli auth login not required; signing not generated".
1536
+ · real device or no HarmonyOS device, and interactive -> ask the user to run `devecocli auth login`, and retry step 2 after confirmation;
1537
+ · real device or no HarmonyOS device, and auto -> do not ask; this node fails (soft_continue) with the reason "signing missing, devecocli auth login needed".
1538
+ Other generation failures -> this node fails (soft_continue), recording the error verbatim.
1539
+ 4. When this node changed build-profile.json5 (generated signing or added the reference) and ${HMOS} is a git repo, **commit this change**:
1540
+ spec-design-pipeline's W0 stops on any uncommitted change (the one before the campaign starts is absorbed into the baseline by git_baseline,
1541
+ but signing newly generated halfway through a resume would get stuck at W0).
1542
+ · If signing generation left key material in ${HMOS} (.p12 / .cer / .p7b / .csr etc. newly appearing in `git status --porcelain`),
1543
+ append their relative paths to ${HMOS}/.git/info/exclude — effective locally only, not committed, and the keys are not absorbed into the baseline by git_baseline either;
1544
+ · `git -C ${HMOS} add -- build-profile.json5 && git -C ${HMOS} commit -m "signing config (app-migrate adopt.signing)"`;
1545
+ · build-profile.json5 already had the user's own uncommitted changes at step 0 -> do not commit on the user's behalf; this node still succeeds, and the report states
1546
+ "build-profile.json5 has uncommitted changes, which will stop W0 of the logic chain; please commit first".
1547
+ This node only touches the signing config in build-profile.json5 (and the local exclude above), nothing else.
1548
+
1549
+ - id: adopt.specs_json
1550
+ lane: adopt
1551
+ type: adopt
1552
+ user_facing:
1553
+ announce: fail_only
1554
+ name: Adopt spec list
1555
+ done: "This feature list has been adopted."
1556
+ failed: "The feature list cannot be used yet: {reason}. Business logic cannot start yet."
1557
+ skipped: "No business logic this round, so no spec list was adopted."
1558
+ needs: [barrier.l2_enrich, review.spec_gen]
1559
+ skip_if: "${SKIP_LOGIC}"
1560
+ precondition:
1561
+ run: "${SKILLS_ROOT}/a2h-app-migrate/scripts/human_review_gate.mjs"
1562
+ runner: node
1563
+ # Same gate, same checkpoint: kept consistent with review.spec_gen (--assert-ready only checks the summary).
1564
+ args: "--gate spec_gen --specs-json ${SPEC_DIR}/specs.json --checkpoint ${CHECKPOINT_DIR}/spec-gen-reviewed.ok --assert-ready"
1565
+ exit_nonzero: hard_stop
1566
+ skip_if: "${SKIP_LOGIC} or ${SKIP_SPEC_GENERATE}"
1567
+ actions:
1568
+ # User explicitly provided specs_json (SPECS_JSON_IS_DEFAULT=false) -> SPECS_JSON keeps the user's path and must not be changed back to the default;
1569
+ # otherwise adopt the ${SPEC_DIR}/specs.json produced by enrich.spec_gen.
1570
+ - adopt_batch_specs_json: { default: "${SPEC_DIR}/specs.json", set: SPECS_JSON, keep_if: "${SPECS_JSON_IS_DEFAULT} == false" }
1571
+ - freeze_order: true
1572
+ success:
1573
+ - file_exists: "${SPECS_JSON}"
1574
+ invoke: null
1575
+
1576
+ - id: logic.spec_pipeline
1577
+ lane: logic
1578
+ type: skill
1579
+ skill: a2h-spec-design-pipeline
1580
+ user_facing:
1581
+ announce: always
1582
+ name: Business logic
1583
+ doing: "Writing the business logic into the HarmonyOS project from the feature list and trying to build it. This step runs in batches. Pausing midway to wait for a batch to finish is normal and does not mean everything is over."
1584
+ done: "The business logic step has finished. Of {specs_total} specs, {specs_done} done and {specs_failed} failed. Of {groups_total} groups, {groups_done} done and {groups_failed} failed. Build result is {final_build} (only SUCCESS counts as a successful build; PARTIAL does not)."
1585
+ failed: "The business logic was not all written: {reason}. The parts already written into the project are still there. The wrap-up report lists the unfinished groups."
1586
+ reused: "The business logic was not rewritten this round; the result from the previous round is reused."
1587
+ skipped: "No business logic this round."
1588
+ # Always inline: B1/B2 are an event loop of background dispatch + waiting for notifications;
1589
+ # as soon as a Task sub-agent finishes, the round exits and nobody receives the completion notifications of background chunks (merges / builds / later waves are all lost).
1590
+ # There is no parallelizable node before or after this one (needs adopt.specs_json; the only successor is logic.finalize), so Task buys no parallelism.
1591
+ dispatch: primary_skill_inline
1592
+ needs: [adopt.specs_json, adopt.signing]
1593
+ skip_if: "${SKIP_LOGIC} or ${SKIP_LOGIC_PIPELINE} or ${REUSE_LOGIC_PIPELINE} == true"
1594
+ # Before this node **actually executes**: archive only on a hard fingerprint mismatch (exit 4) or all failed (exit 3).
1595
+ # exit 4: specs.json content / hard paths differ from this round -> without archiving, pipeline I1 also aborts and every later round gets stuck.
1596
+ # exit 3: all groups failed -> resuming as is would only rerun smoke + Finalization; a retry must start a new round.
1597
+ # exit 1 (unfinished) / 0 (finished) / 2 (no state): archiving is **forbidden** — unfinished is handed to the leaf's Mid-flight to continue;
1598
+ # soft knob drift only warns in JSON.soft_stale, never raises exit 4, and never triggers archiving in this step.
1599
+ before_run:
1600
+ - archive_stale_campaign:
1601
+ script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs"
1602
+ runner: node
1603
+ args: "--state ${HMOS}/.hometrans/spec_pipeline_state.json --specs-json ${SPECS_JSON} --android ${ANDROID} --design-dir ${DESIGN_DIR} --wave-width ${WAVE_WIDTH} --max-scenarios-per-chunk ${MAX_SCENARIOS_PER_CHUNK} --engine-mode ${ENGINE_MODE} --archive-stale --archive-failed"
1604
+ exit_4: "archived (hard fingerprint mismatch): tell the user JSON.stale and JSON.archived and record them in the ledger, then run this node as usual (new round)"
1605
+ exit_3: "archived (all groups failed in the previous round): tell the user JSON.archived and record it in the ledger, then run this node as usual (new round)"
1606
+ exit_1: "unfinished campaign: deleting state / treating it as a new campaign is forbidden; if there is JSON.soft_stale tell the user and continue, handing over to the leaf's Mid-flight"
1607
+ exit_other: continue
1608
+ reads: { specs: "${SPECS_JSON}", android: "${ANDROID}", hmos: "${HMOS}" }
1609
+ writes:
1610
+ state: "${HMOS}/.hometrans/spec_pipeline_state.json"
1611
+ archive: "${HMOS}/.hometrans/spec_pipeline_archive/"
1612
+ design: "${DESIGN_DIR}/"
1613
+ resume_summary: "${RESUME_SUMMARIES_DIR}/logic.spec_pipeline.json" # derived when recording the ledger
1614
+ # state exists from I1 on, so the file alone is not enough; check script exit 0 = all groups done|failed and no pending/in_flight chunk,
1615
+ # and the state belongs to this round's inputs (with the same set of comparison arguments, so an old campaign's state cannot pose as this round's result).
1616
+ success:
1617
+ - any:
1618
+ - all:
1619
+ - file_exists: "${HMOS}/.hometrans/spec_pipeline_state.json"
1620
+ - script_exit_0: { runner: node, script: "${SKILLS_ROOT}/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs", args: "--state ${HMOS}/.hometrans/spec_pipeline_state.json --specs-json ${SPECS_JSON} --android ${ANDROID} --design-dir ${DESIGN_DIR} --wave-width ${WAVE_WIDTH} --max-scenarios-per-chunk ${MAX_SCENARIOS_PER_CHUNK} --engine-mode ${ENGINE_MODE}" }
1621
+ - skipped: true
1622
+ invoke: |
1623
+ Context budget, context window, remaining tokens, a growing session or imminent compaction are not reasons to finish (policy.context_budget).
1624
+ [Precondition] adopt.signing's terminal state is failed (signing missing) -> handle by device scope (signing is gated only at the entry; the pipeline does not require it):
1625
+ `hdc list targets` are all `127.0.0.1:` (emulators only) -> run as usual (unsigned build; emulators can install it);
1626
+ a real device or no HarmonyOS device -> do not run; { "ok": false, "note": "signing missing: <reason>" } (soft_continue).
1627
+ [dispatch] see policy.dispatch_inline; the extra reason this node must be inline is in the node comment (B1/B2 wait for notifications).
1628
+ skill name: a2h-spec-design-pipeline (path `${SKILLS_ROOT}/a2h-spec-design-pipeline`).
1629
+ [Inline arguments]
1630
+ ${SPECS_JSON} ${ANDROID} ${HMOS} ${DESIGN_DIR}
1631
+ --engine-mode ${ENGINE_MODE}
1632
+ --wave-width ${WAVE_WIDTH}
1633
+ --max-scenarios-per-chunk ${MAX_SCENARIOS_PER_CHUNK}
1634
+ [--deveco-home ${DEVECO_HOME} only when non-empty] # adopted directly by I2; the B3 / Finalization builds all use it
1635
+ Depth: the pipeline itself is at depth 0; the design / coding / review / conflict-resolution sub-agents it dispatches are at depth 1.
1636
+ Event loop: after B1/B2 dispatch background chunks, the pipeline **ends the round** per its own protocol to wait for completion notifications — this is normal,
1637
+ not the end of the node. After being woken by a notification, continue the pipeline's event loop (handle the notification, dispatch the next chunk, pop the merge queue);
1638
+ do **not** return to migrate scheduling, do **not** judge this node as success or failure, and do **not** start logic.finalize.
1639
+ Return to migrate scheduling only after the pipeline has completed all waves + the smoke gate + Finalization (outputting the final report).
1640
+ Interaction (subject to ${INTERACTION_MODE}):
1641
+ · I4 announcement: under interactive, give the user the usual window to correct the wiring list; under auto only announce, without waiting.
1642
+ · Whether the homegraph CLI exists is already Hard-Stopped in the bootstrap preflight; this node no longer treats "command not found" as degradable.
1643
+ · Other I2 items that need the user's decision: under auto continue with the safe default from the pipeline document and record it in the report;
1644
+ hard missing items (DEVECO_HOME / HMOS not git / Node version)
1645
+ under auto do not ask; end this node directly and return { "ok": false, "note": "<what is missing>" } (fail_matrix: soft_continue).
1646
+ · When the wrap-up cold-start smoke test hits login: auto records DEPLOY_ERROR in the final report; other questions follow policy.leaf_questions.
1647
+ Checkpoint resume: ${HMOS}/.hometrans/spec_pipeline_state.json (schema spec_pipeline_state/v2;
1648
+ groups[] + per-spec rows; design files SPEC_DESIGN_G<G>_c<k>.md).
1649
+ When FROM_NODE=logic.spec_pipeline (or probe 7 is unfinished and this node is entered again) and state still exists:
1650
+ deleting state / treating it as a new campaign is **forbidden**; inline the pipeline as usual and let its Mid-flight pick up the interrupted wave.
1651
+ Only an old campaign whose hard fingerprint changed is archived by before_run; when soft knobs (WAVE_WIDTH etc.) differ from state.config
1652
+ accept the soft_stale warning and continue; do not archive just to align the knobs.
1653
+ When finished, first run check_spec_pipeline_done.mjs to verify (see success): exit 0 -> success;
1654
+ exit 1 with reason Finalization unfinished -> go back to the pipeline to finish Finalization (including step 5 writing state.finalization), then verify again;
1655
+ other exit 1 (the pipeline stopped midway; JSON.unfinished lists the unfinished groups) / exit 2, and exit 3 (all groups failed)
1656
+ -> this node fails (soft_continue),
1657
+ passing the script's unfinished / reason to logic.finalize for the report. Then return to migrate scheduling,
1658
+ recording the summary:
1659
+ { "ok": true, "specs_total": N, "specs_done": M, "specs_failed": K,
1660
+ "groups_total": G, "groups_done": Gd, "groups_failed": Gf,
1661
+ "final_build": "SUCCESS|PARTIAL (taken from state.finalization.final_build, the same value as the pipeline's report template; only SUCCESS counts as a successful build)" }.
1662
+
1663
+ - id: logic.finalize
1664
+ lane: finalize
1665
+ type: local
1666
+ needs: [logic.spec_pipeline]
1667
+ summary: summary report + final build fallback
1668
+ user_facing:
1669
+ announce: always
1670
+ name: Migration report
1671
+ doing: "Summarizing this round's migration results. The HarmonyOS project will be built once more if needed."
1672
+ done: "The report for this round's migration is written: logic-convert-report.md in the workspace. The build verdict and whether UI conversion and the feature list have gaps are all in this report."
1673
+ failed: "The wrap-up report was not finished: {reason}."
1674
+ invoke: |
1675
+ Present to the user per policy.user_facing: send user_facing.doing when starting, user_facing.done when written, user_facing.failed when it cannot be written.
1676
+ The report body is still written in full per steps 1–4 below. Stage names use each user_facing.name (UI conversion, feature list, module notes, business logic, signing), not node ids.
1677
+ 1. Final build fallback — run only when needed, and never leave uncommitted changes in the workspace
1678
+ 0. logic.spec_pipeline was skipped this round (${SKIP_LOGIC} / ${SKIP_LOGIC_PIPELINE} / ${REUSE_LOGIC_PIPELINE} == true / ${PROFILE} == ui-only) ->
1679
+ **no build, no commit**: this round has no logic changes to fall back on (the UI chain's ui.batch built by itself); when reused, the build was already done in
1680
+ the round that produced it. The report says "No business logic was written this round, so no extra build was done." and goes straight to step 2.
1681
+ (spec-design-pipeline's W0 requires a clean trunk: **any** uncommitted change stops it directly; only on Mid-flight re-entry, when all dirty files are
1682
+ wiring files, are they committed as the interrupted wiring. Leaving changes behind would block the next resume):
1683
+ ★ First run check_spec_pipeline_done.mjs (same arguments as logic.spec_pipeline's success): exit 1 with a non-empty JSON.unfinished
1684
+ (some group / chunk is still unfinished — the pipeline stopped midway) -> **no build, no commit**: these groups still have to merge on the next resume,
1685
+ and if build-fixer first stubs or changes the symbols they are to deliver and commits to the trunk, the merge will certainly conflict. The report says "The business logic is not finished yet (N groups still unfinished), so the final build was not done. Running the migration again will continue from here." and goes straight to step 2.
1686
+ a. logic.spec_pipeline succeeded (check_spec_pipeline_done.mjs exit 0) and state.finalization.final_build == SUCCESS ->
1687
+ **skip**: the pipeline's Finalization just built it and committed the fixes as `build fix`. The report says "The business logic step already built successfully."
1688
+ b. Otherwise (groups all terminal but the pipeline failed / not run because signing is missing / final_build is not SUCCESS) first look at `git -C ${HMOS} status --porcelain`:
1689
+ · non-empty -> **do not run** the fixer (to avoid mixing changes of unknown origin with the fixes); the report lists these uncommitted files;
1690
+ · empty -> run a2h-fix-build-errors on ${HMOS} (passing DEVECO_HOME as deveco_studio_path when non-empty); if there are changes afterwards,
1691
+ `git -C ${HMOS} add -A && git -C ${HMOS} commit -m "build fix (app-migrate finalize)"`.
1692
+ · ${HMOS} is not a git repo -> run the fixer as usual without committing, and note it in the report.
1693
+ c. The report writes one line with the build verdict, using one of these plain sentences: the business logic step already built successfully / build passed / build passed after fixes (with commit hash) / build still fails / the workspace has uncommitted changes, so no build was done.
1694
+ 2. Add a "Business logic" section to the report, first split into three cases by how logic.spec_pipeline was handled this round:
1695
+ · skipped (${SKIP_LOGIC} or ${SKIP_LOGIC_PIPELINE} or ${PROFILE} == ui-only) -> **do not read** spec_pipeline_state.json / design_map.md /
1696
+ claim_audit.json: they were left by some earlier round and are not this round's results. The report says "No business logic was written this round.";
1697
+ when the state file exists add only the sentence "There is an earlier progress record; it is not this round's result and is not included in this report".
1698
+ · reused (${REUSE_LOGIC_PIPELINE} == true) -> read as usual (probe 7 already verified that it belongs to this round's inputs),
1699
+ and note "reused from the previous round" in the section title.
1700
+ · ran this round -> read as usual.
1701
+ What is read: ${HMOS}/.hometrans/spec_pipeline_state.json (v2: groups[] status
1702
+ pending|coded|merged|done|failed; specs[] status/stage/design_file/commit),
1703
+ ${DESIGN_DIR}/design_map.md, and each wave's
1704
+ ${HMOS}/.hometrans/wave_*/claim_audit.json (if present), written into ${LOGIC_REPORT} (what to read is in stage-map.md).
1705
+ 3. Add a "UI conversion" section to the report: read ui_status /
1706
+ page statistics / reason from ${CHECKPOINT_DIR}/ui-batch-reviewed.ok (when skipped write "No UI conversion this round"); list failed steps with their user_facing.name and failed copy
1707
+ (policy.failure_semantics; the ledger still holds node ids, which are replaced by names when writing for the user):
1708
+ node ${SKILLS_ROOT}/a2h-app-migrate/scripts/ledger.mjs --ledger ${LEDGER} --failures
1709
+ — the ledger is kept across runs; only records after the last run_start count.
1710
+ Also add a "Feature list" section (when ${PROFILE} == ui-only write only "This round only did the UI; no feature list was written"):
1711
+ completeness / incomplete of ${SPEC_DIR}/specs.json (for incomplete-known list all of
1712
+ areas / failedShards / unresolved / unresolvedReasonCodes; when the field is missing or complete write "nothing missing").
1713
+ Publishing with holes must not be described as a complete page set; the gaps must go into the final report.
1714
+ 4. Return only ok|fail and the report path.
1715
+
1716
+ schedule_hint:
1717
+ # discover_par conditional parallelism and the scaffold_new serial fallback are in policy.parallel_rule; not repeated here.
1718
+ # The parallel: entries below keep the maximum-parallel shape for validate_workflow.mjs's disk-write race check;
1719
+ # the actual post_utg scheduling is fixed serial (no SCHEDULE_MODE) and never runs in parallel according to these entries.
1720
+ - bootstrap
1721
+ - discover.android_index
1722
+ - parallel: [boot.workspace, discover.arch]
1723
+ - discover.utg_static
1724
+ - review.arch
1725
+ - discover.utg_snapshot
1726
+ # Actual order: ui.batch -> enrich.spec_gen. The parallel shape is only for the maximum-parallel race check.
1727
+ - parallel: [ui.batch, enrich.spec_gen]
1728
+ # Actual order follows needs / parallel_rule (module_docs comes after enrich.spec_gen).
1729
+ - parallel: [review.spec_gen, review.ui_batch, enrich.module_docs]
1730
+ - barrier.l2_enrich
1731
+ - parallel: [adopt.signing, adopt.specs_json]
1732
+ - logic.spec_pipeline
1733
+ - logic.finalize
1734
+
1735
+ # Every node must be listed here — a missing entry leaves the executor with no basis for handling a failure.
1736
+ fail_matrix:
1737
+ bootstrap: hard_stop
1738
+ boot.workspace: hard_stop
1739
+ discover.android_index: hard_stop # utg_static / ui.batch Step 3.1 / spec_gen all read it
1740
+ discover.arch: hard_stop
1741
+ discover.utg_static: hard_stop
1742
+ review.arch: hard_stop # ui.batch / spec_gen must not start before the architecture is confirmed
1743
+ discover.utg_snapshot: hard_stop # without the snapshot spec_gen has no stable UTG input
1744
+ enrich.spec_gen: hard_stop_unless_logic_skipped # default engine: only ok:false fails (publishing with holes is legal); page-specgen: any finalize gate failure is ok:false (no publishing with holes)
1745
+ review.spec_gen: hard_stop_unless_logic_skipped
1746
+ ui.batch: soft_continue
1747
+ review.ui_batch: hard_stop # must not enter barrier / logic before the UI gate is confirmed; UI failure goes --upstream-failed and does not trigger this entry
1748
+ enrich.module_docs: soft_continue # semantic docs are auxiliary artifacts; missing them does not block the logic chain
1749
+ barrier.l2_enrich: hard_stop
1750
+ adopt.signing: soft_continue # signing missing -> with emulators only the pipeline still runs; with a real device / no device it does not run and finalize reports it
1751
+ adopt.specs_json: hard_stop_unless_logic_skipped
1752
+ logic.spec_pipeline: soft_continue # go to finalize for the report, making it easy to locate the failed spec
1753
+ logic.finalize: soft_continue
1754
+
1755
+ observability:
1756
+ ledger: "${LEDGER}"
1757
+ manifest: "${MANIFEST}"
1758
+ # The two per-item progress files are maintained by the leaf skills themselves (the orchestrator only reads, never writes).
1759
+ ui_progress: "${HMOS}/.hometrans/batch_progress.json" # a2h-batch-ui-align; pages{} per page pending|done|failed
1760
+ logic_state: "${HMOS}/.hometrans/spec_pipeline_state.json" # a2h-spec-design-pipeline v2; groups[] pending|coded|merged|done|failed; specs[] keeps status/stage(A|B|B2|C)/design_file/commit