@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
@@ -20,10 +20,12 @@ Deterministic precomputation lives in the scripts (inventory: `references/script
20
20
  | `references/shared-layer.md` | F0 trigger, prompt, manifest/validation, docs commit, fail-soft | before F0 |
21
21
  | `references/coding-loop.md` | B1 (chunk pointers, ledger protocol, event loop, guard, chunk contract) | before the wave loop |
22
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 |
23
24
  | `references/state-and-resume.md` | mid-flight, `runId`/reconcile, state schema/atomic/`.bak` | on resume/restore |
24
25
  | `references/execution-model.md` | ledger contract (events, CAS, state machine, waker) | on every wakeup |
25
26
  | `references/legacy-cleanup.md` | retired dispatch-runtime cleanup | before first `--new-run` |
26
27
  | `references/scripts.md` | script + test inventory | as needed |
28
+ | `references/post-loop.md` | after the wave loop: Homecheck → smoke gate → Finalization, with their markers | after the last wave |
27
29
  | `references/static-defect-gate.md` | Homecheck static-defect gate | before smoke |
28
30
  | `references/final-report-template.md` | Finalization summary template | at Finalization |
29
31
 
@@ -60,7 +62,7 @@ The format is owned by the producing skill (`a2h-spec-generate` 的 `publish-spe
60
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:
61
63
 
62
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.
63
- - **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`.
64
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.
65
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).
66
68
 
@@ -68,16 +70,18 @@ Apply **`references/initialization.md` verbatim** (its steps I1–I4 = the numbe
68
70
 
69
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.
70
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).
71
- - 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`, `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 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.
72
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.
73
75
  - A returned sub-agent result — success or failure — is never a stop: parse it, persist it, dispatch the next.
74
76
 
75
77
  ## The wave loop
76
78
 
77
- **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 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 `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; 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 `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`.
78
80
 
79
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).
80
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`).
84
+
81
85
  ### S0 — Slice this wave (deterministic script, incremental)
82
86
 
83
87
  ```
