@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
@@ -42,12 +42,13 @@ export const meta: RuleMeta[] = [
42
42
  invariant: "resources",
43
43
  card: "resources",
44
44
  needs: ["--resources"],
45
- summary: "被引用的 media SVG 里有一条 fill=\"none\"、铺满 viewBox 的包围盒:d 恰为 viewBox 全矩形的 path,或 x/y 为 0、宽高等于 viewBox 的 rect。",
45
+ summary: "被引用的 media SVG 里有一条 fill=\"none\"、铺满 viewBox 的包围盒:d 只由直线段组成、每个子路径都恰好走过 viewBox 四个角的 path(`M0 0h24v24H0z`、`H0V0z`、两段重复的 `…zm0 0h24v24H0V0z` 等写法都算),或 x/y 为 0、宽高等于 viewBox 的 rect。",
46
46
  fix: "- 读 SVG/资源文件内容的几条(需要 `--resources`)对应「资源引用错用」的各子项:`fillcolor-on-stroke-svg`、`fillcolor-on-full-viewport-path`、`media-unresolved-theme-attr` / `media-placeholder-in-use`、`media-duplicate-attribute`。它们正是\"只跑 `ls media/` 确认名字存在\"漏掉的那一类。",
47
47
  escape: null,
48
48
  cases: [
49
49
  "Android 的 `<vector>` 源里**没有**这条 path —— 实测 10 个安卓仓零命中",
50
50
  "实测 readyou-accounts 的 ic_rss_feed 由 iconFor() 返回、在另一个 @Builder 里被染色,只查 tinted 时漏检,而它恰是列表项里最显眼的那个黑框。",
51
+ "实测中发现:Compose `Icons.Default.CheckCircleOutline` 经 code_vector_icons.ts 转出的 ic_check_circle_outline_filled.svg 带两段重复的包围盒 `M0 0h24v24H0V0zm0 0h24v24H0V0z`;旧规则只认 4 种写法、报 0 条,`.fillColor('#00FF00')` 把整块染成绿色方块,本该是空心圆加勾。",
51
52
  ],
52
53
  },
