@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,113 +1,86 @@
1
1
  # Platform API argument/return contracts (@hometrans/platform-api-contract)
2
2
 
3
- ## Symptom
4
-
5
- A platform API's **documented** contract is not enforced by the type system: an argument type the
6
- d.ts accepts is rejected at run time (often without throwing — the call returns `undefined`), or the
7
- return value is `undefined` on failure. The code compiles clean, every built-in rule passes, and at
8
- run time the feature silently degrades or the next member access kills the process.
9
-
10
- | Sub-code | Runtime failure |
11
- | --- | --- |
12
- | `[buffer-arg-type]` | `image.createImageSource(bytes)` where `bytes` is the `Uint8Array` returned by `util.Base64Helper().decodeSync(...)` (the d.ts wants `ArrayBuffer`) — **the compiler reports nothing**, the call returns `undefined` at run time, and `source.createPixelMap()` throws `Cannot read property 'createPixelMap' of undefined`, killing the process |
13
- | `[nullable-return-unguarded]` | the same family of APIs returns `undefined` on failure and the caller dereferences it without a null check — same `Cannot read property … of undefined` (wrapped in try/catch the feature just degrades silently) |
14
- | `[extra-data-empty-string]` | `http.HttpRequestOptions.extraData` is `""` (its type is `string \| Object \| ArrayBuffer`, so an empty string type-checks) — NetStack rejects it during parameter validation, the request never leaves the device, and the log only shows `NETSTACK error 401 Parameter error` (which reads like an auth failure) |
15
-
16
- ## Detection
17
-
18
- Three sub-codes share one rule: two table-driven ones read `data/api-param-contract.json`, the
19
- value-domain one (`extraData`) works on the CFG. All of them run per method.
20
-
21
- ### Table-driven (`data/api-param-contract.json`)
22
-
23
- The contracts are keyed by **API method name** (the last path segment), so a new API with the same
24
- failure shape is a JSON edit:
25
-
26
- ```json
27
- {
28
- "argContracts": {
29
- "createImageSource": {
30
- "argIndex": 0,
31
- "expect": "ArrayBuffer",
32
- "receiver": "multimedia\\.image|@kit\\.ImageKit|(?:^|[^.\\w$])image[.:]",
33
- "rejectText": ["decodeSync(", "new Uint8Array(", "new util.TextEncoder().encode("],
34
- "allowText": [".buffer", ".buffer.slice(", ".buffer.subarray(", "as ArrayBuffer"]
35
- }
36
- },
37
- "nullableReturns": {
38
- "createImageSource": { "type": "ImageSource", "receiver": "multimedia\\.image|..." }
39
- }
40
- }
41
- ```
42
-
43
- **Precision rules (each one exists because of a real mis-report)**
44
-
45
- - Only `ArkInvokeStmt` / `ArkAssignStmt` are call sites; an `ArkIfStmt` contributes its **condition
46
- text only** (as a null guard) — in ArkAnalyzer the if-statement text spans the whole block body,
47
- so scanning it reports "if line + call line" twice.
48
- - Only **bracket-depth-0** calls of the statement count: a call written inside a closure the
49
- statement passes (`.then(() => { … })`) belongs to that closure's own method, not to the outer
50
- statement (otherwise the `then` line and the closure line both report).
51
- - The callee must belong to the API's real owner (`receiver`): a project-local wrapper with the same
52
- name (`ImageUtil.createImageSource(bytes: Uint8Array)`) never fires.
53
- - `allowText` forms are the correct argument and always pass: `x.buffer`, `x.buffer.slice(...)`,
54
- `x.buffer.subarray(...)`, `as ArrayBuffer` — including when written inline.
55
- - Local backtracking follows **a single declaration only**: a name declared more than once in the
56
- method (one per `if`/`else` branch) is never followed — text-level backtracking is scope-blind, so
57
- it stays silent rather than risk a false ERROR.
58
-
59
- - **buffer-arg-type** — for qualified calls, the `argIndex` argument is an **error** when it does
60
- **not** hit `allowText` and **does** hit `rejectText` (directly, or through the unique local
61
- declaration). String literals, real `ArrayBuffer`s, the `.buffer` family and the URI overload stay
62
- silent.
63
- - **nullable-return-unguarded** — `const|let|var x = api(…)` where `api` is in `nullableReturns`,
64
- and the **first** depth-0 `x.` after it has **no null guard** in between, is a **warning at the
65
- use line**. Recognized guards: `x === null|undefined`, `x !== null|undefined`, `!x`, `if (!x)`,
66
- `if (x)`, `x &&`. The guard forms are open-ended (helper assertions, wrapped chains are not
67
- recognized), so this routes to review instead of blocking.
68
-
69
- ### Value domain (CFG semantics)
70
-
71
- - **extra-data-empty-string** — an `ArkAssignStmt` whose left operand is an `ArkInstanceFieldRef`
72
- named `extraData` (in the IR, `{ extraData: body }` and `options.extraData = body` have the same
73
- shape). For every such assignment the value is graded: literal `""` → provably empty (**error**);
74
- non-empty literal / `JSON.stringify(...)` → clean; local variable → bounded backtracking over its
75
- assignments (union of outcomes); method parameter → cross-file call-site scan (a `""` argument →
76
- **error**, cannot prove non-empty → **warn**); non-string type (Object / ArrayBuffer) → not this
77
- defect. An assignment inside an emptiness guard is clean
78
- (`if (body.length > 0) options.extraData = body;`); unrelated branches such as
79
- `if (method === RequestMethod.POST)` only downgrade a call-site proof to a warning.
3
+ A platform API's **documented** contract is not enforced by the type system: an argument the d.ts
4
+ accepts is rejected at run time (often returning `undefined`), or the return value is `undefined` on
5
+ failure. The code compiles clean; at run time the feature silently degrades or the next member
6
+ access kills the process.
7
+
8
+ | Sub-code | Symptom | Severity |
9
+ | --- | --- | --- |
10
+ | `[buffer-arg-type]` | a `Uint8Array` passed where `ArrayBuffer` is required returns `undefined`; the next `createPixelMap` throws | error |
11
+ | `[nullable-return-unguarded]` | an API failure returns `undefined`; the caller dereferences/chains it without a guard | warn |
12
+ | `[extra-data-empty-string]` | `extraData: ""`; NetStack answers 401 and the request never leaves the device | error / warn |
13
+ | `[encoded-arg-missing]` | raw HTML passed to `loadData`; the first `#` truncates the page and nothing reports it | warn |
14
+ | `[sql-capability]` | `CREATE VIRTUAL TABLE` uses a module/tokenizer the target platform lacks | warn |
15
+ | `[image-src-form]` | `Image(runtime expression)`; the string form cannot be verified statically | warn |
16
+
17
+ ## Boundaries
18
+
19
+ The table-driven sub-codes read `data/api-param-contract.json`; `extraData` uses the CFG. All run
20
+ per method.
21
+
22
+ - **buffer-arg-type** — the callee must be the API's real owner (`receiver`); the `argIndex`
23
+ argument is an error when it does **not** hit `allowText` and **does** hit `rejectText` (directly,
24
+ or through the unique local declaration). The `.buffer` family, `as ArrayBuffer`, string
25
+ literals, real `ArrayBuffer`s and the URI overload pass. Only bracket-depth-0 calls of the
26
+ statement count (a closure body belongs to the closure); an `if` contributes its condition text
27
+ only, as a null guard.
28
+ - **nullable-return-unguarded** — the first depth-0 `x.` after a unique `api(...)` assignment, with
29
+ no null guard in between, is a warning at the use line. Recognized guards: `x ===
30
+ null|undefined`, `x !== null|undefined`, `!x`, `if (x)`, `x &&`; helper assertions are not
31
+ recognized, hence warning.
32
+ - **extra-data-empty-string** — an assignment whose left side is `extraData`. Literal `""` → error;
33
+ non-empty literal / `JSON.stringify` → clean; a local is backtracked (bounded); a parameter is
34
+ checked against call sites (a `""` argument → error, unprovable → warn); a non-string type is
35
+ skipped. An assignment inside an emptiness guard is clean; unrelated branches only downgrade a
36
+ call-site proof to warn.
37
+ - **encoded-arg-missing** — the argument (or its unique assignment source) must come from
38
+ `encoders` (`encodeToStringSync` / `encodeSync` / `encodeURIComponent` / `encodeURI`). A literal
39
+ without interpolation and without `#` / `%` passes. Two further legal call forms pass through
40
+ `acceptWhen`: a literal `encoding` of `base64`, or a non-empty literal `baseUrl` / `historyUrl`
41
+ (the d.ts only takes the `data:`-URL branch when both are empty; it recommends a space for both).
42
+ A variable cannot be proven non-empty and still warns; a failed trace still warns; `receiver` must
43
+ anchor to the real owner (`WebviewController.loadData`; the analyzer returns a `MethodSignature`
44
+ object, so coerce it to a string before matching).
45
+ - **sql-capability** — resolve `runtimeOS` from `build-profile.json5`; an unresolved platform stays
46
+ silent. Only a `sqlCapabilities` lookup of `false` is reported; `true`, unregistered names and a
47
+ variable tokenizer stay silent. Read a 3-line window from the `CREATE VIRTUAL TABLE` line.
48
+ - **image-src-form** — report only runtime expressions (member access, call, template,
49
+ concatenation). `$r` / `$rawfile`, `PixelMap`, bare identifiers, literal-only strings and comments
50
+ are skipped; the data URL is not parsed.
80
51
 