@@ -101,10 +105,12 @@ It appends the wave to `<HMOS>/.hometrans/spec_wave_plan.json` (schema `spec_wav
101
105
 
102
106
  ### F0 — shared-layer pre-seeding
103
107
 
104
- 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`.
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.
105
109
 
106
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`.
107
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
+
108
114
  See `references/shared-layer.md` for the authoritative prompt and manifest.
109
115
 
110
116
  ### W0 — Preconditions & worktrees
@@ -114,13 +120,14 @@ See `references/shared-layer.md` for the authoritative prompt and manifest.
114
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.
115
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.
116
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 (resume or the next wave resets it).
117
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>`:
118
125
  - **Held member** → **stale regardless of content** (a held member cannot hold a legal worktree of this campaign): remove, do not recreate.
119
126
  - **Empty output** → crashed-run leftover: remove, then recreate (ready members only).
120
- - **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`.
121
128
  - **Non-empty, already merged** → post-B2 leftover: remove and recreate (ready members only).
122
129
 
123
- Then index every surviving worktree: `node <skill-dir>/scripts/ensure_wt_index.ts <HMOS> WT/g<G>r<wtGen>` for one created/recreated now, `… --sync` for a kept one (skip both when `ENGINE_MODE=off`). Pass a smaller `--timeout-ms` for a small project (it bounds the build only; when there is no local db the status probe is skipped, otherwise it uses the probe budget set by `--status-timeout-ms`, default 120 s — raise it for a large project). 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 unfinalized index reports `index.state: "indexing"` and the next run rebuilds it rather than using it. **Fail fast:** after two consecutive `timeout`/`init_failed`/`index_failed` results, stop building indexes for the wave (record `engine_degraded` + the K skipped members in the wave log; those coders use grep/read) — 3-10 minutes per worktree is worse than no graph. Normal cost is **serial W0 setup** (≈1.5 s when the index exists, ~10 s per new index on a mid-size project), not a hang. A worktree never inherits `<HMOS>`'s `.homegraph/` (gitignored), so without this the coder has no graph. **Exit 1 is degraded, not a failure:** record `action`/`reason`/`detail` in the wave log and continue; the coder falls back to grep/read (the coder clause is passed only when the index is usable, so an unusable leftover is never advertised). Exit 0 with `reason: "sync_incomplete"` = the refresh failed but the previous snapshot is usable — record it as degraded. Never hand a coder `<HMOS>`'s index: 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/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.
124
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 `进行中` until C.
125
132
 
126
133
  ### B1 — Parallel coding (chunked, per-group serial, background-dispatched)
@@ -129,10 +136,19 @@ Apply **`references/coding-loop.md` verbatim** — read it before entering the w
129
136
 
130
137
  - **chunk pointers**: `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;
131
138
  - **the dispatch command contract**: `claim` (returns `unitId/attempt/claimGen/token/wtGen/worktree/branch/baseHead/baseDirty`) → `intent` → Agent → `confirm --session` → `beat`/`evidence` → `artifact` + `submit --kind completed|failed` → `release --outcome done|failed`; identity commands pass `--expect-gen`/`--token`, and a mismatch is a stale no-op;
132
- - **the spec §11 event loop**: consume `orch.event.json`/`waker.event.json`; evidence sweep (`progress` → `beat`; attempt artifacts → `artifact`/`submit`/`reject`); `reconcile` + one-way repair; triage (`submitted` → `queue-merge` + `release`; `failed` → `retry` or close; `orphaned` → wait; resolver → ladder); drain merges; deps release; dispatch to `freeSlots`; residue disposal; `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 repair; triage (`submitted` → `release(done)` then `queue-merge`; `failed` → `retry` or close; `orphaned` → wait; resolver → ladder); drain merges; deps release; dispatch to `freeSlots`; residue disposal; `wait`;
133
140
  - **the turn-end guard**: `reconcile` → merge drain → deps release → never-strand disposal → arm the waker (`probe`; `waker` in background; `waker.stop` on every terminal path);
134
141
  - **waker wakeup disposal**: demux `waker.event.json` (`artifact`/`git`/`ledger`/`state`/`deadline` → targeted evidence; `relay` → re-arm; `error` → repair), then drain;
135
- - **the chunk dispatch contract** (`a2h-arkts-logic-coder` fields, the compact wiring list and the so-id prompt extra with its code-first/no-build/state-refresh/worktree-index rules), the design-mode verdict, the so-id resume parse, and the coding-complete → audit → B3 handoff.
142
+ - **the chunk dispatch contract** (`a2h-arkts-logic-coder` fields — including the Android source root as
143
+ `android-project-path`, which the coder cannot derive on its own — the compact wiring list and the so-id
144
+ prompt extra with its code-first/no-build/state-refresh/shared-index rules), the design-mode verdict, the
145
+ so-id resume parse, and the coding-complete → audit → B3 handoff;
146
+ - **the coder's HomeGraph evidence**: under `ENGINE_MODE=required`, a `commit-info.md` missing `## HomeGraph evidence`
147
+ **or** carrying none of anchor / `degraded:` / `fallback:` / `not-applicable:` inside it is an evidence failure
148
+ (`kind:"failed"`, reason `homegraph-evidence-missing`); anchors without a `start | hmos` line fail with
149
+ `homegraph-start-missing`; under `auto` both are warnings. The orchestrator must
150
+ export the same `ENGINE_MODE` in the environment when it calls `dispatch.mjs evidence` (`chunkEvidence` reads
151
+ `process.env.ENGINE_MODE`; the CLI has no separate `--engine-mode` flag).
136
152
 
137
153
  Hot-path invariants (the reference is authoritative): every background dispatch is claimed **before** it leaves and `intent` precedes 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; no turn may end while active units remain without a live waker for the current `runId`.
138
154
 
@@ -141,62 +157,40 @@ Hot-path invariants (the reference is authoritative): every background dispatch
141
157
  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 during a wave), popped in coding-completion order, with at most one merge — normal or resolver-backed — in progress. It owns:
142
158
 
143
159
  - **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 feed B4, never a stop);