53
54
  {
@@ -297,20 +298,86 @@ export function checkSvgTintChannel(scans: FileScan[], media: MediaIndex): void
297
298
  * is exactly the full viewBox rectangle.
298
299
  */
299
300
  export function isFullViewportRect(d: string, w: number, h: number): boolean {
300
- // Normalize: strip whitespace, unify commas
301
- const s: string = d.replace(/\s+/g, '').replace(/,/g, ' ').trim();
302
- // Allows starting with M0 0 / m0 0, and any mix of case and relative/absolute for H/h + V/v + H/h back to 0 + Z/z.
303
- // Only the three most common equivalent forms are matched; better a miss than a false positive.
304
- const nw: string = String(w);
305
- const nh: string = String(h);
306
- const variants: string[] = [
307
- `M0 0h${nw}v${nh}H0z`,
308
- `M0 0h${nw}v${nh}h-${nw}z`,
309
- `M0 0H${nw}V${nh}H0Z`,
310
- `M0 0l${nw} 0 0 ${nh} -${nw} 0z`
311
- ];
312
- const norm = (x: string): string => x.replace(/\s+/g, '').toLowerCase();
313
- return variants.some((v) => norm(v) === norm(s));
301
+ // Walk the path instead of matching spellings: Material ships the guard box as `M0 0h24v24H0z`, `M0 0h24v24H0V0z`,
302
+ // `M0 0H24V24H0Z`, and doubled as `M0 0h24v24H0V0zm0 0h24v24H0V0z` (CheckCircleOutline, measured: the old
303
+ // four-spelling list missed it and the green tick rendered as a solid square). Only straight-line commands are
304
+ // followed; a curve or arc means real geometry, so the path is not a guard box.
305
+ const tokens: string[] = d.match(/[MmLlHhVvZz]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?|[^\s,]/g) ?? [];
306
+ const corners: string[] = [`0,0`, `${w},0`, `${w},${h}`, `0,${h}`];
307
+ const isRect = (pts: Set<string>): boolean => pts.size === 4 && corners.every((c) => pts.has(c));
308
+ let x: number = 0;
309
+ let y: number = 0;
310
+ let sx: number = 0;
311
+ let sy: number = 0;
312
+ let cmd: string = '';
313
+ let pts: Set<string> | null = null;
314
+ let subpaths: number = 0;
315
+ const key = (): string => `${+x.toFixed(4)},${+y.toFixed(4)}`;
316
+ const close = (): boolean => {
317
+ if (pts === null) { return true; }
318
+ if (!isRect(pts)) { return false; }
319
+ subpaths += 1;
320
+ pts = null;
321
+ return true;
322
+ };
323
+ let i: number = 0;
324
+ const num = (): number | null => {
325
+ if (i >= tokens.length || !/^[-+.\d]/.test(tokens[i])) { return null; }
326
+ return parseFloat(tokens[i++]);
327
+ };
328
+ while (i < tokens.length) {
329
+ const t: string = tokens[i];
330
+ if (/^[A-Za-z]$/.test(t)) {
331
+ if (!/^[MmLlHhVvZz]$/.test(t)) { return false; }
332
+ cmd = t;
333
+ i += 1;
334
+ if (cmd === 'Z' || cmd === 'z') {
335
+ x = sx; y = sy;
336
+ if (!close()) { return false; }
337
+ continue;
338
+ }
339
+ } else if (!/^[-+.\d]/.test(t) || cmd === '' || cmd === 'Z' || cmd === 'z') {
340
+ return false;
341
+ }
342
+ const rel: boolean = cmd === cmd.toLowerCase();
343
+ switch (cmd.toLowerCase()) {
344
+ case 'm': {
345
+ const a: number | null = num();
346
+ const b: number | null = num();
347
+ if (a === null || b === null || !close()) { return false; }
348
+ x = rel ? x + a : a; y = rel ? y + b : b;
349
+ sx = x; sy = y;
350
+ pts = new Set([key()]);
351
+ cmd = rel ? 'l' : 'L'; // extra coordinate pairs after a moveto are linetos
352
+ break;
353
+ }
354
+ case 'l': {
355
+ const a: number | null = num();
356
+ const b: number | null = num();
357
+ if (a === null || b === null || pts === null) { return false; }
358
+ x = rel ? x + a : a; y = rel ? y + b : b;
359
+ pts.add(key());
360
+ break;
361
+ }
362
+ case 'h': {
363
+ const a: number | null = num();
364
+ if (a === null || pts === null) { return false; }
365
+ x = rel ? x + a : a;
366
+ pts.add(key());
367
+ break;
368
+ }
369
+ case 'v': {
370
+ const a: number | null = num();
371
+ if (a === null || pts === null) { return false; }
372
+ y = rel ? y + a : a;
373
+ pts.add(key());
374
+ break;
375
+ }
376
+ default:
377
+ return false;
378
+ }
379
+ }
380
+ return close() && subpaths > 0;
314
381
  }
315
382
 
316
383
  /**
@@ -396,9 +463,12 @@ export function checkFullViewportTint(scans: FileScan[], media: MediaIndex): voi
396
463
  'before the <rect> fix did not strip it, so the file is most likely a converter leftover, not hand-written. ' +
397
464
  'Fix: delete this <rect> (and the <g> it leaves empty) from the SVG, or re-run ' +
398
465
  'a2h-resource-convert/scripts/code_vector_icons.ts for this icon; the rest of the file is fine'
399
- : 'Root cause: this path is how Material **web SVGs** are written; an Android <vector> source never produces it — ' +
400
- 'the file was hand-written from memory instead of converted from the Android source. ' +
401
- 'Fix: convert it again from the <vector> in res/drawable; when there really is no matching drawable, ' +
466
+ : 'Root cause: this path is how Material **web SVGs** are written; an Android <vector> source never produces it. ' +
467
+ 'Either the file was hand-written from memory, or it is a Compose `Icons.*` icon that ' +
468
+ 'a2h-resource-convert/scripts/code_vector_icons.ts copied from the upstream web SVG without stripping this ' +
469
+ 'spelling of the guard box (e.g. the doubled `M0 0h24v24H0V0zm0 0h24v24H0V0z`). ' +
470
+ 'Fix: delete this element from the SVG (the rest of a converted file is fine); for a hand-written file, convert ' +
471
+ 'it again from the <vector> in res/drawable, and when there really is no matching drawable, ' +
402
472
  `register it as${SP}${quoteWord('已降级')}${SP}per the Phase 4.3 icon source tiers; do not hand-write it`));
403
473
  break;
404
474
  }
@@ -0,0 +1,140 @@
1
+ // static_check/rules/relative_container_cycle.ts — GATE relative-container-anchor-cycle.
2
+
3
+ import { report } from '../core/findings.ts';
4
+ import { directUiChildren, exclusiveBranches, lineOfIndex, matchBracket } from '../core/parse.ts';
5
+ import type { UiChild } from '../core/parse.ts';
6
+ import { maskedOf } from '../core/scan.ts';
7
+ import type { FileScan } from '../core/scan.ts';
8
+ import type { RuleMeta } from '../core/meta.ts';
9
+
10
+ /** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
11
+ export const meta: RuleMeta[] = [
12
+ {
13
+ id: "relative-container-anchor-cycle",
14
+ levels: ["GATE"],
15
+ invariant: "geometry",
16
+ card: "geometry",
17
+ needs: [],
18
+ summary: "同一个 `RelativeContainer` 的直接子节点之间,`.alignRules()` 的兄弟锚点构成环:A 锚 B、B 又锚 A(不分横纵方向),或更长的环、自己锚自己。链除外:同一方向上首尾相接的一对锚定(A 的 right/end 锚 B 的 Start、B 的 left/start 锚 A 的 End;纵向 bottom↔top 同理)不算环,不论有没有 `.chainMode()`。只识别字面量 `.id('x')` 与字面量 `anchor: 'x'`,且只看子组件:经 barrier(`.barrier()`)形成的环、`.alignRules(this.rules)` 等变量写法查不到。",
19
+ fix: "RelativeContainer 文档:子组件互相依赖、环形依赖时容器内子组件全部不绘制 —— 卡片只剩背景/圆角(空胶囊),view tree 里该容器 `children: []`,编译、冒烟都不报。「图标纵向居中 + 右侧两行文字」改用 `Row { Image; Column { … } }.alignItems(VerticalAlign.Center)`,角落元素放下一行或用 `Stack` + `Alignment`;确需 RelativeContainer 时,依赖只能单向:让文字列锚图标(横向),图标就不能再锚文字列(纵向居中改为锚 `__container__` 或用固定高度)。唯一例外是链:同一方向相邻两个组件首尾互锚,并在链头写 `.chainMode(Axis.Horizontal | Axis.Vertical, ChainStyle.*)`,这是文档允许的写法,规则不拦。",
20
+ escape: null,
21
+ cases: [
22
+ "实测(天气首页,ds-1125 11-26):MetricCard / SunCard 的图标 `center` 锚文字列、文字列 `left` 锚图标,配 `.height('auto')`;4 张指标卡和日出/日落卡渲染为空胶囊(实测 bounds 高约 18vp、`children: []`)。static GATE 0、构建成功、Smoke PASS;冒烟子代理只把指标卡记为 TODO,日出/日落卡在首屏以下,直到逻辑阶段评审才发现。诱因是 relative-container-unsized-in-scroll 的修法「纵向只锚兄弟节点」。",
23
+ ],
24
+ },
25
+ ];
26
+
27
+ const RULE_ENTRY: RegExp = /\b(left|right|start|end|middle|top|bottom|center)\s*:\s*\{([^{}]*)\}/g;
28
+ const ANCHOR: RegExp = /\banchor\s*:\s*(['"])([^'"]+)\1/;
29
+ const ALIGN: RegExp = /\balign\s*:\s*(?:HorizontalAlign|VerticalAlign)\s*\.\s*(\w+)/;
30
+ const ID_LITERAL: RegExp = /^\s*(['"])([^'"]+)\1\s*$/;
31
+
32
+ /** One sibling anchor: edge `key` of the child anchors edge `align` of child `to`. */
33
+ interface Edge { to: string; key: string; align: string; }
34
+ interface Node { id: string; kid: UiChild; edges: Edge[]; deps: Set<string>; }
35
+
36
+ /** Per axis: the trailing / leading edge keys, and the neighbour's edge each must meet in a chain. */
37
+ const CHAIN_AXES: { lead: Set<string>; trail: Set<string>; leadMeets: string; trailMeets: string }[] = [
38
+ { lead: new Set(['left', 'start']), trail: new Set(['right', 'end']), leadMeets: 'End', trailMeets: 'Start' },
39
+ { lead: new Set(['top']), trail: new Set(['bottom']), leadMeets: 'Bottom', trailMeets: 'Top' },
40
+ ];
41
+
42
+ /**
43
+ * Whether a <-> b is one chain link: on one axis a's trailing edge meets b's leading edge and b's leading edge
44
+ * meets a's trailing edge (or the mirror). The RelativeContainer doc exempts chains from the no-cycle rule.
45
+ * chainMode only styles a chain the anchors already form (default SPREAD), so it is not required here.
46
+ */
47
+ function chainLink(a: Node, b: Node): boolean {
48
+ const has = (n: Node, to: string, keys: Set<string>, align: string): boolean =>
49
+ n.edges.some((e) => e.to === to && keys.has(e.key) && e.align === align);
50
+ return CHAIN_AXES.some((ax) =>
51
+ (has(a, b.id, ax.trail, ax.trailMeets) && has(b, a.id, ax.lead, ax.leadMeets)) ||
52
+ (has(a, b.id, ax.lead, ax.leadMeets) && has(b, a.id, ax.trail, ax.trailMeets)));
53
+ }
54
+
55
+ /** Shortest cycle through the graph found by DFS from each node in source order, as an id path (first id repeated at the end). */
56
+ function findCycle(nodes: Map<string, Node>): string[] | null {
57
+ const state: Map<string, 0 | 1 | 2> = new Map();
58
+ const stack: string[] = [];
59
+ const dfs = (id: string): string[] | null => {
60
+ state.set(id, 1);
61
+ stack.push(id);
62
+ for (const d of nodes.get(id)?.deps ?? []) {
63
+ if (!nodes.has(d)) { continue; }
64
+ const st = state.get(d) ?? 0;
65
+ if (st === 1) { return [...stack.slice(stack.indexOf(d)), d]; }
66
+ if (st === 0) {
67
+ const c = dfs(d);
68
+ if (c !== null) { return c; }
69
+ }
70
+ }
71
+ stack.pop();
72
+ state.set(id, 2);
73
+ return null;
74
+ };
75
+ for (const id of nodes.keys()) {
76
+ if ((state.get(id) ?? 0) === 0) {
77
+ const c = dfs(id);
78
+ if (c !== null) { return c; }
79
+ }
80
+ }
81
+ return null;
82
+ }
83
+
84
+ /**
85
+ * GATE relative-container-anchor-cycle: direct children of one RelativeContainer whose sibling anchors form a cycle.
86
+ * Per the RelativeContainer doc, mutual or circular dependencies make the container draw none of its children; the
87
+ * dependency is per component, so A anchoring B vertically while B anchors A horizontally counts too (weather cards).
88
+ * Only literal ids and literal anchors are read; children in exclusive if/else branches never depend on each other,
89
+ * and the two anchors of a chain link (same axis, end-to-start both ways) are exempt, as the doc allows.
90
+ */
91
+ export function checkRelativeContainerCycle(scans: FileScan[]): void {
92
+ for (const s of scans) {
93
+ const masked: string = maskedOf(s);
94
+ for (const m of masked.matchAll(/\bRelativeContainer\s*\(/g)) {
95
+ const paren: number = (m.index as number) + m[0].length - 1;
96
+ const argsEnd: number = matchBracket(s.code, paren);
97
+ if (argsEnd < 0) { continue; }
98
+ let k: number = argsEnd + 1;
99
+ while (k < s.code.length && /\s/.test(s.code[k])) { k++; }
100
+ if (s.code[k] !== '{') { continue; }
101
+ const close: number = matchBracket(s.code, k);
102
+ if (close < 0) { continue; }
103
+ const kids: UiChild[] = directUiChildren(s.code, k, close, undefined, { intoBranches: true })
104
+ .filter((c) => c.control !== true);
105
+ const nodes: Map<string, Node> = new Map();
106
+ for (const kid of kids) {
107
+ const idAttr = kid.attrs.find((a) => a.name === 'id');
108
+ const idm: RegExpExecArray | null = idAttr === undefined ? null : ID_LITERAL.exec(idAttr.args);
109
+ if (idm === null || nodes.has(idm[2])) { continue; }
110
+ const edges: Edge[] = [];
111
+ for (const a of kid.attrs) {
112
+ if (a.name !== 'alignRules') { continue; }
113
+ for (const em of a.args.matchAll(RULE_ENTRY)) {
114
+ const am: RegExpExecArray | null = ANCHOR.exec(em[2]);
115
+ if (am === null || am[2] === '__container__') { continue; }
116
+ edges.push({ to: am[2], key: em[1], align: ALIGN.exec(em[2])?.[1] ?? '' });
117
+ }
118
+ }
119
+ nodes.set(idm[2], { id: idm[2], kid, edges, deps: new Set(edges.map((e) => e.to)) });
120
+ }
121
+ // Drop edges between children that are never shown together, and both edges of a chain link.
122
+ // Collect first, then delete: chainLink reads the edges of both ends.
123
+ const drop: [Node, string][] = [];
124
+ for (const n of nodes.values()) {
125
+ for (const d of n.deps) {
126
+ const t: Node | undefined = nodes.get(d);
127
+ if (t === undefined || t === n) { continue; }
128
+ if (exclusiveBranches(n.kid, t.kid) || chainLink(n, t)) { drop.push([n, d]); }
129
+ }
130
+ }
131
+ for (const [n, d] of drop) { n.deps.delete(d); }
132
+ const cycle: string[] | null = findCycle(nodes);
133
+ if (cycle === null) { continue; }
134
+ report('GATE', 'relative-container-anchor-cycle', s.rel, lineOfIndex(s.code, m.index as number),
135
+ `RelativeContainer children anchor each other in a cycle (${cycle.map((c) => `'${c}'`).join(' -> ')}): ` +
136
+ 'with mutual or circular dependencies the container draws none of its children (only its background shows), ' +
137
+ 'whichever axes the anchors are on. Use Row { Image; Column { ... } } for icon + text, or make the anchors one-way');
138
+ }
139
+ }
140
+ }
@@ -17,7 +17,7 @@ export const meta: RuleMeta[] = [
17
17
  card: "geometry",
18
18
  needs: [],
19
19
  summary: "纵向 Scroll/List/Grid/WaterFlow 里、往上直到滚动容器都没有确定高度的 `RelativeContainer`,自身高度未设或为 `'auto'` / `LayoutPolicy.wrapContent` / `fixAtIdealSize`,且有子节点的 `alignRules` 在 top / bottom / center 上以 `'__container__'` 为锚点(跨 struct 追到调用处)。",
20
- fix: "RelativeContainer 文档:height 为 `\"auto\"`(API 11+)或 `wrapContent`(API 20+)时,只要垂直方向上有子组件以容器为锚点,自适应就不生效、视为未设高度(FAQ faqs-arkui-318:容器高与子组件布局循环依赖)。Android `wrap_content` 的卡片改用 `Column`/`Row`/`Stack` 表达(左图标 + 文字列 = `Row { Image; Column { … } }`,角落元素用 `Stack` + `Alignment`);确需二维约束时,纵向只锚兄弟节点(首个子节点不写纵向 alignRules,默认贴顶)并写 `.height('auto')`,或写参考 view tree 实测高度。",
20
+ fix: "RelativeContainer 文档:height 为 `\"auto\"`(API 11+)或 `wrapContent`(API 20+)时,只要垂直方向上有子组件以容器为锚点,自适应就不生效、视为未设高度(FAQ faqs-arkui-318:容器高与子组件布局循环依赖)。Android `wrap_content` 的卡片改用 `Column`/`Row`/`Stack` 表达(左图标 + 文字列 = `Row { Image; Column { … } }`,角落元素用 `Stack` + `Alignment`);确需二维约束时,纵向只锚兄弟节点(首个子节点不写纵向 alignRules,默认贴顶)并写 `.height('auto')`,或写参考 view tree 实测高度;兄弟锚定必须单向,不能 A 锚 B、B 又锚 A(不分横纵),否则子组件全部不绘制(GATE `relative-container-anchor-cycle`);链(同一方向首尾互锚 + 链头 `.chainMode()`)除外。",
21
21
  escape: null,
22
22
  cases: [
23
23
  "实测(天气首页,glm53 11-19):ConstraintLayout `wrap_content` 的日出/日落卡与 4 张信息卡译成只写 `.width('100%')` 的 RelativeContainer,图标同时锚 `__container__` 的 top 和 bottom;卡片在 Scroll 里被拉到远高于 Android 的 59dp。子代理在推理里写「RelativeContainer supports wrap?」后没有查文档,依据是 geometry 卡的「二维约束 → RelativeContainer」。",
@@ -96,7 +96,7 @@ export function checkRelativeContainerInScroll(scans: FileScan[]): void {
96
96
  `RelativeContainer with no definite height inside a vertical scroller (${[...hits[0]].reverse().join(' > ')}), and a child anchors ` +
97
97
  "'__container__' vertically: height 'auto' / wrapContent does not apply on an axis where children anchor the container, so the card " +
98
98
  'is not sized to its content. For an Android wrap_content card use Column / Row / Stack; to keep RelativeContainer, anchor ' +
99
- "vertically to siblings only and set .height('auto'), or set the measured height");
99
+ "vertically to siblings only (one-way: a sibling must not anchor back) and set .height('auto'), or set the measured height");
100
100
  }
101
101
  }
102
102
  }
