@buaa_smat/hometrans 26.0.5 → 26.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/README.md +249 -279
  2. package/agents/code-reviewer.md +1 -1
  3. package/dist/cli/editors.json +20 -0
  4. package/dist/platform/registry.js +1 -0
  5. package/dist/platform/validate.js +2 -1
  6. package/i18n/agents/code-reviewer.md +1 -1
  7. package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  8. package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  9. package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  10. package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  11. package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  12. package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  13. package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  14. package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  15. package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  16. package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  17. package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  18. package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
  19. package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
  20. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
  21. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  22. package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  23. package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
  24. package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  25. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  26. package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  27. package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  28. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
  29. package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  30. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  31. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  32. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  33. package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
  34. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  35. package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  36. package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  37. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  42. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  43. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  44. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  45. package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  46. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  47. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  48. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  49. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
  50. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  51. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  52. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  53. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  54. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  55. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  56. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  57. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  58. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  59. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  60. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  61. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  79. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  80. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  81. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  82. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  83. package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
  84. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
  85. package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
  86. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  87. package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
  88. package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
  89. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
  90. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  91. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  92. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
  93. package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  94. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  95. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
  96. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
  97. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  98. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
  99. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  100. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
  101. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
  102. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
  103. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
  104. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
  105. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
  106. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  107. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  108. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
  109. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
  110. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
  111. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
  112. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
  113. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  114. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  115. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  116. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  117. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  118. package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  119. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
  120. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
  122. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  123. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
  124. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  125. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
  126. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  127. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
  128. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  129. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  131. package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
  132. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  133. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  134. package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  135. package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  136. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
  137. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  138. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  139. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  140. package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  141. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  142. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
  143. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  144. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  145. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  146. package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
  147. package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
  148. package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
  149. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
  150. package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  151. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  152. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  153. package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  154. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  155. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
  156. package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
  157. package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  158. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  159. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  160. package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  161. package/package.json +2 -1
  162. package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  163. package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  164. package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
  165. package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
  166. package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
  167. package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
  168. package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
  169. package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  170. package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  171. package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  172. package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
  173. package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
  174. package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
  175. package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
  176. package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
  177. package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  178. package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
  179. package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
  180. package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
  181. package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
  182. package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
  183. package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  184. package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  185. package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  186. package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  187. package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  188. package/skills/a2h-app-migrate/SKILL.md +31 -14
  189. package/skills/a2h-app-migrate/references/stage-map.md +4 -2
  190. package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
  191. package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
  192. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
  193. package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
  194. package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
  195. package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
  196. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  197. package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
  198. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
  199. package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  200. package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
  201. package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
  202. package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
  203. package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
  204. package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  205. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  206. package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  207. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
  208. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  209. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
  210. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
  211. package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  212. package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  213. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  214. package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  215. package/skills/a2h-batch-ui-align/SKILL.md +14 -12
  216. package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  217. package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  218. package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  219. package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  220. package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  221. package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  222. package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  223. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  224. package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  225. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  226. package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  227. package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  228. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  229. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  230. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  231. package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
  232. package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  233. package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  234. package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  235. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  236. package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
  237. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  238. package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
  239. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
  240. package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
  241. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  242. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  243. package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
  244. package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
  245. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  246. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  247. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
  248. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  249. package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  250. package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  251. package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  252. package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  253. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  254. package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  255. package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  256. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  257. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  258. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  259. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  260. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  261. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  262. package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  263. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  264. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  265. package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  266. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  267. package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  268. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
  269. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
  270. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
  271. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
  272. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
  273. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  274. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  275. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
  276. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
  277. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
  278. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
  279. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  280. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
  281. package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
  282. package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
  283. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
  284. package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
  285. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
  286. package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
  287. package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
  288. package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
  289. package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  290. package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
  291. package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
  292. package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
  293. package/skills/a2h-page-specgen/SKILL.md +36 -5
  294. package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
  295. package/skills/a2h-page-specgen/references/evidence.md +2 -1
  296. package/skills/a2h-page-specgen/references/execution-model.md +13 -5
  297. package/skills/a2h-page-specgen/references/gates.md +33 -7
  298. package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  299. package/skills/a2h-page-specgen/references/spec-example.md +166 -32
  300. package/skills/a2h-page-specgen/references/spec-template.md +8 -5
  301. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
  302. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  303. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  304. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
  305. package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  306. package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
  307. package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  308. package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
  309. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
  310. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  311. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
  312. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
  313. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  314. package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
  315. package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
  316. package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
  317. package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
  318. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
  319. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
  320. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
  321. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
  322. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
  323. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  324. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  325. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
  326. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
  327. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
  328. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
  329. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
  330. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  331. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  332. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  333. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  334. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  335. package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  336. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
  337. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  338. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
  339. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  340. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
  341. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  342. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
  343. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
  344. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  345. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
  346. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  347. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  348. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
  349. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  350. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
  351. package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
  352. package/skills/a2h-resource-convert/SKILL.md +1 -1
  353. package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
  354. package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
  355. package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
  356. package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
  357. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  358. package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
  359. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  360. package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  361. package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  362. package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
  363. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  364. package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
  365. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
  366. package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  367. package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  368. package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  369. package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  370. package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
  371. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
  372. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  373. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
  374. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
  375. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
  376. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
  377. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
  378. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
  379. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
  380. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
  381. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
  382. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
  383. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
  384. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
  385. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
  386. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
  387. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
  388. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
  389. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
  390. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
  391. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
  392. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
  393. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
  394. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
  395. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  396. package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
  397. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
  398. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
  399. package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
  400. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  401. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
  402. package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
  403. package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
  404. package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
  405. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
  406. package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
  407. package/skills/a2h-spec-generate/references/input-formats.md +1 -1
  408. package/skills/a2h-utg-explorer/SKILL.md +11 -5
  409. package/skills/a2h-utg-explorer/references/architecture.md +37 -19
  410. package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
  411. package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
  412. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
  413. package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
  414. package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  415. package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
  416. package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
  417. package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
  418. package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
  419. package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
  420. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  421. package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
  422. package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
  423. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
  424. package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
  425. package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
  426. package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
  427. package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
  428. package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
  429. package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
  430. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  431. package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  432. package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
  433. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
  434. package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
  435. package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
  436. package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
  437. package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
  438. package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
  439. package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
  440. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
  441. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
  442. package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
  443. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
  444. package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
  445. package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
  446. package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
  447. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
  448. package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
  449. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  450. package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
  451. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
  452. package/skills/a2h-utg-static/SKILL.md +3 -3
  453. package/skills/a2h-utg-static/references/extractors.md +7 -0
  454. package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  455. package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  456. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
  457. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  458. package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
  459. package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
  460. package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
  461. package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
  462. package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  463. package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
  464. package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  465. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
  466. package/resource/convert_pipeline_process.svg +0 -114
  467. package/resource/project_architecture.svg +0 -120
  468. package/resource/set_environment.png +0 -0
  469. package/resource/set_multimodel.png +0 -0
  470. package/skills/a2h-app-migrate/references/specs.example.json +0 -19
  471. package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  472. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Regenerate data/framework-strings/strings.json from an Android framework resource table.
