@buaa_smat/hometrans 26.0.7 → 26.0.8-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 (181) hide show
  1. package/agents/a2h-executor.md +37 -0
  2. package/devecocli-plugin/common.ts +2370 -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/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +2 -2
  8. package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +1 -1
  9. package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +13 -6
  10. package/i18n/skills/a2h-app-migrate/SKILL.md +2 -2
  11. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +27 -4
  12. package/i18n/skills/a2h-app-migrate/scripts/opencode_depth.mjs +418 -0
  13. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
  14. package/i18n/skills/a2h-batch-ui-align/SKILL.md +7 -7
  15. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -1
  16. package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +20 -2
  17. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +2 -2
  18. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +3 -3
  19. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +3 -1
  20. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +2 -2
  21. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +10 -6
  22. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +13 -9
  23. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +59 -7
  24. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +3 -0
  25. package/i18n/skills/a2h-batch-ui-align/scripts/interactions.mjs +186 -0
  26. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +33 -7
  27. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +83 -22
  28. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +39 -5
  29. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +25 -1
  30. package/i18n/skills/a2h-page-specgen/SKILL.md +1 -1
  31. package/i18n/skills/a2h-page-specgen/references/gates.md +3 -1
  32. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +11 -11
  33. package/i18n/skills/a2h-page-specgen/references/spec-template.md +3 -3
  34. package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +40 -3
  35. package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +73 -5
  36. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +144 -0
  37. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +11 -11
  38. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +11 -11
  39. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +11 -11
  40. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +11 -11
  41. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +10 -10
  42. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +1 -1
  43. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +11 -11
  44. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +11 -11
  45. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +11 -11
  46. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +11 -11
  47. package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +45 -1
  48. package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +100 -0
  49. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +132 -3
  50. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +36 -1
  51. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +1 -1
  52. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +16 -0
  53. package/i18n/skills/a2h-utg-static/SKILL.md +2 -0
  54. package/index.js +1741 -0
  55. package/package.json +8 -8
  56. package/platforms/atomcode/agents/a2h-executor.frontmatter.md +6 -0
  57. package/platforms/codebuddy/agents/a2h-executor.frontmatter.md +5 -0
  58. package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +2 -2
  59. package/platforms/deveco/agents/a2h-executor.frontmatter.md +7 -0
  60. package/platforms/deveco/agents/build-fixer.frontmatter.md +0 -2
  61. package/platforms/deveco/agents/code-reviewer.frontmatter.md +0 -2
  62. package/platforms/deveco/agents/model-render-worker.frontmatter.md +0 -2
  63. package/platforms/deveco/agents/model-worker.frontmatter.md +0 -2
  64. package/platforms/deveco/agents/specgen-worker.frontmatter.md +0 -2
  65. package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +1 -1
  66. package/platforms/opencode/agents/a2h-executor.frontmatter.md +7 -0
  67. package/platforms/opencode/agents/build-fixer.frontmatter.md +0 -2
  68. package/platforms/opencode/agents/code-reviewer.frontmatter.md +0 -2
  69. package/platforms/opencode/agents/model-render-worker.frontmatter.md +0 -2
  70. package/platforms/opencode/agents/model-worker.frontmatter.md +0 -2
  71. package/platforms/opencode/agents/specgen-worker.frontmatter.md +0 -2
  72. package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +13 -6
  73. package/plugin.jsonc +12 -0
  74. package/skills/a2h-app-migrate/SKILL.md +29 -3
  75. package/skills/a2h-app-migrate/references/host-rules.md +33 -0
  76. package/skills/a2h-app-migrate/references/workflow.yaml +24 -4
  77. package/skills/a2h-app-migrate/scripts/opencode_depth.mjs +418 -0
  78. package/skills/a2h-app-migrate/test/test_executor_header_sync.mjs +78 -0
  79. package/skills/a2h-app-migrate/test/test_opencode_depth.mjs +312 -0
  80. package/skills/a2h-app-migrate/tools/dag.mjs +267 -0
  81. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
  82. package/skills/a2h-batch-ui-align/SKILL.md +7 -7
  83. package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -1
  84. package/skills/a2h-batch-ui-align/references/cards/state.md +20 -2
  85. package/skills/a2h-batch-ui-align/references/cards/widgets.md +2 -2
  86. package/skills/a2h-batch-ui-align/references/checker-rules.md +3 -3
  87. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +3 -1
  88. package/skills/a2h-batch-ui-align/references/host-dispatch.md +5 -5
  89. package/skills/a2h-batch-ui-align/references/incremental-scope.md +2 -2
  90. package/skills/a2h-batch-ui-align/references/step3-capture.md +10 -6
  91. package/skills/a2h-batch-ui-align/references/step5-convert.md +13 -9
  92. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +59 -7
  93. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +3 -0
  94. package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +3 -2
  95. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +139 -23
  96. package/skills/a2h-batch-ui-align/scripts/host_env.mjs +32 -8
  97. package/skills/a2h-batch-ui-align/scripts/interactions.mjs +186 -0
  98. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +33 -7
  99. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +83 -22
  100. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +39 -5
  101. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +82 -0
  102. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +25 -1
  103. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +184 -2
  104. package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +33 -0
  105. package/skills/a2h-batch-ui-align/scripts/tests/interactions.test.mjs +258 -0
  106. package/skills/a2h-page-specgen/SKILL.md +1 -1
  107. package/skills/a2h-page-specgen/references/evidence.md +15 -0
  108. package/skills/a2h-page-specgen/references/gates.md +3 -1
  109. package/skills/a2h-page-specgen/references/scenario-authoring.md +10 -10
  110. package/skills/a2h-page-specgen/references/spec-template.md +2 -2
  111. package/skills/a2h-page-specgen/scripts/contract-calls.mjs +40 -3
  112. package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +73 -5
  113. package/skills/a2h-page-specgen/scripts/gate.mjs +141 -0
  114. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +10 -10
  115. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +10 -10
  116. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +10 -10
  117. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +10 -10
  118. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +10 -10
  119. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +1 -1
  120. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +10 -10
  121. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +10 -10
  122. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +10 -10
  123. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +10 -10
  124. package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +45 -1
  125. package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +100 -0
  126. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +104 -3
  127. package/skills/a2h-resource-convert/references/conversion-rules.md +2 -0
  128. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +36 -1
  129. package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +42 -0
  130. package/skills/a2h-spec-design-pipeline/SKILL.md +1 -1
  131. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +16 -0
  132. package/skills/a2h-spec-design-pipeline/references/execution-model.md +2 -2
  133. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +5 -1
  134. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
  135. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
  136. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +2 -1
  137. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +3 -1
  138. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-v2-observation-cn.md +105 -0
  139. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-v2-observation-en.md +122 -0
  140. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +4 -4
  141. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIV2ObservationCheck.js +1862 -0
  142. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +2 -0
  143. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
  144. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +15 -2
  145. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +20 -4
  146. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_v2_observation.ts +284 -0
  147. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +32 -0
  148. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +22 -1
  149. package/skills/a2h-utg-static/SKILL.md +2 -0
  150. package/skills/a2h-utg-static/references/extractors.md +16 -0
  151. package/skills/a2h-utg-static/scripts/run_pipeline.mjs +22 -1
  152. package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +4 -0
  153. package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +15 -0
  154. package/skills/a2h-utg-static/scripts/tests/test_view_attachments.mjs +330 -0
  155. package/skills/a2h-utg-static/scripts/view_attachments.mjs +465 -0
  156. package/README.md +0 -413
  157. package/dist/cli/config-store.js +0 -128
  158. package/dist/cli/config.js +0 -48
  159. package/dist/cli/editors.json +0 -147
  160. package/dist/cli/env-vars.js +0 -127
  161. package/dist/cli/index.js +0 -76
  162. package/dist/cli/init.js +0 -2618
  163. package/dist/cli/uninstall.js +0 -406
  164. package/dist/platform/compose.js +0 -232
  165. package/dist/platform/frontmatter.js +0 -151
  166. package/dist/platform/installer.js +0 -417
  167. package/dist/platform/language.js +0 -77
  168. package/dist/platform/registry.js +0 -340
  169. package/dist/platform/transform.js +0 -397
  170. package/dist/platform/types.js +0 -9
  171. package/dist/platform/validate.js +0 -153
  172. package/dist/utils/regex.js +0 -7
  173. package/env-requirements.json +0 -536
  174. package/platforms/codebuddy/agents/build-fixer.frontmatter.md +0 -5
  175. package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +0 -5
  176. package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +0 -5
  177. package/platforms/codebuddy/agents/model-worker.frontmatter.md +0 -5
  178. package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +0 -5
  179. package/resource/choose_editor.png +0 -0
  180. package/resource/set_sdk.png +0 -0
  181. package/resource/title_dark.png +0 -0
