@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
@@ -1,17 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * ui.batch reusability check -- the check script for item 4 of the bootstrap probe table.
3
+ * ui.batch reusability check -- the check script for item 4 of the bootstrap probe table, and the
4
+ * success check of the ui.batch node itself.
4
5
  *
5
- * node check_ui_batch_done.mjs --hmos <HMOS>
6
+ * node check_ui_batch_done.mjs --hmos <HMOS> [--mode full|incremental]
7
+ *
8
+ * --mode is the mode the batch must have run in (default full, what the probe needs). The ui.batch node
9
+ * passes incremental under profile=incremental: there the report and the progress file say incremental,
10
+ * and the same checks (no pending page, no open group) decide whether this round's pages are finished.
6
11
  *
7
12
  * Looking only at whether batch_report.md exists misjudges: a2h-batch-ui-align in incremental mode writes the same report and records
8
13
  * mode: incremental in batch_progress.json. Previously, after a single page had been migrated incrementally, a later migrate with REUSE_ALL=all
9
14
  * treated the UI as done and skipped it, so the full UI was never converted. So finished =
10
15
  * 1) <HMOS>/.hometrans/batch_report.md exists;
11
- * 2) batch_progress.json's mode is full (old files without a mode field are treated as full);
16
+ * 2) batch_progress.json's mode is the expected one, full by default (old files without a mode field are treated as full);
12
17
  * 3) no pending pages (failed pages are a legal ui-align terminal state, shown by review.ui_batch);
13
- * 4) no conversion group still queued or running in queue_state.json (T4: a group converted source-only before its
14
- * capture is re-queued when the capture lands; a report written before that redo is not the finished UI).
18
+ * 4) no conversion group still open in queue_state.json: pending, queued, running, blocked or returned (not yet verified).
19
+ * T4: a group converted source-only before its capture is re-queued when the capture lands; a report written
20
+ * before that redo is not the finished UI. Same open set as group_queue.mjs status --assert-settled.
21
+ * 3) does not cover a pending group: init re-queues a group whose pages failed last time as pending,
22
+ * and its failed pages pass 3.
15
23
  *
16
24
  * Read-only. stdout is one JSON line. Exit codes: 0 -- reusable; 1 -- not reusable (reason); 2 -- bad arguments
17
25
  */
@@ -24,7 +32,11 @@ import { parseArgs } from "./paths_preflight.mjs";
24
32
  import { readJson } from "./json_io.mjs";
25
33
  import { summarizeProgress } from "./human_review_gate.mjs";
26
34
 