144
- - **landing**: `branch_landed.ts --wt-gen <n>` on `specpipe/g<G>r<wtGen>` (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);
145
- - **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 from all involved groups' ORIGINAL SPECs, chunk SPECs, design docs and wiring list with a strict-JSON return → `intent` → dispatch → `confirm`); hop (b) group re-code 1×; hop (c) fail-soft `failed`; hop counters are conversation-transient;
146
- - **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).
160
+ - **landing**: `branch_landed.ts --wt-gen <n>` on `specpipe/g<G>r<wtGen>` (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);
161
+ - **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 from all involved groups' ORIGINAL SPECs, chunk SPECs, design docs and wiring list with a 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`; hop counters are conversation-transient;
162
+ - **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>`, apply only its `toAdd` as `add-permission` rows (`user_grant` with `reason` + `usedScene`) — `held` (restricted / picker / notification / F0-judged) is never re-added and `unknown` / `unused` are report-only — and record `permissions: required <n>, added <m>, missing <k>, held <h>` in the wave log and the `wiring` commit body.
147
163
 
148
164
  F0 is the one pre-W0 exception (see **Ordering & safety rules**).
149
165
 
150
166
  ### B3 — One build per wave
151
167
 
152
- 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.)
168
+ 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.)
153
169
 
154
170
  **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.
155
171
 
156
- 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).
172
+ 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).
157
173
  2. Any other reply (a status line such as "后台任务完成后我会自动恢复" / "will resume 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×.
158
174
  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.
159
175
 
160
176
  ### B4 — Unified review (parallel per group, per-group serial fix, only open groups re-reviewed)
161
177
 
162
- 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):
163
- - `open` — `true` while the group still has a defect the fixer can act on.
164
- - `scenarios` — the scenario ids (`so-N 场景X`) the last report judged FAIL / PARTIAL.
165
- - `carry_over` — path of the group's last `review-fix-report.md`, whose Remaining Issues the next fixer re-attempts.
166
- - `fix_commits` — every `fix(review)` commit made for this group.
167
-
168
- 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 the report is **missing** (reviewer failed twice). PASS and UNABLE TO VERIFY are **closed** verdicts: UNABLE TO VERIFY is evidence debt no code change closes, so it never keeps a group open and never costs a round. A closed group is never re-reviewed or handed to a fixer again unless step 1(c) reopens it.
169
-
170
- Loop rounds `r = 1 .. MAX_ROUNDS_REVIEW` (default `2`):
171
-
172
- 0. **Single-writer index sync (main tree)** — the orchestrator is the only writer of `<HMOS>`'s index during review; each worktree's index was built at creation (W0 / deps release) and is **not** touched here. **Skip entirely when `ENGINE_MODE=off`** (no engine command may run in the run). Before dispatching this round's reviewers: `homegraph status --json <HMOS>` → stale → `homegraph sync --quiet <HMOS>`, unindexed → `homegraph init -i <HMOS>` (bound to **120000 ms** — the 1.6.x engine can write the index then spin forever before finalize, so a 600 s default only burns 10 minutes). Failure/timeout → record and continue: the reviewers' concurrency rule degrades automatically, and a step-0 failure is **not** index state — never leak it into reviewer 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.
173
- 1. **Select this round's review set — exactly these groups, computed from state, never by judgment:**
174
- - `r = 1`: every `merged` member of the wave, all scenarios.
175
- - `r ≥ 2`: only (a) groups still **open** after the previous round's fix; (b) groups whose previous report is missing; (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. Every other group is skipped — not reviewed again.
176
- - The set is empty → exit the loop.
177
- 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, so overlap is always safe). Per selected group: a `code-reviewer` sub-agent call with:
178
- - `harmonyos_project_path: <HMOS>`;
179
- - `commit_range: <the group's net-change range recorded at B2 — PRE..<merge-commit>>`;
180
- - `test_case_path: <merged_spec abs path>`;
181
- - `output_path: <HMOS>/.hometrans/spec_group_<G>/review-round_<r>`;
182
- - from `r ≥ 2` also `extra_commits: <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);
183
- - from `r ≥ 2` also `scenarios`: case (a) the group's `review.scenarios` plus the scenarios its cross-cutting / launch-path / audit findings cite; cases (b)/(c) omitted, so all scenarios are reviewed.
184
-
185
- Do not add other fields; wiring registrations live in the `wiring` commit, outside every group's range.
186
-
187
- **Failure handling — retry once, never a stop.** A reviewer call that errors → re-dispatch 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.
188
- 3. **Update each reviewed group's state.** Extract per-spec verdicts into `state.specs[]` (stage stays `B`); set `review.round = r`, recompute `open`, and set `scenarios` to this report's FAIL / PARTIAL ids — a scenario reviewed this round replaces its old verdict, one not in this round's `scenarios` subset keeps it. 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 processes them; a finding naming two groups goes to the lower `G`.
189
- 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.
190
- 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: `mode: fix`; `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); `carry_over_report_path: <review.carry_over>` when set (the previous round's fix report whose Remaining Issues are re-attempted); `harmonyos_project_path: <HMOS>`, `android_project_path: <ANDROID>`; `output_path`: the same `review-round_<r>` dir; `build: false` (the orchestrator builds once per round).
178
+ 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`):
191
179
 
192
- After each fixer returns: append its `commit` to `review.fix_commits` when not `none`, and set `review.carry_over` to its `review-fix-report.md`. A fixer that errors → retry once; a second failure → record it, the group stays open, dispatch the next fixer.
180
+ 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`);
181
+ 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);
182
+ 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;
183
+ 3. `check_review_evidence.ts` on each per-group report, then the per-group state update (wave-audit findings attributed in round 1);
184
+ 4. the exit check;
185
+ 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`);
186
+ 6. the last round's final re-review; groups still open go to the final report as manual follow-up.
193
187
 
194
- 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.
195
- 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.
188
+ **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.
196
189
 
197
190
  ### B5 — One semantic-docs refresh per wave
198
191
 
199
- 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"`.
192
+ 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"`.
193
+ Then write `wave_<K>/docs_refresh.json` `{wave, mode, result, at}`.
200
194
 
201
195
  ### C — Per-group finalize
202
196
 
@@ -228,35 +222,17 @@ Full schema, sibling-file ownership, the atomic-write rule, the `.bak` restore p
228
222
  - 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.
229
223
  - 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).
230
224
  - Merge ladder exhausted → group `failed`, continue (report flags dependents).
225
+ - 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.
231
226
  - B3/B4/B5 failures → record and continue (carried in the final report).