@@ -33,8 +33,8 @@ The report must include this ownership table, **each row labeled (a) / (b1) / (b
33
33
  | Android | `bindSheet` option | Basis |
34
34
  |---|---|---|
35
35
  | `skipPartiallyExpanded = false` (the default) | `detents: [SheetSize.MEDIUM, SheetSize.LARGE]`: opens half-height, can be dragged to full height | sheet doc: "the first height in the tuple is the initial height"; `height` is ignored once `detents` is set |
36
- | `skipPartiallyExpanded = true` | `height: SheetSize.LARGE` (no `detents`) | opens fully expanded |
37
- | `BottomSheetDialog` + `behavior.state = STATE_EXPANDED` / `skipCollapsed = true` | `height: SheetSize.LARGE` | same |
36
+ | `skipPartiallyExpanded = true` | panel content wraps its height (`wrapContentHeight`, no `fillMaxHeight` / `weight`): `height: SheetSize.FIT_CONTENT`; only content that fills the panel gets `height: SheetSize.LARGE` (no `detents` either way) | opens fully expanded; Material3's fully expanded height is the content height (capped by the window), not full screen. With `FIT_CONTENT` the builder root height must not be a percentage (sheet doc, SheetSize.FIT_CONTENT) |
37
+ | `BottomSheetDialog` + `behavior.state = STATE_EXPANDED` / `skipCollapsed = true` | same: wrapping content → `SheetSize.FIT_CONTENT`, filling content → `SheetSize.LARGE` | same |
38
38
 
39
39
  **When part ownership is (a) self-drawn, take over the behavior too**: the three verdicts above only ask whether a decoration is drawn twice and whether it looks right. Once a control is re-classified (a) and the atomic component is no longer instantiated, its built-in **interaction behavior** is gone with it (drag to close, inertia, keyboard avoidance, back key, accessibility role), and neither the compiler, the screenshot comparison nor the GATEs notice. So an (a) row lists, besides the graphic structure, "built-in behavior of the original control → `file:line` of the self-drawn implementation"; a behavior with no implementation site is marked `needs escalation`.
40
40
 
@@ -611,8 +611,8 @@ A downgrade marker is written above the hit line (with the colon and the basis),
611
611
  - Level: GATE
612
612
  - Needs: `--resources`
613
613
  - Knowledge card: `references/cards/resources.md`
614
- - Trigger: the `app.media.*` tinted by `.fillColor()` exists only as a bitmap (png/webp/jpg/bmp/gif) in every resource qualifier directory, with no SVG.
615
- - Fix: SDK: fillColor "only applies to SVG sources … use colorFilter to recolour png images". Drop fillColor and use `.colorFilter(new ColorFilter([0,0,0,0,r, 0,0,0,0,g, 0,0,0,0,b, 0,0,0,1,0]))` (r/g/b in 0~1, keeps alpha, = Android `tint` / `ColorFilter SRC_IN`); or convert the icon from the Android `<vector>` to SVG.
614
+ - Trigger: the `app.media.*` tinted by `.fillColor()` exists only as a bitmap (png/webp/jpg/bmp/gif) in every resource qualifier directory, with no SVG; or it has an SVG but some directory holds a same-named bitmap and no SVG — a qualifier directory (xxldpi/ …) is matched before base/, and base/ is used when none of the SVG's directories match, so the device loads the bitmap.
615
+ - Fix: SDK: fillColor "only applies to SVG sources … use colorFilter to recolour png images"; resource matching "looks in the matching qualifier directory first … base only when none matches". With the SVG in base/, delete the same-named bitmaps in qualifier directories (usually density fallback PNGs Android generated for a vector); with no SVG in base/, copy the SVG into base/ and delete the bitmaps. With bitmaps only, drop fillColor and use `.colorFilter(new ColorFilter([0,0,0,0,r, 0,0,0,0,g, 0,0,0,0,b, 0,0,0,1,0]))` (r/g/b in 0~1, keeps alpha, = Android `tint` / `ColorFilter SRC_IN`); or convert the icon from the Android `<vector>` to SVG.
616
616
  - Downgrade marker: none
617
617
 
618
618
  ### fillcolor-on-stroke-svg
@@ -794,7 +794,7 @@ A downgrade marker is written above the hit line (with the colon and the basis),
794
794
  - Needs: —
795
795
  - Knowledge card: `references/cards/interaction.md`
796
796
  - Trigger: a node `'100%'` in width and height (in a `Stack`/`RelativeContainer`, an axis written with the parent's own size expression counts too) with no `hitTestBehavior` that the checker cannot prove, from the layer structure, leaves the taps below it alone. Nodes it can prove (taking input itself, a non-layered parent, nothing clickable below, a page root) are no longer listed. Any `hitTestBehavior` (`Block` / `Default` included) counts as the author's explicit choice and is out of scope.
797
- - Fix: GATE "conditional overlay": while shown it covers clickable elements below it. When blocking input is the intent (loading mask, modal layer) write the downgrade marker `// HIT-TEST: blocks-input: <basis>`; otherwise add `.hitTestBehavior(HitTestMode.None)`. GATE "layer whose children take input": its own area covers clickable elements below it; size or place it so it does not, or add `.hitTestBehavior(HitTestMode.Transparent)` when a tap on it should reach them too; when covering the lower layer is the intent (a full-screen sheet over its own scrim) write `// HIT-TEST: covers-below: <basis>`. CAND (a component outside the scanned files drawn by it or below it, `zIndex` reordering, no call site found): the checker cannot decide it; check it under "Interaction Reachability Evidence".
797
+ - Fix: GATE "conditional overlay": while shown it covers clickable elements below it. When blocking input is the intent (loading mask, modal layer) write the downgrade marker `// HIT-TEST: blocks-input: <basis>`; otherwise add `.hitTestBehavior(HitTestMode.None)`. GATE "layer whose children take input": its own area covers clickable elements below it; size or place it so it does not, or add `.hitTestBehavior(HitTestMode.Transparent)` when a tap on it should reach them too; when covering the lower layer is the intent (a full-screen sheet over its own scrim) write `// HIT-TEST: covers-below: <basis>`; the marker does not apply when a covered sibling is a scrollable container (Scroll / List / Grid / WaterFlow / Swiper …): only a code fix closes it. CAND (a component outside the scanned files drawn by it or below it, `zIndex` reordering, no call site found): the checker cannot decide it; check it under "Interaction Reachability Evidence".
798
798
  - Downgrade marker: `// HIT-TEST: <blocks-input|covers-below>: <basis>`
799
799
 
800
800
  ### hidden-layer-children-hit
@@ -110,7 +110,7 @@ or when `SOURCE_PACK` has a "Canvas-drawn text" section). The "Knowledge cards"
110
110
 
111
111
  ### 4.1 Parse meta.json
112
112
 
113
- Extract: `page_id`, `label`, `clickable_elements` (with class/resource-id/text/content-desc/bounds), `click_path`, `came_from`/`trigger_element`, `screenshot` / `screenshots`, `view_xml` / `view_xmls`.
113
+ Extract: `page_id`, `label`, `clickable_elements` (with class/resource-id/text/content-desc/bounds), `click_path`, `came_from`, `screenshot` / `screenshots`, `view_xml` / `view_xmls`, plus the static UTG's `reached_from` / `navigates_to` (each edge with `mechanism`, `trigger`, and when present `guard` (the jump's condition), `label` (the trigger control's wording), `gesture` (a non-tap gesture)) and `interactions` (in-page interactions, see Phase 4.3 "In-page interactions"). Captured and source-only pages both carry these fields.
114
114
 
115
115
  The parent skill has already read and verified `REFERENCE_SCREENSHOTS` and `REFERENCE_VIEW_TREES` via their exact paths. You must read them again via the paths passed in, **every frame of every state**, not just the first image; you must not overturn the parent skill's verification with an empty Glob result of your own, nor claim that a screenshot verified to exist does not exist.
116
116
 
@@ -212,6 +212,8 @@ Criterion (mechanical): when the conclusion text contains words like "built in /
212
212
  - **Prefer the real implementation**: before mocking, search `{harmony_project_dir}` for whether the target page/component .ets exists; if it does, wire the real `router.pushUrl()`; **only when the target is not yet implemented** mock it + `console.info('TODO: ...')`
213
213
  - **Never disable an entry silently**: when the Android handler is not empty but its target is not in the conversion set, keep the node clickable, do not write `.hitTestBehavior(HitTestMode.None)` (GATE `click-handler-untestable`), write `// UNWIRED: <Android handler file:line> — <reason>` in the handler (a comment-only handler is GATE `empty-click-handler`; with this marker it is downgraded to CAND `unwired-handler`), and list each one under `UNWIRED entries` in the report. An empty `onClick` that absorbs taps on purpose (a popup card area that keeps the scrim from dismissing) gets `// CLICK-SINK: <basis>`.
214
214
  - **Overlay host effects**: when `SOURCE_PACK` has an "Overlay host effects" section, opening / dismissing the overlay does more than switch the overlay's own visibility flag: implement each effect in the code that opens / dismisses it (from its `resolved` statements, e.g. `contentOpacity = 0` fading the cards out) and write `// EFFECT: <id>` on the implementing statement or up to 3 lines above it; an effect that must not be ported gets `// EFFECT-OMIT: <id> — <basis>`.
215
+ - **In-page interactions**: when `SOURCE_PACK` has an "In-page interactions" section, each entry is an interaction Android has that neither the screenshots nor the clickable list show (e.g. `chart.setMarker(..)`: tapping the curve shows a highlight line and a bubble). Implement the same behaviour from the receiving view's configuration in the Android source (which gesture shows it, what it displays, what is disabled); when the ArkUI component has no built-in equivalent, write the touch handling yourself (`.onTouch` / `.gesture`) and overlay the auxiliary view. Put `// INTERACTION: <id>` on the implementing statement or event attribute, or up to 3 lines above it; one that truly must not be ported gets `// INTERACTION-OMIT: <id> — <basis>`. Interactions folded in from an attached child node are the host page's to implement as well. An id listed under several pages comes from one line in a base class or reused component: implement it once in the shared component and mark it once, which covers all of those pages.
216
+ - **Conditional jumps**: when a `navigates_to` edge carries a `guard`, write the jump under the same condition (e.g. go to login only when `!isLoggedIn`), never unconditionally; when it carries a `gesture` (`long_press`, `double_tap`, `swipe-*`), use that gesture, not `.onClick`.
215
217
  - **Mocks must not reference unreachable addresses**: images/icons in mocks must not use made-up URLs (e.g. `https://mock.weather.icon/…`, `example.com`); they are bound to fail to load and render as blank cells, unlike the reference. Use a semantically equivalent resource already converted in the project (`$r('app.media.…')`); if there is none, register `degraded` and leave an empty placeholder; list remote icons delivered by operations in the report as "takes effect once the data layer is wired up".
216
218
  - **Mock data must reproduce the visible state of the reference screenshot**: mock/placeholder data is not a free value. The **values, count, start/end and order** of every visible item in the reference screenshot must be faithfully reproduced by the mock (while the real data layer is not converted, the mock should be **reverse-engineered** from the reference screenshot). If the visible state the implementation produces differs from the reference, you **must not** pass it on the grounds that "this is mock data and it will heal itself once real data is wired up" — first prove the rule layer is correct, then discuss the data source. A rule-layer error (selection rule, sequence start, item count) is just as wrong with real data.
217
219
 
@@ -130,10 +130,10 @@ Only the `screenshot.png` + `view.xml` + `meta.json` of the pages in `SCOPE` are
130
130
  node compile_tasks.mjs $S/utg.json $C --project <android_project_dir> --locale <device locale>
131
131
  ```
132
132
  `--scope` automatically includes the menus / ui-states / modes / embedded fragments attached to members (host resolution is the same as in `build_conversion_set.mjs`); after changing only `utg.json`, `plan.mjs --extend` without `--scope` also recomputes the scope against the new graph. Nodes outside the scope are treated as settled: the device stage skips tasks targeting them (`task_skipped: target-out-of-scope`; paths to members still pass through them), the A–D and direct-launch review lists exclude them, and `capture_pending.json` lists only members. So review volume and device time scale with the number of members, not the whole app.
133
- 2. **Add `--skip D` to `run_cycle.mjs`** unless the user explicitly agrees to changing app data. Incremental mode often faces an app the user is actively using; D runs `pm clear` and fabricates data per recipe. Data states the members need therefore go into `deferred_human.json` and are reported in Step 7.
133
+ 2. **Add `--skip D` to `run_cycle.mjs`, and leave `reset_between_tasks` out of `config.json`**, unless the user explicitly agrees to changing app data. Incremental mode often faces an app the user is actively using; D runs `pm clear` and fabricates data per recipe, and `reset_between_tasks` runs `pm clear` before every `p0-fresh` task. `--skip D` skips only D and the fresh snapshot, not the latter, so do both. Data states the members need therefore go into `deferred_human.json` and are reported in Step 7.
134
134
  3. **`--max-rounds 1`** is usually enough (few members; one round of direct launch settles them); relax it only when some member still answered `launch` without being covered.
135
135
 
136
- Everything else (config.json, reviewer sub-agents, the watchdog, running in the background with `detach.mjs`) is copied from Step 3.2.
136
+ Everything else (config.json apart from item 2's `reset_between_tasks`, reviewer sub-agents, the watchdog, running in the background with `detach.mjs`) is copied from Step 3.2.
137
137
 
138
138
  **Build the plan** (after `run_cycle.mjs` prints `finished: true`, the same as full-mode Step 3.2 item 5, with two extra arguments):
139
139
  ```bash
@@ -59,8 +59,8 @@ A refused merge names the stage and missing keys; re-dispatch only those parts.
59
59
  **Reviewer waves (Steps 3.1 and 3.2).** Do not dispatch reviewers as a blocking wave. A blocking wave returns only when its slowest member returns, so one hung agent stalls the whole run: a single reviewer whose connection drops can hold its wave for hours after the others have finished. Instead (Step 0.1):
60
60
  - write each part's prompt to `${harmony_project_dir}/.hometrans/work/prompts/<stage>_part<N>.md` and dispatch one **background sub-agent** per part, all in one message: "Read `<that file>` and follow it fully; reply `DONE <stage>_part<N>`." Record each one as you dispatch it with `node ./scripts/group_queue.mjs review-bind ${harmony_project_dir} --name <stage>_part<N> --answers <abs answers path> --task <handle>`. This writes `.hometrans/work/reviewers.json`, which the queue counts against `--max-agents`. Use `--kind skill-agent` for an agent that is not a reviewer, such as the Step 2 resource agent; it does not count. A binding stops counting by itself once its part is consumed (the explorer merged or re-split the parts); a reviewer that ended without its answers is released with `group_queue.mjs review-unbind ${harmony_project_dir} --name <part>`. Never hand-edit that file, and never re-bind a finished reviewer as `skill-agent` to free its slot;
61
61
  - the answers file is the completion signal, never the agent: a part is done when `node ./scripts/answers_check.mjs <answers path>` reports `complete` (it parses and covers every key of the sibling `*_worklist.part<N>.json`); a reviewer whose answers are complete can stay "running" for hours;
62
- - an `nl_hints` or `view_interactions` part is done only when, in addition, `node <a2h-utg-explorer skill>/scripts/hint_check.mjs --project <Android source root> <answers path>` exits 0 (`bad=0`). Its reviewer writes every key first and then rewrites hints in place, so `complete` alone means it may still be fixing them. While `bad>0`, keep the part in the `wait` loop; do not merge, apply or stop it. If its agent ends with `bad>0`, resume it in its own session with the lines `hint_check` prints;
63
- - loop on `node ./scripts/group_queue.mjs wait ${harmony_project_dir}` (plus `--job run_cycle` in Step 3.2 while it runs). It follows every reviewer bound with `review-bind` that is not done or consumed, so no `--answers` is needed for them; pass `--answers <path>` (once per path) only for an answers file you did not bind. A job exit is reported once: a later `wait --job run_cycle` does not return again for the same exit, only after a restart ends. It returns when one becomes complete (`answers_complete`), has been silent for the stall limit (`answers_silent`; counted from the file's last write, or from its bind when it has never been written; `stall_limit_min` in the output, at least 20 min and scaled up with load), or after 9 min. Give the shell call a timeout above that;
62
+ - an `nl_hints` or `view_interactions` part is done only when, in addition, `node <a2h-utg-explorer skill>/scripts/hint_check.mjs --project <Android source root> <answers path>` exits 0 (`bad=0`). Its reviewer writes every key first and then rewrites hints in place, so `complete` alone means it may still be fixing them. While `bad>0`, keep waiting on the part across turns (one wait per shell call); do not merge, apply or stop it. If its agent ends with `bad>0`, resume it in its own session with the lines `hint_check` prints;
63
+ - wait with `node ./scripts/group_queue.mjs wait ${harmony_project_dir}` (plus `--job run_cycle` in Step 3.2 while it runs), one wait per shell call. Never loop several waits inside one shell call: handle each return before the next wait. It follows every reviewer bound with `review-bind` that is not done or consumed, so no `--answers` is needed for them; pass `--answers <path>` (once per path) only for an answers file you did not bind. A job exit is reported once: a later `wait --job run_cycle` does not return again for the same exit, only after a restart ends. It returns when one becomes complete (`answers_complete`; each completion is reported once per bind, including one that completed after the previous wait returned), has been silent for the stall limit (`answers_silent`; counted from the file's last write, or from its bind when it has never been written; `stall_limit_min` in the output, at least 20 min and scaled up with load), or after 5 min (a larger `--timeout-s` is capped at 300). Give the shell call a timeout above that (e.g. 600000 ms);
64
64
  - on each return: a silent part, or one whose agent ended without a complete file, is resumed in its own session with its task id (Step 0.1 item 4), and re-bound at once with the same `review-bind` line, which restarts its silence clock. `answers_silent` means only "no write for the limit"; a reviewer of a few items often writes them all at the end. A resume the host answers with "sent to the running background task" was queued behind a run still in progress: that agent is alive. A resume "also goes silent" only when, after the re-bind, `wait` reports the part silent again or its agent ends without a complete file; only then answer the remaining items `unresolved` yourself. Never answer for a part whose agent is still running: it may still write correct answers after your guesses have been merged;
65
65
  - in Step 3.2, conversion (item 5) starts only after the cycle prints `finished: true`; nothing converts between `wait` returns.
66
66
 
@@ -69,7 +69,7 @@ A refused merge names the stage and missing keys; re-dispatch only those parts.
69
69
 
70
70
  The parent drives the `a2h-utg-explorer` skill's `run_cycle.mjs`; reviewers are parallel sub-agents as in Step 3.1. Commands run from its `scripts/` directory with Node ≥ 22.18 (no Python dependency). `S` is the Step 3.1 workspace; `C=${harmony_project_dir}/.hometrans/utg_explore` is the campaign directory.
71
71
 
72
- 1. **Install and identify.** `<adb> -s <serial> install -r <apk_path>`, where `<adb>` is `ADB_PATH` when the caller passed it and `adb` otherwise (the same adb goes into `config.json` below); the explorer never installs anything. Read the package and launcher component from `aapt dump badging <apk_path>` (`package:`, `launchable-activity:`), and the device locale. `aapt2 dump badging` works the same. Neither is usually on PATH: look under `<sdk>/build-tools/<newest version>/`, where `<sdk>` is `ANDROID_HOME`, `ANDROID_SDK_ROOT`, or the parent of adb's `platform-tools`. If neither exists, take the package from the app module's `applicationId` and, after the install, the launcher from the last line of `<adb> -s <serial> shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.LAUNCHER <package>`.
72
+ 1. **Install and identify.** `<adb>` is `ADB_PATH` when the caller passed it and `adb` otherwise (the same adb goes into `config.json` below); the explorer never installs anything. Read the package and launcher component from `aapt dump badging <apk_path>` (`package:`, `launchable-activity:`), and the device locale. `aapt2 dump badging` works the same. Neither is usually on PATH: look under `<sdk>/build-tools/<newest version>/`, where `<sdk>` is `ANDROID_HOME`, `ANDROID_SDK_ROOT`, or the parent of adb's `platform-tools`. If neither exists, take the package from the app module's `applicationId` and, after the install, the launcher from the last line of `<adb> -s <serial> shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.LAUNCHER <package>`. **Install only when the device lacks this exact APK.** Never uninstall on your own: an uninstall wipes the app data, including a login set up by hand. Run `<adb> -s <serial> shell pm path --user 0 <package>`. Skip the install only when it prints exactly one `package:<path>` line (no splits) and the first column of `<adb> -s <serial> shell sha256sum <path>` (it prints `<hash> <path>`) equals the local APK's SHA-256 (`node -e "console.log(require('crypto').createHash('sha256').update(require('fs').readFileSync(process.argv[1])).digest('hex'))" <apk_path>`). In every other case (not installed, split APKs, a different hash, no `sha256sum` on the device) run `<adb> -s <serial> install -r -t <apk_path>`: `-r` replaces the app in place and keeps its data, `-t` lets a testOnly (IDE-built) APK install. Never compare `versionCode` / `versionName` alone: a debug rebuild keeps them while the UI changes, so the capture would show the old pages. When the install fails: on `INSTALL_FAILED_VERSION_DOWNGRADE`, retry once with `-d` added (an older build may crash on the newer one's data: note the downgrade for Step 7); on `INSTALL_FAILED_UPDATE_INCOMPATIBLE` (the installed app has another signature), or when the `-d` retry fails too (a user build refuses downgrading a non-debuggable app), stop and ask the user to choose between uninstalling (the app data and any login go with it; log in again afterwards) and supplying an APK the device accepts as an update (same signature, `versionCode` not below the installed one), and record the choice for Step 7.
73
73
  2. **Plan and compile.** Review `C/plan.md` before running anything on the device.
74
74
  ```bash
75
75
  node plan.mjs $S/utg.json $C
@@ -80,7 +80,11 @@ The parent drives the `a2h-utg-explorer` skill's `run_cycle.mjs`; reviewers are
80
80
  - `serial`, `package`, `launch_component` (`pkg/fully.qualified.Activity`), `page_rules: []`, `state_rules: []`;
81
81
  - `"adb": "<ADB_PATH>"` when the caller passed `ADB_PATH`. The explorer and its device watchdog default to a bare `adb` on PATH, which fails when adb is not on PATH (only `ADB_PATH` names it);
82
82
  - an empty fixture list for every phase whose `requires` is empty (e.g. `"fixtures": {"p0-fresh": []}`). Phases needing login, content or a data state get no fixture; the explorer does not guess credentials;
83
- - `"reset_between_tasks": ["p0-fresh"]`: the explorer clears app data (`pm clear`, runtime grants restored) before each task of that fixture-less phase. Without it a setting one task changes persists into every later launch. Leave it out only when the device holds a state you set up by hand for this phase (a login), since the clear wipes it. A first-launch consent dialog (privacy policy / user agreement) is not such a state: the explorer accepts the app's own one by its positive button after each clear (`consent_default`, see the explorer's architecture.md). A consent dialog with custom buttons (no `android:id/button1`) gets an `interruption_rules` entry that clicks its accept button; check the `interruption` events of the first tasks for it;
83
+ - `"reset_between_tasks": ["p0-fresh"]`: the explorer clears app data (`pm clear`, runtime grants restored) before each task of that fixture-less phase. Without it a setting one task changes persists into every later launch. With a login set up by hand, whether to keep it depends on the build and device (see below). Leave it out when the user forbids app-data changes: `--skip D` skips stage D and the fresh snapshot only, never these clears. A first-launch consent dialog (privacy policy / user agreement) is no reason to leave it out: the explorer accepts the app's own one by its positive button after each clear (`consent_default`, see the explorer's architecture.md). A consent dialog with custom buttons (no `android:id/button1`) gets an `interruption_rules` entry that clicks its accept button; check the `interruption` events of the first tasks for it;
84
+ - **A login set up by hand.** What `reset_between_tasks` does to it depends on whether `d_prereqs initial` can archive the data, i.e. whether the build is debuggable. Decide this before the first `run_cycle.mjs`, not from `states.json`: `initial` is recorded once, by the cycle's first step, with the `allow_unarchived_wipe` the config held then, so a later change does not take effect (the only repair is setting `"user_state_protected": true` by hand). Check it with `<adb> -s <serial> shell run-as <package> true` (exit 0 = debuggable), or `application-debuggable` in the `aapt dump badging <apk_path>` output. Simplest: whenever a login was set up by hand on an emulator, write `"allow_unarchived_wipe": false` into `config.json` before the first cycle; it does nothing on a debuggable build.
85
+ - **Debuggable build (`run-as` works)**: the login is kept this way, not by dropping `reset_between_tasks`: `run_cycle.mjs` archives it as `initial`, restores it before the login phases run (stage S enters them through the archive) and at the end of the cycle, so the device goes back with it. Between those points the device can sit on cleared data (the `p0-fresh` resets, until the fresh snapshot or stage S restores it). Keep `reset_between_tasks: ["p0-fresh"]` so the pages only first-launch data shows (login, onboarding, consent, empty states) are still captured. The archive covers `/data/data/<pkg>` only: a login kept in device-protected storage (`/data/user_de/0/<pkg>`), external `Android/data/<pkg>` or a KeyStore key bound to it does not survive `pm clear`. When `states.json`'s `initial` landing is a logged-in page but the login phases' captures show the login page, the login lived there: report it in Step 7 and do not drop the reset to work around it.
86
+ - **Non-debuggable build on a real device**: no archive, so `config.user_state_protected` is set and every reset is skipped (`reset_skipped` event): the login stays, and pages only first-launch data shows stay uncaptured and are reported.
87
+ - **Non-debuggable build on an emulator (`emulator-*`)**: no archive, yet an emulator counts as disposable, so the resets run and the first `p0-fresh` task wipes the login for good. Before the first cycle, set `"allow_unarchived_wipe": false` in `config.json`: it protects the data as on a real device. Leaving `reset_between_tasks` out is not enough: without the protection stage D still runs and rebuilds each state from a replay base, which starts with `pm clear` (prevented only by `--skip D` as well). Once the cycle has started, the setting no longer takes effect: set `"user_state_protected": true` by hand, as above, while the login is still there.
84
88
  - for recovery D: `"snapshot_dir": "$C/snapshots"`, `"fixture_server_dir": "$C/fixtures"`. Leave `fixture_server_url` out (or keep the value an earlier run wrote): the server writes it. Without `snapshot_dir` the cycle skips D and lists why under `skipped`;
85
89
  - never `layout_backend: android`, which writes JSON, while this skill needs uiautomator XML;
86
90
  - `state_anchors` for the static UTG's in-page states whose look differs a lot (mode tabs: a calendar's day/week/month/year, a query page's sub-modes): `{"<ui-state id>": {"all": [{"resource_name": "<id only that state shows>"}], "none": [...]}}`. Take the anchor from the Android source/layout of that state's **content**, not from the tab (tabs often never set `selected`). The tab strip and every other control that all modes show cannot anchor a state either. An anchor on the mode tab itself holds under every sibling mode as well, so their captures match two states, are attributed to neither, and end up exported as the host's "default" directory. `final_utg` now resolves this run-wide: an anchor that holds wherever a sibling's holds yields to the sibling, and the export prints `[WARN] state anchor of <id> also holds under …` with the count in `export_manifest.json` `state_anchor_warnings`. Fix the anchor when that warning appears. Sweep frames take their origin capture's state even after the anchor scrolls out of view. A capture reached by a swipe joins the state it scrolled from instead of becoming a `_sN` state of its own. When every real capture of a host belongs to its states, the host directory is its opening state (`meta.default_state`). A state verified this way is exported as its own `page_NNNN_<host>_<state>` directory and joins the host's group as a captured attached member; without an anchor it stays source-only inside the host. `run_cycle` adds a missing `p0-fresh: []` fixture itself, but write it anyway.
@@ -119,7 +123,7 @@ The parent drives the `a2h-utg-explorer` skill's `run_cycle.mjs`; reviewers are
119
123
  **Recovery classes** run inside the cycle without user confirmation: A (offline page identity), B / C (a new gesture for a failed step or an unknown trigger), D (constructing a data state in-app), and direct launch.
120
124
  - **D runs by default**, because blocked `content` / `data-state` phases hold most core pages. Its worklist is split into parts like A–C, one item per state (phases sharing the same `requires` form one item); reviewers answer each item by `key` with `verdict: "recipe"` or `"skipped"`, within D's limits (`references/architecture.md` §D): in-app steps only, ASCII text input, white-listed keys, fixture-server files added but never modified (names and recipe ids prefixed with the item key), snapshots only under `snapshot_dir`, and a positive probe before any task.
121
125
  - Items needing a real account, an external service, another flavor or the system file picker are answered `skipped` with the reason, and reach Step 7 via `deferred_human.json`.
122
- - Pass `--skip D` only when the user asked not to change app data.
126
+ - Pass `--skip D` only when the user asked not to change app data, and then leave `reset_between_tasks` out of `config.json` too: `--skip D` skips stage D and the fresh snapshot, not the `p0-fresh` clears.
123
127
  - Before anything else, `run_cycle.mjs` archives the app data the device was handed over with (`initial`, via `run-as`) and restores it at the end. After the first round it takes the first-launch base (`fresh.tar` via `run-as`). A build without `run-as` keeps the original data live-only: no `pm clear`, no fresh base, and every clear / restore is refused (`config.user_state_protected`), so pages only first-launch data shows stay uncaptured and are reported.
124
128
  - **Stage S** (before A) compiles each phase requirement into an on-screen predicate (`predicates_worklist.json`, reviewed by `key` like A–D) and runs every state phase in a known data state its requirements hold in (`schedule_states.mjs`): a device handed over logged in with content runs those phases directly. D only builds the states no known one satisfies.
125
129
  - The cycle repeats while a round still adds a covered node, up to `--max-rounds` (2). Round 1 runs A–D and direct launch; later rounds run direct launch only (`--later-rounds direct`, the default): later A–D rounds cost hours for few new captures. Pass `--later-rounds all` to run A–D in every round.
@@ -131,7 +135,7 @@ The parent drives the `a2h-utg-explorer` skill's `run_cycle.mjs`; reviewers are
131
135
  `build_conversion_set.mjs` must run after **every** `export_ui_info.mjs`, because export rewrites `pages.json`. The builder then:
132
136
  - re-appends the source-only pages and removes any source-only directory whose node has since been captured;
133
137
  - assigns every static node a role and writes `conversion_set.json` (to `${harmony_project_dir}/.hometrans/ui_info/`, next to `pages.json`; not under `utg_static/`). Read `plan.entry_node` / `plan.entry_chosen_by` from its output line `groups N (entry …)`: an empty entry prints a `[WARN]` and means no group owns the launch page, so re-run with `--entry <static node of the launch page>`;
134
- - writes one `page_NNNN_<Name>/meta.json` per uncaptured page (`evidence_tier: "source-only"`, empty `screenshots`/`view_xmls`, plus `source_hints` / `attached_nodes` / `reached_from` / `navigates_to` / `template_pages`);
138
+ - writes one `page_NNNN_<Name>/meta.json` per uncaptured page (`evidence_tier: "source-only"`, empty `screenshots`/`view_xmls`, plus `source_hints` / `attached_nodes` / `reached_from` / `navigates_to` / `template_pages` / `interactions`), and adds `reached_from` / `navigates_to` / `overlay_effects` / `interactions` to each captured page's `meta.json` (export_ui_info writes none of them);
135
139
  - writes `pages.json` with captured pages first, then source-only pages in click-path order.
136
140
 
137
141
  **Convert after the cycle finishes.** Once `run_cycle.mjs` prints `finished: true` and Step 2's report exists: run Step 4.4's `shell_contract.mjs` (it needs `utg.json`, `conversion_set.json`'s plan and Step 2's fonts, which all exist now), Step 4.3, `group_queue.mjs init` (Step 5.4 item 2), then build Step 4.4's packs and prompts for every group and enter the Step 5.4 loop. Both scripts are incremental:
@@ -22,7 +22,9 @@ Every prompt instructs the agent to **load and follow `./references/conversion-p
22
22
  - `REUSE_FROM` = the group's `reuse_from`: the files the leader wrote, stated **read-only** (extend by composition, never edit).
23
23
  - `OVERLAYS_OWNED_ELSEWHERE` = the group's `overlays_owned_elsewhere`, whenever non-empty: overlays a member opens that another group converts (a shared overlay is a group of its own). The prompt says: import `<file>` from group `<group>` and mount it; never write your own copy under another name; if the file does not exist yet or lacks something this page needs, report it under `shell requests`.
24
24
  - `ATTACHED_NODES`, whenever non-empty (both tiers). Menu → the page's overflow/context menu; ui-state/mode → a state of this page; panel/embedded fragment → a component this page hosts. Mark each one **captured** (it has a `###` state in `REFERENCE_SCREENSHOTS`: convert it against those frames) or **uncaptured** (in `uncaptured[]`: convert it from its source branch per conversion-procedure.md §"source-only tier", which then applies to that node only; "the data layer is not converted yet" is never a reason to degrade it).
25
- - For `source-only` members also pass `SOURCE_HINTS` (= `meta.json.source_hints`), `REACHED_FROM` / `NAVIGATES_TO`, `TEMPLATE_PAGES` + `TEMPLATE_MEASUREMENTS`, and the host-chain source file list (now the primary evidence, so resolve it before dispatch).
25
+ - `REACHED_FROM` / `NAVIGATES_TO` (both tiers: `meta.json.reached_from` / `navigates_to`), with each edge's `guard` / `label` / `gesture` when present. A guarded edge is wired under the same condition, a `gesture` edge with that gesture.
26
+ - `INTERACTIONS` (both tiers), whenever `meta.json.interactions` is non-empty: in-page interactions of the page and of its attached nodes; the pack's「In-page interactions」section lists them with the marker rule.
27
+ - For `source-only` members also pass `SOURCE_HINTS` (= `meta.json.source_hints`), `TEMPLATE_PAGES` + `TEMPLATE_MEASUREMENTS`, and the host-chain source file list (now the primary evidence, so resolve it before dispatch).
26
28
  12. **`LOTTIE_ENTRIES_FOR_THIS_PAGE`**, only when `lottie_by_page[suggested_page_name]` is non-empty: the matching rows verbatim as JSON, used per Phase 4.5. Otherwise omit the block and never mention Lottie.
27
29
  13. **`PRESENTATION` / `HOST_ACTIVITY`**, only when the group carries `presentation` in `conversion_set.json` → `plan` (the app has a shell host; otherwise omit both and say nothing about shells). State it as decided, with the host's `Shell hosts` entry from `Project Fact (Shell Contract)`:
28
30
  - `shell-content`: the group's pages are content the shell mounts. Prompt rules: no `@Entry`; no chrome of its own (bottom nav, tabs, drawer, persistent player bar); a jump to another fragment of the same host goes through a callback parameter the shell passes in, never `router.pushUrl` and never a `console.info('TODO: navigate')` stub; only a jump to another Activity uses `router.pushUrl`; transitions follow the host's declared `transitions`, and "NOT animated" means no `pageTransition()`. Anything the shell must provide goes under `shell requests`. Phase 4.2's chrome description of the screenshot is evidence about the **shell**, not something to draw again.
@@ -56,9 +58,11 @@ Every prompt instructs the agent to **load and follow `./references/conversion-p
56
58
  - From that point the interface is frozen. Internal fixes are allowed; a changed signature is not. If it must change, say so in the report: `release` reports every provided file changed afterwards as `provided_changed`.
57
59
  - **Chrome shared by several `@Entry` pages is provided as a host container, not as a bare bar.** With no `shell_hosts` (each destination its own `@Entry` page), the group that writes the persistent chrome (bottom nav, tab strip, player bar) also provides the scaffold that places it: `XxxScaffold({ currentTab, onNavigate }) { @BuilderParam content }` with the `Stack({ alignContent: … })`, floating margins and `hitTestBehavior` fixed inside. Pages fill the content slot and never re-create the placement. A bar plus a usage comment leaves the placement to every page, and a page that writes `Stack()` + `.align(Alignment.Bottom)` on the bar's wrapper gets its nav floating mid-screen (GATE `stack-child-align-noop` now catches that shape; the scaffold removes it).
58
60
 
59
- 8. **A component written into a shared module (`common/*`, the design system, `uicomponents`) follows its Android component's signature, parameter by parameter.** Any group can be the first to write one, a leader or not, and every later group reuses it as is. One wrong default here repeats on every page. Before the first page uses it, check these four points against the Android source of the component (its `@Composable fun` / custom View):
61
+ 8. **A component written into a shared module (`common/*`, the design system, `uicomponents`) follows its Android component's signature, parameter by parameter.** Any group can be the first to write one, a leader or not, and every later group reuses it as is. One wrong default here repeats on every page. Before the first page uses it, check these points against the Android source of the component (its `@Composable fun` / custom View):
60
62
  - **Nullable callbacks stay optional.** `onClick: (() -> Unit)? = null` becomes `@Event onClick: (() => void) | undefined = undefined`, and the node joins hit testing only when it is set. Never write an empty-function default bound unconditionally with `.onClick`: the component then takes every tap meant for a clickable parent (GATE `event-default-click-swallows-parent`).
61
63
  - **No weight or size the source does not have.** `Modifier.weight` lives at the call site in Compose, so the component root gets no `.layoutWeight()` (GATE `layout-weight-on-shared-component-root`). Likewise no `'100%'` on an axis the source wraps.
64
+ - **Size the caller passes reaches the visible root.** Compose applies a call site's `modifier` (`weight(1f)`, `fillMaxWidth()`) to the component's own root; ArkUI puts a custom component's call-site attributes on an invisible wrapper, so the inner root keeps its content size (a bordered button stays narrow next to its `weight(1f)` sibling). When the Android signature has `modifier: Modifier`, give the component `@Param fillMaxWidth: boolean = false` and write its root `.width(this.fillMaxWidth ? '100%' : 'auto')`; a call site that passes `weight` / `fillMaxWidth` passes `fillMaxWidth: true` with its `.layoutWeight(1)`. A source default such as `fullWidth = true` maps to that same `'100%'` width, never to `constraintSize({ minWidth: '100%' })`: a percentage resolves against the nearest ancestor with a fixed size, so in a wrap-content Row the button stretches to the screen width.
65
+ - **Every variant the call sites use exists.** Match the Android function name, not the look: `XxxButtonFixed` is not `XxxButton`. A variant the shared module lacks is added to the same family file from its own `@Composable fun`, never replaced by the closest existing one.
62
66
  - **Slots are @BuilderParam filled with @Builder content.** Callers pass `() => { this.X() }` and nothing else (GATE `builder-param-arrow-inline-component`). This arrow form is for a custom component's @BuilderParam only: built-in attributes (`bindSheet` / `bindContentCover` / `overlay` / `background` / `bindMenu`) take `this.X()` directly (GATE `overlay-builder-arrow-arg`).
63
67
  - **Defaults equal the source's defaults** (padding, colors, maxLines, showDivider …), each written with its `file:line`.
64
68
 
@@ -130,18 +134,18 @@ Only true dependencies make a group wait (`after`, lane, `reuse_from`, `template
130
134
  - **Queued resumes of a finished group.** Once every group of a unit is settled from its report, `release` overwrites the unit's message file with a stop notice. A resume that was queued behind the run reads it and replies `DONE` at once instead of re-running the task, which would edit the group's files while the parent verifies them. Its completion notice then releases nothing (`action: none`).
131
135
  - **Re-running `init`** (a new parent session) keeps returned/verified results and queues groups left `running` to resume their own sessions. It also keeps every other group's session bindings: a `queued` group keeps its pending decision (a resume stays a resume), and a failed group whose session stalled resumes that session, so re-initing to change `--width` never starts a second writer.
132
136
  3. **The loop.** One pass per parent turn, in this order, so no slot ever waits on the parent's review:
133
- **One command per pass.** `node <this skill>/scripts/group_pass.mjs ${harmony_project_dir}` runs 3.1 and 3.3 and the lease half of 3.2: it releases `reported` groups, releases `stalled` units on opencode/DevEco, runs `phase5_check --group` on every `returned` group (blocking 0: `Q verified` + `group_commit.mjs`; otherwise `Q requeue` with the blocking items, `--resume` when files are missing), then `Q lease`. It prints one JSON line: `dispatch` (start each entry, then `bind` it), `stop_first` (Claude Code only: stop that task, then `Q release --unit <unit> --stalled`), `needs_human` (a group the queue cannot move: read its `hint`), and `next`. Do not write your own driver, and never sleep between passes: `Q wait` is the only wait.
137
+ **One command per pass.** `node <this skill>/scripts/group_pass.mjs ${harmony_project_dir}` runs 3.1 and 3.3 and the lease half of 3.2: it releases `reported` groups, releases `stalled` units on opencode/DevEco, runs `phase5_check --group` on every `returned` group (blocking 0: `Q verified` + `group_commit.mjs`; otherwise `Q requeue` with the blocking items, `--resume` when files are missing), then `Q lease`. It prints one JSON line: `dispatch` (start each entry, then `bind` it), `stop_first` (Claude Code only: stop that task, then `Q release --unit <unit> --stalled`), `needs_human` (a group the queue cannot move: read its `hint`), and `next`. Do not write your own driver, and never sleep between passes: `Q wait` is the only wait. Run `group_pass.mjs` and `Q wait` as separate shell calls, one each per pass: never loop them inside one shell call, or the dispatches `group_pass` prints wait until the whole loop ends.
134
138
  1. **Release.** `Q reap ${harmony_project_dir}` lists `reported` groups (report file written, even mid-batch) and `stalled` units.
135
139
  - Each reported group: `Q release ${harmony_project_dir} --unit <GID>`.
136
140
  - Each stalled unit: Claude Code stops its task first (TaskStop); opencode/DevEco cannot, so it is not stopped. Then `Q release … --unit <unit> --stalled`.
137
141
  - Each host completion notice: `Q release … --unit <unit> --task <the notice's handle>`, with `--error "<its error text>"` if it failed. A `stale-notice` row means the notice came from an older session than the bound one: ignore it.
138
142
  - Parallel `Q` calls are safe: every mutating call holds `.hometrans/queue_state.json.lock`.
139
- 2. **Lease and dispatch.** `Q lease ${harmony_project_dir}` returns `dispatch: [{unit, groups, resume_task, description, message, message_file}]`. `message` is a one-line pointer (`Read the file <message_file> and follow it fully.`), and the full text is in `message_file` (`.hometrans/work/dispatch/<unit>.a<attempt>.md`, one file per attempt). Pass `message` verbatim as the sub-agent prompt, for fresh and resumed sessions alike. `Q message ${harmony_project_dir} --unit <unit>` prints it again while the unit runs. Never rebuild a message yourself or call the script's internal functions. `released_without_dispatch` lists queued resumes whose session had already written its report: they are released without an agent; verify them like any return. For each `dispatch` entry, start one background sub-agent with `message` as its prompt (all in one message; opencode v2 `subagent` with `background: true`, opencode v1 / DevEco `task` with `background: true`). When `resume_task` is set, resume that session instead (opencode v2: `subagent` with `sessionID` = `resume_task`; opencode v1 / DevEco: `task` with `task_id` = `resume_task`; Claude Code: SendMessage to that agent if it is still known, otherwise a fresh agent with the same message). Then `Q bind … --unit <unit> --task <handle>` for each, where `<handle>` is the returned `sessionID` (v2) or `task_id` (v1/DevEco).
143
+ 2. **Lease and dispatch.** `Q lease ${harmony_project_dir}` returns `dispatch: [{unit, groups, resume_task, description, message, message_file}]`. `message` is a one-line pointer (`Read the file <message_file> and follow it fully.`), and the full text is in `message_file` (`.hometrans/work/dispatch/<unit>.a<attempt>.md`, one file per attempt). Pass `message` verbatim as the sub-agent prompt, for fresh and resumed sessions alike. `Q message ${harmony_project_dir} --unit <unit>` prints it again while the unit runs. Never rebuild a message yourself or call the script's internal functions. `released_without_dispatch` lists queued resumes whose session had already written its report: they are released without an agent; verify them like any return. For each `dispatch` entry, start one background sub-agent with `message` as its prompt (all in one message; opencode v2 `subagent` with `background: true`, opencode v1 / DevEco `task` with `background: true`). When `resume_task` is set, resume that session instead, still in the background (opencode v2: `subagent({ agent, background: true, sessionID: resume_task })`; opencode v1 / DevEco: `task` with `background: true` and `task_id` = `resume_task`; Claude Code: SendMessage to that agent if it is still known, otherwise a fresh agent with the same message). Then `Q bind … --unit <unit> --task <handle>` for each, where `<handle>` is the returned `sessionID` (v2) or `task_id` (v1/DevEco). A `bind` that returns `foreground` (the attempt's report was already on disk and the bind came more than 5 min after the lease) most likely means the call blocked until the agent finished. It is an inference: if that dispatch did pass `background: true`, ignore it; otherwise dispatch the next ones with `background: true`.
140
144
  - **Evidence intake (two steps, one session).** A fresh session of a group with screenshots or view trees is leased with `phase: "intake"`: its message lists only that group's evidence (`.hometrans/work/evidence/<GID>.json`: meta.json, every screenshot, every view tree, measure_summary.txt, plus `conversion-procedure.md` with its source-only section named when a member is source-only or an attached node has no capture) and the `evidence_gate.mjs ack` command. It carries no conversion task and no write set, so nothing can be written before the evidence is read. Dispatch and `bind` it like any unit; the agent replies `READY <GID>`. Its release returns `intake-accepted` once every member's ack covers its manifest, and the next `lease` resumes **that same session** (`phase: "convert"`, `resume_task` set) with the full prompt. The evidence it read stays in its context. The continuation is leased before any other unit and keeps its slot and lane. `intake-resume` resumes the session with the files still unread (at most `INTAKE_MAX_ROUNDS` rounds, then `intake-failed`). `intake-unbound` means no `bind` was recorded, so a fresh session reads again: always bind. After `INTAKE_MAX_ROUNDS` unbound intakes the group is `intake-failed`. `intake-recaptured` means a member was captured while the session read: it reads again with the new frames. A queued `RECAPTURED` or `requeue --message` text is held through intake and delivered with the conversion task, and `requeue` after a failed intake starts a new one. A predicted file changed during intake is listed as `touched`, and the conversion message tells the agent to re-check it. A source-only group (no frames) and every resume of a converting session skip intake; `init --no-evidence-gate` turns it off.
141
145
  3. **Verify** every group in `summary.returned_unverified` (below). Then run `Q verified … --group <GID> --summary "<one line>"` (only a `returned` group: never mark a group done in `batch_progress.json` by hand to close it). It marks every page of the group `done` in `batch_progress.json` (`status`, `group`, `verified_at`, `tier`, `output` = the files it wrote plus the `.ets` its report names, `summary`) and refreshes `updated_at`, so the page ledger never trails the queue; it refuses a file that belongs to another run. Then, when `harmony_project_dir` is in a git work tree, `node <this skill>/scripts/group_commit.mjs ${harmony_project_dir} --group <GID>`. The commit takes only the files that group changed and holds other unsettled groups' predicted writes; a file shared by several groups goes to the first one committed.
142
146
  - `missing` non-empty: `Q requeue … --group <GID> --resume --message "<missing files; written files are read-only context>"`.
143
- - Verification failed: `Q requeue … --group <GID> --message "<what to fix>"`. If the group's bound session had stalled, this resumes that session automatically. Use `--fresh` only after that session's completion notice has arrived.
144
- 4. **Capture track** (Step 3.2) work, if any. Then `Q wait ${harmony_project_dir} [--job run_cycle]` (bound reviewers are followed; `--answers` only for unbound files). It returns within seconds of a report, a silent unit, an ended job, complete answers, or an evidence-intake ack that now covers every file (`reasons: ["intake"]`, `intake_acked: [GID…]` — release those groups). It also returns when a free slot has a ready or backfill unit. Otherwise it returns after 9 min. Give the shell call a timeout above that (e.g. 600000 ms). Never sleep in a loop instead.
147
+ - Verification failed: `Q requeue … --group <GID> --message "<what to fix>"`. This resumes the group's bound session (returned or stalled), which still holds the evidence it read, so no new intake re-reads the frames. When that session's `release --error` text says it ran out of context, the queue starts the next attempt (automatic retry or `requeue`) fresh by itself (`fresh_reason: "context-exhausted"`). Use `--fresh` yourself only when the session cannot continue for a reason the queue cannot see (it repeats itself, its context is near full), and only after its completion notice has arrived.
148
+ 4. **Capture track** (Step 3.2) work, if any. Then `Q wait ${harmony_project_dir} [--job run_cycle]` (bound reviewers are followed; `--answers` only for unbound files). It returns within seconds of a report, a silent unit, an ended job, complete answers, or an evidence-intake ack that now covers every file (`reasons: ["intake"]`, `intake_acked: [GID…]` — release those groups). It also returns when a free slot has a ready or backfill unit. Otherwise it returns after 5 min (a larger `--timeout-s` is capped at 300). Give the shell call a timeout above that (e.g. 600000 ms). Never sleep in a loop instead, and never loop several waits inside one shell call.
145
149
  4. **What `release` decides** (no user involved):
146
150
  - a group's written files are its predicted writes plus the `.ets` files its report names. A file named in the report counts even at another path than predicted, and even when it was written before a resume. `written` / `missing` in the row come from this;
147
151
  - a network failure or stall resumes the same session, at most 3 attempts. A second stall of the same session fails the group (a fresh dispatch starts the count at 0), and the row carries `needs: 'human'` with a `hint`. Do not requeue it fresh while that session may be alive: resume it (`Q requeue` does so by default) or wait for its completion notice.
@@ -177,7 +181,7 @@ Parent-side re-verification checks the sub-agent's claims independently of its n
177
181
 
178
182
  | Check | How |
179
183
  |---|---|
180
- | Lexical checks, in one call | `node ./scripts/phase5_check.mjs ${harmony_project_dir} --group <GID>` (or `--files` with what the report lists). It covers GATE for the group's files, unresolved `$r`/`$rawfile`, misnamed / missing / over-budget `EVIDENCE()`, forbidden patterns (`.position(`/`.offset(`, `` $r(` ``, V1 decorators in a V2 project) and brace balance. With `--group` it also runs `[text_color]`. That compares each measured text colour in the group's `measure_pack.json` files with the colour the matching `Text`/`Span` actually renders; `text-color-unset` / `-mismatch` block. It also runs `[icons]`: every visible ImageView in `measure_pack.json` `icon_inventory` (sampled at the drift-corrected position) needs a `// ICON: <key>` marker on its Image/SymbolGlyph line; `icon-uncovered` / `icon-omit-refused` / `icon-marker-detached` block, and `[drift]` lines mean the screenshot was captured mid-animation. With `--group` or `--files` it runs `[effects]` when the UTG carries overlay `host_effects`: every effect of an overlay edge touching the group (with `--files`: any converted page) needs `// EFFECT: <id>` on or up to 3 lines above its implementing statement, or `// EFFECT-OMIT: <id> — <basis>`; `overlay-effect-uncovered` / `effect-marker-detached` block (an edge whose opener is in another group is `[cand]` there). Exit 1 = blocking finding; a static-checker run with no verdict (non-0/1 exit, no report, 0 files scanned) is `[static] …` and blocks too. `--group` covers the predicted writes plus every `.ets` named in the group's report and in its `provides/` markers, so a leader's shared files need no separate `--files` run |
184
+ | Lexical checks, in one call | `node ./scripts/phase5_check.mjs ${harmony_project_dir} --group <GID>` (or `--files` with what the report lists). It covers GATE for the group's files, unresolved `$r`/`$rawfile`, misnamed / missing / over-budget `EVIDENCE()`, forbidden patterns (`.position(`/`.offset(`, `` $r(` ``, V1 decorators in a V2 project) and brace balance. With `--group` it also runs `[text_color]`. That compares each measured text colour in the group's `measure_pack.json` files with the colour the matching `Text`/`Span` actually renders; `text-color-unset` / `-mismatch` block. It also runs `[icons]`: every visible ImageView in `measure_pack.json` `icon_inventory` (sampled at the drift-corrected position) needs a `// ICON: <key>` marker on its Image/SymbolGlyph line; `icon-uncovered` / `icon-omit-refused` / `icon-marker-detached` block, and `[drift]` lines mean the screenshot was captured mid-animation. With `--group` or `--files` it runs `[effects]` when the UTG carries overlay `host_effects`: every effect of an overlay edge touching the group (with `--files`: any converted page) needs `// EFFECT: <id>` on or up to 3 lines above its implementing statement, or `// EFFECT-OMIT: <id> — <basis>`; `overlay-effect-uncovered` / `effect-marker-detached` block (an edge whose opener is in another group is `[cand]` there). It also runs `[interactions]` when `conversion_set.json` carries `interactions` (a2h-utg-static `attachments`): every in-page interaction of a page in the group (with `--files`: any converted page), including those folded in from its attached nodes, needs `// INTERACTION: <id>` on or up to 3 lines above its implementing statement or event attribute (`.onTouch(` / `.gesture(` / `.bind*(`; a plain style attribute does not count), or `// INTERACTION-OMIT: <id> — <basis>`; an id shared by several pages (one line in a base class or reused component) is ported and marked once; `interaction-uncovered` / `interaction-marker-detached` block. Exit 1 = blocking finding; a static-checker run with no verdict (non-0/1 exit, no report, 0 files scanned) is `[static] …` and blocks too. `--group` covers the predicted writes plus every `.ets` named in the group's report and in its `provides/` markers, so a leader's shared files need no separate `--files` run |
181
185
  | No SDK API that does not exist | GATE `sdk-api-nonexistent` (inside the call above) must be 0. These are compile errors the lexical items cannot see.
182
186
  | Claimed output files exist and are complete | file exists, non-trivial length, no truncated tail |
183
187
  | Cited `file:line` really contains the claimed fact | read that exact line; never accept a citation on faith |
@@ -219,7 +223,7 @@ Pages in a shell-content group that still declare `@Entry` are fixed here (drop
219
223
  **No `shell_hosts`, but one chrome component already sits in several destination pages.** Before writing any copy, check whether the launcher Activity is a missed shell host: the UTG has ≥ 2 `fragment-transaction` or `view-swap` edges from it, and its source adds the chrome once (a layout XML widget, or `addView(<XxxNavigationBar>(…), LayoutParams(…, Gravity.BOTTOM))` in code). If so, build the shell as above and report the miss so `shell_contract.mjs` can be fixed. This overrides the per-page convention the groups already used and this prompt's `router.pushUrl` rule for the host's own destinations: the destination pages become shell content (their `@Entry` and bar copies go), and only edges to another Activity keep `router.pushUrl`. Do not give each destination its own `@Entry` page with its own bar and switch tabs with `router.pushUrl`. That stacks a page per tap, which Android never does. It also loses the indicator animation, and every copy re-creates the placement. If copies are truly unavoidable, copy the placement together with the bar: the host `Stack`'s `alignContent`, the margins, and the layer order. A bar copied without its parent's `alignContent` lands in a `Stack()` that defaults to Center. Inside the bar, a selection surface (indicator) is declared before the items: a `Stack` paints later children on top, so an opaque indicator written after them hides the selected icon and label, and `hitTestBehavior(None)` only lets taps through.
220
224
 
221
225
  Then wire navigation to real pages:
222
- - walk `conversion_set.json`'s `page` rows and each page's `navigates_to`;
226
+ - walk `conversion_set.json`'s `page` rows and each row's `navigates_to` (the same edge views as the page's `meta.json`, captured pages included); an edge with a `guard` is wired under that condition, never unconditionally;
223
227
  - an edge with `host_effects` (in `navigates_to` / `reached_from`, a captured page's `overlay_effects`, and `conversion_set.json` `overlay_effects`) also changes the host when the overlay opens or dismisses. When you move an overlay's mounting into its page, or write its trigger / onDismiss here, carry every effect with it: implement it from its `resolved` statements in the code that opens / dismisses the overlay and keep (or add) `// EFFECT: <id>` on or up to 3 lines above the implementing statement, or `// EFFECT-OMIT: <id> — <basis>`. The gate's `phase5_check --files` run checks every converted page's effects (`overlay-effect-uncovered`, `effect-marker-detached`);
224
228
  - an `// UNWIRED: <android file:line> — <reason>` handler whose target is now converted gets its real body here, and the marker goes. Every one still left is listed in the report and carried into Step 7's Manual Follow-up TODOs;
225
229
  - every edge whose target is a converted page gets a real `router.pushUrl` or component toggle;
@@ -237,4 +241,4 @@ A choice that only lives in this agent's reasoning ("dark mode is handled by res
237
241
 
238
242
  **Global state contract.** For every `AppStorageV2` / `PersistenceV2` key shared across modules, write one row in the report: `key | class | owning module | connect sites`. The class and its connect (with a default creator) live once, in a shared HAR under `common/*` that every user imports. A feature module does not declare its own copy of the class to avoid importing the entry HAP: a same-named class in another file is a different type for the same key, and leaving the key uncreated to dodge that makes the first connect without a creator crash. GATE `appstoragev2-connect-creator` covers both shapes.
239
243
 
240
- **Gate:** run `scripts/arkts_static_check.ts` (Step 6.1 command). `orphan-component` must be **zero** before Step 6. An exported struct that no file imports or instantiates can never render: every file is legal and the build is green, but every trigger is dead. Also, **every GATE in a file this step edited must be zero**. Wiring is new code that no group's Phase 5 ever saw.
244
+ **Gate:** run `scripts/arkts_static_check.ts` (Step 6.1 command). `orphan-component` must be **zero** before Step 6. An exported struct that no file imports or instantiates can never render: every file is legal and the build is green, but every trigger is dead. Also, **every GATE in a file this step edited must be zero**. Wiring is new code that no group's Phase 5 ever saw. A GATE that wiring newly exposes in a group's file (its call site now resolves) is fixed in code; wiring never closes it with a downgrade marker (`// HIT-TEST:` …), which only the group that wrote the layout can justify.
@@ -56,6 +56,7 @@ import { _replace, _uiModule } from './group_watch.mjs';
56
56
  import { scrollableContainers, sourceDeclaresScroll, sourceFileFor } from './capture_audit.mjs';
57
57
  import { scrollVerdict } from './scroll_verdict.mjs';
58
58
  import * as mp from './module_placement.mjs';
59
+ import { interactionsOf } from './interactions.mjs';
59
60
 
60
61
  // ---------------------------------------------------------------- Python compatibility layer
61
62
  // These outputs are a contract read by other scripts and the agent and must match the original Python version byte for byte:
@@ -892,8 +893,26 @@ export function templateKeys(node, shareable = shareableByPath) {
892
893
 
893
894
  const tkey = (k) => pyRepr(k[0]) + '\u0000' + pyRepr(k[1]);
894
895
 
896
+ // `args.action` values that name no gesture: a plain tap, and the placeholders a2h-utg-static writes on
897
+ // fragment-transaction / embed / pager edges (`default`) and launch-path edges (`launch`).
898
+ const NOT_A_GESTURE = new Set(['tap', 'click', 'onClick', 'default', 'launch']);
899
+
895
900
  export function edgeView(e, end) {
896
901
  const v = { [end]: e[end], mechanism: get(e, 'mechanism'), trigger: get(e, 'trigger') };
902
+ // The condition the jump needs (`!isLoggedIn` → login page): without it the conversion writes an unconditional jump.
903
+ const guard = get(e, 'guard');
904
+ if (truthy(guard)) { v.guard = guard; }
905
+ // On-screen wording of the trigger, and a gesture other than a plain tap (long_press, double_tap, swipe-*).
906
+ const args = get(e, 'args', {}) ?? {};
907
+ const label = get(args, 'label');
908
+ if (truthy(label)) { v.label = label; }
909
+ // `action` names the gesture; when it is a placeholder or the generic `swipe`, `args.gesture` is the more
910
+ // specific one (`{action: 'swipe', gesture: 'open-drawer'}`), and a placeholder never hides a real gesture.
911
+ const action = get(args, 'action');
912
+ const named = get(args, 'gesture');
913
+ const useAction = truthy(action) && !NOT_A_GESTURE.has(action) && !(action === 'swipe' && truthy(named));
914
+ const gesture = useAction ? action : named;
915
+ if (truthy(gesture) && !NOT_A_GESTURE.has(gesture)) { v.gesture = gesture; }
897
916
  // What opening / dismissing an overlay also does to its host (a2h-utg-static `args.host_effects`:
898
917
  // `{open: [{id, stmt, at, resolved}], dismiss: [...]}`). Absent on an older UTG.
899
918
  const fx = get(get(e, 'args', {}) ?? {}, 'host_effects');
@@ -920,7 +939,9 @@ const isEmptyish = (v) => v === null || v === undefined || (Array.isArray(v) &&
920
939
  export function hintsOf(node) {
921
940
  const widgets = (or(get(node, 'widgets'), [])).map((w) => {
922
941
  const o = {};
923
- for (const k of ['widget', 'kind', 'view_id', 'text', 'placeholder', 'preference_type', 'at']) {
942
+ // gesture_param (long press / double tap ...) and trigger_targets (the nodes this control opens): without them a
943
+ // source-only page cannot tell a long-press control from a tap one, or which control opens which page.
944
+ for (const k of ['widget', 'kind', 'view_id', 'text', 'placeholder', 'preference_type', 'at', 'gesture_param', 'trigger_targets']) {
924
945
  const v = get(w, k);
925
946
  if (v !== null && v !== undefined) { o[k] = w[k]; }
926
947
  }
@@ -1886,6 +1907,17 @@ export function build(ws, uiInfo, entry = null, renumber = false, exploring = fa
1886
1907
  for (const [nid, r] of roles) {
1887
1908
  if (r.role === 'attach') { setdefault(attached, r.host, []).push(nid); }
1888
1909
  }
1910
+ // In-page interactions of a page (interactions.mjs): its own, and those of the nodes attached to it. An attach
1911
+ // node has no page dir of its own, so its interactions would otherwise reach neither a meta.json nor a prompt.
1912
+ // Computed once per page: the source-only meta, the captured meta and conversion_set.json all read it.
1913
+ const interactionsCache = new Map();
1914
+ const interactionsFor = (nid) => {
1915
+ if (!interactionsCache.has(nid)) {
1916
+ interactionsCache.set(nid, [nid, ...sortedBy(attached.get(nid) ?? [])]
1917
+ .flatMap((n) => interactionsOf(g.nodes.get(n))).map((x) => ({ ...x, host: nid })));
1918
+ }
1919
+ return interactionsCache.get(nid);
1920
+ };
1889
1921
 
1890
1922
  const tmplIndex = new Map();
1891
1923
  for (const [nid, dirs] of captured) {
@@ -2021,6 +2053,7 @@ export function build(ws, uiInfo, entry = null, renumber = false, exploring = fa
2021
2053
  const p = or(paths.get(nid), {});
2022
2054
  const labels = get(p, 'steps', []).map((s) => get(s, 'label')).filter(truthy);
2023
2055
  const route = or(get(p, 'nl_path_text'), get(p, 'path_text'));
2056
+ const ixs = interactionsFor(nid);
2024
2057
  const meta = {
2025
2058
  page_id: slug, static_node: nid, kind: get(node, 'kind'), label: get(node, 'label'),
2026
2059
  declared_at: get(node, 'declared_at'),
@@ -2033,6 +2066,7 @@ export function build(ws, uiInfo, entry = null, renumber = false, exploring = fa
2033
2066
  reached_from: (g.inbound.get(nid) ?? []).map((e) => edgeView(e, 'source')),
2034
2067
  navigates_to: (g.outbound.get(nid) ?? []).map((e) => edgeView(e, 'target')),
2035
2068
  template_pages: templates.slice(0, MAX_TEMPLATES),
2069
+ ...(ixs.length ? { interactions: ixs } : {}),
2036
2070
  click_path: get(p, 'steps', []),
2037
2071
  breadcrumb: labels.join(' > '),
2038
2072
  click_path_text: or(route, ''),
@@ -2059,6 +2093,9 @@ export function build(ws, uiInfo, entry = null, renumber = false, exploring = fa
2059
2093
  if (blank) { demoted.set(nid, blank); }
2060
2094
  row.tier = captured.has(nid) && !blank ? 'captured' : 'source-only';
2061
2095
  row.page_dirs = dirs;
2096
+ // Step 5.5 wires navigation by walking these rows' navigates_to (step5-convert.md).
2097
+ const out = (g.outbound.get(nid) ?? []).map((e) => edgeView(e, 'target'));
2098
+ if (out.length) { row.navigates_to = out; }
2062
2099
  // captured but every frame FLAG_SECURE-blocked: view tree only, no pixel verification possible
2063
2100
  if (row.tier === 'captured' && row.page_dirs.every((d) => pixelsBlocked(uiInfo, d))) { row.pixels = 'blocked'; }
2064
2101
  if (blank) { row.pixels = 'rejected'; row.capture_rejected = blank; }
@@ -2105,15 +2142,27 @@ export function build(ws, uiInfo, entry = null, renumber = false, exploring = fa
2105
2142
  for (const [nid, dirs] of captured) {
2106
2143
  if (get(roles.get(nid), 'role') !== 'page') { continue; }
2107
2144
  for (const d of dirs ?? []) { writeDemotion(d, demoted.get(nid) ?? null); }
2108
- // A captured meta.json has no reached_from / navigates_to: the overlay edges that carry host effects
2109
- // go in as overlay_effects, the same edge views a source-only page lists.
2110
- const fx = g.nodes.has(nid) ? overlayEffectsOf(g, nid) : [];
2145
+ // export_ui_info writes a captured meta.json without the static edges. Step 5.5 wires navigation from
2146
+ // navigates_to, so a captured page — usually the main path — needs them as much as a source-only one does.
2147
+ // The overlay edges that carry host effects also go in as overlay_effects, and the page's in-page
2148
+ // interactions (its own and its attached nodes') as interactions.
2149
+ const want = g.nodes.has(nid) ? {
2150
+ reached_from: (g.inbound.get(nid) ?? []).map((e) => edgeView(e, 'source')),
2151
+ navigates_to: (g.outbound.get(nid) ?? []).map((e) => edgeView(e, 'target')),
2152
+ overlay_effects: overlayEffectsOf(g, nid),
2153
+ interactions: interactionsFor(nid),
2154
+ } : { reached_from: [], navigates_to: [], overlay_effects: [], interactions: [] };
2111
2155
  for (const d of dirs ?? []) {
2112
2156
  const file = path.join(uiInfo, pathName(String(d)), 'meta.json');
2113
2157
  const meta = or(readJson(file), null);
2114
2158
  if (!meta) { continue; }
2115
- if (fx.length) { meta.overlay_effects = fx; } else if (meta.overlay_effects !== undefined) { delete meta.overlay_effects; } else { continue; }
2116
- writeJson(file, meta);
2159
+ let changed = false;
2160
+ for (const [k, v] of Object.entries(want)) {
2161
+ if (v.length) {
2162
+ if (JSON.stringify(meta[k]) !== JSON.stringify(v)) { meta[k] = v; changed = true; }
2163
+ } else if (meta[k] !== undefined) { delete meta[k]; changed = true; }
2164
+ }
2165
+ if (changed) { writeJson(file, meta); }
2117
2166
  }
2118
2167
  }
2119
2168
  // pages.json rows feed Step 4.1 and group_queue: a demoted page must not read "captured" there.
@@ -2245,8 +2294,11 @@ export function build(ws, uiInfo, entry = null, renumber = false, exploring = fa
2245
2294
  if (hasHostEffects(get(get(e, 'args', {}) ?? {}, 'host_effects'))) { overlayEffects.push({ source: nid, ...edgeView(e, 'target') }); }
2246
2295
  }
2247
2296
  }
2297
+ // Every page's in-page interactions, for the group pack and phase5_check interaction-uncovered.
2298
+ const interactions = nodesOut.filter((r) => r.role === 'page').flatMap((r) => interactionsFor(r.node));
2248
2299
  writeJson(path.join(uiInfo, 'conversion_set.json'),
2249
- { summary, nodes: nodesOut, plan, ...(overlayEffects.length ? { overlay_effects: overlayEffects } : {}) });
2300
+ { summary, nodes: nodesOut, plan, ...(overlayEffects.length ? { overlay_effects: overlayEffects } : {}),
2301
+ ...(interactions.length ? { interactions } : {}) });
2250
2302
  return summary;
2251
2303
  }
2252
2304
 
@@ -38,6 +38,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
38
38
  import { scrollableContainers } from './capture_audit.mjs';
39
39
  import { scrollVerdict } from './scroll_verdict.mjs';
40
40
  import { edgesInScope, loadEffects, renderEffectsSection } from './overlay_effects.mjs';
41
+ import { interactionsInScope, loadInteractions, renderInteractionsSection } from './interactions.mjs';
41
42
 
42
43
  /** A doc heading / evidence name quoted the way the docs quote it: 「name」 in zh, "name" in en. */
43
44
  const quoteName = (s) => (`"${s}"`);
@@ -1626,6 +1627,8 @@ export function render(group, pack, idx, hres, android, uiInfo = null, { inline
1626
1627
  if (uiInfo !== null) {
1627
1628
  const members = new Set(pyIter(or(dget(group, 'members'), [])).map((m) => pyStr(dget(m, 'node'))));
1628
1629
  lines.push(...renderEffectsSection(edgesInScope(loadEffects(uiInfo), { members })));
1630
+ // In-page interactions of this group's pages and their attached nodes (interactions.mjs)
1631
+ lines.push(...renderInteractionsSection(interactionsInScope(loadInteractions(uiInfo), members)));
1629
1632
  }
1630
1633
  if (uiInfo !== null) { lines.push(...renderEvidence(referenceEvidence(group, uiInfo))); }
1631
1634
  lines.push(...renderCards([...pack.files.values()].map(([p]) => pathStr(p))));