81
52
  ## Severity
82
53
 
83
- - `error`: `[buffer-arg-type]` (the argument form does not hit `allowText` and does hit `rejectText`,
84
- including through the unique local declaration — wrong under every legal reading), and a provably
85
- empty `[extra-data-empty-string]` (a literal, or a parameter that some call site passes `""` to).
86
- - `warn`: `[nullable-return-unguarded]` (whether the failure path is reachable and whether the guard
87
- is recognizable is a review judgement), and an `[extra-data-empty-string]` that may be empty but
88
- cannot be proven.
89
-
90
- Only `@hometrans` warnings are judged: the gate decides per finding whether it is a real defect and fixes it when it is. Errors are mandatory; warnings from every other rule set are ignored.
54
+ - `error`: `[buffer-arg-type]`; a provably empty `[extra-data-empty-string]` (literal, or a call
55
+ site that passes `""`).
56
+ - `warn`: `[nullable-return-unguarded]`, an unprovable empty `extraData`, `[encoded-arg-missing]`,
57
+ a `false` `[sql-capability]` hit, `[image-src-form]`. Only `@hometrans` warnings are judged;
58
+ errors are mandatory.
91
59
 
92
60
  ## Fix
93
61
 
94
62
  ```ts
95
63
  // [buffer-arg-type] Uint8Array -> ArrayBuffer (exact slice of the underlying buffer)
96
- const bytes: Uint8Array = new util.Base64Helper().decodeSync(pureBase64);
97
- const buffer: ArrayBuffer =
98
- bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer;
99
- const source: image.ImageSource | undefined = image.createImageSource(buffer);
64
+ const buffer = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer;
65
+ const source = image.createImageSource(buffer);
66
+
67
+ // [nullable-return-unguarded] guard first, do not chain
68
+ if (source === undefined) { this.releasePixelMap(); return; }
69
+
70
+ // [extra-data-empty-string] omit the field instead of passing ""
71
+ if (body.length > 0) { options.extraData = body; }
72
+
73
+ // [encoded-arg-missing] Base64/URL-encode first (so # cannot start a fragment)
74
+ const b64 = new util.Base64Helper().encodeToStringSync(bytes);
75
+ this.controller.loadData(b64, 'text/html', 'base64');
76
+
77
+ // Or the other documented form: pass a non-empty baseUrl/historyUrl (a space is recommended);
78
+ // the payload is then loaded as ordinary HTML and # cannot start a fragment.
79
+ this.controller.loadData(html, 'text/html', 'UTF-8', ' ', ' ');
100
80
 
101
- // [nullable-return-unguarded] fall back to the placeholder instead of chaining
102
- if (source === undefined) {
103
- this.releasePixelMap(); // render the placeholder branch
104
- return;
105
- }
106
- source.createPixelMap().then(/* … */).catch(/* … */);
81
+ // [sql-capability] use a tokenizer the platform ships
82
+ "... USING fts5(content, tokenize = 'trigram')"
107
83
 
108
- // [extra-data-empty-string] omit the field for an empty body instead of passing ""
109
- const options: http.HttpRequestOptions = { method: POST, header: { 'Content-Type': 'application/json' } };
110
- if (body.length > 0) {
111
- options.extraData = body;
112
- }
84
+ // [image-src-form] confirm http(s) / file / data:<mime>;base64,<payload> and the matching
85
+ // permission/sandbox requirement
113
86
  ```
