@buaa_smat/hometrans 26.0.3 → 26.0.4-devecocli.1

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 (780) hide show
  1. package/agents/code-reviewer.md +91 -21
  2. package/devecocli-plugin/common.ts +2271 -0
  3. package/devecocli-plugin/content-resolver.ts +363 -0
  4. package/devecocli-plugin/install.ts +72 -0
  5. package/devecocli-plugin/uninstall.ts +26 -0
  6. package/devecocli-plugin/update.ts +77 -0
  7. package/i18n/agents/code-reviewer.md +93 -21
  8. package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
  9. package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  10. package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
  11. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
  12. package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
  13. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
  14. package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
  15. package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
  16. package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
  17. package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
  18. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
  19. package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
  20. package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
  21. package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
  22. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
  23. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
  24. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
  25. package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
  26. package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
  27. package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
  28. package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
  29. package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
  30. package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
  31. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
  32. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
  33. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
  34. package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
  35. package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
  36. package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
  37. package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
  42. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
  43. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  44. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
  45. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
  46. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  47. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
  48. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  49. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
  50. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
  51. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
  52. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
  53. package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  54. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
  55. package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
  56. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
  57. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  58. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
  59. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
  60. package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
  61. package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  79. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  80. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  81. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  82. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
  83. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  84. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  85. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  86. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
  87. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  88. package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  89. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
  90. package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
  91. package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
  92. package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
  93. package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
  94. package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  95. package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
  96. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  97. package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
  98. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
  99. package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
  100. package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
  101. package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
  102. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
  103. package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
  104. package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
  105. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  106. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  107. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  108. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  109. package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  110. package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
  111. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
  112. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
  113. package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
  114. package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
  115. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
  116. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  117. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
  118. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  119. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  120. package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
  122. package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  123. package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
  124. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  125. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
  126. package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
  127. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
  128. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
  129. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
  131. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
  132. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
  133. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
  134. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  135. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  136. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  137. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
  138. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  139. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
  140. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
  141. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
  142. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
  143. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  144. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  145. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  146. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  147. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  148. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
  149. package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  150. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  151. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
  152. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
  153. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
  154. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
  155. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
  156. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
  157. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
  158. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
  159. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
  160. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
  161. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
  162. package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  163. package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
  164. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
  165. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  166. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  167. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  168. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  169. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  170. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  171. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  172. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  173. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  174. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  175. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  176. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
  177. package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
  178. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
  179. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  180. package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
  181. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
  182. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  183. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  184. package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
  185. package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
  186. package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
  187. package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
  188. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  189. package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
  190. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  191. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  192. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  193. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
  194. package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
  195. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
  196. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
  197. package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
  198. package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
  199. package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  200. package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  201. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
  202. package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  203. package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  204. package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
  205. package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
  206. package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  207. package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  208. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  209. package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  210. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
  211. package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  212. package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  213. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
  214. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
  215. package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
  216. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
  217. package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
  218. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  219. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
  220. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
  221. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
  222. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
  223. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  224. package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
  225. package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
  226. package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
  227. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
  228. package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  229. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  230. package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  231. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
  232. package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  233. package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
  234. package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
  235. package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  236. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  237. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  238. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
  239. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  240. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
  241. package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
  242. package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
  243. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
  244. package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  245. package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  246. package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  247. package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  248. package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  249. package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
  250. package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  251. package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  252. package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  253. package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
  254. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
  255. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  256. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
  257. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  258. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
  259. package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  260. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  261. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
  262. package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  263. package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
  264. package/index.js +1643 -0
  265. package/package.json +10 -13
  266. package/plugin.jsonc +12 -0
  267. package/skills/a2h-app-migrate/SKILL.md +19 -11
  268. package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  269. package/skills/a2h-app-migrate/references/stage-map.md +2 -2
  270. package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
  271. package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
  272. package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
  273. package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
  274. package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
  275. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
  276. package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
  277. package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
  278. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
  279. package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
  280. package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
  281. package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
  282. package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
  283. package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
  284. package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
  285. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
  286. package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
  287. package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
  288. package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
  289. package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
  290. package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
  291. package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
  292. package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
  293. package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
  294. package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
  295. package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
  296. package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
  297. package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
  298. package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
  299. package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
  300. package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
  301. package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
  302. package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
  303. package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
  304. package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
  305. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
  306. package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
  307. package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
  308. package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
  309. package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
  310. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
  311. package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
  312. package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
  313. package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
  314. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  315. package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
  316. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
  317. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
  318. package/skills/a2h-arch-generate/SKILL.md +20 -17
  319. package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
  320. package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
  321. package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
  322. package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
  323. package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
  324. package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
  325. package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
  326. package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
  327. package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
  328. package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
  329. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
  330. package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
  331. package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
  332. package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
  333. package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
  334. package/skills/a2h-batch-ui-align/SKILL.md +72 -22
  335. package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
  336. package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  337. package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
  338. package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  339. package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
  340. package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
  341. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  342. package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
  343. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
  344. package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
  345. package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  346. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
  347. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  348. package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
  349. package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
  350. package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
  351. package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
  352. package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  353. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
  354. package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
  355. package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
  356. package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
  357. package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
  358. package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
  359. package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
  360. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
  361. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
  362. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  363. package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
  364. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
  365. package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
  366. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
  367. package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
  368. package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
  369. package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
  370. package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
  371. package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  372. package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
  373. package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
  374. package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
  375. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
  376. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
  377. package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  378. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  379. package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  380. package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  381. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  382. package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  383. package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  384. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  385. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  386. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
  387. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  388. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  389. package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
  390. package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  391. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  392. package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  393. package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  394. package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  395. package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  396. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
  397. package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  398. package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  399. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
  400. package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
  401. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
  402. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
  403. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
  404. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  405. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
  406. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  407. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
  408. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
  409. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
  410. package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  411. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
  412. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
  413. package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
  414. package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
  415. package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
  416. package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
  417. package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
  418. package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
  419. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
  420. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
  421. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
  422. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
  423. package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
  424. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
  425. package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
  426. package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
  427. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
  428. package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
  429. package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
  430. package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
  431. package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
  432. package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
  433. package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
  434. package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
  435. package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  436. package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
  437. package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  438. package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
  439. package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
  440. package/skills/a2h-page-specgen/SKILL.md +124 -20
  441. package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
  442. package/skills/a2h-page-specgen/references/body-language.md +11 -9
  443. package/skills/a2h-page-specgen/references/evidence.md +35 -0
  444. package/skills/a2h-page-specgen/references/execution-model.md +135 -26
  445. package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
  446. package/skills/a2h-page-specgen/references/gates.md +120 -52
  447. package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
  448. package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
  449. package/skills/a2h-page-specgen/references/spec-example.md +312 -0
  450. package/skills/a2h-page-specgen/references/spec-template.md +112 -109
  451. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  452. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  453. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  454. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  455. package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
  456. package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  457. package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
  458. package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
  459. package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
  460. package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
  461. package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
  462. package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
  463. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
  464. package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
  465. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  466. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
  467. package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  468. package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  469. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
  470. package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
  471. package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  472. package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
  473. package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
  474. package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
  475. package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  476. package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
  477. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  478. package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
  479. package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
  480. package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
  481. package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
  482. package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
  483. package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
  484. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
  485. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
  486. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
  487. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
  488. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
  489. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
  490. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
  491. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
  492. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  493. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  494. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  495. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
  496. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  497. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
  498. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
  499. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
  500. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
  501. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
  502. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  503. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  504. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  505. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  506. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  507. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
  508. package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  509. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  510. package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
  511. package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
  512. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
  513. package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
  514. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
  515. package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
  516. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
  517. package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
  518. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
  519. package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
  520. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
  521. package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  522. package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
  523. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
  524. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
  525. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
  526. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
  527. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
  528. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
  529. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
  530. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
  531. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
  532. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
  533. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
  534. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
  535. package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
  536. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
  537. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
  538. package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
  539. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  540. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  541. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  542. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  543. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  544. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  545. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  546. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  547. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  548. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  549. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  550. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
  551. package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
  552. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
  553. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  554. package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
  555. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
  556. package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  557. package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  558. package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
  559. package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
  560. package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
  561. package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
  562. package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
  563. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
  564. package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
  565. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  566. package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
  567. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  568. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  569. package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
  570. package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  571. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
  572. package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
  573. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
  574. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
  575. package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
  576. package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
  577. package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
  578. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
  579. package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  580. package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
  581. package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  582. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
  583. package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  584. package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  585. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
  586. package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
  587. package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
  588. package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
  589. package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
  590. package/skills/a2h-resource-convert/SKILL.md +9 -1
  591. package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  592. package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  593. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  594. package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  595. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
  596. package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
  597. package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
  598. package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
  599. package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  600. package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
  601. package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
  602. package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
  603. package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
  604. package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  605. package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
  606. package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
  607. package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
  608. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
  609. package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
  610. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
  611. package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
  612. package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
  613. package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
  614. package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
  615. package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  616. package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
  617. package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
  618. package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
  619. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
  620. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
  621. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
  622. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
  623. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
  624. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
  625. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
  626. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
  627. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
  628. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
  629. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
  630. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
  631. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
  632. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
  633. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
  634. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
  635. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
  636. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
  637. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
  638. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
  639. package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
  640. package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
  641. package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
  642. package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
  643. package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
  644. package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
  645. package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
  646. package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
  647. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
  648. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
  649. package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
  650. package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
  651. package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
  652. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
  653. package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
  654. package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
  655. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
  656. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
  657. package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
  658. package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
  659. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
  660. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
  661. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
  662. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
  663. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
  664. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
  665. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
  666. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
  667. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
  668. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
  669. package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
  670. package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
  671. package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
  672. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  673. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
  674. package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
  675. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
  676. package/skills/a2h-spec-generate/SKILL.md +2 -2
  677. package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
  678. package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
  679. package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
  680. package/skills/a2h-utg-explorer/SKILL.md +9 -3
  681. package/skills/a2h-utg-explorer/references/architecture.md +3 -0
  682. package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
  683. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
  684. package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
  685. package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  686. package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
  687. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  688. package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
  689. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
  690. package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
  691. package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  692. package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
  693. package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
  694. package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
  695. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
  696. package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
  697. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
  698. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  699. package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
  700. package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
  701. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
  702. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
  703. package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
  704. package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
  705. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
  706. package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
  707. package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  708. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
  709. package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  710. package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  711. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
  712. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  713. package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
  714. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
  715. package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
  716. package/skills/a2h-utg-static/SKILL.md +6 -2
  717. package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
  718. package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
  719. package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  720. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
  721. package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  722. package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  723. package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  724. package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  725. package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
  726. package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  727. package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  728. package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  729. package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
  730. package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
  731. package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
  732. package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
  733. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
  734. package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  735. package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
  736. package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
  737. package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  738. package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
  739. package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
  740. package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  741. package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
  742. package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
  743. package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
  744. package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
  745. package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
  746. package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  747. package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
  748. package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  749. package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
  750. package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
  751. package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
  752. package/README.md +0 -440
  753. package/dist/cli/config-store.js +0 -128
  754. package/dist/cli/config.js +0 -48
  755. package/dist/cli/editors.json +0 -114
  756. package/dist/cli/env-vars.js +0 -127
  757. package/dist/cli/index.js +0 -76
  758. package/dist/cli/init.js +0 -2618
  759. package/dist/cli/uninstall.js +0 -406
  760. package/dist/platform/compose.js +0 -228
  761. package/dist/platform/frontmatter.js +0 -151
  762. package/dist/platform/installer.js +0 -417
  763. package/dist/platform/language.js +0 -77
  764. package/dist/platform/registry.js +0 -337
  765. package/dist/platform/transform.js +0 -363
  766. package/dist/platform/types.js +0 -9
  767. package/dist/platform/validate.js +0 -152
  768. package/dist/utils/regex.js +0 -7
  769. package/env-requirements.json +0 -536
  770. package/resource/choose_editor.png +0 -0
  771. package/resource/convert_pipeline_process.svg +0 -114
  772. package/resource/project_architecture.svg +0 -120
  773. package/resource/set_environment.png +0 -0
  774. package/resource/set_multimodel.png +0 -0
  775. package/resource/set_sdk.png +0 -0
  776. package/resource/title_dark.png +0 -0
  777. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
  778. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
  779. package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
  780. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