232
- - 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), or 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).
233
-
234
- ## Homecheck static-defect check (after the last wave, before the smoke gate)
235
-
236
- 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 repeats 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.
237
-
238
- - Gate mode is fixed: scan, fix, and rescan up to 2 rounds; remaining errors are reported, never hidden.
239
- - 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.
240
- - Scan failures, timeouts, and missing rule sets are fail-soft and recorded.
241
-
242
- ## Runtime smoke gate (after the last wave, before Finalization)
243
-
244
- 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:
245
-
246
- - any verdict → the Finalization summary build line: `Smoke: <verdict>`.
247
- - `FAIL_*` → verdict + evidence + fix commits also in the final report's Manual Follow-up list.
248
- - `SKIPPED_*` / `DEPLOY_ERROR` → the reason also in the final report's Manual Follow-up list.
227
+ - 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`).
249
228
 
250
- All outcomes proceed to Finalization.
229
+ ## After the wave loop — Homecheck → smoke gate → Finalization
251
230
 
252
- ## Finalization (after all waves)
231
+ 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:
253
232
 
254
- 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`.
255
- 2. Design issue sweep: list `DESIGN_DIR/SPEC_DESIGN_G*_c*_issue.md` files for manual follow-up.
256
- 3. Verify `design_map.md`: one row per wave member G; every completed row has Start and End; any `进行中` End marks an incomplete group.
257
- 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.
258
- 4. Print the summary report per `references/final-report-template.md` (every section mandatory; all outcomes — including failures — carried, never silently dropped).
259
- 5. Write `state.finalization = { done: true, final_build, homecheck, smoke, at }` (atomic) — the completion marker callers check; absent = Finalization never ran.
233
+ - **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).
234
+ - **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`.
235
+ - **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.
260
236
 
261
237
  ## Ordering & safety rules
262
238
 
@@ -264,7 +240,7 @@ All outcomes proceed to Finalization.
264
240
  - **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.
265
241
  - **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.
266
242
  - **specs.json order is dual — scan order and dependency carrier** (the producer's linearization, `a2h-spec-generate` 的 `publish-specs`). Scan order: groups are ordered by first occurrence; chunks, merges, and wave slicing follow it (backfill may admit a later-order clean group into an earlier wave — wave numbers are not monotone in group order). Dependency carrier: each spec's `deps` (lifted by `plan_groups.ts` to group level; same-page sisters split by the scenario cap re-link through them) point at earlier so-ids, and dispatch-hold (`deps_ready.ts`) staggers within-wave dispatch: 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. Older specs.json without deps keeps pure parallel behavior. The flat fallback bounds this: when the forecast for the remaining pool exceeds 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, and same-wave conflicts surface at B2.
267
- - **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 directly and commits `infra(wave K): shared layer`. B2's wiring application remains idempotent and is not affected.
243
+ - **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 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).
268
244
  - **Every stage is a sub-agent**; results are JSON only; no result is a stop.
269
245
  - **`plan_groups.ts` / `plan_waves.ts` are the single source of grouping/wave-slicing truth** — never recompute by hand, never reorder groups.
270
246
  - **State is durable** — every stage transition is written to `spec_pipeline_state.json` (atomically: temp file + rename) before dispatching the next stage.
@@ -68,8 +68,8 @@ ignore it (a zombie agent's late output never mutates a newer generation). `acce
68
68
  `claimGen`; `close(blocked)`, `retry`, and `group-*` carry no identity. The ledger files are never
69
69
  hand-edited.
70
70
 
71
- **Event loop.** After W0: claim and dispatch chunk 1 of every **ready** member, then end the turn and
72
- wait — `held` members are not dispatched; the release sweep below starts them. Each pass runs the loop
71
+ **Event loop.** After W0: claim and dispatch chunk 1 of every **ready** member, then run the passes below
72
+ (step 9 decides whether the turn ends) — `held` members are not dispatched; the release sweep below starts them. Each pass runs the loop
73
73
  below in order (the spec §11 loop; reconcile is the pivot, not a second source of truth):
74
74
 