@@ -0,0 +1,52 @@
1
+ # @hometrans/route-page-side-effect-import
2
+
3
+ **目的**:HAR/HSP 里用 `@Entry({ routeName })` 声明的路由页,只有被宿主 HAP 真正编译进
4
+ `ets/modules.abc` 才会进入命名路由表。命名 import 的符号若从未被引用,会被 ArkTS 的构建时代码优化去掉,
5
+ 页面模块不参与编译,运行时 `router.pushNamedRoute` / `replaceNamedRoute` 报 `100004`
6
+ (典型表现是 Splash 一直停在启动页)。本规则要求:**每个依赖里的路由页,在能到达它的
7
+ entry/feature HAP 中都应有一行指向页面文件的副作用 import。**
8
+
9
+ ## 判定边界
10
+
11
+ - 只检查 `module.json5` 的 `type` 为 `har` / `shared` / `hsp` 的模块里的 `@Entry({routeName})`
12
+ 页面;HAP 自己的路由页不在范围内。
13
+ - 只有该库能通过 `oh-package.json5` 依赖图或工程 import 图从某个 entry/feature HAP 到达时才
14
+ 判定;没有任何 HAP 使用的孤儿库不报。
15
+ - 副作用 import 必须解析到**页面文件本身**:
16
+ ```ts
17
+ import 'citypicker/src/main/ets/pages/SelectCityRoutesSelectCityPage';
18
+ ```
19
+ 以下都不算(会被构建时代码优化去掉,或只加载 barrel,页面模块仍不编译):
20
+ - `import { SelectCityRoutesSelectCityPage } from 'citypicker';`
21
+ - `import 'citypicker';`(barrel `Index.ets`)
22
+ - 说明符按 `oh-package.json5` 的 `name` + 子路径或相对路径解析;无法解析时不猜测、不报。
23
+ - 每个「路由页 × 可达 HAP」只报一条;多个 HAP 可达时分别报。
24
+
25
+ ## 修复
26
+
27
+ 在入口 Ability 可达的登记文件(如 HAP 的 `pages/RouteRegistry.ets`)里给每个依赖路由页补
28
+ 一行副作用 import:
29
+
30
+ ```ts
31
+ // products/<hap>/src/main/ets/pages/RouteRegistry.ets
32
+ import 'launch/src/main/ets/pages/LaunchRoutesSplashPage';
33
+ import 'weatherboard/src/main/ets/pages/MainRoutesMainPage';
34
+ import 'citypicker/src/main/ets/pages/SelectCityRoutesSelectCityPage';
35
+ ```
36
+
37
+ 并确保登记文件本身被入口 Ability import(否则它也会被构建时代码优化去掉):
38
+
39
+ ```ts
40
+ import { RouteRegistry } from '../pages/RouteRegistry';
41
+ ```
42
+
43
+ HAR 页面不要写进 HAP 的 `main_pages.json`(那里只列 HAP 自身页面)。
44
+
45
+ ## 维护 / 误报
46
+
47
+ - 路由页由 HAP 自己拥有、或库没有被任何 HAP 使用时不会报;这属于设计范围,不是漏检。
48
+ - 若确认某个路由页在运行期不会被任何入口跳转(仍建议登记,成本为零),可写
49
+ `// homecheck-disable-next-line @hometrans/route-page-side-effect-import` 并记录 ruleId、
50
+ 文件、行号、原因。
51
+ - 本规则只检查「存在副作用 import」,不检查登记文件是否最终可达入口 Ability;可达性由
52
+ 代码评审或入口 Ability 的 import 保证。
@@ -0,0 +1,59 @@
1
+ # @hometrans/route-page-side-effect-import
2
+
3
+ **Purpose**: a route page declared in a HAR/HSP with `@Entry({ routeName })` enters the
4
+ named-route table only when the consuming HAP actually compiles the page module into
5
+ `ets/modules.abc`. A named import whose symbol is never referenced is tree-shaken away, so the
6
+ page module is not compiled and `router.pushNamedRoute` / `replaceNamedRoute` throws `100004` at
7
+ run time (typically the splash page stays on screen). This rule requires: **for every route
8
+ page owned by a dependency, each entry/feature HAP that can reach that dependency must contain a
9
+ side-effect import of the page file.**
10
+
11
+ ## Boundaries
12
+
13
+ - Only `@Entry({routeName})` pages in modules whose `module.json5` `type` is `har` / `shared` /
14
+ `hsp` are graded; a route page owned by the HAP itself is out of scope.
15
+ - A page is graded only when its library is reachable from an entry/feature HAP through the
16
+ `oh-package.json5` dependency graph or the project import graph; an orphan library is silent.
17
+ - The side-effect import must resolve to the **page file itself**:
18
+ ```ts
19
+ import 'citypicker/src/main/ets/pages/SelectCityRoutesSelectCityPage';
20
+ ```
21
+ The following do not count (tree-shaken, or only the barrel is evaluated while the page module
22
+ is still not compiled):
23
+ - `import { SelectCityRoutesSelectCityPage } from 'citypicker';`
24
+ - `import 'citypicker';` (the `Index.ets` barrel)
25
+ - Specifiers are resolved through `oh-package.json5` `name` + subpath or relative paths;
26
+ unresolved specifiers stay silent (never a guess).
27
+ - One finding per (route page × reachable HAP); several reachable HAPs produce one finding each.
28
+
29
+ ## Fix
30
+
31
+ Add one side-effect import per dependency route page to a registry file reachable from the entry
32
+ ability (e.g. the HAP's `pages/RouteRegistry.ets`):
33
+
34
+ ```ts
35
+ // products/<hap>/src/main/ets/pages/RouteRegistry.ets
36
+ import 'launch/src/main/ets/pages/LaunchRoutesSplashPage';
37
+ import 'weatherboard/src/main/ets/pages/MainRoutesMainPage';
38
+ import 'citypicker/src/main/ets/pages/SelectCityRoutesSelectCityPage';
39
+ ```
40
+
41
+ Also import the registry file from the entry ability, otherwise the registry itself is
42
+ tree-shaken:
43
+
44
+ ```ts
45
+ import { RouteRegistry } from '../pages/RouteRegistry';
46
+ ```
47
+
48
+ Do not list HAR pages in the HAP's `main_pages.json` — it only lists the HAP's own pages.
49
+
50
+ ## Data / false positives
51
+
52
+ - A route page owned by the HAP, or a library no HAP consumes, is not reported; that is out of
53
+ scope, not a miss.
54
+ - If a route page is provably never navigated by any entry (registering it is still free), add
55
+ `// homecheck-disable-next-line @hometrans/route-page-side-effect-import` and record ruleId,
56
+ file, line and reason.
57
+ - The rule only checks that a side-effect import exists; it does not verify that the registry
58
+ file is ultimately reachable from the entry ability. Code review / the entry ability's import
59
+ keeps that guarantee.
@@ -25,6 +25,12 @@
25
25
  * source of truth: adding a newly introduced Kit/permission only requires a new
26
26
  * entry there (see data/README.md). There is no generator script.
27
27
  *
28
+ * Findings carry extra guidance based on the entry metadata: `restricted`
29
+ * permissions append an ACL/signing-profile hint (a missing ACL fails the
30
+ * install), `system_only` permissions append a permission-free-alternative
31
+ * hint, and `user_grant` permissions append a runtime-request hint (the code
32
+ * may also need abilityAccessCtrl.requestPermissionsFromUser).
33
+ *
28
34
  * Global rule: imports and module.json5 are cross-file information, so this
29
35
  * checker extends GlobalChecker and uses checkScene(scene) rather than the
30
36
  * per-method matcher dispatch.
@@ -151,6 +157,48 @@ function grantLabel(permission) {
151
157
  return `${level} / ${grant}${since}`;
152
158
  }
153
159
 
160
+ /**
161
+ * Extra guidance appended to a missing-permission finding.
162
+ *
163
+ * `restricted` entries need an ACL entry in the signing profile; without it the
164
+ * app installs with the permission silently dropped (or fails the install), so
165
+ * the finding must say so.
166
+ */
167
+ const RESTRICTED_HINT = {
168
+ en: ' Restricted (ACL) permission: you may also need to add it to the signing configuration (signature profile ACLs), otherwise the installation can fail. Prefer a Picker or a security component when it can cover the use case.',
169
+ cn: '受限(ACL)权限:可能还需要在签名配置(signature profile 的 ACL 列表)中加入该权限,否则可能导致安装失败;如果 Picker 或安全控件能满足需求,优先使用它们。',
170
+ };
171
+
172
+ const SYSTEM_ONLY_HINT = {
173
+ en: ' System-only permission: an ordinary app cannot request it; use a Picker, a security component, or delegate to a system app instead.',
174
+ cn: '系统应用专属权限:普通应用无法申请,请改用 Picker / 安全控件,或跳转系统应用。',
175
+ };
176
+
177
+ const USER_GRANT_HINT = {
178
+ en: ' user_grant permission: the code may also need to call abilityAccessCtrl.requestPermissionsFromUser at runtime, which shows the user confirmation dialog.',
179
+ cn: '用户授权(user_grant)权限:代码中可能还需要在运行时调用 abilityAccessCtrl.requestPermissionsFromUser 申请,弹出用户确认弹窗。',
180
+ };
181
+
182
+ function permissionHints(permission) {
183
+ const en = [];
184
+ const cn = [];
185
+ if (!permission) return { en: '', cn: '' };
186
+ if (permission.grant === 'system_only') {
187
+ en.push(SYSTEM_ONLY_HINT.en);
188
+ cn.push(SYSTEM_ONLY_HINT.cn);
189
+ return { en: en.join(''), cn: cn.join('') };
190
+ }
191
+ if (permission.restricted === true) {
192
+ en.push(RESTRICTED_HINT.en);
193
+ cn.push(RESTRICTED_HINT.cn);
194
+ }
195
+ if (permission.grant === 'user_grant') {
196
+ en.push(USER_GRANT_HINT.en);
197
+ cn.push(USER_GRANT_HINT.cn);
198
+ }
199
+ return { en: en.join(''), cn: cn.join('') };
200
+ }
201
+
154
202
  /* ---------- multi-module discovery ---------- */
155
203
 
156
204
  function walkFiles(dir, exts, out, depth) {
@@ -386,12 +434,12 @@ class ApiPermissionDeclaredCheck extends GlobalChecker {
386
434
  super();
387
435
  this.messages = {
388
436
  missing: {
389
- en: 'Import of %s requires permission %s (%s), but it is not declared in %s requestPermissions.',
390
- cn: '导入 %s 需要权限 %s(%s),但 %s 的 requestPermissions 中未声明。',
437
+ en: 'Import of %s may require permission %s (%s), but it is not declared in %s requestPermissions.',
438
+ cn: '导入 %s 可能需要权限 %s(%s),但 %s 的 requestPermissions 中未声明。',
391
439
  },
392
440
  noModuleFile: {
393
- en: 'Import of %s requires permissions, but no module.json5 could be found for the source file.',
394
- cn: '导入 %s 需要申请权限,但无法定位该源文件所属的 module.json5。',
441
+ en: 'Import of %s may require permissions, but no module.json5 could be found for the source file.',
442
+ cn: '导入 %s 可能需要申请权限,但无法定位该源文件所属的 module.json5。',
395
443
  },
396
444
  badModuleFile: {
397
445
  en: 'Cannot parse %s while checking permissions required by %s.',
@@ -429,13 +477,14 @@ class ApiPermissionDeclaredCheck extends GlobalChecker {
429
477
  }
430
478
  }
431
479
 
432
- report(filePath, line, colStart, colEnd, messageKey, values, severity) {
480
+ report(filePath, line, colStart, colEnd, messageKey, values, severity, permission) {
433
481
  // Include the owning module (values[3]) in the dedup key: the same import
434
482
  // can create a missing-permission finding for more than one HAP.
435
483
  const key = `${RULE_ID}|${filePath}|${line}|${colStart}|${values[1] || ''}|${values[3] || ''}|${messageKey}`;
436
484
  if (this.reported.has(key)) return;
437
485
  this.reported.add(key);
438
486
  const template = this.messages[messageKey];
487
+ const hints = permissionHints(permission);
439
488
  const build = (text) => {
440
489
  let result = text;
441
490
  for (const value of values) result = result.replace('%s', String(value));
@@ -446,7 +495,7 @@ class ApiPermissionDeclaredCheck extends GlobalChecker {
446
495
  line,
447
496
  colStart,
448
497
  colEnd,
449
- message: { en: build(template.en), cn: build(template.cn) },
498
+ message: { en: build(template.en) + hints.en, cn: build(template.cn) + hints.cn },
450
499
  severity,
451
500
  });
452
501
  }
@@ -624,7 +673,7 @@ class ApiPermissionDeclaredCheck extends GlobalChecker {
624
673
  path.dirname(path.resolve(req.originFile)), declaring.moduleJson5
625
674
  ).replace(/\\/g, '/') || MODULE_FILE;
626
675
  this.report(req.originFile, pos.line, pos.colStart, pos.colEnd, 'missing',
627
- [req.spec, permission.name, grantLabel(permission), relModule], AlertLevel.WARN);
676
+ [req.spec, permission.name, grantLabel(permission), relModule], AlertLevel.WARN, permission);
628
677
  }
629
678
  }
630
679
  }
@@ -690,7 +739,7 @@ class ApiPermissionDeclaredCheck extends GlobalChecker {
690
739
  if (declared.has(permission.name)) continue;
691
740
  this.report(filePath, pos.line, pos.colStart, pos.colEnd, 'missing',
692
741
  [hit.spec, permission.name, grantLabel(permission), relModule],
693
- AlertLevel.WARN);
742
+ AlertLevel.WARN, permission);
694
743
  }
695
744
  }
696
745
  }