4
+ *
5
+ * Android renders `@android:string/*` on the device, so an app owns neither the text nor its
6
+ * translations. Once HarmonyOS draws the same control itself (a preference dialog, a text-selection
7
+ * bar), the value has to be carried over per language - this tool produces that table.
8
+ *
9
+ * Source of truth is the AOSP resource XML (Apache-2.0). This tool reads a compiled framework table
10
+ * (`android.jar`) because every Android build environment already has one; regenerate from an AOSP
11
+ * checkout before redistribution and record the tag in manifest.json.
12
+ *
13
+ * node scripts/sync-framework-strings.mjs [--jar <android.jar>] [--aapt2 <aapt2>]
14
+ * [--out <dir>] [--api <level>]
15
+ *
16
+ * --jar defaults to $ANDROID_HOME/platforms/android-<latest>/android.jar
17
+ * --aapt2 defaults to $ANDROID_HOME/build-tools/<latest>/aapt2(.exe)
18
+ */
19
+ import fs from 'node:fs';
20
+ import path from 'node:path';
21
+ import crypto from 'node:crypto';
22
+ import { spawnSync } from 'node:child_process';
23
+ import { fileURLToPath } from 'node:url';
24
+
25
+ const HERE = path.dirname(fileURLToPath(import.meta.url));
26
+ const DEFAULT_OUT = path.join(HERE, '..', 'data', 'framework-strings');
27
+
28
+ /** HarmonyOS language directory -> Android resource config (`en` is the default config). */
29
+ const LANGUAGES = {
30
+ en: '',
31
+ ru: 'ru',
32
+ zh_CN: 'zh-rCN',
33
+ zh_TW: 'zh-rTW',
34
+ ja: 'ja',
35
+ ko: 'ko',
36
+ fr: 'fr',
37
+ de: 'de',
38
+ es: 'es',
39
+ pt: 'pt',
40
+ it: 'it',
41
+ ar: 'ar',
42
+ hi: 'hi',
43
+ th: 'th',
44
+ vi: 'vi',
45
+ id: 'in', // legacy AOSP config name for Indonesian
46
+ tr: 'tr',
47
+ nl: 'nl',
48
+ pl: 'pl',
49
+ uk: 'uk',
50
+ };
51
+
52
+ /**
53
+ * Strings a framework widget can surface. Only names that exist in the framework table are kept, so
54
+ * adding a speculative name here is harmless.
55
+ */
56
+ const KEYS = [
57
+ 'ok', 'cancel', 'yes', 'no',
58
+ 'copy', 'cut', 'paste', 'selectAll', 'search_go', 'delete', 'undo', 'redo',
59
+ 'action_menu_overflow_description', 'toolbar_collapse_description',
60
+ 'capital_on', 'capital_off', 'unknownName',
61
+ ];
62
+
63
+ function arg(argv, name) {
64
+ const i = argv.indexOf(`--${name}`);
65
+ return i >= 0 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : null;
66
+ }
67
+
68
+ function latestVersioned(dir) {
69
+ if (!fs.existsSync(dir)) return null;
70
+ const entries = fs.readdirSync(dir)
71
+ .filter((n) => /^\d+/.test(n))
72
+ .sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
73
+ return entries.length > 0 ? path.join(dir, entries[entries.length - 1]) : null;
74
+ }
75
+
76
+ const sdk = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT || '';
77
+ const platformDir = latestVersioned(path.join(sdk, 'platforms'));
78
+ const jar = arg(process.argv, 'jar') || (platformDir ? path.join(platformDir, 'android.jar') : null);
79
+ const aapt2Dir = latestVersioned(path.join(sdk, 'build-tools'));
80
+ const aapt2 = arg(process.argv, 'aapt2') ||
81
+ (aapt2Dir ? path.join(aapt2Dir, process.platform === 'win32' ? 'aapt2.exe' : 'aapt2') : 'aapt2');
82
+ const outDir = arg(process.argv, 'out') || DEFAULT_OUT;
83
+ const api = arg(process.argv, 'api') || (jar ? (path.basename(path.dirname(jar)).replace(/\D/g, '') || 'unknown') : 'unknown');
84
+
85
+ if (!jar || !fs.existsSync(jar)) {
86
+ console.error(`[sync-framework-strings] android.jar not found: ${jar || '(no ANDROID_HOME)'}`);
87
+ process.exit(2);
88
+ }
89
+
90
+ const dump = spawnSync(aapt2, ['dump', 'resources', jar], { encoding: 'utf8', maxBuffer: 512 * 1024 * 1024 });
91
+ if (dump.status !== 0) {
92
+ console.error(`[sync-framework-strings] aapt2 failed: ${dump.stderr || dump.status}`);
93
+ process.exit(2);
94
+ }
95
+
96
+ const strings = {};
97
+ const reRes = /^\s+resource 0x[0-9a-f]+ string\/([A-Za-z0-9_.]+)/;
98
+ const reVal = /^\s+\(([^)]*)\) "(.*)"$/;
99
+ let cur = null;
100
+ for (const line of dump.stdout.split(/\r?\n/)) {
101
+ const r = reRes.exec(line);
102
+ if (r) { cur = r[1]; strings[cur] = strings[cur] || {}; continue; }
103
+ if (/^\s+resource /.test(line)) { cur = null; continue; }
104
+ if (cur === null) continue;
105
+ const v = reVal.exec(line);
106
+ if (v) strings[cur][v[1] || ''] = v[2];
107
+ }
108
+
109
+ const tables = {};
110
+ const missing = {};
111
+ for (const [lang, config] of Object.entries(LANGUAGES)) {
112
+ const table = {};
113
+ let absent = 0;
114
+ for (const key of KEYS) {
115
+ const value = strings[key]?.[config];
116
+ if (value === undefined) { absent++; continue; }
117
+ table[key] = value;
118
+ }
119
+ if (lang === 'en' && Object.keys(table).length === 0) {
120
+ console.error('[sync-framework-strings] no English values parsed - wrong jar or aapt2 output');
121
+ process.exit(2);
122
+ }
123
+ tables[lang] = table;
124
+ missing[lang] = absent;
125
+ }
126
+
127
+ fs.mkdirSync(outDir, { recursive: true });
128
+ const tableFile = path.join(outDir, 'strings.json');
129
+ fs.writeFileSync(tableFile, `${JSON.stringify(tables, null, 2)}\n`, 'utf8');
130
+
131
+ const manifest = {
132
+ source: 'Android framework resource table (aapt2 dump resources)',
133
+ aospTag: null,
134
+ apiLevel: api,
135
+ note: 'Values are Android Open Source Project strings (Apache-2.0). Regenerate from an AOSP tag before redistribution and record it in aospTag.',
136
+ languages: Object.keys(LANGUAGES),
137
+ keys: Object.keys(tables.en),
138
+ requestedKeys: KEYS,
139
+ missingByLanguage: missing,
140
+ generatedAt: new Date().toISOString().slice(0, 10),
141
+ sha256: crypto.createHash('sha256').update(fs.readFileSync(tableFile)).digest('hex'),
142
+ };
143
+ fs.writeFileSync(path.join(outDir, 'manifest.json'), `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
144
+
145
+ console.log(`[sync-framework-strings] api=${api} languages=${Object.keys(LANGUAGES).length} keys=${manifest.keys.length}`);
146
+ console.log(` out: ${tableFile} (${fs.statSync(tableFile).size} B)`);
147
+ console.log(` missing by language: ${JSON.stringify(missing)}`);
@@ -0,0 +1,131 @@
1
+ // Framework strings (`@android:string/*`) resolve per output language from
2
+ // data/framework-strings/strings/<lang>.json. Android renders those strings on the device, so an app
3
+ // never owned the text or its translations; resolving them in English only would turn a localized
4
+ // platform dialog into an English-only HarmonyOS dialog.
5
+ // Run from scripts/: node --test tests/framework_strings.test.mjs
6
+ import { test } from 'node:test';
7
+ import assert from 'node:assert/strict';
8
+ import { spawnSync } from 'node:child_process';
9
+ import * as fs from 'node:fs';
10
+ import * as os from 'node:os';
11
+ import * as path from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
13
+
14
+ const CONVERTER = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'a2h_resource_convert.ts');
15
+ const TABLES = JSON.parse(fs.readFileSync(path.join(path.dirname(CONVERTER), '..', 'data', 'framework-strings', 'strings.json'), 'utf8'));
16
+
17
+ const VALUES = (values) => `<?xml version="1.0" encoding="utf-8"?>\n<resources>\n${Object.entries(values)
18
+ .map(([name, value]) => ` <string name="${name}">${value}</string>`).join('\n')}\n</resources>\n`;
19
+
20
+ /** Runs the converter over a temp `res/` tree; returns { project, records }. */
21
+ function convert(qualifiers) {
22
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'rc-fw-'));
23
+ const res = path.join(dir, 'res');
24
+ for (const [qualifier, values] of Object.entries(qualifiers)) {
25
+ const target = path.join(res, qualifier);
26
+ fs.mkdirSync(target, { recursive: true });
27
+ fs.writeFileSync(path.join(target, 'strings.xml'), VALUES(values), 'utf8');
28
+ }
29
+ const project = path.join(dir, 'proj');
30
+ const records = path.join(dir, 'records.json');
31
+ const run = spawnSync(process.execPath, [CONVERTER, '--res', res, '--harmony', project, '--records', records, '--quiet'], { encoding: 'utf8' });
32
+ assert.equal(run.status, 0, run.stderr);
33
+ return { dir, project, records };
34
+ }
35
+
36
+ function element(project, qualifier, name) {
37
+ const file = path.join(project, 'entry', 'src', 'main', 'resources', qualifier, 'element', 'string.json');
38
+ const doc = JSON.parse(fs.readFileSync(file, 'utf8'));
39
+ const hit = doc.string.find((s) => s.name === name);
40
+ return hit ? hit.value : undefined;
41
+ }
42
+
43
+ function cleanup(dir) {
44
+ fs.rmSync(dir, { recursive: true, force: true });
45
+ }
46
+
47
+ /** Runs the converter over a temp `res/` tree built from raw relative paths. */
48
+ function convertRaw(files) {
49
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'rc-fw-'));
50
+ const res = path.join(dir, 'res');
51
+ for (const [rel, content] of Object.entries(files)) {
52
+ const target = path.join(res, rel);
53
+ fs.mkdirSync(path.dirname(target), { recursive: true });
54
+ fs.writeFileSync(target, content, 'utf8');
55
+ }
56
+ const project = path.join(dir, 'proj');
57
+ const records = path.join(dir, 'records.json');
58
+ const run = spawnSync(process.execPath, [CONVERTER, '--res', res, '--harmony', project, '--records', records, '--quiet'], { encoding: 'utf8' });
59
+ assert.equal(run.status, 0, run.stderr);
60
+ return { dir, project, records };
61
+ }
62
+
63
+ test('a framework string resolves to its English value in base', (t) => {
64
+ const run = convert({ values: { cancel_button: '@android:string/cancel' } });
65
+ t.after(() => cleanup(run.dir));
66
+ assert.equal(element(run.project, 'base', 'cancel_button'), 'Cancel');
67
+ });
68
+
69
+ test('the same framework string resolves to the localized value in ru', (t) => {
70
+ const run = convert({
71
+ values: { cancel_button: '@android:string/cancel' },
72
+ 'values-ru': { cancel_button: '@android:string/cancel' },
73
+ });
74
+ t.after(() => cleanup(run.dir));
75
+ assert.equal(element(run.project, 'ru', 'cancel_button'), TABLES.ru.cancel);
76
+ assert.notEqual(element(run.project, 'ru', 'cancel_button'), 'Cancel');
77
+ });
78
+
79
+ test('a language the table does not cover falls back to base and warns', (t) => {
80
+ const run = convert({
81
+ values: { cancel_button: '@android:string/cancel' },
82
+ // Czech is not a bundled language
83
+ 'values-cs': { cancel_button: '@android:string/cancel' },
84
+ });
85
+ t.after(() => cleanup(run.dir));
86
+ assert.equal(element(run.project, 'cs', 'cancel_button'), 'Cancel');
87
+ const rec = JSON.parse(fs.readFileSync(run.records, 'utf8'));
88
+ assert.ok(rec.warnings.some((w) => w.includes('@android:string/cancel') && w.includes('cs')),
89
+ `expected a fallback warning, got: ${JSON.stringify(rec.warnings)}`);
90
+ });
91
+
92
+ test('yes/no keep the framework semantics (OK / Cancel), not literal Yes / No', (t) => {
93
+ const run = convert({ values: { yes_label: '@android:string/yes', no_label: '@android:string/no' } });
94
+ t.after(() => cleanup(run.dir));
95
+ assert.equal(element(run.project, 'base', 'yes_label'), TABLES.en.yes);
96
+ assert.equal(element(run.project, 'base', 'no_label'), TABLES.en.no);
97
+ assert.equal(TABLES.en.yes, 'OK');
98
+ assert.equal(TABLES.en.no, 'Cancel');
99
+ });
100
+
101
+ test('re-running the conversion produces byte-identical resources', (t) => {
102
+ const first = convert({ values: { cancel_button: '@android:string/cancel' }, 'values-ru': { cancel_button: '@android:string/cancel' } });
103
+ const second = convert({ values: { cancel_button: '@android:string/cancel' }, 'values-ru': { cancel_button: '@android:string/cancel' } });
104
+ t.after(() => cleanup(first.dir));
105
+ t.after(() => cleanup(second.dir));
106
+ for (const qualifier of ['base', 'ru']) {
107
+ const a = fs.readFileSync(path.join(first.project, 'entry', 'src', 'main', 'resources', qualifier, 'element', 'string.json'), 'utf8');
108
+ const b = fs.readFileSync(path.join(second.project, 'entry', 'src', 'main', 'resources', qualifier, 'element', 'string.json'), 'utf8');
109
+ assert.equal(a, b, qualifier);
110
+ }
111
+ });
112
+ test('a framework string referenced only from a style is emitted as a localized fw_ key', (t) => {
113
+ const style = (value) => [
114
+ '<?xml version="1.0" encoding="utf-8"?>',
115
+ '<resources>',
116
+ ' <style name="AppDialog" parent="Preference.DialogPreference">',
117
+ ` <item name="android:negativeButtonText">${value}</item>`,
118
+ ' <item name="android:positiveButtonText">@android:string/ok</item>',
119
+ ' </style>',
120
+ '</resources>',
121
+ '',
122
+ ].join('\n');
123
+ const run = convertRaw({
124
+ 'values/styles.xml': style('@android:string/cancel'),
125
+ 'values-ru/styles.xml': style('@android:string/cancel'),
126
+ });
127
+ t.after(() => cleanup(run.dir));
128
+ assert.equal(element(run.project, 'base', 'fw_cancel'), 'Cancel');
129
+ assert.equal(element(run.project, 'ru', 'fw_cancel'), TABLES.ru.cancel);
130
+ assert.equal(element(run.project, 'base', 'fw_ok'), TABLES.en.ok);
131
+ });
@@ -27,6 +27,7 @@ Deterministic precomputation lives in the scripts (inventory: `references/script
27
27
  | `references/scripts.md` | script + test inventory | as needed |
28
28
  | `references/post-loop.md` | after the wave loop: Homecheck → smoke gate → Finalization, with their markers | after the last wave |
29
29
  | `references/static-defect-gate.md` | Homecheck static-defect gate | before smoke |
30
+ | `references/reply-recovery.md` | host-independent reply recovery (F0/B3/B4 rebuild/build breaker/post-gate build-fixer) | before dispatching a foreground stage agent |
30
31
  | `references/final-report-template.md` | Finalization summary template | at Finalization |
31
32
 
32
33
  **Execution model — every stage runs in an isolated sub-agent** (details at I5): the orchestrator parses compact JSON results, runs the scripts and git/worktree bookkeeping itself, and dispatches the next stage. Only B1 chunk agents and B2 conflict resolvers are background dispatches; user interaction is confined to Initialization — after I4 the run is autonomous (per-group failures logged, never paused). Background completion notifications are the run's only immediate wakeup source, and one that never arrives strands the whole wave — so every background dispatch is claimed on the on-disk **dispatch ledger** (`dispatch.mjs`) before it leaves, and a durable **waker** (`dispatch.mjs waker`) holds a wakeup independently of any notification (discipline: `references/execution-model.md`).
@@ -52,6 +53,7 @@ Parse the arguments from the user's message (natural language is fine — no fix
52
53
  | `IMAGE_READ` | `--image-read true\|false`: whether this host's sub-agents can read image files (a2h-app-migrate probes it at bootstrap). `false` → every sub-agent prompt carries the no-image rule of I5. Never probe it by opening an image in this session | `true` |
53
54
  | `SHARED_LAYER` | `auto` (default) or `off`; persisted in `state.config.shared_layer` |
54
55
  | `SOURCE_KIND` | optional `android` (default) or `uniapp`; persisted in `state.config.source_kind`. No current caller passes it (`a2h-app-migrate` exports no `SOURCE_KIND` variable), so it defaults to `android` and only labels the F0 agent's source-evidence reading — scanning is project-neutral |
56
+ | `WAIT_MODE` | `background` (default): B1 ends the turn and waits for notifications / the waker. `foreground`: this run is itself a dispatched sub-agent (e.g. under `a2h-app-migrate`) whose ended turn would return to its caller — B1 never ends the turn; it blocks in `dispatch.mjs wait` instead and arms no waker (`references/coding-loop.md` → Foreground wait mode) | `background` |
55
57
 
56
58
  ### specs.json format
57
59
 
@@ -62,15 +64,16 @@ The format is owned by the producing skill (`a2h-spec-generate` 的 `publish-spe
62
64
  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:
63
65
 
64
66
  - **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.
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`.
67
+ - **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 `STATE_DOCS_MODE`, `API_DOCS_MODE`, `MVVM_MODE`, `MAX_ROUNDS_REVIEW`.
66
68
  - **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.
67
69
  - **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).
68
70
 
69
71
  ### I5 — Execution model
70
72
 
71
73
  - 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.
74
+ - **Docs-refresh reply contract** (when this skill dispatches the I3 baseline seed, F0 docs refresh or B5): reply only `{ "ok": true, "modules_updated": N, "modules_total": M }` or `{ "ok": false, "note": "..." }`; `modules_updated` = the `module_design.md` files it wrote, `modules_total` = modules in `module_structure.json`. The docs-refresh sub-agent never commits; the orchestrator makes the docs commit.
72
75
  - 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).
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.
76
+ - 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`, `settle.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.
74
77
  - **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.
75
78
  - A returned sub-agent result — success or failure — is never a stop: parse it, persist it, dispatch the next.
76
79
 
@@ -105,9 +108,9 @@ It appends the wave to `<HMOS>/.hometrans/spec_wave_plan.json` (schema `spec_wav
105
108
 
106
109
  ### F0 — shared-layer pre-seeding
107
110
 
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.
111
+ 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`), write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --stage f0 --wave <K> --dispatch-at <DISPATCH_AT> --campaign-id <campaign_id> --base <PRE_F0> --init`), and dispatch one foreground `general` sub-agent with `references/shared-layer.md`; resolve that prompt's `entry_module` / `entry_module_json5` / `entry_module_strings` fields from `build-profile.json5` (`type:"entry"`) before dispatch.
109
112
 
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`.
113
+ After it returns, apply **`references/reply-recovery.md`** with `stage: f0`: a parseable reply goes to the manifest validation below; an unparseable one runs the disk settle ladder — never a session resume — and only `artifact_fresh` ends it. 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/`. Then run the docs-refresh procedure in `references/shared-layer.md` ("Docs refresh / visibility"): a `docs(wave K)` commit only when tracked `.hometrans` docs changed; `WAVE_BASE = docs_commit ?? infra commit`.
111
114
 
