@buaa_smat/hometrans 26.0.3 → 26.0.4

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 (750) hide show
  1. package/README.md +1 -1
  2. package/agents/code-reviewer.md +91 -21
  3. package/env-requirements.json +1 -1
  4. package/i18n/agents/code-reviewer.md +93 -21
  5. package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
  6. package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  7. package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
  8. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
  9. package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
  10. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
  11. package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
  12. package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
  13. package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
  14. package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
  15. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
  16. package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
  17. package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
  18. package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
  19. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
  20. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
  21. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
  22. package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
  23. package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
  24. package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
  25. package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
  26. package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
  27. package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
  28. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
  29. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
  30. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
  31. package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
  32. package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
  33. package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
  34. package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
  35. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  36. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
  37. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
  42. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
  43. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  44. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
  45. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  46. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
  47. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
  48. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
  49. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
  50. package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  51. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
  52. package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
  53. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
  54. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  55. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
  56. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
  57. package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
  58. package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  59. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
  60. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  61. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  79. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
  80. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  81. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  82. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  83. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
  84. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  85. package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  86. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
  87. package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
  88. package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
  89. package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
  90. package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
  91. package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  92. package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
  93. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  94. package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
  95. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
  96. package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
  97. package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
  98. package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
  99. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
  100. package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
  101. package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
  102. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  103. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  104. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  105. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  106. package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  107. package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
  108. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
  109. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
  110. package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
  111. package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
  112. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
  113. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  114. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
  115. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  116. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  117. package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  118. package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
  119. package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  120. package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  122. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
  123. package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
  124. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
  125. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
  126. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
  127. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
  128. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
  129. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
  131. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  132. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  133. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  134. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
  135. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  136. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
  137. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
  138. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
  139. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
  140. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  141. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  142. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  143. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  144. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  145. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
  146. package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  147. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  148. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
  149. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
  150. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
  151. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
  152. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
  153. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
  154. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
  155. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
  156. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
  157. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
  158. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
  159. package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  160. package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
  161. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
  162. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  163. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  164. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  165. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  166. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  167. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  168. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  169. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  170. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  171. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  172. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  173. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
  174. package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
  175. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
  176. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  177. package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
  178. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
  179. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  180. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  181. package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
  182. package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
  183. package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
  184. package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
  185. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  186. package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
  187. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  188. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  189. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  190. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
  191. package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
  192. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
  193. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
  194. package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
  195. package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
  196. package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  197. package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  198. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
  199. package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  200. package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  201. package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
  202. package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
  203. package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  204. package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  205. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  206. package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  207. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
  208. package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  209. package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  210. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
  211. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
  212. package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
  213. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
  214. package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
  215. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  216. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
  217. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
  218. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
  219. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
  220. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  221. package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
  222. package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
  223. package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
  224. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
  225. package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  226. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  227. package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  228. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
  229. package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  230. package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
  231. package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
  232. package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  233. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  234. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  235. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
  236. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  237. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
  238. package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
  239. package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
  240. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
  241. package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  242. package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  243. package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  244. package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  245. package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  246. package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
  247. package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  248. package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  249. package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  250. package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
  251. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
  252. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  253. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
  254. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  255. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
  256. package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  257. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  258. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
  259. package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  260. package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
  261. package/package.json +3 -6
  262. package/skills/a2h-app-migrate/SKILL.md +19 -11
  263. package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  264. package/skills/a2h-app-migrate/references/stage-map.md +2 -2
  265. package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
  266. package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
  267. package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
  268. package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
  269. package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
  270. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
  271. package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
  272. package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
  273. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
  274. package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
  275. package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
  276. package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
  277. package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
  278. package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
  279. package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
  280. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
  281. package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
  282. package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
  283. package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
  284. package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
  285. package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
  286. package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
  287. package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
  288. package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
  289. package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
  290. package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
  291. package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
  292. package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
  293. package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
  294. package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
  295. package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
  296. package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
  297. package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
  298. package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
  299. package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
  300. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
  301. package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
  302. package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
  303. package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
  304. package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
  305. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
  306. package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
  307. package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
  308. package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
  309. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  310. package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
  311. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
  312. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
  313. package/skills/a2h-arch-generate/SKILL.md +20 -17
  314. package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
  315. package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
  316. package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
  317. package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
  318. package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
  319. package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
  320. package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
  321. package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
  322. package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
  323. package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
  324. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
  325. package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
  326. package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
  327. package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
  328. package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
  329. package/skills/a2h-batch-ui-align/SKILL.md +72 -22
  330. package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
  331. package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  332. package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
  333. package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  334. package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
  335. package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
  336. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  337. package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
  338. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
  339. package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
  340. package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  341. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
  342. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  343. package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
  344. package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
  345. package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
  346. package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
  347. package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  348. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
  349. package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
  350. package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
  351. package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
  352. package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
  353. package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
  354. package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
  355. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
  356. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
  357. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  358. package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
  359. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
  360. package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
  361. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
  362. package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
  363. package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
  364. package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
  365. package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
  366. package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  367. package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
  368. package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
  369. package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
  370. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
  371. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
  372. package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  373. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  374. package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  375. package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  376. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  377. package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  378. package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  379. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  380. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  381. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
  382. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  383. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  384. package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
  385. package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  386. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  387. package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  388. package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  389. package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  390. package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  391. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
  392. package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  393. package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  394. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
  395. package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
  396. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
  397. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
  398. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
  399. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  400. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
  401. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  402. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
  403. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
  404. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
  405. package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  406. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
  407. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
  408. package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
  409. package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
  410. package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
  411. package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
  412. package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
  413. package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
  414. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
  415. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
  416. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
  417. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
  418. package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
  419. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
  420. package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
  421. package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
  422. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
  423. package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
  424. package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
  425. package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
  426. package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
  427. package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
  428. package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
  429. package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
  430. package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  431. package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
  432. package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  433. package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
  434. package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
  435. package/skills/a2h-page-specgen/SKILL.md +124 -20
  436. package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
  437. package/skills/a2h-page-specgen/references/body-language.md +11 -9
  438. package/skills/a2h-page-specgen/references/evidence.md +35 -0
  439. package/skills/a2h-page-specgen/references/execution-model.md +135 -26
  440. package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
  441. package/skills/a2h-page-specgen/references/gates.md +120 -52
  442. package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
  443. package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
  444. package/skills/a2h-page-specgen/references/spec-example.md +312 -0
  445. package/skills/a2h-page-specgen/references/spec-template.md +112 -109
  446. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  447. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  448. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  449. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  450. package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
  451. package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  452. package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
  453. package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
  454. package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
  455. package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
  456. package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
  457. package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
  458. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
  459. package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
  460. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  461. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
  462. package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  463. package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  464. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
  465. package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
  466. package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  467. package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
  468. package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
  469. package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
  470. package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  471. package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
  472. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  473. package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
  474. package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
  475. package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
  476. package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
  477. package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
  478. package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
  479. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
  480. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
  481. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
  482. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
  483. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
  484. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
  485. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
  486. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
  487. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  488. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  489. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  490. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
  491. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  492. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
  493. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
  494. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
  495. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
  496. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
  497. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  498. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  499. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  500. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  501. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  502. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
  503. package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  504. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  505. package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
  506. package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
  507. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
  508. package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
  509. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
  510. package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
  511. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
  512. package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
  513. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
  514. package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
  515. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
  516. package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  517. package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
  518. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
  519. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
  520. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
  521. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
  522. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
  523. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
  524. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
  525. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
  526. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
  527. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
  528. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
  529. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
  530. package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
  531. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
  532. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
  533. package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
  534. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  535. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  536. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  537. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  538. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  539. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  540. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  541. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  542. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  543. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  544. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  545. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
  546. package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
  547. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
  548. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  549. package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
  550. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
  551. package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  552. package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  553. package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
  554. package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
  555. package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
  556. package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
  557. package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
  558. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
  559. package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
  560. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  561. package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
  562. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  563. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  564. package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
  565. package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  566. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
  567. package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
  568. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
  569. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
  570. package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
  571. package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
  572. package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
  573. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
  574. package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  575. package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
  576. package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  577. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
  578. package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  579. package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  580. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
  581. package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
  582. package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
  583. package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
  584. package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
  585. package/skills/a2h-resource-convert/SKILL.md +9 -1
  586. package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  587. package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  588. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  589. package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  590. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
  591. package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
  592. package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
  593. package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
  594. package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  595. package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
  596. package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
  597. package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
  598. package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
  599. package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  600. package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
  601. package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
  602. package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
  603. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
  604. package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
  605. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
  606. package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
  607. package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
  608. package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
  609. package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
  610. package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  611. package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
  612. package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
  613. package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
  614. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
  615. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
  616. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
  617. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
  618. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
  619. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
  620. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
  621. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
  622. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
  623. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
  624. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
  625. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
  626. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
  627. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
  628. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
  629. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
  630. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
  631. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
  632. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
  633. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
  634. package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
  635. package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
  636. package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
  637. package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
  638. package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
  639. package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
  640. package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
  641. package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
  642. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
  643. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
  644. package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
  645. package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
  646. package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
  647. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
  648. package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
  649. package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
  650. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
  651. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
  652. package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
  653. package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
  654. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
  655. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
  656. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
  657. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
  658. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
  659. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
  660. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
  661. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
  662. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
  663. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
  664. package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
  665. package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
  666. package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
  667. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  668. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
  669. package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
  670. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
  671. package/skills/a2h-spec-generate/SKILL.md +2 -2
  672. package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
  673. package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
  674. package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
  675. package/skills/a2h-utg-explorer/SKILL.md +9 -3
  676. package/skills/a2h-utg-explorer/references/architecture.md +3 -0
  677. package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
  678. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
  679. package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
  680. package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  681. package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
  682. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  683. package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
  684. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
  685. package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
  686. package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  687. package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
  688. package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
  689. package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
  690. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
  691. package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
  692. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
  693. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  694. package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
  695. package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
  696. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
  697. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
  698. package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
  699. package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
  700. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
  701. package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
  702. package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  703. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
  704. package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  705. package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  706. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
  707. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  708. package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
  709. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
  710. package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
  711. package/skills/a2h-utg-static/SKILL.md +6 -2
  712. package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
  713. package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
  714. package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  715. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
  716. package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  717. package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  718. package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  719. package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  720. package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
  721. package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  722. package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  723. package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  724. package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
  725. package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
  726. package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
  727. package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
  728. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
  729. package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  730. package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
  731. package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
  732. package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  733. package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
  734. package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
  735. package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  736. package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
  737. package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
  738. package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
  739. package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
  740. package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
  741. package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  742. package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
  743. package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  744. package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
  745. package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
  746. package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
  747. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
  748. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
  749. package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
  750. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
