@buaa_smat/hometrans 26.0.1 → 26.0.3
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 +14 -7
- package/agents/code-reviewer.md +25 -138
- package/dist/cli/index.js +4 -1
- package/dist/cli/init.js +131 -26
- package/dist/cli/uninstall.js +5 -5
- package/dist/platform/language.js +77 -0
- package/env-requirements.json +30 -5
- package/i18n/FILE-NAMES.md +9 -0
- package/i18n/agents/code-reviewer.md +364 -0
- package/i18n/agents/model-render-worker.md +38 -0
- package/i18n/agents/specgen-worker.md +18 -0
- package/i18n/commands/hometrans.md +17 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +198 -0
- package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +50 -0
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +1760 -0
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1588 -0
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +657 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
- package/i18n/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/i18n/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/i18n/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/i18n/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/i18n/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/i18n/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +171 -0
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/i18n/skills/a2h-arch-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/i18n/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/i18n/skills/a2h-arch-generate/references/arkts-mvvm-v2.md +1407 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/i18n/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/i18n/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/i18n/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +360 -0
- package/i18n/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +798 -0
- package/i18n/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/generate.mjs +639 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1261 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +851 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +982 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +9 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +192 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +303 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/move_spec_technical_reference.mjs +162 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +298 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +587 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +323 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +80 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +87 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +57 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +705 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +417 -0
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2549 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +560 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +148 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +220 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +28 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +216 -0
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +203 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +210 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1748 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1787 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1836 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/image_probe.mjs +405 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1406 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1226 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1220 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +412 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +18 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +173 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +136 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +551 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +374 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +80 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +137 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +97 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +560 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +59 -0
- package/i18n/skills/a2h-dashboard-render/SKILL.md +73 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-contract.jsonc +117 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/i18n/skills/a2h-dashboard-render/scripts/dashboard.mjs +3245 -0
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +2048 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/i18n/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +154 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/i18n/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/i18n/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/i18n/skills/a2h-fix-build-errors/SKILL.md +304 -0
- package/i18n/skills/a2h-fix-build-errors/references/arkts-strict-patterns.md +219 -0
- package/i18n/skills/a2h-fix-build-errors/references/rdb-entity-pattern.md +131 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +227 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/i18n/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/i18n/skills/a2h-page-specgen/SKILL.md +136 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/i18n/skills/a2h-page-specgen/references/gates.md +262 -0
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +576 -0
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +138 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +262 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +176 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +248 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +506 -0
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +299 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +616 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1166 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +7 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +271 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +83 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +77 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +419 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +511 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
- package/i18n/skills/a2h-resource-convert/SKILL.md +367 -0
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +335 -0
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +219 -0
- package/i18n/skills/a2h-resource-convert/references/resource-mapping-rules.md +493 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
- package/i18n/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +2532 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +278 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +260 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +163 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +589 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +506 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-spec-generate/references/batch-mode.md +215 -0
- package/i18n/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +184 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/i18n/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/i18n/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/i18n/skills/a2h-spec-generate/references/recall-guide.md +84 -0
- package/i18n/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/i18n/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/i18n/skills/a2h-spec-generate/references/review-checklist.md +22 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/i18n/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/i18n/skills/a2h-spec-generate/references/specs.schema.json +85 -0
- package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +145 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/worker-rules.md +129 -0
- package/i18n/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +702 -0
- package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/collect-specs.mjs +727 -0
- package/i18n/skills/a2h-spec-generate/scripts/feature-stem.mjs +151 -0
- package/i18n/skills/a2h-spec-generate/scripts/parse_requirements.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/prepare-facts.mjs +313 -0
- package/i18n/skills/a2h-spec-generate/scripts/publish-specs.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +669 -0
- package/i18n/skills/a2h-spec-generate/scripts/render-tasks.mjs +385 -0
- package/i18n/skills/a2h-spec-generate/scripts/report.mjs +136 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1265 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1057 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +565 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +544 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +317 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +707 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +436 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +650 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +178 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +912 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +279 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +163 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +256 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +340 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1857 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +262 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +722 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.txt +22 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
- package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +847 -0
- package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +415 -0
- package/i18n/skills/a2h-spec-generate/test/collect-specs.test.mjs +808 -0
- package/i18n/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/i18n/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/i18n/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/i18n/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/i18n/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/i18n/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/SKILL.md +120 -0
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +279 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +918 -0
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +446 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_check.mjs +147 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_source.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +380 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1412 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2037 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +368 -0
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/i18n/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +2120 -0
- package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +609 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +250 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +374 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +913 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +517 -0
- package/i18n/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/i18n/skills/a2h-utg-static/scripts/static_prior.mjs +956 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +108 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +289 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_fresh_branch_guard.mjs +49 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +136 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +368 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_off_path.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +61 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_data_table.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_relative_url.mjs +125 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1351 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/package.json +13 -160
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/skills/a2h-app-migrate/SKILL.md +17 -6
- package/skills/a2h-app-migrate/references/config.example.json +1 -0
- package/skills/a2h-app-migrate/references/stage-map.md +3 -1
- package/skills/a2h-app-migrate/references/workflow.yaml +138 -47
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +1 -2
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +105 -39
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +7 -8
- package/skills/a2h-app-migrate/scripts/ledger.mjs +17 -5
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +43 -7
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +127 -41
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +2 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +38 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_devecocli_docs_preflight.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +102 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +51 -0
- package/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +91 -0
- package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +111 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_acceptance.mjs +94 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +344 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
- package/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +41 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +178 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/skills/a2h-arch-generate/SKILL.md +1 -1
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +15 -6
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +33 -40
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +2 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1260 -0
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +191 -0
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
- package/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
- package/skills/a2h-arkts-logic-coder/SKILL.md +21 -2
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +62 -0
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +4 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +22 -25
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +583 -0
- package/skills/a2h-arkts-logic-coder/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/skills/a2h-arkts-logic-coder/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
- package/skills/a2h-batch-ui-align/SKILL.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +1 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +22 -3
- package/skills/a2h-batch-ui-align/references/checker-rules.md +66 -3
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +45 -8
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -5
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +2 -2
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +4 -2
- package/skills/a2h-batch-ui-align/references/step5-convert.md +7 -5
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +84 -7
- package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +229 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1 -2
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +88 -26
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +305 -12
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +8 -9
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +18 -5
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +103 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +14 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +8 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +84 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +11 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +5 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +66 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +6 -0
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +235 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_safearea.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +567 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -0
- package/skills/a2h-batch-ui-align/scripts/tests/detect_paradigm.test.mjs +260 -0
- package/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +420 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1628 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +297 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
- package/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +12 -14
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +29 -30
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +203 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-page-specgen/SKILL.md +136 -0
- package/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/skills/a2h-page-specgen/references/evidence.md +70 -0
- package/skills/a2h-page-specgen/references/execution-model.md +255 -0
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +250 -0
- package/skills/a2h-page-specgen/references/gates.md +255 -0
- package/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +209 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +422 -0
- package/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/skills/a2h-page-specgen/scripts/gate.mjs +558 -0
- package/skills/a2h-page-specgen/scripts/interactions.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/inventory.mjs +269 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +255 -0
- package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/lib/footprint-roles.mjs +278 -0
- package/skills/a2h-page-specgen/scripts/lib/fsx.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +175 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +234 -0
- package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +391 -0
- package/skills/a2h-page-specgen/scripts/lib/symbols.mjs +125 -0
- package/skills/a2h-page-specgen/scripts/lib/utg-io.mjs +110 -0
- package/skills/a2h-page-specgen/scripts/lib/waker-event-store.mjs +658 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +492 -0
- package/skills/a2h-page-specgen/scripts/render.mjs +317 -0
- package/skills/a2h-page-specgen/scripts/report.mjs +7 -0
- package/skills/a2h-page-specgen/scripts/submission.mjs +532 -0
- package/skills/a2h-page-specgen/scripts/submit.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +590 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +207 -0
- package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1164 -0
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Api.kt +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/BothAnnotations.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Cache.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Comments.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Mmkv.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Models.kt +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Pair.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Prefs.kt +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Room.kt +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Sample.kt +43 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Templates.kt +34 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Timeouts.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/androidTest/Helper.kt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/build.gradle.kts +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/en.js.txt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/libs.versions.toml +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/package.json +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-land/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-night/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-v21/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/test/Legacy.kt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/weather.proto +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/AppPreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/SettingsViewModel.kt +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-dao/src/UserDao.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/base/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/fil/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/arrays.xml +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/xml/prefs.xml +27 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Api.java +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Datastore.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Settings.java +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/forecast.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/store.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/BasePreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/Screen.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/UiPreferences.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-retrofit/src/AuthAPI.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/AndroidManifest.xml +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/feature/auth/navigation/ScreenRoute.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/pages.json +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/components/Widget.vue +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/detail/detail.vue +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/index/index.vue +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/store/userStore.js +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/uni_modules/uview-ui/components/u-thing.js +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp.mkdb.mjs +144 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +94 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyListeners.java +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/PlainActivity.java +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/fold-chain/utg.json +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/utg.json +34 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-roles.test.mjs +172 -0
- package/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +222 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +45 -0
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +120 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +68 -0
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +390 -0
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +167 -0
- package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +503 -0
- package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
- package/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/skills/a2h-page-specgen/scripts/test/waker-event-store.test.mjs +1365 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1979 -0
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +313 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +1234 -0
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +298 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +49 -51
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
- package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +79 -78
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +51 -12
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +24 -6
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +3 -2
- package/skills/a2h-spec-design-pipeline/references/initialization.md +15 -4
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +82 -41
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +61 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +19 -10
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +267 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +61 -8
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +62 -13
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +55 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +60 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/HttpExtraDataEmptyStringCheck.js +488 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +11 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +17 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +40 -5
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +18 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +74 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +128 -5
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +98 -35
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +218 -37
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_classes.ts +113 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_docs.ts +202 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/wiring.ts +58 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +6 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +348 -0
- package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +15 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +7 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +104 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +24 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +394 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +24 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +163 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +15 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +350 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_scan_shared.ts +996 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_classes.ts +80 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_docs.ts +205 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +121 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_e2e.ts +85 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_validate_shared_manifest.ts +720 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_wiring.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/validate_shared_manifest.ts +566 -0
- package/skills/a2h-spec-generate/SKILL.md +87 -21
- package/skills/a2h-spec-generate/references/batch-mode.md +78 -17
- package/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +7 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
- package/skills/a2h-spec-generate/references/synthesis-rules.md +4 -2
- package/skills/a2h-spec-generate/references/worker-rules.md +6 -3
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +4 -5
- package/skills/a2h-spec-generate/scripts/check_spec.ts +145 -14
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +261 -19
- package/skills/a2h-spec-generate/scripts/dispatch-watch.mjs +1168 -0
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +25 -46
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +26 -27
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +3 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +31 -32
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +2 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +15 -26
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +102 -81
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +39 -19
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +12 -13
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +35 -196
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +3 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +22 -96
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +1 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +74 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +51 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +42 -111
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +1 -20
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/zip.ts +63 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +650 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-seed.test.ts +195 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +347 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1948 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-library-evidence.test.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +277 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +844 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/zip.test.ts +61 -0
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +879 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +430 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +811 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/dispatch-watch.test.mjs +606 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +230 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +182 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/skills/a2h-utg-explorer/references/architecture.md +4 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +64 -80
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
- package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +231 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_identity.test.mjs +77 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
- package/skills/a2h-utg-explorer/scripts/tests/fresh_state_plan.test.mjs +78 -0
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/skills/a2h-utg-explorer/scripts/tests/holds_without_data_parity.test.mjs +26 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_failure.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +454 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +142 -0
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/skills/a2h-utg-explorer/scripts/tests/string_tables_twin_ties.test.mjs +83 -0
- package/skills/a2h-utg-explorer/scripts/tests/tar_fixture.mjs +12 -0
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +13 -3
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +107 -65
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +155 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +28 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +19 -20
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +102 -2
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +2 -3
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +1 -2
- package/skills/a2h-utg-static/scripts/route_interceptor.mjs +21 -7
- package/skills/a2h-utg-static/scripts/static_prior.mjs +26 -29
- package/skills/a2h-utg-static/scripts/tests/test_activity_gates.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
|
@@ -0,0 +1,2217 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Action,
|
|
3
|
+
AnalysisContext,
|
|
4
|
+
Area,
|
|
5
|
+
AreaGraphDocument,
|
|
6
|
+
AreaGraphView,
|
|
7
|
+
AreaPath,
|
|
8
|
+
BehaviorEffectData,
|
|
9
|
+
ConditionAlternative,
|
|
10
|
+
Control,
|
|
11
|
+
DescriptionFact,
|
|
12
|
+
Edge,
|
|
13
|
+
Effect,
|
|
14
|
+
EntryPoint,
|
|
15
|
+
ExternalEndpoint,
|
|
16
|
+
RawFactDataByKind,
|
|
17
|
+
RawFactKind,
|
|
18
|
+
SourceFact,
|
|
19
|
+
SourceFactsArtifact,
|
|
20
|
+
SupportedValue,
|
|
21
|
+
UiElementData,
|
|
22
|
+
UnresolvedItem
|
|
23
|
+
} from "../../contracts/index.ts";
|
|
24
|
+
import { withAreaGraphFlatViews } from "../../contracts/index.ts";
|
|
25
|
+
import { createStableId } from "../../core/stable-id.ts";
|
|
26
|
+
import { computePaths } from "../../graph/paths.ts";
|
|
27
|
+
import { validateAreaGraph } from "../../validation/index.ts";
|
|
28
|
+
import {
|
|
29
|
+
codeNameCandidate,
|
|
30
|
+
componentIdentifierName,
|
|
31
|
+
controlNameCandidates,
|
|
32
|
+
literalNameCandidate,
|
|
33
|
+
resolveNameCandidates
|
|
34
|
+
} from "../names/policy.ts";
|
|
35
|
+
import {
|
|
36
|
+
CallbackFlowTraversal
|
|
37
|
+
} from "./callback-flow.ts";
|
|
38
|
+
import {
|
|
39
|
+
resolveComposeRouteArea,
|
|
40
|
+
resolveAreaOwnership
|
|
41
|
+
} from "./area-ownership.ts";
|
|
42
|
+
import { applyComponentVariants } from "./component-variants.ts";
|
|
43
|
+
|
|
44
|
+
function factsOfKind<K extends RawFactKind>(
|
|
45
|
+
artifact: SourceFactsArtifact,
|
|
46
|
+
kind: K
|
|
47
|
+
): SourceFact<K>[] {
|
|
48
|
+
return artifact.facts.filter(
|
|
49
|
+
(fact): fact is SourceFact<K> => fact.kind === kind
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function resolved<T>(
|
|
54
|
+
value: T,
|
|
55
|
+
supportRefs: readonly string[],
|
|
56
|
+
confidence: "high" | "medium" | "low" = "high"
|
|
57
|
+
): SupportedValue<T> {
|
|
58
|
+
return {
|
|
59
|
+
status: "resolved",
|
|
60
|
+
value,
|
|
61
|
+
confidence,
|
|
62
|
+
supportRefs: [...new Set(supportRefs)].sort()
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function graphId(
|
|
67
|
+
namespace: string,
|
|
68
|
+
caseId: string,
|
|
69
|
+
entityKind: string,
|
|
70
|
+
identity: string
|
|
71
|
+
): string {
|
|
72
|
+
return createStableId({
|
|
73
|
+
namespace,
|
|
74
|
+
caseId,
|
|
75
|
+
entityKind,
|
|
76
|
+
identity: [{ kind: "semantic-key", value: identity }]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function inferredTrigger(data: UiElementData): string {
|
|
81
|
+
if (
|
|
82
|
+
data.elementType === "toggle" ||
|
|
83
|
+
data.elementType === "switch" ||
|
|
84
|
+
data.elementType === "checkbox" ||
|
|
85
|
+
data.elementType === "radio-button" ||
|
|
86
|
+
data.elementType === "toggle-button"
|
|
87
|
+
) return "toggle";
|
|
88
|
+
if (
|
|
89
|
+
data.elementType === "text-input" ||
|
|
90
|
+
data.elementType === "text-field"
|
|
91
|
+
) return "text-input";
|
|
92
|
+
return "click";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function repeatedControlName(areaName: string | undefined): string {
|
|
96
|
+
if (!areaName) return "List item";
|
|
97
|
+
return /\p{Script=Han}/u.test(areaName)
|
|
98
|
+
? `${areaName} list item`
|
|
99
|
+
: `${areaName} item`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function genericMenuOpenerName(value: string): boolean {
|
|
103
|
+
const compact = value.replace(/[^\p{Letter}\p{Number}]/gu, "")
|
|
104
|
+
.toLocaleLowerCase("en-US");
|
|
105
|
+
return new Set([
|
|
106
|
+
"menu",
|
|
107
|
+
"more",
|
|
108
|
+
"morehorizontal",
|
|
109
|
+
"morehoriz",
|
|
110
|
+
"morevertical",
|
|
111
|
+
"morevert",
|
|
112
|
+
"overflow",
|
|
113
|
+
"More",
|
|
114
|
+
"menu"
|
|
115
|
+
]).has(compact);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function contextualMenuName(value: string): string {
|
|
119
|
+
const normalized = value.trim();
|
|
120
|
+
if (/menu$/u.test(normalized) || /(?:^|\s)menu$/iu.test(normalized)) {
|
|
121
|
+
return normalized;
|
|
122
|
+
}
|
|
123
|
+
return /\p{Script=Han}/u.test(normalized)
|
|
124
|
+
? `${normalized} menu`
|
|
125
|
+
: `${normalized} menu`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function androidExternalTargetName(
|
|
129
|
+
intentAction: string | undefined
|
|
130
|
+
): string | undefined {
|
|
131
|
+
switch (intentAction) {
|
|
132
|
+
case "android.intent.action.OPEN_DOCUMENT":
|
|
133
|
+
case "android.intent.action.GET_CONTENT":
|
|
134
|
+
return "Android system file picker";
|
|
135
|
+
case "android.intent.action.OPEN_DOCUMENT_TREE":
|
|
136
|
+
return "Android system folder picker";
|
|
137
|
+
case "android.intent.action.CREATE_DOCUMENT":
|
|
138
|
+
return "Android system file save screen";
|
|
139
|
+
default:
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function effectText(
|
|
145
|
+
data: BehaviorEffectData,
|
|
146
|
+
targetName?: string
|
|
147
|
+
): string {
|
|
148
|
+
const sourceDescription = data.description?.trim();
|
|
149
|
+
if (sourceDescription) return sourceDescription;
|
|
150
|
+
const scalarValue = data.value === null ||
|
|
151
|
+
typeof data.value === "string" ||
|
|
152
|
+
typeof data.value === "number" ||
|
|
153
|
+
typeof data.value === "boolean"
|
|
154
|
+
? String(data.value)
|
|
155
|
+
: undefined;
|
|
156
|
+
switch (data.effectKind) {
|
|
157
|
+
case "navigate-area":
|
|
158
|
+
return targetName ? `Go to ${targetName}` : "Go to the target area";
|
|
159
|
+
case "open-external":
|
|
160
|
+
return targetName ? `Open ${targetName}` : "Open a target outside the app";
|
|
161
|
+
case "update-state":
|
|
162
|
+
if (data.stateKey?.split("\u0000").includes("preference-key")) {
|
|
163
|
+
return "Update the selected value of this setting";
|
|
164
|
+
}
|
|
165
|
+
return scalarValue === undefined
|
|
166
|
+
? "Update the current state"
|
|
167
|
+
: `Update the current state to "${scalarValue}"`;
|
|
168
|
+
case "show-feedback":
|
|
169
|
+
return scalarValue === undefined
|
|
170
|
+
? "Show a brief message"
|
|
171
|
+
: `Show the brief message "${scalarValue}"`;
|
|
172
|
+
case "business-action":
|
|
173
|
+
return "Perform the corresponding business action";
|
|
174
|
+
case "show-surface":
|
|
175
|
+
return targetName ? `Show ${targetName}` : "Show the interaction area";
|
|
176
|
+
case "close-surface":
|
|
177
|
+
return "Close the current area";
|
|
178
|
+
case "input":
|
|
179
|
+
return "Receive and handle user input";
|
|
180
|
+
case "unknown":
|
|
181
|
+
return "Action result TBD";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function sorted<T extends { readonly id: string }>(values: T[]): T[] {
|
|
186
|
+
return values.sort((left, right) =>
|
|
187
|
+
left.id.localeCompare(right.id, "en")
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function uniqueSorted(values: readonly string[]): string[] {
|
|
192
|
+
return [...new Set(values)].sort((left, right) =>
|
|
193
|
+
left.localeCompare(right, "en")
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function canonicalSemanticValue(value: unknown): string {
|
|
198
|
+
if (Array.isArray(value)) {
|
|
199
|
+
return `[${value.map(canonicalSemanticValue).join(",")}]`;
|
|
200
|
+
}
|
|
201
|
+
if (value !== null && typeof value === "object") {
|
|
202
|
+
return `{${Object.entries(value)
|
|
203
|
+
.sort(([left], [right]) => left.localeCompare(right, "en"))
|
|
204
|
+
.map(([key, child]) =>
|
|
205
|
+
`${JSON.stringify(key)}:${canonicalSemanticValue(child)}`
|
|
206
|
+
)
|
|
207
|
+
.join(",")}}`;
|
|
208
|
+
}
|
|
209
|
+
return JSON.stringify(value);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function stateKeyDisplayName(value: string): string {
|
|
213
|
+
const parts = value.split("\u0000");
|
|
214
|
+
const preferenceKeyIndex = parts.indexOf("preference-key");
|
|
215
|
+
if (
|
|
216
|
+
preferenceKeyIndex >= 0 &&
|
|
217
|
+
parts[preferenceKeyIndex + 1]?.trim()
|
|
218
|
+
) {
|
|
219
|
+
return parts[preferenceKeyIndex + 1].trim();
|
|
220
|
+
}
|
|
221
|
+
if (parts[0] === "receiver" && parts[3]?.trim()) {
|
|
222
|
+
return parts[3].trim();
|
|
223
|
+
}
|
|
224
|
+
if (parts[2]?.trim()) return parts[2].trim();
|
|
225
|
+
if (parts[1]?.trim()) return parts[1].trim();
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function normalizedUiPropertyName(property: string): string {
|
|
230
|
+
const leaf = property.trim().split(/[.:/]/u).at(-1) ?? property;
|
|
231
|
+
return leaf.replace(/[^a-z0-9]/giu, "").toLowerCase();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function staticEnabledFor(
|
|
235
|
+
uiFactRef: string,
|
|
236
|
+
propertyFacts: readonly SourceFact<"ui-property">[]
|
|
237
|
+
): SupportedValue<boolean> | undefined {
|
|
238
|
+
const enabledFacts = propertyFacts.filter((property) =>
|
|
239
|
+
property.data.ownerKey === uiFactRef &&
|
|
240
|
+
normalizedUiPropertyName(property.data.property) === "enabled" &&
|
|
241
|
+
typeof property.data.value === "boolean"
|
|
242
|
+
);
|
|
243
|
+
if (enabledFacts.length === 0) return undefined;
|
|
244
|
+
const values = new Set(
|
|
245
|
+
enabledFacts.map((property) => property.data.value as boolean)
|
|
246
|
+
);
|
|
247
|
+
if (values.size !== 1) {
|
|
248
|
+
throw new Error(
|
|
249
|
+
`Area graph property invariant for UI Element ${uiFactRef}: ` +
|
|
250
|
+
"static enabled properties disagree."
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
const confidenceRank = { high: 2, medium: 1, low: 0 } as const;
|
|
254
|
+
const confidence = enabledFacts.reduce<"high" | "medium" | "low">(
|
|
255
|
+
(weakest, property) =>
|
|
256
|
+
confidenceRank[property.confidence] < confidenceRank[weakest]
|
|
257
|
+
? property.confidence
|
|
258
|
+
: weakest,
|
|
259
|
+
"high"
|
|
260
|
+
);
|
|
261
|
+
return resolved(
|
|
262
|
+
enabledFacts[0].data.value as boolean,
|
|
263
|
+
enabledFacts.map((property) => property.id),
|
|
264
|
+
confidence
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface StableDescriptionCandidate {
|
|
269
|
+
readonly value: string;
|
|
270
|
+
readonly sourceFactRefs: readonly string[];
|
|
271
|
+
readonly confidence: "high" | "medium" | "low";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function descriptionText(value: unknown): string | undefined {
|
|
275
|
+
if (typeof value !== "string") return undefined;
|
|
276
|
+
const normalized = value.trim().replace(/\s+/gu, " ");
|
|
277
|
+
return normalized.length > 0 && /[\p{Letter}\p{Number}]/u.test(normalized)
|
|
278
|
+
? normalized
|
|
279
|
+
: undefined;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function sameDescriptionText(left: string, right: string): boolean {
|
|
283
|
+
return left.toLocaleLowerCase("en-US") ===
|
|
284
|
+
right.toLocaleLowerCase("en-US");
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function weakestDescriptionConfidence(
|
|
288
|
+
candidates: readonly StableDescriptionCandidate[]
|
|
289
|
+
): "high" | "medium" | "low" {
|
|
290
|
+
const rank = { high: 2, medium: 1, low: 0 } as const;
|
|
291
|
+
return candidates.reduce<"high" | "medium" | "low">(
|
|
292
|
+
(weakest, candidate) =>
|
|
293
|
+
rank[candidate.confidence] < rank[weakest]
|
|
294
|
+
? candidate.confidence
|
|
295
|
+
: weakest,
|
|
296
|
+
"high"
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function stableDescriptionFacts(
|
|
301
|
+
caseId: string,
|
|
302
|
+
areaRef: string,
|
|
303
|
+
componentRefs: ReadonlySet<string>,
|
|
304
|
+
areaName: SupportedValue<string>,
|
|
305
|
+
uiFacts: readonly SourceFact<"ui-element">[],
|
|
306
|
+
propertyFacts: readonly SourceFact<"ui-property">[],
|
|
307
|
+
boundUiFactRefs: ReadonlySet<string>
|
|
308
|
+
): DescriptionFact[] {
|
|
309
|
+
const uiById = new Map(uiFacts.map((fact) => [fact.id, fact]));
|
|
310
|
+
const runtimeContentOwners = new Set(propertyFacts.flatMap((property) =>
|
|
311
|
+
normalizedUiPropertyName(property.data.property) === "runtimecontent" &&
|
|
312
|
+
property.data.value === true
|
|
313
|
+
? [property.data.ownerKey]
|
|
314
|
+
: []
|
|
315
|
+
));
|
|
316
|
+
const candidates: StableDescriptionCandidate[] = [];
|
|
317
|
+
|
|
318
|
+
for (const fact of uiFacts) {
|
|
319
|
+
const value = descriptionText(fact.data.visibleText);
|
|
320
|
+
if (
|
|
321
|
+
!value ||
|
|
322
|
+
fact.data.actionable ||
|
|
323
|
+
boundUiFactRefs.has(fact.id) ||
|
|
324
|
+
!componentRefs.has(fact.data.ownerKey) ||
|
|
325
|
+
runtimeContentOwners.has(fact.id)
|
|
326
|
+
) continue;
|
|
327
|
+
candidates.push({
|
|
328
|
+
value,
|
|
329
|
+
sourceFactRefs: [fact.id],
|
|
330
|
+
confidence: fact.confidence
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
for (const property of propertyFacts) {
|
|
335
|
+
const value = descriptionText(property.data.value);
|
|
336
|
+
if (!value) continue;
|
|
337
|
+
const normalizedProperty = normalizedUiPropertyName(
|
|
338
|
+
property.data.property
|
|
339
|
+
);
|
|
340
|
+
const stableProperty =
|
|
341
|
+
property.data.property.startsWith("stable-content:") ||
|
|
342
|
+
normalizedProperty === "stablecontent";
|
|
343
|
+
if (!stableProperty && normalizedProperty !== "message") continue;
|
|
344
|
+
const ownedUi = uiById.get(property.data.ownerKey);
|
|
345
|
+
const ownedByArea = componentRefs.has(property.data.ownerKey) ||
|
|
346
|
+
(
|
|
347
|
+
ownedUi !== undefined &&
|
|
348
|
+
!ownedUi.data.actionable &&
|
|
349
|
+
!boundUiFactRefs.has(ownedUi.id) &&
|
|
350
|
+
componentRefs.has(ownedUi.data.ownerKey)
|
|
351
|
+
);
|
|
352
|
+
if (!ownedByArea) continue;
|
|
353
|
+
candidates.push({
|
|
354
|
+
value,
|
|
355
|
+
sourceFactRefs: [property.id],
|
|
356
|
+
confidence: property.confidence
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const areaNameValue = areaName.status === "resolved"
|
|
361
|
+
? descriptionText(areaName.value)
|
|
362
|
+
: undefined;
|
|
363
|
+
const grouped = new Map<string, StableDescriptionCandidate[]>();
|
|
364
|
+
for (const candidate of candidates) {
|
|
365
|
+
if (
|
|
366
|
+
areaNameValue &&
|
|
367
|
+
sameDescriptionText(candidate.value, areaNameValue)
|
|
368
|
+
) continue;
|
|
369
|
+
const key = candidate.value.toLocaleLowerCase("en-US");
|
|
370
|
+
const matches = grouped.get(key) ?? [];
|
|
371
|
+
matches.push(candidate);
|
|
372
|
+
grouped.set(key, matches);
|
|
373
|
+
}
|
|
374
|
+
return [...grouped.values()].map((matching) => {
|
|
375
|
+
const value = matching[0].value;
|
|
376
|
+
const sourceFactRefs = uniqueSorted(
|
|
377
|
+
matching.flatMap((candidate) => candidate.sourceFactRefs)
|
|
378
|
+
);
|
|
379
|
+
return {
|
|
380
|
+
id: graphId(
|
|
381
|
+
"description",
|
|
382
|
+
caseId,
|
|
383
|
+
"stable-content",
|
|
384
|
+
`${areaRef}\u0000${value.toLocaleLowerCase("en-US")}`
|
|
385
|
+
),
|
|
386
|
+
kind: "stable-content",
|
|
387
|
+
value: resolved(
|
|
388
|
+
value,
|
|
389
|
+
sourceFactRefs,
|
|
390
|
+
weakestDescriptionConfidence(matching)
|
|
391
|
+
),
|
|
392
|
+
sourceFactRefs
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const controlNameUnknownReasonCodes = new Set([
|
|
398
|
+
"INTRINSIC_CONTROL_NAME_UNKNOWN",
|
|
399
|
+
"INTRINSIC_COMPOSE_CONTROL_NAME_UNKNOWN"
|
|
400
|
+
]);
|
|
401
|
+
|
|
402
|
+
function sourceControlNameUnresolvedItems(
|
|
403
|
+
fact: SourceFact<"ui-element">,
|
|
404
|
+
unresolvedById: ReadonlyMap<string, UnresolvedItem>
|
|
405
|
+
): UnresolvedItem[] {
|
|
406
|
+
return uniqueSorted(fact.unresolvedRefs ?? [])
|
|
407
|
+
.map((ref) => unresolvedById.get(ref))
|
|
408
|
+
.filter((item): item is UnresolvedItem =>
|
|
409
|
+
item !== undefined &&
|
|
410
|
+
item.ownerRef === fact.id &&
|
|
411
|
+
/^(?:data\.)?(?:controlName|name)$/u.test(item.fieldPath) &&
|
|
412
|
+
controlNameUnknownReasonCodes.has(item.reasonCode)
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function sourceControlNameUnresolvedRef(
|
|
417
|
+
fact: SourceFact<"ui-element">,
|
|
418
|
+
unresolvedById: ReadonlyMap<string, UnresolvedItem>
|
|
419
|
+
): string | undefined {
|
|
420
|
+
const matches = sourceControlNameUnresolvedItems(fact, unresolvedById);
|
|
421
|
+
return matches.length === 1 ? matches[0].id : undefined;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export interface BuildAreaGraphOptions {
|
|
425
|
+
readonly maxCallDepth?: number;
|
|
426
|
+
readonly maxCallbackIterations?: number;
|
|
427
|
+
readonly maxGraphStates?: number;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export function buildAreaGraph(
|
|
431
|
+
source: SourceFactsArtifact,
|
|
432
|
+
options: BuildAreaGraphOptions = {}
|
|
433
|
+
): AreaGraphView {
|
|
434
|
+
const componentFacts = factsOfKind(source, "component");
|
|
435
|
+
const componentVariantFacts = factsOfKind(source, "component-variant");
|
|
436
|
+
const uiFacts = factsOfKind(source, "ui-element").filter(
|
|
437
|
+
(fact) => fact.data.analysisRole !== "declaration-template"
|
|
438
|
+
);
|
|
439
|
+
const bindingFacts = factsOfKind(source, "interaction-binding");
|
|
440
|
+
const boundUiFactRefs = new Set(
|
|
441
|
+
bindingFacts.map((binding) => binding.data.elementKey)
|
|
442
|
+
);
|
|
443
|
+
const callbackFacts = factsOfKind(source, "callback");
|
|
444
|
+
const callbackFlowFacts = factsOfKind(source, "callback-flow");
|
|
445
|
+
const effectFacts = factsOfKind(source, "behavior-effect");
|
|
446
|
+
const navigationFacts = factsOfKind(source, "navigation-target");
|
|
447
|
+
const conditionFacts = factsOfKind(source, "condition");
|
|
448
|
+
const conditionById = new Map(
|
|
449
|
+
conditionFacts.map((condition) => [condition.id, condition])
|
|
450
|
+
);
|
|
451
|
+
const uniqueConditionRefs = (
|
|
452
|
+
refs: readonly string[]
|
|
453
|
+
): string[] => {
|
|
454
|
+
const selectedByEvidence = new Map<string, string>();
|
|
455
|
+
for (const ref of refs) {
|
|
456
|
+
const condition = conditionById.get(ref);
|
|
457
|
+
const key = condition
|
|
458
|
+
? JSON.stringify({
|
|
459
|
+
expression: condition.data.expressionAnchor,
|
|
460
|
+
evidence: condition.support
|
|
461
|
+
.map((support) => support.evidenceRef)
|
|
462
|
+
.sort()
|
|
463
|
+
})
|
|
464
|
+
: ref;
|
|
465
|
+
if (!selectedByEvidence.has(key)) {
|
|
466
|
+
selectedByEvidence.set(key, ref);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return [...selectedByEvidence.values()].sort((left, right) =>
|
|
470
|
+
left.localeCompare(right, "en")
|
|
471
|
+
);
|
|
472
|
+
};
|
|
473
|
+
const normalizeConditionAlternatives = (
|
|
474
|
+
alternatives: readonly ConditionAlternative[]
|
|
475
|
+
): ConditionAlternative[] => {
|
|
476
|
+
const byConditions = new Map<string, ConditionAlternative>();
|
|
477
|
+
for (const alternative of alternatives) {
|
|
478
|
+
const conditionRefs = uniqueConditionRefs(
|
|
479
|
+
alternative.conditionRefs
|
|
480
|
+
);
|
|
481
|
+
const key = conditionRefs.join("\u0000");
|
|
482
|
+
const existing = byConditions.get(key);
|
|
483
|
+
byConditions.set(key, {
|
|
484
|
+
conditionRefs,
|
|
485
|
+
sourceFactRefs: uniqueSorted([
|
|
486
|
+
...(existing?.sourceFactRefs ?? []),
|
|
487
|
+
...alternative.sourceFactRefs
|
|
488
|
+
])
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
return [...byConditions.values()].sort((left, right) =>
|
|
492
|
+
left.conditionRefs.join("\u0000").localeCompare(
|
|
493
|
+
right.conditionRefs.join("\u0000"),
|
|
494
|
+
"en"
|
|
495
|
+
)
|
|
496
|
+
);
|
|
497
|
+
};
|
|
498
|
+
const entryFacts = factsOfKind(source, "entry-point");
|
|
499
|
+
const propertyFacts = factsOfKind(source, "ui-property");
|
|
500
|
+
const containerFacts = factsOfKind(source, "container-binding");
|
|
501
|
+
const unresolved: UnresolvedItem[] = [...source.unresolved];
|
|
502
|
+
const sourceUnresolvedById = new Map(
|
|
503
|
+
source.unresolved.map((item) => [item.id, item])
|
|
504
|
+
);
|
|
505
|
+
const callbackTraversal = new CallbackFlowTraversal(
|
|
506
|
+
callbackFlowFacts,
|
|
507
|
+
{
|
|
508
|
+
maxCallDepth: options.maxCallDepth,
|
|
509
|
+
maxCallbackIterations: options.maxCallbackIterations,
|
|
510
|
+
conditionFacts
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
const areaByComponent = new Map<string, string>();
|
|
515
|
+
const areaById = new Map<string, Area>();
|
|
516
|
+
const componentById = new Map(
|
|
517
|
+
componentFacts.map((component) => [component.id, component])
|
|
518
|
+
);
|
|
519
|
+
const sourceFactById = new Map(
|
|
520
|
+
source.facts.map((fact) => [fact.id, fact])
|
|
521
|
+
);
|
|
522
|
+
const sourceEvidenceById = new Map(
|
|
523
|
+
source.evidence.map((item) => [item.id, item])
|
|
524
|
+
);
|
|
525
|
+
const evidenceRefsForNameSupport = (
|
|
526
|
+
supportRefs: readonly string[]
|
|
527
|
+
): string[] => uniqueSorted(supportRefs.flatMap((supportRef) => {
|
|
528
|
+
const fact = sourceFactById.get(supportRef);
|
|
529
|
+
if (fact) return fact.support.map((support) => support.evidenceRef);
|
|
530
|
+
return sourceEvidenceById.has(supportRef) ? [supportRef] : [];
|
|
531
|
+
}));
|
|
532
|
+
const explicitAppEntryComponentRefs = new Set<string>([
|
|
533
|
+
...componentFacts.flatMap((component) =>
|
|
534
|
+
component.support.some((support) =>
|
|
535
|
+
(
|
|
536
|
+
sourceEvidenceById.get(support.evidenceRef)?.sourceKind === "java" ||
|
|
537
|
+
sourceEvidenceById.get(support.evidenceRef)?.sourceKind === "kotlin"
|
|
538
|
+
)
|
|
539
|
+
)
|
|
540
|
+
? [component.id]
|
|
541
|
+
: []
|
|
542
|
+
),
|
|
543
|
+
...navigationFacts.flatMap((navigation) =>
|
|
544
|
+
navigation.data.targetKind === "component" &&
|
|
545
|
+
navigation.data.targetKey
|
|
546
|
+
? [navigation.data.targetKey]
|
|
547
|
+
: []
|
|
548
|
+
),
|
|
549
|
+
...effectFacts.flatMap((effect) =>
|
|
550
|
+
effect.data.effectKind === "navigate-area" && effect.data.targetKey
|
|
551
|
+
? [effect.data.targetKey]
|
|
552
|
+
: []
|
|
553
|
+
)
|
|
554
|
+
]);
|
|
555
|
+
const ownership = resolveAreaOwnership(
|
|
556
|
+
componentFacts,
|
|
557
|
+
containerFacts,
|
|
558
|
+
{ explicitAppEntryComponentRefs }
|
|
559
|
+
);
|
|
560
|
+
for (const group of ownership.groups) {
|
|
561
|
+
const fact = group.anchor;
|
|
562
|
+
const id = graphId(
|
|
563
|
+
"area",
|
|
564
|
+
source.caseId,
|
|
565
|
+
group.kind,
|
|
566
|
+
fact.id
|
|
567
|
+
);
|
|
568
|
+
group.componentRefs.forEach((componentRef) =>
|
|
569
|
+
areaByComponent.set(componentRef, id)
|
|
570
|
+
);
|
|
571
|
+
const componentRefs = new Set(group.componentRefs);
|
|
572
|
+
const titleFacts = propertyFacts
|
|
573
|
+
.filter((property) =>
|
|
574
|
+
componentRefs.has(property.data.ownerKey) &&
|
|
575
|
+
/^(title|label|name)$/iu.test(property.data.property) &&
|
|
576
|
+
typeof property.data.value === "string"
|
|
577
|
+
)
|
|
578
|
+
.sort((left, right) =>
|
|
579
|
+
Number(right.data.ownerKey === fact.id) -
|
|
580
|
+
Number(left.data.ownerKey === fact.id) ||
|
|
581
|
+
left.id.localeCompare(right.id, "en")
|
|
582
|
+
);
|
|
583
|
+
const nameDecision = resolveNameCandidates([
|
|
584
|
+
...titleFacts.map((title) => literalNameCandidate(
|
|
585
|
+
"visible-title",
|
|
586
|
+
typeof title.data.value === "string" ? title.data.value : undefined,
|
|
587
|
+
[title.id],
|
|
588
|
+
title.confidence,
|
|
589
|
+
{
|
|
590
|
+
frameworkGeneric: title.support.some((support) =>
|
|
591
|
+
support.role === "resolved Compose surface API name"
|
|
592
|
+
)
|
|
593
|
+
}
|
|
594
|
+
)),
|
|
595
|
+
codeNameCandidate(
|
|
596
|
+
"component-identifier",
|
|
597
|
+
fact.data.qualifiedName,
|
|
598
|
+
[fact.id],
|
|
599
|
+
componentIdentifierName
|
|
600
|
+
)
|
|
601
|
+
]);
|
|
602
|
+
let areaName: SupportedValue<string>;
|
|
603
|
+
const areaUnresolvedRefs = uniqueSorted(
|
|
604
|
+
group.componentRefs.flatMap((componentRef) =>
|
|
605
|
+
componentById.get(componentRef)?.unresolvedRefs ?? []
|
|
606
|
+
)
|
|
607
|
+
);
|
|
608
|
+
if (
|
|
609
|
+
nameDecision.value !== undefined &&
|
|
610
|
+
nameDecision.confidence !== undefined
|
|
611
|
+
) {
|
|
612
|
+
areaName = resolved(
|
|
613
|
+
nameDecision.value,
|
|
614
|
+
nameDecision.supportRefs,
|
|
615
|
+
nameDecision.confidence
|
|
616
|
+
);
|
|
617
|
+
} else {
|
|
618
|
+
const unresolvedId = graphId(
|
|
619
|
+
"unresolved",
|
|
620
|
+
source.caseId,
|
|
621
|
+
"area-name",
|
|
622
|
+
fact.id
|
|
623
|
+
);
|
|
624
|
+
unresolved.push({
|
|
625
|
+
id: unresolvedId,
|
|
626
|
+
ownerRef: id,
|
|
627
|
+
fieldPath: "name",
|
|
628
|
+
reasonCode: "INTRINSIC_AREA_NAME_UNKNOWN",
|
|
629
|
+
message:
|
|
630
|
+
"The area has no usable title; its class-name, route and Surface identity candidates are all raw/hash, abstract Base or framework-generic names.",
|
|
631
|
+
evidenceRefs: uniqueSorted([
|
|
632
|
+
...fact.support.map((support) => support.evidenceRef),
|
|
633
|
+
...titleFacts.flatMap((title) =>
|
|
634
|
+
title.support.map((support) => support.evidenceRef)
|
|
635
|
+
)
|
|
636
|
+
]),
|
|
637
|
+
candidates: nameDecision.attempts.flatMap((attempt) =>
|
|
638
|
+
attempt.outcome === "rejected" && attempt.rawValue !== undefined
|
|
639
|
+
? [{
|
|
640
|
+
value: attempt.rawValue,
|
|
641
|
+
supportRefs: evidenceRefsForNameSupport(attempt.supportRefs),
|
|
642
|
+
...(attempt.reason ? { note: attempt.reason } : {})
|
|
643
|
+
}]
|
|
644
|
+
: []
|
|
645
|
+
),
|
|
646
|
+
impact: ["req-area-name"],
|
|
647
|
+
originRef: fact.id
|
|
648
|
+
});
|
|
649
|
+
areaUnresolvedRefs.push(unresolvedId);
|
|
650
|
+
areaName = { status: "unresolved", unresolvedRef: unresolvedId };
|
|
651
|
+
}
|
|
652
|
+
areaById.set(id, {
|
|
653
|
+
id,
|
|
654
|
+
identityAnchors: uniqueSorted(
|
|
655
|
+
group.componentRefs.flatMap((componentRef) => {
|
|
656
|
+
const component = componentById.get(componentRef);
|
|
657
|
+
return component
|
|
658
|
+
? [component.id, component.data.qualifiedName]
|
|
659
|
+
: [];
|
|
660
|
+
})
|
|
661
|
+
),
|
|
662
|
+
kind: group.kind,
|
|
663
|
+
name: areaName,
|
|
664
|
+
descriptionFacts: stableDescriptionFacts(
|
|
665
|
+
source.caseId,
|
|
666
|
+
id,
|
|
667
|
+
componentRefs,
|
|
668
|
+
areaName,
|
|
669
|
+
uiFacts,
|
|
670
|
+
propertyFacts,
|
|
671
|
+
boundUiFactRefs
|
|
672
|
+
),
|
|
673
|
+
controlRefs: [],
|
|
674
|
+
conditions: conditionFacts
|
|
675
|
+
.filter((condition) =>
|
|
676
|
+
componentRefs.has(condition.data.ownerKey)
|
|
677
|
+
)
|
|
678
|
+
.map((condition) => condition.id)
|
|
679
|
+
.sort(),
|
|
680
|
+
sourceFactRefs: uniqueSorted([
|
|
681
|
+
...group.componentRefs,
|
|
682
|
+
...group.containerBindingRefs
|
|
683
|
+
]),
|
|
684
|
+
unresolvedRefs: uniqueSorted(areaUnresolvedRefs)
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const controls: Control[] = [];
|
|
689
|
+
const controlByUi = new Map<string, string>();
|
|
690
|
+
for (const fact of uiFacts) {
|
|
691
|
+
if (
|
|
692
|
+
!fact.data.actionable &&
|
|
693
|
+
!boundUiFactRefs.has(fact.id)
|
|
694
|
+
) continue;
|
|
695
|
+
const areaRef = areaByComponent.get(fact.data.ownerKey);
|
|
696
|
+
if (!areaRef) continue;
|
|
697
|
+
const id = graphId("control", source.caseId, fact.data.elementType, fact.id);
|
|
698
|
+
controlByUi.set(fact.id, id);
|
|
699
|
+
const ownerArea = areaById.get(areaRef);
|
|
700
|
+
const areaName = ownerArea?.name.status === "resolved"
|
|
701
|
+
? ownerArea.name.value
|
|
702
|
+
: undefined;
|
|
703
|
+
const areaNameSupport = ownerArea?.name.status === "resolved"
|
|
704
|
+
? ownerArea.name.supportRefs
|
|
705
|
+
: [];
|
|
706
|
+
const repeatedItemName =
|
|
707
|
+
(
|
|
708
|
+
fact.data.elementType === "list-item" ||
|
|
709
|
+
fact.data.elementType === "repeated-row"
|
|
710
|
+
) &&
|
|
711
|
+
fact.data.dynamicIdentity
|
|
712
|
+
? repeatedControlName(areaName)
|
|
713
|
+
: undefined;
|
|
714
|
+
const nameDecision = resolveNameCandidates(controlNameCandidates(
|
|
715
|
+
fact.data,
|
|
716
|
+
fact.id,
|
|
717
|
+
fact.confidence,
|
|
718
|
+
repeatedItemName,
|
|
719
|
+
areaNameSupport
|
|
720
|
+
));
|
|
721
|
+
const sourceNameUnresolvedItems = sourceControlNameUnresolvedItems(
|
|
722
|
+
fact,
|
|
723
|
+
sourceUnresolvedById
|
|
724
|
+
);
|
|
725
|
+
const resolvedSourceNameUnresolvedRefs = new Set(
|
|
726
|
+
nameDecision.value !== undefined
|
|
727
|
+
? sourceNameUnresolvedItems.map((item) => item.id)
|
|
728
|
+
: []
|
|
729
|
+
);
|
|
730
|
+
const unresolvedRefs = (fact.unresolvedRefs ?? []).filter(
|
|
731
|
+
(ref) => !resolvedSourceNameUnresolvedRefs.has(ref)
|
|
732
|
+
);
|
|
733
|
+
let supportedName: SupportedValue<string>;
|
|
734
|
+
if (
|
|
735
|
+
nameDecision.value !== undefined &&
|
|
736
|
+
nameDecision.confidence !== undefined
|
|
737
|
+
) {
|
|
738
|
+
for (let index = unresolved.length - 1; index >= 0; index -= 1) {
|
|
739
|
+
if (resolvedSourceNameUnresolvedRefs.has(unresolved[index].id)) {
|
|
740
|
+
unresolved.splice(index, 1);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
supportedName = resolved(
|
|
744
|
+
nameDecision.value,
|
|
745
|
+
nameDecision.supportRefs,
|
|
746
|
+
nameDecision.confidence
|
|
747
|
+
);
|
|
748
|
+
} else {
|
|
749
|
+
const sourceUnresolvedRef = sourceControlNameUnresolvedRef(
|
|
750
|
+
fact,
|
|
751
|
+
sourceUnresolvedById
|
|
752
|
+
);
|
|
753
|
+
const unresolvedId = sourceUnresolvedRef ?? graphId(
|
|
754
|
+
"unresolved",
|
|
755
|
+
source.caseId,
|
|
756
|
+
"control-name",
|
|
757
|
+
fact.id
|
|
758
|
+
);
|
|
759
|
+
if (!sourceUnresolvedRef) {
|
|
760
|
+
unresolved.push({
|
|
761
|
+
id: unresolvedId,
|
|
762
|
+
ownerRef: id,
|
|
763
|
+
fieldPath: "name",
|
|
764
|
+
reasonCode: "INTRINSIC_CONTROL_NAME_UNKNOWN",
|
|
765
|
+
message: "The control has no visible text, accessibility label or provable icon semantics.",
|
|
766
|
+
evidenceRefs: fact.support.map((item) => item.evidenceRef),
|
|
767
|
+
candidates: nameDecision.attempts.flatMap((attempt) =>
|
|
768
|
+
attempt.outcome === "rejected" && attempt.rawValue !== undefined
|
|
769
|
+
? [{
|
|
770
|
+
value: attempt.rawValue,
|
|
771
|
+
supportRefs: evidenceRefsForNameSupport(attempt.supportRefs),
|
|
772
|
+
...(attempt.reason ? { note: attempt.reason } : {})
|
|
773
|
+
}]
|
|
774
|
+
: []
|
|
775
|
+
),
|
|
776
|
+
impact: ["req-feature-name"],
|
|
777
|
+
originRef: fact.id
|
|
778
|
+
});
|
|
779
|
+
unresolvedRefs.push(unresolvedId);
|
|
780
|
+
}
|
|
781
|
+
supportedName = { status: "unresolved", unresolvedRef: unresolvedId };
|
|
782
|
+
}
|
|
783
|
+
const ownedControlConditions = conditionFacts.filter(
|
|
784
|
+
(condition) => condition.data.ownerKey === fact.id
|
|
785
|
+
);
|
|
786
|
+
const visibilityConditions = ownedControlConditions
|
|
787
|
+
.filter((condition) => condition.data.conditionRole === "visibility")
|
|
788
|
+
.map((condition) => condition.id)
|
|
789
|
+
.sort((left, right) => left.localeCompare(right, "en"));
|
|
790
|
+
const enabledConditions = ownedControlConditions
|
|
791
|
+
.filter((condition) => condition.data.conditionRole !== "visibility")
|
|
792
|
+
.map((condition) => condition.id)
|
|
793
|
+
.sort((left, right) => left.localeCompare(right, "en"));
|
|
794
|
+
const enabled = staticEnabledFor(fact.id, propertyFacts);
|
|
795
|
+
const control: Control = {
|
|
796
|
+
id,
|
|
797
|
+
areaRef,
|
|
798
|
+
kind: fact.data.elementType,
|
|
799
|
+
name: supportedName,
|
|
800
|
+
...(enabled ? { enabled } : {}),
|
|
801
|
+
actionRefs: [],
|
|
802
|
+
visibilityConditions,
|
|
803
|
+
enabledConditions,
|
|
804
|
+
sourceFactRefs: uniqueSorted([
|
|
805
|
+
fact.id,
|
|
806
|
+
...visibilityConditions,
|
|
807
|
+
...enabledConditions,
|
|
808
|
+
...(enabled?.status === "resolved" ? enabled.supportRefs : [])
|
|
809
|
+
]),
|
|
810
|
+
unresolvedRefs: [...new Set(unresolvedRefs)].sort()
|
|
811
|
+
};
|
|
812
|
+
controls.push(control);
|
|
813
|
+
const area = areaById.get(areaRef);
|
|
814
|
+
if (area) {
|
|
815
|
+
areaById.set(areaRef, {
|
|
816
|
+
...area,
|
|
817
|
+
controlRefs: [...area.controlRefs, id].sort()
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
const actions: Action[] = [];
|
|
823
|
+
const effects: Effect[] = [];
|
|
824
|
+
const edges: Edge[] = [];
|
|
825
|
+
const externalEndpoints: ExternalEndpoint[] = [];
|
|
826
|
+
const actionByBinding = new Map<string, string>();
|
|
827
|
+
const effectGraphByFact = new Map<string, string>();
|
|
828
|
+
const navigationByEffect = new Map(
|
|
829
|
+
navigationFacts.map((fact) => [fact.data.effectKey, fact])
|
|
830
|
+
);
|
|
831
|
+
const exactTargetEffectSemanticKey = (
|
|
832
|
+
effect: SourceFact<"behavior-effect">
|
|
833
|
+
): string | undefined => {
|
|
834
|
+
if (!effect.data.targetKey) return undefined;
|
|
835
|
+
const effectData = Object.fromEntries(
|
|
836
|
+
Object.entries(effect.data).filter(([key]) => key !== "conditionKeys")
|
|
837
|
+
);
|
|
838
|
+
const navigation = navigationByEffect.get(effect.id);
|
|
839
|
+
const navigationData = navigation
|
|
840
|
+
? Object.fromEntries(
|
|
841
|
+
Object.entries(navigation.data).filter(([key]) => key !== "effectKey")
|
|
842
|
+
)
|
|
843
|
+
: undefined;
|
|
844
|
+
return canonicalSemanticValue({
|
|
845
|
+
effectData,
|
|
846
|
+
confidence: effect.confidence,
|
|
847
|
+
unresolvedRefs: uniqueSorted(effect.unresolvedRefs ?? []),
|
|
848
|
+
...(navigation
|
|
849
|
+
? {
|
|
850
|
+
navigation: {
|
|
851
|
+
data: navigationData,
|
|
852
|
+
confidence: navigation.confidence,
|
|
853
|
+
unresolvedRefs: uniqueSorted(navigation.unresolvedRefs ?? [])
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
: {})
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
const hasResolvedAreaTarget = (
|
|
860
|
+
effect: SourceFact<"behavior-effect">
|
|
861
|
+
): boolean => {
|
|
862
|
+
if (
|
|
863
|
+
effect.data.targetKey &&
|
|
864
|
+
areaByComponent.has(effect.data.targetKey)
|
|
865
|
+
) return true;
|
|
866
|
+
const navigation = navigationByEffect.get(effect.id);
|
|
867
|
+
if (
|
|
868
|
+
navigation?.data.targetKind === "component" &&
|
|
869
|
+
navigation.data.targetKey &&
|
|
870
|
+
areaByComponent.has(navigation.data.targetKey)
|
|
871
|
+
) return true;
|
|
872
|
+
return Boolean(
|
|
873
|
+
navigation?.data.targetKind === "route" &&
|
|
874
|
+
navigation.data.uri &&
|
|
875
|
+
resolveComposeRouteArea(
|
|
876
|
+
navigation.data.uri,
|
|
877
|
+
componentFacts,
|
|
878
|
+
areaByComponent
|
|
879
|
+
).areaRef
|
|
880
|
+
);
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
const addUnknownEffectForAction = (
|
|
884
|
+
action: Action,
|
|
885
|
+
originRef: string,
|
|
886
|
+
sourceFactRefs: readonly string[],
|
|
887
|
+
evidenceRefs: readonly string[],
|
|
888
|
+
message: string
|
|
889
|
+
): { readonly effectId: string; readonly unresolvedId: string } => {
|
|
890
|
+
const effectId = graphId(
|
|
891
|
+
"effect",
|
|
892
|
+
source.caseId,
|
|
893
|
+
"unknown",
|
|
894
|
+
action.id
|
|
895
|
+
);
|
|
896
|
+
const unresolvedId = graphId(
|
|
897
|
+
"unresolved",
|
|
898
|
+
source.caseId,
|
|
899
|
+
"control-action",
|
|
900
|
+
originRef
|
|
901
|
+
);
|
|
902
|
+
unresolved.push({
|
|
903
|
+
id: unresolvedId,
|
|
904
|
+
ownerRef: action.id,
|
|
905
|
+
fieldPath: "effectRefs",
|
|
906
|
+
reasonCode: "INTRINSIC_CONTROL_ACTION_UNKNOWN",
|
|
907
|
+
message,
|
|
908
|
+
evidenceRefs: uniqueSorted(evidenceRefs),
|
|
909
|
+
candidates: [],
|
|
910
|
+
impact: ["req-feature-effect"],
|
|
911
|
+
originRef
|
|
912
|
+
});
|
|
913
|
+
effects.push({
|
|
914
|
+
id: effectId,
|
|
915
|
+
actionRef: action.id,
|
|
916
|
+
kind: "unknown",
|
|
917
|
+
description: { status: "unresolved", unresolvedRef: unresolvedId },
|
|
918
|
+
sourceFactRefs: uniqueSorted(sourceFactRefs),
|
|
919
|
+
unresolvedRefs: [unresolvedId]
|
|
920
|
+
});
|
|
921
|
+
return { effectId, unresolvedId };
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
const addEffectForAction = (
|
|
925
|
+
action: Action,
|
|
926
|
+
sourceEffect: SourceFact<"behavior-effect">,
|
|
927
|
+
alternatives: readonly ConditionAlternative[],
|
|
928
|
+
equivalentSourceEffects: readonly SourceFact<"behavior-effect">[] = [
|
|
929
|
+
sourceEffect
|
|
930
|
+
]
|
|
931
|
+
): string => {
|
|
932
|
+
const equivalentEffectRefs = uniqueSorted(
|
|
933
|
+
equivalentSourceEffects.map((effect) => effect.id)
|
|
934
|
+
);
|
|
935
|
+
const equivalentNavigations = equivalentSourceEffects.flatMap((effect) => {
|
|
936
|
+
const candidate = navigationByEffect.get(effect.id);
|
|
937
|
+
return candidate ? [candidate] : [];
|
|
938
|
+
});
|
|
939
|
+
const equivalentNavigationRefs = uniqueSorted(
|
|
940
|
+
equivalentNavigations.map((candidate) => candidate.id)
|
|
941
|
+
);
|
|
942
|
+
const normalizedAlternatives = normalizeConditionAlternatives(
|
|
943
|
+
alternatives
|
|
944
|
+
);
|
|
945
|
+
const flowFactRefs = uniqueSorted(
|
|
946
|
+
normalizedAlternatives.flatMap((alternative) =>
|
|
947
|
+
alternative.sourceFactRefs
|
|
948
|
+
)
|
|
949
|
+
);
|
|
950
|
+
const conditionRefs = uniqueConditionRefs(
|
|
951
|
+
normalizedAlternatives.flatMap((alternative) =>
|
|
952
|
+
alternative.conditionRefs
|
|
953
|
+
)
|
|
954
|
+
);
|
|
955
|
+
const id = graphId(
|
|
956
|
+
"effect",
|
|
957
|
+
source.caseId,
|
|
958
|
+
sourceEffect.data.effectKind,
|
|
959
|
+
`${action.id}:${sourceEffect.id}`
|
|
960
|
+
);
|
|
961
|
+
for (const equivalent of equivalentSourceEffects) {
|
|
962
|
+
effectGraphByFact.set(equivalent.id, id);
|
|
963
|
+
}
|
|
964
|
+
const navigation = navigationByEffect.get(sourceEffect.id);
|
|
965
|
+
const routeResolution =
|
|
966
|
+
!sourceEffect.data.targetKey &&
|
|
967
|
+
navigation?.data.targetKind === "route" &&
|
|
968
|
+
navigation.data.uri
|
|
969
|
+
? resolveComposeRouteArea(
|
|
970
|
+
navigation.data.uri,
|
|
971
|
+
componentFacts,
|
|
972
|
+
areaByComponent
|
|
973
|
+
)
|
|
974
|
+
: undefined;
|
|
975
|
+
const targetArea = sourceEffect.data.targetKey
|
|
976
|
+
? areaByComponent.get(sourceEffect.data.targetKey)
|
|
977
|
+
: routeResolution?.areaRef;
|
|
978
|
+
const targetComponent = sourceEffect.data.targetKey
|
|
979
|
+
? componentFacts.find((fact) => fact.id === sourceEffect.data.targetKey)
|
|
980
|
+
: undefined;
|
|
981
|
+
const targetComponentName = targetComponent
|
|
982
|
+
? resolveNameCandidates([codeNameCandidate(
|
|
983
|
+
"component-identifier",
|
|
984
|
+
targetComponent.data.qualifiedName,
|
|
985
|
+
[targetComponent.id],
|
|
986
|
+
componentIdentifierName
|
|
987
|
+
)])
|
|
988
|
+
: undefined;
|
|
989
|
+
const externalTargetName = androidExternalTargetName(
|
|
990
|
+
navigation?.data.intentAction
|
|
991
|
+
);
|
|
992
|
+
const targetName = targetArea
|
|
993
|
+
? areaById.get(targetArea)?.name
|
|
994
|
+
: targetComponentName?.value !== undefined &&
|
|
995
|
+
targetComponentName.confidence !== undefined
|
|
996
|
+
? resolved(
|
|
997
|
+
targetComponentName.value,
|
|
998
|
+
targetComponentName.supportRefs,
|
|
999
|
+
targetComponentName.confidence
|
|
1000
|
+
)
|
|
1001
|
+
: navigation?.data.presentation === "chooser"
|
|
1002
|
+
? resolved(
|
|
1003
|
+
"Android system chooser",
|
|
1004
|
+
[navigation.id],
|
|
1005
|
+
navigation.confidence
|
|
1006
|
+
)
|
|
1007
|
+
: externalTargetName && navigation
|
|
1008
|
+
? resolved(
|
|
1009
|
+
externalTargetName,
|
|
1010
|
+
[navigation.id],
|
|
1011
|
+
navigation.confidence
|
|
1012
|
+
)
|
|
1013
|
+
: undefined;
|
|
1014
|
+
const inheritedNavigationUnresolvedRefs = uniqueSorted([
|
|
1015
|
+
...equivalentSourceEffects.flatMap((effect) =>
|
|
1016
|
+
effect.unresolvedRefs ?? []
|
|
1017
|
+
),
|
|
1018
|
+
...equivalentNavigations.flatMap((candidate) =>
|
|
1019
|
+
candidate.unresolvedRefs ?? []
|
|
1020
|
+
)
|
|
1021
|
+
]);
|
|
1022
|
+
const effectUnresolvedRefs = [...inheritedNavigationUnresolvedRefs];
|
|
1023
|
+
const unknownEffectUnresolvedRef = sourceEffect.data.effectKind === "unknown"
|
|
1024
|
+
? graphId(
|
|
1025
|
+
"unresolved",
|
|
1026
|
+
source.caseId,
|
|
1027
|
+
"effect-kind",
|
|
1028
|
+
id
|
|
1029
|
+
)
|
|
1030
|
+
: undefined;
|
|
1031
|
+
if (
|
|
1032
|
+
unknownEffectUnresolvedRef &&
|
|
1033
|
+
!unresolved.some((item) => item.id === unknownEffectUnresolvedRef)
|
|
1034
|
+
) {
|
|
1035
|
+
unresolved.push({
|
|
1036
|
+
id: unknownEffectUnresolvedRef,
|
|
1037
|
+
ownerRef: id,
|
|
1038
|
+
fieldPath: "description",
|
|
1039
|
+
reasonCode: "INTRINSIC_EFFECT_KIND_UNKNOWN",
|
|
1040
|
+
message: "An interaction effect call was recognized, but static source cannot determine its user-perceivable result.",
|
|
1041
|
+
evidenceRefs: uniqueSorted(equivalentSourceEffects.flatMap((effect) =>
|
|
1042
|
+
effect.support.map((item) => item.evidenceRef)
|
|
1043
|
+
)),
|
|
1044
|
+
candidates: [],
|
|
1045
|
+
impact: ["req-feature-effect"],
|
|
1046
|
+
originRef: sourceEffect.id
|
|
1047
|
+
});
|
|
1048
|
+
effectUnresolvedRefs.push(unknownEffectUnresolvedRef);
|
|
1049
|
+
}
|
|
1050
|
+
const hasResolvedValue = Object.prototype.hasOwnProperty.call(
|
|
1051
|
+
sourceEffect.data,
|
|
1052
|
+
"value"
|
|
1053
|
+
);
|
|
1054
|
+
const hasInheritedFeedbackValueUnknown =
|
|
1055
|
+
inheritedNavigationUnresolvedRefs.some((unresolvedRef) => {
|
|
1056
|
+
const item = sourceUnresolvedById.get(unresolvedRef);
|
|
1057
|
+
return item !== undefined &&
|
|
1058
|
+
(
|
|
1059
|
+
/feedback|snackbar|toast/iu.test(item.reasonCode) ||
|
|
1060
|
+
/(?:value|text|message)$/iu.test(item.fieldPath)
|
|
1061
|
+
);
|
|
1062
|
+
});
|
|
1063
|
+
if (
|
|
1064
|
+
sourceEffect.data.effectKind === "show-feedback" &&
|
|
1065
|
+
!hasResolvedValue &&
|
|
1066
|
+
!hasInheritedFeedbackValueUnknown
|
|
1067
|
+
) {
|
|
1068
|
+
const unresolvedId = graphId(
|
|
1069
|
+
"unresolved",
|
|
1070
|
+
source.caseId,
|
|
1071
|
+
"feedback-value",
|
|
1072
|
+
sourceEffect.id
|
|
1073
|
+
);
|
|
1074
|
+
if (!unresolved.some((item) => item.id === unresolvedId)) {
|
|
1075
|
+
unresolved.push({
|
|
1076
|
+
id: unresolvedId,
|
|
1077
|
+
ownerRef: id,
|
|
1078
|
+
fieldPath: "value",
|
|
1079
|
+
reasonCode: "INTRINSIC_FEEDBACK_VALUE_UNKNOWN",
|
|
1080
|
+
message: "A brief message is confirmed to be shown, but static source cannot determine its content.",
|
|
1081
|
+
evidenceRefs: sourceEffect.support.map(
|
|
1082
|
+
(item) => item.evidenceRef
|
|
1083
|
+
),
|
|
1084
|
+
candidates: [],
|
|
1085
|
+
impact: ["req-feature-effect"],
|
|
1086
|
+
originRef: sourceEffect.id
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
effectUnresolvedRefs.push(unresolvedId);
|
|
1090
|
+
}
|
|
1091
|
+
const supportRefs = uniqueSorted([
|
|
1092
|
+
...equivalentEffectRefs,
|
|
1093
|
+
...flowFactRefs,
|
|
1094
|
+
...equivalentNavigationRefs
|
|
1095
|
+
]);
|
|
1096
|
+
effects.push({
|
|
1097
|
+
id,
|
|
1098
|
+
actionRef: action.id,
|
|
1099
|
+
kind: sourceEffect.data.effectKind,
|
|
1100
|
+
description: unknownEffectUnresolvedRef
|
|
1101
|
+
? { status: "unresolved", unresolvedRef: unknownEffectUnresolvedRef }
|
|
1102
|
+
: resolved(
|
|
1103
|
+
effectText(
|
|
1104
|
+
sourceEffect.data,
|
|
1105
|
+
targetName?.status === "resolved" ? targetName.value : undefined
|
|
1106
|
+
),
|
|
1107
|
+
uniqueSorted([
|
|
1108
|
+
...equivalentEffectRefs,
|
|
1109
|
+
...equivalentNavigationRefs
|
|
1110
|
+
]),
|
|
1111
|
+
sourceEffect.confidence
|
|
1112
|
+
),
|
|
1113
|
+
...(normalizedAlternatives.some(
|
|
1114
|
+
(alternative) => alternative.conditionRefs.length > 0
|
|
1115
|
+
)
|
|
1116
|
+
? { conditionAlternatives: normalizedAlternatives }
|
|
1117
|
+
: {}),
|
|
1118
|
+
...(sourceEffect.data.closePolicy
|
|
1119
|
+
? { closePolicy: sourceEffect.data.closePolicy }
|
|
1120
|
+
: {}),
|
|
1121
|
+
...(sourceEffect.data.transitionMode
|
|
1122
|
+
? { transitionMode: sourceEffect.data.transitionMode }
|
|
1123
|
+
: {}),
|
|
1124
|
+
...(sourceEffect.data.stateKey
|
|
1125
|
+
? {
|
|
1126
|
+
stateKey: resolved(
|
|
1127
|
+
stateKeyDisplayName(sourceEffect.data.stateKey),
|
|
1128
|
+
equivalentEffectRefs,
|
|
1129
|
+
sourceEffect.confidence
|
|
1130
|
+
)
|
|
1131
|
+
}
|
|
1132
|
+
: {}),
|
|
1133
|
+
...(hasResolvedValue
|
|
1134
|
+
? {
|
|
1135
|
+
value: resolved(
|
|
1136
|
+
sourceEffect.data.value ?? null,
|
|
1137
|
+
equivalentEffectRefs,
|
|
1138
|
+
sourceEffect.confidence
|
|
1139
|
+
)
|
|
1140
|
+
}
|
|
1141
|
+
: {}),
|
|
1142
|
+
sourceFactRefs: supportRefs,
|
|
1143
|
+
unresolvedRefs: uniqueSorted(effectUnresolvedRefs)
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
if (
|
|
1147
|
+
sourceEffect.data.effectKind !== "navigate-area" &&
|
|
1148
|
+
sourceEffect.data.effectKind !== "show-surface" &&
|
|
1149
|
+
sourceEffect.data.effectKind !== "open-external" &&
|
|
1150
|
+
navigation?.data.targetKind !== "external"
|
|
1151
|
+
) {
|
|
1152
|
+
return id;
|
|
1153
|
+
}
|
|
1154
|
+
let target: Edge["target"];
|
|
1155
|
+
if (targetArea) {
|
|
1156
|
+
target = { kind: "area", ref: targetArea };
|
|
1157
|
+
} else if (
|
|
1158
|
+
sourceEffect.data.effectKind === "open-external" ||
|
|
1159
|
+
navigation?.data.targetKind === "external"
|
|
1160
|
+
) {
|
|
1161
|
+
const endpointSemanticKey = [
|
|
1162
|
+
navigation?.data.presentation ?? "direct",
|
|
1163
|
+
navigation?.data.intentAction ?? "external",
|
|
1164
|
+
navigation?.data.mimeType ?? "",
|
|
1165
|
+
navigation?.data.uri ?? targetComponent?.data.qualifiedName ?? ""
|
|
1166
|
+
].join("\u0000");
|
|
1167
|
+
const endpointId = graphId(
|
|
1168
|
+
"external",
|
|
1169
|
+
source.caseId,
|
|
1170
|
+
"endpoint",
|
|
1171
|
+
endpointSemanticKey
|
|
1172
|
+
);
|
|
1173
|
+
const existingEndpoint = externalEndpoints.findIndex(
|
|
1174
|
+
(item) => item.id === endpointId
|
|
1175
|
+
);
|
|
1176
|
+
if (existingEndpoint < 0) {
|
|
1177
|
+
externalEndpoints.push({
|
|
1178
|
+
id: endpointId,
|
|
1179
|
+
kind: navigation?.data.presentation === "chooser"
|
|
1180
|
+
? "android-intent-chooser"
|
|
1181
|
+
: navigation?.data.intentAction ?? "external",
|
|
1182
|
+
name: targetName ?? resolved(
|
|
1183
|
+
navigation?.data.uri ?? "Target outside the app",
|
|
1184
|
+
[navigation?.id ?? sourceEffect.id],
|
|
1185
|
+
"medium"
|
|
1186
|
+
),
|
|
1187
|
+
...(navigation?.data.presentation
|
|
1188
|
+
? { presentation: navigation.data.presentation }
|
|
1189
|
+
: {}),
|
|
1190
|
+
...(navigation?.data.intentAction
|
|
1191
|
+
? {
|
|
1192
|
+
intentAction: resolved(
|
|
1193
|
+
navigation.data.intentAction,
|
|
1194
|
+
[navigation.id],
|
|
1195
|
+
navigation.confidence
|
|
1196
|
+
)
|
|
1197
|
+
}
|
|
1198
|
+
: {}),
|
|
1199
|
+
...(navigation?.data.mimeType
|
|
1200
|
+
? {
|
|
1201
|
+
mimeType: resolved(
|
|
1202
|
+
navigation.data.mimeType,
|
|
1203
|
+
[navigation.id],
|
|
1204
|
+
navigation.confidence
|
|
1205
|
+
)
|
|
1206
|
+
}
|
|
1207
|
+
: {}),
|
|
1208
|
+
...(navigation?.data.uri
|
|
1209
|
+
? {
|
|
1210
|
+
uri: resolved(
|
|
1211
|
+
navigation.data.uri,
|
|
1212
|
+
[navigation.id],
|
|
1213
|
+
navigation.confidence
|
|
1214
|
+
)
|
|
1215
|
+
}
|
|
1216
|
+
: {}),
|
|
1217
|
+
sourceFactRefs: [
|
|
1218
|
+
...equivalentEffectRefs,
|
|
1219
|
+
...equivalentNavigationRefs
|
|
1220
|
+
].sort(),
|
|
1221
|
+
unresolvedRefs: []
|
|
1222
|
+
});
|
|
1223
|
+
} else {
|
|
1224
|
+
externalEndpoints[existingEndpoint] = {
|
|
1225
|
+
...externalEndpoints[existingEndpoint],
|
|
1226
|
+
sourceFactRefs: uniqueSorted([
|
|
1227
|
+
...externalEndpoints[existingEndpoint].sourceFactRefs,
|
|
1228
|
+
...equivalentEffectRefs,
|
|
1229
|
+
...equivalentNavigationRefs
|
|
1230
|
+
])
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
target = { kind: "external", ref: endpointId };
|
|
1234
|
+
} else {
|
|
1235
|
+
const inheritedUnresolvedId =
|
|
1236
|
+
inheritedNavigationUnresolvedRefs.length === 1
|
|
1237
|
+
? inheritedNavigationUnresolvedRefs[0]
|
|
1238
|
+
: undefined;
|
|
1239
|
+
const unresolvedId = inheritedUnresolvedId ?? graphId(
|
|
1240
|
+
"unresolved",
|
|
1241
|
+
source.caseId,
|
|
1242
|
+
"edge-target",
|
|
1243
|
+
sourceEffect.id
|
|
1244
|
+
);
|
|
1245
|
+
if (!inheritedUnresolvedId) {
|
|
1246
|
+
unresolved.push({
|
|
1247
|
+
id: unresolvedId,
|
|
1248
|
+
ownerRef: id,
|
|
1249
|
+
fieldPath: "target",
|
|
1250
|
+
reasonCode: "INTRINSIC_NAVIGATION_TARGET_UNKNOWN",
|
|
1251
|
+
message: "Static source cannot determine the target of this navigation effect.",
|
|
1252
|
+
evidenceRefs: sourceEffect.support.map((item) => item.evidenceRef),
|
|
1253
|
+
candidates: (routeResolution?.candidateAreaRefs ?? [])
|
|
1254
|
+
.map((value) => ({
|
|
1255
|
+
value,
|
|
1256
|
+
supportRefs: navigation
|
|
1257
|
+
? navigation.support.map((item) => item.evidenceRef)
|
|
1258
|
+
: []
|
|
1259
|
+
})),
|
|
1260
|
+
impact: ["area-path"],
|
|
1261
|
+
originRef: sourceEffect.id
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
target = { status: "unresolved", unresolvedRef: unresolvedId };
|
|
1265
|
+
}
|
|
1266
|
+
const control = controls.find((item) => item.id === action.controlRef);
|
|
1267
|
+
if (control) {
|
|
1268
|
+
edges.push({
|
|
1269
|
+
id: graphId(
|
|
1270
|
+
"edge",
|
|
1271
|
+
source.caseId,
|
|
1272
|
+
sourceEffect.data.effectKind,
|
|
1273
|
+
`${control.areaRef}:${id}`
|
|
1274
|
+
),
|
|
1275
|
+
sourceAreaRef: control.areaRef,
|
|
1276
|
+
controlRef: control.id,
|
|
1277
|
+
actionRef: action.id,
|
|
1278
|
+
target,
|
|
1279
|
+
conditions: uniqueConditionRefs([
|
|
1280
|
+
...conditionRefs,
|
|
1281
|
+
...(areaById.get(control.areaRef)?.conditions ?? [])
|
|
1282
|
+
]),
|
|
1283
|
+
...(normalizedAlternatives.some(
|
|
1284
|
+
(alternative) => alternative.conditionRefs.length > 0
|
|
1285
|
+
)
|
|
1286
|
+
? { conditionAlternatives: normalizedAlternatives }
|
|
1287
|
+
: {}),
|
|
1288
|
+
preconditions: uniqueConditionRefs([
|
|
1289
|
+
...control.visibilityConditions.filter((conditionRef) =>
|
|
1290
|
+
conditionById.get(conditionRef)?.data.pathRequirement ===
|
|
1291
|
+
"runtime-availability"
|
|
1292
|
+
),
|
|
1293
|
+
...control.enabledConditions
|
|
1294
|
+
]),
|
|
1295
|
+
sourceFactRefs: uniqueSorted([
|
|
1296
|
+
...equivalentEffectRefs,
|
|
1297
|
+
...flowFactRefs,
|
|
1298
|
+
...equivalentNavigationRefs
|
|
1299
|
+
])
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
return id;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
for (const binding of [...bindingFacts].sort((left, right) =>
|
|
1306
|
+
left.id.localeCompare(right.id, "en")
|
|
1307
|
+
)) {
|
|
1308
|
+
const controlRef = controlByUi.get(binding.data.elementKey);
|
|
1309
|
+
if (!controlRef) continue;
|
|
1310
|
+
const reachableCallbacks = callbackTraversal.resolve(
|
|
1311
|
+
binding.id,
|
|
1312
|
+
binding.data.callbackKey
|
|
1313
|
+
);
|
|
1314
|
+
const reachableByCallback = new Map<
|
|
1315
|
+
string,
|
|
1316
|
+
typeof reachableCallbacks
|
|
1317
|
+
>();
|
|
1318
|
+
for (const callback of reachableCallbacks) {
|
|
1319
|
+
const alternatives = reachableByCallback.get(
|
|
1320
|
+
callback.callbackKey
|
|
1321
|
+
) ?? [];
|
|
1322
|
+
alternatives.push(callback);
|
|
1323
|
+
reachableByCallback.set(callback.callbackKey, alternatives);
|
|
1324
|
+
}
|
|
1325
|
+
const callbackKeys = new Set(reachableByCallback.keys());
|
|
1326
|
+
const flowFactRefs = uniqueSorted(
|
|
1327
|
+
reachableCallbacks.flatMap((callback) =>
|
|
1328
|
+
callback.flowFactRefs
|
|
1329
|
+
)
|
|
1330
|
+
);
|
|
1331
|
+
const actionId = graphId(
|
|
1332
|
+
"action",
|
|
1333
|
+
source.caseId,
|
|
1334
|
+
binding.data.trigger,
|
|
1335
|
+
binding.id
|
|
1336
|
+
);
|
|
1337
|
+
actionByBinding.set(binding.id, actionId);
|
|
1338
|
+
const owningControl = controls.find(
|
|
1339
|
+
(control) => control.id === controlRef
|
|
1340
|
+
);
|
|
1341
|
+
const controlEnabledConditions =
|
|
1342
|
+
owningControl?.enabledConditions ?? [];
|
|
1343
|
+
const ownerArea = owningControl
|
|
1344
|
+
? areaById.get(owningControl.areaRef)
|
|
1345
|
+
: undefined;
|
|
1346
|
+
const activationScopedAreaKinds = new Set([
|
|
1347
|
+
"bottom-sheet",
|
|
1348
|
+
"dialog",
|
|
1349
|
+
"drawer",
|
|
1350
|
+
"overlay",
|
|
1351
|
+
"pager-page",
|
|
1352
|
+
"popup"
|
|
1353
|
+
]);
|
|
1354
|
+
const areaActivationExpressions =
|
|
1355
|
+
ownerArea && activationScopedAreaKinds.has(ownerArea.kind)
|
|
1356
|
+
? new Set(ownerArea.conditions.flatMap((conditionRef) => {
|
|
1357
|
+
const expression =
|
|
1358
|
+
conditionById.get(conditionRef)?.data.expressionAnchor.trim();
|
|
1359
|
+
return expression ? [expression] : [];
|
|
1360
|
+
}))
|
|
1361
|
+
: new Set<string>();
|
|
1362
|
+
const compatibleReachabilitiesByEffect = new Map<
|
|
1363
|
+
string,
|
|
1364
|
+
typeof reachableCallbacks
|
|
1365
|
+
>();
|
|
1366
|
+
const compatibleActionEffects = effectFacts
|
|
1367
|
+
.filter((effect) => {
|
|
1368
|
+
if (!callbackKeys.has(effect.data.callbackKey)) return false;
|
|
1369
|
+
const compatible = (
|
|
1370
|
+
reachableByCallback.get(effect.data.callbackKey) ?? []
|
|
1371
|
+
).filter((reachable) =>
|
|
1372
|
+
callbackTraversal.isCompatibleWithConditions(
|
|
1373
|
+
reachable,
|
|
1374
|
+
effect.data.conditionKeys ?? []
|
|
1375
|
+
)
|
|
1376
|
+
);
|
|
1377
|
+
if (compatible.length === 0) return false;
|
|
1378
|
+
compatibleReachabilitiesByEffect.set(effect.id, compatible);
|
|
1379
|
+
return true;
|
|
1380
|
+
});
|
|
1381
|
+
const compatibleEffectById = new Map(
|
|
1382
|
+
compatibleActionEffects.map((effect) => [effect.id, effect])
|
|
1383
|
+
);
|
|
1384
|
+
const supersededImplementationEffects = new Set<string>();
|
|
1385
|
+
for (const summary of compatibleActionEffects) {
|
|
1386
|
+
if (
|
|
1387
|
+
summary.data.effectKind !== "navigate-area" ||
|
|
1388
|
+
!hasResolvedAreaTarget(summary)
|
|
1389
|
+
) continue;
|
|
1390
|
+
for (const relatedRef of summary.relatedFactRefs ?? []) {
|
|
1391
|
+
const implementation = compatibleEffectById.get(relatedRef);
|
|
1392
|
+
if (
|
|
1393
|
+
implementation?.data.effectKind === "navigate-area" &&
|
|
1394
|
+
!hasResolvedAreaTarget(implementation)
|
|
1395
|
+
) {
|
|
1396
|
+
supersededImplementationEffects.add(implementation.id);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
const actionEffects = compatibleActionEffects
|
|
1401
|
+
.filter((effect) =>
|
|
1402
|
+
!supersededImplementationEffects.has(effect.id)
|
|
1403
|
+
)
|
|
1404
|
+
.sort((left, right) => left.id.localeCompare(right.id, "en"));
|
|
1405
|
+
const alternativesByEffect = new Map<
|
|
1406
|
+
string,
|
|
1407
|
+
ConditionAlternative[]
|
|
1408
|
+
>();
|
|
1409
|
+
for (const effect of actionEffects) {
|
|
1410
|
+
const reachabilities =
|
|
1411
|
+
compatibleReachabilitiesByEffect.get(effect.id) ?? [];
|
|
1412
|
+
const rawAlternatives = reachabilities.map((reachability) => {
|
|
1413
|
+
const callbackPath = new Set(reachability.callbackPath);
|
|
1414
|
+
const conditionRefs =
|
|
1415
|
+
effect.data.conditionKeys !== undefined
|
|
1416
|
+
? uniqueConditionRefs([
|
|
1417
|
+
...reachability.conditionRefs,
|
|
1418
|
+
...effect.data.conditionKeys
|
|
1419
|
+
]).filter((conditionRef) => {
|
|
1420
|
+
const expression = conditionById.get(
|
|
1421
|
+
conditionRef
|
|
1422
|
+
)?.data.expressionAnchor.trim();
|
|
1423
|
+
return !expression ||
|
|
1424
|
+
!areaActivationExpressions.has(expression);
|
|
1425
|
+
})
|
|
1426
|
+
: uniqueConditionRefs([
|
|
1427
|
+
...conditionFacts
|
|
1428
|
+
.filter((condition) =>
|
|
1429
|
+
callbackPath.has(condition.data.ownerKey)
|
|
1430
|
+
)
|
|
1431
|
+
.map((condition) => condition.id),
|
|
1432
|
+
...reachability.conditionRefs
|
|
1433
|
+
]).filter((conditionRef) => {
|
|
1434
|
+
const expression = conditionById.get(
|
|
1435
|
+
conditionRef
|
|
1436
|
+
)?.data.expressionAnchor.trim();
|
|
1437
|
+
return !expression ||
|
|
1438
|
+
!areaActivationExpressions.has(expression);
|
|
1439
|
+
});
|
|
1440
|
+
return {
|
|
1441
|
+
conditionRefs,
|
|
1442
|
+
sourceFactRefs: reachability.flowFactRefs
|
|
1443
|
+
};
|
|
1444
|
+
});
|
|
1445
|
+
alternativesByEffect.set(
|
|
1446
|
+
effect.id,
|
|
1447
|
+
normalizeConditionAlternatives(rawAlternatives)
|
|
1448
|
+
);
|
|
1449
|
+
}
|
|
1450
|
+
const action: Action = {
|
|
1451
|
+
id: actionId,
|
|
1452
|
+
controlRef,
|
|
1453
|
+
trigger: binding.data.trigger,
|
|
1454
|
+
effectRefs: [],
|
|
1455
|
+
/*
|
|
1456
|
+
* Callback-path guards describe whether an individual downstream effect
|
|
1457
|
+
* executes after the interaction. They are not prerequisites for the
|
|
1458
|
+
* user being able to trigger the control. Keep those guards on effects
|
|
1459
|
+
* (and navigation edges); Action preconditions are UI availability only.
|
|
1460
|
+
*/
|
|
1461
|
+
preconditionRefs: uniqueConditionRefs(controlEnabledConditions),
|
|
1462
|
+
sourceFactRefs: uniqueSorted([
|
|
1463
|
+
binding.id,
|
|
1464
|
+
...flowFactRefs
|
|
1465
|
+
])
|
|
1466
|
+
};
|
|
1467
|
+
const equivalentEffectGroups = new Map<
|
|
1468
|
+
string,
|
|
1469
|
+
SourceFact<"behavior-effect">[]
|
|
1470
|
+
>();
|
|
1471
|
+
for (const effect of actionEffects) {
|
|
1472
|
+
const semanticKey = exactTargetEffectSemanticKey(effect);
|
|
1473
|
+
const groupKey = semanticKey === undefined
|
|
1474
|
+
? `fact:${effect.id}`
|
|
1475
|
+
: `exact-target:${semanticKey}`;
|
|
1476
|
+
const group = equivalentEffectGroups.get(groupKey) ?? [];
|
|
1477
|
+
group.push(effect);
|
|
1478
|
+
equivalentEffectGroups.set(groupKey, group);
|
|
1479
|
+
}
|
|
1480
|
+
let effectRefs = [...equivalentEffectGroups.values()].map((group) => {
|
|
1481
|
+
const representative = group[0];
|
|
1482
|
+
return addEffectForAction(
|
|
1483
|
+
action,
|
|
1484
|
+
representative,
|
|
1485
|
+
normalizeConditionAlternatives(group.flatMap((effect) =>
|
|
1486
|
+
alternativesByEffect.get(effect.id) ?? []
|
|
1487
|
+
)),
|
|
1488
|
+
group
|
|
1489
|
+
);
|
|
1490
|
+
});
|
|
1491
|
+
let actionUnresolvedRef: string | undefined;
|
|
1492
|
+
if (effectRefs.length === 0) {
|
|
1493
|
+
const unknown = addUnknownEffectForAction(
|
|
1494
|
+
action,
|
|
1495
|
+
binding.id,
|
|
1496
|
+
action.sourceFactRefs,
|
|
1497
|
+
binding.support.map((item) => item.evidenceRef),
|
|
1498
|
+
"The control has a bound callback, but no matching effect was resolved along the callback call chain."
|
|
1499
|
+
);
|
|
1500
|
+
effectRefs = [unknown.effectId];
|
|
1501
|
+
actionUnresolvedRef = unknown.unresolvedId;
|
|
1502
|
+
}
|
|
1503
|
+
actions.push({ ...action, effectRefs });
|
|
1504
|
+
const controlIndex = controls.findIndex((item) => item.id === controlRef);
|
|
1505
|
+
if (controlIndex >= 0) {
|
|
1506
|
+
controls[controlIndex] = {
|
|
1507
|
+
...controls[controlIndex],
|
|
1508
|
+
actionRefs: [...controls[controlIndex].actionRefs, actionId].sort(),
|
|
1509
|
+
...(actionUnresolvedRef
|
|
1510
|
+
? {
|
|
1511
|
+
unresolvedRefs: uniqueSorted([
|
|
1512
|
+
...controls[controlIndex].unresolvedRefs,
|
|
1513
|
+
actionUnresolvedRef
|
|
1514
|
+
])
|
|
1515
|
+
}
|
|
1516
|
+
: {})
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
/*
|
|
1522
|
+
* Editable text has one intrinsic user interaction even when source code
|
|
1523
|
+
* only binds a separate submit/editor callback. This is an Android UI
|
|
1524
|
+
* contract, not a guessed business effect: typing changes the field value.
|
|
1525
|
+
*/
|
|
1526
|
+
for (const control of [...controls]) {
|
|
1527
|
+
if (control.kind !== "text-input") continue;
|
|
1528
|
+
const alreadyHasInput = control.actionRefs.some((actionRef) =>
|
|
1529
|
+
actions.some((action) =>
|
|
1530
|
+
action.id === actionRef && action.trigger === "text-input"
|
|
1531
|
+
)
|
|
1532
|
+
);
|
|
1533
|
+
if (alreadyHasInput) continue;
|
|
1534
|
+
const uiFact = uiFacts.find(
|
|
1535
|
+
(fact) => controlByUi.get(fact.id) === control.id
|
|
1536
|
+
);
|
|
1537
|
+
if (!uiFact) continue;
|
|
1538
|
+
const actionId = graphId(
|
|
1539
|
+
"action",
|
|
1540
|
+
source.caseId,
|
|
1541
|
+
"text-input",
|
|
1542
|
+
`${uiFact.id}:intrinsic-input`
|
|
1543
|
+
);
|
|
1544
|
+
const effectId = graphId(
|
|
1545
|
+
"effect",
|
|
1546
|
+
source.caseId,
|
|
1547
|
+
"input",
|
|
1548
|
+
actionId
|
|
1549
|
+
);
|
|
1550
|
+
actions.push({
|
|
1551
|
+
id: actionId,
|
|
1552
|
+
controlRef: control.id,
|
|
1553
|
+
trigger: "text-input",
|
|
1554
|
+
effectRefs: [effectId],
|
|
1555
|
+
preconditionRefs: [...control.enabledConditions],
|
|
1556
|
+
sourceFactRefs: [uiFact.id]
|
|
1557
|
+
});
|
|
1558
|
+
effects.push({
|
|
1559
|
+
id: effectId,
|
|
1560
|
+
actionRef: actionId,
|
|
1561
|
+
kind: "input",
|
|
1562
|
+
description: resolved(
|
|
1563
|
+
"Receive and handle user input",
|
|
1564
|
+
[uiFact.id],
|
|
1565
|
+
uiFact.confidence
|
|
1566
|
+
),
|
|
1567
|
+
sourceFactRefs: [uiFact.id],
|
|
1568
|
+
unresolvedRefs: []
|
|
1569
|
+
});
|
|
1570
|
+
const index = controls.findIndex((item) => item.id === control.id);
|
|
1571
|
+
controls[index] = {
|
|
1572
|
+
...controls[index],
|
|
1573
|
+
actionRefs: uniqueSorted([
|
|
1574
|
+
...controls[index].actionRefs,
|
|
1575
|
+
actionId
|
|
1576
|
+
])
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
for (const control of [...controls]) {
|
|
1581
|
+
if (control.actionRefs.length > 0) continue;
|
|
1582
|
+
const uiFact = uiFacts.find(
|
|
1583
|
+
(fact) => controlByUi.get(fact.id) === control.id
|
|
1584
|
+
);
|
|
1585
|
+
if (!uiFact) continue;
|
|
1586
|
+
const actionId = graphId(
|
|
1587
|
+
"action",
|
|
1588
|
+
source.caseId,
|
|
1589
|
+
inferredTrigger(uiFact.data),
|
|
1590
|
+
`${uiFact.id}:unbound`
|
|
1591
|
+
);
|
|
1592
|
+
const action: Action = {
|
|
1593
|
+
id: actionId,
|
|
1594
|
+
controlRef: control.id,
|
|
1595
|
+
trigger: inferredTrigger(uiFact.data),
|
|
1596
|
+
effectRefs: [],
|
|
1597
|
+
preconditionRefs: [...control.enabledConditions],
|
|
1598
|
+
sourceFactRefs: [uiFact.id]
|
|
1599
|
+
};
|
|
1600
|
+
const unknown = addUnknownEffectForAction(
|
|
1601
|
+
action,
|
|
1602
|
+
uiFact.id,
|
|
1603
|
+
action.sourceFactRefs,
|
|
1604
|
+
uiFact.support.map((item) => item.evidenceRef),
|
|
1605
|
+
"The control is actionable, but no matching callback effect was resolved in the selected source."
|
|
1606
|
+
);
|
|
1607
|
+
actions.push({ ...action, effectRefs: [unknown.effectId] });
|
|
1608
|
+
const index = controls.findIndex((item) => item.id === control.id);
|
|
1609
|
+
controls[index] = {
|
|
1610
|
+
...controls[index],
|
|
1611
|
+
actionRefs: [actionId],
|
|
1612
|
+
unresolvedRefs: uniqueSorted([
|
|
1613
|
+
...controls[index].unresolvedRefs,
|
|
1614
|
+
unknown.unresolvedId
|
|
1615
|
+
])
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
applyComponentVariants({
|
|
1620
|
+
caseId: source.caseId,
|
|
1621
|
+
variants: componentVariantFacts,
|
|
1622
|
+
areaByComponent,
|
|
1623
|
+
areasById: areaById,
|
|
1624
|
+
controls,
|
|
1625
|
+
actions,
|
|
1626
|
+
effects,
|
|
1627
|
+
edges,
|
|
1628
|
+
unresolved,
|
|
1629
|
+
bindings: bindingFacts,
|
|
1630
|
+
conditions: conditionFacts,
|
|
1631
|
+
id: graphId
|
|
1632
|
+
});
|
|
1633
|
+
|
|
1634
|
+
/*
|
|
1635
|
+
* A user action that resolves back to its own Area is still a real control
|
|
1636
|
+
* with a real effect, but it is not a transition between graph nodes. This
|
|
1637
|
+
* commonly occurs when the selected Pager tab is clicked again. Remove the
|
|
1638
|
+
* self-loop only after component variants have been expanded so the check
|
|
1639
|
+
* uses final Area identities. Startup settling is derived independently
|
|
1640
|
+
* from source effects below and therefore remains unaffected.
|
|
1641
|
+
*/
|
|
1642
|
+
for (let index = edges.length - 1; index >= 0; index -= 1) {
|
|
1643
|
+
const edge = edges[index];
|
|
1644
|
+
if (
|
|
1645
|
+
!("status" in edge.target) &&
|
|
1646
|
+
edge.target.kind === "area" &&
|
|
1647
|
+
edge.target.ref === edge.sourceAreaRef
|
|
1648
|
+
) {
|
|
1649
|
+
edges.splice(index, 1);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/*
|
|
1654
|
+
* A close/back API carries no literal destination. When the static graph
|
|
1655
|
+
* proves one or more in-app predecessors, materialize the possible history
|
|
1656
|
+
* transitions from that evidence. Use a snapshot of forward edges so a
|
|
1657
|
+
* generated back edge can never become proof for another generated edge.
|
|
1658
|
+
*
|
|
1659
|
+
* An action can atomically close the current surface and show another one.
|
|
1660
|
+
* That is a replacement transition: it must not also emit a return edge,
|
|
1661
|
+
* and the new surface inherits the replaced surface's predecessors rather
|
|
1662
|
+
* than treating the replaced surface as its back destination.
|
|
1663
|
+
*/
|
|
1664
|
+
const forwardEdges = [...edges];
|
|
1665
|
+
const actionById = new Map(actions.map((action) => [action.id, action]));
|
|
1666
|
+
const effectById = new Map(effects.map((effect) => [effect.id, effect]));
|
|
1667
|
+
const actionHasEffect = (
|
|
1668
|
+
action: Action,
|
|
1669
|
+
kinds: ReadonlySet<string>
|
|
1670
|
+
): boolean => action.effectRefs.some((effectRef) => {
|
|
1671
|
+
const effect = effectById.get(effectRef);
|
|
1672
|
+
return effect !== undefined && kinds.has(effect.kind);
|
|
1673
|
+
});
|
|
1674
|
+
const closeKinds = new Set(["close-surface"]);
|
|
1675
|
+
const transitionKinds = new Set([
|
|
1676
|
+
"navigate-area",
|
|
1677
|
+
"show-surface",
|
|
1678
|
+
"open-external"
|
|
1679
|
+
]);
|
|
1680
|
+
interface HistoryProof {
|
|
1681
|
+
readonly predecessorAreaRef: string;
|
|
1682
|
+
readonly edges: readonly Edge[];
|
|
1683
|
+
}
|
|
1684
|
+
const historyProofsFor = (
|
|
1685
|
+
targetAreaRef: string,
|
|
1686
|
+
visiting: ReadonlySet<string> = new Set()
|
|
1687
|
+
): HistoryProof[] => {
|
|
1688
|
+
if (visiting.has(targetAreaRef)) return [];
|
|
1689
|
+
const nextVisiting = new Set([...visiting, targetAreaRef]);
|
|
1690
|
+
const proofs: HistoryProof[] = [];
|
|
1691
|
+
for (const edge of forwardEdges) {
|
|
1692
|
+
if (
|
|
1693
|
+
"status" in edge.target ||
|
|
1694
|
+
edge.target.kind !== "area" ||
|
|
1695
|
+
edge.target.ref !== targetAreaRef ||
|
|
1696
|
+
edge.sourceAreaRef === targetAreaRef
|
|
1697
|
+
) continue;
|
|
1698
|
+
const incomingAction = actionById.get(edge.actionRef);
|
|
1699
|
+
if (
|
|
1700
|
+
incomingAction &&
|
|
1701
|
+
actionHasEffect(incomingAction, closeKinds)
|
|
1702
|
+
) {
|
|
1703
|
+
for (const inherited of historyProofsFor(
|
|
1704
|
+
edge.sourceAreaRef,
|
|
1705
|
+
nextVisiting
|
|
1706
|
+
)) {
|
|
1707
|
+
proofs.push({
|
|
1708
|
+
predecessorAreaRef: inherited.predecessorAreaRef,
|
|
1709
|
+
edges: [...inherited.edges, edge]
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
} else {
|
|
1713
|
+
proofs.push({
|
|
1714
|
+
predecessorAreaRef: edge.sourceAreaRef,
|
|
1715
|
+
edges: [edge]
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
const unique = new Map<string, HistoryProof>();
|
|
1720
|
+
for (const proof of proofs) {
|
|
1721
|
+
const key = [
|
|
1722
|
+
proof.predecessorAreaRef,
|
|
1723
|
+
...proof.edges.map((edge) => edge.id)
|
|
1724
|
+
].join("\u0000");
|
|
1725
|
+
unique.set(key, proof);
|
|
1726
|
+
}
|
|
1727
|
+
return [...unique.values()];
|
|
1728
|
+
};
|
|
1729
|
+
const closeEffectsByAction = new Map<string, Effect[]>();
|
|
1730
|
+
for (const closeEffect of effects.filter(
|
|
1731
|
+
(effect) =>
|
|
1732
|
+
effect.kind === "close-surface" &&
|
|
1733
|
+
effect.closePolicy !== "host-exit"
|
|
1734
|
+
)) {
|
|
1735
|
+
const grouped = closeEffectsByAction.get(closeEffect.actionRef) ?? [];
|
|
1736
|
+
grouped.push(closeEffect);
|
|
1737
|
+
closeEffectsByAction.set(closeEffect.actionRef, grouped);
|
|
1738
|
+
}
|
|
1739
|
+
// One user event may reach several implementation callbacks that all close
|
|
1740
|
+
// the same surface. They remain separate effect evidence, but history has
|
|
1741
|
+
// only one transition for that Action and predecessor Area.
|
|
1742
|
+
for (const [closeActionRef, closeEffects] of closeEffectsByAction) {
|
|
1743
|
+
const action = actions.find(
|
|
1744
|
+
(candidate) => candidate.id === closeActionRef
|
|
1745
|
+
);
|
|
1746
|
+
const control = action
|
|
1747
|
+
? controls.find((candidate) => candidate.id === action.controlRef)
|
|
1748
|
+
: undefined;
|
|
1749
|
+
if (!action || !control) continue;
|
|
1750
|
+
if (actionHasEffect(action, transitionKinds)) {
|
|
1751
|
+
continue;
|
|
1752
|
+
}
|
|
1753
|
+
const proofByPredecessor = new Map<string, Edge[]>();
|
|
1754
|
+
for (const proof of historyProofsFor(control.areaRef)) {
|
|
1755
|
+
const edgesForArea = proofByPredecessor.get(
|
|
1756
|
+
proof.predecessorAreaRef
|
|
1757
|
+
) ?? [];
|
|
1758
|
+
edgesForArea.push(...proof.edges);
|
|
1759
|
+
proofByPredecessor.set(
|
|
1760
|
+
proof.predecessorAreaRef,
|
|
1761
|
+
edgesForArea
|
|
1762
|
+
);
|
|
1763
|
+
}
|
|
1764
|
+
for (const [predecessorAreaRef, proofs] of proofByPredecessor) {
|
|
1765
|
+
edges.push({
|
|
1766
|
+
id: graphId(
|
|
1767
|
+
"edge",
|
|
1768
|
+
source.caseId,
|
|
1769
|
+
"history-back",
|
|
1770
|
+
`${control.areaRef}:${action.id}:${predecessorAreaRef}`
|
|
1771
|
+
),
|
|
1772
|
+
sourceAreaRef: control.areaRef,
|
|
1773
|
+
controlRef: control.id,
|
|
1774
|
+
actionRef: action.id,
|
|
1775
|
+
target: { kind: "area", ref: predecessorAreaRef },
|
|
1776
|
+
conditions: uniqueConditionRefs(
|
|
1777
|
+
proofs.flatMap((proof) => proof.conditions)
|
|
1778
|
+
),
|
|
1779
|
+
preconditions: uniqueSorted(
|
|
1780
|
+
proofs.flatMap((proof) => proof.preconditions)
|
|
1781
|
+
),
|
|
1782
|
+
sourceFactRefs: uniqueSorted([
|
|
1783
|
+
...closeEffects.flatMap((effect) => effect.sourceFactRefs),
|
|
1784
|
+
...proofs.flatMap((proof) => proof.sourceFactRefs)
|
|
1785
|
+
])
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
const entryPoints: EntryPoint[] = [];
|
|
1791
|
+
const startupPromotedAreaRefs = new Set<string>();
|
|
1792
|
+
const entryFactById = new Map(entryFacts.map((fact) => [fact.id, fact]));
|
|
1793
|
+
const launcherFactsWithDerivedDefault = new Set(
|
|
1794
|
+
entryFacts.flatMap((fact) =>
|
|
1795
|
+
fact.data.startupRole === "default" && fact.data.parentEntryKey
|
|
1796
|
+
? [fact.data.parentEntryKey]
|
|
1797
|
+
: []
|
|
1798
|
+
)
|
|
1799
|
+
);
|
|
1800
|
+
const callbackById = new Map(
|
|
1801
|
+
callbackFacts.map((callback) => [callback.id, callback])
|
|
1802
|
+
);
|
|
1803
|
+
for (const fact of entryFacts) {
|
|
1804
|
+
/*
|
|
1805
|
+
* A finite startup resolver replaces its technical Activity/shell root
|
|
1806
|
+
* with the proven visible default Area. Keeping both roots would make the
|
|
1807
|
+
* shell compete with its own content and reintroduce arbitrary paths.
|
|
1808
|
+
*/
|
|
1809
|
+
if (launcherFactsWithDerivedDefault.has(fact.id)) continue;
|
|
1810
|
+
const root = areaByComponent.get(fact.data.componentKey);
|
|
1811
|
+
if (!root || !areaById.has(root)) {
|
|
1812
|
+
unresolved.push({
|
|
1813
|
+
id: graphId(
|
|
1814
|
+
"unresolved",
|
|
1815
|
+
source.caseId,
|
|
1816
|
+
"entry-root",
|
|
1817
|
+
fact.id
|
|
1818
|
+
),
|
|
1819
|
+
ownerRef: fact.id,
|
|
1820
|
+
fieldPath: "rootAreaRefs",
|
|
1821
|
+
reasonCode: "INTRINSIC_ENTRY_ROOT_UNKNOWN",
|
|
1822
|
+
message:
|
|
1823
|
+
"The entry component cannot be mapped to a traversable Area; this entry was left out of path computation.",
|
|
1824
|
+
evidenceRefs: fact.support.map((item) => item.evidenceRef),
|
|
1825
|
+
candidates: [],
|
|
1826
|
+
impact: ["area-path"],
|
|
1827
|
+
originRef: fact.id
|
|
1828
|
+
});
|
|
1829
|
+
continue;
|
|
1830
|
+
}
|
|
1831
|
+
const rootArea = areaById.get(root);
|
|
1832
|
+
const rootConditions = rootArea?.conditions ?? [];
|
|
1833
|
+
if (
|
|
1834
|
+
fact.data.entryKind === "launcher" &&
|
|
1835
|
+
fact.data.category === "normal"
|
|
1836
|
+
) {
|
|
1837
|
+
const startupCallbacks = callbackFacts.filter((callback) =>
|
|
1838
|
+
callback.data.ownerKey === fact.data.componentKey &&
|
|
1839
|
+
callback.data.callbackKind === "function" &&
|
|
1840
|
+
/#onCreate\(/u.test(callback.data.callableSymbol)
|
|
1841
|
+
);
|
|
1842
|
+
const lifecyclePagerTransitions = effectFacts.flatMap((effect) => {
|
|
1843
|
+
if (
|
|
1844
|
+
effect.data.effectKind !== "navigate-area" ||
|
|
1845
|
+
effect.data.transitionMode !== "startup-auto" ||
|
|
1846
|
+
!effect.data.targetKey
|
|
1847
|
+
) return [];
|
|
1848
|
+
const callback = callbackById.get(effect.data.callbackKey);
|
|
1849
|
+
const callbackAreaRef = callback
|
|
1850
|
+
? areaByComponent.get(callback.data.ownerKey)
|
|
1851
|
+
: undefined;
|
|
1852
|
+
const targetAreaRef = areaByComponent.get(effect.data.targetKey);
|
|
1853
|
+
if (
|
|
1854
|
+
callbackAreaRef !== root ||
|
|
1855
|
+
!targetAreaRef ||
|
|
1856
|
+
targetAreaRef === root
|
|
1857
|
+
) return [];
|
|
1858
|
+
const transitionConditions = uniqueConditionRefs(
|
|
1859
|
+
effect.data.conditionKeys ?? []
|
|
1860
|
+
);
|
|
1861
|
+
return [{
|
|
1862
|
+
effect,
|
|
1863
|
+
targetAreaRef,
|
|
1864
|
+
transitionConditions,
|
|
1865
|
+
conditions: uniqueConditionRefs([
|
|
1866
|
+
...fact.data.conditionKeys,
|
|
1867
|
+
...transitionConditions
|
|
1868
|
+
]),
|
|
1869
|
+
flowFactRefs: [] as string[]
|
|
1870
|
+
}];
|
|
1871
|
+
});
|
|
1872
|
+
const callbackStartupTransitions = startupCallbacks.flatMap(
|
|
1873
|
+
(startupCallback) =>
|
|
1874
|
+
callbackTraversal.resolve(
|
|
1875
|
+
`${fact.id}:startup:${startupCallback.id}`,
|
|
1876
|
+
startupCallback.id
|
|
1877
|
+
).flatMap((reachability) =>
|
|
1878
|
+
effectFacts
|
|
1879
|
+
.filter((effect) =>
|
|
1880
|
+
effect.data.effectKind === "navigate-area" &&
|
|
1881
|
+
effect.data.targetKey !== undefined &&
|
|
1882
|
+
effect.data.callbackKey === reachability.callbackKey
|
|
1883
|
+
)
|
|
1884
|
+
.flatMap((effect) => {
|
|
1885
|
+
const targetAreaRef = effect.data.targetKey
|
|
1886
|
+
? areaByComponent.get(effect.data.targetKey)
|
|
1887
|
+
: undefined;
|
|
1888
|
+
const transitionConditions = uniqueConditionRefs([
|
|
1889
|
+
...reachability.conditionRefs,
|
|
1890
|
+
...(effect.data.conditionKeys ?? [])
|
|
1891
|
+
]);
|
|
1892
|
+
return targetAreaRef &&
|
|
1893
|
+
targetAreaRef !== root &&
|
|
1894
|
+
transitionConditions.length > 0
|
|
1895
|
+
? [{
|
|
1896
|
+
effect,
|
|
1897
|
+
targetAreaRef,
|
|
1898
|
+
transitionConditions,
|
|
1899
|
+
conditions: uniqueConditionRefs([
|
|
1900
|
+
...fact.data.conditionKeys,
|
|
1901
|
+
...transitionConditions
|
|
1902
|
+
]),
|
|
1903
|
+
flowFactRefs: reachability.flowFactRefs
|
|
1904
|
+
}]
|
|
1905
|
+
: [];
|
|
1906
|
+
})
|
|
1907
|
+
)
|
|
1908
|
+
);
|
|
1909
|
+
const startupTransitions = [
|
|
1910
|
+
...lifecyclePagerTransitions,
|
|
1911
|
+
...callbackStartupTransitions
|
|
1912
|
+
];
|
|
1913
|
+
const seenTransitions = new Set<string>();
|
|
1914
|
+
for (const transition of startupTransitions) {
|
|
1915
|
+
const conditions = transition.conditions;
|
|
1916
|
+
const transitionKey =
|
|
1917
|
+
`${transition.targetAreaRef}\u0000${conditions.join("|")}`;
|
|
1918
|
+
if (seenTransitions.has(transitionKey)) continue;
|
|
1919
|
+
seenTransitions.add(transitionKey);
|
|
1920
|
+
const targetArea = areaById.get(transition.targetAreaRef);
|
|
1921
|
+
if (targetArea) {
|
|
1922
|
+
startupPromotedAreaRefs.add(transition.targetAreaRef);
|
|
1923
|
+
areaById.set(transition.targetAreaRef, {
|
|
1924
|
+
...targetArea,
|
|
1925
|
+
conditions: uniqueConditionRefs([
|
|
1926
|
+
...targetArea.conditions,
|
|
1927
|
+
...conditions
|
|
1928
|
+
]),
|
|
1929
|
+
sourceFactRefs: uniqueSorted([
|
|
1930
|
+
...targetArea.sourceFactRefs,
|
|
1931
|
+
transition.effect.id,
|
|
1932
|
+
...transition.flowFactRefs,
|
|
1933
|
+
...conditions
|
|
1934
|
+
])
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
entryPoints.push({
|
|
1938
|
+
id: graphId(
|
|
1939
|
+
"entry",
|
|
1940
|
+
source.caseId,
|
|
1941
|
+
fact.data.entryKind,
|
|
1942
|
+
`${fact.id}:${transitionKey}`
|
|
1943
|
+
),
|
|
1944
|
+
kind: fact.data.entryKind,
|
|
1945
|
+
category: fact.data.category,
|
|
1946
|
+
rootAreaRefs: [transition.targetAreaRef],
|
|
1947
|
+
conditions,
|
|
1948
|
+
preconditions: conditions,
|
|
1949
|
+
startupRole: "conditional",
|
|
1950
|
+
launcherAreaRef: root,
|
|
1951
|
+
sourceFactRefs: uniqueSorted([
|
|
1952
|
+
fact.id,
|
|
1953
|
+
transition.effect.id,
|
|
1954
|
+
...transition.flowFactRefs,
|
|
1955
|
+
...conditions
|
|
1956
|
+
])
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
const deterministicStartupTarget = (() => {
|
|
1960
|
+
const unique = [...new Map(
|
|
1961
|
+
startupTransitions.map((transition) => [
|
|
1962
|
+
[
|
|
1963
|
+
transition.targetAreaRef,
|
|
1964
|
+
...transition.transitionConditions
|
|
1965
|
+
].join("\u0000"),
|
|
1966
|
+
transition
|
|
1967
|
+
])
|
|
1968
|
+
).values()];
|
|
1969
|
+
return unique.length === 1 &&
|
|
1970
|
+
unique[0].transitionConditions.length === 0
|
|
1971
|
+
? unique[0].targetAreaRef
|
|
1972
|
+
: undefined;
|
|
1973
|
+
})();
|
|
1974
|
+
if (deterministicStartupTarget) {
|
|
1975
|
+
continue;
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
const parentEntry = fact.data.parentEntryKey
|
|
1979
|
+
? entryFactById.get(fact.data.parentEntryKey)
|
|
1980
|
+
: undefined;
|
|
1981
|
+
const parentRoot = parentEntry
|
|
1982
|
+
? areaByComponent.get(parentEntry.data.componentKey)
|
|
1983
|
+
: undefined;
|
|
1984
|
+
const launcherAreaRef = parentRoot ?? root;
|
|
1985
|
+
entryPoints.push({
|
|
1986
|
+
id: graphId(
|
|
1987
|
+
"entry",
|
|
1988
|
+
source.caseId,
|
|
1989
|
+
fact.data.entryKind,
|
|
1990
|
+
fact.id
|
|
1991
|
+
),
|
|
1992
|
+
kind: fact.data.entryKind,
|
|
1993
|
+
category: fact.data.category,
|
|
1994
|
+
rootAreaRefs: uniqueSorted([
|
|
1995
|
+
root,
|
|
1996
|
+
...(fact.data.parentEntryKey && launcherAreaRef !== root
|
|
1997
|
+
? [launcherAreaRef]
|
|
1998
|
+
: [])
|
|
1999
|
+
]),
|
|
2000
|
+
conditions: uniqueConditionRefs([
|
|
2001
|
+
...fact.data.conditionKeys,
|
|
2002
|
+
...rootConditions.filter((conditionRef) =>
|
|
2003
|
+
conditionById.get(conditionRef)?.data.ownerKey ===
|
|
2004
|
+
fact.data.componentKey
|
|
2005
|
+
)
|
|
2006
|
+
]),
|
|
2007
|
+
preconditions: uniqueConditionRefs(
|
|
2008
|
+
fact.data.preconditionKeys ?? fact.data.conditionKeys
|
|
2009
|
+
),
|
|
2010
|
+
startupRole: fact.data.startupRole ?? (
|
|
2011
|
+
fact.data.entryKind === "launcher" &&
|
|
2012
|
+
fact.data.category === "normal" &&
|
|
2013
|
+
fact.data.conditionKeys.length === 0
|
|
2014
|
+
? "default"
|
|
2015
|
+
: "conditional"
|
|
2016
|
+
),
|
|
2017
|
+
launcherAreaRef,
|
|
2018
|
+
sourceFactRefs: uniqueSorted([
|
|
2019
|
+
fact.id,
|
|
2020
|
+
...fact.data.conditionKeys,
|
|
2021
|
+
...(fact.data.preconditionKeys ?? []),
|
|
2022
|
+
...(fact.data.parentEntryKey ? [fact.data.parentEntryKey] : []),
|
|
2023
|
+
...rootConditions.filter((conditionRef) =>
|
|
2024
|
+
conditionById.get(conditionRef)?.data.ownerKey ===
|
|
2025
|
+
fact.data.componentKey
|
|
2026
|
+
)
|
|
2027
|
+
])
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
/*
|
|
2032
|
+
* Startup branch analysis can promote a redirect target to a conditioned
|
|
2033
|
+
* launcher root after controls and forward edges have already been built.
|
|
2034
|
+
* Re-apply the final source-Area conditions to outgoing edges so paths and
|
|
2035
|
+
* REQ descriptions do not lose that proven entry predicate.
|
|
2036
|
+
*/
|
|
2037
|
+
for (let index = 0; index < edges.length; index += 1) {
|
|
2038
|
+
const edge = edges[index];
|
|
2039
|
+
if (!startupPromotedAreaRefs.has(edge.sourceAreaRef)) continue;
|
|
2040
|
+
const updated = {
|
|
2041
|
+
...edge,
|
|
2042
|
+
conditions: uniqueConditionRefs([
|
|
2043
|
+
...(areaById.get(edge.sourceAreaRef)?.conditions ?? []),
|
|
2044
|
+
...edge.conditions
|
|
2045
|
+
])
|
|
2046
|
+
};
|
|
2047
|
+
edges[index] = updated;
|
|
2048
|
+
const forwardIndex = forwardEdges.findIndex(
|
|
2049
|
+
(candidate) => candidate.id === edge.id
|
|
2050
|
+
);
|
|
2051
|
+
if (forwardIndex >= 0) forwardEdges[forwardIndex] = updated;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
/*
|
|
2055
|
+
* A title-less popup is perceived in the context of the control that opens
|
|
2056
|
+
* it. Derive that contextual product label only after the show edge is
|
|
2057
|
+
* proven. Generic overflow/menu openers use the host Area name (for example
|
|
2058
|
+
* "Playlist menu"); a semantic opener such as "Choose language" names its
|
|
2059
|
+
* own menu. No framework class name or application-specific vocabulary is
|
|
2060
|
+
* involved.
|
|
2061
|
+
*/
|
|
2062
|
+
for (const area of areaById.values()) {
|
|
2063
|
+
if (area.kind !== "popup" || area.name.status !== "unresolved") continue;
|
|
2064
|
+
const incoming = edges.filter((edge) => {
|
|
2065
|
+
if (
|
|
2066
|
+
"status" in edge.target ||
|
|
2067
|
+
edge.target.kind !== "area" ||
|
|
2068
|
+
edge.target.ref !== area.id
|
|
2069
|
+
) return false;
|
|
2070
|
+
const action = actionById.get(edge.actionRef);
|
|
2071
|
+
return action?.effectRefs.some((effectRef) =>
|
|
2072
|
+
effectById.get(effectRef)?.kind === "show-surface"
|
|
2073
|
+
) === true;
|
|
2074
|
+
});
|
|
2075
|
+
const sourceAreaRefs = [...new Set(
|
|
2076
|
+
incoming.map((edge) => edge.sourceAreaRef)
|
|
2077
|
+
)];
|
|
2078
|
+
if (incoming.length === 0 || sourceAreaRefs.length !== 1) continue;
|
|
2079
|
+
const sourceArea = areaById.get(sourceAreaRefs[0]);
|
|
2080
|
+
const openerNames = [...new Set(incoming.flatMap((edge) => {
|
|
2081
|
+
const control = controls.find((candidate) =>
|
|
2082
|
+
candidate.id === edge.controlRef
|
|
2083
|
+
);
|
|
2084
|
+
return control?.name.status === "resolved"
|
|
2085
|
+
? [control.name.value]
|
|
2086
|
+
: [];
|
|
2087
|
+
}))];
|
|
2088
|
+
const openerName = openerNames.length === 1 ? openerNames[0] : undefined;
|
|
2089
|
+
const hostName = sourceArea?.name.status === "resolved"
|
|
2090
|
+
? sourceArea.name.value
|
|
2091
|
+
: undefined;
|
|
2092
|
+
const baseName = openerName && !genericMenuOpenerName(openerName)
|
|
2093
|
+
? openerName
|
|
2094
|
+
: hostName ?? openerName;
|
|
2095
|
+
if (!baseName) continue;
|
|
2096
|
+
const supportRefs = uniqueSorted([
|
|
2097
|
+
...incoming.flatMap((edge) => edge.sourceFactRefs),
|
|
2098
|
+
...incoming.flatMap((edge) => {
|
|
2099
|
+
const control = controls.find((candidate) =>
|
|
2100
|
+
candidate.id === edge.controlRef
|
|
2101
|
+
);
|
|
2102
|
+
return control?.name.status === "resolved"
|
|
2103
|
+
? control.name.supportRefs
|
|
2104
|
+
: [];
|
|
2105
|
+
}),
|
|
2106
|
+
...(sourceArea?.name.status === "resolved"
|
|
2107
|
+
? sourceArea.name.supportRefs
|
|
2108
|
+
: [])
|
|
2109
|
+
]);
|
|
2110
|
+
const oldUnresolvedRef = area.name.unresolvedRef;
|
|
2111
|
+
const unresolvedIndex = unresolved.findIndex((candidate) =>
|
|
2112
|
+
candidate.id === oldUnresolvedRef
|
|
2113
|
+
);
|
|
2114
|
+
if (unresolvedIndex >= 0) unresolved.splice(unresolvedIndex, 1);
|
|
2115
|
+
areaById.set(area.id, {
|
|
2116
|
+
...area,
|
|
2117
|
+
name: resolved(contextualMenuName(baseName), supportRefs, "medium"),
|
|
2118
|
+
unresolvedRefs: area.unresolvedRefs.filter((ref) =>
|
|
2119
|
+
ref !== oldUnresolvedRef
|
|
2120
|
+
)
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
const controlById = new Map(
|
|
2125
|
+
controls.map((control) => [control.id, control])
|
|
2126
|
+
);
|
|
2127
|
+
const pathEdges = forwardEdges.filter((edge) => {
|
|
2128
|
+
const enabled = controlById.get(edge.controlRef)?.enabled;
|
|
2129
|
+
return enabled?.status !== "resolved" || enabled.value !== false;
|
|
2130
|
+
});
|
|
2131
|
+
const pathDrafts = computePaths({
|
|
2132
|
+
areas: [...areaById.values()],
|
|
2133
|
+
edges: pathEdges,
|
|
2134
|
+
entryPoints
|
|
2135
|
+
}, {
|
|
2136
|
+
maxGraphStates: options.maxGraphStates,
|
|
2137
|
+
conditionExpressions: new Map(
|
|
2138
|
+
conditionFacts.map((condition) => [
|
|
2139
|
+
condition.id,
|
|
2140
|
+
condition.data.expressionAnchor
|
|
2141
|
+
])
|
|
2142
|
+
)
|
|
2143
|
+
});
|
|
2144
|
+
const paths: AreaPath[] = pathDrafts.map((path) => ({
|
|
2145
|
+
...path,
|
|
2146
|
+
id: graphId(
|
|
2147
|
+
"path",
|
|
2148
|
+
source.caseId,
|
|
2149
|
+
path.kind,
|
|
2150
|
+
[
|
|
2151
|
+
path.targetAreaRef,
|
|
2152
|
+
path.rootEntryRef ?? "none",
|
|
2153
|
+
...path.steps.map((step) => step.edgeRef)
|
|
2154
|
+
].join("|")
|
|
2155
|
+
),
|
|
2156
|
+
selectionReasons: path.kind === "canonical"
|
|
2157
|
+
? ["shortest normal-launcher path"]
|
|
2158
|
+
: path.kind === "equivalent"
|
|
2159
|
+
? ["equal-cost normal-launcher path"]
|
|
2160
|
+
: path.kind === "alternate"
|
|
2161
|
+
? ["alternate entry path"]
|
|
2162
|
+
: ["not reachable from a normal launcher"],
|
|
2163
|
+
unresolvedRefs: []
|
|
2164
|
+
}));
|
|
2165
|
+
const canonicalByArea = new Map(
|
|
2166
|
+
paths
|
|
2167
|
+
.filter((path) =>
|
|
2168
|
+
path.kind === "canonical" || path.kind === "unreachable"
|
|
2169
|
+
)
|
|
2170
|
+
.map((path) => [path.targetAreaRef, path.id])
|
|
2171
|
+
);
|
|
2172
|
+
const areas = sorted(
|
|
2173
|
+
[...areaById.values()].map((area) => ({
|
|
2174
|
+
...area,
|
|
2175
|
+
...(canonicalByArea.has(area.id)
|
|
2176
|
+
? { canonicalPathRef: canonicalByArea.get(area.id) }
|
|
2177
|
+
: {})
|
|
2178
|
+
}))
|
|
2179
|
+
);
|
|
2180
|
+
const document: AreaGraphDocument = {
|
|
2181
|
+
schemaVersion: "2.0.0",
|
|
2182
|
+
artifactKind: "area-graph",
|
|
2183
|
+
caseId: source.caseId,
|
|
2184
|
+
analysisContext: source.analysisContext as AnalysisContext,
|
|
2185
|
+
areaControl: {
|
|
2186
|
+
areas,
|
|
2187
|
+
controls: sorted(controls),
|
|
2188
|
+
externalEndpoints: sorted(externalEndpoints),
|
|
2189
|
+
entryPoints: sorted(entryPoints),
|
|
2190
|
+
excludedAreaCandidates: ownership.exclusions.map((exclusion) => ({
|
|
2191
|
+
...exclusion,
|
|
2192
|
+
sourceFactRefs: [exclusion.componentRef]
|
|
2193
|
+
}))
|
|
2194
|
+
},
|
|
2195
|
+
actionEffect: {
|
|
2196
|
+
actions: sorted(actions),
|
|
2197
|
+
effects: sorted(effects),
|
|
2198
|
+
edges: sorted(edges),
|
|
2199
|
+
paths: sorted(paths)
|
|
2200
|
+
},
|
|
2201
|
+
unresolved: sorted(
|
|
2202
|
+
[...new Map(unresolved.map((item) => [item.id, item])).values()]
|
|
2203
|
+
)
|
|
2204
|
+
};
|
|
2205
|
+
const graph = withAreaGraphFlatViews(document);
|
|
2206
|
+
const validation = validateAreaGraph(graph);
|
|
2207
|
+
if (!validation.ok) {
|
|
2208
|
+
throw new Error(
|
|
2209
|
+
`Area graph invariants failed: ${
|
|
2210
|
+
validation.issues.map((item) =>
|
|
2211
|
+
`${item.code}@${item.path}: ${item.message}`
|
|
2212
|
+
).join(", ")
|
|
2213
|
+
}`
|
|
2214
|
+
);
|
|
2215
|
+
}
|
|
2216
|
+
return graph;
|
|
2217
|
+
}
|