@@ -0,0 +1,149 @@
1
+ // static_check/rules/see_through_overlay.ts — GATE scroll-driven-overlay-see-through.
2
+ //
3
+ // A collapsing header translated as "spacer at the top of the Scroll + a header overlay stacked above it" lets the
4
+ // content scroll UNDER the header. In Android that never happens: the MotionLayout / CoordinatorLayout constrains
5
+ // the content to the header's bottom (`flContent` Top_toBottomOf `@toolbar`), and the header draws its own
6
+ // opaque layers. When the overlay has no background of its own, every card that scrolls up shows through the header
7
+ // text (measured: the header backdrop had been moved to a separate layer UNDER the Refresh/Scroll for the
8
+ // status-bar extension, so the collapsed header was transparent and the cards overlapped the header text).
9
+
10
+ import { report } from '../core/findings.ts';
11
+ import { attrsWithArgs, directUiChildren, exclusiveBranches, lineOfIndex, markedAbove, matchBracket,
12
+ structBuildRoots } from '../core/parse.ts';
13
+ import type { UiAttr, UiChild } from '../core/parse.ts';
14
+ import { SCROLLERS, maskedOf, structDeclFor, verticalScroller } from '../core/scan.ts';
15
+ import type { FileScan } from '../core/scan.ts';
16
+ import type { RuleMeta } from '../core/meta.ts';
17
+ import { SCROLL_HANDLERS, overlaps, stateReads, stateWrites } from './offset_in_scroll.ts';
18
+
19
+ /** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
20
+ export const meta: RuleMeta[] = [
21
+ {
22
+ id: "scroll-driven-overlay-see-through",
23
+ levels: ["GATE"],
24
+ invariant: "geometry",
25
+ card: "dynamics",
26
+ needs: [],
27
+ summary: "同一个 `Stack` 里,纵向滚动容器(Scroll/List/Grid/WaterFlow)后面排着一个兄弟层;这个兄弟层的参数或属性读了该滚动容器滚动回调写入的状态(折叠头部的 progress / offset),而它的根是布局容器(Stack/Column/Row/Flex/RelativeContainer,或根为这些容器的自定义组件),根上没有任何 `.background*` / `.linearGradient`。滚动内容会从这个透明的头部底下穿过,头部文字压在卡片上。",
28
+ fix: "按 `cards/dynamics.md`「MotionLayout 折叠头部」处理:首选结构为 `Column { 头部(高度随状态变, 自己画不透明的背景层) ; Scroll(内容).layoutWeight(1) }`,在 Scroll 的 `.onScrollFrameBegin` 里让头部先消费滑动量(未收尽时返回 `{ offsetRemain: 0 }`),内容的可视区从头部底边开始,与 Android 的 `Top_toBottomOf=@toolbar` 一致。保留「占位 + 覆盖层」结构时,头部根节点必须自己画 Android 头部的不透明层(底色 + 头图,opacity 由同一状态驱动);页根外那层延伸背景只负责状态栏那一条(`cards/window.md` ③)。确认就是要透明(Android 侧内容确实从透明栏下穿过)时,在该兄弟层上方写 `// SEE-THROUGH-OK: <Android 布局 文件:行>`。",
29
+ escape: "// SEE-THROUGH-OK:",
30
+ cases: [
31
+ "实测中发现:页面的 `Stack { Scroll(346vp 占位 + 卡片).onDidScroll(→ this.progress) ; XxxHeader({ progress: this.progress }) }`,XxxHeader 根 `Stack` 无背景、`hitTestBehavior(Transparent)`;头部底色与头图被放进页根最底层(为状态栏延伸)。下滑后卡片在头部文字下面穿过,收起后的头部底色不显示。编译、冒烟、评审全过。",
32
+ ],
33
+ },
34
+ ];
35
+
36
+ /** Layout containers: they paint nothing unless given a background. */
37
+ const LAYOUT_ROOTS: Set<string> = new Set(['Stack', 'Column', 'Row', 'Flex', 'RelativeContainer']);
38
+ /** Attributes that make a container paint an opaque-ish layer of its own. */
39
+ const PAINTS: RegExp = /^(background|backgroundColor|backgroundImage|backgroundBlurStyle|backgroundEffect|linearGradient|radialGradient|sweepGradient)$/;
40
+
41
+ const paints = (attrs: UiAttr[]): boolean => attrs.some((a) => PAINTS.test(a.name));
42
+ /** Children that are an opaque layer by themselves when they span the header. */
43
+ const BACKDROPS: Set<string> = new Set(['Image', 'Rect']);
44
+
45
+ const fullWidth = (attrs: UiAttr[]): boolean => attrs.some((a) =>
46
+ (a.name === 'width' && /^\s*['"]100%['"]\s*$/.test(a.args)) || (a.name === 'size' && /\bwidth\s*:\s*['"]100%['"]/.test(a.args)));
47
+
48
+ /**
49
+ * A Stack root that draws its backdrop as its first child instead of a `.background*` attribute:
50
+ * `Stack() { Image(headerBg).width('100%').height('100%') ; Column() { … } }`, or a full-width first child with a
51
+ * background. `paren` is the `(` of the root call.
52
+ */
53
+ function backdropChild(code: string, paren: number): boolean {
54
+ const pclose: number = matchBracket(code, paren);
55
+ if (pclose < 0) { return false; }
56
+ let k: number = pclose + 1;
57
+ while (k < code.length && /\s/.test(code[k])) { k++; }
58
+ if (code[k] !== '{') { return false; }
59
+ const bclose: number = matchBracket(code, k);
60
+ if (bclose < 0) { return false; }
61
+ const first: UiChild | undefined = directUiChildren(code, k, bclose, undefined, { intoBranches: true })
62
+ .find((c) => !c.control && !c.branch && !c.isBuilderCall);
63
+ return first !== undefined && fullWidth(first.attrs) && (BACKDROPS.has(first.name) || paints(first.attrs));
64
+ }
65
+
66
+ /** Text of one child statement: its call arguments and its attribute arguments (what the overlay reads). */
67
+ function childText(code: string, kid: UiChild): string {
68
+ const paren: number = code.indexOf('(', kid.at);
69
+ const close: number = paren < 0 ? -1 : matchBracket(code, paren);
70
+ const args: string = close < 0 ? '' : code.slice(paren + 1, close);
71
+ return args + '\n' + kid.attrs.map((a) => a.args).join('\n');
72
+ }
73
+
74
+ /**
75
+ * Root of a custom component's build() as { root, attrs }, or null when it cannot be resolved (another project,
76
+ * a control-statement root). Unresolved components are left alone: better a miss than a false positive.
77
+ */
78
+ function customRoot(scans: FileScan[], s: FileScan, name: string):
79
+ { root: string; attrs: UiAttr[]; code: string; paren: number } | null {
80
+ const abs: string = structDeclFor(scans, s, name);
81
+ const decl: FileScan | undefined = abs === '' ? undefined : scans.find((t) => t.abs === abs || t.abs.replace(/\\/g, '/') === abs.replace(/\\/g, '/'));
82
+ const t: FileScan | undefined = decl ?? scans.find((x) => x.declaredStructs.includes(name));
83
+ if (t === undefined) { return null; }
84
+ const r = structBuildRoots(t.code).find((x) => x.struct === name);
85
+ return r === undefined ? null : { root: r.root, attrs: attrsWithArgs(t.code, r.paren), code: t.code, paren: r.paren };
86
+ }
87
+
88
+ /**
89
+ * GATE scroll-driven-overlay-see-through: in a Stack, a later sibling of a vertical scroller is driven by the state
90
+ * that scroller's scroll callback writes (a collapsing header), and that sibling is a layout container whose root
91
+ * paints nothing — so the scrolled content shows through it. `// SEE-THROUGH-OK: <basis>` above the sibling silences it.
92
+ */
93
+ export function checkSeeThroughScrollOverlay(scans: FileScan[]): void {
94
+ for (const s of scans) {
95
+ const masked: string = maskedOf(s);
96
+ const rawLines: string[] = s.src.split(/\r?\n/);
97
+ for (const m of masked.matchAll(/(?<![\w$.])Stack\s*\(/g)) {
98
+ const paren: number = (m.index ?? 0) + m[0].length - 1;
99
+ const pclose: number = matchBracket(s.code, paren);
100
+ if (pclose < 0) { continue; }
101
+ let k: number = pclose + 1;
102
+ while (k < s.code.length && /\s/.test(s.code[k])) { k++; }
103
+ if (s.code[k] !== '{') { continue; }
104
+ const bclose: number = matchBracket(s.code, k);
105
+ if (bclose < 0) { continue; }
106
+ const kids: UiChild[] = directUiChildren(s.code, k, bclose, undefined, { intoBranches: true });
107
+ kids.forEach((sc, i) => {
108
+ if (!SCROLLERS.has(sc.name) || !verticalScroller(sc.name, sc.attrs)) { return; }
109
+ const handlers: string = sc.attrs.filter((a) => SCROLL_HANDLERS.has(a.name)).map((a) => a.args).join('\n');
110
+ if (handlers === '') { return; }
111
+ const writes: Set<string> = stateWrites(handlers, scans, s);
112
+ if (writes.size === 0) { return; }
113
+ for (const ov of kids.slice(i + 1)) {
114
+ if (ov.control || exclusiveBranches(sc, ov) || ov.isBuilderCall) { continue; }
115
+ const hit: string = overlaps(stateReads(childText(s.code, ov), scans, s), writes);
116
+ if (hit === '') { continue; }
117
+ if (paints(ov.attrs)) { continue; } // the call site gives it a background
118
+ let root: string = ov.name;
119
+ let rootName: string = ov.name;
120
+ let rootAttrs: UiAttr[] = ov.attrs;
121
+ let rootCode: string = s.code;
122
+ let rootParen: number = s.code.indexOf('(', ov.at);
123
+ if (!LAYOUT_ROOTS.has(ov.name)) {
124
+ const cr = customRoot(scans, s, ov.name);
125
+ if (cr === null || !LAYOUT_ROOTS.has(cr.root)) { continue; }
126
+ root = `${ov.name} (root ${cr.root})`;
127
+ rootName = cr.root;
128
+ rootAttrs = cr.attrs;
129
+ rootCode = cr.code;
130
+ rootParen = cr.paren;
131
+ }
132
+ if (paints(rootAttrs)) { continue; }
133
+ // the backdrop is the root Stack's first child (header image / color layer under the text)
134
+ if (rootName === 'Stack' && rootParen >= 0 && backdropChild(rootCode, rootParen)) { continue; }
135
+ const line: number = lineOfIndex(s.code, ov.at);
136
+ if (markedAbove(rawLines, line, 'SEE-THROUGH-OK')) { continue; }
137
+ report('GATE', 'scroll-driven-overlay-see-through', s.rel, line,
138
+ `${root} is stacked above the ${sc.name} (line ${lineOfIndex(s.code, sc.at)}) and reads this.${hit}, which that ` +
139
+ `${sc.name}'s scroll callback writes, but neither the call site nor its root paints a background: the content ` +
140
+ 'scrolls under this header and shows through its text. In Android the content is constrained to the header\'s ' +
141
+ 'bottom and the header draws its own opaque layers. Put the header above the scroller in a Column and let it ' +
142
+ 'consume the drag in .onScrollFrameBegin (return { offsetRemain: 0 } until collapsed), or give the header root its ' +
143
+ 'Android background layers (color + header image, opacity from the same state). If Android really lets the content ' +
144
+ 'show through, write // SEE-THROUGH-OK: <Android layout file:line> above it');
145
+ }
146
+ });
147
+ }
148
+ }
149
+ }
@@ -0,0 +1,139 @@
1
+ // static_check/rules/sheet_builder.ts — GATE overlay-builder-arrow-arg / sheet-isshow-no-writeback.
2
+
3
+ import { report } from '../core/findings.ts';
4
+ import { lineOfIndex, markedAbove, maskStrings, matchBracket, splitTopLevel } from '../core/parse.ts';
5
+ import type { FileCtx } from '../core/scan.ts';
6
+ import type { RuleMeta } from '../core/meta.ts';
7
+
8
+ /** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
9
+ export const meta: RuleMeta[] = [
10
+ {
11
+ id: "overlay-builder-arrow-arg",
12
+ levels: ["GATE", "CAND"],
13
+ invariant: "interaction",
14
+ card: "widgets",
15
+ needs: [],
16
+ summary: "`.bindSheet(isShow, <箭头函数>, …)` / `.bindContentCover(isShow, <箭头函数>, …)` 的第二参是箭头函数字面量(如 `() => { this.X() }`),报 GATE;`.overlay(` / `.background(` / `.bindMenu(` / `.bindContextMenu(` 的第一参是箭头函数,报 CAND。",
17
+ fix: "系统属性的 builder 参数直接写 `this.X()`(或 `this.X(arg)`):编译器只认这种写法,把它改写成 `{ builder: () => { this.X.call(this) } }`;箭头函数原样下传成裸函数,运行时读不到 `builder`,弹层静默不出现,编译不报错。`() => { this.X() }` 只用于自定义组件的 `@BuilderParam` 实参(见 builder-param-bare-method-ref),不要套到系统属性上。已上机确认当前 SDK 能显示箭头写法的弹层时,在调用处上方写 `// SHEET-BUILDER-ARROW: <依据>` 降为 CAND。",
18
+ escape: "// SHEET-BUILDER-ARROW:",
19
+ cases: [
20
+ "实测(CoolMall 短信登录图形验证码,ds-1126):source-only 弹层 ImageCaptchaDialog 写成 `.bindSheet(this.visible, () => { this.CaptchaSheet() }, {…})`;通知权限、fetchCaptcha、`visible=true` 日志全对,屏幕无弹层。改成 `this.CaptchaSheet()` 后每次弹出。同项目另外 4 个弹层都是直接传 builder。编译、GATE、冒烟、评审全过。",
21
+ ],
22
+ },
23
+ {
24
+ id: "sheet-isshow-no-writeback",
25
+ levels: ["GATE", "CAND"],
26
+ invariant: "state",
27
+ card: "widgets",
28
+ needs: [],
29
+ summary: "`.bindSheet(` / `.bindContentCover(` 的 isShow 不是双向绑定(没有 `$$x` / `x!!`),且第三参的字面量 options 里没有 `onDisappear` / `onWillDisappear` / `onWillDismiss` / `shouldDismiss`,或第三参是 `ModalTransition.X`(这个重载放不下关闭回调),报 GATE;options 不是字面量(变量、调用),或写了回调但回调体里既没有赋值也没有 `this.x()` 调用(`onWillDismiss` / `shouldDismiss` 不调 `dismiss()` 即拦下关闭,视为已处理),报 CAND。回调体只按文本启发式判断,不追踪被调方法是否真把状态写回 false。",
30
+ fix: "用户下滑、点蒙层或按返回键关闭弹层时,系统不会回写单向传入的 isShow,状态停在 true,下次再设 true 没有变化,弹层第二次打不开。能双向绑定时写 `$$this.x`(V1)或 `this.x!!`(V2);isShow 来自 @Param 等不能双向绑定的入参时,在 options 里加 `onDisappear: () => { this.onDismiss() }`,把宿主状态拉回 false;`bindContentCover` 的第三参从 `ModalTransition.X` 改为 `{ modalTransition: ModalTransition.X, onDisappear: … }`。确有其他途径保证状态复位时,在调用处上方写 `// SHEET-CLOSE-OWNED: <依据>` 降为 CAND。",
31
+ escape: "// SHEET-CLOSE-OWNED:",
32
+ cases: [
33
+ "实测(CoolMall 短信登录图形验证码,ds-1126):ImageCaptchaDialog 的 `visible` 是 @Param,bindSheet 没有任何关闭回调;下滑关闭后再点「获取验证码」不再弹出。",
34
+ ],
35
+ },
36
+ ];
37
+
38
+ /** Built-in attributes whose builder argument the compiler only rewrites from a direct `this.X()` call. */
39
+ const SHEET: RegExp = /\.(bindSheet|bindContentCover)\s*\(/g;
40
+ const FIRST_ARG_BUILDER: RegExp = /\.(overlay|background|bindMenu|bindContextMenu)\s*\(/g;
41
+ const CLOSE_PROP: RegExp = /^\s*(onDisappear|onWillDisappear|onWillDismiss|shouldDismiss)\s*(?::\s*([\s\S]*))?$/;
42
+
43
+ /** Close callbacks (`{ key, value }`, value undefined for a shorthand property) of a literal `{ … }` options object. */
44
+ function closeCallbacks(opts: string): { key: string; value: string | undefined }[] {
45
+ const close: number = matchBracket(opts, 0);
46
+ if (close < 0) { return []; }
47
+ const out: { key: string; value: string | undefined }[] = [];
48
+ for (const prop of splitTopLevel(opts.slice(1, close))) {
49
+ const m: RegExpMatchArray | null = prop.match(CLOSE_PROP);
50
+ if (m !== null) { out.push({ key: m[1], value: m[2] }); }
51
+ }
52
+ return out;
53
+ }
54
+
55
+ /**
56
+ * The callback can put the host state back: a reference (body not visible), an inline body with an assignment or a
57
+ * `this.x()` call, or an onWillDismiss / shouldDismiss that never calls `dismiss()` and so blocks the system close.
58
+ */
59
+ function callbackWritesBack(key: string, value: string | undefined): boolean {
60
+ if (value === undefined || !isArrowLiteral(value)) { return true; }
61
+ const noOps: string = value.replace(/=>|===?|!==?|<=|>=/g, ' ');
62
+ if (/=/.test(noOps) || /\bthis\s*\.\s*[\w$]+\s*(?:\?\.\s*)?\(/.test(value)) { return true; }
63
+ return (key === 'onWillDismiss' || key === 'shouldDismiss') && !/\.\s*dismiss\s*\(/.test(value);
64
+ }
65
+
66
+ /** Why a one-way isShow can get stuck, with its level; null when the options handle the close. */
67
+ function writebackIssue(optsArg: string | undefined): { level: 'GATE' | 'CAND'; why: string } | null {
68
+ const opts: string = (optsArg ?? '').trim();
69
+ if (/^ModalTransition\s*\./.test(opts)) {
70
+ return { level: 'GATE', why: 'its third argument is a ModalTransition, an overload with no room for a close callback ' +
71
+ '(pass { modalTransition: …, onDisappear: … } instead)' };
72
+ }
73
+ if (opts !== '' && !opts.startsWith('{')) {
74
+ return { level: 'CAND', why: 'its options are not a literal, so no close callback is visible' };
75
+ }
76
+ const cbs = opts === '' ? [] : closeCallbacks(opts);
77
+ if (cbs.length === 0) { return { level: 'GATE', why: 'its options have no onDisappear / onWillDismiss' }; }
78
+ if (cbs.some((c) => callbackWritesBack(c.key, c.value))) { return null; }
79
+ return { level: 'CAND', why: `its ${cbs.map((c) => c.key).join(' / ')} body neither assigns state nor calls this.x()` };
80
+ }
81
+
82
+ /** `() => …`, `(a: T) => …`, `x => …`, `async () => …`, `function () {…}`. */
83
+ function isArrowLiteral(arg: string): boolean {
84
+ const s: string = arg.trim();
85
+ return /^(?:async\s+)?(?:\([^()]*\)|[A-Za-z_$][\w$]*)\s*(?::\s*[^=]+?)?\s*=>/.test(s) || /^function\b/.test(s);
86
+ }
87
+
88
+ /** Top-level arguments of the call whose `(` is the last char of the match at `at`, or null when unbalanced. */
89
+ function callArgs(masked: string, at: number, len: number): string[] | null {
90
+ const open: number = at + len - 1;
91
+ const close: number = matchBracket(masked, open);
92
+ return close < 0 ? null : splitTopLevel(masked.slice(open + 1, close));
93
+ }
94
+
95
+ /** isShow is two-way bound (`$$this.x` in V1, `this.x!!` in V2) or a constant that cannot get stuck. */
96
+ function boundTwoWay(isShow: string): boolean {
97
+ const s: string = isShow.trim();
98
+ return s.startsWith('$$') || s.endsWith('!!') || s === 'true' || s === 'false';
99
+ }
100
+
101
+ /**
102
+ * GATE overlay-builder-arrow-arg: a built-in builder attribute gets an arrow function instead of `this.X()`.
103
+ * The compiler (ets-loader processCustomBuilderProperty) only rewrites a builder call / builder reference into
104
+ * `{ builder: … }`; an arrow is passed through as a bare function and the native side finds no `builder`.
105
+ *
106
+ * GATE sheet-isshow-no-writeback: a one-way isShow with no close callback stays true after a system dismissal.
107
+ */
108
+ export function checkSheetBuilder(fctx: FileCtx): void {
109
+ const masked: string = maskStrings(fctx.code);
110
+ for (const m of masked.matchAll(SHEET)) {
111
+ const at: number = m.index ?? 0;
112
+ const args: string[] | null = callArgs(masked, at, m[0].length);
113
+ if (args === null || args.length < 2) { continue; }
114
+ const line: number = lineOfIndex(fctx.code, at);
115
+ if (isArrowLiteral(args[1])) {
116
+ report(markedAbove(fctx.rawLines, line, 'SHEET-BUILDER-ARROW') ? 'CAND' : 'GATE', 'overlay-builder-arrow-arg', fctx.rel, line,
117
+ `.${m[1]}(…) gets an arrow function as its builder: the compiler only turns \`this.X()\` into { builder: … }, ` +
118
+ 'so the arrow reaches the runtime as a bare function and the panel never shows (no error). Pass `this.X()` directly; ' +
119
+ '`() => { this.X() }` is only for a custom component\'s @BuilderParam');
120
+ }
121
+ if (boundTwoWay(args[0])) { continue; }
122
+ const issue = writebackIssue(args[2]);
123
+ if (issue === null) { continue; }
124
+ const soft: boolean = issue.level === 'CAND' || markedAbove(fctx.rawLines, line, 'SHEET-CLOSE-OWNED');
125
+ report(soft ? 'CAND' : 'GATE', 'sheet-isshow-no-writeback', fctx.rel, line,
126
+ `.${m[1]}(${args[0].trim()}, …) binds isShow one-way and ${issue.why}` +
127
+ ': after the user swipes / taps the mask / presses back, the state stays true and the panel never opens again. ' +
128
+ 'Use $$this.x (V1) or this.x!! (V2), or add onDisappear that sets the host state back to false; ' +
129
+ 'write // SHEET-CLOSE-OWNED: <basis> above the call when the state is reset elsewhere');
130
+ }
131
+ for (const m of masked.matchAll(FIRST_ARG_BUILDER)) {
132
+ const at: number = m.index ?? 0;
133
+ const args: string[] | null = callArgs(masked, at, m[0].length);
134
+ if (args === null || args.length < 1 || !isArrowLiteral(args[0])) { continue; }
135
+ report('CAND', 'overlay-builder-arrow-arg', fctx.rel, lineOfIndex(fctx.code, at),
136
+ `.${m[1]}(…) gets an arrow function as its builder; the compiler only rewrites \`this.X()\` into { builder: … }. ` +
137
+ 'Pass `this.X()` directly unless the attribute is known to accept a bare function');
138
+ }
139
+ }
@@ -0,0 +1,53 @@
1
+ // static_check/rules/sheet_show_close.ts — GATE sheet-show-close-unset.
2
+ //
3
+ // SheetOptions.showClose defaults to true: the system draws a close (×) button in the sheet's top-right corner. Android's
4
+ // Material ModalBottomSheet / BottomSheetDialog have no such button, so a bindSheet that leaves showClose unset grows an
5
+ // extra icon that no static check, build or smoke run notices.
6
+
7
+ import { report } from '../core/findings.ts';
8
+ import { lineOfIndex, matchBracket, splitTopLevel } from '../core/parse.ts';
9
+ import type { FileCtx } from '../core/scan.ts';
10
+ import type { RuleMeta } from '../core/meta.ts';
11
+
12
+ /** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
13
+ export const meta: RuleMeta[] = [
14
+ {
15
+ id: "sheet-show-close-unset",
16
+ levels: ["GATE"],
17
+ invariant: "appearance",
18
+ card: "widgets",
19
+ needs: [],
20
+ summary: "`bindSheet` 的字面量选项没写 `showClose`,或只传了两个参数、没有选项 —— 它默认 `true`,系统在面板右上角画一个关闭按钮,而 Android 的 `ModalBottomSheet` / `BottomSheetDialog` 没有这个按钮。",
21
+ fix: "按 Android 显式写:源侧弹层没有关闭按钮(Material 底部弹层的默认)写 `showClose: false`;源侧确实在标题栏右上角有关闭图标、且要用系统按钮代替时写 `showClose: true`。源侧自绘的关闭图标留在 builder 里,同时写 `showClose: false`,否则会出现两个。",
22
+ escape: null,
23
+ cases: [
24
+ "实测(电商应用设置页):夜间模式、主题颜色两个 `bindSheet` 写了 dragBar/backgroundColor/radius/maskColor,没写 `showClose`,面板右上角各多一个系统关闭按钮;同工程其他弹层写了 `showClose: false`,因为规则没要求,写不写全看子代理。",
25
+ ],
26
+ },
27
+ ];
28
+
29
+ /**
30
+ * GATE sheet-show-close-unset: a `.bindSheet(isShow, builder, { … })` whose literal options object has no `showClose`.
31
+ * A two-argument `.bindSheet(isShow, builder)` has no options at all, so showClose is the default there too. Options
32
+ * passed as a variable are not judged (their content is not visible here).
33
+ */
34
+ export function checkSheetShowClose(fctx: FileCtx): void {
35
+ const { rel, code } = fctx;
36
+ for (const m of code.matchAll(/\.bindSheet\s*\(/g)) {
37
+ const open: number = (m.index ?? 0) + m[0].length - 1;
38
+ const close: number = matchBracket(code, open);
39
+ if (close < 0) { continue; }
40
+ const opt: string = (splitTopLevel(code.slice(open + 1, close))[2] ?? '').trim();
41
+ if (opt !== '') {
42
+ if (!opt.startsWith('{') || !opt.endsWith('}')) { continue; }
43
+ const keys: string[] = splitTopLevel(opt.slice(1, -1))
44
+ .map((e) => /^\s*([A-Za-z_$][\w$]*)\s*:/.exec(e)?.[1] ?? '');
45
+ if (keys.includes('showClose')) { continue; }
46
+ }
47
+ report('GATE', 'sheet-show-close-unset', rel, lineOfIndex(code, m.index ?? 0),
48
+ (opt === '' ? 'bindSheet passes no options, so showClose' : 'bindSheet options do not set showClose,') +
49
+ ' which defaults to true: the system draws a close button in the sheet\'s ' +
50
+ 'top-right corner. Android\'s ModalBottomSheet / BottomSheetDialog have none, so write showClose: false; write ' +
51
+ 'showClose: true only when the Android sheet really shows a close icon there and the system button replaces it');
52
+ }
53
+ }