@buaa_smat/hometrans 26.0.3 → 26.0.4
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 +1 -1
- package/agents/code-reviewer.md +91 -21
- package/env-requirements.json +1 -1
- package/i18n/agents/code-reviewer.md +93 -21
- package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
- package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
- package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
- package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
- package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
- package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
- package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
- package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
- package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
- package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
- package/package.json +3 -6
- package/skills/a2h-app-migrate/SKILL.md +19 -11
- package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
- package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
- package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
- package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
- package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
- package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
- package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
- package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
- package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/skills/a2h-arch-generate/SKILL.md +20 -17
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
- package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
- package/skills/a2h-batch-ui-align/SKILL.md +72 -22
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
- package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
- package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
- package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
- package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
- package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
- package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
- package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
- package/skills/a2h-page-specgen/SKILL.md +124 -20
- package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
- package/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/skills/a2h-page-specgen/references/evidence.md +35 -0
- package/skills/a2h-page-specgen/references/execution-model.md +135 -26
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
- package/skills/a2h-page-specgen/references/gates.md +120 -52
- package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
- package/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/skills/a2h-page-specgen/references/spec-template.md +112 -109
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
- package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
- package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
- package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
- package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
- package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
- package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
- package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
- package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
- package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
- package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
- package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
- package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
- package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
- package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
- package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
- package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
- package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
- package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
- package/skills/a2h-resource-convert/SKILL.md +9 -1
- package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
- package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
- package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
- package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
- package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
- package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
- package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
- package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
- package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
- package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
- package/skills/a2h-spec-generate/SKILL.md +2 -2
- package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
- package/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
- package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
- package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
- package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
- package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
- package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
- package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
- package/skills/a2h-utg-static/SKILL.md +6 -2
- package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
- package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// seed_recipes: a create producer (a2h-utg-static data_producers) turned into a gated recipe phase
|
|
2
|
+
// that makes one record in its initial state and verifies it on the entity's empty list page.
|
|
3
|
+
import { test } from 'node:test';
|
|
4
|
+
import assert from 'node:assert/strict';
|
|
5
|
+
import { buildRecipes, initialRecord, preconditions, unlockedBy } from '../seed_recipes.mjs';
|
|
6
|
+
|
|
7
|
+
const MODEL = { entities: { order: { fields: { status: { values: { 0: 'unpaid' }, initial: '0' } },
|
|
8
|
+
producers: [{ kind: 'create', page: 'r:Confirm', control_text: 'Place order', vm_fn: 'onSubmit', endpoint: 'POST order/create', checks: ['addressId == null'] }] } } };
|
|
9
|
+
const need = (op, values) => [{ entity: 'order', states: { status: { op, values } } }];
|
|
10
|
+
const obs = (id, sid, texts, env = 'recD-cart') => ({ kind: 'observation', environment_id: env, payload: { observation_id: id, activity: 'A',
|
|
11
|
+
static_resolution: { status: 'verified', static_id: sid }, nodes: texts.map((text) => ({ text, visible: true })) } });
|
|
12
|
+
const DOC = {
|
|
13
|
+
nodes: [
|
|
14
|
+
{ id: 'r:Confirm', data_needs: [{ entity: 'goods', states: {} }] },
|
|
15
|
+
{ id: 'r:Goods', data_needs: [{ entity: 'goods', states: {} }] },
|
|
16
|
+
{ id: 'r:OrderList' }, { id: 'r:AddressList' },
|
|
17
|
+
{ id: 'r:CancelDialog', data_needs: need('in', ['0', '2']) },
|
|
18
|
+
{ id: 'r:Track', data_needs: need('in', ['2', '3']) },
|
|
19
|
+
{ id: 'r:Rebuy', data_needs: need('not-in', ['0', '2']) },
|
|
20
|
+
{ id: 'r:Empty', body_text: [{ text: 'No data', at: 'ui/component/empty/EmptyData.kt:3' }, { text: 'Nothing here', at: 'ui/component/empty/EmptyData.kt:4' }] },
|
|
21
|
+
],
|
|
22
|
+
page_catalog: { 'r:OrderList': { titles: ['Orders'] } },
|
|
23
|
+
tasks: [
|
|
24
|
+
{ task_id: 'buy', status: 'compiled', target_static: 'r:Confirm', replay: [{ type: 'click_candidates', selectors: [{ text: 'Buy' }], target_id: 'r:Goods' }],
|
|
25
|
+
action: { type: 'click_candidates', selectors: [{ text: 'Checkout' }] } },
|
|
26
|
+
{ task_id: 'cancel', status: 'compiled', target_static: 'r:CancelDialog', replay: [{ type: 'click_candidates', selectors: [{ text: 'My orders' }], target_id: 'r:OrderList' }],
|
|
27
|
+
action: { type: 'click_candidates', selectors: [{ text: 'Cancel order' }] } },
|
|
28
|
+
{ task_id: 'track', status: 'compiled', target_static: 'r:Track', replay: [], action: { type: 'click_candidates', selectors: [{ text: 'Track' }] } },
|
|
29
|
+
],
|
|
30
|
+
events: [
|
|
31
|
+
{ kind: 'task_result', environment_id: 'recD-cart', payload: { task_id: 'buy@recD-cart', outcome: 'confirmed' } },
|
|
32
|
+
{ kind: 'task_result', environment_id: 'recD-cart', payload: { task_id: 'buy', outcome: 'confirmed' } },
|
|
33
|
+
{ kind: 'mapping', environment_id: 'recD-cart', payload: { static_id: 'r:Confirm', observation_id: 'o1' } },
|
|
34
|
+
{ kind: 'mapping', environment_id: 'recD-cart', payload: { static_id: 'r:Goods', observation_id: 'o2' } },
|
|
35
|
+
{ kind: 'mapping', environment_id: 'recD-login', payload: { static_id: 'r:OrderList', observation_id: 'o3' } },
|
|
36
|
+
obs('o3', 'r:OrderList', ['Orders', 'No data', 'Nothing here'], 'recD-login'),
|
|
37
|
+
obs('o4', 'r:AddressList', ['Addresses', 'No data', 'Nothing here'], 'recD-login'),
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
const CONFIG = { snapshot_dir: '/snap', fixtures: { 'recD-cart': [{ type: 'restore_app_data', archive: '/snap/login.tar' }, { type: 'launch', component: 'p/A' }, { type: 'snapshot_app_data', archive: '/snap/recD-cart.tar' }, { type: 'launch', component: 'p/A' }] } };
|
|
41
|
+
const PLAN = { empty_pages: [{ page: 'r:OrderList', kind: 'data', shown: 'No data / Nothing here' }] };
|
|
42
|
+
|
|
43
|
+
test('a new record starts in its fields\' data-class defaults and unlocks only the pages that state satisfies', () => {
|
|
44
|
+
assert.deepEqual(initialRecord(MODEL, 'order'), { status: '0' });
|
|
45
|
+
const byId = new Map(DOC.nodes.map((n) => [n.id, n]));
|
|
46
|
+
assert.deepEqual(unlockedBy(['r:CancelDialog', 'r:Track', 'r:Rebuy'], byId, 'order', { status: '0' }, new Set()), ['r:CancelDialog']);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('a producer check naming an entity whose list was seen empty is an unmet precondition', () => {
|
|
50
|
+
const p = preconditions(MODEL.entities.order.producers[0], DOC);
|
|
51
|
+
assert.deepEqual(p, [{ check: 'addressId == null', entity: 'address', list_seen_empty: ['r:AddressList'], unmet: true }]);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('a check\'s entities come from the static model (check_entities), never guessed again here', () => {
|
|
55
|
+
// the static layer read "addressid" as address (Address is a record class); the explorer takes its word
|
|
56
|
+
const producer = { checks: ['addressid == null'], check_entities: [{ check: 'addressid == null', entities: ['address'] }] };
|
|
57
|
+
assert.equal(preconditions(producer, DOC)[0].entity, 'address');
|
|
58
|
+
// and an id word it did not take ("isvalid") is no entity here either
|
|
59
|
+
assert.equal(preconditions({ checks: ['!isvalid'], check_entities: [{ check: '!isvalid', entities: [] }] }, DOC)[0].entity, null);
|
|
60
|
+
// a model from before the field: the camelCase / snake suffix only
|
|
61
|
+
assert.equal(preconditions({ checks: ['addressid == null'] }, DOC)[0].entity, null);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('the recipe: base fixtures, the path to the producer page, one tap, a snapshot, the list page, a no-empty-state probe', () => {
|
|
65
|
+
const { recipes, skipped } = buildRecipes(DOC, CONFIG, MODEL, PLAN);
|
|
66
|
+
assert.deepEqual(skipped, []);
|
|
67
|
+
const r = recipes[0];
|
|
68
|
+
assert.equal(r.id, 'recS-order-status-0');
|
|
69
|
+
assert.equal(r.base, 'recD-cart');
|
|
70
|
+
assert.deepEqual(r.unlocks, ['r:CancelDialog']);
|
|
71
|
+
assert.deepEqual(r.task_ids, ['cancel']);
|
|
72
|
+
const types = r.fixtures.map((s) => s.type + (s.selectors ? `:${s.selectors[0].text}` : ''));
|
|
73
|
+
assert.deepEqual(types, ['restore_app_data', 'launch', 'launch', 'wait', 'click_candidates:My orders', 'wait', 'skip_unless',
|
|
74
|
+
'launch', 'wait', 'click_candidates:Buy', 'click_candidates:Checkout', 'click_candidates:Place order',
|
|
75
|
+
'wait', 'snapshot_app_data', 'launch', 'wait', 'click_candidates:My orders', 'wait']);
|
|
76
|
+
const g = r.fixtures.find((s) => s.type === 'skip_unless');
|
|
77
|
+
assert.deepEqual(g.rule, { any: [{ text: 'No data' }, { text: 'Nothing here' }] }, 'the record is made only while its list is empty');
|
|
78
|
+
assert.equal(g.count, 6);
|
|
79
|
+
assert.equal(r.fixtures.filter((s) => s.type === 'snapshot_app_data').length, 1, 'the base phase\'s own snapshot is replaced');
|
|
80
|
+
assert.deepEqual(r.probes, [{ any: [{ text: 'Orders' }], none: [{ text: 'No data' }, { text: 'Nothing here' }] }]);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// ---- step 3: preconditions made first through their own producer's form ----
|
|
84
|
+
import { exampleFor, formSteps } from '../seed_recipes.mjs';
|
|
85
|
+
import { Runner } from '../utg_explorer/task_runner.mjs';
|
|
86
|
+
|
|
87
|
+
test('a value the app\'s own pattern accepts', () => {
|
|
88
|
+
for (const p of [String.raw`^1[3-9]\d{9}$`, String.raw`^[a-z]+@[a-z]+\.com$`, String.raw`^(?:\+86)?1\d{10}$`, String.raw`^[A-Z]{2}\d{3,5}$`]) {
|
|
89
|
+
assert.ok(new RegExp(p).test(exampleFor(p)), p);
|
|
90
|
+
}
|
|
91
|
+
assert.equal(exampleFor('^(a|b'), null);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('form steps: typed fields, a picker through its overlay, the switch the consumer check names', () => {
|
|
95
|
+
const form = [
|
|
96
|
+
{ label: 'Contact', kind: 'text', neighbors: [null, 'Phone'] },
|
|
97
|
+
{ label: 'Phone', kind: 'text', keyboard: 'Phone', pattern: String.raw`^1\d{3}$`, neighbors: ['Contact', 'Region'] },
|
|
98
|
+
{ label: 'Region', kind: 'picker', at: 'a/F.kt:20', neighbors: ['Phone', 'Street'] },
|
|
99
|
+
{ label: 'Use first for orders', key: 'default_address_tip', kind: 'switch', neighbors: ['Street', null] },
|
|
100
|
+
{ label: 'Notify me', key: 'push_tip', kind: 'switch', neighbors: [null, null] },
|
|
101
|
+
];
|
|
102
|
+
const doc = { edges: [{ source: 'r:Form', target: 'overlay:Picker', mechanism: 'open-overlay', trigger: 'onClick@a/F.kt:31' }],
|
|
103
|
+
page_catalog: { 'overlay:Picker': { titles: ['Pick a region'] } } };
|
|
104
|
+
const s = formSteps(form, doc, 'r:Form', new Set(['default']));
|
|
105
|
+
const sig = s.map((x) => x.type + (x.value ? `=${x.value}` : '') + (x.label ? `:${x.label}` : '') + (x.selectors ? `:${x.selectors[0].text}` : ''));
|
|
106
|
+
assert.deepEqual(sig.filter((x) => !x.startsWith('wait')), ['click_candidates:Contact', 'input=Test', 'click_candidates:Phone', 'input=1000',
|
|
107
|
+
'click_candidates:Region', 'click_list_item', 'click_list_item', 'click_list_item', 'click_list_item', 'toggle_on:Use first for orders']);
|
|
108
|
+
assert.deepEqual(s.find((x) => x.type === 'click_list_item').when, { any: [{ text: 'Pick a region' }] });
|
|
109
|
+
assert.deepEqual(s[0].neighbors, [null, 'Phone']);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const node = (text, b, extra = {}) => ({ text, class: 'android.widget.TextView', visible: true, enabled: true, clickable: false, bounds: b, ...extra });
|
|
113
|
+
test('a field the screen shows only as a text-less clickable is tapped between its neighbours', () => {
|
|
114
|
+
const r = Object.create(Runner.prototype);
|
|
115
|
+
r.current = { nodes: [node('Phone', [100, 600, 300, 650]), node('', [64, 820, 1016, 990], { class: 'android.view.View', clickable: true }), node('Street', [100, 1080, 300, 1130])] };
|
|
116
|
+
assert.deepEqual(r.betweenNeighbors({ neighbors: ['Phone', 'Street'] }).type, 'click_point');
|
|
117
|
+
assert.equal(r.betweenNeighbors({ neighbors: ['Phone', 'Street'] }).y, 905);
|
|
118
|
+
assert.equal(r.betweenNeighbors({}), null, 'no neighbours named: no guessing');
|
|
119
|
+
r.current.nodes.push(node('', [64, 700, 1016, 800], { class: 'android.view.View', clickable: true }));
|
|
120
|
+
assert.equal(r.betweenNeighbors({ neighbors: ['Phone', 'Street'] }), null, 'two candidates: no guessing');
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
test('a column of same-shaped clickable rows is a list even when not flagged scrollable', async () => {
|
|
124
|
+
const { rowGroups } = await import('../utg_explorer/task_runner.mjs');
|
|
125
|
+
const v = (p, b, extra = {}) => ({ class: 'android.view.View', parent_index: p, visible: true, enabled: true, clickable: false, bounds: b, ...extra });
|
|
126
|
+
const nodes = [v(null, [0, 0, 1080, 2400]), v(0, [42, 1376, 190, 1502], { clickable: true }), v(0, [42, 1500, 1038, 2400])];
|
|
127
|
+
for (let k = 0; k < 5; k++) { nodes.push(v(2, [42, 1513 + k * 137, 1038, 1649 + k * 137], { clickable: true })); }
|
|
128
|
+
nodes.push(v(2, [42, 2198, 1038, 2260], { clickable: true }));
|
|
129
|
+
assert.deepEqual(rowGroups(nodes), [2]);
|
|
130
|
+
assert.deepEqual(rowGroups(nodes.slice(0, 5)), [], 'two rows are no list');
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('a one-row picker level is a list; a tab strip, a drag handle and a scrim are not', async () => {
|
|
134
|
+
const { rowGroups } = await import('../utg_explorer/task_runner.mjs');
|
|
135
|
+
const v = (p, b, extra = {}) => ({ class: 'android.view.View', text: '', parent_index: p, visible: true, enabled: true, clickable: false, bounds: b, ...extra });
|
|
136
|
+
const t = (p, text) => ({ class: 'android.widget.TextView', text, parent_index: p, visible: true, enabled: true, clickable: false, bounds: [0, 0, 10, 10] });
|
|
137
|
+
const nodes = [v(null, [0, 0, 1080, 2400]),
|
|
138
|
+
v(0, [0, 0, 1080, 1840], { clickable: true }), v(0, [0, 1855, 1080, 2400]), // 1 scrim, 2 sheet
|
|
139
|
+
v(2, [0, 1855, 1080, 1950]), v(3, [0, 1840, 1080, 1966], { clickable: true }), // 3/4 drag handle (no text)
|
|
140
|
+
v(2, [42, 1950, 1038, 2160]), v(5, [42, 2031, 190, 2157], { clickable: true }), t(6, 'Beijing'), // 5 tabs: narrow
|
|
141
|
+
v(5, [211, 2031, 359, 2157], { clickable: true }), t(8, 'Pick'),
|
|
142
|
+
v(2, [42, 2168, 1038, 2305]), v(10, [42, 2168, 1038, 2304], { clickable: true }), t(11, 'Beijing')]; // 10 the one-row list
|
|
143
|
+
assert.deepEqual(rowGroups(nodes), [10]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test('a precondition record is created only while its list page shows the empty state', () => {
|
|
147
|
+
const MODEL2 = { entities: { ...MODEL.entities, address: { fields: {}, producers: [{ kind: 'create', page: 'r:AddrForm', control_text: 'Save',
|
|
148
|
+
form: [{ label: 'Contact', kind: 'text', neighbors: [null, null] }] }] } } };
|
|
149
|
+
const doc = structuredClone(DOC);
|
|
150
|
+
doc.nodes.push({ id: 'r:AddrForm' });
|
|
151
|
+
doc.tasks.push({ task_id: 'addr', status: 'compiled', target_static: 'r:AddrPicker',
|
|
152
|
+
replay: [{ type: 'click_candidates', selectors: [{ text: 'Addresses' }], target_id: 'r:AddressList' }, { type: 'click_candidates', selectors: [{ text: 'New' }], target_id: 'r:AddrForm' }],
|
|
153
|
+
action: { type: 'click_candidates', selectors: [{ text: 'Region' }] } });
|
|
154
|
+
doc.events.push({ kind: 'mapping', environment_id: 'recD-login', payload: { static_id: 'r:AddrForm', observation_id: 'o5' } });
|
|
155
|
+
const { recipes } = buildRecipes(doc, CONFIG, MODEL2, PLAN);
|
|
156
|
+
const f = recipes[0].fixtures;
|
|
157
|
+
const g = f.findIndex((s, i) => s.type === 'skip_unless' && i > f.findIndex((x) => x.type === 'skip_unless'));
|
|
158
|
+
assert.ok(g > 0, 'the precondition guard sits inside the record guard');
|
|
159
|
+
assert.deepEqual(f[g - 2].selectors[0], { text: 'Addresses' }, 'the guard stands on the list page');
|
|
160
|
+
assert.deepEqual(f[g].rule, { any: [{ text: 'No data' }, { text: 'Nothing here' }] });
|
|
161
|
+
const guarded = f.slice(g + 1, g + 1 + f[g].count).map((s) => s.selectors?.[0]?.text ?? s.type);
|
|
162
|
+
assert.deepEqual(guarded, ['New', 'wait', 'Contact', 'input', 'Save', 'wait']);
|
|
163
|
+
assert.deepEqual(recipes[0].made_first.map((m) => m.made), [true]);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('a scheduled task\'s taps are adapted to the record the recipe makes', async () => {
|
|
167
|
+
const { adaptTask } = await import('../seed_recipes.mjs');
|
|
168
|
+
const node = { data_requirements: [
|
|
169
|
+
{ entity: 'order', kind: 'state', field: 'status', op: 'in', values: ['4'], step: 4, via: 'tap "Completed" at step 4' },
|
|
170
|
+
{ entity: 'order', kind: 'state', field: 'status', op: 'in', values: ['0'], step: 5, via: 'tap "Cancel" at step 5' },
|
|
171
|
+
{ entity: 'order', kind: 'state', field: 'status', op: 'in', values: ['2'], step: 5, via: 'tap "Received" at step 5' }] };
|
|
172
|
+
const model = { entities: { order: { fields: { status: { values: { 0: 'Unpaid', 4: 'Completed' } } } } } };
|
|
173
|
+
const t = { replay: [{ type: 'click_candidates', selectors: [{ text: 'Orders' }], static_label: 'Orders' },
|
|
174
|
+
{ type: 'click_candidates', selectors: [{ text: 'Completed' }], static_label: 'Completed' }],
|
|
175
|
+
action: { type: 'click_candidates', selectors: [{ text: 'Received' }], static_label: 'Received' } };
|
|
176
|
+
const ov = adaptTask(t, node, 'order', { status: '0' }, model);
|
|
177
|
+
assert.deepEqual(ov.replay.map((s) => s.static_label), ['Orders', 'Unpaid'], 'the card is opened by the label of the record\'s state');
|
|
178
|
+
assert.equal(ov.action.static_label, 'Cancel', 'the alternative the record satisfies');
|
|
179
|
+
const model2 = { entities: { order: { fields: { status: { values: { 0: 'Unpaid', 2: 'Shipped', 4: 'Completed' } } } } } };
|
|
180
|
+
const ov2 = adaptTask(t, node, 'order', { status: '2' }, model2);
|
|
181
|
+
assert.equal(ov2.replay[1].static_label, 'Shipped');
|
|
182
|
+
assert.equal(ov2.action, t.action, 'a control the record already shows is kept');
|
|
183
|
+
assert.equal(adaptTask(t, node, 'order', { status: '2' }, model), null, 'no label for the state and no alternative: left as compiled');
|
|
184
|
+
assert.equal(adaptTask({ replay: [], action: { static_label: 'Cancel' } }, node, 'order', { status: '0' }, model), null, 'nothing to change');
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test('instances of one template matched alike are settled by their opener', async () => {
|
|
188
|
+
const { buildCatalog, resolveTwinByOpener } = await import('../utg_explorer/semantics.mjs');
|
|
189
|
+
const graph = { nodes: [{ id: 'r:List', kind: 'compose-route' }, { id: 'r:Detail', kind: 'compose-route' },
|
|
190
|
+
{ id: 'overlay:Pick@a:1', kind: 'sheet', template_of: 'overlay:Pick' }, { id: 'overlay:Pick@b:2', kind: 'sheet', template_of: 'overlay:Pick' }],
|
|
191
|
+
links: [{ source: 'r:List', target: 'overlay:Pick@a:1' }, { source: 'r:Detail', target: 'overlay:Pick@b:2' }] };
|
|
192
|
+
const cat = buildCatalog(graph);
|
|
193
|
+
const amb = { status: 'ambiguous', candidates: [{ static_id: 'overlay:Pick@a:1', reason: 'overlay-lead-title-alone' },
|
|
194
|
+
{ static_id: 'overlay:Pick@b:2', reason: 'overlay-lead-title-alone' }] };
|
|
195
|
+
const r = resolveTwinByOpener(amb, { static_resolution: { status: 'verified', static_id: 'r:Detail' } }, cat);
|
|
196
|
+
assert.equal(r.status, 'verified'); assert.equal(r.static_id, 'overlay:Pick@b:2');
|
|
197
|
+
const g2 = structuredClone(graph); delete g2.nodes[3].template_of;
|
|
198
|
+
assert.equal(resolveTwinByOpener(amb, { static_resolution: { status: 'verified', static_id: 'r:Detail' } }, buildCatalog(g2)).status, 'ambiguous', 'not one template: untouched');
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
test('a precondition whose path skips its list page is guarded by visiting that page first', () => {
|
|
202
|
+
const MODEL2 = { entities: { ...MODEL.entities, address: { fields: {}, producers: [{ kind: 'create', page: 'r:AddrForm', control_text: 'Save',
|
|
203
|
+
form: [{ label: 'Contact', kind: 'text', neighbors: [null, null] }] }] } } };
|
|
204
|
+
const doc = structuredClone(DOC);
|
|
205
|
+
doc.nodes.push({ id: 'r:AddrForm' });
|
|
206
|
+
// the form is reached straight from Me, never through the address list
|
|
207
|
+
doc.tasks.push({ task_id: 'addr', status: 'compiled', target_static: 'r:AddrForm', replay: [{ type: 'click_candidates', selectors: [{ text: 'Me' }], target_id: 'r:Me' }],
|
|
208
|
+
action: { type: 'click_candidates', selectors: [{ text: 'New address' }] } });
|
|
209
|
+
doc.tasks.push({ task_id: 'alist', status: 'compiled', target_static: 'r:AddressList', replay: [], action: { type: 'click_candidates', selectors: [{ text: 'Addresses' }] } });
|
|
210
|
+
doc.events.push({ kind: 'task_result', environment_id: 'recD-login', payload: { task_id: 'addr', outcome: 'confirmed' } },
|
|
211
|
+
{ kind: 'task_result', environment_id: 'recD-login', payload: { task_id: 'alist', outcome: 'confirmed' } });
|
|
212
|
+
const { recipes } = buildRecipes(doc, CONFIG, MODEL2, PLAN);
|
|
213
|
+
const f = recipes[0].fixtures;
|
|
214
|
+
const guards = f.map((s, i) => [s, i]).filter(([s]) => s.type === 'skip_unless').map(([, i]) => i);
|
|
215
|
+
assert.equal(guards.length, 2, 'the record guard and the precondition guard');
|
|
216
|
+
const g = guards[1];
|
|
217
|
+
assert.deepEqual(f[g - 2].selectors[0], { text: 'Addresses' }, 'the precondition guard stands on the address list');
|
|
218
|
+
const guarded = f.slice(g + 1, g + 1 + f[g].count).map((s) => s.selectors?.[0]?.text ?? s.type);
|
|
219
|
+
assert.ok(guarded.includes('Save'), 'the address is created only inside the guard');
|
|
220
|
+
assert.deepEqual(recipes[0].made_first.map((m) => m.made), [true]);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test('a precondition with no reachable list page is not created (a rerun could not tell it was made)', () => {
|
|
224
|
+
const MODEL2 = { entities: { ...MODEL.entities, address: { fields: {}, producers: [{ kind: 'create', page: 'r:AddrForm', control_text: 'Save', form: [] }] } } };
|
|
225
|
+
const doc = structuredClone(DOC);
|
|
226
|
+
doc.nodes.push({ id: 'r:AddrForm' });
|
|
227
|
+
doc.tasks.push({ task_id: 'addr', status: 'compiled', target_static: 'r:AddrForm', replay: [], action: { type: 'click_candidates', selectors: [{ text: 'New address' }] } });
|
|
228
|
+
doc.events.push({ kind: 'task_result', environment_id: 'recD-login', payload: { task_id: 'addr', outcome: 'confirmed' } });
|
|
229
|
+
const { recipes } = buildRecipes(doc, CONFIG, MODEL2, PLAN);
|
|
230
|
+
assert.equal(recipes[0].fixtures.filter((s) => s.selectors?.[0]?.text === 'Save').length, 0);
|
|
231
|
+
assert.match(recipes[0].made_first[0].why, /no reachable list page of address/);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
test('apply refreshes an already scheduled recipe phase: guarded fixtures, probes and the writes_data flag', async () => {
|
|
235
|
+
const fs = await import('node:fs'); const os = await import('node:os'); const path = await import('node:path');
|
|
236
|
+
const { apply } = await import('../seed_recipes.mjs');
|
|
237
|
+
const td = fs.mkdtempSync(path.join(os.tmpdir(), 'seedrefresh-'));
|
|
238
|
+
try {
|
|
239
|
+
fs.mkdirSync(path.join(td, 'static'));
|
|
240
|
+
const doc = { ...structuredClone(DOC), static_utg: path.join(td, 'static', 'utg.json'), phases: [{ id: 'recS-order-status-0', status: 'done' }] };
|
|
241
|
+
fs.writeFileSync(path.join(td, 'campaign.json'), JSON.stringify(doc));
|
|
242
|
+
fs.writeFileSync(path.join(td, 'static', 'data_model.json'), JSON.stringify(MODEL));
|
|
243
|
+
fs.writeFileSync(path.join(td, 'data_seed_plan.json'), JSON.stringify(PLAN));
|
|
244
|
+
// the old, unguarded fixtures an earlier version scheduled
|
|
245
|
+
fs.writeFileSync(path.join(td, 'config.json'), JSON.stringify({ ...CONFIG, allow_data_writes: true,
|
|
246
|
+
fixtures: { ...CONFIG.fixtures, 'recS-order-status-0': [{ type: 'launch' }, { type: 'click_candidates', selectors: [{ text: 'Place order' }] }] } }));
|
|
247
|
+
const [phases, report] = apply(td, path.join(td, 'config.json'));
|
|
248
|
+
assert.deepEqual(phases, ['recS-order-status-0']);
|
|
249
|
+
assert.equal(report.recipes[0].refreshed, true);
|
|
250
|
+
const cfg = JSON.parse(fs.readFileSync(path.join(td, 'config.json'), 'utf8'));
|
|
251
|
+
assert.ok(cfg.fixtures['recS-order-status-0'].some((s) => s.type === 'skip_unless'), 'the guarded fixtures replace the old ones');
|
|
252
|
+
assert.ok(cfg.phase_probes['recS-order-status-0'].length);
|
|
253
|
+
const camp = JSON.parse(fs.readFileSync(path.join(td, 'campaign.json'), 'utf8'));
|
|
254
|
+
assert.equal(camp.phases[0].writes_data, true);
|
|
255
|
+
// the phase's tasks follow the recipe: the page it unlocks now gets its task, and the phase runs again
|
|
256
|
+
assert.deepEqual(camp.tasks.filter((t) => t.phase === 'recS-order-status-0').map((t) => t.task_id), ['cancel@recS-order-status-0']);
|
|
257
|
+
assert.equal(report.recipes[0].tasks_added, 1);
|
|
258
|
+
assert.equal(camp.phases[0].status, 'pending');
|
|
259
|
+
assert.equal(camp.phases[0].task_count, 1);
|
|
260
|
+
} finally { fs.rmSync(td, { recursive: true, force: true }); }
|
|
261
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagnostics.mjs — failure classes that are not coverage gaps of a page, shared by task_runner
|
|
3
|
+
* (which names them while a phase runs) and report (which lists them, for old campaigns too).
|
|
4
|
+
*
|
|
5
|
+
* Collapsed phase: one replay prefix that failed, and the prefix memo failing every other task
|
|
6
|
+
* behind it without running it. Measured (coolmall 2026-11-15): a first-run hop (Guide "Skip")
|
|
7
|
+
* that was no longer shown failed at replay step 0 in the first round and in all 7 recovery
|
|
8
|
+
* phases; the report listed some 30 `selector-not-found` gaps and never said that each phase had
|
|
9
|
+
* run one task. A collapse is an explorer fault to fix, not a page to review.
|
|
10
|
+
*
|
|
11
|
+
* Empty state: a selector or list row that is missing because the page shows its own empty-state
|
|
12
|
+
* component (no orders, no coupons), not because the path is wrong. Measured (coolmall
|
|
13
|
+
* 2026-11-16): the order list showed "No data" and 14 pages behind "Completed" failed as
|
|
14
|
+
* selector-not-found; the remedy is test data, which a selector review cannot give. The empty
|
|
15
|
+
* components come from the static pass's own body texts (their `at` file lies in an `empty`
|
|
16
|
+
* component: `component/empty/EmptyData.kt`, `layout/view_empty.xml`), never from app vocabulary.
|
|
17
|
+
*
|
|
18
|
+
* Exports: COLLAPSE_MIN_CASCADE, collapsedPrefixes, collapseNote, EMPTY_AT_RE, emptyStateComponents,
|
|
19
|
+
* emptyStateShown
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** Tasks failed through one root's prefix before a phase counts as collapsed. */
|
|
23
|
+
export const COLLAPSE_MIN_CASCADE = 3;
|
|
24
|
+
|
|
25
|
+
const verifiedId = (o) => {
|
|
26
|
+
const r = (o && o.static_resolution) || {};
|
|
27
|
+
return r.status === 'verified' ? r.static_id : null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* collapsedPrefixes(events, tasksById, { env, min }): the roots whose failed prefix the memo
|
|
32
|
+
* reused for at least `min` other tasks, per environment:
|
|
33
|
+
* [{ environment_id, root_task, replay_index, step_label, page, reason, cascaded, targets }].
|
|
34
|
+
* `step_label` is the root task's replay step at `replay_index`; `page` the screen it failed on.
|
|
35
|
+
*/
|
|
36
|
+
export function collapsedPrefixes(events, tasksById, { env = null, min = COLLAPSE_MIN_CASCADE } = {}) {
|
|
37
|
+
const pageOf = new Map();
|
|
38
|
+
for (const e of events) {
|
|
39
|
+
if (e.kind === 'mapping' && e.payload) { pageOf.set(e.payload.observation_id, e.payload.static_id); }
|
|
40
|
+
else if (e.kind === 'observation' && e.payload && verifiedId(e.payload)) { pageOf.set(e.payload.observation_id, verifiedId(e.payload)); }
|
|
41
|
+
}
|
|
42
|
+
const groups = new Map();
|
|
43
|
+
for (const e of events) {
|
|
44
|
+
if (e.kind !== 'task_result' || !e.payload || !e.payload.prefix_failed_from) { continue; }
|
|
45
|
+
if (env !== null && e.environment_id !== env) { continue; }
|
|
46
|
+
const p = e.payload;
|
|
47
|
+
const k = JSON.stringify([e.environment_id, p.prefix_failed_from, p.replay_index ?? null]);
|
|
48
|
+
if (!groups.has(k)) {
|
|
49
|
+
groups.set(k, { environment_id: e.environment_id, root_task: p.prefix_failed_from, replay_index: p.replay_index ?? null,
|
|
50
|
+
reason: p.reason ?? null, observation_id: p.observation_id ?? null, targets: [] });
|
|
51
|
+
}
|
|
52
|
+
groups.get(k).targets.push(p.target_static);
|
|
53
|
+
}
|
|
54
|
+
const out = [];
|
|
55
|
+
for (const g of groups.values()) {
|
|
56
|
+
if (g.targets.length < min) { continue; }
|
|
57
|
+
const root = tasksById.get(String(g.root_task)) || tasksById.get(String(g.root_task).split('@')[0]) || {};
|
|
58
|
+
const step = Number.isInteger(g.replay_index) ? ((root.replay || [])[g.replay_index] || {}) : {};
|
|
59
|
+
out.push({ environment_id: g.environment_id, root_task: g.root_task, replay_index: g.replay_index,
|
|
60
|
+
step_label: step.static_label ?? step.type ?? null, page: pageOf.get(g.observation_id) ?? null,
|
|
61
|
+
reason: g.reason, cascaded: g.targets.length, targets: [...new Set(g.targets)].sort() });
|
|
62
|
+
}
|
|
63
|
+
return out.sort((a, b) => b.cascaded - a.cascaded || String(a.environment_id).localeCompare(String(b.environment_id)));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** One line naming a collapse: `19 tasks failed with <root> at replay step 0 "Skip" on <page>`. */
|
|
67
|
+
export function collapseNote(c) {
|
|
68
|
+
const step = c.replay_index === null ? 'its prefix' : `replay step ${c.replay_index}${c.step_label ? ` "${c.step_label}"` : ''}`;
|
|
69
|
+
return `${c.cascaded} tasks failed with ${c.root_task} at ${step}${c.page ? ` on ${c.page}` : ''} (${c.reason ?? 'failed'})`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** An `at` that lies in an empty-state component: a dir, file or layout named empty*. */
|
|
73
|
+
export const EMPTY_AT_RE = /(?:^|[\\/_.-])empty/i;
|
|
74
|
+
/** Of those, the ones that stand for a failed load (network / error), not for missing data. */
|
|
75
|
+
const NETWORK_AT_RE = /network|offline|error|fail/i;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* emptyStateComponents(nodes): Map component file -> { kind: 'data' | 'network', texts: Set } from
|
|
79
|
+
* the static nodes' body texts (`{ text, at: 'path/File.kt:23' }`) whose `at` is an empty component.
|
|
80
|
+
*/
|
|
81
|
+
export function emptyStateComponents(nodes) {
|
|
82
|
+
const out = new Map();
|
|
83
|
+
for (const n of nodes || []) {
|
|
84
|
+
for (const b of (n && n.body_text) || []) {
|
|
85
|
+
const at = String((b && b.at) || '');
|
|
86
|
+
const text = String((b && b.text) || '').trim();
|
|
87
|
+
if (!text || !EMPTY_AT_RE.test(at.replace(/:\d+$/, ''))) { continue; }
|
|
88
|
+
const file = at.replace(/:\d+$/, '');
|
|
89
|
+
if (!out.has(file)) { out.set(file, { kind: NETWORK_AT_RE.test(file.split(/[\\/]/).pop()) ? 'network' : 'data', texts: new Set() }); }
|
|
90
|
+
out.get(file).texts.add(text);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* emptyStateShown(observation, components): the empty component the screen shows, or null. The
|
|
98
|
+
* component with the most of its texts visible wins; it needs two of them (all, when it has one),
|
|
99
|
+
* so a lone shared word ("Reload" is in both the data and the network component) decides nothing.
|
|
100
|
+
* -> { kind, file, texts: [shown texts] }
|
|
101
|
+
*/
|
|
102
|
+
export function emptyStateShown(observation, components) {
|
|
103
|
+
if (!components || !components.size) { return null; }
|
|
104
|
+
const shown = new Set();
|
|
105
|
+
for (const n of (observation && observation.nodes) || []) {
|
|
106
|
+
if (n && n.visible === false) { continue; }
|
|
107
|
+
for (const t of [n && n.text, n && (n.content_desc ?? n['content-desc'])]) { if (t && String(t).trim()) { shown.add(String(t).trim()); } }
|
|
108
|
+
}
|
|
109
|
+
let best = null;
|
|
110
|
+
for (const [file, c] of components) {
|
|
111
|
+
const hits = [...c.texts].filter((t) => shown.has(t));
|
|
112
|
+
if (hits.length < Math.min(2, c.texts.size)) { continue; }
|
|
113
|
+
if (!best || hits.length > best.texts.length) { best = { kind: c.kind, file, texts: hits.sort() }; }
|
|
114
|
+
}
|
|
115
|
+
return best;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Does a value satisfy a state predicate { op: 'in'|'not-in', values }? */
|
|
119
|
+
const satisfies = (pred, v) => (pred.op === 'in' ? pred.values.includes(v) : !pred.values.includes(v));
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* seedPlan(gaps, nodesById, model): the fewest records to seed so every uncovered page's data needs
|
|
123
|
+
* hold (a2h-utg-static data_model `data_needs`: per entity, one predicate per field), chosen greedily:
|
|
124
|
+
* each pick is the entity / field / value that satisfies the most remaining page constraints.
|
|
125
|
+
* Pages needing only an instance (any state) are satisfied by any record of that entity.
|
|
126
|
+
* gaps [{ id, reason }] the report's uncovered nodes
|
|
127
|
+
* nodesById Map id -> static node (with data_needs, data_path_conflicts)
|
|
128
|
+
* model data_model.json or null (value labels and data sources, for the report)
|
|
129
|
+
* present entities the run already saw a record of (a covered page that needs one): their
|
|
130
|
+
* instance-only needs are met, so no "any state" record is asked for
|
|
131
|
+
* -> { seeds: [{ entity, field?, value?, label?, unlocks: [id] }], conflicts: [{ id, ... }],
|
|
132
|
+
* unseeded: [{ entity, field, op, values, ids }] (constraints no known value satisfies) }
|
|
133
|
+
*/
|
|
134
|
+
export function seedPlan(gaps, nodesById, model = null, present = new Set()) {
|
|
135
|
+
const pending = [];
|
|
136
|
+
for (const g of gaps) {
|
|
137
|
+
const needs = (nodesById.get(g.id) || {}).data_needs;
|
|
138
|
+
if (!Array.isArray(needs) || !needs.length) { continue; }
|
|
139
|
+
for (const n of needs) {
|
|
140
|
+
const fields = Object.entries(n.states || {});
|
|
141
|
+
if (!fields.length) { if (!present.has(n.entity)) { pending.push({ id: g.id, entity: n.entity, field: null }); } continue; }
|
|
142
|
+
for (const [field, pred] of fields) { pending.push({ id: g.id, entity: n.entity, field, pred }); }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const labelOf = (e, f, v) => model?.entities?.[e]?.fields?.[f]?.values?.[v] ?? null;
|
|
146
|
+
const domain = (e, f) => {
|
|
147
|
+
const vs = new Set(Object.keys(model?.entities?.[e]?.fields?.[f]?.values || {}));
|
|
148
|
+
for (const c of pending) { if (c.entity === e && c.field === f) { for (const v of c.pred.values) { vs.add(v); } } }
|
|
149
|
+
return [...vs].sort((a, b) => (Number.isNaN(+a) || Number.isNaN(+b) ? a.localeCompare(b) : +a - +b));
|
|
150
|
+
};
|
|
151
|
+
const seeds = []; let open = pending.filter((c) => c.field);
|
|
152
|
+
for (;;) {
|
|
153
|
+
let best = null;
|
|
154
|
+
for (const key of new Set(open.map((c) => `${c.entity}\u0000${c.field}`))) {
|
|
155
|
+
const [e, f] = key.split('\u0000');
|
|
156
|
+
for (const v of domain(e, f)) {
|
|
157
|
+
const hit = open.filter((c) => c.entity === e && c.field === f && satisfies(c.pred, v));
|
|
158
|
+
if (hit.length && (!best || hit.length > best.hit.length)) { best = { e, f, v, hit }; }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!best) { break; }
|
|
162
|
+
seeds.push({ entity: best.e, field: best.f, value: best.v, label: labelOf(best.e, best.f, best.v), unlocks: [...new Set(best.hit.map((c) => c.id))].sort() });
|
|
163
|
+
open = open.filter((c) => !best.hit.includes(c));
|
|
164
|
+
}
|
|
165
|
+
const unseeded = [];
|
|
166
|
+
for (const c of open) {
|
|
167
|
+
const u = unseeded.find((x) => x.entity === c.entity && x.field === c.field && x.op === c.pred.op && JSON.stringify(x.values) === JSON.stringify(c.pred.values));
|
|
168
|
+
if (u) { u.ids.push(c.id); } else { unseeded.push({ entity: c.entity, field: c.field, op: c.pred.op, values: c.pred.values, ids: [c.id] }); }
|
|
169
|
+
}
|
|
170
|
+
// instance-only needs: met by any seeded record of the entity, else one record in any state
|
|
171
|
+
for (const c of pending.filter((x) => !x.field)) {
|
|
172
|
+
const s = seeds.find((x) => x.entity === c.entity);
|
|
173
|
+
if (s) { if (!s.unlocks.includes(c.id)) { s.unlocks.push(c.id); s.unlocks.sort(); } continue; }
|
|
174
|
+
let any = seeds.find((x) => x.entity === c.entity && x.field === undefined);
|
|
175
|
+
if (!any) { any = { entity: c.entity, unlocks: [] }; seeds.push(any); }
|
|
176
|
+
if (!any.unlocks.includes(c.id)) { any.unlocks.push(c.id); }
|
|
177
|
+
}
|
|
178
|
+
const conflicts = gaps.filter((g) => (nodesById.get(g.id) || {}).data_path_conflicts)
|
|
179
|
+
.map((g) => ({ id: g.id, conflicts: nodesById.get(g.id).data_path_conflicts }));
|
|
180
|
+
return { seeds, conflicts, unseeded };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Entities a covered page needs an instance of: the run saw such a record, so it exists. */
|
|
184
|
+
export function presentEntities(mappedIds, nodesById) {
|
|
185
|
+
const out = new Set();
|
|
186
|
+
for (const id of mappedIds) {
|
|
187
|
+
for (const n of (nodesById.get(id) || {}).data_needs || []) { out.add(n.entity); }
|
|
188
|
+
}
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** One line per seed, for report.md: `order.status = 2 (Awaiting receipt): unlocks 5: a, b, ...`. */
|
|
193
|
+
export function seedNote(s) {
|
|
194
|
+
const what = s.field === undefined ? `${s.entity} (any state)` : `${s.entity}.${s.field} = ${s.value}${s.label ? ` (${s.label})` : ''}`;
|
|
195
|
+
return `${what}: unlocks ${s.unlocks.length}: ${s.unlocks.join(', ')}`;
|
|
196
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hybrid_route.mjs — shared helpers for uni-app / hybrid page capture.
|
|
3
|
+
*
|
|
4
|
+
* A uni-app page is not an Android Activity: every page lives in one WebView host, so the
|
|
5
|
+
* Activity-based direct-launch fallback cannot reach it. The equivalent first-class action is a
|
|
6
|
+
* route jump through the page WebView (`uni.reLaunch` / `uni.switchTab`), handled by
|
|
7
|
+
* DeviceAdapter's `route` action (hybrid_route_cdp.mjs). These helpers keep task/phase creation
|
|
8
|
+
* consistent between compile_tasks.mjs and direct_launch.mjs.
|
|
9
|
+
*/
|
|
10
|
+
import { get, truthy, pyStr, sha256Hex } from './_py.mjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Routes declared under a components/modules/static folder are building blocks, not pages. A
|
|
14
|
+
* leading `modules/` is not counted: it is usually a subPackage root (the whole package), and only
|
|
15
|
+
* a2h-utg-static knows the root (uniapp_nav.mjs isComponentRoute).
|
|
16
|
+
*/
|
|
17
|
+
export const COMPONENT_ROUTE_RE = /(?:^|\/)(?:components?|static)(?:\/|$)|\/modules?(?:\/|$)/;
|
|
18
|
+
|
|
19
|
+
/** A static node that can be captured by a uni-app route jump. */
|
|
20
|
+
export function isHybridPageNode(n) {
|
|
21
|
+
return get(n, 'kind') === 'hybrid-page' && truthy(get(n, 'route'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A route under pages/components, a subpackage's modules folder, or a static component folder is
|
|
26
|
+
* a component/overlay entry in pages.json, not an independently navigable page. It stays in the
|
|
27
|
+
* graph (its edges may explain a parent page) but is out of the coverage denominator. This is the
|
|
28
|
+
* fallback for a graph without a2h-utg-static's verdict; no leaf-name rule (popup / dialog /
|
|
29
|
+
* picker): uni-app opens such registered pages with navigateTo.
|
|
30
|
+
*/
|
|
31
|
+
export function isComponentRoute(route) {
|
|
32
|
+
const r = pyStr(route).replace(/^\/+/, '');
|
|
33
|
+
return COMPONENT_ROUTE_RE.test(r);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A hybrid component/overlay route entry that has no screen of its own: a2h-utg-static marks it
|
|
38
|
+
* `non_navigable` (uniapp_nav.mjs); an older graph without the marker falls back to the route
|
|
39
|
+
* heuristic. Native denominator:false nodes (host activities, embedded fragments, shells, dialogs)
|
|
40
|
+
* are NOT non-navigable: their edges still carry click obligations. plan.mjs drops the edges of
|
|
41
|
+
* exactly these nodes and audit.mjs takes exactly these edges out of the denominator.
|
|
42
|
+
*/
|
|
43
|
+
export function isNonNavigable(n) {
|
|
44
|
+
const v = get(n, 'non_navigable');
|
|
45
|
+
if (v === true || v === false) { return v; } // a2h-utg-static's verdict
|
|
46
|
+
// A hybrid page the static layer took out of the denominator is a component entry too (no
|
|
47
|
+
// native node kind: those keep their edges).
|
|
48
|
+
if (get(n, 'kind') === 'hybrid-page' && (get(n, 'denominator') === false || truthy(get(n, 'out_of_scope')))) { return true; }
|
|
49
|
+
return isHybridPageNode(n) && isComponentRoute(get(n, 'route'));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Deterministic id shared by compile_tasks and direct_launch (so a recompile never duplicates). */
|
|
53
|
+
export function routeTaskId(route) {
|
|
54
|
+
return 'route-' + sha256Hex(Buffer.from(pyStr(route), 'utf8')).slice(0, 16);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** '/' + normalized route. */
|
|
58
|
+
export function routeUrl(route) {
|
|
59
|
+
const r = pyStr(route).replace(/^\/+/, '');
|
|
60
|
+
return '/' + r;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The runner action for a page route. */
|
|
64
|
+
export function routeAction(node) {
|
|
65
|
+
return { type: 'route', url: routeUrl(get(node, 'route')), api: 'reLaunch', appid: get(node, 'appid') };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** A task that reaches `node` with a direct route jump, independent of any in-app click path. */
|
|
69
|
+
export function routeTask(node, phaseId, opts = {}) {
|
|
70
|
+
const route = pyStr(get(node, 'route')).replace(/^\/+/, '');
|
|
71
|
+
const expected = {};
|
|
72
|
+
const src = get(node, 'expected');
|
|
73
|
+
if (src && typeof src === 'object' && !Array.isArray(src)) {
|
|
74
|
+
for (const k of Object.keys(src)) { expected[k] = src[k]; }
|
|
75
|
+
}
|
|
76
|
+
if (get(node, 'kind') !== undefined) { expected.kind = get(node, 'kind'); }
|
|
77
|
+
if (get(node, 'label') !== undefined) { expected.label = get(node, 'label'); }
|
|
78
|
+
if (get(node, 'aliases') !== undefined) { expected.aliases = get(node, 'aliases'); }
|
|
79
|
+
return {
|
|
80
|
+
task_id: routeTaskId(route),
|
|
81
|
+
phase: phaseId,
|
|
82
|
+
environment_id: pyStr(get(opts, 'environment_id', 'default')),
|
|
83
|
+
source_static: get(node, 'id'),
|
|
84
|
+
source_context: null,
|
|
85
|
+
target_static: get(node, 'id'),
|
|
86
|
+
target_expected: expected,
|
|
87
|
+
requires: [...(get(opts, 'requires', []) || [])],
|
|
88
|
+
purpose: 'route-launch',
|
|
89
|
+
source_launch: null,
|
|
90
|
+
replay: [],
|
|
91
|
+
prelude: [],
|
|
92
|
+
task_preconditions: [],
|
|
93
|
+
action: routeAction(node),
|
|
94
|
+
status: 'compiled',
|
|
95
|
+
compile_issues: [],
|
|
96
|
+
provenance: { hybrid_route: { route, reason: pyStr(get(opts, 'reason',
|
|
97
|
+
'uni-app page: direct route jump (uni.reLaunch); no clickable static trigger required')) } },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Group hybrid nodes into requirement-free `p0-routes*` phases (chunked so a runner's
|
|
103
|
+
* max-tasks cap never starves them) and register the phases in `doc`. Returns [{id, nodes}].
|
|
104
|
+
*/
|
|
105
|
+
export function ensureRoutePhases(doc, nodes, perPhase = 80) {
|
|
106
|
+
const want = [];
|
|
107
|
+
const seen = new Set();
|
|
108
|
+
for (const n of nodes) {
|
|
109
|
+
if (!isHybridPageNode(n)) { continue; }
|
|
110
|
+
if (get(n, 'denominator') === false || get(n, 'out_of_scope') || get(n, 'status') === 'unreachable') { continue; }
|
|
111
|
+
// Older static graphs predate the denominator flag: still refuse component/overlay routes.
|
|
112
|
+
if (isNonNavigable(n)) { continue; }
|
|
113
|
+
const id = pyStr(get(n, 'id'));
|
|
114
|
+
if (seen.has(id)) { continue; }
|
|
115
|
+
seen.add(id);
|
|
116
|
+
want.push(n);
|
|
117
|
+
}
|
|
118
|
+
if (!want.length) { return []; }
|
|
119
|
+
want.sort((a, b) => pyStr(get(a, 'route')).localeCompare(pyStr(get(b, 'route'))));
|
|
120
|
+
const size = Math.max(1, Number(perPhase) || 80);
|
|
121
|
+
const phases = get(doc, 'phases', []);
|
|
122
|
+
if (!Array.isArray(phases)) { doc.phases = []; }
|
|
123
|
+
const list = doc.phases;
|
|
124
|
+
const out = [];
|
|
125
|
+
let maxOrder = list.reduce((m, p) => Math.max(m, Number(get(p, 'order', 0)) || 0), 0);
|
|
126
|
+
const idFor = (j) => (j === 0 ? 'p0-routes' : `p0-routes-${j + 1}`);
|
|
127
|
+
for (let i = 0, j = 0; i < want.length; i += size, j += 1) {
|
|
128
|
+
const chunk = want.slice(i, i + size);
|
|
129
|
+
const id = idFor(j);
|
|
130
|
+
let phase = list.find((p) => pyStr(get(p, 'id')) === id) || null;
|
|
131
|
+
if (phase === null) {
|
|
132
|
+
maxOrder += 1;
|
|
133
|
+
phase = { id, order: maxOrder, environment: 'default', requires: [], depends_on: [],
|
|
134
|
+
obligations: [], status: 'pending' };
|
|
135
|
+
list.push(phase);
|
|
136
|
+
}
|
|
137
|
+
out.push({ id, nodes: chunk, environment: pyStr(get(phase, 'environment', 'default')), requires: [] });
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|