112
115
  **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
116
 
@@ -165,13 +168,13 @@ F0 is the one pre-W0 exception (see **Ordering & safety rules**).
165
168
 
166
169
  ### B3 — One build per wave
167
170
 
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.)
171
+ Write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --stage b3 --wave <wave> --dispatch-at <DISPATCH_AT> --output <HMOS>/.hometrans/wave_<wave>/build --pre-head <PRE_HEAD> --init`, where `PRE_HEAD` is the full SHA from `git rev-parse HEAD`, not a short sha; `--force` only on a re-dispatch after confirming the old agent is gone) immediately before the call, then 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.)
169
172
 
170
173
  **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.
171
174
 
172
175
  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).
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×.
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.
176
+ 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, and never resume a session.** Apply **`references/reply-recovery.md`** with `stage: b3` and this wave's build dir as `output_path`. Its verdict decides: `artifact_fresh` → validate as step 1; `settled_empty` → run the build yourself (step 3) — the build stages' `QUIET_MS` exceeds the build's own timeout, so no concurrent build remains; `settled_timeout` → **stop for manual recovery**: record `build: "FAILED"` with `note: "reply-recovery: settled_timeout"`, do **not** build inline, and do **not** continue B4–C (a live writer may still own main; C's `git add -A` must not run).
177
+ 3. **Only on `settled_empty` (or a fresh report)** take the result from disk: `<output_path>/build-fix-report.md` (Build Status) and `<output_path>/build-fix-commit-info.md` (`commit_id`). Stale/invalid artifacts are never adopted; `settled_timeout` never reaches this step. If neither is fresh (missing, stale, or invalid), 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.
175
178
 
176
179
  ### B4 — Unified review (parallel per group, per-group serial fix, only open groups re-reviewed)
177
180
 
@@ -189,8 +192,8 @@ Apply **`references/review-loop.md` verbatim** — read it before the wave's fir
189
192
 
190
193
  ### B5 — One semantic-docs refresh per wave
191
194
 
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}`.
195
+ Run `/a2h-module-semantic-docs <HMOS> --engine-mode <ENGINE_MODE> --homegraph-index <ready|missing> --incremental preserve --scope project-source` **via a sub-agent**. `<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"`.
196
+ Then write `wave_<K>/docs_refresh.json` `{wave, result, at}`, copying `result` from the sub-agent's reply (the docs-refresh reply contract in I5) — never self-assessed; retry an unparseable/failed reply once first, and if it stays unparseable record `{ok:false, note:"unparseable reply"}`.
194
197
 