@@ -5,10 +5,10 @@ description: "Grouped Android→HarmonyOS migration orchestrator driven by a spe
5
5
 
6
6
  # a2h-spec-design-pipeline — grouped parallel "design → convert" pipeline
7
7
 
8
- This skill is a thin **orchestrator**. It owns no conversion logic of its own; it groups a `specs.json` list into page-level **groups** (one group per spec-file parent directory) and runs a single **wave loop** until no groups remain. Each wave runs S0 → W0 → B1⇄B2 → B3 → B4 → B5 → C:
8
+ This skill is a thin **orchestrator**. It owns no conversion logic of its own; it groups a `specs.json` list into page-level **groups** (one group per spec-file parent directory) and runs a single **wave loop** until no groups remain. Each wave runs S0 → F0 → W0 → B1⇄B2 → B3 → B4 → B5 → C:
9
9
 
10
- 1. **S0 — slice this wave.** `scripts/plan_waves.ts` (incremental: each call assigns the next wave) slices the wave with a **deps-aware backfill** scan in group order (full algorithm at S0); when the deps forecast for the remaining pool implies more than 2× the width-bound ideal dispatch rounds (coder concurrency collapse), it slices **flat** instead — pure group order, `mode: "flat"` on the wave entry, and `deps_ready.ts` releases every member (deps stop shaping concurrency; conflicts surface as B2 merge work). Wave numbers are not monotone in group order.
11
- 2. **W0 → B1⇄B2 → … → C — execute the wave.** Background parallel coding (one isolated git worktree per group; chunks chain serially per group; deps-unsatisfied members held and released as their deps merge — dispatch-hold, `deps_ready.ts`) interleaved with a **serial merge queue** (a group merges the moment its coding completes; every landing a main-side `--no-ff` merge commit; bounded conflict-recovery ladder) → actual-write audit → wiring application → **one** build → per-group parallel reviews + bounded fix rounds → **one** semantic-docs refresh → per-group marker commits. Design is generated per chunk inside B1.
10
+ 1. **S0 — slice this wave** with `scripts/plan_waves.ts` (incremental; deps-aware backfill, flat fallback; details at S0). Wave numbers are not monotone in group order.
11
+ 2. **F0 → W0 → B1⇄B2 → … → C — pre-seed the shared layer, then execute the wave** (each stage below owns its details: worktrees, parallel chunked coding with a serial merge queue, one build, parallel review with bounded fix rounds, one docs refresh, per-group finalize).
12
12
 
13
13
  Deterministic precomputation lives in the scripts (inventory: `references/scripts.md`); the orchestrator runs them and reads their JSON — it never re-derives paths or counts by hand.
14
14
 