@@ -0,0 +1,1123 @@
1
+ // entry-evidence.mjs — deterministic static entry and outbound navigation evidence.
2
+ // Graph rows locate producers and callees; they never establish runtime values.
3
+
4
+ import { maskNonCode as sharedMaskNonCode } from "./lib/source-text.mjs";
5
+ import fs from "node:fs";
6
+ import path from "node:path";
7
+ import { COVERAGE_PROFILE, stableDigest } from "./behavior-model.mjs";
8
+
9
+ const ENTRY_QUERY_LIMIT = 100;
10
+ const ORIGIN_FIELDS = [
11
+ "entry", "is_launcher", "deep_links", "launch_hint", "origin_kind", "source_file",
12
+ "entry_kind", "launch", "fqn",
13
+ "exported", "restoration", "process_restoration", "restore", "restorable",
14
+ ];
15
+
16
+ function cmp(a, b) {
17
+ return a < b ? -1 : a > b ? 1 : 0;
18
+ }
19
+
20
+ function sortByDigest(values) {
21
+ return [...values].sort((a, b) => cmp(stableDigest(a), stableDigest(b)));
22
+ }
23
+
24
+ function uniqueStrings(values) {
25
+ return [...new Set(values.filter(value => typeof value === "string" && value !== ""))].sort(cmp);
26
+ }
27
+
28
+ function normalizeLocator(value) {
29
+ if (typeof value !== "string" || value === "") return null;
30
+ const locator = value.replace(/(?::\d+)+$/, "").replace(/\\/g, "/");
31
+ return locator === "" ? null : locator;
32
+ }
33
+
34
+ function parseTrigger(trigger) {
35
+ if (typeof trigger !== "string") return null;
36
+ const match = /^([^@]*)@(.+):(\d+)$/.exec(trigger);
37
+ if (!match) return null;
38
+ return { kind: match[1] || null, locator: normalizeLocator(match[2]), line: Number(match[3]) };
39
+ }
40
+
41
+ function parseAt(at) {
42
+ if (typeof at !== "string") return null;
43
+ const match = /^(.*):(\d+)$/.exec(at);
44
+ if (!match) return null;
45
+ return { kind: null, locator: normalizeLocator(match[1]), line: Number(match[2]) };
46
+ }
47
+
48
+ function edgeLocator(edge) {
49
+ return parseTrigger(edge?.trigger) ?? parseAt(edge?.at);
50
+ }
51
+
52
+ function sourceOrigin(page, pageId = page.page_id) {
53
+ const recorded = (page.source_origins ?? []).find(origin => origin?.page_id === pageId);
54
+ if (recorded) return { ...recorded };
55
+ const origin = {
56
+ page_id: pageId,
57
+ kind: pageId === page.page_id ? page.kind ?? null : null,
58
+ label: pageId === page.page_id ? page.label ?? null : null,
59
+ declared_at: pageId === page.page_id ? page.declared_at ?? null : null,
60
+ };
61
+ if (pageId === page.page_id) {
62
+ for (const field of ORIGIN_FIELDS) {
63
+ if (Object.prototype.hasOwnProperty.call(page, field)) origin[field] = page[field];
64
+ }
65
+ }
66
+ return origin;
67
+ }
68
+
69
+ function originsOf(page) {
70
+ const origins = (page.source_origins ?? []).map(origin => ({ ...origin }));
71
+ if (!origins.some(origin => origin.page_id === page.page_id)) origins.unshift(sourceOrigin(page));
72
+ return origins.sort((a, b) => cmp(a.page_id ?? "", b.page_id ?? ""));
73
+ }
74
+
75
+ function deepLinksOf(origin) {
76
+ const direct = Array.isArray(origin?.deep_links) ? origin.deep_links : [];
77
+ const hinted = Array.isArray(origin?.launch_hint?.deep_links) ? origin.launch_hint.deep_links : [];
78
+ const byDigest = new Map();
79
+ for (const value of [...direct, ...hinted]) {
80
+ const supported = (typeof value === "string" && value !== "")
81
+ || (value !== null && typeof value === "object" && !Array.isArray(value));
82
+ if (!supported) continue;
83
+ const copy = typeof value === "string" ? value : { ...value };
84
+ const digest = stableDigest(copy);
85
+ if (!byDigest.has(digest)) byDigest.set(digest, copy);
86
+ }
87
+ return sortByDigest([...byDigest.values()]);
88
+ }
89
+
90
+ function isLauncher(origin) {
91
+ return origin?.is_launcher === true || origin?.launch_hint?.is_launcher === true
92
+ || origin?.entry_kind === "launcher"
93
+ || (origin?.entry === true && origin?.launch?.type === "component");
94
+ }
95
+
96
+ function isIntentAction(origin) {
97
+ return origin?.entry_kind === "intent-action" || origin?.launch?.type === "intent-action"
98
+ || (origin?.entry === true && !isLauncher(origin) && deepLinksOf(origin).length === 0
99
+ && Array.isArray(origin?.launch_hint?.actions) && origin.launch_hint.actions.length > 0);
100
+ }
101
+
102
+ function restorationOf(origin) {
103
+ for (const key of ["restoration", "process_restoration", "restore", "restorable"]) {
104
+ if (origin?.[key] !== undefined && origin?.[key] !== null && origin?.[key] !== false) return origin[key];
105
+ const hinted = origin?.launch_hint?.[key];
106
+ if (hinted !== undefined && hinted !== null && hinted !== false) return hinted;
107
+ }
108
+ return null;
109
+ }
110
+
111
+ function firstDefined(...values) {
112
+ return values.find(value => value !== undefined) ?? null;
113
+ }
114
+
115
+ function firstString(...values) {
116
+ return values.find(value => typeof value === "string" && value !== "") ?? null;
117
+ }
118
+
119
+ function lineAt(text, offset) {
120
+ return text.slice(0, Math.max(0, offset)).split(/\r?\n/).length;
121
+ }
122
+
123
+ function offsetAtLine(text, line) {
124
+ if (!Number.isInteger(line) || line < 1) return Number.MAX_SAFE_INTEGER;
125
+ let offset = 0;
126
+ for (let current = 1; current < line; current += 1) {
127
+ const newline = text.indexOf("\n", offset);
128
+ if (newline === -1) return Number.MAX_SAFE_INTEGER;
129
+ offset = newline + 1;
130
+ }
131
+ return offset;
132
+ }
133
+
134
+ /** Preserve offsets while hiding comments and strings from structural scans. */
135
+ function maskNonCode(text) {
136
+ return sharedMaskNonCode(text);
137
+ }
138
+
139
+ /** Remove comments only; literal strings, including comment markers, stay intact. */
140
+ function stripComments(text) {
141
+ const output = text.split("");
142
+ const blank = index => {
143
+ if (output[index] !== "\n" && output[index] !== "\r") output[index] = " ";
144
+ };
145
+ let state = "code";
146
+ let quote = null;
147
+ let escaped = false;
148
+ for (let index = 0; index < text.length; index += 1) {
149
+ const char = text[index];
150
+ const next = text[index + 1];
151
+ if (state === "line-comment") {
152
+ if (char === "\n" || char === "\r") state = "code";
153
+ else blank(index);
154
+ continue;
155
+ }
156
+ if (state === "block-comment") {
157
+ if (char === "*" && next === "/") {
158
+ blank(index);
159
+ blank(index + 1);
160
+ index += 1;
161
+ state = "code";
162
+ } else blank(index);
163
+ continue;
164
+ }
165
+ if (state === "raw-string") {
166
+ if (char === '"' && next === '"' && text[index + 2] === '"') {
167
+ index += 2;
168
+ state = "code";
169
+ }
170
+ continue;
171
+ }
172
+ if (state === "string") {
173
+ if (escaped) escaped = false;
174
+ else if (char === "\\") escaped = true;
175
+ else if (char === quote) state = "code";
176
+ continue;
177
+ }
178
+ if (char === "/" && next === "/") {
179
+ blank(index);
180
+ blank(index + 1);
181
+ index += 1;
182
+ state = "line-comment";
183
+ } else if (char === "/" && next === "*") {
184
+ blank(index);
185
+ blank(index + 1);
186
+ index += 1;
187
+ state = "block-comment";
188
+ } else if (char === '"' && next === '"' && text[index + 2] === '"') {
189
+ index += 2;
190
+ state = "raw-string";
191
+ } else if (char === '"' || char === "'" || char === "`") {
192
+ quote = char;
193
+ escaped = false;
194
+ state = "string";
195
+ }
196
+ }
197
+ return output.join("");
198
+ }
199
+
200
+ function matchingParen(masked, open) {
201
+ let depth = 0;
202
+ for (let index = open; index < masked.length; index += 1) {
203
+ if (masked[index] === "(") depth += 1;
204
+ else if (masked[index] === ")") {
205
+ depth -= 1;
206
+ if (depth === 0) return index;
207
+ }
208
+ }
209
+ return -1;
210
+ }
211
+
212
+ /** Split masked argument/parameter bodies without splitting nested expressions. */
213
+ function topLevelParts(masked) {
214
+ const parts = [];
215
+ let start = 0;
216
+ let round = 0;
217
+ let square = 0;
218
+ let curly = 0;
219
+ for (let index = 0; index < masked.length; index += 1) {
220
+ const char = masked[index];
221
+ if (char === "(") round += 1;
222
+ else if (char === ")") round -= 1;
223
+ else if (char === "[") square += 1;
224
+ else if (char === "]") square -= 1;
225
+ else if (char === "{") curly += 1;
226
+ else if (char === "}") curly -= 1;
227
+ else if (char === "," && round === 0 && square === 0 && curly === 0) {
228
+ parts.push([start, index]);
229
+ start = index + 1;
230
+ }
231
+ }
232
+ parts.push([start, masked.length]);
233
+ return parts;
234
+ }
235
+
236
+ function topLevelCharacter(masked, wanted, end = masked.length) {
237
+ let round = 0;
238
+ let square = 0;
239
+ let curly = 0;
240
+ for (let index = 0; index < end; index += 1) {
241
+ const char = masked[index];
242
+ if (char === "(") round += 1;
243
+ else if (char === ")") round -= 1;
244
+ else if (char === "[") square += 1;
245
+ else if (char === "]") square -= 1;
246
+ else if (char === "{") curly += 1;
247
+ else if (char === "}") curly -= 1;
248
+ else if (char === wanted && round === 0 && square === 0 && curly === 0) {
249
+ if (wanted === "=") {
250
+ const previous = masked[index - 1] ?? "";
251
+ const next = masked[index + 1] ?? "";
252
+ if (["=", "!", "<", ">"].includes(previous) || ["=", ">"].includes(next)) continue;
253
+ }
254
+ return index;
255
+ }
256
+ }
257
+ return -1;
258
+ }
259
+
260
+ /** Kotlin string templates are expressions; escaped dollars in quoted strings are literal text. */
261
+ function hasStringTemplate(body, raw = false) {
262
+ for (let index = 0; index < body.length; index += 1) {
263
+ if (!raw && body[index] === "\\") {
264
+ index += 1;
265
+ continue;
266
+ }
267
+ if (body[index] !== "$") continue;
268
+ if (body[index + 1] === "{" || /[A-Za-z_]/.test(body[index + 1] ?? "")) return true;
269
+ }
270
+ return false;
271
+ }
272
+
273
+ /** Return a value only for source data literals; expressions are never evaluated. */
274
+ function literalValue(raw) {
275
+ const text = String(raw ?? "").trim();
276
+ if (text === "true") return { known: true, value: true };
277
+ if (text === "false") return { known: true, value: false };
278
+ if (text === "null") return { known: true, value: null };
279
+ if (/^-?(?:\d+\.?\d*|\.\d+)(?:[fFlL])?$/.test(text)) {
280
+ return { known: true, value: Number(text.replace(/[fFlL]$/, "")) };
281
+ }
282
+ if (text.startsWith('"""') && text.endsWith('"""') && text.length >= 6) {
283
+ const body = text.slice(3, -3);
284
+ return hasStringTemplate(body, true) ? { known: false } : { known: true, value: body };
285
+ }
286
+ if ((text.startsWith('"') && text.endsWith('"')) || (text.startsWith("'") && text.endsWith("'"))) {
287
+ if (hasStringTemplate(text.slice(1, -1))) return { known: false };
288
+ try {
289
+ return {
290
+ known: true,
291
+ value: text[0] === '"' ? JSON.parse(text.replace(/\\\$/g, "$")) : text.slice(1, -1).replace(/\\(['\\])/g, "$1"),
292
+ };
293
+ } catch {
294
+ return { known: false };
295
+ }
296
+ }
297
+ return { known: false };
298
+ }
299
+
300
+ function routeWrapper(edge) {
301
+ const args = firstDefined(edge?.args, edge?.arguments, edge?.parameters, edge?.params);
302
+ if (!args || typeof args !== "object" || Array.isArray(args)) return null;
303
+ if (args.via !== "route-wrapper" || typeof args.wrapper !== "string" || args.wrapper === "") return null;
304
+ return args.wrapper;
305
+ }
306
+
307
+ function escapedIdentifier(value) {
308
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
309
+ }
310
+
311
+ function readSource(sourceProject, locator) {
312
+ if (locator === null) return null;
313
+ try {
314
+ return fs.readFileSync(path.resolve(sourceProject, locator), "utf8");
315
+ } catch {
316
+ return null;
317
+ }
318
+ }
319
+
320
+ function wrapperCall({ sourceProject, locator, line, wrapper }) {
321
+ const failure = cause => ({ call: null, issues: [{ cause }] });
322
+ const text = readSource(sourceProject, locator);
323
+ if (text === null) return failure("call-site-source-unread");
324
+ const segments = wrapper.split(".");
325
+ const name = segments.at(-1);
326
+ const receiver = segments.at(-2);
327
+ if (!/^[A-Za-z_$][\w$]*$/.test(name ?? "")) return failure("wrapper-call-unresolved");
328
+ const callee = receiver && /^[A-Za-z_$][\w$]*$/.test(receiver)
329
+ ? `${escapedIdentifier(receiver)}\\s*\\.\\s*${escapedIdentifier(name)}`
330
+ : escapedIdentifier(name);
331
+ const masked = maskNonCode(text);
332
+ const matches = [...masked.matchAll(new RegExp(`\\b${callee}\\s*\\(`, "g"))]
333
+ .filter(match => lineAt(text, match.index) === line);
334
+ if (matches.length === 0) return failure("wrapper-call-not-found");
335
+ if (matches.length !== 1) return failure("wrapper-call-ambiguous");
336
+ const open = masked.indexOf("(", matches[0].index);
337
+ const close = matchingParen(masked, open);
338
+ if (close === -1) return failure("wrapper-call-malformed");
339
+ const originalBody = text.slice(open + 1, close);
340
+ const maskedBody = masked.slice(open + 1, close);
341
+ const supplied = new Map();
342
+ const positional = [];
343
+ const issues = [];
344
+ for (const [start, end] of topLevelParts(maskedBody)) {
345
+ const raw = stripComments(originalBody.slice(start, end)).trim();
346
+ if (raw === "") continue;
347
+ const cleanedMasked = maskedBody.slice(start, end);
348
+ const equals = topLevelCharacter(cleanedMasked, "=");
349
+ const named = equals === -1 ? null : /^([A-Za-z_$][\w$]*)\s*=(?!=)/.exec(stripComments(raw));
350
+ if (named === null) {
351
+ positional.push({ expression: raw, literal: literalValue(raw) });
352
+ continue;
353
+ }
354
+ const argument = named[1];
355
+ if (supplied.has(argument)) {
356
+ issues.push({ cause: "wrapper-call-malformed", argument });
357
+ continue;
358
+ }
359
+ const expression = raw.slice(named[0].length).trim();
360
+ const literal = literalValue(expression);
361
+ supplied.set(argument, { expression, literal });
362
+ if (!literal.known) issues.push({
363
+ cause: "computed-argument", argument, expression, source: "call-site",
364
+ });
365
+ }
366
+ return { call: supplied, positional, issues };
367
+ }
368
+
369
+ function wrapperDeclaration(db, wrapper) {
370
+ if (!db || typeof db.prepare !== "function") {
371
+ return { row: null, issue: { cause: "wrapper-declaration-unresolved" } };
372
+ }
373
+ const name = wrapper.split(".").at(-1);
374
+ const kotlinWrapper = wrapper.includes(".") ? wrapper.replace(/\./g, "::") : null;
375
+ try {
376
+ const qualified = db.prepare(`
377
+ SELECT id, kind, name, qualified_name, file_path, start_line
378
+ FROM nodes
379
+ WHERE kind IN ('function', 'method') AND (
380
+ qualified_name = ? OR qualified_name LIKE ? OR qualified_name = ? OR qualified_name LIKE ?
381
+ )
382
+ ORDER BY file_path ASC, start_line ASC, id ASC
383
+ `).all(
384
+ wrapper, `%.${wrapper}`,
385
+ kotlinWrapper, kotlinWrapper === null ? null : `%::${kotlinWrapper}`,
386
+ );
387
+ const rows = qualified.length > 0 ? qualified : db.prepare(`
388
+ SELECT id, kind, name, qualified_name, file_path, start_line
389
+ FROM nodes
390
+ WHERE kind IN ('function', 'method') AND name = ?
391
+ ORDER BY file_path ASC, start_line ASC, id ASC
392
+ `).all(name);
393
+ const unique = [...new Map(rows.map(row => [stableDigest({
394
+ qualified_name: row.qualified_name, file_path: row.file_path, start_line: row.start_line,
395
+ }), row])).values()];
396
+ if (unique.length !== 1) {
397
+ return { row: null, issue: {
398
+ cause: unique.length === 0 ? "wrapper-declaration-unresolved" : "wrapper-declaration-ambiguous",
399
+ } };
400
+ }
401
+ return { row: unique[0], issue: null };
402
+ } catch {
403
+ return { row: null, issue: { cause: "wrapper-declaration-query-failed" } };
404
+ }
405
+ }
406
+
407
+ function declarationDefaults({ row, sourceProject, wrapper }) {
408
+ const locator = normalizeLocator(row.file_path);
409
+ const failure = cause => ({ defaults: {}, unresolved: {}, parameters: [], declaration: null, issues: [{ cause }] });
410
+ const text = readSource(sourceProject, locator);
411
+ if (text === null) return failure("wrapper-declaration-source-unread");
412
+ const startLine = Number(row.start_line);
413
+ const lineStart = offsetAtLine(text, startLine);
414
+ if (lineStart === Number.MAX_SAFE_INTEGER) return failure("wrapper-defaults-unresolved");
415
+ const name = wrapper.split(".").at(-1);
416
+ const masked = maskNonCode(text);
417
+ const declaration = new RegExp(`\\bfun\\s+(?:[A-Za-z_$][\\w$]*\\s*\\.\\s*)?${escapedIdentifier(name)}\\s*\\(`)
418
+ .exec(masked.slice(lineStart));
419
+ if (declaration === null || lineAt(text, lineStart + declaration.index) !== startLine) {
420
+ return failure("wrapper-defaults-unresolved");
421
+ }
422
+ const open = lineStart + declaration.index + declaration[0].lastIndexOf("(");
423
+ const close = matchingParen(masked, open);
424
+ if (close === -1) return failure("wrapper-defaults-unresolved");
425
+ const originalBody = text.slice(open + 1, close);
426
+ const maskedBody = masked.slice(open + 1, close);
427
+ const defaults = {};
428
+ const unresolved = {};
429
+ const parameters = [];
430
+ const issues = [];
431
+ for (const [start, end] of topLevelParts(maskedBody)) {
432
+ const rawPart = originalBody.slice(start, end);
433
+ const maskedPart = maskedBody.slice(start, end);
434
+ const equals = topLevelCharacter(maskedPart, "=");
435
+ const colon = topLevelCharacter(maskedPart, ":", equals === -1 ? maskedPart.length : equals);
436
+ const nameMatch = colon === -1 ? null : /([A-Za-z_$][\w$]*)\s*$/.exec(stripComments(rawPart.slice(0, colon)));
437
+ if (nameMatch === null) {
438
+ if (equals !== -1) issues.push({ cause: "wrapper-defaults-unresolved" });
439
+ continue;
440
+ }
441
+ const argument = nameMatch[1];
442
+ parameters.push(argument);
443
+ if (equals === -1) continue;
444
+ const expression = stripComments(rawPart.slice(equals + 1)).trim();
445
+ const literal = literalValue(expression);
446
+ if (literal.known) defaults[argument] = literal.value;
447
+ else {
448
+ unresolved[argument] = { expression, reason: "computed-default", source: "declaration" };
449
+ issues.push({ cause: "computed-default", argument, expression, source: "declaration" });
450
+ }
451
+ }
452
+ return {
453
+ defaults, unresolved, parameters, issues,
454
+ declaration: { file_path: locator, line: startLine },
455
+ };
456
+ }
457
+
458
+ /** Merge only independently proven values; computed call arguments erase defaults from effective values. */
459
+ function wrapperArgumentValues({ edge, db, sourceProject }) {
460
+ const wrapper = routeWrapper(edge);
461
+ if (wrapper === null) return null;
462
+ const locator = edgeLocator(edge);
463
+ const literal = {};
464
+ const defaults = {};
465
+ const effective = {};
466
+ const unresolved = {};
467
+ const issues = [];
468
+ const requiredLocators = [];
469
+ let declaration = null;
470
+ const finish = () => ({
471
+ variant: {
472
+ argument_values: {
473
+ status: issues.length === 0 ? "resolved" : "partial",
474
+ literal, defaults, effective, unresolved,
475
+ ...(declaration === null ? {} : { declaration }),
476
+ },
477
+ },
478
+ issues, requiredLocators,
479
+ });
480
+ if (locator?.locator == null || !Number.isInteger(locator?.line)) {
481
+ issues.push({ cause: "call-site-unavailable" });
482
+ return finish();
483
+ }
484
+ const parsedCall = wrapperCall({
485
+ sourceProject, locator: locator.locator, line: locator.line, wrapper,
486
+ });
487
+ issues.push(...parsedCall.issues);
488
+ if (parsedCall.call === null) return finish();
489
+ for (const [argument, supplied] of parsedCall.call) {
490
+ if (supplied.literal.known) {
491
+ literal[argument] = supplied.literal.value;
492
+ effective[argument] = supplied.literal.value;
493
+ } else {
494
+ unresolved[argument] = {
495
+ expression: supplied.expression, reason: "computed-argument", source: "call-site",
496
+ };
497
+ }
498
+ }
499
+ const resolved = wrapperDeclaration(db, wrapper);
500
+ if (resolved.issue !== null) {
501
+ issues.push(resolved.issue);
502
+ for (const supplied of parsedCall.positional) {
503
+ issues.push({ cause: "wrapper-call-arguments-unresolved", expression: supplied.expression });
504
+ }
505
+ return finish();
506
+ }
507
+ const parsedDefaults = declarationDefaults({ row: resolved.row, sourceProject, wrapper });
508
+ issues.push(...parsedDefaults.issues);
509
+ declaration = parsedDefaults.declaration;
510
+ for (const [index, supplied] of parsedCall.positional.entries()) {
511
+ const argument = parsedDefaults.parameters[index] ?? null;
512
+ if (argument === null || parsedCall.call.has(argument)) {
513
+ issues.push({
514
+ cause: "wrapper-call-arguments-unresolved", expression: supplied.expression,
515
+ ...(argument === null ? {} : { argument }),
516
+ });
517
+ continue;
518
+ }
519
+ parsedCall.call.set(argument, supplied);
520
+ if (supplied.literal.known) {
521
+ literal[argument] = supplied.literal.value;
522
+ effective[argument] = supplied.literal.value;
523
+ } else {
524
+ unresolved[argument] = {
525
+ expression: supplied.expression, reason: "computed-argument", source: "call-site",
526
+ };
527
+ issues.push({
528
+ cause: "computed-argument", argument, expression: supplied.expression, source: "call-site",
529
+ });
530
+ }
531
+ }
532
+ Object.assign(defaults, parsedDefaults.defaults);
533
+ for (const [argument, value] of Object.entries(defaults)) {
534
+ if (!parsedCall.call.has(argument)) effective[argument] = value;
535
+ }
536
+ for (const [argument, detail] of Object.entries(parsedDefaults.unresolved)) {
537
+ if (!parsedCall.call.has(argument)) {
538
+ unresolved[argument] = detail;
539
+ delete effective[argument];
540
+ }
541
+ }
542
+ for (const [argument, supplied] of parsedCall.call) {
543
+ if (!supplied.literal.known) delete effective[argument];
544
+ }
545
+ if (Object.keys(defaults).length > 0 && declaration !== null) requiredLocators.push(declaration.file_path);
546
+ return finish();
547
+ }
548
+
549
+ /** Keep the UTG producer when graph rows describe only route registration/generic producers. */
550
+ function actualProducer({ edge, items, graphItems }) {
551
+ const locator = edgeLocator(edge);
552
+ const wrapper = routeWrapper(edge);
553
+ if (locator?.locator == null || !Number.isInteger(locator?.line)) return null;
554
+ if (graphItems.length === 0 && wrapper === null) return null;
555
+ const eligible = wrapper === null ? graphItems : items;
556
+ const matchedIndex = eligible.findIndex(item => {
557
+ const parts = producerParts(item, null);
558
+ return parts.locator === locator.locator && parts.line === locator.line;
559
+ });
560
+ const matched = matchedIndex === -1 ? null : eligible[matchedIndex];
561
+ const actualItems = wrapper === null ? graphItems : items;
562
+ const actualIndex = matched === null ? -1 : actualItems.indexOf(matched);
563
+ const record = matched === null ? {
564
+ qualified_name: wrapper ?? locator.kind ?? edge.source,
565
+ file_path: locator.locator,
566
+ line: locator.line,
567
+ callsite: edge.trigger ?? edge.at ?? null,
568
+ } : {
569
+ ...matched,
570
+ ...(wrapper === null ? {} : { qualified_name: wrapper, args: edge.args }),
571
+ file_path: locator.locator,
572
+ line: locator.line,
573
+ callsite: edge.trigger ?? edge.at ?? matched.callsite ?? null,
574
+ };
575
+ return { record, index: actualIndex };
576
+ }
577
+
578
+ function producerParts(record, edge) {
579
+ const value = record && typeof record === "object" ? record : {};
580
+ const nested = firstDefined(value.caller, value.producer, value.node,
581
+ value.source && typeof value.source === "object" ? value.source : null);
582
+ const source = nested && typeof nested === "object" ? nested : value;
583
+ const rawCallsite = firstDefined(value.callsite, value.call_site, source.callsite, source.call_site);
584
+ const callsiteObject = rawCallsite && typeof rawCallsite === "object" ? rawCallsite : null;
585
+ const parsed = edgeLocator(edge);
586
+ const locator = normalizeLocator(firstString(
587
+ value.file_path, value.source_file, value.file, value.locator, value.uri,
588
+ source.file_path, source.source_file, source.file, source.locator, source.uri,
589
+ callsiteObject?.file_path, callsiteObject?.source_file, callsiteObject?.file,
590
+ callsiteObject?.locator, callsiteObject?.uri, parsed?.locator,
591
+ ));
592
+ const lineValue = firstDefined(
593
+ value.call_line, value.callsite_line, value.line, value.start_line,
594
+ source.call_line, source.callsite_line, source.line, source.start_line,
595
+ callsiteObject?.line, callsiteObject?.start_line, parsed?.line,
596
+ );
597
+ const line = Number.isInteger(Number(lineValue)) && Number(lineValue) > 0 ? Number(lineValue) : null;
598
+ const producer = firstString(
599
+ value.qualified_name, value.source_qualified, value.name, value.source_name,
600
+ source.qualified_name, source.name, value.id, source.id,
601
+ typeof value.source === "string" ? value.source : null,
602
+ typeof record === "string" ? record : null,
603
+ edge?.source,
604
+ );
605
+ const callsite = rawCallsite ?? (record !== null && record !== undefined && locator !== null && line !== null
606
+ ? { file_path: locator, line }
607
+ : edge?.trigger ?? edge?.at ?? null);
608
+ const variant = {
609
+ arguments: firstDefined(value.args, value.arguments, value.parameters, value.params,
610
+ source.args, source.arguments, callsiteObject?.args, callsiteObject?.arguments, edge?.args),
611
+ guard: firstDefined(value.guard, source.guard, callsiteObject?.guard, edge?.guard),
612
+ defaults: firstDefined(value.defaults, value.default_values, source.defaults, callsiteObject?.defaults, edge?.defaults),
613
+ transform: firstDefined(value.transform, value.transforms, source.transform,
614
+ callsiteObject?.transform, callsiteObject?.transforms, edge?.transform, edge?.transforms),
615
+ branch: firstDefined(value.branch, source.branch, callsiteObject?.branch, edge?.branch),
616
+ };
617
+ return { producer, callsite, locator, line, variant };
618
+ }
619
+
620
+ function entryCandidate({
621
+ page, origin, entryType, edge = null, record = null, variantExtra = {}, sourceLocatorsExtra = [],
622
+ }) {
623
+ const parts = producerParts(record, edge);
624
+ const variant = { ...parts.variant, ...variantExtra };
625
+ const identity = {
626
+ page: origin.page_id ?? page.page_id,
627
+ source: edge?.source ?? null,
628
+ entry_type: entryType,
629
+ producer: parts.producer,
630
+ producer_file: parts.locator,
631
+ producer_line: parts.line,
632
+ callsite: parts.callsite,
633
+ behavior_variant: variant,
634
+ };
635
+ const refs = parts.locator !== null && parts.line !== null
636
+ ? [{ uri: parts.locator, span: { start: parts.line, end: parts.line } }]
637
+ : [];
638
+ const sourceLocators = uniqueStrings([
639
+ normalizeLocator(origin.source_file), normalizeLocator(origin.declared_at), parts.locator,
640
+ ...sourceLocatorsExtra.map(normalizeLocator),
641
+ ]);
642
+ return {
643
+ candidate_id: `cand_${stableDigest(identity)}`,
644
+ subject: { page_id: page.page_id, origin_page_id: origin.page_id ?? page.page_id },
645
+ trigger: {
646
+ kind: "entry",
647
+ entry_type: entryType,
648
+ source: edge?.source ?? null,
649
+ producer: parts.producer,
650
+ callsite: parts.callsite,
651
+ producer_file: parts.locator,
652
+ producer_line: parts.line,
653
+ behavior_variant: variant,
654
+ source_origin: { ...origin },
655
+ },
656
+ evidence_refs: refs,
657
+ source_locators: sourceLocators,
658
+ review_status: "pending",
659
+ provenance: { method: "structural", profile: COVERAGE_PROFILE.id },
660
+ };
661
+ }
662
+
663
+ function mergeCandidates(candidates) {
664
+ const byId = new Map();
665
+ for (const candidate of [...candidates].sort((a, b) => cmp(a.candidate_id, b.candidate_id))) {
666
+ const existing = byId.get(candidate.candidate_id);
667
+ if (!existing) {
668
+ byId.set(candidate.candidate_id, candidate);
669
+ continue;
670
+ }
671
+ existing.evidence_refs = sortByDigest([...existing.evidence_refs, ...candidate.evidence_refs]
672
+ .filter((ref, index, all) => all.findIndex(other => stableDigest(other) === stableDigest(ref)) === index));
673
+ existing.source_locators = uniqueStrings([...existing.source_locators, ...candidate.source_locators]);
674
+ }
675
+ return [...byId.values()].sort((a, b) => cmp(a.candidate_id, b.candidate_id));
676
+ }
677
+
678
+ function entryUnknown({ page, candidateIds = [], reason, cause = null, locator = null, nextAction, attributes = {} }) {
679
+ const detail = {
680
+ scope: "composition",
681
+ page_id: page.page_id,
682
+ reason,
683
+ cause,
684
+ candidate_ids: [...candidateIds].sort(cmp),
685
+ referring_file: page.declared_at ?? null,
686
+ locator: locator ?? page.page_id,
687
+ relevance_review: { status: "reviewed", conclusion: "blocks-composition" },
688
+ ...attributes,
689
+ };
690
+ return {
691
+ id: `unk_${stableDigest(detail)}`,
692
+ ...detail,
693
+ ...(candidateIds.length === 1 ? { candidate_id: candidateIds[0] } : {}),
694
+ next_action: nextAction,
695
+ };
696
+ }
697
+
698
+ function mergeUnknowns(unknowns) {
699
+ const byId = new Map();
700
+ for (const unknown of unknowns) if (!byId.has(unknown.id)) byId.set(unknown.id, unknown);
701
+ return sortByDigest([...byId.values()]);
702
+ }
703
+
704
+ function queryResult(query, command, symbol) {
705
+ if (typeof query !== "function" || typeof symbol !== "string" || symbol === "") return null;
706
+ try {
707
+ const result = query({ command, symbol, limit: ENTRY_QUERY_LIMIT });
708
+ return {
709
+ status: result?.status === "ok" ? "ok" : "partial",
710
+ items: Array.isArray(result?.items) ? result.items : [],
711
+ reason: result?.reason ?? (result?.status === "ok" ? null : "graph-query-failed"),
712
+ truncated: result?.truncated === true,
713
+ limit: ENTRY_QUERY_LIMIT,
714
+ version: result?.version ?? null,
715
+ };
716
+ } catch {
717
+ return {
718
+ status: "partial", items: [], reason: "graph-query-failed", truncated: false,
719
+ limit: ENTRY_QUERY_LIMIT, version: null,
720
+ };
721
+ }
722
+ }
723
+
724
+ function dbTargetIds(db, origin, page) {
725
+ const label = firstString(origin.label, page.label,
726
+ typeof origin.page_id === "string" ? origin.page_id.replace(/^[^:]*:/, "") : null);
727
+ if (label === null) return [];
728
+ const rows = db.prepare(
729
+ "SELECT id FROM nodes WHERE name = ? OR qualified_name = ? ORDER BY id ASC",
730
+ ).all(label, label);
731
+ return rows.map(row => row.id).filter(id => typeof id === "string");
732
+ }
733
+
734
+ function dbProducers(db, origin, page) {
735
+ if (!db || typeof db.prepare !== "function") return null;
736
+ try {
737
+ const targetIds = dbTargetIds(db, origin, page);
738
+ const items = [];
739
+ const statement = db.prepare(`
740
+ SELECT n.id AS id, n.kind AS node_kind, n.name AS name,
741
+ n.qualified_name AS qualified_name, n.file_path AS file_path,
742
+ e.kind AS edge_kind, e.line AS line
743
+ FROM edges e JOIN nodes n ON n.id = e.source
744
+ WHERE e.target = ? AND e.kind IN ('calls', 'instantiates', 'references', 'imports')
745
+ ORDER BY n.id ASC, e.line ASC, e.id ASC
746
+ `);
747
+ for (const targetId of targetIds) items.push(...statement.all(targetId));
748
+ return { status: "ok", items, reason: null, truncated: false, limit: ENTRY_QUERY_LIMIT, version: null };
749
+ } catch {
750
+ return { status: "partial", items: [], reason: "graph-query-failed", truncated: false, limit: ENTRY_QUERY_LIMIT, version: null };
751
+ }
752
+ }
753
+
754
+ function embeddedProducers(edge) {
755
+ const records = [];
756
+ for (const key of ["producers", "call_sites", "callsites", "variants"]) {
757
+ if (Array.isArray(edge?.[key])) records.push(...edge[key]);
758
+ }
759
+ return records;
760
+ }
761
+
762
+ function producersFor({ page, origin, edge, db, query }) {
763
+ const symbol = firstString(edge.producer_symbol, edge.symbol, origin.label, page.label);
764
+ const fromQuery = queryResult(query, "callers", symbol);
765
+ const fromDb = dbProducers(db, origin, page);
766
+ const graphItems = [...(fromQuery?.items ?? []), ...(fromDb?.items ?? [])];
767
+ const items = [...graphItems, ...embeddedProducers(edge)];
768
+ const partial = [fromQuery, fromDb].find(result => result?.status === "partial") ?? null;
769
+ return { items, graphItems, partial, attempted: fromQuery !== null || fromDb !== null };
770
+ }
771
+
772
+ function dynamicDispatch(item) {
773
+ return item?.dynamic === true || item?.dynamic_dispatch === true
774
+ || item?.edge_kind === "implements" || item?.edge_kind === "extends";
775
+ }
776
+
777
+ function calleeIdentity(item) {
778
+ const nested = firstDefined(item?.callee, item?.target, item?.node, item?.implementation);
779
+ const source = nested && typeof nested === "object" ? nested : {};
780
+ const qualifiedName = firstString(
781
+ item?.qualified_name, item?.target_qualified_name, source.qualified_name,
782
+ );
783
+ const filePath = normalizeLocator(firstString(
784
+ item?.file_path, item?.source_file, item?.file,
785
+ source.file_path, source.source_file, source.file,
786
+ ));
787
+ return qualifiedName === null || filePath === null
788
+ ? null
789
+ : { qualified_name: qualifiedName, file_path: filePath };
790
+ }
791
+
792
+ function targetQualifiedNames(targetPage, targetOrigin) {
793
+ return uniqueStrings([
794
+ targetPage?.fqn, targetPage?.qualified_name, targetPage?.launch?.component_fqn,
795
+ targetOrigin?.fqn, targetOrigin?.qualified_name, targetOrigin?.launch?.component_fqn,
796
+ ]);
797
+ }
798
+
799
+ function explicitImplementations(targetPage, targetOrigin) {
800
+ const implementations = [];
801
+ for (const record of [targetOrigin, targetPage]) {
802
+ const qualifiedName = firstString(record?.fqn, record?.qualified_name, record?.launch?.component_fqn);
803
+ const filePath = normalizeLocator(firstString(
804
+ record?.source_file, record?.implementation_file, record?.declared_at,
805
+ ));
806
+ if (qualifiedName !== null && filePath !== null) {
807
+ implementations.push({ qualified_name: qualifiedName, file_path: filePath });
808
+ }
809
+ }
810
+ return implementations;
811
+ }
812
+
813
+ function dbImplementations(db, targetPage, targetOrigin) {
814
+ if (!db || typeof db.prepare !== "function") return [];
815
+ const implementations = [];
816
+ try {
817
+ const statement = db.prepare(`
818
+ SELECT qualified_name, file_path
819
+ FROM nodes
820
+ WHERE qualified_name = ? AND file_path IS NOT NULL
821
+ ORDER BY file_path ASC, id ASC
822
+ `);
823
+ for (const qualifiedName of targetQualifiedNames(targetPage, targetOrigin)) {
824
+ for (const row of statement.all(qualifiedName)) {
825
+ const filePath = normalizeLocator(row.file_path);
826
+ if (filePath !== null) implementations.push({ qualified_name: qualifiedName, file_path: filePath });
827
+ }
828
+ }
829
+ } catch {
830
+ return [];
831
+ }
832
+ return implementations;
833
+ }
834
+
835
+ function readableCurrentSource(sourceProject, locator) {
836
+ if (typeof sourceProject !== "string" || sourceProject === "" || locator === null) return false;
837
+ try {
838
+ fs.readFileSync(path.resolve(sourceProject, locator));
839
+ return true;
840
+ } catch {
841
+ return false;
842
+ }
843
+ }
844
+
845
+ /** Resolve only a qualified callee independently backed by the target implementation. */
846
+ function implementationMatch({ item, targetPage, targetOrigin, db, sourceProject }) {
847
+ if (dynamicDispatch(item)) return null;
848
+ const identity = calleeIdentity(item);
849
+ if (identity === null || !readableCurrentSource(sourceProject, identity.file_path)) return null;
850
+ const implementations = [
851
+ ...explicitImplementations(targetPage, targetOrigin),
852
+ ...dbImplementations(db, targetPage, targetOrigin),
853
+ ];
854
+ return implementations.some(implementation =>
855
+ implementation.qualified_name === identity.qualified_name
856
+ && implementation.file_path === identity.file_path)
857
+ ? identity
858
+ : null;
859
+ }
860
+
861
+ function dbCallees(db, edge) {
862
+ const locator = edgeLocator(edge)?.locator;
863
+ if (!db || typeof db.prepare !== "function" || locator === null) return null;
864
+ try {
865
+ const items = db.prepare(`
866
+ SELECT n2.id AS id, n2.kind AS node_kind, n2.name AS name,
867
+ n2.qualified_name AS qualified_name, n2.file_path AS file_path,
868
+ e.kind AS edge_kind, e.line AS line
869
+ FROM nodes n1 JOIN edges e ON e.source = n1.id
870
+ JOIN nodes n2 ON n2.id = e.target
871
+ WHERE n1.file_path = ? AND e.kind IN ('calls', 'instantiates', 'references', 'imports')
872
+ ORDER BY n2.id ASC, e.line ASC, e.id ASC
873
+ `).all(locator);
874
+ return { status: "ok", items, reason: null, truncated: false, limit: ENTRY_QUERY_LIMIT, version: null };
875
+ } catch {
876
+ return { status: "partial", items: [], reason: "graph-query-failed", truncated: false, limit: ENTRY_QUERY_LIMIT, version: null };
877
+ }
878
+ }
879
+
880
+ function outboundFor({ pages, pageById, db, query, sourceProject }) {
881
+ const records = [];
882
+ const unknowns = [];
883
+ const required = [];
884
+ for (const page of pages) {
885
+ const edges = Array.isArray(page.behavior_edges) ? page.behavior_edges : page.out_edges;
886
+ for (const edge of edges ?? []) {
887
+ if (!edge || typeof edge.target !== "string" || edge.target === "") continue;
888
+ const locator = edgeLocator(edge);
889
+ if (locator?.locator) required.push(locator.locator);
890
+ const targetPage = pageById.get(edge.target) ?? null;
891
+ const targetOrigin = targetPage ? sourceOrigin(targetPage, edge.target) : sourceOrigin(page, edge.target);
892
+ const parsed = parseTrigger(edge.trigger);
893
+ const symbol = firstString(edge.callee_symbol, edge.symbol, edge.callee,
894
+ parsed?.kind, targetPage?.label, targetOrigin.label);
895
+ const fromQuery = queryResult(query, "callees", symbol);
896
+ const fromDb = dbCallees(db, edge);
897
+ const items = [...(fromQuery?.items ?? []), ...(fromDb?.items ?? [])];
898
+ const partial = [fromQuery, fromDb].find(result => result?.status === "partial") ?? null;
899
+ const matches = items.map(item => ({
900
+ item,
901
+ implementation: implementationMatch({ item, targetPage, targetOrigin, db, sourceProject }),
902
+ }));
903
+ const validated = matches.find(match => match.implementation !== null) ?? null;
904
+ const dynamic = items.some(dynamicDispatch);
905
+ const resolved = partial === null && validated !== null;
906
+ const status = resolved ? "resolved" : "partial";
907
+ const reason = status === "resolved" ? null
908
+ : partial?.reason ?? (items.length === 0 ? "outbound-callees-missing"
909
+ : dynamic && validated === null ? "outbound-dynamic-dispatch-unresolved" : "outbound-target-unresolved");
910
+ const record = {
911
+ source: page.page_id,
912
+ target: edge.target,
913
+ trigger: edge.trigger ?? edge.at ?? null,
914
+ status,
915
+ reason,
916
+ callees: sortByDigest(items),
917
+ dynamic_dispatch: dynamic,
918
+ implementation: validated?.implementation ?? null,
919
+ required_locators: uniqueStrings([
920
+ locator?.locator ?? null, validated?.implementation?.file_path ?? null,
921
+ ]),
922
+ query: {
923
+ command: "callees", symbol, limit: ENTRY_QUERY_LIMIT,
924
+ returned: items.length,
925
+ truncated: fromQuery?.truncated === true || fromDb?.truncated === true,
926
+ version: fromQuery?.version ?? fromDb?.version ?? null,
927
+ },
928
+ provenance: { method: "static" },
929
+ };
930
+ records.push(record);
931
+ required.push(...record.required_locators);
932
+ if (status === "partial") {
933
+ unknowns.push(entryUnknown({
934
+ page, reason: "outbound-unresolved", cause: reason,
935
+ locator: edge.trigger ?? edge.at ?? edge.target,
936
+ nextAction: "Resolve the recorded outbound call or dynamic dispatch and revalidate the target",
937
+ }));
938
+ }
939
+ }
940
+ }
941
+ const unique = new Map();
942
+ for (const record of sortByDigest(records)) {
943
+ const key = stableDigest({ source: record.source, target: record.target, trigger: record.trigger });
944
+ if (!unique.has(key)) unique.set(key, record);
945
+ }
946
+ return { records: sortByDigest([...unique.values()]), unknowns, required };
947
+ }
948
+
949
+ /**
950
+ * Discover every statically recorded entry path and validate outbound UTG edges.
951
+ * A single UTG edge can yield several candidates when actual producers/call
952
+ * sites differ; only identical semantic candidate identities are deduplicated.
953
+ */
954
+ export function discoverEntryEvidence({ pages, db = null, sourceProject, query = null } = {}) {
955
+ if (!Array.isArray(pages)) throw new TypeError("discoverEntryEvidence: pages must be an array");
956
+ if (typeof sourceProject !== "string" || sourceProject === "") {
957
+ throw new TypeError("discoverEntryEvidence: sourceProject must be a non-empty string");
958
+ }
959
+ const orderedPages = [...pages].sort((a, b) => cmp(a.page_id, b.page_id));
960
+ const pageById = new Map(orderedPages.map(page => [page.page_id, page]));
961
+ const outbound = outboundFor({ pages: orderedPages, pageById, db, query, sourceProject });
962
+ const outboundByPage = new Map(orderedPages.map(page => [page.page_id, []]));
963
+ for (const record of outbound.records) outboundByPage.get(record.source)?.push(record);
964
+
965
+ const result = new Map();
966
+ for (const page of orderedPages) {
967
+ const origins = originsOf(page);
968
+ const candidates = [];
969
+ const unknowns = [...outbound.unknowns.filter(unknown => unknown.page_id === page.page_id)];
970
+ const requiredLocators = origins.flatMap(origin => [
971
+ normalizeLocator(origin.source_file), normalizeLocator(origin.declared_at),
972
+ ]);
973
+
974
+ for (const origin of origins.filter(isLauncher)) {
975
+ const launcher = entryCandidate({ page, origin, entryType: "launcher", record: { name: "launcher" } });
976
+ const coldStart = entryCandidate({
977
+ page, origin, entryType: "cold-start", record: { name: "cold-start" },
978
+ variantExtra: { launch_mode: "cold-start" },
979
+ });
980
+ candidates.push(launcher, coldStart);
981
+ unknowns.push(entryUnknown({
982
+ page, candidateIds: [coldStart.candidate_id], reason: "cold-start-input-unresolved",
983
+ cause: "runtime-input-not-static", locator: origin.source_file ?? origin.declared_at,
984
+ nextAction: "Inspect cold-start query and saved inputs at the recorded entry source",
985
+ }));
986
+ }
987
+
988
+ for (const origin of origins) {
989
+ const restoration = restorationOf(origin);
990
+ if (restoration !== null) {
991
+ const candidate = entryCandidate({
992
+ page, origin, entryType: "restoration", record: { name: "process-restoration" },
993
+ variantExtra: { restoration },
994
+ });
995
+ candidates.push(candidate);
996
+ unknowns.push(entryUnknown({
997
+ page, candidateIds: [candidate.candidate_id], reason: "restoration-state-unresolved",
998
+ cause: "runtime-input-not-static", locator: origin.source_file ?? origin.declared_at,
999
+ nextAction: "Inspect the actual process-restoration state consumed by this entry",
1000
+ }));
1001
+ }
1002
+ if (isIntentAction(origin)) {
1003
+ const candidate = entryCandidate({
1004
+ page, origin, entryType: "intent-action", record: { name: "external-intent-action" },
1005
+ variantExtra: { launch: origin.launch ?? null },
1006
+ });
1007
+ candidates.push(candidate);
1008
+ unknowns.push(entryUnknown({
1009
+ page, candidateIds: [candidate.candidate_id], reason: "intent-action-input-unresolved",
1010
+ cause: "runtime-input-not-static", locator: origin.source_file ?? origin.declared_at,
1011
+ attributes: { launch: origin.launch ?? null },
1012
+ nextAction: "Inspect inputs supplied by the recorded external intent action",
1013
+ }));
1014
+ }
1015
+ for (const deepLink of deepLinksOf(origin)) {
1016
+ const candidate = entryCandidate({
1017
+ page, origin, entryType: "deep-link", record: { name: "external-deep-link" },
1018
+ variantExtra: { deep_link: deepLink, launch: origin.launch ?? null },
1019
+ });
1020
+ candidates.push(candidate);
1021
+ unknowns.push(entryUnknown({
1022
+ page, candidateIds: [candidate.candidate_id], reason: "deep-link-input-unresolved",
1023
+ cause: "runtime-input-not-static",
1024
+ locator: typeof deepLink === "string" ? deepLink : origin.source_file ?? origin.declared_at,
1025
+ attributes: { deep_link: deepLink },
1026
+ nextAction: "Inspect the deep-link parameters consumed by the recorded entry",
1027
+ }));
1028
+ }
1029
+ if (origin.exported === true || origin.launch_hint?.exported === true) {
1030
+ const candidate = entryCandidate({
1031
+ page, origin, entryType: "external", record: { name: "external-host" },
1032
+ variantExtra: { exported: true },
1033
+ });
1034
+ candidates.push(candidate);
1035
+ unknowns.push(entryUnknown({
1036
+ page, candidateIds: [candidate.candidate_id], reason: "external-entry-input-unresolved",
1037
+ cause: "runtime-input-not-static", locator: origin.source_file ?? origin.declared_at,
1038
+ nextAction: "Inspect inputs supplied by external native hosts",
1039
+ }));
1040
+ }
1041
+ }
1042
+
1043
+ const inbound = [...(page.in_edges ?? [])].sort((a, b) => cmp(stableDigest(a), stableDigest(b)));
1044
+ for (const edge of inbound) {
1045
+ const origin = sourceOrigin(page, edge.target ?? page.page_id);
1046
+ const discovered = producersFor({ page, origin, edge, db, query });
1047
+ const argumentValues = wrapperArgumentValues({ edge, db, sourceProject });
1048
+ const actual = actualProducer({ edge, items: discovered.items, graphItems: discovered.graphItems });
1049
+ let descriptors = discovered.items.map(record => ({ record, actual: false }));
1050
+ if (actual !== null) {
1051
+ const descriptor = { record: actual.record, actual: true };
1052
+ if (actual.index === -1) descriptors.unshift(descriptor);
1053
+ else descriptors[actual.index] = descriptor;
1054
+ } else if (descriptors.length === 0) {
1055
+ descriptors = [{ record: null, actual: true }];
1056
+ }
1057
+ const made = descriptors.map(({ record, actual: isActual }) => entryCandidate({
1058
+ page, origin, entryType: "navigation", edge, record,
1059
+ variantExtra: isActual ? argumentValues?.variant ?? {} : {},
1060
+ sourceLocatorsExtra: isActual ? argumentValues?.requiredLocators ?? [] : [],
1061
+ }));
1062
+ candidates.push(...made);
1063
+ const actualCandidate = made.find((candidate, index) => descriptors[index].actual) ?? null;
1064
+ if (argumentValues !== null && actualCandidate !== null) {
1065
+ for (const issue of argumentValues.issues) {
1066
+ unknowns.push(entryUnknown({
1067
+ page, candidateIds: [actualCandidate.candidate_id], reason: "review-incomplete",
1068
+ cause: issue.cause, locator: edge.trigger ?? edge.at ?? edge.source ?? origin.page_id,
1069
+ attributes: {
1070
+ scope: "behavior",
1071
+ affected_fields: ["trigger"],
1072
+ evidence_refs: actualCandidate.evidence_refs,
1073
+ relevance_review: { status: "reviewed", conclusion: "blocks-fields" },
1074
+ ...(typeof issue.argument === "string" ? { argument: issue.argument } : {}),
1075
+ ...(typeof issue.expression === "string" ? { expression: issue.expression } : {}),
1076
+ ...(typeof issue.source === "string" ? { value_source: issue.source } : {}),
1077
+ },
1078
+ nextAction: "Inspect the actual wrapper call and declaration; retain only source-backed literal values",
1079
+ }));
1080
+ }
1081
+ }
1082
+ if (discovered.partial !== null || discovered.items.length === 0) {
1083
+ unknowns.push(entryUnknown({
1084
+ page, candidateIds: made.map(candidate => candidate.candidate_id),
1085
+ reason: "entry-producers-unresolved",
1086
+ cause: discovered.partial?.reason ?? (discovered.attempted ? "no-static-producers" : "utg-only"),
1087
+ locator: edge.trigger ?? edge.at ?? edge.source ?? origin.page_id,
1088
+ nextAction: "Resolve the actual producers and argument variants for the recorded UTG inbound edge",
1089
+ }));
1090
+ }
1091
+ }
1092
+
1093
+ if (inbound.length === 0) {
1094
+ const origin = sourceOrigin(page);
1095
+ const candidate = entryCandidate({
1096
+ page, origin, entryType: "external-unknown", record: { name: "external-unknown" },
1097
+ });
1098
+ candidates.push(candidate);
1099
+ unknowns.push(entryUnknown({
1100
+ page, candidateIds: [candidate.candidate_id], reason: "external-entry-unresolved",
1101
+ cause: "zero-inbound", locator: origin.source_file ?? origin.declared_at,
1102
+ nextAction: "Identify external, restored, route-table, or shared-state inputs for the zero-inbound page",
1103
+ }));
1104
+ }
1105
+
1106
+ for (const candidate of candidates) requiredLocators.push(...candidate.source_locators);
1107
+ for (const record of outboundByPage.get(page.page_id) ?? []) {
1108
+ requiredLocators.push(...(record.required_locators ?? []));
1109
+ }
1110
+ const ownOutboundEdges = Array.isArray(page.behavior_edges) ? page.behavior_edges : page.out_edges;
1111
+ for (const edge of ownOutboundEdges ?? []) {
1112
+ const locator = edgeLocator(edge)?.locator;
1113
+ if (locator) requiredLocators.push(locator);
1114
+ }
1115
+ result.set(page.page_id, {
1116
+ candidates: mergeCandidates(candidates),
1117
+ requiredLocators: uniqueStrings(requiredLocators),
1118
+ unknowns: mergeUnknowns(unknowns),
1119
+ outbound: sortByDigest(outboundByPage.get(page.page_id) ?? []),
1120
+ });
1121
+ }
1122
+ return result;
1123
+ }