75
75
  1. **Consume events.** Read `dispatch/orch.event.json` and `dispatch/waker.event.json` (verify `runId`,
@@ -93,10 +93,12 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
93
93
  4. **Triage (fixed order).**
94
94
  - `deadGroups` / `closed(reason=dead)` → `group-reset --mode fresh` when a generation remains (new
95
95
  `WT/g<G>r<n>` + `specpipe/g<G>r<n>`), else `group-fail`.
96
- - `submitted` chunk → only the group's **last non-terminal chunk** goes `queue-merge`; every submitted
97
- chunk gets `release(done)`. A non-last chunk immediately dispatches its successor (claim → intent →
98
- Agent → confirm) in the same turn. A submitted resolver is handled by step 5 (land, then
99
- `release(merged)`).
96
+ - `submitted` chunk → every submitted chunk gets `release(done)` first; then only the group's **last
97
+ non-terminal chunk** goes `queue-merge`. A non-last chunk immediately dispatches its successor (claim →
98
+ intent → Agent → confirm) in the same turn. A submitted resolver is handled by step 5 (land, then
99
+ `release(merged)`). `queue-merge` uses the same predicate as landing: it reports `chunks-incomplete`
100
+ unless every planned chunk is `done`/`accepted` — not a retryable error; finish the coding, and a
101
+ `closed`/`abandoned` chunk means `group-fail` (it can never land).
100
102
  - `failed` → resolver failures take the B2 ladder; a chunk failure with `contentAttempts < 2` takes
101
103
  `retry` (then claim/dispatch the retry), otherwise `close --reason content-exhausted --expect-gen
102
104
  <claimGen> --token <token>` + `group-fail`.
@@ -114,6 +116,11 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
114
116
  chunks include a `failed`/`closed` one is terminal at `landed-required` → `group-fail <G>` (never retry
115
117
  every turn). If the generation branch was already landed and then deleted, pass the known
116
118
  `--landed <M>` (accepted when it is a first-parent merge naming `specpipe/g<G>r<wtGen>`).
119
+ **A landed branch is not a finished group**: `group-merge --landed` refuses while any planned chunk is
120
+ not `done`/`accepted` (`chunks-incomplete`) — do not retry and do not mark chunks done. `dequeue-merge
121
+ <G>` if queued, then: the group is still `coding` → finish the remaining chunks (a `closed`/`abandoned`
122
+ chunk means `group-fail`); the group is already `merged`/`done` → `group-reopen <G> --base <current main
123
+ HEAD>` (see `references/merge-queue.md` → incomplete group).
117
124
  `group-merge` refuses while main is mid-merge (`MERGE_HEAD` exists); never run it in the same unchecked
118
125
  shell line as `git merge`. A conflict takes ladder hop (a) and
119
126
  parks the queue: main `merge --abort` → `claim resolver:g<G>` → worktree `git merge <main>` →
@@ -125,24 +132,38 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
125
132
  is a pure function of plan deps + group/chunk statuses; a nonzero exit is recorded and retried next
126
133
  turn. A **flat** wave yields `ready` for every pending member. For every member newly in `released`
127
134
  (ready ∧ all chunks `pending`): if the ledger group is already `provisioned` (a `group-reset` created
128
- the new generation), skip the create/`group-worktree` step and go straight to index/staging.
135
+ the new generation), skip the create/`group-worktree` step and go straight to staging.
136
+ **Held release: wiring first.** When the member waited on groups of this same wave, apply the wiring
137
+ of those merged dependencies to main before taking `coding_base`: the B2 apply-wiring procedure
138
+ (`merge-queue.md`) restricted to those groups' `wiring.md` rows, with the same per-row key check and
139
+ permission-index rule, committed as `wiring (deps of G<G>)` (no row left to apply → no commit). Without
140
+ it the worktree has the dependency's code but not its exports / routes, and the coder may not edit
141
+ `Index.ets` or the route table. The wave-end application still runs; its key check skips these rows.
129
142
  Otherwise record `state.groups[G].coding_base = <current main HEAD>`, remove any leftover
130
143
  `WT/g<G>r<wtGen>` (`worktree remove --force`, else `worktree prune`), delete a stale
131
144
  `specpipe/g<G>r<wtGen>`, `git worktree add WT/g<G>r<wtGen> -b specpipe/g<G>r<wtGen> <coding_base>`,