@@ -16,21 +16,24 @@ Deterministic precomputation lives in the scripts (inventory: `references/script
16
16
 
17
17
  | File | Owns | Read |
18
18
  |---|---|---|
19
- | `references/initialization.md` | I1–I4: input validation, the `plan_groups.ts` + `resolve_wiring.ts` precompute, environment prerequisites, one-time setup, announcement | at run start |
20
- | `references/coding-loop.md` | B1: chunk pointers, the dispatch ledger protocol, the spec §11 event loop, the turn-end sequence + guard, waker wakeup disposal, the chunk dispatch contract | before entering the wave loop |
21
- | `references/merge-queue.md` | B2: the actual-write audit, serial generation-branch landing, the conflict recovery ladder, the wave-end wiring application | whenever a merge is enqueued, popped, or conflicts |
22
- | `references/state-and-resume.md` | mid-flight detection, `runId` + reconcile, one-way state repair, the state schema / atomic-write / `.bak` restore rules | on any resume or state restore |
23
- | `references/execution-model.md` | the ledger contract: events, identity/CAS, the state machine, timeouts/`runId`, reconcile, `wait`/waker discipline | on every wakeup |
24
- | `references/legacy-cleanup.md` | one-time runtime cleanup on resume (retired `.hometrans` dispatch files) | once before the first `init --new-run` |
19
+ | `references/initialization.md` | I1–I4 (inputs, precompute, prerequisites, setup, announcement) | at run start |
20
+ | `references/shared-layer.md` | F0 trigger, prompt, manifest/validation, docs commit, fail-soft | before F0 |
21
+ | `references/coding-loop.md` | B1 (chunk pointers, ledger protocol, event loop, guard, chunk contract) | before the wave loop |
22
+ | `references/merge-queue.md` | B2 (audit, landing, recovery ladder, wiring) | on enqueue/pop/conflict |
23
+ | `references/review-loop.md` | B4 (review set, reviewer batch, evidence check, fix rounds, rebuild) | before each wave's first review round |
24
+ | `references/state-and-resume.md` | mid-flight, `runId`/reconcile, state schema/atomic/`.bak` | on resume/restore |
25
+ | `references/execution-model.md` | ledger contract (events, CAS, state machine, waker) | on every wakeup |
26
+ | `references/legacy-cleanup.md` | retired dispatch-runtime cleanup | before first `--new-run` |
25
27
  | `references/scripts.md` | script + test inventory | as needed |
26
- | `references/static-defect-gate.md` | Homecheck static-defect check and repair | before the smoke gate |
27
- | `references/final-report-template.md` | the Finalization summary report template | at Finalization |
28
+ | `references/post-loop.md` | after the wave loop: Homecheck → smoke gate → Finalization, with their markers | after the last wave |
29
+ | `references/static-defect-gate.md` | Homecheck static-defect gate | before smoke |
30
+ | `references/final-report-template.md` | Finalization summary template | at Finalization |
28
31
 
29
- **Execution model — every stage runs in an isolated sub-agent** (details at I5): the orchestrator parses compact JSON results, runs the scripts and git/worktree bookkeeping itself, and dispatches the next stage. B1's chunk agents and B2's conflict resolvers are the only **background mode** dispatches; all user interaction is confined to **Initialization** — once the wave loop starts the run is autonomous (per-group failures logged, never paused). Background completion notifications are the run's only immediate wakeup source, and one that never arrives strands the whole wave — so every background dispatch is claimed on the on-disk **dispatch ledger** (`dispatch.mjs`) before it leaves, and a durable **waker** (`dispatch.mjs waker`) holds a wakeup independently of any notification (full discipline: `references/execution-model.md`).
32
+ **Execution model — every stage runs in an isolated sub-agent** (details at I5): the orchestrator parses compact JSON results, runs the scripts and git/worktree bookkeeping itself, and dispatches the next stage. Only B1 chunk agents and B2 conflict resolvers are background dispatches; user interaction is confined to Initialization — after I4 the run is autonomous (per-group failures logged, never paused). Background completion notifications are the run's only immediate wakeup source, and one that never arrives strands the whole wave — so every background dispatch is claimed on the on-disk **dispatch ledger** (`dispatch.mjs`) before it leaves, and a durable **waker** (`dispatch.mjs waker`) holds a wakeup independently of any notification (discipline: `references/execution-model.md`).
30
33
 
31
- **Scope — spec logic, not UI rendering.** This pipeline migrates **behavioral specs** (ViewModels, services, repositories, data entities, DB/Preferences access, navigation wiring); it does not synthesize ArkUI page layouts (use `a2h-ui-spec-pipeline` / `a2h-batch-ui-align` for that). Each group's `ui_sequence`s serve as navigation/ownership context only.
34
+ **Scope — spec logic, not UI rendering.** It migrates **behavioral specs** (ViewModels, services, repositories, data entities, DB/Preferences access, navigation wiring), not ArkUI page layouts (use `a2h-ui-spec-pipeline` / `a2h-batch-ui-align`); each group's `ui_sequence`s are navigation/ownership context only.
32
35
 
33
- > **Note on commits.** Coder sub-agents commit in their own worktree branches; the wave-end merge preserves those commits. The orchestrator adds: one `wiring` commit per wave, per-wave fix commits (build-fixer; the fix-mode code-reviewer commits its own `fix(review)` commits), and one marker commit per group — `group <G> (specs so-a..so-b)` — carrying that group's residual changes (the chunk designs and design_map.md are runtime artifacts and stay ignored).
36
+ > **Note on commits.** Coder sub-agents commit on their own worktree branches; the wave-end merge preserves them. The orchestrator adds one `wiring` commit per wave, per-wave fix commits (build-fixer; the fix-mode reviewer commits its own `fix(review)`), and one marker commit per group — `group <G> (specs so-a..so-b)` — carrying that group's residual changes (chunk designs and design_map.md are runtime artifacts, ignored).
34
37
 
35
38
  ## Inputs
36
39
 
@@ -47,6 +50,8 @@ Parse the arguments from the user's message (natural language is fine — no fix
47
50
  | `MAX_SCEN` | Max scenarios per coding chunk (spec atomic) | `32` |
48
51
  | `DEVECO_HOME` | `--deveco-home`: DevEco root for every build | env |
49
52
  | `IMAGE_READ` | `--image-read true\|false`: whether this host's sub-agents can read image files (a2h-app-migrate probes it at bootstrap). `false` → every sub-agent prompt carries the no-image rule of I5. Never probe it by opening an image in this session | `true` |
53
+ | `SHARED_LAYER` | `auto` (default) or `off`; persisted in `state.config.shared_layer` | `auto` |
54
+ | `SOURCE_KIND` | optional `android` (default) or `uniapp`; persisted in `state.config.source_kind`. No current caller passes it (`a2h-app-migrate` exports no `SOURCE_KIND` variable), so it defaults to `android` and only labels the F0 agent's source-evidence reading — scanning is project-neutral | `android` |
50
55
 
51
56
  ### specs.json format
52
57
 
@@ -57,7 +62,7 @@ The format is owned by the producing skill (`a2h-spec-generate`'s `publish-specs
57
62
  Apply **`references/initialization.md` verbatim** (its steps I1–I4 = the numbered steps 1–12). This is the run's **only** interactive window; everything after I4 is autonomous. The stages:
58
63
 
59
64
  - **I1 — inputs, grouping precompute, wiring surface.** `plan_groups.ts` (`--emit-state` on a fresh run; without it on a resume, where exit 3 = specs.json changed → stop) writes `spec_group_plan.json`, one `spec_group_<G>/merged_spec.md` per group, and — on a fresh run — the state seed; `resolve_wiring.ts` fills `state.config.wiring_files` (three tiers; skipped on a resume when the field already exists, so user corrections survive). Every later stage reads their JSON — never re-derive paths, counts, or membership by hand.
60
- - **I2 — environment prerequisites.** `DEVECO_HOME` resolving, `<HMOS>` a git repo, Node ≥ 22.18, the Homegraph engine runnable, the semantic docs (`project_design.md` required, `database_design.md` / `preferences_design.md` optional), Homecheck availability and rule sets, then `DOCS_MODE`, `STATE_DOCS_MODE`, `MVVM_MODE`, `MAX_ROUNDS_REVIEW`.
65
+ - **I2 — environment prerequisites.** `DEVECO_HOME` resolving, `<HMOS>` a git repo, Node ≥ 22.18, both HomeGraph indexes (`ensure_index.ts <ANDROID> --create --sync`, trigger `i2-android`, and `<HMOS> --create --sync`, trigger `i2-hmos`; `ENGINE_MODE=off` skips), the semantic docs (`project_design.md` required, `database_design.md` / `preferences_design.md` optional), Homecheck availability and rule sets, then `DOCS_MODE`, `STATE_DOCS_MODE`, `API_DOCS_MODE`, `MVVM_MODE`, `MAX_ROUNDS_REVIEW`.
61
66
  - **I3 — one-time setup.** Create `DESIGN_DIR`; `git_baseline.ts` (gitignores `.hometrans/` + `.homegraph/` and commits a fresh scaffold as `pre-campaign baseline` so W0 has a `WAVE_BASE` and a clean tree); seed the semantic-docs baseline once.
62
67
  - **I4 — announce, then commit to autonomous execution.** Announce the plan table, flags, warnings, the git baseline and the wiring-surface summary — the one window for user corrections — then no prompts and no mid-run branching (per-group failures are recorded and skipped).
63
68
 
@@ -65,15 +70,17 @@ Apply **`references/initialization.md` verbatim** (its steps I1–I4 = the numbe
65
70
 
66
71
  - Every sub-skill run happens in a **fresh sub-agent** via the `Agent` tool. The prompt must (1) name the sub-skill/agent and its exact inputs, (2) forbid asking back — on ambiguity take the documented safe default or return `{ "ok": false, "note": ... }`, (3) require the final message to be **only** a compact JSON object, (4) when `IMAGE_READ` is `false`, open with `Do not open any image file (.png/.jpg/.jpeg/.webp/.gif): image content crashes this host session; use view trees, measure files and source instead.` — this covers coders, resolvers, build-fixers, reviewers and the watchdog sentinel alike. A sub-agent that still dies on image content (`messages.content.type` invalid; it cannot be resumed) sets `IMAGE_READ=false` for the rest of the run (persist it in the state file) and is redispatched fresh with the rule; the final report says so.
67
72
  - Sub-skill SKILL.md text never enters this orchestrator's context during the wave loop (the exception: the runtime smoke gate, run by the orchestrator itself).
68
- - The orchestrator itself runs: the deterministic scripts (`plan_groups.ts`, `resolve_wiring.ts`, `git_baseline.ts`, `stage_design_inputs.ts`, `ensure_wt_index.ts`, `plan_waves.ts`, `deps_ready.ts`, `branch_landed.ts`, `resolver_prompt.ts`, `audit_claims.ts`, `dispatch.mjs` — the ledger's only writer), git/worktree/merge/wiring/commit bookkeeping, the B4 single-writer homegraph index sync of `<HMOS>` (the only `<HMOS>`-index write moment — each worktree's own index is built at creation by `ensure_wt_index.ts` and refreshed only on resume (W0 or mid-wave) and at hop (b); reviewers are read-only), state-file updates, dispatch discipline (including dispatching the post-loop Homecheck gate sub-agent and validating its JSON reply — the scan/fix/build-check work itself, `homecheck_scan.ts` included, belongs to that sub-agent), and the post-loop runtime smoke gate. Nothing else.
73
+ - The orchestrator itself runs: the deterministic scripts (`plan_groups.ts`, `resolve_wiring.ts`, `git_baseline.ts`, `stage_design_inputs.ts`, `ensure_index.ts`, `plan_waves.ts`, `scan_shared.ts`, `validate_shared_manifest.ts`, `deps_ready.ts`, `branch_landed.ts`, `resolver_prompt.ts`, `audit_claims.ts`, `dispatch.mjs` — the ledger's only writer), git/worktree/merge/wiring/commit bookkeeping, the single-writer HomeGraph index lifecycle of `<ANDROID>` (I2 only) and `<HMOS>` (I2, resume, W0, B2 landing, B2 hop-b, B3/build-breaker fix, B4 step 0/fix/rebuild, B5 — all via `ensure_index.ts`), state-file updates, dispatch discipline (including dispatching the post-loop Homecheck gate sub-agent and validating its JSON reply — the scan/fix/build-check work itself, `homecheck_scan.ts` included, belongs to that sub-agent), and the post-loop runtime smoke gate; nothing else. Coders, reviewers, fixers, resolvers and the semantic-docs sub-agent are read-only consumers of those indexes.
69
74
  - **Ledger + waker discipline.** Every background dispatch is `claim` → seed the foreground baseline → `intent` → Agent → `confirm` (the session id proves liveness); progress is `beat`; a completion is `artifact` + `submit` then `release`. Only `dispatch.mjs` writes the ledger. Before ending a turn with active units, run `dispatch.mjs probe`: `inPlace:false` (or a different `runId`) → arm the durable waker as one background sub-agent running `dispatch.mjs waker`; its `dispatch/waker.event.json` is consumed at the start of **every** turn (verify `runId`, delete after reading). Write `dispatch/waker.stop` on every terminal path — wave barrier, resume, abort, Finalization.
70
75
  - A returned sub-agent result — success or failure — is never a stop: parse it, persist it, dispatch the next.
71
76
 
72
77
  ## The wave loop
73
78
 
74
- **Mid-flight detection (resume into an interrupted wave).** Apply **`references/state-and-resume.md` → Mid-flight detection verbatim** before running S0. In short: a state group with `wave != null` and a status outside {done, failed} means the wave loop must be **re-entered**, not restarted — reset the dispatch run first (write `dispatch/waker.stop`, snapshot `dispatch/ledger.jsonl`, then `dispatch.mjs init --wave <K> --concurrency <WAVE_WIDTH> --new-run` — the genuine reset that gives the new session its own `runId`, archives the old pipeline state as the audit trail, and makes every old-run active unit dead-run on the first `reconcile`; a **normal later wave** is plain `init --wave <K>` under the same `runId` — see `references/legacy-cleanup.md` for the one-time runtime cleanup before that reset), then run `reconcile` and repair state one way before dispatching. Then branch on `wave_<K>/wave_meta.json`: absent → the crash happened before W0 — re-enter at W0 for exactly those members, then continue W0 onward; present → classify every recorded member (a done chunk with an empty `specs[].design_file` → backfill it from the design file first; no worktree → route by the `deps_ready.ts` verdict; merged → skip; coding incomplete → re-stage design inputs (`stage_design_inputs.ts`) and re-upsert its `design_map` row, then dispatch; coding complete and unmerged → enqueue its merge) and drain the B1⇄B2 event loop. **"Merged" is always `branch_landed.ts --wt-gen <wtGen>`**, never `merge-base --is-ancestor`.
79
+ **Mid-flight detection (resume into an interrupted wave).** Apply **`references/state-and-resume.md` → Mid-flight detection verbatim** before running S0. In short: a state group with `wave != null` and a status outside {done, failed} means the wave loop must be **re-entered**, not restarted — reset the dispatch run first (write `dispatch/waker.stop`, snapshot `dispatch/ledger.jsonl`, then `dispatch.mjs init --wave <K> --concurrency <WAVE_WIDTH> --new-run --resume` — a new `runId` that keeps the wave's merged / done / failed groups and the state, restarts the rest, and makes old-run active units dead-run on the first `reconcile`; a **normal later wave** is plain `init --wave <K>` under the same `runId` — see `references/legacy-cleanup.md` for the one-time runtime cleanup before that reset), then run `reconcile` and repair state one way before dispatching. Then branch on `wave_<K>/wave_meta.json`: absent → re-enter F0 idempotently (`shared_manifest.json` / `shared_inflight.json` / `campaign_id`), then W0 for the groups whose `state.wave == K`, then continue W0 onward; present → classify every recorded member (a done chunk with an empty `specs[].design_file` → backfill it from the design file first; no worktree → route by the `deps_ready.ts` verdict; merged → skip only when every planned chunk is `done`/`accepted` (a merged row with an open chunk is a premature landing → `group-reopen`); coding incomplete → re-stage design inputs (`stage_design_inputs.ts`) and re-upsert its `design_map` row, then dispatch; coding complete and unmerged → enqueue its merge) and drain the B1⇄B2 event loop. **"Merged" is always `branch_landed.ts --wt-gen <wtGen>`**, never `merge-base --is-ancestor`.
75
80
 
76
- Iterate waves until `plan_waves.ts` reports `{"wave": null, "done": true}` (no pending groups). **Skip any group already `done` or `failed`**. Each wave runs S0 → W0 → B1⇄B2 → B3 → B4 → B5 → C (B1 and B2 interleave: coding-completion events drive per-group chunk chaining and the serial merge queue).
81
+ Iterate waves until `plan_waves.ts` reports `{"wave": null, "done": true}` (no pending groups). **Skip any group already `done` or `failed`**. Each wave runs S0 → F0 → W0 → B1⇄B2 → B3 → B4 → B5 → C (B1 and B2 interleave: coding-completion events drive per-group chunk chaining and the serial merge queue).
82
+
83
+ **After the last wave: Homecheck → smoke gate → Finalization** — each writes a marker that Finalization step 0 requires (**After the wave loop** below; `references/post-loop.md`).
77
84
 
78
85
  ### S0 — Slice this wave (deterministic script, incremental)
79
86
 
@@ -96,6 +103,16 @@ Decision order: ineligible → skip; no same-wave deps → join; same-wave deps
96
103
 
97
104
  It appends the wave to `<HMOS>/.hometrans/spec_wave_plan.json` (schema `spec_wave_plan/v2` — waves only) and sets `state.groups[G].wave = k` for members. Announce this wave's members (G, group_id, per-group scenario totals) before W0. **Same-wave file overlaps are expected, not prevented** — they surface as merge work at B2 and as audit findings after the merge queue drains.
98
105
 
106
+ ### F0 — shared-layer pre-seeding
107
+
108
+ Before W0, run `node <skill-dir>/scripts/scan_shared.ts <HMOS> --wave <K>`. `SHARED_LAYER=off` → write a skipped manifest with `reason:"disabled"` and continue to W0 without scanning or dispatching. Scanner exit `2` (missing/unparseable input) → skipped manifest `reason:"failed:2"` and continue to W0 — no `PRE_F0` exists, so nothing to reset. `skip:true` → write the skipped manifest from `references/shared-layer.md` and continue to W0. Otherwise assert the main tree is clean, record `PRE_F0 = git rev-parse HEAD`, write `wave_<K>/shared_inflight.json` (`campaign_id`, `pre`, `wiring_files`, `wiring_compact`), and dispatch one foreground `general` sub-agent with `references/shared-layer.md`; resolve that prompt's `entry_module` / `entry_module_json5` / `entry_module_strings` fields from `build-profile.json5` (`type:"entry"`) before dispatch.
109
+
110
+ After it returns, apply the **reply-recovery protocol** there ("Reply recovery"): an unparseable reply resumes the same session at most twice, then falls back to the on-disk manifest/commit. Then branch on `wave_<K>/shared_manifest.json` status: `done` → run `node <skill-dir>/scripts/validate_shared_manifest.ts <HMOS> --wave <K> --base <PRE_F0>` (non-resume: `HEAD` must equal the F0 commit); `skipped` (including `declined:*`) → valid **only when the agent made no commit**: require `git rev-parse HEAD` == `PRE_F0`, record the reason, and continue to W0 without the done validator. A skipped manifest whose `HEAD` moved is an **unrecorded-commit anomaly** — not a skip and not a rollback case: record `failed:post_agent_commit`, restore the wiring snapshot, and **stop for manual recovery**; never reset or delete those commits. Any other post-agent failure with a recorded F0 commit → the **ownership-guarded rollback** in `references/shared-layer.md` (`git reset --hard PRE_F0` + `git clean -fd` only in the two recorded cases — `HEAD == commit`, or `HEAD == docs_commit` whose parent is `commit` — and only when every dirty path is F0's own; otherwise stop under the dirty-tree rule), restore `wiring_files`/`wiring_compact` from `shared_inflight.json`, write the skipped manifest, continue W0. On success: append the module's new barrel/wiring **and any `modules[].files` matching a wiring category** (`Index.ets`, the `getRdbStore` registration file, `module.json5`, `oh-package.json5`) to `state.config.wiring_files` + refresh `wiring_compact`. Before W0, if `database_design`/`preferences_design` resolved to a root-only file and `.hometrans/<name>.md` is missing, copy it verbatim into `.hometrans/` (independent of `DOCS_MODE`). Then run the docs-refresh procedure in `references/shared-layer.md` ("Docs refresh / visibility"): a `docs(wave K)` commit only when tracked `.hometrans` docs changed; `WAVE_BASE = docs_commit ?? infra commit`.
111
+
112
+ **Permissions ride along.** When F0 dispatches (this wave has shared candidates), the same agent also declares the permissions this wave's specs require in the **entry** module's `module.json5` (`requestPermissions` appended, never rewritten; the wave's specs gate the set and the source manifest only confirms it; every name is looked up in the framework docs (a Kit's `申请<能力>权限` page) and must exist in `references/permission-index.json`; `user_grant` entries with `reason` + `usedScene`) inside the same `infra(wave K)` commit — the pre-W0 window, so every coder starts from an already-declared module. A skipped F0 declares nothing: those permissions keep the B1 `add-permission` wiring-row path applied at B2. Runtime consent (`requestPermissionsFromUser`) stays the chunk coder's work, and every file edited for permissions is listed in the first `modules[]` entry's `wiring[]` (a reporting bucket, never an ownership claim).
113
+
114
+ See `references/shared-layer.md` for the authoritative prompt and manifest.
115
+
99
116
  ### W0 — Preconditions & worktrees
100
117
 
101
118
  1. Verify the main tree is clean (`git -C <HMOS> status --porcelain` empty). Dirty → **stop the run and report** (never auto-commit user changes; never ask mid-run).
@@ -103,13 +120,14 @@ It appends the wave to `<HMOS>/.hometrans/spec_wave_plan.json` (schema `spec_wav
103
120
  2b. Write `<HMOS>/.hometrans/wave_<K>/wave_meta.json` = `{ "wave": K, "wave_base": "<WAVE_BASE>", "groups": [<wave members>] }` (K = the wave number plan_waves just assigned) — the resume anchor for mid-wave crash recovery.
104
121
  2c. Run `node <skill-dir>/scripts/deps_ready.ts <HMOS> --wave <K>` — the wave's **dispatch-hold** verdicts (read-only): `verdicts` covers every still-`pending` member (`ready` = deps empty or all satisfied; `held` = waiting on unsatisfied deps, `behind` lists them all), `released` = ready members with no chunk dispatched yet. At W0 this is the **initial release set**. A member whose plan row carries no `deps` is always `ready` (plans predating the field behave exactly as before). Cycle edges (a dep pointing at a *later* group) are ignored and reported as `cycleEdgesIgnored` — record them in the wave log.
105
122
  2d. `node <skill-dir>/scripts/dispatch.mjs <HMOS> init --wave <K> --concurrency <WAVE_WIDTH>` — builds the wave's `plan` event from `spec_wave_plan.json` + `spec_group_plan.json` under the current `runId` (a genuine reset — never a normal wave — uses `--new-run`; a plan identical to the last one is a no-op).
123
+ 2e. **Sync the shared main index** (skip when `ENGINE_MODE=off`): `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `w0`). This covers F0's `infra` commit, the previous wave's C residual and any build-breaker fix, so every coder starts from an index matching `WAVE_BASE`. Exit 0 with `reason: "sync_incomplete"` → record a degraded refresh; exit 1 → record `action`/`reason`/`detail` in the wave log and continue under `auto` (`required` → hard stop). Circuit breaker: two consecutive non-`lock_busy` init/sync failures set `state.engine.hmos.degraded` and skip later syncs for the campaign (a resume or the next wave resets it).
106
124
  3. The wave's worktrees live under `WT = <HMOS>/../wt/<basename(HMOS)>` (per-project namespace; paths deliberately short — Windows MAX_PATH). Traverse **every** wave member (serially) — classification and cleanup are NOT limited to ready members — but **create** a worktree only for a `ready` member at generation `n` (a fresh campaign starts at `n=0`; a kept resumable generation keeps its `n`): `git -C <HMOS> worktree add WT/g<G>r<n> -b specpipe/g<G>r<n> <WAVE_BASE>` (delete a stale branch first: `git branch -D specpipe/g<G>r<n>` if it exists), then `dispatch.mjs group-worktree <G> --wt-gen <n> --base <WAVE_BASE>` — the only claim fence. A `held` member gets **no worktree at W0** — its worktree is created at release time from the then-current main HEAD (its coder starts from its deps' merged code). An existing worktree classifies with `git -C <worktree> log --oneline <WAVE_BASE>..HEAD`; removal is always `git -C <HMOS> worktree remove --force WT/g<G>r<wtGen>` (on failure `worktree prune` + retry once) + `git branch -D specpipe/g<G>r<wtGen>`:
107
125
  - **Held member** → **stale regardless of content** (a held member cannot hold a legal worktree of this campaign): remove, do not recreate.
108
126
  - **Empty output** → crashed-run leftover: remove, then recreate (ready members only).
109
- - **Non-empty, NOT merged into main** (`branch_landed.ts --wt-gen <n>` → `landed: false`) → **resumable** (ready members only): keep worktree and branch, resume this group's B1 chunks (the so-id-log chunk-resume rule). Its index is refreshed below (`--sync`) — the branch moved on since creation.
127
+ - **Non-empty, NOT merged into main** (`branch_landed.ts --wt-gen <n>` → `landed: false`) → **resumable** (ready members only): keep worktree and branch, resume this group's B1 chunks (the so-id-log chunk-resume rule). No index lives in the worktree; the shared main index is synced at `2e`.
110
128
  - **Non-empty, already merged** → post-B2 leftover: remove and recreate (ready members only).
111
129
 
112
- After the classification: every surviving worktree gets its own index — `node <skill-dir>/scripts/ensure_wt_index.ts <HMOS> WT/g<G>r<wtGen>` for one created or recreated now, and `… --sync` for a kept (resumable) one, whose branch already moved on (skip both when `ENGINE_MODE=off`). A hung build costs one 600 s attempt (≈12 min including the status read); three `database is locked` retries can reach ~38 min, so pass a smaller `--timeout-ms` for a small project — it bounds the build only (the status read stays at 120 s). On Windows the timeout kills only the cmd.exe shim, so the script reaps the writer the attempt started (`reaped` in its JSON) instead of leaving a node engine at 100% CPU; an index it never finalized reports `index.state: "indexing"` and the next run rebuilds it rather than treating it as usable. **Fail fast:** after two consecutive `timeout`/`init_failed`/`index_failed` results, stop building indexes for the rest of the wave (record `engine_degraded` + the K members skipped in the wave log, hand those coders grep/read) — finishing W0 at 3-10 minutes per worktree is worse than no graph at all. Normal cost is **serial W0 setup time** (≈1.5 s when the index already exists, ~10 s per new index on a mid-size project), not a hang. A worktree never inherits `<HMOS>`'s `.homegraph/` — it is gitignored — so without this the coder has no graph at all. **Exit 1 is degraded, not a failure:** record its `action`/`reason`/`detail` in the wave log and continue; the coder falls back to grep/read (the coder clause is only passed when the index is usable, so an unusable leftover is never advertised). Exit 0 with `reason: "sync_incomplete"` means the refresh failed but the previous snapshot is still usable — record it as a degraded refresh. Never hand a coder `<HMOS>`'s index instead: it answers from another branch (other groups' merged code, none of this worktree's commits) and the CLI prints no mismatch warning. A symlinked/junctioned `.homegraph/` — dangling included — is refused (`homegraph_linked`) — it would present another tree's index as this worktree's.
130
+ There is **no worktree index**: coders read the shared `<HMOS>` main index (reference for existing APIs and call chains) plus the `<ANDROID>` source index, and the worktree's own files are the truth for what exists on this branch. Pass both index paths, `hmos-project-path`, `hmos-index-ready`, `android-index-ready`, `homegraph-guide`, `engine-mode` and `engine-degraded-reason` in the chunk prompt (see `references/coding-loop.md`). An index symbol missing from the worktree is `index_ahead` — never import, copy, or re-implement it; the worktree's `Read`/`Grep` wins.
113
131
  4. **Stage the design inputs into every surviving worktree** (created, recreated, or kept): `node <skill-dir>/scripts/stage_design_inputs.ts <HMOS> WT/g<G>r<wtGen>`. Exit 1 → record it in the wave log and continue (the coder's design step will report `design_gap_blocked` if `project_design.md` is missing). Then **upsert** this wave's `design_map.md` rows (one row per member G; Design File / Start blank until a chunk design lands). Columns: `G | Group (dir) | Specs | Scenarios | Design File | UI Sequence | Start | End`; `End` stays `In progress` until C.
114
132
 
115
133
  ### B1 — Parallel coding (chunked, per-group serial, background-dispatched)
@@ -118,10 +136,11 @@ Apply **`references/coding-loop.md` verbatim** — read it before entering the w
118
136
 
119
137
  - **chunk pointer discipline**: `state.groups[G].chunks[k].status` (`pending` → `in_flight` → `done`/`failed`), at most one chunk in flight per group, up to `WAVE_WIDTH` chunk agents, at most one merge;
120
138
  - **the dispatch command contract**: `dispatch.mjs claim` before the Agent call (it returns `unitId/attempt/claimGen/token/wtGen/worktree/branch/baseHead/baseDirty`), `intent` before dispatch, `confirm --session` when the call returns, `beat` for observed progress, `evidence` for the deterministic per-attempt gate, then `artifact` + `submit --kind completed|failed` only on its `completed`, then `release --outcome done|failed`; identity-bearing commands pass `--expect-gen`/`--token` and a mismatch is a stale no-op;
121
- - **the spec §11 event loop**: consume `orch.event.json`/`waker.event.json`, evidence sweep (`progress` → `beat`; attempt artifacts → `artifact`/`submit`/`reject`), `reconcile` + one-way state repair, triage (`submitted` → `queue-merge` + `release`; `failed` → `retry` or close; `orphaned` → wait; resolver → ladder), drain the merge queue, deps release sweep, dispatch up to `freeSlots`, residue disposal, then `wait`;
139
+ - **the spec §11 event loop**: consume `orch.event.json`/`waker.event.json`, evidence sweep (`progress` → `beat`; attempt artifacts → `artifact`/`submit`/`reject`), `reconcile` + one-way state repair, triage (`submitted` → `release(done)` then `queue-merge`; `failed` → `retry` or close; `orphaned` → wait; resolver → ladder), drain the merge queue, deps release sweep, dispatch up to `freeSlots`, residue disposal, then `wait`;
122
140
  - **the turn-end guard**: `reconcile` → merge-queue drain → deps release sweep → never-strand disposal → arm the waker (`dispatch.mjs probe`; `dispatch.mjs waker` in background; `waker.stop` on every terminal path);
123
141
  - **the waker wakeup disposal**: demux `waker.event.json` (`artifact`/`git`/`ledger`/`state`/`deadline` → targeted evidence; `relay` → re-arm; `error` → repair), then drain the event loop;
124
- - **the chunk dispatch contract** (`a2h-arkts-logic-coder` fields: the worktree as `harmonyos-project-path`, the chunk spec slice as `spec-file`, the per-chunk design path as `spec-design-file`, `design-mode` + `design-ui-sequence` + `design-display-root` + `design-engine-mode` + `design-mvvm` + `state-docs-mode`, the `unitId`, `output-path` = `.../chunk_<k>/attempt_<n>`, `wiring-mode: true`, the compact wiring list, the so-id prompt extra with the code-first, no-build, state-refresh and worktree-index rules), the design-mode verdict (`references/coding-loop.md`), the so-id resume parse, and the coding-complete → audit → B3 handoff.
142
+ - **the chunk dispatch contract** (`a2h-arkts-logic-coder` fields: the worktree as `harmonyos-project-path`, the Android source root as `android-project-path` — the coder cannot derive it on its own — the chunk spec slice as `spec-file`, the per-chunk design path as `spec-design-file`, `design-mode` + `design-ui-sequence` + `design-display-root` + `design-engine-mode` + `design-mvvm` + `state-docs-mode` + `api-docs-mode`, the `unitId`, `output-path` = `.../chunk_<k>/attempt_<n>`, `wiring-mode: true`, the compact wiring list, the so-id prompt extra with the code-first, no-build, state-refresh and shared-index rules), the design-mode verdict (`references/coding-loop.md`), the so-id resume parse, and the coding-complete → audit → B3 handoff;
143
+ - **the coder's HomeGraph evidence**: under `ENGINE_MODE=required`, a `commit-info.md` missing `## HomeGraph evidence` **or** carrying none of anchor / `degraded:` / `fallback:` / `not-applicable:` inside it is an evidence failure (`kind:"failed"`, reason `homegraph-evidence-missing`); anchors without a `start | hmos` line fail with `homegraph-start-missing`; under `auto` both are warnings. The orchestrator must export the same `ENGINE_MODE` in the environment when it calls `dispatch.mjs evidence` (`chunkEvidence` reads `process.env.ENGINE_MODE`; the CLI has no separate `--engine-mode` flag).
125
144
 
126
145
  Hot-path invariants (the reference file is authoritative): every background dispatch is claimed **before** it leaves and `intent` is written before the Agent call, a completion is released only from fresh per-attempt evidence, a retry is `retry` + a fresh claim (never an in-place resurrection of a live unit), a stale identity writes nothing, and no turn may end while active units remain without a live waker for the current `runId`.
127
146
 
@@ -130,80 +149,38 @@ Hot-path invariants (the reference file is authoritative): every background disp
130
149
  Apply **`references/merge-queue.md` verbatim.** B2 is a queue the B1 event loop drains while coding continues — not a phase after B1: a group enters at its coding-complete event, the queue is processed strictly serially (main is the single git-writer), popped in coding-completion order, and at most one merge — normal or resolver-backed — is in progress at any moment. It owns:
131
150
 
132
151
  - **step 0, the actual-write audit** (`audit_claims.ts <HMOS> --wave <K> --base <WAVE_BASE>`, once per wave after the queue drains and before wiring, on the recorded `state.groups[G].audit = { base, tip }` pairs; findings are data for B4, never a stop);
133
- - **landing**: the current generation branch `specpipe/g<G>r<wtGen>` → `branch_landed.ts --wt-gen <n>` (already landed → reuse its `merge_commit`) → otherwise `PRE = git rev-parse HEAD` → `git merge --no-ff --no-edit specpipe/g<G>r<wtGen>` (every landing a main-side merge commit, never a fast-forward) → `dispatch.mjs group-merge <G> --landed <merge-commit>`; the zero-commit branch is the only no-op (`group-merge <G>` without `--landed`, queued + all chunks done, records `noop`). `group-merge` refuses while a merge is in progress, for a failed group, or when `--landed` is not that group's landing commit. **Only after `group-merge` succeeds**: the group's B4 net-change range `PRE..<merge-commit>`, specs to `stage: "B"`, status `merged` (ledger first, state second);
134
- - **the recovery ladder** on conflict (hop (a) background conflict-resolve re-dispatch 1×: main `merge --abort` → `claim resolver:g<G>` → worktree `git merge <main>` → `resolver_prompt.ts` renders the prompt (all involved groups' ORIGINAL SPECs, chunk SPECs, design docs, wiring list, strict-JSON return) → `intent` → dispatch → `confirm`; hop (b) group re-code 1× → hop (c) fail-soft `failed`), with hop counters conversation-transient;
135
- - **the wiring application** after the queue drains (idempotent, per group in chunk order, mechanically applied from the chunks' `wiring.md` rows onto `state.config.wiring_files`; lock files skipped; same-key cross-group conflicts recorded for manual follow-up) and its single `wiring` commit (skipped when all wiring files are empty/absent).
152
+ - **landing**: the current generation branch `specpipe/g<G>r<wtGen>` → `branch_landed.ts --wt-gen <n>` (already landed → reuse its `merge_commit`) → otherwise `PRE = git rev-parse HEAD` → `git merge --no-ff --no-edit specpipe/g<G>r<wtGen>` (every landing a main-side merge commit, never a fast-forward) → `dispatch.mjs group-merge <G> --landed <merge-commit>`; the zero-commit branch is the only no-op (`group-merge <G>` without `--landed`, queued + all chunks done, records `noop`). `group-merge` refuses while a merge is in progress, for a failed group, when `--landed` is not that group's landing commit, and while any planned chunk of the group is not `done`/`accepted` (`chunks-incomplete` — a landed branch is not a finished group; exit 2). `queue-merge` applies the same precondition **before any `git merge`** (all planned chunks `done`/`accepted`; a `closed`/`abandoned` chunk can never land → `group-fail`), so a partial branch never reaches main. **Only after `group-merge` succeeds**: the group's B4 net-change range `PRE..<merge-commit>`, specs to `stage: "B"`, status `merged` (ledger first, state second); then `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b2-merge`; skip when `ENGINE_MODE=off`; record the JSON line — exit 1 is a degraded refresh, never a merge failure);
153
+ - **the recovery ladder** on conflict (hop (a) background conflict-resolve re-dispatch 1×: main `merge --abort` → `claim resolver:g<G>` → worktree `git merge <main>` → `resolver_prompt.ts` renders the prompt (all involved groups' ORIGINAL SPECs, chunk SPECs, design docs, wiring list, strict-JSON return) → `intent` → dispatch → `confirm`; hop (b) group re-code 1× (if hop (b) moved code on main after the last `b2-merge` sync, run `ensure_index.ts <HMOS> --sync` once with trigger `b2-hop-b`; skip when `ENGINE_MODE=off`; otherwise the reset only moves worktree files and no index write happens) → hop (c) fail-soft `failed`), with hop counters conversation-transient;
154
+ - **the wiring application** after the queue drains (idempotent, per group in chunk order, mechanically applied from the chunks' `wiring.md` rows onto `state.config.wiring_files`; lock files skipped; same-key cross-group conflicts recorded for manual follow-up) and its single `wiring` commit (skipped when no wiring file changed). **The wiring step must also explicitly check permission completeness** (per `references/merge-queue.md`): run `node <skill-dir>/scripts/check_permissions.ts <HMOS> --wave <K>` — it merges the wave's specs with the entry `module.json5`, `references/permission-index.json` and F0's declared/judged `notes`, and replies `toAdd` / `held` / `unknown` / `unused` / `declaredForbidden`; apply only `toAdd` as `add-permission` rows (`user_grant` with `reason` + `usedScene`), never a restricted / `level != normal` name, a picker capability or a notification (F0's rules — `shared-layer.md`), and never a name F0 already judged; the reverse check spans every merged group plus F0's notes, not this wave alone. Verify the coder-side `requestPermissionsFromUser` consent call sites exist (`consent.callSites`), and record `permissions: required <n>, added <m>, missing <k>, held <h>` in the wave log and the `wiring` commit body — never assume the coders' rows are complete.
136
155
 
137
156
  ### B3 — One build per wave
138
157
 
139
- Dispatch one `build-fixer` sub-agent (`harmony_project_dir: <HMOS>`, `deveco_home: <DEVECO_HOME>`, `output_path: <HMOS>/.hometrans/wave_<wave>/build` — the agent's field names) in the foreground. It fixes cross-group compile errors and replies with one JSON object `{ ok, build, commit, fixes, report, note }`. (Build failure after fix attempts → record; the wave still proceeds to review — the review report will carry the build status.)
158
+ Dispatch one `build-fixer` sub-agent (`harmony_project_dir: <HMOS>`, `deveco_home: <DEVECO_HOME>`, `output_path: <HMOS>/.hometrans/wave_<wave>/build` — the agent's field names) in the foreground. It fixes cross-group compile errors and replies with one JSON object `{ ok, build, commit, fixes, report, note }`. (`FAILED` → record; the wave still runs B4–C, but no later wave starts on a red build: coding-loop.md → Build breaker.)
140
159
 
141
160
  **Validate the reply before moving on — never end the turn to wait for B3.** A foreground sub-agent call returns at the sub-agent's first idle. Nothing it does after that reaches you: no notification follows, and no ledger row or waker covers B3. An orchestrator that ends its turn here hangs forever.
142
161
 
143
- 1. The reply parses as that JSON and `build` is `SUCCESS` or `FAILED` → record `build` and `commit` (`null` = no fix commit). If `commit` is non-null, check it with `git -C <HMOS> cat-file -e <commit>`. A missing commit counts as an invalid reply (step 2).
162
+ 1. The reply parses as that JSON and `build` is `SUCCESS` or `FAILED` → record `build` and `commit` (`null` = no fix commit). If `commit` is non-null, check it with `git -C <HMOS> cat-file -e <commit>`, then run `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b3-fix`, also labelled `build-breaker` — the design's build-breaker row is this same B3 build-fixer commit; skip when `ENGINE_MODE=off`; record the JSON line — a degraded refresh never invalidates the build). A missing commit counts as an invalid reply (step 2).
144
163
  2. Any other reply (a status line such as "will resume automatically when the background task finishes", prose, a truncated object) means the sub-agent went idle **mid-run**, typically behind its own background build, and may still be editing `<HMOS>`. **Never dispatch a second build-fixer beside it.** Resume **the same session** in the foreground instead: the `subagent` call with `sessionID: <the sessionID from the reply>`, same agent, prompt `Continue the build-fix loop in the foreground until it ends; reply only with the final JSON.`. Re-validate the new reply by step 1. Resume at most 2×.
145
164
  3. Still no valid reply → take the result from disk: `<output_path>/build-fix-report.md` (Build Status) and `<output_path>/build-fix-commit-info.md` (`commit_id`). If either is missing, run one build yourself, in the foreground with a 600000 ms timeout (`cmd /c "devecocli build > "<output_path>\b3_orchestrator.log" 2>&1"` from `<HMOS>`), and record its outcome as the B3 build status. Note the invalid reply in the final report either way.
146
165
 
147
166
  ### B4 — Unified review (parallel per group, per-group serial fix, only open groups re-reviewed)
148
167
 
149
- Every group carries its review state in `state.groups[G].review = { round, open, scenarios, carry_over, fix_commits }` (written after every step below; atomic like every state write):
150
- - `open` — `true` while the group still has a defect the fixer can act on.
151
- - `scenarios` — the scenario ids (`so-N Scenario X`) the last report judged FAIL / PARTIAL.
152
- - `carry_over` — the path of the group's last `review-fix-report.md`, whose Remaining Issues the next fixer re-attempts.
153
- - `fix_commits` — every `fix(review)` commit made for this group.
154
-
155
- A group is **open** after a review when its report has any FAIL / PARTIAL scenario, a broken Launch Path hop, a non-PASS Cross-Cutting section, or a wave-audit finding that names it — or when its report is **missing** (reviewer failed twice). PASS and UNABLE TO VERIFY are **closed** verdicts: UNABLE TO VERIFY is evidence debt that no code change closes, so it never keeps a group open and never costs a round. A closed group is never re-reviewed and never handed to a fixer again, unless step 1(c) reopens it.
156
-
157
- Loop rounds `r = 1 .. MAX_ROUNDS_REVIEW` (default `2`):
158
-
159
- 0. **Single-writer index sync (main tree)** — the orchestrator is the only writer of `<HMOS>`'s index during review; each worktree's own index was built once at creation (W0 / the deps release sweep) and is **not** touched here. **Skip this step entirely when `ENGINE_MODE=off`** (no engine command may run in the whole run). Before dispatching this round's reviewers, bring the main index current: `homegraph status --json <HMOS>` → stale → `homegraph sync --quiet <HMOS>`, unindexed → `homegraph init -i <HMOS>` (bound it to **120000 ms** — the 1.6.x engine can finish writing the index and then spin forever before finalize, so a default 600 s wait only burns 10 minutes). Failure or timeout → record and continue: the reviewers' concurrency rule degrades them automatically — but a recorded step-0 failure is **not** index state: never leak it into the reviewer dispatch prompts. After one timeout, skip this step for the rest of the run (the engine will hang every round); re-sync every round only while it keeps returning.
160
- 1. **Select this round's review set — exactly these groups, computed from state, never by judgment:**
161
- - `r = 1`: every `merged` member of the wave, all scenarios.
162
- - `r ≥ 2`: only
163
- - (a) groups still **open** after the previous round's fix;
164
- - (b) groups whose previous report is missing;
165
- - (c) **regression check** — a closed group whose files were touched by a `fix(review)` or rebuild commit of the previous round (`git -C <HMOS> diff --name-only <commit>^..<commit>` intersected with `git diff --name-only` of the group's B2 range). This reopens the group.
166
-
167
- Every other group is skipped — it is not reviewed again.
168
- - The set is empty → exit the loop.
169
- 2. **Dispatch the selected reviewers as ONE foreground batch — every reviewer call of the round in a single assistant message, never one-per-message** (reviewers are read-only — overlap is always safe). Per selected group: a `code-reviewer` sub-agent call with:
170
- - `harmonyos_project_path: <HMOS>`;
171
- - `commit_range: <the group's net-change range recorded at B2 — PRE..<merge-commit>>`;
172
- - `test_case_path: <merged_spec abs path>`;
173
- - `output_path: <HMOS>/.hometrans/spec_group_<G>/review-round_<r>`;
174
- - from `r ≥ 2` also `extra_commits: <state.groups[G].review.fix_commits plus the previous round's rebuild commit, when any>`, so the fixes are in the change context. The B2 range alone predates them.
175
- - from `r ≥ 2` also `scenarios`:
176
- - case (a): the group's `review.scenarios` plus the scenarios its cross-cutting / launch-path / audit findings cite;
177
- - cases (b) and (c): omitted, so all scenarios are reviewed.
178
-
179
- Do not add other fields; wiring registrations live in the `wiring` commit, outside every group's range.
180
-
181
- **Failure handling — retry once, never a stop.** A reviewer call that errors → re-dispatch it once, with the same contract, batched with every other same-round failure. A second failure → record it and continue: that group's report is missing, it stays open, and it is flagged in the final report. Reports are per-spec sectioned.
182
- 3. **Update each reviewed group's state.**
183
- - Extract per-spec verdicts into `state.specs[]` (stage stays `B`).
184
- - Set `review.round = r`, recompute `open`, and set `scenarios` to the FAIL / PARTIAL scenario ids of this report. A scenario reviewed this round replaces its old verdict; one not in this round's `scenarios` subset keeps it.
185
- - The wave audit's findings (`.hometrans/wave_<K>/claim_audit.json`: registry edits, resolver registry edits / wiring-mode violations, cross-group actual overlaps) are attributed in round 1 to every group they name and keep that group open until a fixer has processed them. A finding that names two groups goes to the lower `G`.
186
- 4. **Exit check.** No group is open → exit the loop. Open groups whose only cause is a missing report get no fixer: go straight to the next round.
187
- 5. **Fix — one fix-mode `code-reviewer` per open group, dispatched serially in group order.** Fixers write to the main tree, so one runs at a time. Each fix call gets:
188
- - `mode: fix`;
189
- - `review_report_path: <HMOS>/.hometrans/spec_group_<G>/review-round_<r>/findings.md` — the group's round-`r` report, plus the audit findings attributed to it in round 1. The orchestrator writes this file.
190
- - `carry_over_report_path: <review.carry_over>`, when set — the previous round's fix report for this group, whose Remaining Issues the fixer re-attempts;
191
- - `harmonyos_project_path: <HMOS>`, `android_project_path: <ANDROID>`;
192
- - `output_path`: the same `review-round_<r>` dir;
193
- - `build: false` — the orchestrator builds once for the whole round.
194
-
195
- After each fixer returns:
196
- - append its `commit` to `review.fix_commits` when it is not `none`;
197
- - set `review.carry_over` to its `review-fix-report.md`;
198
-
199
- A fixer that errors → retry it once; a second failure → record it, the group stays open, and the next fixer is dispatched.
200
-
201
- When every fixer has returned, dispatch **one** `build-fixer` (B3's fields, `output_path: <HMOS>/.hometrans/wave_<K>/review_round_<r>/build`) and validate its reply exactly as in B3. Its fix commit, when any, counts as a previous-round commit for step 1(c). Then the next round.
202
- 6. **Last round.** After `r = MAX_ROUNDS_REVIEW` the loop ends; groups still open are listed in the final report with their open scenarios and last `review-fix-report.md` as manual follow-up.
168
+ Apply **`references/review-loop.md` verbatim** — read it before the wave's first review round. It owns the per-group review state `state.groups[G].review = { round, open, scenarios, carry_over, fix_commits }` (written after every step, atomically), the open/closed rule (PASS and UNABLE TO VERIFY close a group; a missing report keeps it open), and the rounds `r = 1 .. MAX_ROUNDS_REVIEW` (default `2`):
169
+
170
+ 0. the single-writer `<HMOS>` index sync before the reviewers (`ensure_index.ts <HMOS> --sync`, trigger `b4-step0`; skip when `ENGINE_MODE=off`; never gated on `homegraph status`);
171
+ 1. the review set, computed from state, never by judgment (`r = 1`: every `merged` member; `r ≥ 2`: only still-open, missing-report and regression-check groups; empty → exit the loop);
172
+ 2. every reviewer call of the round as ONE foreground batch of `code-reviewer` calls with exactly the listed fields; a failed call is retried once, never a stop;
173
+ 3. `check_review_evidence.ts` on each per-group report, then the per-group state update (wave-audit findings attributed in round 1);
174
+ 4. the exit check;
175
+ 5. one fix-mode `code-reviewer` per open group, serially in group order (trigger `b4-fix` after each), then one round rebuild by `build-fixer`, validated exactly as in B3 (trigger `b4-rebuild`);
176
+ 6. the last round's final re-review; groups still open go to the final report as manual follow-up.
177
+
178
+ **Recording every `ensure_index` call (all trigger points)**: write the JSON into the one `state.engine.<index>` its `repo` names (leave the other index untouched; `path` = `repo`, `initialized` = the JSON field of the same name) and append `{trigger, action, ok, lastIndexed, durationMs}` to the wave log; `reason === "sync_incomplete"` is booked degraded even though the JSON's `degraded` is still `false`. `hmos_index_ready` / `android_index_ready` = `exit 0 && action !== "skip"` (a `sync_incomplete` still counts as ready while also recorded as degraded). A JSON whose `repo` is `null` (an `internal_error`/`skip` line that names no repo) **or an exit 2 usage failure (no JSON at all)** writes no `state.engine` entry: append the raw output line to the wave log and leave that index's readiness/state exactly as it was. The script itself writes neither state nor the wave log.
203
179
 
204
180
  ### B5 — One semantic-docs refresh per wave
205
181
 
206
- Run the `DOCS_MODE` path (`/a2h-module-semantic-docs <HMOS> --engine-mode <ENGINE_MODE> --incremental preserve --scope project-source` via sub-agent, or the direct-script fallback). Sets every non-failed spec of the wave to `stage: "B2"`.
182
+ Run the `DOCS_MODE` path (`/a2h-module-semantic-docs <HMOS> --engine-mode <ENGINE_MODE> --homegraph-index <ready|missing> --incremental preserve --scope project-source` via sub-agent, or the direct-script fallback). `<ready|missing>` is the orchestrator's `<HMOS>` index verdict; under `ready` the docs sub-agent reads the shared index only (never `init`/`sync`/`index`), under `missing` it records the degradation and never probes. If B5 changed a code file listed in `state.config.wiring_files`, run `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b5`; skip when `ENGINE_MODE=off`; a docs-only refresh writes no index). Sets every non-failed spec of the wave to `stage: "B2"`.
183
+ Then write `wave_<K>/docs_refresh.json` `{wave, mode, result, at}`.
207
184
 
208
185
  ### C — Per-group finalize
209
186
 
@@ -220,6 +197,7 @@ Full schema, sibling-file ownership, the atomic-write rule, the `.bak` restore p
220
197
 
221
198
  ## Fail-soft rules (never pause)
222
199
 
200
+ - F0 scan/agent/validation failure → ownership-guarded reset to `PRE_F0` (only the two recorded cases — `HEAD == commit`, or `HEAD == docs_commit` whose parent is `commit` — allow a reset; guard fails → stop under the dirty-tree rule), restore the `wiring_files`/`wiring_compact` snapshot, write a skipped `shared_manifest.json`, continue W0. A post-agent skip whose `HEAD` moved is `failed:post_agent_commit`: a skipped manifest records no commit, so **no reset** — record it, surface it for manual recovery, never delete those commits. F0 never blocks a wave except for that unowned-history anomaly.
223
201
  - **Every** group marked `failed` (any cause, incl. a failed release) also gets each of its specs `status: "failed"` in the same state write — the completion check counts specs.
224
202
  - A chunk whose design step fails (`design_gap_blocked` / `validation_failure`) follows the normal chunk failure path; a missing design artifact after a completed submission is a wave-log/report warning, not a group failure.
225
203
  - Chunk failure (after one retry) → group `failed`; its branch is discarded, any queued merge dropped; wave continues.
@@ -227,43 +205,25 @@ Full schema, sibling-file ownership, the atomic-write rule, the `.bak` restore p
227
205
  - A wave drained with a member still **coding** whose ledger unit is `orphaned` → `accept --expect-gen <claimGen> --reason wave-end` + group `failed` (never-strand guard) — the unit was never re-dispatchable and no wakeup source remained; the zombie's eventual artifact is ignored per the rule above.
228
206
  - A parked merge whose resolver unit is terminal — `orphaned` (a phantom/zombie dispatch) or `closed` — → the ladder advances **without hop (a)**: hop (b) group re-code if a generation remains, else hop (c) fail-soft (group `failed`, merge dropped) — same turn (never-strand guard).
229
207
  - Merge ladder exhausted → group `failed`, continue (report flags dependents).
208
+ - A merge or queue refused with `chunks-incomplete` → `dequeue-merge <G>` if queued, then: a still-`coding` group finishes the remaining chunks (a `closed`/`abandoned` chunk means `group-fail`); a `merged`/`done` group is a premature landing → `group-reopen <G> --base <current main HEAD>` (new generation, finished chunks kept), then continue B1; if no generation remains, `group-fail`. Never call `group-reopen` on a `coding` group (it refuses `not-merged`), never mark the open chunks done, and never leave them to the final report. A `terminal-group-open-chunks` residue row is the `merged`/`done` repair.
230
209
  - B3/B4/B5 failures → record and continue (carried in the final report).
231
- - The only legitimate stops: the wave loop + Finalization complete, or an environment prerequisite Initialization was supposed to guarantee is unrecoverable (e.g. dirty main tree at W0).
232
-
233
- ## Homecheck static-defect check (after the last wave, before the smoke gate)
234
-
235
- Dispatch one `general` sub-agent in the foreground to run the Homecheck gate per `references/static-defect-gate.md` (inputs: `<HMOS>`, `<skill-dir>`, `DEVECO_HOME`, `runId = state.config.campaign_id`, the per-campaign nonce from I3 step 10b — never `specs_json_sha256`, which is identical when the same specs.json starts a new campaign) — scan, fix every `errors[]` finding and every migration-set `warnings[]` finding in the main tree, one final build check; the sub-agent dispatches nothing and never fixes compile errors itself. It replies with the compact JSON `{ ok, status, rounds, errorsBefore, errorsAfter, fixed, suppressed, remaining, build, note }` — validate per B3 (fallback: `summary.json` on disk, accepted only on a `runId` match), then mirror it into `state.post_homecheck` (the completion authority on resume — `summary.json` alone never marks the gate done). Off the reply's `build`: `FAILED` → dispatch one `build-fixer` (B3's contract, `output_path: <HMOS>/.hometrans/homecheck/build`); `SUCCESS` or no code change → nothing to fix. Then run the smoke gate on the fresh build.
236
-
237
- - Gate mode is fixed: scan, fix, and rescan up to 2 rounds; remaining errors are reported, never hidden.
238
- - The migration rule set (`<skill-dir>/rules/migration-rules`, `plugin:@hometrans/all`) is part of the scan. Its warnings are repaired too; warnings of the three fixed sets are not in scope. A scan that cannot prove the migration set loaded is a `scan_error`, never a clean pass.
239
- - Scan failures, timeouts, and missing rule sets are fail-soft and recorded.
240
-
241
- ## Runtime smoke gate (after the last wave, before Finalization)
242
-
243
- When the Homecheck step is complete and its rebuild succeeded (or it made no code change), run the `a2h-coldstart-smoke-gate` skill yourself — no sub-agent dispatch — with `harmony_project_dir = <HMOS>`, then record the outcome:
244
-
245
- - any verdict → the Finalization summary build line: `Smoke: <verdict>`.
246
- - `FAIL_*` → verdict + evidence + fix commits also in the final report's Manual Follow-up list.
247
- - `SKIPPED_*` / `DEPLOY_ERROR` → the reason also in the final report's Manual Follow-up list.
210
+ - The only legitimate stops: the wave loop + Finalization complete, an environment prerequisite Initialization was supposed to guarantee is unrecoverable (e.g. dirty main tree at W0), the F0 **unowned-history anomaly** (`failed:post_agent_commit` — a skipped manifest whose `HEAD` moved with no recorded commit; stop for manual recovery, never reset or delete those commits), or an `ENGINE_MODE=required` engine failure (`state.engine_blocked = { index: "android" | "hmos", reason, at }` — persist the failing index, stop the waker, leave the ledger/worktrees intact; a resume retries exactly that index with `--create --sync`).
248
211
 
249
- All outcomes proceed to Finalization.
212
+ ## After the wave loop — Homecheck → smoke gate → Finalization
250
213
 
251
- ## Finalization (after all waves)
214
+ Apply **`references/post-loop.md` verbatim** once `plan_waves.ts` reports `{"wave": null, "done": true}`. Each step writes a state marker and Finalization step 0 requires both; a missing marker is never a pass, on a resume too (`references/state-and-resume.md` → After the wave loop). A carried-only round (`finalization.carried_only`) is exempt:
252
215
 
253
- 1. Final build sanity check: run `a2h-fix-build-errors` once against `HMOS` with `DEVECO_HOME` as `deveco_studio_path` (fast no-op when green); commit any changes as `build fix`.
254
- 2. Design issue sweep: list `DESIGN_DIR/SPEC_DESIGN_G*_c*_issue.md` files for manual follow-up.
255
- 3. Verify `design_map.md`: one row per wave member G; every completed row has Start and End; any `In progress` End marks an incomplete group.
256
- 3b. **Ledger finalization**: snapshot `<HMOS>/.hometrans/dispatch/ledger.jsonl` to `dispatch/ledger.final-<ts>.jsonl` (the summary report lists its unresolved/accepted units), then write `<HMOS>/.hometrans/dispatch/waker.stop` (idempotent — the waker was already stopped at the last wave's barrier) and `reconcile` once for the final count. Never delete the ledger; never leave a background waker alive after the run ends.
257
- 4. Print the summary report per `references/final-report-template.md` (every section mandatory; all outcomes — including failures — carried, never silently dropped).
258
- 5. Write `state.finalization = { done: true, final_build, homecheck, smoke, at }` (atomic) — the completion marker callers check; absent = Finalization never ran.
216
+ - **Homecheck static-defect check** — one foreground `general` sub-agent runs `references/static-defect-gate.md`; its validated reply is mirrored into `state.post_homecheck` (or the I2 8b `skipped` mirror).
217
+ - **Runtime smoke gate** — run `a2h-coldstart-smoke-gate` yourself (no sub-agent) with `harmony_project_dir = <HMOS>`, `image_read = IMAGE_READ`; its verdict (or `SKIPPED_HOMECHECK_BUILD_FAILED`) goes to `state.post_smoke`.
218
+ - **Finalization** — final build check, design-issue sweep, `check_design_map.ts`, ledger finalization, the summary report per `references/final-report-template.md`, then `state.finalization = { done: true, … }`, the completion marker callers check.
259
219
 
260
220
  ## Ordering & safety rules
261
221
 
262
- - **The wave loop is sequential across waves**: S0 slices the wave before W0 creates its worktrees (never pre-generate later waves); inside a wave, merges serialize on main in coding-completion order (group order breaks same-turn ties and governs resume).
222
+ - **The wave loop is sequential across waves**: S0 slices the wave, F0 pre-seeds its shared primitives, before W0 creates its worktrees (never pre-generate later waves); inside a wave, merges serialize on main in coding-completion order (group order breaks same-turn ties and governs resume).
263
223
  - **Specs run sequentially inside a group** (chunks serial in one worktree; intra-page `page-order` always respected); **groups run in parallel only within a wave**, in isolated worktrees — same-wave write overlaps are expected and handled by B2's serial merge + the recovery ladder.
264
224
  - **Design is per chunk**: each chunk generates its own `SPEC_DESIGN_G<G>_c<k>.md` before coding; the orchestrator records it in `state`/`design_map.md` on the chunk's successful release. Designs are runtime artifacts and are not committed.
265
225
  - **specs.json order is dual — scan order and dependency carrier**: it is the producer's linearization (`a2h-spec-generate`'s `publish-specs`). As scan order: groups are ordered by first occurrence; chunks, merges, and the wave-slicing scan follow it (backfill may admit a later-order clean group into an earlier wave — wave numbers are not monotone in group order). As dependency carrier: each spec's `deps` (lifted by `plan_groups.ts` into group-level `deps`; same-page sister groups split by the scenario cap re-link through them) point at earlier so-ids, and dispatch-hold (`deps_ready.ts`) staggers within-wave dispatch on them: same-wave groups still code in parallel, only dispatch starts are staggered, and a released member's coder starts from its deps' merged code; deps pointing at later so-ids are cycle edges — ignored and recorded. Groups without deps data (older specs.json) keep the pure parallel behavior. The flat fallback bounds this contract: when the deps forecast for the remaining pool implies more than 2× the width-bound ideal dispatch rounds, `plan_waves.ts` slices flat and dispatch-hold stops holding (a `mode: "flat"` wave releases everything) — throughput wins over dep ordering, and same-wave conflicts surface as B2 merge work.
266
- - **Worktrees are the parallel-isolation mechanism** — never run two coders in one working tree, and coders never build or install dependencies inside them (compilation is B3's, on the main tree — coder-side build runs orphan worktree cleanup on Windows). The wiring surface (resolved once at Initialization into `state.config.wiring_files`) never gets direct coder edits (`wiring-mode`); the orchestrator applies wiring serially after merges.
226
+ - **Worktrees are the parallel-isolation mechanism** — never run two coders in one working tree, and coders never build or install dependencies inside them (compilation is B3's, on the main tree — coder-side build runs orphan worktree cleanup on Windows). The wiring surface (resolved once at Initialization into `state.config.wiring_files`) never gets direct coder edits (`wiring-mode`); the orchestrator applies wiring serially after merges. F0 is the one pre-W0 exception: it edits `state.config.wiring_files` files (and declares the wave's permissions in `module.json5`) directly and commits `infra(wave K): shared layer`. B2's wiring application remains idempotent and is not affected. B4 fixers are the other exception (B4 step 5).
267
227
  - **Every stage is a sub-agent**; results are JSON only; no result is a stop.
268
228
  - **`plan_groups.ts` / `plan_waves.ts` are the single source of grouping/wave-slicing truth** — never recompute by hand, never reorder groups.
269
229
  - **State is durable** — every stage transition is written to `spec_pipeline_state.json` (atomically: temp file + rename) before dispatching the next stage.