@buaa_smat/hometrans 26.0.5 → 26.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +249 -279
- package/agents/code-reviewer.md +1 -1
- package/dist/cli/editors.json +20 -0
- package/dist/platform/registry.js +1 -0
- package/dist/platform/validate.js +2 -1
- package/i18n/agents/code-reviewer.md +1 -1
- package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
- package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
- package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/package.json +2 -1
- package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/skills/a2h-app-migrate/SKILL.md +31 -14
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
- package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
- package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
- package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
- package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
- package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
- package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
- package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
- package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
- package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
- package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
- package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
- package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
- package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
- package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
- package/skills/a2h-page-specgen/SKILL.md +36 -5
- package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
- package/skills/a2h-page-specgen/references/evidence.md +2 -1
- package/skills/a2h-page-specgen/references/execution-model.md +13 -5
- package/skills/a2h-page-specgen/references/gates.md +33 -7
- package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
- package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
- package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
- package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
- package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
- package/skills/a2h-resource-convert/SKILL.md +1 -1
- package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
- package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
- package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
- package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
- package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
- package/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
- package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
- package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
- package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
- package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
- package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
- package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
- package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
- package/skills/a2h-utg-static/SKILL.md +3 -3
- package/skills/a2h-utg-static/references/extractors.md +7 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
- package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// A full-screen DialogFragment renders in window "main" with no framework modal marker
|
|
2
|
+
// (alertTitle / parentPanel). Its own layout ids are then the evidence that it is open.
|
|
3
|
+
// Measured (universalapp TV 2026-11-25): 47 captures of the agreement dialog resolved to the
|
|
4
|
+
// host activity by exact-activity, so the dialog and its three child pages stayed source-only.
|
|
5
|
+
import { test } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import { resolvePage, dialogShown } from '../utg_explorer/semantics.mjs';
|
|
8
|
+
import { get } from '../utg_explorer/_py.mjs';
|
|
9
|
+
|
|
10
|
+
const P = { app_package: 'x' };
|
|
11
|
+
const page = (kind, ids, component = null) => ({ kind, titles: [], hint_titles: [], row_titles: [], widget_ids: ids, component });
|
|
12
|
+
const AGREE = ['root_layout', 'agreement_summary_tv', 'user_protocol_tv', 'privacy_protocol_tv', 'reject_layout', 'agree_layout'];
|
|
13
|
+
|
|
14
|
+
function catalog() {
|
|
15
|
+
return {
|
|
16
|
+
'activity:Splash': page('activity', [], 'x.Splash'),
|
|
17
|
+
'fragment:AgreementDialog': page('dialog', [...AGREE, 'iv_control_back']),
|
|
18
|
+
'fragment:Other': page('fragment', ['iv_control_back', 'other_list']),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
test('a dialog whose own layout is on screen resolves without a modal marker', () => {
|
|
23
|
+
const nodes = ['content', ...AGREE, 'iv_control_back'].map((r) => ({ resource_id: `x:id/${r}` }));
|
|
24
|
+
const r = resolvePage({ package: 'x', activity: 'x.Splash', window: 'main', nodes }, catalog(), null, P);
|
|
25
|
+
assert.deepEqual([get(r, 'status'), get(r, 'static_id'), get(r, 'reason')], ['verified', 'fragment:AgreementDialog', 'own-layout-ids']);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('a few of a dialog\'s ids on a plain page do not open it', () => {
|
|
29
|
+
const nodes = ['root_layout', 'agree_layout', 'iv_control_back', 'other_list'].map((r) => ({ resource_id: `x:id/${r}` }));
|
|
30
|
+
const r = resolvePage({ package: 'x', activity: 'x.Splash', window: 'main', nodes }, catalog(), null, P);
|
|
31
|
+
assert.notEqual(get(r, 'static_id'), 'fragment:AgreementDialog');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('dialogShown needs both a minimum count and coverage of the unique ids', () => {
|
|
35
|
+
const counts = new Map([['a', 1], ['b', 1], ['c', 1], ['d', 1], ['e', 1], ['shared', 4]]);
|
|
36
|
+
const ids = ['a', 'b', 'c', 'd', 'e', 'shared'];
|
|
37
|
+
assert.equal(dialogShown(ids, new Set(['a', 'b', 'c', 'd']), counts), true);
|
|
38
|
+
assert.equal(dialogShown(ids, new Set(['a', 'b', 'c', 'shared']), counts), false); // 3/5 < 0.8
|
|
39
|
+
assert.equal(dialogShown(['a', 'b'], new Set(['a', 'b']), counts), false); // below the minimum
|
|
40
|
+
});
|
|
@@ -67,6 +67,7 @@ describe('d_prereqs snapshot takes the device lock', () => {
|
|
|
67
67
|
seen.push(`${action.type}:${held()}`);
|
|
68
68
|
if (action.type === 'snapshot_app_data') { fs.writeFileSync(action.archive, tinyTar()); }
|
|
69
69
|
}
|
|
70
|
+
observe() { seen.push(`observe:${held()}`); return { observation_id: 'o', package: 'p', activity: 'p.A', nodes: [] }; }
|
|
70
71
|
close() { seen.push(`close:${held()}`); }
|
|
71
72
|
}
|
|
72
73
|
beforeEach(() => {
|
|
@@ -74,6 +75,8 @@ describe('d_prereqs snapshot takes the device lock', () => {
|
|
|
74
75
|
cfg = path.join(root, 'config.json');
|
|
75
76
|
fs.writeFileSync(cfg, JSON.stringify({ serial, package: 'p', launch_component: 'p/.A', snapshot_dir: snap, device_lock_wait_s: 0.2 }));
|
|
76
77
|
saved = dp.deps.DeviceAdapter; dp.deps.DeviceAdapter = LockedDevice; seen = [];
|
|
78
|
+
// d_prereqs initial already ran: snapshot alone would archive the handed-over data first
|
|
79
|
+
fs.writeFileSync(path.join(root, 'states.json'), JSON.stringify({ states: [{ id: 'initial', origin: 'initial', archive: null, restorable: false, empty: true, landing: null }], timeline: [] }));
|
|
77
80
|
});
|
|
78
81
|
afterEach(() => {
|
|
79
82
|
dp.deps.DeviceAdapter = saved;
|
|
@@ -84,7 +87,7 @@ describe('d_prereqs snapshot takes the device lock', () => {
|
|
|
84
87
|
test('launch, tar and close all run under the lock; it is released afterwards', () => {
|
|
85
88
|
const r = dp.snapshot(cfg, 'fresh', 0);
|
|
86
89
|
assert.equal(r.created, true);
|
|
87
|
-
assert.deepEqual(seen, ['new', 'clear_app_data:locked', 'launch:locked', 'snapshot_app_data:locked', 'close:locked']);
|
|
90
|
+
assert.deepEqual(seen, ['new', 'clear_app_data:locked', 'launch:locked', 'snapshot_app_data:locked', 'launch:locked', 'observe:locked', 'close:locked']);
|
|
88
91
|
assert.equal(lockOf(serial), null);
|
|
89
92
|
});
|
|
90
93
|
|
|
@@ -8,7 +8,6 @@ import * as path from 'node:path';
|
|
|
8
8
|
import {
|
|
9
9
|
isComponentRoute, routeTask, routeTaskId, ensureRoutePhases,
|
|
10
10
|
} from '../utg_explorer/hybrid_route.mjs';
|
|
11
|
-
import { fallbackScope, statePhaseFallbackEnabled } from '../utg_explorer/state_phase.mjs';
|
|
12
11
|
import { firstRoundPhases } from '../run_cycle.mjs';
|
|
13
12
|
import * as dl from '../direct_launch.mjs';
|
|
14
13
|
|
|
@@ -64,35 +63,14 @@ describe('Route tasks', () => {
|
|
|
64
63
|
});
|
|
65
64
|
});
|
|
66
65
|
|
|
67
|
-
describe('State
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
test('default is best-effort for uni-app, blocking for native; an explicit flag overrides', () => {
|
|
72
|
-
assert.equal(statePhaseFallbackEnabled({}, uniDoc), true);
|
|
73
|
-
assert.equal(statePhaseFallbackEnabled({}, nativeDoc), false);
|
|
74
|
-
assert.equal(statePhaseFallbackEnabled({ state_phase_fallback: false }, uniDoc), false);
|
|
75
|
-
assert.equal(statePhaseFallbackEnabled({ state_phase_fallback: true }, nativeDoc), true);
|
|
76
|
-
assert.match(fallbackScope({}, phase, undefined, uniDoc), /best-effort/);
|
|
77
|
-
assert.equal(fallbackScope({}, phase, undefined, nativeDoc), null);
|
|
78
|
-
assert.equal(fallbackScope({ state_phase_fallback: false }, phase, undefined, uniDoc), null);
|
|
79
|
-
assert.equal(fallbackScope({}, phase, [{ text: 'x' }], uniDoc), null);
|
|
80
|
-
assert.equal(fallbackScope({}, { id: 'p0-fresh', requires: [] }, undefined), 'existing state, no guard assumed');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test('first round includes state phases with tasks but no fixture/probe (uni-app default on, native default off)', () => {
|
|
84
|
-
const base = {
|
|
85
|
-
phases: [{ id: 'p0-fresh', requires: [] }, { id: 'state-login', requires: ['login'] },
|
|
86
|
-
{ id: 'state-empty', requires: ['content'] }],
|
|
66
|
+
describe('State phases in the first round', () => {
|
|
67
|
+
test('only configured phases run; a state phase waits for stage S whatever the app type', () => {
|
|
68
|
+
const doc = {
|
|
69
|
+
phases: [{ id: 'p0-fresh', requires: [] }, { id: 'state-login', requires: ['login'] }],
|
|
87
70
|
tasks: [{ phase: 'state-login', status: 'compiled' }],
|
|
71
|
+
nodes: [page('pages/index/index', { entry: true })],
|
|
88
72
|
};
|
|
89
|
-
|
|
90
|
-
const native = { ...base, ...nativeDoc };
|
|
91
|
-
assert.deepEqual(firstRoundPhases({ fixtures: { 'p0-fresh': [] } }, uni), ['p0-fresh', 'state-login']);
|
|
92
|
-
assert.deepEqual(firstRoundPhases({ fixtures: { 'p0-fresh': [] }, state_phase_fallback: false }, uni), ['p0-fresh']);
|
|
93
|
-
// native: the probe-less state phase stays out of the first round, so D can still recipe it
|
|
94
|
-
assert.deepEqual(firstRoundPhases({ fixtures: { 'p0-fresh': [] } }, native), ['p0-fresh']);
|
|
95
|
-
assert.deepEqual(firstRoundPhases({ fixtures: { 'p0-fresh': [] }, state_phase_fallback: true }, native), ['p0-fresh', 'state-login']);
|
|
73
|
+
assert.deepEqual(firstRoundPhases({ fixtures: { 'p0-fresh': [] } }, doc), ['p0-fresh']);
|
|
96
74
|
});
|
|
97
75
|
});
|
|
98
76
|
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// a2h-utg-static `in-route-surface` nodes (id `surface:<Composable>`): a host route swaps the surface in
|
|
2
|
+
// by a state flag, through `surface-switch` edges (trigger onClick@file:line, args.state_flag) and back.
|
|
3
|
+
// The edge compiles as a tap, the surface is identified over its host by its own body texts, and it
|
|
4
|
+
// is a node obligation like any page. Also: one overlay target from two hosts, compiled end to end.
|
|
5
|
+
import { test, describe } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as os from 'node:os';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { spawnSync } from 'node:child_process';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { buildCatalog, resolvePage } from '../utg_explorer/semantics.mjs';
|
|
13
|
+
import { navigatedAway } from '../utg_explorer/task_runner.mjs';
|
|
14
|
+
import { compilePlan } from '../plan.mjs';
|
|
15
|
+
|
|
16
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const run = (script, ...args) => spawnSync(process.execPath, [path.join(HERE, '..', script), ...args], { encoding: 'utf8' });
|
|
18
|
+
const HOST = 'compose-route:Routes.Settings';
|
|
19
|
+
const SURFACE = 'surface:AdvancedOptionsPane';
|
|
20
|
+
const GRAPH = {
|
|
21
|
+
nodes: [
|
|
22
|
+
{ id: 'compose-route:Routes.Main', kind: 'compose-route', label: 'Routes.Main', entry: true, body_text: [{ text: 'Home feed today' }] },
|
|
23
|
+
{ id: HOST, kind: 'compose-route', label: 'Routes.Settings', body_text: [{ text: 'General settings' }, { text: 'Show advanced' }] },
|
|
24
|
+
{ id: SURFACE, kind: 'in-route-surface', label: 'AdvancedOptionsPane', host_node: HOST,
|
|
25
|
+
body_text: [{ text: 'Developer switches' }, { text: 'Reset all caches' }] },
|
|
26
|
+
],
|
|
27
|
+
links: [
|
|
28
|
+
{ source: 'compose-route:Routes.Main', target: HOST, mechanism: 'compose-navigate', trigger: 'onClick@app/Main.kt:20',
|
|
29
|
+
args: { label: 'Settings' } },
|
|
30
|
+
{ source: HOST, target: SURFACE, mechanism: 'surface-switch', trigger: 'onClick@app/Settings.kt:41',
|
|
31
|
+
args: { label: 'Show advanced', state_flag: 'showAdvanced' } },
|
|
32
|
+
{ source: SURFACE, target: HOST, mechanism: 'surface-switch', trigger: 'onClick@app/Advanced.kt:12',
|
|
33
|
+
args: { label: 'Back to settings', state_flag: 'showAdvanced' } },
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
const screen = (texts) => ({ package: 'com.ex', activity: 'com.ex.MainActivity', identity: {},
|
|
37
|
+
nodes: texts.map((t, i) => ({ text: t, visible: true, package: 'com.ex', class: 'android.widget.TextView', bounds: [0, i * 100, 500, i * 100 + 50] })) });
|
|
38
|
+
|
|
39
|
+
describe('in-route surface identity', () => {
|
|
40
|
+
const catalog = buildCatalog(GRAPH);
|
|
41
|
+
test('the surface wins over its host when its own texts are on screen under the host bar', () => {
|
|
42
|
+
const r = resolvePage(screen(['General settings', 'Show advanced', 'Developer switches', 'Reset all caches']), catalog);
|
|
43
|
+
assert.equal(r.status, 'verified');
|
|
44
|
+
assert.equal(r.static_id, SURFACE);
|
|
45
|
+
assert.equal(r.reason, 'in-route-surface-body-text');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('the host alone is still the host', () => {
|
|
49
|
+
const r = resolvePage(screen(['General settings', 'Show advanced']), catalog);
|
|
50
|
+
assert.deepEqual([r.status, r.static_id], ['verified', HOST]);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('a surface opens in place: tapping into it is no navigation away', () => {
|
|
54
|
+
const at = (id) => ({ activity: 'A', static_resolution: { status: 'verified', static_id: id } });
|
|
55
|
+
assert.equal(navigatedAway(at(HOST), at(SURFACE), catalog), false);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('the surface and both switch edges are obligations, counted like any node and edge', () => {
|
|
59
|
+
const obligations = compilePlan(GRAPH).flatMap((p) => p.obligations);
|
|
60
|
+
assert.ok(obligations.some((o) => o.type === 'node' && o.id === SURFACE));
|
|
61
|
+
assert.equal(obligations.filter((o) => o.type === 'edge').length, 3);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const launch = { action: 'launch', label: null, target_id: 'compose-route:Routes.Main',
|
|
66
|
+
launch: { type: 'component', component_fqn: 'com.ex.MainActivity' } };
|
|
67
|
+
const toHost = { action: 'tap', label: 'Settings', target_id: HOST };
|
|
68
|
+
|
|
69
|
+
/** plan.mjs + compile_tasks.mjs over `graph` / `paths` in a temp dir -> campaign tasks. */
|
|
70
|
+
function compile(graph, paths) {
|
|
71
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'surface-'));
|
|
72
|
+
fs.writeFileSync(path.join(d, 'utg.json'), JSON.stringify(graph));
|
|
73
|
+
fs.writeFileSync(path.join(d, 'click_paths.json'), JSON.stringify({ root: 'compose-route:Routes.Main', paths }));
|
|
74
|
+
const camp = path.join(d, 'campaign');
|
|
75
|
+
let r = run('plan.mjs', path.join(d, 'utg.json'), camp);
|
|
76
|
+
assert.equal(r.status, 0, r.stderr);
|
|
77
|
+
r = run('compile_tasks.mjs', path.join(d, 'utg.json'), camp);
|
|
78
|
+
assert.equal(r.status, 0, r.stderr);
|
|
79
|
+
const tasks = JSON.parse(fs.readFileSync(path.join(camp, 'campaign.json'), 'utf8')).tasks;
|
|
80
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
81
|
+
return tasks;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
describe('compile', () => {
|
|
85
|
+
test('a surface-switch edge is a tap on its trigger label, from the host, with its state flag', () => {
|
|
86
|
+
const tasks = compile(GRAPH, { 'compose-route:Routes.Main': { steps: [launch] }, [HOST]: { steps: [launch, toHost] },
|
|
87
|
+
[SURFACE]: { steps: [launch, toHost, { action: 'surface-switch', label: 'Show advanced', target_id: SURFACE }] } });
|
|
88
|
+
const open = tasks.find((t) => t.source_static === HOST && t.target_static === SURFACE);
|
|
89
|
+
assert.equal(open.status, 'compiled', JSON.stringify(open.compile_issues));
|
|
90
|
+
assert.equal(open.action.type, 'click_candidates');
|
|
91
|
+
assert.deepEqual(open.action.selectors[0], { text: 'Show advanced' });
|
|
92
|
+
assert.equal(open.provenance.state_flag, 'showAdvanced');
|
|
93
|
+
// back: the surface's own path replays the switch as a tap too
|
|
94
|
+
const back = tasks.find((t) => t.source_static === SURFACE && t.target_static === HOST);
|
|
95
|
+
assert.equal(back.status, 'compiled', JSON.stringify(back.compile_issues));
|
|
96
|
+
assert.equal(back.replay.at(-1).type, 'click_candidates');
|
|
97
|
+
assert.deepEqual(back.action.selectors[0], { text: 'Back to settings' });
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('one overlay from two hosts: the launch-page host runs first, the other borrows its gesture', () => {
|
|
101
|
+
const TRIG = 'onClick@app/widget/DailyPanel.kt:86';
|
|
102
|
+
const graph = {
|
|
103
|
+
nodes: [GRAPH.nodes[0], { id: 'compose-route:Routes.Preview', kind: 'compose-route', label: 'Routes.Preview' },
|
|
104
|
+
{ id: 'overlay:DailyPopup', kind: 'dialog', label: 'DailyPopup', body_text: [{ text: 'Night' }, { text: 'Daytime' }] }],
|
|
105
|
+
links: [
|
|
106
|
+
{ source: 'compose-route:Routes.Main', target: 'compose-route:Routes.Preview', mechanism: 'compose-navigate', trigger: 'onClick@app/Main.kt:9' },
|
|
107
|
+
{ source: 'compose-route:Routes.Preview', target: 'overlay:DailyPopup', mechanism: 'open-overlay', trigger: TRIG, args: { source_resolved_by: 'callgraph' } },
|
|
108
|
+
{ source: 'compose-route:Routes.Main', target: 'overlay:DailyPopup', mechanism: 'open-overlay', trigger: TRIG, args: { source_resolved_by: 'callgraph-fanout' } }],
|
|
109
|
+
};
|
|
110
|
+
const preview = { action: 'tap', target_id: 'compose-route:Routes.Preview', label_source: 'code-name', label: 'Routes.Preview',
|
|
111
|
+
nl_hint: 'Tap any city row' };
|
|
112
|
+
const tasks = compile(graph, { 'compose-route:Routes.Main': { steps: [launch] },
|
|
113
|
+
'compose-route:Routes.Preview': { steps: [launch, preview] },
|
|
114
|
+
'overlay:DailyPopup': { steps: [launch, preview, { action: 'tap', target_id: 'overlay:DailyPopup', label: 'DailyPopup',
|
|
115
|
+
label_source: 'code-name', nl_hint: 'Tap “Today”' }] } });
|
|
116
|
+
const popup = tasks.filter((t) => t.target_static === 'overlay:DailyPopup');
|
|
117
|
+
assert.deepEqual(popup.map((t) => t.source_static), ['compose-route:Routes.Main', 'compose-route:Routes.Preview']);
|
|
118
|
+
const [main, prev] = popup;
|
|
119
|
+
assert.equal(main.status, 'compiled', JSON.stringify(main.compile_issues));
|
|
120
|
+
assert.deepEqual(main.action.selectors[0], { text: 'Today' });
|
|
121
|
+
assert.equal(main.provenance.gesture_from_host, 'compose-route:Routes.Preview');
|
|
122
|
+
assert.deepEqual(main.host_alternatives, [prev.task_id]);
|
|
123
|
+
assert.deepEqual(prev.host_alternatives, [main.task_id]);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// A status tab strip beside the order list is not a second data list, and a data-backed page a row
|
|
2
|
+
// opens lands on a sparse frame first. Measured (coolmall 2026-11-28): the order list's tabs
|
|
3
|
+
// counted as a second list, so `click_list_item` threw and the probe tapped a tab; the order detail
|
|
4
|
+
// then showed only its status bar's buttons while the order was fetched, so the probe judged it a
|
|
5
|
+
// wrong page and gave up (6 tasks collapsed: Logistics, Refund, Comment, 取消原因, 再次购买, 确认收货).
|
|
6
|
+
import { test } from 'node:test';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { Runner } from '../utg_explorer/task_runner.mjs';
|
|
9
|
+
|
|
10
|
+
const v = (parent, bounds, extra = {}) => ({ class: 'android.view.View', text: '', parent_index: parent,
|
|
11
|
+
visible: true, enabled: true, clickable: false, scrollable: false, bounds, ...extra });
|
|
12
|
+
|
|
13
|
+
/** A horizontal status-tab strip above one vertical order list. */
|
|
14
|
+
function stripAndList() {
|
|
15
|
+
const n = [v(null, [0, 0, 1080, 2400])];
|
|
16
|
+
const strip = n.push(v(0, [0, 300, 1080, 432], { scrollable: true })) - 1;
|
|
17
|
+
for (let k = 0; k < 4; k++) {
|
|
18
|
+
n.push(v(strip, [k * 270, 300, (k + 1) * 270, 432], { clickable: true, text: `标签${k}` }));
|
|
19
|
+
}
|
|
20
|
+
const list = n.push(v(0, [0, 444, 1080, 2300], { scrollable: true })) - 1;
|
|
21
|
+
for (let k = 0; k < 3; k++) {
|
|
22
|
+
n.push(v(list, [0, 470 + k * 600, 1080, 1040 + k * 600], { clickable: true, text: `订单${k}` }));
|
|
23
|
+
}
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const runner = (nodes) => { const r = Object.create(Runner.prototype); r.current = { observation_id: 'o', nodes }; return r; };
|
|
28
|
+
|
|
29
|
+
test('a horizontal tab strip beside one vertical list is probed only after the list', () => {
|
|
30
|
+
const r = runner(stripAndList());
|
|
31
|
+
const cands = r.listCandidates();
|
|
32
|
+
assert.equal(cands.length, 2, 'both lists stay candidates');
|
|
33
|
+
assert.deepEqual(r.current.nodes[cands[0][0]].bounds, [0, 444, 1080, 2300], 'the vertical order list is probed first');
|
|
34
|
+
assert.equal(cands[0][1].text, '订单0', 'the first order row, not a status tab');
|
|
35
|
+
assert.throws(() => r.listItem(), /list-item: expected one list, found 2/);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('two vertical lists stay ambiguous rather than guessed at', () => {
|
|
39
|
+
const nodes = [v(null, [0, 0, 1080, 2400])];
|
|
40
|
+
for (const x of [0, 540]) {
|
|
41
|
+
const li = nodes.push(v(0, [x, 100, x + 500, 2300], { scrollable: true })) - 1;
|
|
42
|
+
for (let k = 0; k < 3; k++) { nodes.push(v(li, [x, 120 + k * 500, x + 480, 520 + k * 500], { clickable: true, text: `行${k}` })); }
|
|
43
|
+
}
|
|
44
|
+
const r = runner(nodes);
|
|
45
|
+
assert.equal(r.listCandidates().length, 2);
|
|
46
|
+
assert.throws(() => r.listItem(), /list-item: expected one list, found 2/);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('probeLists waits for a data-backed target to render', () => {
|
|
50
|
+
const r = Object.create(Runner.prototype);
|
|
51
|
+
r.config = { target_wait_seconds: 2, max_list_probes: 3 };
|
|
52
|
+
r.current = { observation_id: 'origin', nodes: [], static_resolution: { status: 'verified', static_id: 'origin' } };
|
|
53
|
+
const tapped = [];
|
|
54
|
+
r.at = (id) => r.current.observation_id === id || r.current.static_resolution?.static_id === id;
|
|
55
|
+
r.emit = () => {};
|
|
56
|
+
r.listCandidates = () => [[1, { bounds: [0, 100, 100, 200], text: 'row' }]];
|
|
57
|
+
const tapRow = () => { r.current = { observation_id: 'sparse', nodes: [], static_resolution: null }; tapped.push('tap'); return 'tap'; };
|
|
58
|
+
r.capture = () => { r.current = { observation_id: 'target', nodes: [], static_resolution: { status: 'verified', static_id: 'T' } }; return r.current; };
|
|
59
|
+
assert.equal(r.probeLists('T', tapRow, 'task'), 'tap');
|
|
60
|
+
assert.equal(tapped.length, 1, 'the sparse frame is not a wrong page: one row is tapped');
|
|
61
|
+
assert.equal(r.current.observation_id, 'target');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('a page verified as another page ends the target wait at once', () => {
|
|
65
|
+
const r = Object.create(Runner.prototype);
|
|
66
|
+
r.config = { target_wait_seconds: 30 };
|
|
67
|
+
r.current = { observation_id: 'other', nodes: [], static_resolution: { status: 'verified', static_id: 'Other' } };
|
|
68
|
+
let captures = 0;
|
|
69
|
+
r.capture = () => { captures++; return r.current; };
|
|
70
|
+
r.at = () => false;
|
|
71
|
+
const started = Date.now();
|
|
72
|
+
assert.equal(r.waitForTarget('T', 'task'), false);
|
|
73
|
+
assert.ok(Date.now() - started < 1000, 'verified as another page, so no bounded wait');
|
|
74
|
+
assert.equal(captures, 0);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('a page that already verifies as the target needs no capture', () => {
|
|
78
|
+
const r = Object.create(Runner.prototype);
|
|
79
|
+
r.config = { target_wait_seconds: 30 };
|
|
80
|
+
r.current = { observation_id: 'target', nodes: [], static_resolution: { status: 'verified', static_id: 'T' } };
|
|
81
|
+
let captures = 0;
|
|
82
|
+
r.capture = () => { captures++; return r.current; };
|
|
83
|
+
r.at = (id) => r.current.static_resolution.static_id === id;
|
|
84
|
+
assert.equal(r.waitForTarget('T', 'task'), true);
|
|
85
|
+
assert.equal(captures, 0);
|
|
86
|
+
});
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// One target opened from several hosts (a shared composable's panel rendered by two routes): the
|
|
2
|
+
// cheapest host runs first, a failure on an unverified/unreachable host retries the target through
|
|
3
|
+
// the next host before a gap is recorded, and the gap lists every host tried.
|
|
4
|
+
import { test, describe } from 'node:test';
|
|
5
|
+
import assert from 'node:assert/strict';
|
|
6
|
+
import * as fs from 'node:fs';
|
|
7
|
+
import * as os from 'node:os';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import { annotateHosts, orderHosts, hostCost, isHostFailure, alternativeHost, hostsTried, hostFamily } from '../utg_explorer/hosts.mjs';
|
|
10
|
+
import { sharedTriggerStep, compileReplayStep } from '../compile_tasks.mjs';
|
|
11
|
+
import { dataPrerequisites } from '../report.mjs';
|
|
12
|
+
import { Runner } from '../utg_explorer/task_runner.mjs';
|
|
13
|
+
|
|
14
|
+
const TARGET = 'overlay:DetailPopup';
|
|
15
|
+
const TRIG = 'onClick@app/src/main/java/x/widget/DailyPanel.kt:86';
|
|
16
|
+
const LIST = { type: 'click_list_item', static_label: null, target_id: 'route:Preview' };
|
|
17
|
+
// The host behind a data-backed list row: compiled first (static edge order), needs `content`.
|
|
18
|
+
const viaList = () => ({ task_id: 'edge-preview', phase: 'p-content', status: 'compiled', purpose: 'navigate',
|
|
19
|
+
source_static: 'route:Preview', target_static: TARGET, requires: ['content'], replay: [LIST], prelude: [],
|
|
20
|
+
action: { type: 'click_candidates', selectors: [{ text: 'Today' }] }, provenance: { mechanism: 'open-overlay', trigger: TRIG } });
|
|
21
|
+
// The launch page, already verified: no replay, no requirement.
|
|
22
|
+
const viaMain = () => ({ task_id: 'edge-main', phase: 'p0', status: 'compiled', purpose: 'navigate',
|
|
23
|
+
source_static: 'route:Main', target_static: TARGET, requires: [], replay: [], prelude: [],
|
|
24
|
+
action: { type: 'click_candidates', selectors: [{ text: 'Today' }] }, provenance: { mechanism: 'open-overlay', trigger: TRIG } });
|
|
25
|
+
|
|
26
|
+
describe('host ordering', () => {
|
|
27
|
+
test('a verified host with no data precondition runs before the list-row host', () => {
|
|
28
|
+
const other = { task_id: 'edge-other', purpose: 'navigate', source_static: 'route:Main', target_static: 'route:Settings',
|
|
29
|
+
requires: [], replay: [], provenance: { mechanism: 'compose-navigate' } };
|
|
30
|
+
const out = annotateHosts([viaList(), other, viaMain()], new Set(['route:Main']));
|
|
31
|
+
assert.deepEqual(out.map((t) => t.task_id), ['edge-main', 'edge-other', 'edge-preview']);
|
|
32
|
+
assert.deepEqual(out[0].host_alternatives, ['edge-preview']);
|
|
33
|
+
assert.equal(out[0].host_rank, 0);
|
|
34
|
+
assert.deepEqual(out[2].host_alternatives, ['edge-main']);
|
|
35
|
+
assert.equal(out[1].host_alternatives, undefined, 'a single-host target is left untouched');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('cost: verified first, then data preconditions (requirements + list rows), then replay length', () => {
|
|
39
|
+
assert.deepEqual(hostCost(viaList(), new Set()), [1, 2, 1]);
|
|
40
|
+
assert.deepEqual(hostCost(viaMain(), new Set(['route:Main'])), [0, 0, 0]);
|
|
41
|
+
// unverified everywhere: the data-free host still wins
|
|
42
|
+
const out = orderHosts([viaList(), viaMain()], new Set());
|
|
43
|
+
assert.deepEqual(out.map((t) => t.task_id), ['edge-main', 'edge-preview']);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('one family per surface kind: an overlay and a navigation into one target are not alternatives', () => {
|
|
47
|
+
assert.equal(hostFamily('open-overlay'), hostFamily('show-dialog'));
|
|
48
|
+
assert.notEqual(hostFamily('open-overlay'), hostFamily('compose-navigate'));
|
|
49
|
+
const nav = { ...viaMain(), provenance: { mechanism: 'compose-navigate' } };
|
|
50
|
+
const out = annotateHosts([viaList(), nav]);
|
|
51
|
+
assert.equal(out[0].host_alternatives, undefined);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe('host failure', () => {
|
|
56
|
+
test('the measured reasons of an unverified host count; a trigger miss on a verified host does not', () => {
|
|
57
|
+
const probing = { outcome: 'failed', stage: 'target', reason: 'list-item: the probing page is unverified, so a return to it cannot be checked' };
|
|
58
|
+
assert.equal(isHostFailure(probing), true);
|
|
59
|
+
assert.equal(isHostFailure({ outcome: 'failed', stage: 'target', reason: 'selector unavailable on non-app/empty UI' }), true);
|
|
60
|
+
assert.equal(isHostFailure({ outcome: 'failed', stage: 'source', reason: 'anything' }), true);
|
|
61
|
+
assert.equal(isHostFailure({ outcome: 'failed', stage: 'source', reason: 'replay-target-unverified:route:Preview' }), true);
|
|
62
|
+
assert.equal(isHostFailure({ outcome: 'unsupported', reason: 'missing-source-path', compile_issues: ['missing-source-path'] }), true);
|
|
63
|
+
const miss = { outcome: 'failed', stage: 'target', reason: 'selector-not-found-after-bounded-scroll' };
|
|
64
|
+
assert.equal(isHostFailure(miss, { hostVerified: true }), false);
|
|
65
|
+
// the same miss past a host that was only attested (never verified) is the host's
|
|
66
|
+
assert.equal(isHostFailure(miss, { hostVerified: false }), true);
|
|
67
|
+
assert.equal(isHostFailure({ outcome: 'target-unverified' }, { hostVerified: false }), true);
|
|
68
|
+
assert.equal(isHostFailure({ outcome: 'confirmed', stage: 'source' }), false);
|
|
69
|
+
assert.equal(isHostFailure({ outcome: 'device-error', stage: 'source' }), false);
|
|
70
|
+
assert.equal(isHostFailure({ outcome: 'failed', stage: 'source', retrying: true }), false);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('alternativeHost skips tried hosts, tasks the phase runs anyway, started ones and unmet requirements', () => {
|
|
74
|
+
const a = viaList(); const b = viaMain(); annotateHosts([a, b], new Set());
|
|
75
|
+
const byId = new Map([[a.task_id, a], [b.task_id, b]]);
|
|
76
|
+
assert.equal(alternativeHost(a, byId, { tried: new Set(['route:Preview']), requires: ['content'] }).task_id, 'edge-main');
|
|
77
|
+
assert.equal(alternativeHost(a, byId, { tried: new Set(['route:Main']) }), null);
|
|
78
|
+
assert.equal(alternativeHost(a, byId, { inPhase: new Set(['edge-main']) }), null);
|
|
79
|
+
assert.equal(alternativeHost(a, byId, { started: (id) => id === 'edge-main' }), null);
|
|
80
|
+
// the list-row host needs `content`, which a requirement-free phase does not hold
|
|
81
|
+
assert.equal(alternativeHost(b, byId, { tried: new Set(['route:Main']), requires: [] }), null);
|
|
82
|
+
assert.equal(alternativeHost(b, byId, { tried: new Set(['route:Main']), requires: ['content'] }).task_id, 'edge-preview');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('hostsTried keeps one entry per host, with its last reason; dataPrerequisites ignores the note', () => {
|
|
86
|
+
const byId = new Map([['edge-preview', viaList()], ['edge-main', viaMain()]]);
|
|
87
|
+
const hosts = hostsTried([
|
|
88
|
+
{ task_id: 'edge-preview', outcome: 'failed', reason: 'list-item: the probing page is unverified' },
|
|
89
|
+
{ task_id: 'edge-main@host-retry:p-content', outcome: 'target-unverified' },
|
|
90
|
+
{ task_id: 'edge-preview@st-1', outcome: 'failed', reason: 'selector unavailable on non-app/empty UI' }], byId);
|
|
91
|
+
assert.deepEqual(hosts.map((h) => [h.source, h.reason]),
|
|
92
|
+
[['route:Main', 'target-unverified'], ['route:Preview', 'selector unavailable on non-app/empty UI']]);
|
|
93
|
+
const gaps = [{ id: TARGET, reason: 'needs-data:route:SelectCity (Error!); hosts tried: route:Main (x); route:Preview (y)' }];
|
|
94
|
+
assert.deepEqual(dataPrerequisites(gaps).map((g) => [g.page, g.shown]), [['route:SelectCity', 'Error!']]);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/** A Runner on phase `p-content` holding only the list-row host's task; the real emit (events to a temp dir). */
|
|
99
|
+
function runnerWith(tasks, { confirmOn }) {
|
|
100
|
+
const r = Object.create(Runner.prototype);
|
|
101
|
+
r.args = { max_tasks: 100 };
|
|
102
|
+
r.root = fs.mkdtempSync(path.join(os.tmpdir(), 'utg-hosts-'));
|
|
103
|
+
r.config = { max_task_attempts: 1, save_interval: 1e9 };
|
|
104
|
+
r.phase = { id: 'p-content', requires: [], obligations: [] }; // a probe-free phase (a probed state phase is the same)
|
|
105
|
+
r.env = 'p-content'; r.used = 0; r.stage = 'initial';
|
|
106
|
+
r.doc = { tasks, events: [] };
|
|
107
|
+
r.coverage = 'nodes'; r.covered = new Set(['route:Main']);
|
|
108
|
+
r.current = { observation_id: 'o0', nodes: [] };
|
|
109
|
+
r.save = () => {}; r.capture = () => r.current; r.runDiscovery = () => ({}); r.sweep = () => false;
|
|
110
|
+
r.sweepBacklog = () => {}; r.prepareEnvironment = () => {}; r._runFixtures = () => true; r.awaitContent = (o) => o;
|
|
111
|
+
let running = null;
|
|
112
|
+
r.source = (task) => { running = task.task_id; };
|
|
113
|
+
r.seek = (step, taskId) => r.emit('action_result', { task_id: taskId, before: 'o0', after: 'o0', action: step });
|
|
114
|
+
// the list-row host is only attested, never verified; the retry through Main lands on the target
|
|
115
|
+
r.at = (id) => id === TARGET && running === confirmOn;
|
|
116
|
+
r.attest = () => {};
|
|
117
|
+
return r;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
describe('host retry in the runner', () => {
|
|
121
|
+
test('a failure on the unverified host runs the same target through the next host, in this phase', () => {
|
|
122
|
+
const a = viaList(); a.phase = 'p-content'; const b = viaMain();
|
|
123
|
+
const tasks = annotateHosts([a, b], new Set(['route:Main']));
|
|
124
|
+
const r = runnerWith(tasks, { confirmOn: 'edge-main@host-retry:p-content' });
|
|
125
|
+
r.run();
|
|
126
|
+
const kinds = r.doc.events.map((e) => [e.kind, e.payload.task_id]);
|
|
127
|
+
const started = kinds.filter(([k]) => k === 'task_started').map(([, id]) => id);
|
|
128
|
+
assert.deepEqual(started, ['edge-preview', 'edge-main@host-retry:p-content']);
|
|
129
|
+
const retry = r.doc.events.find((e) => e.kind === 'host_retry').payload;
|
|
130
|
+
assert.equal(retry.failed_host, 'route:Preview');
|
|
131
|
+
assert.equal(retry.next_host, 'route:Main');
|
|
132
|
+
const results = r.doc.events.filter((e) => e.kind === 'task_result').map((e) => e.payload);
|
|
133
|
+
assert.deepEqual(results.map((p) => [p.task_id, p.outcome, p.source_static]), [
|
|
134
|
+
['edge-preview', 'target-unverified', 'route:Preview'],
|
|
135
|
+
['edge-main@host-retry:p-content', 'confirmed', 'route:Main']]);
|
|
136
|
+
assert.equal(results[1].host_retry_of, 'edge-preview');
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test('no alternative left: no retry, the gap stands', () => {
|
|
140
|
+
const a = viaList(); a.phase = 'p-content'; const b = viaMain();
|
|
141
|
+
const tasks = annotateHosts([a, b], new Set(['route:Main']));
|
|
142
|
+
const r = runnerWith(tasks, { confirmOn: null });
|
|
143
|
+
r.doc.events.push({ kind: 'task_started', environment_id: 'p0', payload: { task_id: 'edge-main' } });
|
|
144
|
+
r.run();
|
|
145
|
+
assert.equal(r.doc.events.filter((e) => e.kind === 'host_retry').length, 0);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
describe('compile: one trigger, several hosts', () => {
|
|
150
|
+
test('a host without a click path takes the gesture of the sibling host whose path ends with the trigger', () => {
|
|
151
|
+
const edges = [
|
|
152
|
+
{ source: 'route:Preview', target: TARGET, mechanism: 'open-overlay', trigger: TRIG },
|
|
153
|
+
{ source: 'route:Main', target: TARGET, mechanism: 'open-overlay', trigger: TRIG },
|
|
154
|
+
{ source: 'route:Main', target: TARGET, mechanism: 'open-overlay', trigger: 'onClick@x/Other.kt:3' }];
|
|
155
|
+
const last = { action: 'tap', target_id: TARGET, label_source: 'code-name', nl_hint: '点击「今天」' };
|
|
156
|
+
const ctx = { edges, edgeHints: {}, paths: { [TARGET]: { steps: [{ action: 'launch', target_id: 'route:Main' },
|
|
157
|
+
{ action: 'tap', target_id: 'route:Preview' }, last] } } };
|
|
158
|
+
assert.deepEqual(sharedTriggerStep(ctx, edges[1]), { step: last, source: 'route:Preview' });
|
|
159
|
+
assert.equal(sharedTriggerStep(ctx, edges[2]), null, 'another trigger is another view');
|
|
160
|
+
assert.equal(sharedTriggerStep(ctx, edges[0]), null, 'the path host itself needs no borrowed gesture');
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('a surface-switch step replays as a tap', () => {
|
|
164
|
+
const [step] = compileReplayStep({ action: 'surface-switch', label: 'More', target_id: 'surface:MoreSheet' }, {});
|
|
165
|
+
assert.equal(step.type, 'click_candidates');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// A container that wraps the real list is not a second list. Measured (coolmall 2026-11-28): the
|
|
2
|
+
// spec sheet's grid sits inside the sheet's own scroll container, so a `click_list_item` step failed
|
|
3
|
+
// with 「expected one list, found 2」 and Confirm (from GoodsDetail), CouponModal (from Confirm) and
|
|
4
|
+
// the order overlay tasks never ran.
|
|
5
|
+
import { test } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import { Runner, pruneNestedLists } from '../utg_explorer/task_runner.mjs';
|
|
8
|
+
|
|
9
|
+
const v = (parent, bounds, extra = {}) => ({ class: 'android.view.View', text: '', parent_index: parent,
|
|
10
|
+
visible: true, enabled: true, clickable: false, scrollable: false, bounds, ...extra });
|
|
11
|
+
|
|
12
|
+
/** A sheet: outer scroll container, the spec grid's own scroll container, 9 spec cells. */
|
|
13
|
+
function nestedSheet() {
|
|
14
|
+
const n = [v(null, [0, 0, 1080, 2400])];
|
|
15
|
+
const outer = n.push(v(0, [0, 200, 1080, 2360], { scrollable: true })) - 1;
|
|
16
|
+
const grid = n.push(v(outer, [40, 400, 1040, 2100], { scrollable: true })) - 1;
|
|
17
|
+
for (let r = 0; r < 3; r++) {
|
|
18
|
+
for (let c = 0; c < 3; c++) {
|
|
19
|
+
const top = 420 + r * 500;
|
|
20
|
+
n.push(v(grid, [40 + c * 340, top, 360 + c * 340, top + 460], { clickable: true, text: `规格${r}${c}` }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Two independent vertical lists (same page, not nested). */
|
|
27
|
+
function twoLists() {
|
|
28
|
+
const n = [v(null, [0, 0, 1080, 2400])];
|
|
29
|
+
for (const [x, y] of [[0, 100], [540, 100]]) {
|
|
30
|
+
const li = n.push(v(0, [x, y, x + 500, 2300], { scrollable: true })) - 1;
|
|
31
|
+
for (let k = 0; k < 3; k++) { n.push(v(li, [x, y + 20 + k * 500, x + 480, y + 400 + k * 500], { clickable: true, text: `行${k}` })); }
|
|
32
|
+
}
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const runner = (nodes) => { const r = Object.create(Runner.prototype); r.current = { observation_id: 'o', nodes }; return r; };
|
|
37
|
+
|
|
38
|
+
test('pruneNestedLists keeps the innermost of nested candidates and leaves independent lists alone', () => {
|
|
39
|
+
const nodes = nestedSheet();
|
|
40
|
+
assert.deepEqual(pruneNestedLists(nodes, [1, 2]), [2]);
|
|
41
|
+
const two = twoLists();
|
|
42
|
+
assert.deepEqual(pruneNestedLists(two, [1, 5]), [1, 5]);
|
|
43
|
+
assert.deepEqual(pruneNestedLists(nodes, []), []);
|
|
44
|
+
assert.deepEqual(pruneNestedLists(nodes, [2]), [2]);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('a list step on a sheet whose grid is nested in the sheet container takes a grid row', () => {
|
|
48
|
+
const r = runner(nestedSheet());
|
|
49
|
+
assert.equal(r.listCandidates().length, 1, 'probing does not try the wrapping container as another list');
|
|
50
|
+
const row = r.listItem();
|
|
51
|
+
assert.equal(row.text, '规格00', 'the first spec cell, not a container');
|
|
52
|
+
assert.deepEqual(row.bounds, [40, 420, 360, 880]);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('two independent lists still fail rather than guess one', () => {
|
|
56
|
+
const r = runner(twoLists());
|
|
57
|
+
assert.throws(() => r.listItem(), /list-item: expected one list, found 2/);
|
|
58
|
+
});
|