195
198
  ### C — Per-group finalize
196
199
 
@@ -223,8 +226,8 @@ Full schema, sibling-file ownership, the atomic-write rule, the `.bak` restore p
223
226
  - 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).
224
227
  - Merge ladder exhausted → group `failed`, continue (report flags dependents).
225
228
  - 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.
226
- - B3/B4/B5 failures → record and continue (carried in the final report).
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`).
229
+ - B3/B4/B5 failures → record and continue (carried in the final report). A reply-recovery `settled_timeout` is **not** this case — see the stops below.
230
+ - 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), a **reply-recovery `settled_timeout`** at any foreground stage (`references/reply-recovery.md` — a live writer may still own main; never continue C or run an inline build), 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`).
228
231
 
229
232
  ## After the wave loop — Homecheck → smoke gate → Finalization
230
233
 
@@ -179,9 +179,13 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
179
179
  9. **End of pass — the only exits.**
180
180
  - `complete` (step 8) → leave the loop; continue at B3.
181
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
182
+ notification, or the armed waker (`probe` above), starts the next turn: **end the turn now**
183
+ (`WAIT_MODE=foreground`: never — see Foreground wait mode below). Never
183
184
  sit in a foreground `wait` or `sleep` while an agent runs: a blocked turn does not receive its
184
185
  completion notification (measured: 16–30 polling rounds per batch while the notifications waited).