27
- export function checkUiBatch(hmos) {
35
+ /** Group states that still owe work: the same set as group_queue.mjs OPEN_STATES. */
36
+ const OPEN_GROUP_STATES = new Set(["pending", "queued", "running", "blocked", "returned"]);
37
+ export const MODES = ["full", "incremental"];
38
+
39
+ export function checkUiBatch(hmos, { mode: expected = "full" } = {}) {
28
40
  const dir = path.join(hmos, ".hometrans");
29
41
  const report = path.join(dir, "batch_report.md");
30
42
  const progress = path.join(dir, "batch_progress.json");
@@ -38,7 +50,11 @@ export function checkUiBatch(hmos) {
38
50
  } catch {
39
51
  /* summarizeProgress has already parsed it once; this cannot fail */
40
52
  }
41
- if (mode !== "full") return no(`batch_progress.json mode is ${mode}: an incremental migration report does not mean the full UI is done`, { mode });
53
+ if (mode !== expected) {
54
+ return no(expected === "full"
55
+ ? `batch_progress.json mode is ${mode}: an incremental migration report does not mean the full UI is done`
56
+ : `batch_progress.json mode is ${mode}, expected ${expected}`, { mode });
57
+ }
42
58
  if (stats.pending > 0) {
43
59
  return no(`${stats.pending} page(s) still pending (total ${stats.total})`, { mode, pending: stats.pendingIds.slice(0, 10) });
44
60
  }
@@ -47,18 +63,19 @@ export function checkUiBatch(hmos) {
47
63
  queue = readJson(path.join(dir, "queue_state.json"));
48
64
  } catch { /* no queue (an older run, or a run without Step 5's queue): nothing more to check */ }
49
65
  const waiting = Object.entries(queue?.groups ?? {})
50
- .filter(([, g]) => g && (g.state === "queued" || g.state === "running"))
66
+ .filter(([, g]) => g && OPEN_GROUP_STATES.has(g.state))
51
67
  .map(([gid, g]) => `${gid}:${g.state}`);
52
68
  if (waiting.length) {
53
- return no(`${waiting.length} conversion group(s) still queued or running (e.g. re-queued after their capture landed): ${waiting.slice(0, 10).join(", ")}`,
69
+ return no(`${waiting.length} conversion group(s) still open (pending / queued / running / blocked / not verified, e.g. re-queued after their capture landed): ${waiting.slice(0, 10).join(", ")}`,
54
70
  { mode, groups_waiting: waiting.slice(0, 20) });
55
71
  }
56
72
  return { code: 0, result: { done: true, mode, pages_total: stats.total, pages_done: stats.done, pages_failed: stats.failed } };
57
73
  }
58
74
 
59
75
  function main() {
60
- const args = parseArgs(process.argv.slice(2), { required: ["hmos"] });
61
- const { code, result } = checkUiBatch(args.hmos);
76
+ const args = parseArgs(process.argv.slice(2), { required: ["hmos"], defaults: { mode: "full" } });
77
+ if (!MODES.includes(args.mode)) throw new Error(`--mode must be one of ${MODES.join(" / ")}, got "${args.mode}"`);
78
+ const { code, result } = checkUiBatch(args.hmos, { mode: args.mode });
62
79
  process.stdout.write(JSON.stringify({ hmos: args.hmos.replace(/\\/g, "/"), ...result }) + "\n");
63
80
  return code;
64
81
  }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The production node kinds and lifecycle actions the production executor implements.
3
+ *
4
+ * Single source for dag_production_executor.mjs (rejects anything else as UNSUPPORTED_PRODUCTION_ACTION /
5
+ * UNSUPPORTED_PRODUCTION_KIND) and validate_workflow.mjs (rejects a workflow.yaml that names an action the executor
6
+ * cannot run), so a yaml/code mismatch fails the static check instead of blocking a customer run half-way through.
7
+ * Gate nodes (runner.kind: gate) run their own fixed lifecycle and are not covered here.
8
+ */
9
+ export const PRODUCTION_KINDS = new Set([
10
+ "bootstrap", "workspace", "script", "snapshot", "adopt_specs", "skill", "gate", "host_action", "barrier",
11
+ ]);
12
+
13
+ /** `actions` of runner.kind: bootstrap. */
14
+ export const BOOTSTRAP_ACTIONS = new Set([
15
+ "plan_resume",
16
+ "infer_android_root",
17
+ "infer_android_root_after_config",
18
+ "resolve_run_dir_show",
19
+ "describe_run_dir",
20
+ "probe_all_artifacts",
21
+ "ask_run_config_once",
22
+ "run_env_preflight",
23
+ "set_vars_from_preflight",
24
+ "incremental_history",
25
+ "incremental_diagnose",
26
+ "probe_image_read",
27
+ "tip_image_read_false",
28
+ ]);
29
+
30
+ /** `actions` of runner.kind: workspace. */
31
+ export const WORKSPACE_ACTIONS = new Set(["ensure_dirs", "init_manifest", "init_ledger", "clear_stale_resume_summaries"]);
32
+
33
+ /**
34
+ * `actions` of runner.kind: script | snapshot | adopt_specs. Any action whose body names a `script` runs that
35
+ * script; only these names have a built-in implementation without one.
36
+ */
37
+ export const GENERIC_KINDS = new Set(["script", "snapshot", "adopt_specs"]);
38
+ export const GENERIC_BUILTIN_ACTIONS = new Set(["adopt_batch_specs_json", "freeze_order"]);
39
+
40
+ /** before_run / after_run of runner.kind: skill. */
41
+ export const SKILL_BEFORE_RUN_ACTIONS = new Set([
42
+ "clear_gate_checkpoint",
43
+ "mark_module_docs_start",
44
+ "incremental_scope",
45
+ "resolve_run_dir",
46
+ "archive_stale_campaign",
47
+ ]);
48
+
49
+ export const SKILL_AFTER_RUN_ACTIONS = new Set(["refresh_run_dir"]);
50
+
51
+ /** Errors for a production node whose runner.kind or lifecycle actions the executor does not implement. */
52
+ export function productionActionErrors(node) {
53
+ const kind = node?.runner?.kind;
54
+ const errors = [];
55
+ const named = (action) => Object.keys(action || {})[0] || "";
56
+ if (!PRODUCTION_KINDS.has(kind)) {
57
+ errors.push(`${node.id}: runner.kind \`${kind}\` is not implemented by dag_production_executor.mjs`);
58
+ return errors;
59
+ }
60
+ const check = (list, catalog, label) => {
61
+ for (const action of list || []) {
62
+ const name = named(action);
63
+ if (!catalog(name, action?.[name])) errors.push(`${node.id}: ${label} action \`${name}\` is not implemented by dag_production_executor.mjs`);
64
+ }
65
+ };
66
+ if (kind === "bootstrap") check(node.actions, (name) => BOOTSTRAP_ACTIONS.has(name), "bootstrap");
67
+ if (kind === "workspace") check(node.actions, (name) => WORKSPACE_ACTIONS.has(name), "workspace");
68
+ if (GENERIC_KINDS.has(kind)) {
69
+ check(node.actions, (name, body) => GENERIC_BUILTIN_ACTIONS.has(name) || Boolean(body && typeof body === "object" && body.script), kind);
70
+ }
71
+ if (kind === "skill") {
72
+ check(node.before_run, (name) => SKILL_BEFORE_RUN_ACTIONS.has(name), "before_run");
73
+ check(node.after_run, (name) => SKILL_AFTER_RUN_ACTIONS.has(name), "after_run");
74
+ }
75
+ return errors;
76
+ }
@@ -17,6 +17,9 @@ import fs from "node:fs";
17
17
  import path from "node:path";
18
18
  import { fileURLToPath } from "node:url";
19
19
 
20
+ import {
21
+ BOOTSTRAP_ACTIONS, SKILL_AFTER_RUN_ACTIONS, SKILL_BEFORE_RUN_ACTIONS, WORKSPACE_ACTIONS,
22
+ } from "./dag_action_catalog.mjs";
20
23
  import { evaluateExpression } from "./dag_graph.mjs";
21
24
  import { readJson, writeJsonAtomic } from "./json_io.mjs";
22
25
 
@@ -45,6 +48,29 @@ function businessFailure(request, error) {
45
48
  return { attempt_id: request.attempt_id, status: "failed", reason: `${error.code}: ${error.message}` };
46
49
  }
47
50
 
51
+ const DISPATCH_MODES = new Set(["task_subagent", "primary_skill_inline"]);
52
+
53
+ // How the host should run a skill wait, taken from the node's own `dispatch` (workflow.yaml policy.dispatch).
54
+ // Plain form: `dispatch: "task_subagent"`. Per-engine form (enrich.spec_gen only):
55
+ // `task_subagent(SPEC_ENGINE=page-specgen)| primary_skill_inline(SPEC_ENGINE=spec-generate)`
56
+ // A missing field keeps the historical inline behaviour; anything unparsable is a config error (Runner blocks),
57
+ // never a silent fallback. The host may still fall back to inline when it has no Task tool (policy.dispatch).
58
+ function resolveDispatch(request, vars) {
59
+ const raw = request.node_definition.dispatch;
60
+ if (raw === undefined || raw === null || raw === "") return "primary_skill_inline";
61
+ const text = String(raw).trim();
62
+ if (!text.includes("|")) {
63
+ if (!DISPATCH_MODES.has(text)) throw new ProductionError("INVALID_DISPATCH", `${request.node}: unknown dispatch "${text}"`);
64
+ return text;
65
+ }
66
+ for (const part of text.split("|")) {
67
+ const m = part.trim().match(/^([a-z_]+)\s*[((]\s*SPEC_ENGINE\s*=\s*([\w-]+)\s*[))]$/);
68
+ if (!m || !DISPATCH_MODES.has(m[1])) throw new ProductionError("INVALID_DISPATCH", `${request.node}: cannot parse dispatch "${text}"`);
69
+ if (m[2] === vars.SPEC_ENGINE) return m[1];
70
+ }
71
+ throw new ProductionError("INVALID_DISPATCH", `${request.node}: dispatch "${text}" has no entry for SPEC_ENGINE=${vars.SPEC_ENGINE}`);
72
+ }
73
+
48
74
  function stamp() {
49
75
  return new Date().toISOString();
50
76
  }
@@ -385,7 +411,7 @@ function normalizeConfig(request, checkpoint, answer) {
385
411
  setVars(checkpoint, values);
386
412
  }
387
413
  const vars = currentVars(request, checkpoint);
388
- const resume = vars.PROFILE === "resume" || vars.FROM_NODE !== "bootstrap";
414
+ const resume = vars.FROM_NODE !== "bootstrap";
389
415
  if (vars.INTERACTION_MODE === "ask") checkpoint.vars.INTERACTION_MODE = body.interaction.prompt_default;
390
416
  if (vars.INTERACTION_MODE === "auto") checkpoint.vars.INTERACTIVE_GATES = "";
391
417
  else if (vars.INTERACTION_MODE === "interactive" && vars.INTERACTIVE_GATES === "ask") {
@@ -410,7 +436,7 @@ function normalizeConfig(request, checkpoint, answer) {
410
436
  function askRunConfig(request, checkpoint, answer) {
411
437
  normalizeConfig(request, checkpoint, answer);
412
438
  const vars = currentVars(request, checkpoint);
413
- const resume = vars.PROFILE === "resume" || vars.FROM_NODE !== "bootstrap";
439
+ const resume = vars.FROM_NODE !== "bootstrap";
414
440
  if (configNeedsAnswer(currentVars(request, checkpoint), resume)) {
415
441
  const body = request.node_definition.actions.map(actionBody).find((value) => value?.interaction && value?.reuse);
416
442
  return waitingResult(request, checkpoint, "waiting_external", {
@@ -483,10 +509,13 @@ function finishImageProbe(request, checkpoint, answer) {
483
509
  function runBootstrapAction(request, checkpoint, action, answer) {
484
510
  const name = actionName(action);
485
511
  const body = actionBody(action);
512
+ if (!BOOTSTRAP_ACTIONS.has(name)) {
513
+ throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `bootstrap action ${name} has no deterministic implementation`);
514
+ }
486
515
  const vars = currentVars(request, checkpoint);
487
516
  activeVars = vars;
488
517
  if (name === "plan_resume") {
489
- if (!(vars.PROFILE === "resume" || vars.FROM_NODE !== "bootstrap")) return { skipped: true };
518
+ if (vars.FROM_NODE === "bootstrap") return { skipped: true };
490
519
  const args = ["--workflow", request.vars.WORKFLOW, "--ledger", request.paths.ledger,
491
520
  "--from-node", vars.FROM_NODE, "--engine", vars.SPEC_ENGINE, "--engine-given", String(vars.SPEC_ENGINE_GIVEN === true)];
492
521
  if (vars.RESUME_BASE_PROFILE) args.push("--base-profile", vars.RESUME_BASE_PROFILE);
@@ -620,6 +649,9 @@ function runWorkspace(request, checkpoint) {
620
649
  const action = actions[checkpoint.cursor];
621
650
  const name = actionName(action);
622
651
  const body = actionBody(action);
652
+ if (!WORKSPACE_ACTIONS.has(name)) {
653
+ throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `workspace action ${name} has no deterministic implementation`);
654
+ }
623
655
  const vars = currentVars(request, checkpoint);
624
656
  activeVars = vars;
625
657
  let output;
@@ -673,7 +705,7 @@ function runSkill(request, checkpoint, outcome) {
673
705
  for (const action of request.node_definition.after_run || []) {
674
706
  const name = actionName(action);
675
707
  const body = actionBody(action);
676
- if (name !== "refresh_run_dir") throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `after_run ${name} is not implemented`);
708
+ if (!SKILL_AFTER_RUN_ACTIONS.has(name)) throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `after_run ${name} is not implemented`);
677
709
  const record = runLifecycleScript(checkpoint, body, ["--work", currentVars(request, checkpoint).WORK, "--show", "--json", "--engine", currentVars(request, checkpoint).SPEC_ENGINE], { allow: [0, 1] });
678
710
  if (record.exit_code === 0 && record.json?.run_dir) {
679
711
  setVars(checkpoint, { RUN_DIR: record.json.run_dir, SPEC_DIR: record.json.spec_dir });
@@ -695,14 +727,37 @@ function runSkill(request, checkpoint, outcome) {
695
727
  const body = actionBody(action);
696
728
  const live = currentVars(request, checkpoint);
697
729
  activeVars = live;
730
+ if (!SKILL_BEFORE_RUN_ACTIONS.has(name)) {
731
+ throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `before_run ${name} is not implemented`);
732
+ }
733
+ // A `when` guard that is false skips the action (e.g. incremental_scope only runs for PROFILE=incremental);
734
+ // the skip is recorded and the cursor moves on, so a resumed attempt does not re-evaluate it.
735
+ if (body && typeof body === "object" && body.when !== undefined && !condition(body.when, live)) {
736
+ checkpoint.history.push({ action: `before_run:${name}`, index: checkpoint.before_run_cursor, output: { skipped: true, when: body.when } });
737
+ checkpoint.before_run_cursor++;
738
+ saveCheckpoint(request, checkpoint);
739
+ continue;
740
+ }
698
741
  let record;
699
742
  if (name === "clear_gate_checkpoint" || name === "mark_module_docs_start") {
700
743
  const args = String(body.args).split(/\s+/).filter(Boolean).map((arg) => expand(arg, live));
701
744
  record = runLifecycleScript(checkpoint, body, args);
745
+ } else if (name === "incremental_scope") {
746
+ // exit≠0 = scope.json missing / empty (ui.batch never confirmed a scope): a business failure of this node,
747
+ // never a range the executor invents (workflow.yaml enrich.spec_gen before_run.incremental_scope).
748
+ const args = String(body.args).split(/\s+/).filter(Boolean).map((arg) => expand(arg, live));
749
+ record = runLifecycleScript(checkpoint, body, args);
750
+ const scopeId = record.json?.scope_id;
751
+ if (typeof scopeId !== "string" || !scopeId) {
752
+ throw new ProductionError("PRODUCTION_SCRIPT_FAILED", "incremental scope not confirmed: progress_identity.mjs scope-id printed no scope_id");
753
+ }
754
+ const scopeIndex = args.indexOf("--scope");
755
+ setVars(checkpoint, { SCOPE_ID: scopeId, ...(scopeIndex >= 0 && args[scopeIndex + 1] ? { SCOPE_JSON: args[scopeIndex + 1] } : {}) });
702
756
  } else if (name === "resolve_run_dir") {
703
757
  const args = ["--work", live.WORK, "--engine", live.SPEC_ENGINE];
704
758
  if (live.RUN_DIR_GIVEN === true && live.RUN_DIR) args.push("--run-dir", live.RUN_DIR);
705
759
  if ((request.node_state.generation || 0) > 0 || live.REUSE_ALL === "none") args.push("--fresh");
760
+ if (live.PROFILE === "incremental" && live.SCOPE_ID) args.push("--scope-id", String(live.SCOPE_ID));
706
761
  record = runLifecycleScript(checkpoint, body, args);
707
762
  if (record.json?.run_dir) setVars(checkpoint, { RUN_DIR: record.json.run_dir, SPEC_DIR: record.json.spec_dir, RUN_MODE: record.json.mode });
708
763
  } else if (name === "archive_stale_campaign") {
@@ -727,7 +782,7 @@ function runSkill(request, checkpoint, outcome) {
727
782
  kind: "skill",
728
783
  skill,
729
784
  skill_path: path.join(SKILLS_ROOT, skill),
730
- dispatch: "primary_skill_inline",
785
+ dispatch: resolveDispatch(request, live),
731
786
  invoke: expand(request.invoke || "", live),
732
787
  vars: live,
733
788
  paths: request.paths,
@@ -17,6 +17,42 @@ const TERMINAL = new Set(["done", "reused", "skipped", "failed"]);
17
17
  const ACTIVE_ATTEMPT = new Set(["running", "waiting_external", "waiting_human"]);
18
18
  const UNSUPPORTED_LIFECYCLE = ["precondition", "before_run", "after_run", "hook", "hooks", "actions"];
19
19
  const STDERR_LIMIT = 4096;
20
+ const SKILL_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
21
+ const DEFAULT_SKILLS_ROOT = path.resolve(SKILL_DIR, "..");
22
+ const INTEGRITY_DIRS = ["scripts"];
23
+ const INTEGRITY_EXTENSIONS = new Set([".mjs", ".js", ".cjs", ".py"]);
24
+ // Only a runner interruption (the previous process died mid-node) is an operational state that continue clears on
25
+ // its own. Every other blocked code needs the user's explicit go-ahead (continue --confirmed-by user): the host cannot
26
+ // reliably tell a skill defect from a crash or a business failure, and an automatic retry is exactly what let a host
27
+ // "fix" a blocked run by patching the skill. That includes EXECUTOR_EARLY_STOP / EXECUTOR_EXIT, which also carry the
28
+ // production executor's own UNSUPPORTED_* rejections.
29
+ const AUTO_RESUMABLE_BLOCKED = new Set(["RUNNER_INTERRUPTED"]);
30
+ // Codes that can only come from the installed skill itself: a yaml/code mismatch or changed skill files.
31
+ const SKILL_DEFECT_CODES = new Set([
32
+ "SKILL_FILES_CHANGED", "WORKFLOW_CHANGED", "INVALID_WORKFLOW", "INVALID_SKILL", "INVALID_DISPATCH",
33
+ "UNSUPPORTED_SUCCESS_RULE", "UNSUPPORTED_NODE_ACTION", "UNSUPPORTED_FAIL_MATRIX", "UNSUPPORTED_PRODUCTION_ACTION",
34
+ "UNSUPPORTED_PRODUCTION_KIND", "INVALID_PRODUCTION_ACTION", "INVALID_PRODUCTION_GATE",
35
+ ]);
36
+ const SKILL_DEFECT_PATTERN = new RegExp(`\\b(${[...SKILL_DEFECT_CODES].join("|")})\\b`);
37
+ // A node that failed for real (retries spent / completion evidence missing): a migration result, not a defect.
38
+ const BUSINESS_BLOCKED_CODES = new Set(["FINALIZE_FAILED", "DAG_INCOMPLETE", "INVALID_COMPLETION_EVIDENCE", "RESUME_PROBE_INCOMPLETE"]);
39
+ const NEVER_MODIFY = "Never modify, patch or replace any file under SKILLS_ROOT (runner, executor, workflow.yaml, leaf "
40
+ + "scripts) and never work around the check.";
41
+ const CONFIRMED_RESUME = "Resume only after the user decides: once they say to retry, run "
42
+ + "`dag_runner.mjs continue --state <state> --confirmed-by user`.";
43
+ const BLOCKED_HOST_INSTRUCTIONS = {
44
+ interrupted: "The previous runner process stopped while a node was running. This is not a defect: run "
45
+ + "`dag_runner.mjs continue --state <state>` to start a new attempt (no user confirmation needed).",
46
+ skill_defect: "The migration skill hit a defect it cannot handle (yaml/code mismatch or changed skill files). Report "
47
+ + `error.code, error.message and the node to the user verbatim and stop. ${NEVER_MODIFY} ${CONFIRMED_RESUME} If they `
48
+ + "reinstalled or upgraded the skill, start a new DAG control directory with `run --resume-from <node>` instead.",
49
+ business_failure: "A node failed after its retries, or the run's completion evidence is incomplete. This is a "
50
+ + "migration result, not something to fix in the skill. Report error.code, error.message and the node to the user "
51
+ + `verbatim and stop. ${NEVER_MODIFY} ${CONFIRMED_RESUME}`,
52
+ executor_error: "A node's executor or host step did not produce a valid result (crash, timeout, missing or malformed "
53
+ + "result file). First check your own last command (e.g. a wrong --result-file path); then report error.code, "
54
+ + `error.message and the node to the user verbatim and stop. ${NEVER_MODIFY} ${CONFIRMED_RESUME}`,
55
+ };
20
56
 
21
57
  class RunnerError extends Error {
22
58
  constructor(code, message, exitCode = 2, cause) {
@@ -69,6 +105,100 @@ function workflowDigest(filePath) {
69
105
  return createHash("sha256").update(fs.readFileSync(filePath)).digest("hex");
70
106
  }
71
107
 
108
+ /**
109
+ * sha256 of every code file under this skill's scripts/ (the runner, the executor and every script a node runs).
110
+ * Recorded when a run starts and re-checked by every command that advances it, so an edited runner / executor /
111
+ * lifecycle script blocks the run instead of silently producing a result from changed code.
112
+ */
113
+ export function skillIntegrity(skillDir = SKILL_DIR) {
114
+ const files = {};
115
+ const walk = (dir) => {
116
+ let entries;
117
+ try {
118
+ entries = fs.readdirSync(dir, { withFileTypes: true });
119
+ } catch {
120
+ return;
121
+ }
122
+ for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
123
+ if (entry.name === "node_modules" || entry.name === "__pycache__" || entry.name.startsWith(".")) continue;
124
+ const full = path.join(dir, entry.name);
125
+ if (entry.isDirectory()) walk(full);
126
+ else if (entry.isFile() && INTEGRITY_EXTENSIONS.has(path.extname(entry.name))) {
127
+ files[path.relative(skillDir, full).split(path.sep).join("/")] = workflowDigest(full);
128
+ }
129
+ }
130
+ };
131
+ for (const dir of INTEGRITY_DIRS) walk(path.join(skillDir, dir));
132
+ return { root: skillDir, files };
133
+ }
134
+
135
+ function integrityDiff(recorded, current) {
136
+ const changed = [];
137
+ const removed = [];
138
+ const added = [];
139
+ for (const [file, digest] of Object.entries(recorded.files || {})) {
140
+ if (!(file in current.files)) removed.push(file);
141
+ else if (current.files[file] !== digest) changed.push(file);
142
+ }
143
+ for (const file of Object.keys(current.files)) if (!(file in (recorded.files || {}))) added.push(file);
144
+ return { changed, removed, added };
145
+ }
146
+
147
+ function assertSkillIntact(state) {
148
+ if (!state.integrity || typeof state.integrity !== "object") return;
149
+ const recordedRoot = state.integrity.root ? path.resolve(state.integrity.root) : SKILL_DIR;
150
+ const sameRoot = process.platform === "win32" ? recordedRoot.toLowerCase() === SKILL_DIR.toLowerCase() : recordedRoot === SKILL_DIR;
151
+ if (!sameRoot) {
152
+ throw new RunnerError(
153
+ "SKILL_FILES_CHANGED",
154
+ `Run ${state.run_id} started with the skill at ${recordedRoot}, but this runner is ${SKILL_DIR}. A run must keep `
155
+ + "using the runner it started with; after an intended reinstall / upgrade start a new DAG control directory with "
156
+ + "run --resume-from.",
157
+ 3,
158
+ );
159
+ }
160
+ const diff = integrityDiff(state.integrity, skillIntegrity(SKILL_DIR));
161
+ if (!diff.changed.length && !diff.removed.length && !diff.added.length) return;
162
+ const parts = [
163
+ diff.changed.length ? `changed: ${diff.changed.join(", ")}` : "",
164
+ diff.removed.length ? `removed: ${diff.removed.join(", ")}` : "",
165
+ diff.added.length ? `added: ${diff.added.join(", ")}` : "",
166
+ ].filter(Boolean);
167
+ throw new RunnerError(
168
+ "SKILL_FILES_CHANGED",
169
+ `Skill scripts differ from the ones run ${state.run_id} started with (${parts.join("; ")}). `
170
+ + "Editing the migration skill during a run is forbidden; restore the original files, or after an intended "
171
+ + "reinstall / upgrade start a new DAG control directory with run --resume-from.",
172
+ 3,
173
+ );
174
+ }
175
+
176
+ export function blockedCategory(error) {
177
+ const code = error?.code || "";
178
+ if (AUTO_RESUMABLE_BLOCKED.has(code)) return "interrupted";
179
+ if (SKILL_DEFECT_CODES.has(code) || SKILL_DEFECT_PATTERN.test(String(error?.message || ""))) return "skill_defect";
180
+ if (BUSINESS_BLOCKED_CODES.has(code)) return "business_failure";
181
+ return "executor_error";
182
+ }
183
+
184
+ /**
185
+ * Host guidance for a blocked result. `error` is what the CLI reports; when it is BLOCKED_NEEDS_USER_CONFIRMATION,
186
+ * `blockedOn` is the error the run is actually blocked on, and it decides the category.
187
+ */
188
+ export function blockedGuidance(error, blockedOn = error) {
189
+ const category = blockedCategory(blockedOn);
190
+ return {
191
+ category,
192
+ skill_defect: category === "skill_defect",
193
+ requires_user_confirmation: category !== "interrupted",
194
+ code: error?.code || "",
195
+ blocked_on: blockedOn?.code || "",
196
+ message: blockedOn?.message || error?.message || "",
197
+ node: blockedOn?.node || error?.node || null,
198
+ host_instruction: BLOCKED_HOST_INSTRUCTIONS[category],
199
+ };
200
+ }
201
+
72
202
  function readWorkflow(filePath) {
73
203
  let document;
74
204
  try {
@@ -116,6 +246,12 @@ function workflowVars(document, explicit, profile) {
116
246
  : definition;
117
247
  }
118
248
  Object.assign(values, explicit);
249
+ // `${SKILLS_ROOT}` (workflow.yaml skill_root_var) is the directory this runner was installed into; without it
250
+ // every `${SKILLS_ROOT}/…` script path renders as `/…` and resolves against the drive root.
251
+ const rootVar = typeof document.skill_root_var === "string" ? document.skill_root_var : "";
252
+ if (rootVar && (values[rootVar] === undefined || values[rootVar] === null || values[rootVar] === "")) {
253
+ values[rootVar] = DEFAULT_SKILLS_ROOT.split(path.sep).join("/");
254
+ }
119
255
  values.RUN_DIR_GIVEN = Object.prototype.hasOwnProperty.call(explicit, "RUN_DIR");
120
256
  if (Object.prototype.hasOwnProperty.call(explicit, "SPEC_ENGINE")) values.SPEC_ENGINE_GIVEN = true;
121
257
  if (Object.prototype.hasOwnProperty.call(explicit, "SPECS_JSON")) {
@@ -444,8 +580,14 @@ function loadContext(rawOptions) {
444
580
  }
445
581
  const document = readWorkflow(workflowPath);
446
582
  if (workflowDigest(workflowPath) !== state.workflow.sha256) {
447
- throw new RunnerError("WORKFLOW_CHANGED", `Workflow sha256 does not match run ${state.run_id}`);
583
+ throw new RunnerError(
584
+ "WORKFLOW_CHANGED",
585
+ `Workflow sha256 does not match run ${state.run_id}: workflow.yaml was edited during the run, which is forbidden; `
586
+ + "restore it, or after an intended reinstall / upgrade start a new DAG control directory with run --resume-from.",
587
+ 3,
588
+ );
448
589
  }
590
+ assertSkillIntact(state);
449
591
  const production = productionWorkflow(document);
450
592
  const context = {
451
593
  statePath,
@@ -1295,7 +1437,7 @@ export function startRun(rawOptions) {
1295
1437
  }
1296
1438
  profile = resumePlan.base_profile;
1297
1439
  }
1298
- if (profile === "resume" || !document.profiles?.[profile]) {
1440
+ if (!document.profiles?.[profile]) {
1299
1441
  throw new RunnerError("INVALID_PROFILE", `Unknown concrete workflow profile: ${profile}`);
1300
1442
  }
1301
1443
  const graph = buildGraph(document, { profile });
@@ -1330,6 +1472,7 @@ export function startRun(rawOptions) {
1330
1472
  schema: SCHEMA,
1331
1473
  run_id: runId,
1332
1474
  workflow: { path: workflowPath, sha256: workflowDigest(workflowPath) },
1475
+ integrity: skillIntegrity(),
1333
1476
  profile,
1334
1477
  vars: allVars,
1335
1478
  status: "running",
@@ -1408,12 +1551,42 @@ function probesForResume(document) {
1408
1551
  return probeEntries(document);
1409
1552
  }
1410
1553
 
1554
+ function blockedOnError(blockedOn, error) {
1555
+ error.blockedOn = { code: blockedOn.code || "", message: blockedOn.message || "", node: blockedOn.node || null };
1556
+ return error;
1557
+ }
1558
+
1411
1559
  export function advance(options) {
1412
1560
  const normalized = normalizeStateOptions(options);
1413
1561
  const statePath = absolute(normalized.state || normalized.statePath || "");
1414
1562
  return withLock(statePath, async () => {
1415
1563
  const context = loadContext(normalized);
1564
+ // A run that is already blocked on a skill defect resumes only with the user's explicit go-ahead.
1565
+ const blockedBefore = context.state.status === "blocked" ? (context.state.error || {}) : null;
1566
+ if (blockedBefore && !AUTO_RESUMABLE_BLOCKED.has(blockedBefore.code)) {
1567
+ if (normalized.confirmedBy !== "user") {
1568
+ throw blockedOnError(blockedBefore, new RunnerError(
1569
+ "BLOCKED_NEEDS_USER_CONFIRMATION",
1570
+ `Run is blocked on ${blockedBefore.code || "an error"}${blockedBefore.node ? ` at ${blockedBefore.node}` : ""}: `
1571
+ + `${blockedBefore.message || ""}. Report it to the user and wait; resume only with continue --confirmed-by user `
1572
+ + "after the user decides to retry.",
1573
+ 3,
1574
+ ));
1575
+ }
1576
+ context.state.blocked_acks = [...(context.state.blocked_acks || []), {
1577
+ code: blockedBefore.code || null,
1578
+ node: blockedBefore.node || null,
1579
+ message: blockedBefore.message || "",
1580
+ confirmed_by: "user",
1581
+ confirmed_at: stamp(),
1582
+ }];
1583
+ }
1416
1584
  recoverContext(context);
1585
+ // recoverContext may block the run in this very call (a result file left by a runner that died before processing
1586
+ // it turns out invalid / stale): that needs the user exactly like a run that was already blocked.
1587
+ if (!blockedBefore && context.state.status === "blocked" && !AUTO_RESUMABLE_BLOCKED.has(context.state.error?.code)) {
1588
+ return context.state;
1589
+ }
1417
1590
  context.executorCommand = normalized.executorCommand !== undefined ? normalized.executorCommand : context.state.executor.command;
1418
1591
  context.executorTimeoutMs = normalized.executorTimeoutMs !== undefined ? Number(normalized.executorTimeoutMs) : context.state.executor.timeout_ms;
1419
1592
  if (!Number.isInteger(context.executorTimeoutMs) || context.executorTimeoutMs < 0) {
@@ -1702,6 +1875,7 @@ function summary(state) {
1702
1875
  current_attempt_id: node.current_attempt_id,
1703
1876
  }])),
1704
1877
  ledger_commit: state.ledger_commit,
1878
+ ...(state.blocked_acks?.length ? { blocked_acks: state.blocked_acks } : {}),
1705
1879
  updated_at: state.updated_at,
1706
1880
  };
1707
1881
  }
@@ -1748,7 +1922,8 @@ async function main(argv) {
1748
1922
  const presentation = command === "status"
1749
1923
  ? null
1750
1924
  : presentationForTransition(previousState, state, readWorkflow(state.workflow.path));
1751
- process.stdout.write(`${JSON.stringify({ ...summary(state), ...(presentation ? { presentation } : {}), exit_code: code })}\n`);
1925
+ const blocked = state.status === "blocked" ? { blocked: blockedGuidance(state.error) } : {};
1926
+ process.stdout.write(`${JSON.stringify({ ...summary(state), ...(presentation ? { presentation } : {}), ...blocked, exit_code: code })}\n`);
1752
1927
  return code;
1753
1928
  }
1754
1929
 
@@ -1759,7 +1934,12 @@ if (isDirect) {
1759
1934
  process.exitCode = code;
1760
1935
  } catch (error) {
1761
1936
  const code = Number.isInteger(error?.exitCode) ? error.exitCode : 2;
1762
- const payload = { status: code === 3 ? "blocked" : "invalid", error: { code: error?.code || "INVALID", message: String(error?.message || error) } };
1937
+ const errorBody = { code: error?.code || "INVALID", message: String(error?.message || error) };
1938
+ const payload = {
1939
+ status: code === 3 ? "blocked" : "invalid",
1940
+ error: errorBody,
1941
+ ...(code === 3 ? { blocked: blockedGuidance(errorBody, error?.blockedOn || errorBody) } : {}),
1942
+ };
1763
1943
  process.stdout.write(`${JSON.stringify({ ...payload, exit_code: code })}\n`);
1764
1944
  process.stderr.write(String(error?.message || error) + "\n");
1765
1945
  process.exitCode = code;
@@ -842,7 +842,7 @@ export function resolveAppModule(candidates, requested, { sourceKind = "" } = {}
842
842
  };
843
843
  }
844
844
 
845
- export const PROFILES = ["full", "ui-only", "incremental", "resume"];
845
+ export const PROFILES = ["full", "ui-only", "incremental"];
846
846
 
847
847
  /**
848
848
  * profile=incremental preconditions (scenario 3: a few pages into an existing HarmonyOS project), checked here so
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Reads and writes ${LEDGER} (stage-ledger.jsonl). Append-only and kept across runs: profile=resume relies on it to know the original run's
3
+ * Reads and writes ${LEDGER} (stage-ledger.jsonl). Append-only and kept across runs: resuming (FROM_NODE) relies on it to know the original run's
4
4
  * profile and each node's terminal state (resume_plan.mjs), so every run records a run_start line at the start, and every node records a line on reaching its terminal state.
5
5
  *
6
6
  * node ledger.mjs --ledger <LEDGER> --start --profile <p> [--from-node <id>] [--engine <spec-generate|page-specgen>]
7
- * Appends {event:"run_start", profile, from_node, resume, spec_engine?, at}. For profile=resume pass the base_profile computed by resume_plan,
7
+ * Appends {event:"run_start", profile, from_node, resume, spec_engine?, at}. When resuming pass the base_profile computed by resume_plan,
8
8
  * together with --from-node (resume is expressed by from_node != bootstrap). --engine records the spec engine of the original run
9
9
  * (an unknown value -> exit 2); resume_plan inherits it, and a resume may not switch it.
10
10
  * node ledger.mjs --ledger <LEDGER> --node <id> --begin
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Reuse decisions for profile=resume (resuming from FROM_NODE). Resume used to be a standalone profile (all lanes, no force_skip),
3
+ * Reuse decisions for resuming from FROM_NODE (FROM_NODE != bootstrap). Resume used to be a standalone profile (all lanes, no force_skip),
4
4
  * forcing reuse for every ancestor of FROM_NODE and hard_stopping on an incomplete probe:
5
5
  * - resuming after a ui.batch soft failure under full -> a failure the original run tolerated is treated as a missing artifact -> hard_stop;
6
6
  * - resuming after a ui-only run -> utg_static was skipped by ui-only -> hard_stop, and spec_gen / logic get pulled back in;
@@ -110,9 +110,9 @@ const truthy = (v) => ["true", "1", "yes", "on"].includes(String(v ?? "").trim()
110
110
 
111
111
  export function planResume(doc, records, { fromNode, baseProfile = "", engine = "", engineGiven = false }) {
112
112
  const ids = new Set((doc.nodes || []).map((n) => n.id));
113
- if (!fromNode || fromNode === "bootstrap") throw new PlanError("profile=resume requires from_node=<node id> (not bootstrap)", 2);
113
+ if (!fromNode || fromNode === "bootstrap") throw new PlanError("resume requires from_node=<node id> (not bootstrap)", 2);
114
114
  if (!ids.has(fromNode)) throw new PlanError(`FROM_NODE \`${fromNode}\` is not a workflow node id`, 2);
115
- const concrete = Object.keys(doc.profiles || {}).filter((p) => p !== "resume");
115
+ const concrete = Object.keys(doc.profiles || {});
116
116
  if (baseProfile && !concrete.includes(baseProfile)) {
117
117
  throw new PlanError(`resume_base_profile must be one of ${concrete.join(" / ")}, got ${baseProfile}`, 2);
118
118
  }