132
- build its index (`ensure_wt_index.ts`, skip when `ENGINE_MODE=off`; exit 1 is degraded, never a
133
- release failure), run `stage_design_inputs.ts`, then `dispatch.mjs group-worktree <G> --wt-gen
145
+ run `stage_design_inputs.ts` (there is no worktree index to build — coders read the shared
146
+ `<HMOS>`/`<ANDROID>` indexes), then `dispatch.mjs group-worktree <G> --wt-gen
134
147
  <wtGen> --base <coding_base>` — the only claim fence. Worktree creation failure → group `failed`,
135
148
  recorded, wave continues. Then claim and dispatch chunk 1. A release never takes an extra concurrency
136
149
  slot.
137
- 7. **Reconcile; dispatch up to `freeSlots`.** For each `dispatchable` entry, claim → intent → background
138
- Agent → confirm. A same-turn successor (step 4/5) and a released held group (step 6) are both covered
139
- by this pass; `chunk k-1 done` is read from the **ledger**, so a lagging state never blocks dispatch.
150
+ 7. **Reconcile; dispatch up to `freeSlots`.** For each `dispatchable` entry, in the order given (most
151
+ `remainingChunks` first, so the longest group starts first), claim → intent → background Agent → confirm. A same-turn successor (step 4/5) and a released held group (step 6) are both covered
152
+ by this pass; `chunk k-1 done`/`accepted` is read from the **ledger**, so a lagging state never blocks dispatch.
140
153
  8. **Residue disposal (scope = every group still holding units, including older waves).** A group whose
141
- units are all terminal but whose group status is not → `queue-merge` when unlanded (then drain), or
142
- `group-merge <G> --landed <merge_commit>` when `branch_landed.ts` reports it already landed. A
143
- zero-commit group whose terminal chunks include `failed`/`closed` can never land: skip the queue and
144
- `group-fail <G>` directly. `failed-group-residue` (a failed group still holding a non-terminal
145
- unit) → dispose of those units (`reject` for invalid evidence, `orphan`/`close` as their state allows):
154
+ units are all terminal but whose group status is not → `queue-merge` **only when every chunk is
155
+ `done`/`accepted`** (then drain), or `group-merge <G> --landed <merge_commit>` under the same condition
156
+ when `branch_landed.ts` reports it already landed. A group whose terminal chunks include
157
+ `failed`/`closed`/`abandoned` can never land: skip the queue and `group-fail <G>` directly. `terminal-group-open-chunks` (a `merged`/`done` group that still owns a
158
+ pending chunk — a premature landing, usually from an older release) → `group-reopen <G> --base
159
+ <current main HEAD>` when a generation remains, else `group-fail`; it is never "already done".
160
+ `open-chunks-outside-plan` (a non-terminal group whose open chunks fell out of the active plan after a
161
+ later wave) → re-`init` its wave so dispatch and completion see it again; never let it fall through to
162
+ the final report.
163
+ `group-fail` closes every non-terminal unit of the group itself (reason `group-failed`; a later event
164
+ of an agent still running is absorbed), so a failed group holds no residue; `group-reset` reopens them.
165
+ `failed-group-residue` (a failed group still holding a non-terminal unit — only a ledger written before
166
+ that rule) → dispose of those units (`reject` for invalid evidence, `orphan`/`close` as their state allows):
146
167
  they can never reach a verdict on their own and would keep `complete` false forever. `deadGroups` → fresh
147
168
  reset (if a generation remains) or
148
169
  `group-fail`. At wave end (no claimed/dispatched/live/submitted unit and no queued merge): an
@@ -150,11 +171,21 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
150
171
  whose deps can never be
151
172
  satisfied → `close --reason blocked` + `group-fail`. Then re-check `complete`; otherwise make sure a
152
173
  waker is armed (`probe` → `inPlace:false` or a different `runId`).
153
- 9. **Wait.** `dispatch.mjs <HMOS> wait --max-wait 120 --poll 5 --baseline <HMOS>/.hometrans/dispatch/snapshots/orch.snapshot.json
154
- --event-file <HMOS>/.hometrans/dispatch/orch.event.json` (the next deadline comes from reconcile). It
155
- persists its event before returning, so an event created at the end of a turn is still consumed at the
156
- start of the next.
157
- 10. Go to step 1.
174
+ `dispatch.mjs <HMOS> next` (read-only, after `reconcile`) prints this pass as `{ actions, exit }`: the
175
+ ordered actions of steps 2–8 (`evidence-release`, `retry-or-close`, `resume-or-accept`, `queue-merge`,
176
+ `group-reopen-or-fail` (`terminal-group-open-chunks`), `reinit-wave` (`open-chunks-outside-plan`), `dispose`
177
+ (`failed-group-residue`), `group-reset-or-fail`, then `claim` up to `freeSlots`, longest group first) and step 9's exit
178
+ (`complete` / `end-turn` / `wait`). Work its list top to bottom instead of re-deriving the pass.
179
+ 9. **End of pass — the only exits.**
180
+ - `complete` (step 8) → leave the loop; continue at B3.
181
+ - A unit is active (claimed / dispatched / live / submitted) → its background agent's completion
182
+ notification, or the armed waker (`probe` above), starts the next turn: **end the turn now**. Never
183
+ sit in a foreground `wait` or `sleep` while an agent runs: a blocked turn does not receive its
184
+ completion notification (measured: 16–30 polling rounds per batch while the notifications waited).
185
+ - No unit is active and not complete (only a deadline can move the wave: a held group, a timeout) →
186
+ `dispatch.mjs <HMOS> wait --max-wait 120 --poll 5 --baseline <HMOS>/.hometrans/dispatch/snapshots/orch.snapshot.json
187
+ --event-file <HMOS>/.hometrans/dispatch/orch.event.json` (it persists its event before returning, so
188
+ one created at the end of a turn is still consumed at the start of the next), then go to step 1.
158
189
 
159
190
  **Never-strand guard (checked at every turn end, in this order).**
160
191
 
@@ -198,6 +229,19 @@ with these fields (the skill's Inputs). The orchestrator owns every ledger write
198
229
  its artifacts.
199
230
 
200
231
  - `harmonyos-project-path`: the group's worktree `WT/g<G>r<wtGen>` (W0's per-project worktree root)
232
+ - `android-project-path`: `<ANDROID>` (the pipeline's Android source root, required by this pipeline).
233
+ It is the join base for the spec's `## 安卓代码参考` anchors, so the coder can settle an uncertain spec
234
+ detail from the real source instead of guessing; the spec itself stays the implementation baseline.
235
+ Pass it on **every** chunk dispatch; a coder that finds it missing falls back to spec-only
236
+ implementation and records `android-source: unavailable` — never omit it because "this chunk looks
237
+ spec-only".
238
+ - `hmos-project-path`: `<HMOS>` (absolute — the shared main checkout, i.e. the index root for existing APIs,
239
+ shared layers and call chains; never the worktree)
240
+ - `hmos-index-ready` / `android-index-ready`: the orchestrator's verdict for each shared index (`true` = that
241
+ repo's last `ensure_index.ts` exited 0 with an action other than `skip`); a `false`/missing one omits that
242
+ index from the HomeGraph clause below
243
+ - `homegraph-guide`: `<skill-dir>/references/homegraph-cli.md` — the query discipline and evidence format
244
+ - `engine-mode` / `engine-degraded-reason`: `<ENGINE_MODE>` / the recorded degraded reason (`null` when none)
201
245
  - `spec-file`: this chunk's `chunk_<k>_spec.md` (absolute path into main-tree `.hometrans`)