186
+ This ban is scoped to an **active ledger unit**; the settle ladder for F0 / B3 / B4 rebuild /
187
+ build breaker / post-Homecheck build-fixer is the no-unit case and is governed by
188
+ `references/reply-recovery.md`.
185
189
  - No unit is active and not complete (only a deadline can move the wave: a held group, a timeout) →
186
190
  `dispatch.mjs <HMOS> wait --max-wait 120 --poll 5 --baseline <HMOS>/.hometrans/dispatch/snapshots/orch.snapshot.json
187
191
  --event-file <HMOS>/.hometrans/dispatch/orch.event.json` (it persists its event before returning, so
@@ -210,7 +214,23 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
210
214
  - **Pending member with no worktree** (the dispatch-hold shape): route by `deps_ready.ts` — `held` →
211
215
  not dispatched; `ready` → step 6's release procedure, **never a bare chunk dispatch**.
212
216
 
213
- **Waker arming.** When active units remain: `dispatch.mjs <HMOS> probe` → if `inPlace:false` or
217
+ **Foreground wait mode (`WAIT_MODE=foreground`).** The pipeline itself runs inside a dispatched
218
+ sub-agent, so an ended turn returns to the caller with the wave unfinished and no notification can wake
219
+ it again. Chunk and resolver agents are still dispatched in background (slots keep refilling); only the
220
+ wait changes:
221
+ - Step 9's `end-turn` exit (and `next`'s `end-turn`) becomes the foreground `wait`: `dispatch.mjs <HMOS>
222
+ wait --max-wait 300 --poll 5 --baseline <HMOS>/.hometrans/dispatch/snapshots/orch.snapshot.json
223
+ --event-file <HMOS>/.hometrans/dispatch/orch.event.json` (shell timeout ≥ 600000 ms), then step 1. Exit 5
224
+ (timeout) also goes to step 1, whose `progress` → `beat` keeps long agents inside their lease.
225
+ - No waker is armed and no waker sub-agent is dispatched: the foreground `wait` watches the same
226
+ ledger / attempt artifacts / worktree git files / deadlines, so a finished agent is found from its
227
+ evidence, not its notification. The never-strand rule "a turn may end only with a live waker" reads
228
+ "the turn never ends while a unit is active"; `waker.stop` on terminal paths stays (harmless when no
229
+ waker runs). Completion notifications that still arrive are consumed in step 1 as usual.
230
+ - The turn ends only at the legitimate stops (Finalization done, or a hard stop), with the final report.
231
+ The "never sit in a foreground `wait`" rule above is for `background` mode only.
232
+
233
+ **Waker arming** (`WAIT_MODE=background` only). When active units remain: `dispatch.mjs <HMOS> probe` → if `inPlace:false` or
214
234
  `runId` differs, clear a stale stop file and dispatch a general-purpose sub-agent in **background mode**
215
235
  whose entire task is one shell call (timeout 0): `node <skill-dir>/scripts/dispatch.mjs <HMOS> waker
216
236
  --interval 30`. Its final message is only `{ "code": <exit> }`. It occupies no concurrency slot and is
@@ -278,13 +298,14 @@ its artifacts.
278
298
  carries the same list, so the design proposes against the existing APIs.
279
299
  - `state-docs-mode`: `<state.config.state_docs_mode>` (`available` / `unavailable`) — the coder's
280
300
  state-management doc gate reads it (`a2h-arkts-logic-coder` → `references/code-generation.md`
281
- Step 2). With `unavailable` the coder skips the `devecocli docs` wrapper, falls back to its
282
- `references/ISSUES.md`, and records `state-docs: unavailable` in `state_docs_used.md`. Never paste
283
- the doc rules or a doc key list into the prompt — the coder skill owns them.
301
+ Step 2). `unavailable` skips the `devecocli docs` wrapper and records `state-docs: unavailable`;
302
+ the coder still reads its own `references/ISSUES.md` in full. Never paste the doc rules or a doc
303
+ key list into the prompt — the coder skill owns them.
284
304
  - `api-docs-mode`: `<state.config.api_docs_mode>` (`available` / `unavailable`, `unavailable` when the
285
305
  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.
306
+ Step 2, "Platform API doc gate"). `unavailable` only skips the API lookups (local `.d.ts`); the
307
+ coder still reads its own `references/ISSUES.md` in full. Independent of `state-docs-mode`; never
308
+ paste the lookup rules, the catalogue names, or the `api-*` key list into the prompt.
288
309
  - shared indexes: `<HMOS>/.homegraph/` (main tree — reference for existing APIs, shared layers and call
289
310
  chains) and `<ANDROID>/.homegraph/` (the source implementation). Both are read-only for the coder; the