202
246
  - `spec-design-file`: `<DESIGN_DIR>/SPEC_DESIGN_G<G>_c<k>.md` (absolute path into the main tree)
203
247
  - `design-mode`: `true` when the chunk's design file is absent or its `_issue.md` exists (delete both
@@ -237,20 +281,47 @@ its artifacts.
237
281
  Step 2). With `unavailable` the coder skips the `devecocli docs` wrapper, falls back to its
238
282
  `references/ISSUES.md`, and records `state-docs: unavailable` in `state_docs_used.md`. Never paste
239
283
  the doc rules or a doc key list into the prompt — the coder skill owns them.
240
- - worktree index: `<worktree>/.homegraph/`, built by the dispatcher when the worktree was created
241
- (`ensure_wt_index.ts` — W0 for ready members, the deps release sweep for held ones). Read-only for the
242
- coder; the prompt clause below carries the usage rules. **No usable index** (the script exited 1, or
243
- the orchestrator skipped the build for `ENGINE_MODE=off` — both recorded in the wave log) → the clause
244
- is omitted and the coder uses plain grep/read.
245
- - worktree index clause (append it to the `prompt extra` **only** when the index build exited 0 — the
246
- same condition as the bullet above; omit the whole clause when the build was degraded or skipped,
247
- never paste a conditional sentence): "**HomeGraph rule**: this worktree has its own read-only index —
248
- query it with `homegraph explore -p <this worktree> \"<query>\"`. Prefer the CLI; the MCP tool may be
249
- used only when the MCP session's bound root is this worktree (a mismatched `projectPath` is ignored by
250
- the server and answers from the bound tree). Never run `homegraph init`/`sync`/`index`, and never query
251
- `<HMOS>`'s index — it answers from a different branch and the CLI prints no mismatch warning. The index
252
- is a snapshot from this worktree's creation (or its last `--sync`), so symbols you write now may be
253
- missing from it."
284
+ - `api-docs-mode`: `<state.config.api_docs_mode>` (`available` / `unavailable`, `unavailable` when the
285
+ field is absent) — the coder's soft platform-API doc gate reads it (`references/code-generation.md`
286
+ Step 2, "Platform API doc gate"). It is independent of `state-docs-mode`; never paste the lookup
287
+ rules, the catalogue names, or the `api-*` key list into the prompt.
288
+ - shared indexes: `<HMOS>/.homegraph/` (main tree — reference for existing APIs, shared layers and call
289
+ chains) and `<ANDROID>/.homegraph/` (the source implementation). Both are read-only for the coder; the
290
+ orchestrator is the only writer. There is no worktree index. **No usable index** (that repo's
291
+ `ensure_index.ts` exited 1, or the orchestrator skipped it for `ENGINE_MODE=off` — both recorded in the
292
+ wave log) → the corresponding path is omitted and the coder uses plain grep/read.
293
+ - HomeGraph clause (append it to the `prompt extra` **only** when at least one shared index is ready — a
294
+ `*-index-ready` that is `false`/missing simply omits that path, never advertise it; omit the whole clause
295
+ when both are unusable, and never paste a conditional sentence): "**HomeGraph rule**: the shared indexes
296
+ are read-only and CLI-only — `<hmos-project-path>` for existing APIs, shared layers and call chains,
297
+ `<android-project-path>` for the source implementation. Locate code with
298
+ `homegraph explore -p \"<hmos-project-path>\" \"<TypeA TypeB Type.member>\"` or
299
+ `homegraph explore -p \"<android-project-path>\" \"<Symbol>\"`, plus `impact` / `callers` (2–5 names per
300
+ `explore`; `-j` only on `status`/`query`/`callers`/`callees`/`impact`/`affected`/`files` — `explore` and
301
+ `node` take no `-j`). Never run `homegraph init`/`sync`/`index`/`unlock`: the orchestrator owns both
302
+ indexes and is their only writer. There is no worktree index — never create or query one, and never
303
+ treat a symbol in either index as proof it exists here. An index symbol missing from this worktree is
304
+ `index_ahead` (another group's merged code or a later commit): **never import, copy or re-implement
305
+ it** — the worktree's `Read`/`Grep` wins, and if you truly depend on it, wait for the owning group to
306
+ merge. The reverse is `trust the worktree`: a symbol present here but absent from the index is real —
307
+ re-query once, then cite the file's `file:line`. **Start with `<hmos-project-path>` before reading source**:
308
+ one `explore` with this chunk's modules / pages / VMs / shared-layer symbols; query
309
+ `<android-project-path>` only when the SPEC's `## 安卓代码参考` anchor is missing/ambiguous or the scenario
310
+ needs a cross-file call chain (never once per scenario), and add `impact`/`callers` for shared-layer
311
+ changes. Never truncate `explore` output (`| Select-Object -First N`); `Partial locator` is a budget note,
312
+ not proof that a file is unindexed. Record the queries by phase — first line `start | hmos`, then
313
+ `design | android` for SPEC anchor gaps and `code | hmos` for impact — with their `file:line` anchors, plus
314
+ `degraded: <reason>` / `fallback: <reason>` / `not-applicable: <file>` when no query was possible or the
315
+ change is not code, in `commit-info.md` under `## HomeGraph evidence`. A missing section, a section
316
+ carrying none of anchor / `degraded:` / `fallback:` / `not-applicable:`, is `homegraph-evidence-missing`;
317
+ anchors without a `start | hmos` line are `homegraph-start-missing`: an evidence failure under
318
+ `ENGINE_MODE=required`, a warning under `auto`.
319
+ Read `<skill-dir>/references/homegraph-cli.md` for the full query discipline."
320
+ - engine-degraded clause (append it to the `prompt extra` when `engine-degraded-reason` is non-null):
321
+ "**HomeGraph degraded**: the shared index refresh had a degraded outcome (`<engine-degraded-reason>`);
322
+ the snapshot may lag HEAD. Do not retry, repair or rebuild it — where the index looks stale fall back to
323
+ `read`/`grep`, and record the reason as `degraded: <engine-degraded-reason>` in
324
+ `## HomeGraph evidence`."
254
325
  - prompt extra: "Implement all scenarios in the given spec-file (the slice already contains only this
255
326
  chunk's specs). Every commit message MUST start with the so-ids implemented in that commit
256
327
  ('so-26,so-27: ...'). Resume note: so-<id> 已提交的实现从 so-<next> 继续。**Code-first rule**: the
@@ -262,7 +333,9 @@ its artifacts.
262
333
  scripts, git) are fine. Compile verification belongs to B3 alone (`build-fixer` runs `devecocli build`
263
334
  once per wave on the main tree). **State-refresh rule**: before choosing any state variable or