290
311
  orchestrator is the only writer. There is no worktree index. **No usable index** (that repo's
@@ -324,7 +345,9 @@ its artifacts.
324
345
  `## HomeGraph evidence`."
325
346
  - prompt extra: "Implement all scenarios in the given spec-file (the slice already contains only this
326
347
  chunk's specs). Every commit message MUST start with the so-ids implemented in that commit
327
- ('so-26,so-27: ...'). Resume note: so-<id> 已提交的实现从 so-<next> 继续。**Code-first rule**: the
348
+ ('so-26,so-27: ...'). Resume note: so-<id> 已提交的实现从 so-<next> 继续。**Pre-code rule**: read your
349
+ own skill's `references/ISSUES.md` in full before any edit (not a grep summary), regardless of the
350
+ doc modes. **Code-first rule**: the
328
351
  design document's semantic descriptions may lag the actual code — always treat the ACTUAL code in this
329
352
  worktree as ground truth; when an implementation already exists, reuse/extend it instead of rewriting;
330
353
  the design's anchors (UI/data/logic file paths) locate the code and impose no file-scope restriction.
@@ -350,8 +373,13 @@ A wave whose B3 build (or B4's last review-round build) ended `FAILED` still run
350
373
  next wave never codes on a red main: every coder of wave K+1 would branch from code that does not compile,
351
374
  and their own build would fail for reasons outside their chunk. Before the next wave's W0:
352
375
 
353
- 1. Dispatch one `build-fixer` against `<HMOS>` (`output_path: <HMOS>/.hometrans/wave_<K+1>/prebuild`) and
354
- validate its reply as in B3.
376
+ 1. Write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage
377
+ build-breaker --wave <K+1> --dispatch-at <DISPATCH_AT> --output
378
+ <HMOS>/.hometrans/wave_<K+1>/prebuild --pre-head <PRE_HEAD>`) and dispatch one `build-fixer` against
379
+ `<HMOS>` (the same `output_path`), validating its reply as in B3 (probe with
380
+ `--stage build-breaker --wave <K+1>`). `settled_empty` runs the
381
+ inline build; `settled_timeout` **stops for manual recovery** — no later wave starts and no
382
+ inline build runs (`references/reply-recovery.md`).
355
383
  2. `SUCCESS` → start wave K+1 as usual.
356
384
  3. Still `FAILED` → start no further wave. Go to the Homecheck gate / Finalization; the remaining groups stay
357
385
  `pending`, and the final report lists `waves not started: build still red after wave K` with the fixer's
@@ -10,6 +10,9 @@ created but never delivered is indistinguishable from an agent still coding: the
10
10
  defense is mechanical: every background dispatch is registered in an append-only **ledger** before it
11
11
  leaves (`dispatch.mjs claim` → `intent`), and a durable **waker** holds a wakeup independently of any
12
12
  notification. **A stale unit never means a dead agent; evidence beats re-dispatch.**
13
+ With `WAIT_MODE=foreground` (the pipeline runs inside a dispatched sub-agent) the orchestrator never ends
14
+ its turn mid-wave; it blocks in the foreground `wait` over the same evidence instead of arming a waker
15
+ (`coding-loop.md` → Foreground wait mode).
13
16
 
14
17
  The ledger is the scheduling truth (who is running, how far it got). `spec_pipeline_state.json` is the
15
18
  plan/progress file the orchestrator owns (what should be done). The only bridge is the orchestrator:
@@ -2,16 +2,19 @@
2
2
 
3
3
  The orchestrator prints this at Finalization step 4, filling every placeholder. All outcomes — including failures — are carried in the report; nothing is silently dropped.
4
4
 
5
+ **Re-verify review-open items against the merged trunk before printing.** A group's last review verdict is a review-time snapshot: wave-1 groups were judged before later waves merged, and a later group may have already closed an open item (e.g. a cross-group data layer). For every open FAIL / PARTIAL scenario and open cross-cutting finding that is about to enter the Review (B4) line or Manual Follow-up TODOs, locate the concrete symbol its gap names (a TODO marker, an API / repository name, a call site, a missing link) and grep / read the final merged code: resolved → report it as `resolved by <G> (<symbol + file:line>)`, never as a current follow-up; still unresolved → list it with current-tree evidence; decidable only at runtime → label it `review-time snapshot (later merges followed, not re-verified)`, never phrased as current fact. A review report's wording is not by itself evidence that the issue still exists.
6
+
5
7
  ```
6
8
  ## Spec Pipeline Overview (grouped, wave-parallel)
7
9
  - Specs: N Groups: G Scenarios: S Waves: W
8
- - Designed (per-chunk, in B1): A Coded+Merged (B1/B2): K Docs refreshed (B5): D Groups committed (C): C
10
+ - Designed (per-chunk, in B1): A Coded+Merged (B1/B2): K Docs refreshed (B5): D B5 degraded waves: [k (reason)...] Groups committed (C): C
9
11
  - Final build: SUCCESS / FAILED (Finalization step 1, `a2h-fix-build-errors`; `state.finalization.final_build` takes the same value, SKIPPED only for a carried-only run); Smoke: <verdict> (PASS / FAIL_CRASH / FAIL_BLANK / SKIPPED_NO_DEVICE / SKIPPED_NO_CLI / SKIPPED_HOMECHECK_BUILD_FAILED / DEPLOY_ERROR — `SKIPPED_HOMECHECK_BUILD_FAILED` is the orchestrator's own marker, written when the post-Homecheck build is still red; the smoke skill never returns it)
10
12
  - Static defect check (before smoke): PASS / FAIL / SKIPPED — pass→PASS; fail / build_failed / scan_error / scan_timeout→FAIL; skipped / preflight_failed / infra_error→SKIPPED; errors X → Y; warnings X → Y (accepted A); fixed F; suppressed S; remaining R; build SUCCESS / FAILED
13
+ - Reply recovery: per stage — F0 / B3 / b4-rebuild / build-breaker / homecheck-build: verdict (`artifact_fresh` / `settled_empty` / `settled_timeout`), polls, waited Ns, last activity, artifact state, `statusKnown/statusError`, `activityTruncated/clockSkew`, dirty-path summary; when the first reply parsed and the probe never ran, write `n/a (first reply parsed)`; every `settled_timeout` stop is also listed in Manual Follow-up TODOs
11
14
  - Actual-write audit: registry edits Y (coder) + R (resolver), cross-group overlaps Z, empty-diff groups (per-wave details: .hometrans/wave_<k>/claim_audit.json)
12
15
  - Dispatch-hold: held-then-released groups [G...], cycle edges ignored [G→G...] (per-wave details in the wave log); flat waves (deps forecast collapsed concurrency): waves [k...] sliced `mode: "flat"` — deps ignored, overlaps handled at B2
13
16
  - Shared layer (F0): per wave — Infra(wave K) | <commit | skipped(reason)> | docs=<sha | none> | modules=N | foundation_overlaps_after=<n> (foundation_overlaps_after: the wave's claim_audit.cross_group_overlaps files filtered against the cumulative inventory's `modules[].files`, not `wiring`)
14
- - Review (B4): per wave — rounds run R, groups reviewed per round [r1: n, r2: n, ...], groups still open after the verification review of the last round's fixes [G (open scenarios)...] (a group whose fixer or verification review failed is listed as `fixed, not re-reviewed`, never as closed), fix-mode Remaining Issues per group (count); HomeGraph evidence warnings / review_contract_violation [G...]
17
+ - Review (B4): per wave — rounds run R, groups reviewed per round [r1: n, r2: n, ...], groups still open after the verification review of the last round's fixes [G (open scenarios)...] (a group whose fixer or verification review failed is listed as `fixed, not re-reviewed`, never as closed; every open item listed here has been re-verified against the merged trunk at Finalization — items a later wave resolved are listed as `resolved by <G> (<symbol + file:line>)`, not as open), fix-mode Remaining Issues per group (count); HomeGraph evidence warnings / review_contract_violation [G...]
15
18
  - HomeGraph: syncs N (I2 x, W0 y, B2 a, B3 b, B4 c, resume/build-breaker r), degraded [index: reason...], circuit-open [index...] (per-wave details in the wave log)
16
19
  - Failed groups: [...] (with downstream impact notes)
17
20
 
@@ -24,5 +27,5 @@ The orchestrator prints this at Finalization step 4, filling every placeholder.
24
27
  |---|---|---|---|---|---|
25
28
 
26
29
  ### Manual Follow-up TODOs
27
- - (design issues, unfixed review defects — groups still open after the last review round, with their open scenarios and last review-fix-report —, build issues, cross-group and audit findings, state-docs evidence warnings (`state-docs-missing` / `state-docs-invalid` / `state-docs-unavailable` from the per-chunk artifacts), unfixed Homecheck errors, Homecheck warnings left by the gate's judgement (ruleId + reason), smoke-gate FAIL_*/SKIPPED_* outcomes)
30
+ - (design issues, unfixed review defects — groups still open after the last review round **whose open items still hold after the Finalization re-verification against the merged trunk**, with their open scenarios and last review-fix-report (items a later wave resolved are reported as resolved instead, and runtime-only items are labeled as review-time snapshots) —, build issues, B5 degraded waves (`result.ok:false` with its `note`), cross-group and audit findings, state-docs evidence warnings (`state-docs-missing` / `state-docs-invalid` / `state-docs-unavailable` from the per-chunk artifacts), unfixed Homecheck errors, Homecheck warnings left by the gate's judgement (ruleId + reason), smoke-gate FAIL_*/SKIPPED_* outcomes)
28
31
  ```
@@ -62,7 +62,7 @@ stable and cross-referenced by the rest of the skill (I5 continues them in `SKIL
62
62
  default stays 300000 ms.
63
63
  6. Confirm the semantic docs the B1 design step reads: `project_design.md` (required; resolved from `<HMOS>/.hometrans/`), `database_design.md` / `preferences_design.md` (optional). If `project_design.md` is absent the I3 baseline seed **must** run.
64
64
  6b. Validate `DESIGN_DIR`: it may be absent (I3 creates it), must not be a file, must not equal `HMOS`, must not be a symlink/junction pointing outside `HMOS`; when it exists inside `HMOS`, `git -C <HMOS> ls-files -- <rel>` must be empty. Abort on violation.
65
- 7. Resolve `DOCS_MODE` (`skill` | `script` | `off`) by trial-invoking the semantic-docs path; record it run-wide.
65
+ 7. Confirm the semantic-docs path: a sub-agent invoking `a2h-module-semantic-docs`. Do not probe invocability here — the first real use is the I3 baseline seed (step 10) when `project_design.md` is absent, or the first wave's B5 otherwise.
66
66
  7b. Resolve `STATE_DOCS_MODE` (`available` | `unavailable`) once, for the coder's state-management doc gate (`a2h-arkts-logic-coder` → `references/code-generation.md` Step 2). Probe with one bounded search — this also builds the local docs index once, before any worktree coder pays for it:
67
67
 
68
68
  ```
@@ -94,7 +94,7 @@ stable and cross-referenced by the rest of the skill (I5 continues them in `SKIL
94
94
  ```
95
95
 
96
96
  Gitignores `.hometrans/` + `.homegraph/` (an in-repo custom design dir is appended to `.gitignore`); before the first wave, commits an unborn-HEAD / dirty tree (a fresh scaffold: only `git init`, upstream output uncommitted) as `pre-campaign baseline` so W0 has a `WAVE_BASE` and a clean tree. No-op once a wave exists (mid-campaign dirt stays W0's to judge). Keep `head` / `files` for I4 and the final report. Exit 1 → abort, like an I2 miss. The committed `.homegraph/` rule stays load-bearing: `ensure_index.ts` refuses to write an index whose database would be tracked, and amends an existing `.gitignore` instead of committing a db — do not remove it.
97
- 10. **Seed the semantic-docs baseline once** (via the `DOCS_MODE` path), commit as `semantic-docs baseline`. Skip if the baseline state already exists.
97
+ 10. **Seed the semantic-docs baseline once** (sub-agent invoking `a2h-module-semantic-docs`, the same single path B5 uses; require the docs-refresh reply contract in SKILL.md I5), then commit the result as `semantic-docs baseline` (orchestrator). Run it when either `.hometrans/module_understanding/.module_semantic_docs_state.json` or `project_design.md` is missing; skip only when both exist. If `project_design.md` is absent and the seed fails — reply `ok:false`, an unparseable reply, or `project_design.md` still absent or empty after the sub-agent returns — **stop the run**: the B1 design step has no `project_design.md` to read and every spec would fail — report the failure. When `project_design.md` already exists, a skipped or failed seed is not fatal; proceed.
98
98
  10b. **Campaign identity.** If `state.config.campaign_id` is absent, generate one and persist it with the state write: `node -e "process.stdout.write(crypto.randomUUID())"`. A resume keeps the existing value — it identifies this campaign, not this process. This nonce (never `specs_json_sha256`, which is identical when the same specs.json starts a new campaign) is the `runId` the Homecheck gate dispatch carries.
99
99
 
100
100
  ### I4 — Announce, then commit to autonomous execution
@@ -6,7 +6,7 @@ Authoritative post-loop procedure, applied verbatim (SKILL.md → After the wave
6
6
 
7
7
  **Finalization is gated on this step.** `state.post_homecheck` must exist before Finalization. Missing → run this gate (or write the I2 8b `skipped` mirror, per `references/state-and-resume.md`), then the smoke gate.
8
8
 
9
- Dispatch one foreground `general` sub-agent to run the gate verbatim per `references/static-defect-gate.md` (that file owns the inputs, the nonce rule, gate mode, warning policy, fail-soft rules and the reply contract; pass `runId = state.config.campaign_id`). Validate its reply per B3 (`summary.json` fallback only on a `runId` match), mirror it into `state.post_homecheck` (the resume authority); reply `build: FAILED` → dispatch one `build-fixer` (B3's contract, `output_path: <HMOS>/.hometrans/homecheck/build`). Then the smoke gate on the fresh build.
9
+ Dispatch one foreground `general` sub-agent to run the gate verbatim per `references/static-defect-gate.md` (that file owns the inputs, the nonce rule, gate mode, warning policy, fail-soft rules and the reply contract; pass `runId = state.config.campaign_id`). Validate its reply per **its own** contract (`summary.json` fallback only on a `runId` match; the gate is idempotent and does **not** use `references/reply-recovery.md`), mirror it into `state.post_homecheck` (the resume authority); reply `build: FAILED` → write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage homecheck-build --wave <K> --dispatch-at <DISPATCH_AT> --output <HMOS>/.hometrans/homecheck/build --pre-head <PRE_HEAD>`; `K` = the last wave — post-loop is not reached on a carried-only run) and dispatch one `build-fixer` (B3's contract, the same `output_path`), validating its reply as in B3 (`references/reply-recovery.md`, probe with `--stage homecheck-build --wave <K>`). `settled_empty` runs the inline build; `settled_timeout` **stops for manual recovery** and the smoke gate is not run. Then the smoke gate on the fresh build.
10
10
 
11
11
  ## Runtime smoke gate (after Homecheck, before Finalization)
12
12
 
@@ -19,5 +19,5 @@ Run `a2h-coldstart-smoke-gate` yourself (no sub-agent) with `harmony_project_dir
19
19
  2. Design issue sweep: list `DESIGN_DIR/SPEC_DESIGN_G*_c*_issue.md` files for manual follow-up.
20
20
  3. Run `node <skill-dir>/scripts/check_design_map.ts <HMOS>`; exit 1 → list its problems in the report, never call the map complete.
21
21
  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.
22
- 4. Print the summary report per `references/final-report-template.md` (every section mandatory; all outcomes — including failures — carried, never silently dropped).
22
+ 4. Print the summary report per `references/final-report-template.md` (every section mandatory; all outcomes — including failures — carried, never silently dropped). Before printing, re-verify every review-open item (open FAIL / PARTIAL scenarios, open cross-cutting findings) against the merged trunk per the template's re-verification rule — a wave-1 group's final verdict predates later waves' merges, so an open item may already be closed by a later group's code; resolved items are reported as resolved (symbol + file:line), never as current follow-ups.
23
23
  5. Write `state.finalization = { done: true, final_build, homecheck: <post_homecheck.status>, smoke: <post_smoke.verdict>, at }` (atomic) — the completion marker callers check; absent = Finalization never ran. Flags without on-disk evidence are not done (state-and-resume.md → Completion evidence).