264
335
  decorator, follow the coder skill's state-management doc gate and write `state_docs_used.md`; never
265
- settle a decorator from memory or analogy. **Your final JSON must echo the `unitId` given above.**" — resume
336
+ settle a decorator from memory or analogy. **API-usage rule**: for a platform API whose call shape this
337
+ worktree does not already show, follow the coder skill's platform-API doc gate and record it in
338
+ `state_docs_used.md`; never invent a signature, an `await`, or a lifecycle from memory. **Your final JSON must echo the `unitId` given above.**" — resume
266
339
  detection is mechanical: parse `git -C <worktree> log --oneline <TASK_BASE>..` commit-message so-id
267
340
  prefixes to find the last completed so-id before any re-dispatch. `TASK_BASE` = the ledger group's
268
341
  `base` (falling back to `WAVE_BASE`); `coding_base` in state is a read-only cache. Filter the parsed
@@ -270,3 +343,16 @@ its artifacts.
270
343
  never skip-read).
271
344
  - return JSON: `{ "ok": true, "unitId": "chunk:g<G>c<k>", "commits": "<TASK_BASE>..<HEAD>",
272
345
  "change_type": "code", "wiring": "wiring.md"|null, "note": null }`
346
+
347
+ ## Build breaker
348
+
349
+ A wave whose B3 build (or B4's last review-round build) ended `FAILED` still runs B4 → B5 → C, but the
350
+ next wave never codes on a red main: every coder of wave K+1 would branch from code that does not compile,
351
+ and their own build would fail for reasons outside their chunk. Before the next wave's W0:
352
+
353
+ 1. Dispatch one `build-fixer` against `<HMOS>` (`output_path: <HMOS>/.hometrans/wave_<K+1>/prebuild`) and
354
+ validate its reply as in B3.
355
+ 2. `SUCCESS` → start wave K+1 as usual.
356
+ 3. Still `FAILED` → start no further wave. Go to the Homecheck gate / Finalization; the remaining groups stay
357
+ `pending`, and the final report lists `waves not started: build still red after wave K` with the fixer's
358
+ report as manual follow-up.