@buaa_smat/hometrans 26.0.0-devecocli.4 → 26.0.0
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 +433 -0
- package/agents/build-fixer.md +1 -2
- package/agents/code-reviewer.md +31 -15
- package/agents/model-render-worker.md +9 -5
- package/dist/cli/config-store.js +128 -0
- package/dist/cli/config.js +48 -0
- package/dist/cli/editors.json +114 -0
- package/dist/cli/env-vars.js +127 -0
- package/dist/cli/index.js +73 -0
- package/dist/cli/init.js +2513 -0
- package/dist/cli/uninstall.js +406 -0
- package/dist/platform/compose.js +228 -0
- package/dist/platform/frontmatter.js +151 -0
- package/dist/platform/installer.js +417 -0
- package/dist/platform/registry.js +337 -0
- package/dist/platform/transform.js +363 -0
- package/dist/platform/types.js +9 -0
- package/dist/platform/validate.js +152 -0
- package/dist/utils/regex.js +7 -0
- package/env-requirements.json +511 -0
- package/package.json +240 -11
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +114 -0
- package/resource/project_architecture.svg +120 -0
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/resource/set_sdk.png +0 -0
- package/resource/title_dark.png +0 -0
- package/skills/a2h-app-migrate/SKILL.md +17 -11
- package/skills/a2h-app-migrate/references/stage-map.md +22 -7
- package/skills/a2h-app-migrate/references/workflow.yaml +276 -209
- package/skills/a2h-app-migrate/scripts/android_index.mjs +34 -16
- package/skills/a2h-app-migrate/scripts/check_arch_done.mjs +12 -12
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +12 -12
- package/skills/a2h-app-migrate/scripts/check_signing.mjs +16 -16
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +17 -16
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +141 -62
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +12 -12
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +26 -26
- package/skills/a2h-app-migrate/scripts/cli_values.mjs +7 -7
- package/skills/a2h-app-migrate/scripts/ensure_utg_snapshot.mjs +144 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +474 -365
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +115 -108
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +6 -6
- package/skills/a2h-app-migrate/scripts/json_io.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +15 -15
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +99 -99
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +25 -25
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +9 -9
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +33 -33
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +13 -11
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +128 -80
- package/skills/a2h-app-migrate/scripts/write_resume_summary.mjs +349 -0
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +21 -21
- package/skills/a2h-arch-generate/scripts/create_project.mjs +23 -23
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +48 -40
- package/skills/a2h-arch-generate/scripts/generate_state.mjs +7 -7
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-arch-generate/scripts/inspect_android_project.mjs +10 -1
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +41 -36
- package/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
- package/skills/a2h-arch-generate/scripts/lib/py_compat.mjs +1 -1
- package/skills/a2h-arch-generate/scripts/module_create/create.mjs +17 -17
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +54 -50
- package/skills/a2h-arch-generate/scripts/scaffold_project.mjs +42 -42
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +69 -44
- package/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +62 -17
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +5 -4
- package/skills/a2h-arkts-logic-coder/SKILL.md +39 -8
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +28 -17
- package/skills/{a2h-spec-design/SKILL.md → a2h-arkts-logic-coder/references/spec-design.md} +45 -78
- package/skills/a2h-arkts-logic-coder/scripts/check_mvvm.ts +1 -1
- package/skills/a2h-arkts-logic-coder/scripts/check_units.ts +448 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +5 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +54 -0
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/inspect_spec_design_inputs.mjs +18 -12
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/lib/py_compat.mjs +1 -1
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/move_spec_technical_reference.mjs +10 -7
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/resolve_module_design.mjs +13 -7
- package/skills/{a2h-spec-design/scripts → a2h-arkts-logic-coder/scripts/design}/validate_spec_design_output.mjs +57 -41
- package/skills/a2h-arkts-logic-coder/scripts/stop_check_hook.ts +66 -323
- package/skills/a2h-arkts-logic-coder/scripts/test_check_scripts.ts +66 -108
- package/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_worktree_compat.ts +5 -18
- package/skills/a2h-batch-ui-align/SKILL.md +39 -39
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -0
- package/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +80 -0
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +83 -0
- package/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
- package/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +38 -0
- package/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
- package/skills/a2h-batch-ui-align/references/checker-rules.md +642 -0
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +69 -260
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +34 -0
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +16 -4
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +3 -1
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +32 -1
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +7 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +28 -0
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +220 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +11 -9
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +13 -8
- package/skills/a2h-batch-ui-align/references/step5-convert.md +21 -18
- package/skills/a2h-batch-ui-align/scripts/agent_cli.mjs +44 -44
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +237 -236
- package/skills/a2h-batch-ui-align/scripts/arkts_static_check.ts +42 -3854
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +34 -32
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +1 -1
- package/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +240 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +139 -33
- package/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +26 -25
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +1 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +159 -12
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +145 -21
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +8 -8
- package/skills/a2h-batch-ui-align/scripts/host_env.mjs +1 -1
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +228 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +444 -266
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +66 -32
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +141 -57
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +410 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +80 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/findings.ts +21 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +22 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/meta.ts +34 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +668 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +392 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +167 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/package.json +3 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +101 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +67 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +71 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +551 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +310 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +80 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +64 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +97 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +68 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +153 -0
- package/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +65 -65
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +8 -6
- package/skills/a2h-dashboard-render/SKILL.md +15 -7
- package/skills/a2h-dashboard-render/references/artifact-contract.jsonc +5 -35
- package/skills/a2h-dashboard-render/references/artifact-registry-spec.md +4 -4
- package/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
- package/skills/a2h-dashboard-render/scripts/check-registry.mjs +17 -17
- package/skills/a2h-dashboard-render/scripts/dashboard.css +3546 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +1021 -941
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +104 -65
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-dashboard-render/scripts/page_capture.mjs +8 -8
- package/skills/a2h-dashboard-render/scripts/usage_readers.mjs +67 -37
- package/skills/a2h-dashboard-render/scripts/usage_worker.mjs +4 -4
- package/skills/a2h-fix-build-errors/SKILL.md +1 -2
- package/skills/a2h-resource-convert/SKILL.md +1 -3
- package/skills/a2h-resource-convert/references/step7-report-template.md +2 -2
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +366 -361
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +170 -170
- package/skills/a2h-resource-convert/scripts/app_identity.ts +162 -162
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +95 -95
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +132 -132
- package/skills/a2h-resource-convert/scripts/extract_project_resources.ts +220 -220
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +74 -74
- package/skills/a2h-spec-design-pipeline/SKILL.md +113 -63
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +226 -56
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +315 -62
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +4 -2
- package/skills/a2h-spec-design-pipeline/references/initialization.md +12 -9
- package/skills/a2h-spec-design-pipeline/references/legacy-cleanup.md +18 -0
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +109 -8
- package/skills/a2h-spec-design-pipeline/references/scripts.md +29 -16
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +116 -8
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +179 -0
- package/skills/a2h-spec-design-pipeline/scripts/audit_claims.ts +33 -5
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +36 -16
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +93 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +915 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/ledger.mjs +234 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/plan.mjs +33 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +31 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +94 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/state-mirror.mjs +55 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/timeouts.mjs +34 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +92 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/waker.mjs +60 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +89 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +551 -0
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +267 -33
- package/skills/a2h-spec-design-pipeline/scripts/git_baseline.ts +30 -10
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +634 -0
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/io.mjs +33 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +107 -19
- package/skills/a2h-spec-design-pipeline/scripts/stage_design_inputs.ts +79 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_atomic_write.ts +4 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_audit_claims.ts +121 -38
- package/skills/a2h-spec-design-pipeline/scripts/test_branch_landed.ts +58 -11
- package/skills/a2h-spec-design-pipeline/scripts/test_deps_ready.ts +31 -31
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +564 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +339 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +161 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +1024 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_ledger.mjs +178 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_plan.mjs +60 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +58 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +91 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +60 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_waker.mjs +95 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_worktree.mjs +81 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +183 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_git_baseline.ts +29 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +294 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +70 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +157 -30
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_waves.ts +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_stage_design_inputs.ts +72 -0
- package/skills/a2h-spec-generate/SKILL.md +34 -10
- package/skills/a2h-spec-generate/references/batch-mode.md +4 -1
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +90 -21
- package/skills/a2h-spec-generate/references/recall-guide.md +1 -0
- package/skills/a2h-spec-generate/references/requirement-scope.md +1 -1
- package/skills/a2h-spec-generate/references/specs.schema.json +6 -0
- package/skills/a2h-spec-generate/references/worker-rules.md +2 -1
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +305 -116
- package/skills/a2h-spec-generate/scripts/check_spec.ts +136 -114
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +19 -4
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +74 -14
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +4 -2
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-spec-generate/scripts/parse_requirements.ts +65 -65
- package/skills/a2h-spec-generate/scripts/prepare-facts.mjs +8 -2
- package/skills/a2h-spec-generate/scripts/publication-verdict.mjs +8 -2
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +80 -5
- package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +670 -0
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +37 -30
- package/skills/a2h-spec-generate/scripts/report.mjs +7 -3
- package/skills/a2h-spec-generate/scripts/reqgen/assets/dashboard.html +26 -26
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-api.js +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-code-view.js +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-format.js +4 -4
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-handoff.js +6 -6
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-tree.js +3 -3
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.html +23 -23
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.js +16 -16
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +27 -26
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +7 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +32 -31
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +3 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +26 -20
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +92 -69
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-output.ts +7 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +545 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +545 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +177 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +424 -29
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +133 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +302 -103
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/zip.ts +99 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +5 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +54 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +8 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/schema.ts +5 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +39 -33
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +4 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +4 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +48 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +366 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/query.ts +102 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +81 -52
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +21 -11
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +2 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +13 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-api.ts +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-code-view.ts +2 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-format.ts +4 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-handoff.ts +6 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-tree.ts +3 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz.ts +16 -16
- package/skills/a2h-utg-explorer/assets/final_viewer.html +21 -21
- package/skills/a2h-utg-explorer/references/architecture.md +7 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +108 -9
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +21 -3
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +45 -2
- package/skills/a2h-utg-explorer/scripts/recover_b.mjs +2 -1
- package/skills/a2h-utg-explorer/scripts/report.mjs +38 -18
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +9 -2
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +179 -18
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +21 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +449 -42
- package/skills/a2h-utg-static/SKILL.md +7 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +29 -2
- package/skills/a2h-utg-static/scripts/click_paths.mjs +42 -26
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +4 -2
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +5 -0
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +54 -0
- package/skills/a2h-utg-static/scripts/manifest.mjs +91 -10
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +68 -3
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +2 -1
- package/skills/a2h-utg-static/scripts/route_interceptor.mjs +374 -0
- package/skills/a2h-utg-static/scripts/static_prior.mjs +87 -33
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +240 -8
- package/skills/a2h-utg-static/scripts/utg_html.mjs +51 -51
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +100 -100
- package/devecocli-plugin/common.ts +0 -2203
- package/devecocli-plugin/install.ts +0 -61
- package/devecocli-plugin/uninstall.ts +0 -26
- package/devecocli-plugin/update.ts +0 -66
- package/index.js +0 -1418
- package/plugin.jsonc +0 -12
- package/skills/a2h-app-migrate/test/test_android_index.mjs +0 -80
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +0 -63
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +0 -54
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +0 -92
- package/skills/a2h-app-migrate/test/test_config_example.mjs +0 -42
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +0 -93
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +0 -544
- package/skills/a2h-app-migrate/test/test_finalize.mjs +0 -89
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +0 -146
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +0 -68
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +0 -91
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -122
- package/skills/a2h-app-migrate/test/test_json_io.mjs +0 -32
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +0 -109
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +0 -53
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +0 -69
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +0 -93
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +0 -144
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +0 -100
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +0 -315
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +0 -133
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +0 -133
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +0 -158
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +0 -181
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +0 -76
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +0 -53
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +0 -226
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +0 -83
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +0 -39
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +0 -168
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +0 -50
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +0 -11
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +0 -12
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +0 -8
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +0 -17
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +0 -8
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +0 -14
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +0 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +0 -1
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +0 -9
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +0 -7
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +0 -10
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +0 -6
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +0 -16
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +0 -5
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +0 -548
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +0 -1122
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +0 -191
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +0 -52
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +0 -34
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +0 -138
- package/skills/a2h-arkts-logic-coder/scripts/check_module_scope.ts +0 -224
- package/skills/a2h-batch-ui-align/flowchart.html +0 -271
- package/skills/a2h-batch-ui-align/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -648
- package/skills/a2h-batch-ui-align/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +0 -2089
- package/skills/a2h-batch-ui-align/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +0 -1033
- package/skills/a2h-batch-ui-align/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -1183
- package/skills/a2h-batch-ui-align/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +0 -576
- package/skills/a2h-batch-ui-align/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +0 -297
- package/skills/a2h-batch-ui-align/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +0 -395
- package/skills/a2h-batch-ui-align/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -903
- package/skills/a2h-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +0 -106
- package/skills/a2h-batch-ui-align/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -1178
- package/skills/a2h-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +0 -911
- package/skills/a2h-batch-ui-align/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +0 -355
- package/skills/a2h-batch-ui-align/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +0 -11
- package/skills/a2h-batch-ui-align/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +0 -206
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +0 -373
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +0 -158
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +0 -750
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +0 -1704
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +0 -1012
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +0 -164
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +0 -840
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -856
- package/skills/a2h-batch-ui-align/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +0 -83
- package/skills/a2h-batch-ui-align/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -294
- package/skills/a2h-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +0 -1407
- package/skills/a2h-batch-ui-align/references/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +0 -1220
- package/skills/a2h-batch-ui-align/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +0 -47
- package/skills/a2h-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +0 -133
- package/skills/a2h-batch-ui-align/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +0 -840
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +0 -217
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +0 -253
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +0 -312
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +0 -241
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +0 -365
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +0 -298
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +0 -365
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +0 -91
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +0 -473
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +0 -356
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +0 -290
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +0 -74
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +0 -31
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +0 -564
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +0 -123
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +0 -126
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +0 -241
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +0 -1451
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +0 -215
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +0 -95
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +0 -115
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +0 -170
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +0 -102
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +0 -244
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +0 -166
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +0 -49
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +0 -219
- package/skills/a2h-dashboard-render/references//347/234/213/346/235/277/350/257/264/346/230/216.md +0 -83
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +0 -1
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +0 -156
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +0 -1
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +0 -1
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +0 -1
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +0 -170
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +0 -99
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +0 -182
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +0 -64
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +0 -1172
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +0 -251
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +0 -81
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +0 -115
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +0 -303
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +0 -147
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +0 -444
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +0 -187
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +0 -351
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +0 -495
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +0 -157
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +0 -388
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +0 -182
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +0 -206
- package/skills/a2h-spec-design/test/golden/inspect_happy.json +0 -20
- package/skills/a2h-spec-design/test/golden/move_design.md +0 -18
- package/skills/a2h-spec-design/test/golden/move_design_crlf.md +0 -18
- package/skills/a2h-spec-design/test/golden/move_spec.md +0 -7
- package/skills/a2h-spec-design/test/golden/resolve_cases.json +0 -36
- package/skills/a2h-spec-design/test/golden/validate_issue_file.md +0 -12
- package/skills/a2h-spec-design/test/golden/validate_issues.json +0 -57
- package/skills/a2h-spec-design/test/test_spec_design_scripts.mjs +0 -381
- package/skills/a2h-spec-design-pipeline/scripts/inflight.mjs +0 -944
- package/skills/a2h-spec-design-pipeline/scripts/lib/bgcli.mjs +0 -95
- package/skills/a2h-spec-design-pipeline/scripts/reconcile.mjs +0 -218
- package/skills/a2h-spec-design-pipeline/scripts/test_bgcli.mjs +0 -64
- package/skills/a2h-spec-design-pipeline/scripts/test_inflight.mjs +0 -452
- package/skills/a2h-spec-design-pipeline/scripts/test_reconcile.mjs +0 -182
- package/skills/a2h-spec-design-pipeline/scripts/test_watchdog.mjs +0 -289
- package/skills/a2h-spec-design-pipeline/scripts/watchdog.mjs +0 -441
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +0 -50
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +0 -75
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +0 -256
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +0 -576
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +0 -290
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +0 -1323
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +0 -574
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +0 -339
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +0 -831
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +0 -548
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +0 -117
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +0 -396
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +0 -175
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +0 -298
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +0 -1061
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +0 -286
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +0 -25
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +0 -159
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +0 -632
- package/skills/a2h-spec-generate/test/check-spec.test.ts +0 -200
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +0 -538
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +0 -37
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +0 -45
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +0 -147
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +0 -3
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +0 -3
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +0 -3
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +0 -9
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +0 -8
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +0 -9
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +0 -1
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +0 -6
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +0 -4
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +0 -1
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +0 -33
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +0 -1
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +0 -23
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +0 -3
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +0 -8
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +0 -1
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +0 -54
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +0 -157
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +0 -282
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +0 -593
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +0 -66
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +0 -45
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +0 -243
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +0 -104
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +0 -223
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +0 -88
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +0 -187
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +0 -130
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +0 -136
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +0 -135
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +0 -16
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +0 -251
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +0 -42
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +0 -162
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +0 -193
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +0 -204
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +0 -355
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +0 -240
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +0 -212
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +0 -173
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +0 -280
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +0 -213
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +0 -345
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +0 -453
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +0 -131
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +0 -229
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +0 -336
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +0 -102
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +0 -92
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +0 -119
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +0 -346
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +0 -112
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +0 -63
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +0 -24
- package/skills/a2h-utg-static/scripts/tests/_zipw.mjs +0 -28
- package/skills/a2h-utg-static/scripts/tests/probe_autoload.mjs +0 -108
- package/skills/a2h-utg-static/scripts/tests/probe_layout_fragments.mjs +0 -90
- package/skills/a2h-utg-static/scripts/tests/probe_unknown_scope.mjs +0 -61
- package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +0 -1261
- package/skills/a2h-utg-static/scripts/tests/test_activity_alias_launcher.mjs +0 -90
- package/skills/a2h-utg-static/scripts/tests/test_activity_supertype_chain.mjs +0 -106
- package/skills/a2h-utg-static/scripts/tests/test_bottom_sheet_container.mjs +0 -58
- package/skills/a2h-utg-static/scripts/tests/test_branch_guard.mjs +0 -19
- package/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +0 -30
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +0 -103
- package/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +0 -60
- package/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +0 -111
- package/skills/a2h-utg-static/scripts/tests/test_commit_scope.mjs +0 -113
- package/skills/a2h-utg-static/scripts/tests/test_compose_file_private_route.mjs +0 -117
- package/skills/a2h-utg-static/scripts/tests/test_compose_nested_graph.mjs +0 -166
- package/skills/a2h-utg-static/scripts/tests/test_compose_route_holder_collision.mjs +0 -112
- package/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +0 -289
- package/skills/a2h-utg-static/scripts/tests/test_custom_source_root.mjs +0 -71
- package/skills/a2h-utg-static/scripts/tests/test_defensive_null_guard.mjs +0 -77
- package/skills/a2h-utg-static/scripts/tests/test_dialog_orphan_entries.mjs +0 -99
- package/skills/a2h-utg-static/scripts/tests/test_dialog_page_owner.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_builder_forms.mjs +0 -96
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_java_factory.mjs +0 -37
- package/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +0 -42
- package/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +0 -140
- package/skills/a2h-utg-static/scripts/tests/test_edge_dedupe_by_gesture.mjs +0 -111
- package/skills/a2h-utg-static/scripts/tests/test_edge_provenance_lint.mjs +0 -70
- package/skills/a2h-utg-static/scripts/tests/test_enclosing_gesture.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_external_surface_roots.mjs +0 -43
- package/skills/a2h-utg-static/scripts/tests/test_find_package_indirect.mjs +0 -67
- package/skills/a2h-utg-static/scripts/tests/test_forwarding_wrapper.mjs +0 -38
- package/skills/a2h-utg-static/scripts/tests/test_fragment_containment.mjs +0 -85
- package/skills/a2h-utg-static/scripts/tests/test_fragment_helper_trigger.mjs +0 -92
- package/skills/a2h-utg-static/scripts/tests/test_graph.mjs +0 -55
- package/skills/a2h-utg-static/scripts/tests/test_guard_clause.mjs +0 -86
- package/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +0 -119
- package/skills/a2h-utg-static/scripts/tests/test_host_kind_by_chain.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +0 -74
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +0 -181
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +0 -293
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +0 -118
- package/skills/a2h-utg-static/scripts/tests/test_interaction_sites.mjs +0 -272
- package/skills/a2h-utg-static/scripts/tests/test_item_data_instance.mjs +0 -51
- package/skills/a2h-utg-static/scripts/tests/test_kotlin_fn_spans.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +0 -187
- package/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +0 -70
- package/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +0 -67
- package/skills/a2h-utg-static/scripts/tests/test_layout_declared_fragment.mjs +0 -103
- package/skills/a2h-utg-static/scripts/tests/test_listener_call_forms.mjs +0 -79
- package/skills/a2h-utg-static/scripts/tests/test_listener_receiver_binding.mjs +0 -47
- package/skills/a2h-utg-static/scripts/tests/test_manifest_exported_default.mjs +0 -40
- package/skills/a2h-utg-static/scripts/tests/test_manifest_filters_modules.mjs +0 -84
- package/skills/a2h-utg-static/scripts/tests/test_manifest_srcfile.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +0 -172
- package/skills/a2h-utg-static/scripts/tests/test_module_namespace.mjs +0 -33
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +0 -44
- package/skills/a2h-utg-static/scripts/tests/test_multiple_entry_contracts.mjs +0 -80
- package/skills/a2h-utg-static/scripts/tests/test_nav_graph_xml.mjs +0 -35
- package/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +0 -42
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +0 -85
- package/skills/a2h-utg-static/scripts/tests/test_node_id_collision.mjs +0 -57
- package/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +0 -62
- package/skills/a2h-utg-static/scripts/tests/test_out_of_scope_and_settings.mjs +0 -72
- package/skills/a2h-utg-static/scripts/tests/test_overload_and_climb.mjs +0 -86
- package/skills/a2h-utg-static/scripts/tests/test_pager_page_source.mjs +0 -78
- package/skills/a2h-utg-static/scripts/tests/test_pager_position_zero.mjs +0 -65
- package/skills/a2h-utg-static/scripts/tests/test_pager_variant_guard.mjs +0 -172
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +0 -107
- package/skills/a2h-utg-static/scripts/tests/test_plain_dialog_nodes.mjs +0 -167
- package/skills/a2h-utg-static/scripts/tests/test_plaindialog_shared_anchor.mjs +0 -117
- package/skills/a2h-utg-static/scripts/tests/test_preference_click_nav.mjs +0 -98
- package/skills/a2h-utg-static/scripts/tests/test_preference_host_binding.mjs +0 -87
- package/skills/a2h-utg-static/scripts/tests/test_preference_nesting.mjs +0 -183
- package/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +0 -48
- package/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +0 -41
- package/skills/a2h-utg-static/scripts/tests/test_resolver_tier_parity.mjs +0 -126
- package/skills/a2h-utg-static/scripts/tests/test_result_launcher.mjs +0 -142
- package/skills/a2h-utg-static/scripts/tests/test_review_fixes.mjs +0 -135
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +0 -66
- package/skills/a2h-utg-static/scripts/tests/test_same_name_decl_scope.mjs +0 -236
- package/skills/a2h-utg-static/scripts/tests/test_scope_utils.mjs +0 -85
- package/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +0 -148
- package/skills/a2h-utg-static/scripts/tests/test_shared_overlay_split.mjs +0 -63
- package/skills/a2h-utg-static/scripts/tests/test_slug_parity.mjs +0 -58
- package/skills/a2h-utg-static/scripts/tests/test_starter_node_id.mjs +0 -41
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_arity.mjs +0 -109
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_commented_candidates.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_model_gates.mjs +0 -127
- package/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +0 -130
- package/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +0 -51
- package/skills/a2h-utg-static/scripts/tests/test_template_method_layout.mjs +0 -81
- package/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +0 -58
- package/skills/a2h-utg-static/scripts/tests/test_trigger_id_spelling.mjs +0 -68
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_action_override.mjs +0 -91
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +0 -110
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_nl_hint_key.mjs +0 -89
- package/skills/a2h-utg-static/scripts/tests/test_uiless_host_fold.mjs +0 -98
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +0 -231
- package/skills/a2h-utg-static/scripts/tests/test_view_click_refs.mjs +0 -104
- package/skills/a2h-utg-static/scripts/tests/test_view_id_label.mjs +0 -69
- package/skills/a2h-utg-static/scripts/tests/test_view_interactions.mjs +0 -346
- package/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +0 -340
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +0 -98
- package/skills/a2h-utg-static/scripts/tests/test_widget_class_scope.mjs +0 -92
- package/skills/a2h-utg-static/scripts/tests/test_window_nav_kotlin.mjs +0 -158
- package/skills/a2h-utg-static/scripts/tests/test_worklist_parts.mjs +0 -65
|
@@ -27,11 +27,11 @@ Following the steps linearly leaves conversion idle for the whole capture, which
|
|
|
27
27
|
|
|
28
28
|
## Step 0 — Environment Check (run first)
|
|
29
29
|
|
|
30
|
-
DevEco is resolved along the chain **OS environment variable →
|
|
30
|
+
DevEco is resolved along the chain **OS environment variable → ask the user** (`echo "$VAR"` on macOS/Linux, `$env:VAR` in PowerShell); `ht init` writes these as machine environment variables, and there is no config file to fall back to:
|
|
31
31
|
|
|
32
|
-
| Variable |
|
|
33
|
-
|
|
34
|
-
| `DEVECO_HOME` *(or `DEVECO_SDK_HOME`)* |
|
|
32
|
+
| Variable | Needed for | Valid when |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `DEVECO_HOME` *(or `DEVECO_SDK_HOME`)* | Step 6.2 build | resolves to a valid DevEco install |
|
|
35
35
|
|
|
36
36
|
If the caller passed `DEVECO_HOME=<path>` (the migrate orchestrator does, after validating it), use it as-is — skip the lookup and pass it to every `a2h-fix-build-errors` call as `deveco_studio_path`. If no valid DevEco install is found, ask the user for the DevEco Studio path (suggest `ht init` to persist it).
|
|
37
37
|
|
|
@@ -42,28 +42,20 @@ Full batch mode also needs (incremental mode: the device is optional; without on
|
|
|
42
42
|
| One online device/emulator | `adb devices` lists the serial you will pass (the explorer requires an explicit serial). If the caller passed `ADB_SERIAL` (and `ADB_PATH`), use that device and that adb | ask the user which device; do not pick one |
|
|
43
43
|
| `homegraph` | `homegraph --version` | Step 3.1 cannot index the source; ask the user |
|
|
44
44
|
|
|
45
|
-
Both modes also need,
|
|
46
|
-
|
|
47
|
-
| Requirement | Check | If missing |
|
|
48
|
-
|---|---|---|
|
|
49
|
-
| Background sub-agents | `node ./scripts/host_env.mjs check` → `background_ready`. Claude Code: always ready. **opencode v2+: always ready** — background sub-agents are native (`native_background: true`, the `subagent` tool's `background: true`), no flag. opencode v1 (≥ 1.16.2) / DevEco Code (0.2.0-3) need `OPENCODE_` / `DEVECO_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true`, which the host reads only at start-up | follow `action`. When it starts with `none` (Claude, opencode v2, or a v1/DevEco session with the flag active), go straight on. When the result carries `verify` (`opencode_version_source: "path"`), the version came from the `opencode` on PATH, which may not be this session's binary: trust your own tool list instead — a `subagent` tool means v2 (native), only `task` means v1 (follow the flag path as if `native_background` were false). `enable` (v1/DevEco only): run `node ./scripts/host_env.mjs enable` (persists both flags for the user: Windows `setx`, macOS/Linux a marked block in the shell rc; `disable` removes them). After `enable` or on `restart`, tell the user to restart the host session from a new terminal and resume this skill there; stop here until they do. If they decline, continue with blocking waves (Step 0.1 item 6) |
|
|
50
|
-
| Pre-approved writes | the session may edit under `harmony_project_dir` and run `node <this skill>/scripts/*`, `node <a2h-utg-*>/scripts/*`, `adb` without asking | sub-agents inherit the parent's permissions, so an unapproved first write waits for a human. Ask the user to allow them (Claude Code: `permissions.allow`; opencode/DevEco: the agent's `permission` config) |
|
|
45
|
+
Both modes also need **background sub-agents** and **pre-approved writes**. Run `node ./scripts/host_env.mjs check` and follow its `action`: `none` means go on; `enable` / `restart` (opencode v1, DevEco) means the user must restart the host session with the flag set, so stop until they do, or continue with blocking waves if they decline. The session must be allowed to edit under `harmony_project_dir` and run `node <this skill>/scripts/*`, `node <a2h-utg-*>/scripts/*` and `adb` without asking, because sub-agents inherit the parent's permissions. Host-by-host detail (version checks, `verify`, the flags): [references/host-dispatch.md](references/host-dispatch.md).
|
|
51
46
|
|
|
52
47
|
### Step 0.1 — How sub-agents are dispatched (every step)
|
|
53
48
|
|
|
54
|
-
Every sub-agent of this skill (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
6. **Without background sub-agents** the same loop runs, but each `lease` is dispatched as one blocking wave. This is correct but slow, because every wave waits for its slowest member. Say so in the Step 7 report.
|
|
65
|
-
7. **If the parent session ends,** its sub-agents end with it. A new session re-runs `group_queue.mjs init`, which keeps results and queues the interrupted groups to resume.
|
|
66
|
-
- **One parent per campaign.** Never assume the previous parent ended because this is a new session: the user may have opened a second one while the first is still dispatching. Before writing **anything** under `.hometrans/` (plan, prompts, measure packs, `batch_progress.json`, queue), check: a `detach.mjs status` job `running` (other than a `service: true` one such as `fixture_server`, which runs across sessions by design), a `reviewers.json` entry bound in the last 20 min whose answers are incomplete, or a running group with recent activity. `Q init` runs the same check and refuses (`another parent session may still be driving this campaign`). On any of these, stop and ask the user: monitor only, or stop that session and re-run `init --takeover`. `Q wait`, `lease`, `reap` and `refresh` are not read-only either (they re-plan and settle groups), so a monitoring session never calls them.
|
|
49
|
+
Every sub-agent of this skill (Step 2 resources, Step 3 reviewers, Step 5 groups, Step 5.5 wiring, Step 6 verify) is a **background sub-agent of the parent's own host**; which tool that is per host is in [references/host-dispatch.md](references/host-dispatch.md) — **read it before the first dispatch**. The rules, on every host:
|
|
50
|
+
|
|
51
|
+
1. **One call per unit, several in one message.** Record each resume handle with `group_queue.mjs bind --task <handle>`.
|
|
52
|
+
2. **Completion comes from disk, not from the host:** a report file, `answers_check.mjs` complete, or `detach.mjs` exited. `group_queue.mjs wait` blocks on these (≤ 9 min); a host notice is an early hint.
|
|
53
|
+
3. **The parent never holds the foreground for long.** Anything over ~3 min runs through `detach.mjs start … --name <job>`; pass `--job <job>` to `wait`.
|
|
54
|
+
4. **Never cancel by re-dispatching.** A stalled agent is resumed in its own session with the same handle, never replaced by a fresh one (two writers on one file). `Q requeue` enforces this; `--fresh` only after the old session's completion notice. Pass `--task <handle>` to every `Q release` that comes from a notice.
|
|
55
|
+
5. **Sub-agents cannot dispatch sub-agents**; every prompt says so.
|
|
56
|
+
5a. **`image_read=false` (Step 1)**: every prompt opens with the `NO_IMAGE` block of `scripts/group_queue.mjs` (`lease` adds it to group messages; the parent adds it to the others), and the parent never opens an image either.
|
|
57
|
+
6. **Without background sub-agents** each `lease` is dispatched as one blocking wave; say so in Step 7.
|
|
58
|
+
7. **One parent per campaign.** A new session re-runs `group_queue.mjs init`, which keeps results. Before writing anything under `.hometrans/`, check that no other parent is still driving the campaign (`Q init` refuses with `another parent session may still be driving this campaign`); if one may be, ask the user: monitor only, or `init --takeover`. A monitoring session never calls `Q wait` / `lease` / `reap` / `refresh`.
|
|
67
59
|
|
|
68
60
|
## Step 1 — Parse User Request
|
|
69
61
|
|
|
@@ -79,6 +71,7 @@ Extract from the user's message (natural language, no fixed format):
|
|
|
79
71
|
| `pages` (optional) | A page subset the user listed explicitly | "1. .../page_0001_X" ... |
|
|
80
72
|
| `android_index_ready` (optional) | `true` when the caller has just built and synced `android_project_dir`'s HomeGraph index and other agents read it concurrently (a2h-app-migrate does). Step 3.1 then skips `homegraph init` / `homegraph index` | — |
|
|
81
73
|
| `reuse_static_workspace` (optional) | A finished static-UTG workspace from this run's `discover.utg_static`. When set, Step 3.1 may copy it into `.hometrans/utg_static` and skip the pipeline. Omit it whenever that discover step did not run | — |
|
|
74
|
+
| `image_read` (optional) | `true` \| `false`: whether this host's sub-agents can read image files (a2h-app-migrate probes it at bootstrap and passes it). **When not passed, probe it** (below) before the first dispatch; never assume `true`, and never probe by opening an image in the parent | — |
|
|
82
75
|
| `MODE` | `full` \| `incremental`, per Mode Routing | existing Harmony version + a named page/module ⇒ `incremental` |
|
|
83
76
|
| `scope_request` | **Incremental only, required.** The user's own words for the range | "短视频播放页", "短视频模块所有缺失页面" |
|
|
84
77
|
|
|
@@ -86,9 +79,18 @@ If `android_project_dir`, `harmony_project_dir` or `apk_path` is missing, **ask
|
|
|
86
79
|
|
|
87
80
|
Then, once in the parent, resolve these and pass them to every later step and sub-agent:
|
|
88
81
|
|
|
82
|
+
- **`host_caps.json`**: `${harmony_project_dir}/.hometrans/work/host_caps.json` must hold `image_read` before the first dispatch (Step 2). `group_queue.mjs` reads it on every lease (Step 0.1 item 5a).
|
|
83
|
+
- **Passed by the caller**: write `{"image_read": <true|false>}` as given.
|
|
84
|
+
- **Not passed → probe it with one throwaway sub-agent, before any other dispatch** (resources, reviewers and groups all wait for it, so a text-only host never loses a real unit to its first PNG):
|
|
85
|
+
1. `node ./scripts/image_probe.mjs prepare --hp ${harmony_project_dir}` → one JSON line `{image, state, prompt}`.
|
|
86
|
+
2. Dispatch **one** fresh sub-agent with `prompt` verbatim, and wait for its reply in the foreground (it takes seconds; no `bind`, never resumed or reused). **The parent never reads the probe image itself**: on a text-only host that breaks the parent's own session.
|
|
87
|
+
3. Write its reply verbatim to a file, then `node ./scripts/image_probe.mjs verify --hp ${harmony_project_dir} --reply-file <that file>`. If the sub-agent call errored (e.g. `messages.content.type` invalid), write the error text as the reply. Never put the reply on the command line: error texts are JSON with quotes, `$` and backticks that break shell quoting. The verdict is `true` only for the right 6 digits, and `verify --hp` writes it with its `probe_reason` to `host_caps.json`.
|
|
88
|
+
4. Anything unexpected (the script exits non-zero, no sub-agent tool) → write `{"image_read": false}` and note why. Never fall back to `true`.
|
|
89
|
+
Step 7 reports how `image_read` was decided (passed / probed + `probe_reason`).
|
|
89
90
|
- **`ALL_MODULES`**: every module under `${harmony_project_dir}` with `src/main/ets` or `src/main/resources`.
|
|
90
|
-
- **`PARADIGM = V1 | V2`**: run
|
|
91
|
-
- **
|
|
91
|
+
- **`PARADIGM = V1 | V2`**: run `node ./scripts/detect_paradigm.mjs ${harmony_project_dir}` and use its `paradigm` field as-is (rule: `./references/state-mgmt/_范式选择说明.md`). Do not grep decorators by hand: the DevEco scaffold `pages/Index.ets` (`@Component` + `@State message`) is not evidence of an existing V1 project, and the script ignores it, so a freshly created project correctly defaults to V2. It is project-level, so sub-agents must not re-detect it.
|
|
92
|
+
- **References**: always skill-bundled, with no user override: mappings `./references/mappings/` and the state-management cheat sheet `./references/state-mgmt/_装饰器速查.md` (one file for both paradigms). They are loaded lazily. The official V1/V2 state-management docs are **not** bundled: a sub-agent reads one with `node ./scripts/state_doc.mjs read <key> --project ${harmony_project_dir}` (keys in the cheat sheet's 深读 columns, `list` prints them all), and only for what the cheat sheet doesn't cover. Prompts must never tell an agent to read a whole doc directory, and never to run `devecocli docs search` itself.
|
|
93
|
+
- **`STATE_DOCS`**: run `node ./scripts/state_doc.mjs check --project ${harmony_project_dir}` once (it resolves every key through `devecocli docs` and caches the IDs in `.hometrans/work/state_docs.json`). On exit 1 (meaning of each message: [references/host-dispatch.md](references/host-dispatch.md)), **stop and ask the user before Step 5**: fix it, or explicitly accept converting without the official docs. Only on that explicit acceptance, tell every prompt `STATE_DOCS=unavailable`; agents then use the cheat sheet alone, and the Step 7 report says so.
|
|
92
94
|
|
|
93
95
|
## Step 2 — Resource Conversion
|
|
94
96
|
|
|
@@ -217,17 +219,21 @@ If a task-tracking tool is available, create one task per page, with already-`do
|
|
|
217
219
|
|
|
218
220
|
## Step 5 — Per-Group Conversion
|
|
219
221
|
|
|
220
|
-
**Read [references/step5-convert.md](references/step5-convert.md) in full before writing the first prompt.** It holds the per-group prompt inputs (5.1), the sub-agent contract every prompt carries (5.2), the scheduling rules (5.3), the work-queue loop, what `release` decides and the verification tables (5.4), and
|
|
222
|
+
**Read [references/step5-convert.md](references/step5-convert.md) in full before writing the first prompt.** It holds the per-group prompt inputs (5.1), the sub-agent contract every prompt carries (5.2), the scheduling rules (5.3), the work-queue loop, what `release` decides and the verification tables (5.4), and the wiring sub-agent (5.5).
|
|
221
223
|
|
|
222
224
|
- **5.1–5.2** One prompt file per group, `<prompts_dir>/<GID>.md`: Step 5.1's inputs, Step 5.2's contract, `SOURCE_PACK` = `group_packs/<GID>.md`. `REFERENCE_SCREENSHOTS` / `REFERENCE_VIEW_TREES` list every frame of every state from `group_packs/<GID>.evidence.json`, grouped by state. Substitute every placeholder, keep each prompt under 48 KB, and forbid `git` and sub-agent dispatch.
|
|
223
225
|
- **5.3** host-chain groups run serially, self-contained groups concurrently; `group_queue.mjs` applies the rules from `plan`. When in doubt, serialize. Rule 7 binds every concurrent prompt:
|
|
224
226
|
|
|
225
227
|
7. **The shared registry surface is parent-owned while any other group is in flight.** Every concurrently dispatched group's prompt states: do not edit `main_pages.json`, `resources/**/element/*.json`, `oh-package*.json5`, `module.json5` or the ability's `loadContent()`. Instead, list the additions in the report under `registry_requests`. The parent applies each group's requests when that group is released, one group at a time. Merge, never overwrite: an existing name with a different value is a conflict, so keep the existing value and record it in the report.
|
|
226
228
|
- **5.4** Never dispatch blocking waves. `Q init` once, then one pass per parent turn: release (`Q reap` → `Q release`), lease and dispatch (`Q lease`, pass `message` verbatim, `Q bind`), verify every `returned_unverified` group (`phase5_check.mjs --group`, `Q verified`, `group_commit.mjs`), then `Q wait` with a shell timeout above 9 min. Go on only when `summary.idle` is true, nothing is unverified and `summary.stuck` is empty.
|
|
227
|
-
- **5.5**
|
|
229
|
+
- **5.5** One background sub-agent (Step 0.1) does the wiring: confirm every `registry_requests` was applied, wire self-contained components and shell hosts, and wire navigation from `navigates_to`. No group is in flight any more, so this agent may edit the registry surface of Rule 7. The parent writes `${harmony_project_dir}/.hometrans/work/prompts/wiring.md` (the Step 5.5 procedure of step5-convert.md plus its inputs), dispatches it the way Step 2 is dispatched, and joins on `.hometrans/work/wiring.report.md`. **Gate (parent re-checks after the join):** `orphan-component` is zero, and `phase5_check.mjs --files <every file changed since the last group commit>` has `blocking` 0, before Step 6. Take that file list from `git status --porcelain` (modified and untracked), not from the report: a file the agent edited but left out of the report would otherwise skip the gate and still be committed. The parent then commits the wiring.
|
|
228
230
|
|
|
229
231
|
## Step 6 — Static Check, Build, Smoke Gate
|
|
230
232
|
|
|
233
|
+
**Steps 6.1–6.4 run in one background sub-agent (Step 0.1), dispatched after the Step 5.5 gate passes and the wiring is committed.** The parent writes `${harmony_project_dir}/.hometrans/work/prompts/verify.md` with this whole Step 6 section, `harmony_project_dir`, `android_project_dir`, `ui_module`, `ALL_MODULES`, `DEVECO_HOME`, `ADB_SERIAL` / `ADB_PATH` and `ui_info_root`, and dispatches it the way Step 2 is dispatched: "Read `<that file>` and follow it fully. When done, write your full report to `${harmony_project_dir}/.hometrans/work/verify.report.md` and reply with one line `DONE verify`." The agent itself runs the `a2h-fix-build-errors` and `a2h-coldstart-smoke-gate` skills (neither dispatches sub-agents). It never asks the user. A login in the smoke gate comes back as its `DEPLOY_ERROR` with the instruction. Where `a2h-fix-build-errors` would ask (no DevEco path resolves, `devecocli` is not on PATH), the agent stops, writes `BLOCKED: <the human step>` at the top of the report and ends; the parent relays that step to the user and resumes the agent once it is done. The prompt forbids `git` and dispatching sub-agents. The report carries, for Step 7: the 6.1 `[GATE]` count of the last run and every `[CANDIDATES]` item reviewed but deliberately not fixed, with the reason; the 6.2 outcome; the 6.3 verdict with evidence path; the 6.4 screenshot paths, the fixes made and what is left; and every file edited.
|
|
234
|
+
|
|
235
|
+
**Join** on the report file, as in Step 2. Then the parent re-runs the 6.1 command once (it takes under a second); a non-zero `[GATE]` means the agent's report is wrong, so resume the agent in its own session with that output. The parent also runs `phase5_check.mjs --files` on every file `git status --porcelain` shows since the wiring commit (`blocking` 0), for the same reason as in 5.5. The parent commits the agent's fixes and writes Step 7 from the report.
|
|
236
|
+
|
|
231
237
|
### Step 6.1 — Static check (no device, no build, under a second)
|
|
232
238
|
|
|
233
239
|
```
|
|
@@ -248,7 +254,7 @@ node ./scripts/arkts_static_check.ts \
|
|
|
248
254
|
- **Re-run 6.1 after every Step 6.2 fix round that edits `.ets` or `module.json5`.** Build fixes reintroduce GATE defects the compiler accepts (orphaned components, shadowed attributes); the build passing is not the static check passing.
|
|
249
255
|
- **Wildcards.** `--ets` / `--resources` are repeatable and accept a `*` segment. The checker expands wildcards itself and skips paths that do not exist, so passing all four layouts is correct even in a single-module project.
|
|
250
256
|
- **Quote every pattern containing `*`.** PowerShell does not glob for native commands. An unquoted pattern scans one module and still prints `[GATE] 0 条`. Read the first output line (`扫描 N 个 .ets 文件(4 个模块: …)`); it is the only sign of a wildcard that matched nothing.
|
|
251
|
-
- **Never capture output with PowerShell `>`.** Windows PowerShell 5.1 writes it as UTF-16LE: the file reads `[ G A T E ]`, and a grep for `[GATE]` finds 0
|
|
257
|
+
- **Never capture output with PowerShell `>`.** Windows PowerShell 5.1 writes it as UTF-16LE: the file reads `[ G A T E ]`, and a grep for `[GATE]` finds 0 . Use `cmd /c "<command> > <log> 2>&1"`, and take the result from the exit code. The same applies to build logs; see `a2h-fix-build-errors` §1.3.
|
|
252
258
|
- **Pages.** A file is a page only if it declares `@Entry`; `shell-content` components may live under `pages/`.
|
|
253
259
|
- **Union of roots.** Cross-module facts are resolved over the union of the roots passed: `orphan-component`'s import surface, `entry-route-not-converted`'s `loadContent` target, and resource lookups. Pass every participating module.
|
|
254
260
|
- **`--android`** enables the immersive cross-check. It greps for `enableEdgeToEdge` / `setDecorFitsSystemWindows` and, when no Harmony component extends into the bars (`ignoresLayoutSafeAreaEdges` / `expandSafeArea`), lists the call sites under `[CANDIDATES]`. This defect is invisible on the Harmony side alone, because an edge-to-edge page looks the same shape as a bar-avoiding one. It also enables the GATE `framework-picker-appearance`: an Android `TimePicker` / `DatePicker` (or their dialogs) in its default clock / calendar mode, converted to the ArkUI wheel of the same name (conversion-procedure.md Phase 4.3「外观替换」). Omitted, both checks are skipped silently. Independent of `--android`, `window-fullscreen-layout` and `system-bar-height-read` are GATEs: a window-level full-screen layout, or any read of a bar height, breaks the `system_bars` policy.
|
|
@@ -259,8 +265,7 @@ Output has two sections, and the exit code is `1` only when the first is non-emp
|
|
|
259
265
|
- **`[GATE]`** — zero-ambiguity defects. **Fix every one before building.** Two of them:
|
|
260
266
|
- `entry-route-not-converted`: `loadContent()` in the `UIAbility` does not point at a converted page, so the app launches the scaffold's Hello World. It fires only once converted pages exist.
|
|
261
267
|
- `orphan-component`: see Step 5.5.
|
|
262
|
-
-
|
|
263
|
-
- Shell rules, active only when the plan has `presentation: shell-content` groups (the checker reads `<harmony_project_dir>/.hometrans`, derived from the first `--ets` root; pass `--hometrans <dir>` when the layout differs): `shell-content-has-entry`, `chrome-duplicated-in-content-page`, `transition-undeclared-but-animated`, `transition-pair-mismatch`. The `[CANDIDATES]` list also gains `dead-nav-todo`: a navigation `TODO` is legitimate only when its target is a `skip` row. Apps without a shell host see none of these.
|
|
268
|
+
- Every other rule (layout placement, shell rules, resource content, SDK, a11y …): what it detects, how to fix it and its downgrade marker are in [references/checker-rules.md](references/checker-rules.md), one `### <rule-id>` section per rule. Look up only the ids that fired (`grep -n "### <id>"`). Shell rules are active only when the plan has `presentation: shell-content` groups (the checker reads `<harmony_project_dir>/.hometrans`; pass `--hometrans <dir>` when the layout differs).
|
|
264
269
|
- **`[CANDIDATES]`** — not defects, but a narrowed worklist whose correctness depends on Android-side intent. Feed each into the matching Phase 5 item (位置锚点证据 / 交互可达性证据 / 窗口模式证据) with its source. Do not "fix" a candidate just because it is listed; a full-size container is usually legitimate.
|
|
265
270
|
|
|
266
271
|
### Step 6.2 — Build
|
|
@@ -275,13 +280,6 @@ Run the `a2h-coldstart-smoke-gate` skill with `harmony_project_dir`, then record
|
|
|
275
280
|
- `FAIL_*`: the verdict + evidence path; a human takes over;
|
|
276
281
|
- `SKIPPED_*`: "smoke gate not run — <reason>";
|
|
277
282
|
- `DEPLOY_ERROR` (signing / install / build / device failed, or login needed): "smoke gate could not deploy — <the gate's message>", including any instruction it carries (e.g. run `devecocli auth login`, then re-run the gate).
|
|
278
|
-
### Step 6.4 — Render check (device)
|
|
279
|
-
|
|
280
|
-
The smoke gate only proves the app starts. Static checks and the build pass a page whose cards are transparent, whose clip path is in the wrong unit or whose top bar is centred. After `PASS`, on the same device:
|
|
281
|
-
1. `devecocli ui screenshot --path <work>/render_<page>.png` and `devecocli ui layout` for the landing page and every page one tap away from it (follow `REACHED_FROM`/`NAVIGATES_TO`; skip pages needing data the mock cannot provide).
|
|
282
|
-
2. Compare each against its Android capture in `ui_info` (side by side: module backgrounds, card order and count, every card's visible content, top/bottom bar placement, icon vs text). For a source-only page compare against the source composable/XML: every section the source renders must show its content, and every chrome element must sit where the source puts it.
|
|
283
|
-
3. Read the layout dump for mechanical tells: a panel whose children are clipped to a small part of its bounds, a full-width bar whose top is far from the screen top/bottom, a panel with no visible text where the source shows some.
|
|
284
|
-
4. Fix what is wrong in this run, then repeat 6.1–6.3. Anything left goes to Manual Follow-up TODOs with the screenshot path.
|
|
285
283
|
|
|
286
284
|
## Step 7 — Final Report
|
|
287
285
|
|
|
@@ -304,7 +302,9 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
|
|
|
304
302
|
- **Source-only pages awaiting visual calibration** — these were converted from source. List each with its uncertain items (template-borrowed or framework-default values). Re-running Step 3.2 with a fixture, then `build_conversion_set.mjs`, flips them to `captured`, and resume resets them to `pending`.
|
|
305
303
|
- **Pages needing manual setup** — every `deferred_human.json` entry (login, content/data state, server address, default-app role), with `axes` / `affected_nodes` / `instructions` verbatim. In full mode, fold `derived: true` entries under the base phase they retry. These pages were converted source-only; the list says which fixture would let them be calibrated. Full mode picks them up by re-running Step 3.2 with the fixture; incremental mode by re-running I5.
|
|
306
304
|
- **Tree-only pages (`待人工复核`)** — `conversion_set.json` rows marked `pixels: "blocked"`. Their screenshots were FLAG_SECURE-blocked, so geometry came from the view tree only and nothing compared them with pixels. List each one with its `card-width-wraps` / `text_color` status, plus the colours and borders that were taken from source.
|
|
305
|
+
- **Pages captured only before their data arrived (`待人工复核`)** — `meta.json` `content_loading.primary: true` with empty `loaded_views` (the export warns about them). No capture shows the page's data: its texts in view.xml are layout defaults (`%1$s`), and the populated look was derived from source binding code. List each one with the placeholder texts and how the data is bound; re-running Step 3.2 with a longer `content_wait_seconds` or a data fixture recaptures it.
|
|
307
306
|
- **Uncaptured popups and menus** — attached `panel` nodes with no capture directory, such as a menu that only appears after a tap. Give each one's Harmony implementation (`bindMenu` / dialog). Any custom-drawn overlay must carry its `APPEARANCE-ESCALATED` ruling.
|
|
307
|
+
- **No visual comparison (`image_read=false`)** — say how it was decided (passed by the caller, or the Step 1 probe and its `probe_reason`). This host's sub-agents could not read images, so no page was compared with its screenshots by eye; geometry, alignment and pull/transition visuals rest on view trees and measurements only. List every captured page, and name the items a reviewer should check on screen first (indicator positions, left/right alignment of buttons, deviations the reports noted).
|
|
308
308
|
- **Captured but not converted** (full mode) — `export_manifest.json`'s `dynamic_only` count and `foreign_tree_captures`.
|
|
309
309
|
- **Degraded items (`已降级`)** — icons that could not be sourced (Phase 4.3 L3), and transitions declared but not implemented (过渡实现证据). They may ship degraded, but not unmentioned.
|
|
310
310
|
- **Pending fetch (`待拉取`)** — Phase 4.3 **L2.5-Remote** icons. Give the original web path, the absolute URL, the suggested media name, and what the page renders meanwhile. Keep this list separate from `已降级`: these need only a download, whereas an L3 needs new artwork.
|
|
@@ -316,6 +316,6 @@ Write the cumulative report to `${harmony_project_dir}/.hometrans/batch_report.m
|
|
|
316
316
|
- **Use the right resource.** Find it in `harmony_project_dir`; if it is missing, find it in `android_project_dir` and transfer it. Never invent one.
|
|
317
317
|
- **Never fabricate a measurement for a source-only page.** No px/vp from "typical" screens, and no colour picked by eye from a template's screenshot for a region the template does not share. Use XML dp, theme/style resolution, template-shared values or framework defaults, each labelled as such.
|
|
318
318
|
- **Work through the 常见误译速查 table** at the end of Phase 5 before declaring a page done. It is the static backstop; Step 6.4 is the runtime one.
|
|
319
|
-
- **Edit `.ets` / `.json5` / `.json` only with the file edit/write tools, or a script that reads and writes UTF-8 explicitly.** Never `Get-Content … -replace … | Set-Content` or `(Get-Content f) -replace` in Windows PowerShell 5.1: it reads UTF-8 without BOM as the ANSI code page (GBK) and writes it back mangled.
|
|
319
|
+
- **Edit `.ets` / `.json5` / `.json` only with the file edit/write tools, or a script that reads and writes UTF-8 explicitly.** Never `Get-Content … -replace … | Set-Content` or `(Get-Content f) -replace` in Windows PowerShell 5.1: it reads UTF-8 without BOM as the ANSI code page (GBK) and writes it back mangled.
|
|
320
320
|
- **Incremental mode never overwrites a `placeholder` page without a backup.** Copy the existing `.ets` to `<same dir>/<name>.bak.<timestamp>` before the sub-agent writes, and report the path in §0b. The backup never goes under `resources/` (contract item 2).
|
|
321
|
-
- **Incremental mode may edit `loadContent()` and the app entry, and GATE `entry-route-not-converted` stays in force.** A migrated page that is routable but never reachable from the ability is invisible work. But if reconciling the route would change which screen an existing app opens on, say so and let the user decide.
|
|
321
|
+
- **Incremental mode may edit `loadContent()` and the app entry, and GATE `entry-route-not-converted` stays in force.** A migrated page that is routable but never reachable from the ability is invisible work. But if reconciling the route would change which screen an existing app opens on, say so and let the user decide.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 知识卡 — 对齐与水平内缩
|
|
2
|
+
|
|
3
|
+
> 必读。Phase 5「文字对齐证据」「水平内缩证据」的判据。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
### Phase 5「文字对齐证据」—— 判据
|
|
7
|
+
|
|
8
|
+
**两种容器的该轴属性不同名,必须按容器类型取**:`Column` 的水平方向是交叉轴 → `.alignItems(HorizontalAlign.*)`;`Row` 的水平方向是主轴 → `.justifyContent(FlexAlign.*)`。
|
|
9
|
+
`Row` 上的 `.alignItems(VerticalAlign.*)` 管的是**纵轴**,**不满足本项** —— 它常常本身完全正确(对应 Android 的 `verticalAlignment`/`gravity="center_vertical"`),正因如此最容易被当成"对齐已经写了"而放过:一个正确的纵轴设置掩盖了缺失的横轴设置,两处单看都没错。实测漏检形态是日期分隔行、章节标题居中而 Android 齐左。判据:宽度撑满的 `Row` 里若有收缩宽度的 `Text`,就必须能指出是哪个属性把它定在了左边。**ArkUI `Column` 默认居中、Android `LinearLayout`/Compose `Column` 默认 start** —— Android 侧未写 gravity 时必须显式译成 `.alignItems(HorizontalAlign.Start)`,不能同样"不写"。未显式声明且未说明依据者判定失败(居中确为本意时,注明理由即可通过,例如空态插图、按钮内图标)。此项漏检的典型表现是章节标题、列表项文字整体居中而 Android 是齐左,且逐属性对照会确认成"翻译正确"。
|
|
10
|
+
**对齐要看父容器,不只看含 Text 的那个容器**:`Column` 的子节点里只要有**收缩宽度**的容器(未设 `.width()` / `.layoutWeight()` 的 `Row`/`Column`/`Stack`,典型是「图标 + 标题」行),决定它水平位置的是**父** `Column` 的 `alignItems`,子 `Row` 自己的 `justifyContent(FlexAlign.Start)` 只管 Row **内部**,管不到 Row 在父中的位置。实测漏检:卡片标题行 `Row() { Image; Text }` 被报 `container-align-unset`,回答「Row 主轴默认 Start」本身正确,于是放行,而真正让它居中的是未写 `alignItems` 的卡片 `Column`。修法:父 `Column` 显式 `.alignItems(HorizontalAlign.Start)`,或给子行 `.width('100%')`。检查器 CAND `column-shrink-child-centered`。
|
|
11
|
+
**`Scroll` 的 `.align()` 决定内容短于视口时的位置**,默认 `Alignment.Center`。**`Alignment.Start` = 左 + 垂直居中,不是左上**。Android `ScrollView`/`NestedScrollView`/`RecyclerView` 内容默认从顶部开始,通常应取 `Alignment.TopStart`(或 `Top`/`TopEnd`)。例外要有 Android 依据:`fillViewport="true"` + 子布局 `gravity="center"`(登录页、空状态页居中)对应 `Alignment.Center`;`stackFromEnd`/`reverseLayout`(聊天页靠底)对应 `Bottom*`。检查器:`Alignment.Start` 报 GATE `scroll-align-not-top`(几乎必是误当左上);其余非 Top 值报 CAND `scroll-align-not-top`、未写报 CAND `scroll-align-default-center`,有上述依据时注明即可。
|
|
12
|
+
**Compose `Box` 子节点的单独对齐(`Modifier.align(X)`)**:`Box(contentAlignment = C)` 里子节点写 `Modifier.align(X)`(X ≠ C)时,该子节点按 X 放、其余按 C 放。ArkUI `Stack` 没有按子节点的对齐,子节点 `.align()` 只排它自己的内容,所以 X 必须单独表达:把该子节点包进与 Stack 同尺寸的容器并在容器里按 X 排(`BottomCenter` + `padding(bottom = 5.dp)` → `Column() { … }.width('100%').height('100%').justifyContent(FlexAlign.End).padding({ bottom: 5 })`;`CenterStart` → `Row()…justifyContent(FlexAlign.Start)`),或用 `.position` / `.markAnchor` 定位。**只留下 `padding` 改成单侧 `margin` 不算译了对齐**:Stack 仍居中,它压在居中的兄弟上。group pack 的「Box children with their own alignment」一节列出本组每一处(`文件:行号`),本项逐条给出鸿蒙侧的 `文件:行号` 与所用写法。检查器:显式 `alignContent: Alignment.Center` 与不写一样走 GATE `stack-overlay-default-center` / `stack-child-align-noop`。
|
|
13
|
+
|
|
14
|
+
### Phase 5「水平内缩证据」—— 判据
|
|
15
|
+
|
|
16
|
+
- **对得上实测**:鸿蒙侧该 `Text` 到父容器左缘的距离(沿途所有祖先的 `padding` + 自身 `margin` 之和)必须等于 Android `boundsPx.x1 − 父.x1`(换算成 vp),依据写 `约束求解实测` 或 XML 显式 dp。父取它在 view tree 里真正的布局父节点,不是屏幕左缘。
|
|
17
|
+
- **同组同缩进**:measure_summary 的「文本左缘」栏按相同 x 把文本分了组。**同一组的文本在鸿蒙侧必须落在同一左边距上**;不同组之间的差值也要对得上。若某个 `Text` 落在其他组,或该组文本被拆进不同组件、各自写了不同 `padding`,必须给出 Android 依据(例如某行确实带图标、某行 `layout_marginStart` 不同)。
|
|
18
|
+
- **右缘同理**:「文本右缘」栏只列至少占半宽的框(`match_parent`/`0dp` 撑开的),这些框的右边距同样要对上。
|
|
19
|
+
- 判据:拆成多个 `@ComponentV2`/`@Builder` 的列表(分类行 + 条目行、标题行 + 内容行)最容易漏——每个组件单看都「齐左」,但其中一个漏了缩进。实测漏检:设置页 `PreferenceCategory` 标题与 `Preference` 条目同在 x=189px=72vp(androidx Preference 默认 `iconSpaceReserved=true`),条目行写了 `padding({ left: 72 })`,分类行只写了上下 padding,"Language"/"Units" 贴边显示,而「文字对齐证据」判为通过。
|
|
20
|
+
- 写法:`// EVIDENCE(水平内缩证据): 72vp 组 = 分类行 padding.left 72 + 条目行 padding.left 72 —— 依据: 约束求解实测 view.xml:207/217(x=189px/2.625)`。
|
|
21
|
+
|
|
22
|
+
## 常见误译(编译期无法发现)
|
|
23
|
+
|
|
24
|
+
| 误译 | 为什么会发生 | 后果 | 自查方法 |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| **`Stack()` 里用子节点 `.align(Alignment.Bottom)` 贴底** | 把 `.align` 当成"本节点在父中的对齐" | `.align` 只排子节点自己的内容;`Stack` 默认 `alignContent: Center`,底部导航悬在屏幕中部 | 贴底/贴边由 `Stack({ alignContent })` 决定;跨页共享 chrome 用宿主容器组件(step5-convert.md 合同第 7 条)。GATE `stack-child-align-noop` |
|
|
27
|
+
| **从别页复制 chrome 调用、漏抄父 `Stack` 的 `alignContent`** | 只复制 `Bar(...).margin({ bottom })`,根容器写成 `Stack()` | 默认 Center 下 `margin.bottom` 只上移几 vp,导航栏停在屏幕中部,复制了同一调用的页面全部如此 | 复制时连 `Stack({ alignContent })` 一起复制;宿主 Activity 只画一份 chrome 时建壳(step5-convert.md Step 5.5)。GATE `stack-overlay-default-center` / `shared-chrome-placement-drift` |
|
|
28
|
+
| **容器对齐默认值两端相反** | ArkUI `Column`/`Row` 默认居中,Android 默认 start;两边都不写时字面一致 | 收缩宽度的 `Text`、标题整体居中,而 Android 齐左 | → Phase 5「文字对齐证据」(含父容器一段);CAND `container-align-unset` / `column-shrink-child-centered` |
|
|
29
|
+
| **Compose `Box` 译成裸 `Stack()`** | 组件映射表写「Box → Stack」,两边都不写对齐时字面一致 | Compose `Box` 默认左上,`Stack` 默认居中:顶栏图标、角标落到屏幕/卡片中部 | `Box()` → `Stack({ alignContent: Alignment.TopStart })`,`Box(contentAlignment = X)` → X;GATE `stack-bar-default-center` |
|
|
30
|
+
| **`Box` 子节点的 `Modifier.align(X)` 被丢掉** | 映射成 `Stack({ alignContent: C })` 后,子节点上只剩 `.padding(…)`,顺手译成单侧 `margin` | 标签/角标停在 Stack 中部,与居中的数字、图标重叠(「UV」压在数字上) | 子节点包一层与 Stack 同尺寸、按 X 排的 `Column`/`Row`,或 `.position`/`.markAnchor`;逐条对照 group pack「Box children with their own alignment」;GATE `stack-overlay-default-center` |
|
|
31
|
+
| **`Alignment.Start` 被当成「左上」** | ArkUI 九宫格 `Start` = 左 + 垂直居中,左上是 `TopStart` | `Scroll` 内容短于视口时悬在屏幕中部 | → Phase 5「文字对齐证据」的 `Scroll` 段;GATE `scroll-align-not-top` |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 知识卡 — SDK 与平台默认值
|
|
2
|
+
|
|
3
|
+
> 必读。查 API、查默认值的方法。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
- **API 编译不过 ≠ 语义取反**(不限于 Canvas):编译器报某个属性/方法/枚举不存在时,说明的只是**这个写法**不存在,不说明该能力的语义与你的设想相反。改代码前先打开该类在 SDK `.d.ts` 里的声明,查**构造参数和 `@default` / `Default value`**,在 Phase 5 报告里引用 `.d.ts` 文件与行号,再决定单位或语义。上面的 Canvas 事故就是跳过了这一步:只查了 `font` 的说明,没看构造函数的 `unit` 参数。
|
|
7
|
+
|
|
8
|
+
## 常见误译(编译期无法发现)
|
|
9
|
+
|
|
10
|
+
| 误译 | 为什么会发生 | 后果 | 自查方法 |
|
|
11
|
+
|---|---|---|---|
|
|
12
|
+
| **在别的 SDK 副本里查 API 是否存在** | 机器上有多份 SDK,搜到的第一份不是构建用的那份 | 误判接口不存在而改用降级写法 | 只查壳契约 `SDK` 段的 `component_dts_dir`;该段为空时以构建日志里的 SDK 路径为准 |
|
|
13
|
+
| 平台默认值差异 | 同名属性两端默认行为不同(如 sheet 键盘避让 ArkUI 默认 `TRANSLATE_AND_SCROLL`,Android 默认 `adjustResize` 是压缩) | 参考截图与实现产出不一致,且无任何报错 | 凡依赖"默认行为"的属性,查 SDK `.d.ts` 确认默认值;与 Android 不一致时**显式设置**,不要继承默认 |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 知识卡 — 自绘 View(Canvas / Path)
|
|
2
|
+
|
|
3
|
+
> 条件卡:本组有 `onDraw` / `Canvas` / `Path` / Compose `drawBehind` 时必读。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
- **自绘 View 的绘制分支**:移植 `onDraw` / `Canvas` 时,沿 `onDraw` 的调用图列出每个 `drawXxx(...)` **及其守卫条件**(如 `CalendarTimelineView.kt:450` `if (compact && days.size == 1 && showCourseSlots) drawCompactCourseSlotLabels(canvas)`)。只移植"首屏用到的那几个 draw"是本条最常见的漏法:实测日视图的「第 N 节 08:00-08:45」节次胶囊整段漏掉,周视图截图(已捕获)完全一致,日视图(未捕获)与源 App 不同,报告仍写「清单缺项:无」—— 因为清单只登记了"过渡",没登记"分支"。
|
|
7
|
+
- **自绘文字的字号单位**:`Paint.textSize` 是 px,源码一般写成 `sp(N)` / `dp(N)` / `applyDimension(...)` 换算。ArkUI `CanvasRenderingContext2D.font` 的字号单位只能是 `px` 或 `vp`,并且必须写明(SDK `canvas.d.ts`),其中 `px` 是**物理像素**。所以 `sp(N)` 要写成 `` `${N}vp` ``;要跟随系统字体缩放,就写 `` `${this.getUIContext().fp2px(N)}px` ``。**不能**把 sp 的数值直接接上 `px`。同一个 Canvas 的坐标默认按 vp 计,单位写错时排版位置照样正确,只有字小了一圈(density 2.625 时约为原来的 38%),几何自检会全部通过。自绘文字在 view tree 里没有节点,也没有 measurement;group pack 的「Canvas-drawn text」一节会列出每个 `drawText` 及其字号来源,逐条对照即可。机械兜底:GATE `canvas-font-px-literal`。
|
|
8
|
+
- **自绘几何的坐标单位**:`CanvasRenderingContext2D` 的单位只由构造参数决定:`new CanvasRenderingContext2D(settings, unit?)`,`unit` 缺省为 `LengthMetricsUnit.DEFAULT`,**即 vp**(SDK `canvas.d.ts` 构造函数;`Graphics.d.ts` `DEFAULT = 0 // Length in vp`)。坐标、`lineWidth`、`setLineDash`、`measureText()` 的返回值都按 vp。Android 的 `dp(N)` 直接写 `N`,**不要**再乘 `vp2px(1)` / `densityPixels`,`measureText().width` 也不要再除以密度。确实需要物理像素时,构造为 `new CanvasRenderingContext2D(settings, LengthMetricsUnit.PX)`(`import { LengthMetricsUnit } from '@kit.ArkUI'`),不要手工乘密度。**没有** `ctx.units` 属性,也**没有** `CanvasUnit` 枚举。坐标多乘一次密度时,框、线放大 density 倍,定宽 Canvas 外侧的内容被裁掉,而 `vp` 字号不随之放大,编译、smoke、几何自检全部通过。机械兜底:GATE `canvas-coord-density-scaled`,`ctx.units =` / `CanvasUnit` 命中 GATE `sdk-api-nonexistent`。
|
|
9
|
+
- **`Path` / 裁剪路径的 commands 单位是 px**:`Path({ commands })`、`.commands()`、`new Path({ commands })` 作 `.clip()` / `.clipShape()` 参数、`PathShape({ commands })` 的 SVG 路径串单位都是**物理像素**(SDK `path.d.ts`:「The unit is px」),而 `Path` 的 `width`/`height` 与 `onAreaChange` 给的 `Area.width/height` 是 vp。用 vp 数值拼 commands 时裁剪区缩小为 1/density。Compose 的 `clip(GenericShape { … })`、`drawBehind { path… }` 里是 px(`size` 本身就是 px),移植时同一几何要用 `vp2px()` 换算后再拼进 commands。机械兜底:GATE `path-commands-vp`。
|
|
10
|
+
|
|
11
|
+
## 常见误译(编译期无法发现)
|
|
12
|
+
|
|
13
|
+
| 误译 | 为什么会发生 | 后果 | 自查方法 |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| **Canvas 字号照抄 sp 数值并接上 `px`** | `Paint.textSize = sp(9f)` 读成"9 号字" | Canvas 里的 `px` 是物理像素,字只有原来的 1/density | `` `${N}vp` `` 或 `fp2px(N)` + `px`。GATE `canvas-font-px-literal` |
|
|
16
|
+
| **Canvas 坐标再乘一次密度** | 写 `ctx.units = CanvasUnit.VP` 编译不过,推断「没有 units → 坐标是物理 px」 | 缺省就是 vp,框、线、胶囊放大 density 倍,定宽 Canvas 外侧的内容被裁掉 | → 「自绘几何的坐标单位」;GATE `canvas-coord-density-scaled` |
|
|
17
|
+
| **`Path` commands 用 vp 数值** | `Path` 的 width/height 是 vp,commands 也按 vp 写最自然 | commands 是 px:裁剪区缩为 1/density,卡片内容被裁掉 | `vp2px()` 换算后再拼;GATE `path-commands-vp` |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 知识卡 — 动态:变体、过渡、状态分支
|
|
2
|
+
|
|
3
|
+
> 必读。Phase 4.2 的三类动态登记;Phase 5「过渡实现证据」(A 档)的依据。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
**数据驱动的可见变体 —— 必须追到调用点**:当某个可见元素(图标/文案/颜色)由运行时值在多个候选中**选择**时,除映射表与枚举定义外,**必须**在 `android_project_dir` 中定位该值被**生成并传入**的位置,记录它的**作用域与粒度**:每条目各算一次、每屏一个常量、每次请求算一次。作用域搞错时,映射表与资源引用可以全部正确,渲染出的变体仍系统性错误。判据:源侧若把某值提到循环外当常量复用,译文不得改成逐条目自算;反之亦然。
|
|
7
|
+
|
|
8
|
+
**已声明的状态过渡 —— 必须逐条登记**:结构理解只描述**某一时刻**的界面,而 Android 侧常把「界面如何随交互改变」声明在布局之外的文件里。必须扫 `android_project_dir` 并逐条登记:
|
|
9
|
+
|
|
10
|
+
- `MotionLayout` 的 scene(`app:layoutDescription` 指向的 xml,内含 `<ConstraintSet>` + `<Transition>`)
|
|
11
|
+
- `<animated-selector>` / `<animated-vector>` / `<selector>` 中带状态的条目
|
|
12
|
+
- `StateListAnimator`、`res/animator/`、`res/anim/`
|
|
13
|
+
- 代码里对可见属性做的动画(`ObjectAnimator`、`animate()`、`TransitionManager`、`setDuration` 等)
|
|
14
|
+
|
|
15
|
+
每条登记「触发条件 → 变化的属性 → 起止值」。
|
|
16
|
+
|
|
17
|
+
**判据(用快照交叉验证,不靠自觉)**:`view_scroll_n.xml` 中同一 `resource-id` 的 bounds 或尺寸若在快照之间变化,且该变化**不能由滚动位移解释**(例如整块高度变小、而非整块上移),即为过渡证据 —— 必须能在本清单里找到对应条目。反之,清单里的每一条都要在 Phase 5 说明其实现状态。
|
|
18
|
+
|
|
19
|
+
**端点回代(插值过渡必做)**:把过渡写成「起止常量 + 进度插值」时,起点常量只在首帧被看见,终点常量要滚动/点击后才显形。对每个插值的位置/尺寸,在鸿蒙侧的坐标原点下(`cards/geometry.md`「硬性要求(坐标系)」)算出进度 = 0 与 = 1 时的实际矩形,与起止两份快照里同一 `resource-id` 的 bounds 逐个对照(换算成安全区 vp);列成「元素 → 端点 → 算出区间 → 快照区间」表写进「过渡实现证据」。端点算不出或对不上,该过渡不得标 `已实现`。
|
|
20
|
+
|
|
21
|
+
漏掉本节的典型后果:静态首屏完全正确,一旦滚动/点击/切换就与源 App 行为不同,而所有静态检查项均满分通过。
|
|
22
|
+
|
|
23
|
+
**状态分支清单 —— 有截图的状态对截图,没截到的才逐分支对照源码**:参考快照只覆盖一部分状态(模式页签、展开/收起、空/有数据……)。`ATTACHED_NODES` 里的每个 `ui-state`、以及本页源码里每个按状态切换渲染的分支,都要登记成一行「状态 → 判断条件(`文件:行号`)→ 该分支下的构建/绘制调用 → 证据」。证据一栏按 `REFERENCE_SCREENSHOTS` 填写:该状态有自己的 `###` 分组时,写它的帧路径,并**按这些帧转换和核对**(与主状态同等对待,含 Phase 5 各项实测);没有分组的状态写「未捕获」。未捕获的状态没有截图可对,**只能靠源码分支逐条对照**,所以必须把分支里的调用列全:
|
|
24
|
+
|
|
25
|
+
- 布局分支:`if (mode == DAY) addView(...)`、`when (selectedMode)` 等,列出每个分支里新增/隐藏的 View;
|
|
26
|
+
|
|
27
|
+
每一行在 Phase 5「过渡实现证据」里给出鸿蒙侧对应的 `文件:行号`,或 `不适用` + 理由。
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# 知识卡 — 几何:尺寸、位置、坐标系
|
|
2
|
+
|
|
3
|
+
> 必读。Phase 4.2 的坐标规则与 ConstraintLayout 转写;Phase 5「主要区域证据」「位置锚点证据」「交互可达性证据」的依据。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
**坐标与窗口模式规则(静态分析)**:
|
|
7
|
+
|
|
8
|
+
- `bounds` 是采集设备上的物理坐标,不是可直接写入 ArkUI 的 vp。
|
|
9
|
+
- 先以应用内容 bounds 为原点,将主要区域转换为相对比例:`xRatio=(x-appLeft)/appWidth`、`yRatio=(y-appTop)/appHeight`、`wRatio=width/appWidth`、`hRatio=height/appHeight`。
|
|
10
|
+
- 对比截图与 view tree,识别 Android 是沉浸式绘制还是避让系统栏;ArkUI 顶层结构必须采用相同策略。此处只产生静态实现约束,不做目标端运行时验收。
|
|
11
|
+
- 顶层页面、toolbar、主内容、列表区优先用 `Column`/`Row`/`Flex`、百分比、`layoutWeight` 和父子约束表达。禁止把原始 px 差值直接写成 `.position()`、`.height()` 或 `.margin()`。
|
|
12
|
+
- 只有 Android XML 明确定义的组件固有 dp/sp 尺寸才能按 `dp→vp`、`sp→fp` 使用;无来源的大数值固定位置/高度视为校验失败。
|
|
13
|
+
|
|
14
|
+
#### 约束布局(ConstraintLayout)→ ArkUI 的等价转写方法
|
|
15
|
+
|
|
16
|
+
`0dp` + 约束是 ConstraintLayout 表达「尺寸由约束求解」的标准写法,**不是**「尺寸为 0」,
|
|
17
|
+
也**不等于**「填满父容器」。ArkUI 没有约束求解器,必须译成显式的父子布局关系。
|
|
18
|
+
下表每行都给出错误写法及其后果 —— 这些错误全部**能编译通过**,只在真机上才显形:
|
|
19
|
+
|
|
20
|
+
| Android 写法 | 正确译法 | 错误译法 → 后果 |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| `layout_width="0dp"` + start/end 约束 + 左右 `margin` | 父容器承担内缩:父 `.padding({left,right})` + 子 `.width('100%')`;或子用 `.layoutWeight(1)` | 子同时写 `.width('100%')` 和 `.margin({left,right})` → ArkUI 的 `100%` 以父内容区为基准且**不扣除自身 margin**,实际宽度 = 父宽 + 左右 margin,**右侧溢出**(圆角/描边被裁掉) |
|
|
23
|
+
| `layout_height="0dp"` + top/bottom 约束 | `.layoutWeight(1)`(占据剩余空间);或按参考 view tree 实测比例给显式高度 | `.height('100%')` → 取父容器全高。约束求解的结果**通常小于**父容器高度,导致该区域偏高、挤压后续内容 |
|
|
24
|
+
| 负 margin(如 `layout_marginTop="-30dp"`) | 保留为负值 `.margin({top:-30})` 或 `.offset({y:-30})`,并在报告中说明用途 | 直接丢弃 → 该块及其后所有内容整体下移,常见于「顶部区域上移贴合状态栏」的场景 |
|
|
25
|
+
| 元素自身的 `margin` | 落在**该元素**上 | 提升为父容器 `padding` → 影响同级所有子元素,同级元素被一起推移 |
|
|
26
|
+
| `layout_constraintStart_toEndOf="parent"` (被推出可见区) | 该状态下不渲染,或按需 `.visibility()` | 当作普通约束照译 → 元素错误地留在屏内 |
|
|
27
|
+
| 二维约束:某元素只与**部分**兄弟共用一段纵向区间(如右下角的「箭头 + 差值」链只贴 `parent` 底、`start_toEndOf` 第二行文字;第一行标题右侧不受约束) | 保留二维关系:`RelativeContainer` + `.alignRules()`;或 `Stack`,角落元素按 `Alignment.BottomEnd` 等单独排,主体 `Row/Column` 撑满 | 拆成一维 `Row [图标][Column(标题, 数值).layoutWeight(1)][角落元素]` → 角落元素在**整个高度**上占一列,标题可用宽度被扣掉,`wrap_content` 的单行标题折成两行、卡片变高;照抄属性逐项都对,编译与检查全过 |
|
|
28
|
+
| **固定 dp 尺寸** + `layout_constraintEnd_toEndOf="parent"` + `layout_marginEnd`(右锚定;`Bottom_toBottomOf` 同理为下锚定) | 表达为**对齐关系**而非坐标:`RelativeContainer` + `.alignRules()`(见 layout mapping 表 `ConstraintLayout → RelativeContainer`);或父 `Stack` 用 `Alignment.TopEnd` + 子 `.margin({right})`;或由父容器实测宽度推导 `x = parentWidth - marginEnd - childWidth` | 按参考分辨率算出绝对偏移写成 `.position({x: <常量>})` → 该常量**只在参考设备宽度上成立**,换到更窄的屏幕时元素右侧**移出可视区被裁切**。尺寸维度无歧义(dp 是显式的),最易漏检;或用撑满父容器的容器(`width('100%')` + `height('100%')` + 贴边对齐)承载该锚定 → 视觉正确,但它成为兄弟节点中的**最上层**,吞掉其下所有可点击元素的命中测试(`hitTestBehavior` 取默认值即响应命中),该区域点击全部失效 |
|
|
29
|
+
|
|
30
|
+
**硬性要求(尺寸)**:顶层区域与主要区域的每个宽高值,必须能追溯到以下两者之一 ——
|
|
31
|
+
(a)参考 view tree 的**约束求解实测结果**,(b)Android XML 里的**显式 dp 声明**。
|
|
32
|
+
把父容器尺寸当作子元素的约束尺寸,属于校验失败。
|
|
33
|
+
判据:若某区域在参考 view tree 中的实测尺寸与父容器不同,就**不能**用 `'100%'` / `.height('100%')` 表达。
|
|
34
|
+
|
|
35
|
+
**硬性要求(位置)**:**每个位置锚点**同样必须可追溯,且必须额外标注它属于哪一类 ——
|
|
36
|
+
(a)**固定偏移**:Android 侧本身就是相对父容器起始边(start/top)的固定 `margin`/`padding`;
|
|
37
|
+
(b)**由父尺寸推导**:Android 侧是右/下/居中锚定(`constraintEnd_toEndOf`、`Bottom_toBottomOf`、
|
|
38
|
+
`layout_gravity="end|center"`、`constraintHorizontal_bias` 等),位置随父容器尺寸变化。
|
|
39
|
+
|
|
40
|
+
判据:**(b)类锚点不得写成常量坐标**。参考 view tree 量出的绝对值只是「在该参考设备上的解」,
|
|
41
|
+
不是布局意图;必须还原成对齐关系(`RelativeContainer` + `.alignRules()`、`Stack` + `Alignment`、
|
|
42
|
+
父 `padding`)或由实时父尺寸推导的表达式。
|
|
43
|
+
自查方法:对每个 `.position()` / `.offset()` 的每个坐标问一句「**把屏幕宽度改小 10%,这个值还对吗**」——
|
|
44
|
+
答案为否却仍写成常量的,判定失败。这类缺陷在参考分辨率上数值完全正确,静态校验与编译均无法发现。
|
|
45
|
+
同一个问题也要对**接近屏宽的常量宽度**问一遍(≥ 300vp 由 CAND `wide-constant-width` 列出)。弹窗面板以
|
|
46
|
+
measure_summary 的 `dialog panel` 行为准(不是带背景 inset 的 window 行),按它给的比例写成外层
|
|
47
|
+
`width('<窗口占屏宽>%')` + 左右 `padding(<内缩>)`、里层 `width('100%')`。参考机换算出的常量宽度到更窄的屏上
|
|
48
|
+
左右几乎不留边,看起来铺满屏幕。
|
|
49
|
+
|
|
50
|
+
**硬性要求(坐标系)**:参考 view tree 的 bounds 是**屏幕坐标**,沉浸页(root 从 y=0 起)里含状态栏;
|
|
51
|
+
鸿蒙内容留在安全区内(壳契约 system_bars)。所以纵向偏移与 marginTop 一律用 measure_pack 给的
|
|
52
|
+
`safeTopVp`(= (屏幕 y − 状态栏) / density,摘要「坐标系」行给出状态栏高度与来源),不要直接用屏幕 y。
|
|
53
|
+
每个控件的位置取**它自己**的 bounds,不得借用相邻控件的 margin:把一个控件的屏幕坐标 marginTop 套到另一行上,整行在安全区里多下移一段,
|
|
54
|
+
与下方内容叠在一起。
|
|
55
|
+
**偏移的原点是真正排它的那个 ArkUI 父容器**:`Column`/`Row` 里 margin 从前一个兄弟的边算起,`Stack`/`RelativeContainer`(无 alignRules 时)
|
|
56
|
+
里从容器自身的边算起。Android 的兄弟相对约束(`Top_toBottomOf="@id/sibling"`、链)按「相对兄弟」算出的偏移,放进 `Stack` 当兄弟时必须加回
|
|
57
|
+
该兄弟的 top + 高度;更稳的做法是保留顺序关系 —— 两者放进同一个 `Column`,或用 `RelativeContainer` + `.alignRules({ top: { anchor: '<sibling id>', align: VerticalAlign.Bottom } })`。
|
|
58
|
+
每个写在 `Stack` 子节点上的 `margin.top`/`offset.y` 在报告里写一行「原点 = 哪个容器的哪条边」;状态驱动(插值)的偏移,起止两个端点都要按这个原点
|
|
59
|
+
算出纵向区间 `[top, top+高]`,与同一 `Stack` 里其他兄弟的区间比对、与对应快照(`view.xml` / `view_scroll_N.xml`)的 bounds 比对 —— 快照里不重叠而算出来重叠,即判定失败。
|
|
60
|
+
|
|
61
|
+
## 常见误译(编译期无法发现)
|
|
62
|
+
|
|
63
|
+
| 误译 | 为什么会发生 | 后果 | 自查方法 |
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
| `.width('100%')` 与 `.margin({left,right})` 叠加 | 直觉认为 `100%` 会自动扣掉 margin | 实际宽度 = 父宽 + 左右 margin,**右侧溢出**、圆角被裁 | 搜同一元素上同时出现 `width('100%')` 与左右 `margin`;改为父 `padding` 或 `layoutWeight(1)` |
|
|
66
|
+
| **`0dp` + `layout_weight` 译成多个兄弟都 `width('100%')`** | 等分页签每个都"撑满自己那格",逐个看都对 | 第一个兄弟吃满整行,其余被挤出屏幕 | 权重一律 `.layoutWeight(n)`,`@Builder` 根节点同理。GATE `main-axis-pct-siblings` |
|
|
67
|
+
| **竖向 `LinearLayout` 里的卡片不写宽度** | Android 子 View 不写 LayoutParams 也是满宽,源码里看不到 `MATCH_PARENT` | ArkUI `Column` 的子节点默认按内容收缩:每张卡宽度不同、右缘参差不齐,整页看起来"排版很乱" | 卡片 `.width('100%')`;tree-only 页按 group pack 的几何表(`full` 行)核对。GATE `card-width-wraps` |
|
|
68
|
+
| **WRAP 父 + MATCH 子译成 `constraintSize({ minHeight })` 父 + `'100%'` 子** | Android 的两遍测量会让 MATCH_PARENT 子在 WRAP_CONTENT 父里回落为内容高度,逐属性照译看着等价 | ArkUI 的百分比按上层约束解析,在 Scroll 里约等于视口,组件被撑得特别长;共享组件一错,多处同时出问题 | 子节点去掉 `'100%'`,改用 `alignItems` + `min…`。GATE `pct-in-auto-size-parent` |
|
|
69
|
+
| 用父容器尺寸充当子元素的约束尺寸 | Android `0dp` + 约束被当成「填满父容器」 | 区域偏大/偏高,挤压后续内容 | 拿参考 view tree 的实测尺寸与父容器比;不等就不能用 `'100%'` |
|
|
70
|
+
| 负 margin 被丢弃 | 负值看起来像笔误 | 整块内容下移(常见于顶部贴合状态栏) | 在 Android 布局里 grep `margin.*="-`,逐个确认已译出 |
|
|
71
|
+
| 宽度未定的 `Row` 里用 `Blank()` 把按钮推到右端 | 以为 `Blank` 总会撑满剩余空间 | `Blank` 只在父容器主轴定宽时拉伸(Blank API 文档);`Row` 收缩包裹,再被父 `Column` 默认居中 —— 标题和按钮整体挤在中间 | 每个含 `Blank()` 的 `Row` 必须能指出其主轴宽度来源(`.width('100%')` / `layoutWeight`);EVIDENCE 写「Blank 顶到右端」时回代核对 |
|
|
72
|
+
| 右/下锚定元素被写成常量 `.position()` 坐标 | 参考 view tree 只给出该设备上的绝对解 | 屏幕更窄时元素移出可视区**被裁切** | → Phase 4.2「硬性要求(位置)」、Phase 5「位置锚点证据」:「把屏幕宽度改小 10%,这个值还对吗」 |
|
|
73
|
+
| **滚动内容里未定高的容器中用 `.height('100%')`** | 照译 Android 的 `match_parent` 角标/装饰层 | 卡片、列表行被撑成视口高度 | GATE `percent-height-in-scroll`;角标改 `.position({ right, bottom })` |
|
|
74
|
+
| **弹窗/卡片写成参考机换算的常量宽度** | measure 量出的 vp 数值看起来就是答案 | 窄屏上顶边、看起来铺满 | → Phase 4.2「硬性要求(位置)」末段;CAND `wide-constant-width`;用 `dialog panel` 行的比例 |
|
|
75
|
+
| **沉浸页的屏幕 y 直接当成安全区内的偏移** | view tree 的 bounds 含状态栏,鸿蒙内容在安全区内 | 头部各元素整体下移一个状态栏高,与下方内容叠在一起 | → Phase 4.2「硬性要求(坐标系)」;用 `safeTopVp` |
|
|
76
|
+
| **「相对兄弟」的偏移写进 `Stack` 子节点** | 按 `Top_toBottomOf=@sibling` 算出「距兄弟底边 N」,结构却改成 `Stack` 兄弟(便于叠背景/做折叠) | `Stack` 里 margin 从容器顶算起,元素整体上移一个兄弟高度;插值到另一端点(常为负值)时与兄弟完全重叠(折叠后两行文字叠在一起),首帧往往看不出 | → Phase 4.2「硬性要求(坐标系)」原点一段:逐个写明原点,起止端点回代纵向区间 |
|
|
77
|
+
| **二维约束拆成一维 `Row` 的三列** | ConstraintLayout 写在一个容器里,最顺手的译法是「左图标 / 中文字 / 右角标」 | 只占一角的元素在整个高度上吃掉宽度,单行标题折行、卡片变高 | → 约束布局转写表「二维约束」行;`RelativeContainer` 或 `Stack` + 角落对齐 |
|
|
78
|
+
| 撑满容器承载底/右锚定,吞掉其下点击 | 既满足「不写死坐标」又视觉正确 | 其下可点击元素**点击无响应**,控制台亦无输出 | → Phase 5「交互可达性证据」:逐个确认撑满容器可交互或已设 `hitTestBehavior(HitTestMode.None)` |
|
|
79
|
+
| **`padding` 语义反向**:把 Android 的「N dp 图标 + P dp padding」直译成 `.width(N).padding(P)` | Android 的 `padding` 在声明尺寸**之外**(总占位 N+2P),ArkUI 在**之内**。逐属性对照翻译时两边字面完全一致,最像"忠实" | 内容区被压成 `N-2P`(P≥N/2 时为 **0**)——元素**照常占位、完全不可见**。相邻元素位置全对,只有它消失;编译、`[GATE]`、资源引用检查全过 | 逐个列出同时带 `.width()/.height()` 与 `.padding()` 的元素,核对声明值**是否已包含** padding(Android 侧 `src` N dp + `padding` P dp ⇒ ArkUI 应写 `N+2P`)。`Image` + 圆形图标按钮这类"图标 + 内边距"样式是高发处 |
|
|
80
|
+
| **`layout_weight` 译到自定义组件的 build() 根节点上** | Android 的 `layout_weight` 写在 View 自己身上,逐属性照译恰好落到组件内部根节点;调用处不链属性时它还真能生效 | 调用处一链属性(`.margin()`、`.onClick()` 都算),组件被套上 `__Common__` 节点,父 `Row`/`Column` 读不到权重:组件按内容收缩,**行尾留白** | 权重写在**调用处** `Cell({ … }).layoutWeight(1)`,**同时**内部根节点在父主轴上撑满(父 Row → `.width('100%')`);只移权重不撑满,背景仍按内容收缩。`@Builder` 内联展开,不受影响。GATE `layout-weight-on-component-root` |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 知识卡 — 交互与可达性:点击命中、导航接线、无障碍名
|
|
2
|
+
|
|
3
|
+
> 修 `invariant: interaction` 规则(`references/checker-rules.md` 中「知识卡: interaction」的各条)时读。
|
|
4
|
+
> 本卡只做索引,规则原文留在原处,不复制;按下表找到对应段落再读。卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
| 规则 | 依据(原文所在) | 一句话 |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| `fullsize-container` (CAND) | `conversion-procedure.md` Phase 5「交互可达性证据」;`cards/geometry.md`「常见误译」撑满容器一行 | 撑满容器默认参与命中测试,透明也会吞掉其下点击。逐个标注它可交互,或设 `.hitTestBehavior(HitTestMode.None)`;不是缺陷清单,不要见列表就改 |
|
|
9
|
+
| `a11y-content-desc-unobservable` (GATE/CAND) | `references/checker-rules.md` 本条 | `uitest` 视图树只导出 `accessibilityDescription`。纯图标/符号控件补 `.accessibilityDescription(X)`,与 Android `content-desc` 同值 |
|
|
10
|
+
| `orphan-component` (GATE) | `step5-convert.md` Step 5.5「Gate」与 self-contained 组件接线 | 没被 import 或实例化的 `export struct` 永远不会渲染:在宿主页 import、实例化,并把触发器接到它的显示开关上 |
|
|
11
|
+
| `converted-page-unreachable` (GATE) | `step5-convert.md` Step 5.5「wire navigation to real pages」 | 沿 `conversion_set.json` 每页的 `navigates_to`,给每条指向已转换页的边写真实的 `router.pushUrl` 或组件切换,并登记 `main_pages.json` |
|
|
12
|
+
| `entry-route-not-converted` (GATE) | `step5-convert.md` Step 5.5;入口组的外壳文件(`shell_contract.md`) | `EntryAbility` 的 `loadContent()` 必须指向转换后的启动页,不能留脚手架页 |
|
|
13
|
+
| `shell-content-has-entry` / `chrome-duplicated-in-content-page` (GATE) | `step5-convert.md` Step 5.1 第 13 项 `shell-content`、Step 5.5「Shell hosts」 | 壳内容页不是 `@Entry` 路由页,也不自带 chrome;壳只画一份 chrome,内容页作为组件挂进壳的内容容器,跳转走壳的切换 |
|
|
14
|
+
| `dead-nav-todo` (CAND) | `step5-convert.md` Step 5.5「A remaining `TODO` route」 | 只有目标是 `skip` 行的 `TODO: navigate` 才合法,并在报告写明原因;其余都要接成真实跳转 |
|
|
15
|
+
|
|
16
|
+
## 常见误译(编译期无法发现)
|
|
17
|
+
|
|
18
|
+
| 误译 | 为什么会这样写 | 后果 | 正确做法 |
|
|
19
|
+
|---|---|---|---|
|
|
20
|
+
| 撑满的透明覆盖层没设 `hitTestBehavior` | 视觉上不遮挡,自查「不重叠」就放行 | 其下按钮点击无响应,控制台无输出 | 见 Phase 5「交互可达性证据」:「视觉不重叠」与「命中不被遮挡」分开核对 |
|
|
21
|
+
| 图标按钮只写 `.accessibilityText` | 以为它等同 Android `content-desc` | 自动化测试与评测器按名字点不到 | 补 `.accessibilityDescription`(GATE `a11y-content-desc-unobservable`) |
|
|
22
|
+
| 组件写好了但没接到触发器 | self-contained 组只写自己的文件,以为接线已完成 | 对话框/面板永远不出现 | Step 5.5 接线;`orphan-component` 清零后才进 Step 6 |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# 知识卡 — 资源:字符串、颜色、图标、SVG、形状
|
|
2
|
+
|
|
3
|
+
> 必读。Phase 4.3 资源规则;Phase 5「图标来源分级证据」「资源引用错用」「形状背景证据」「可见资源闭环」的依据。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
**字符串资源取值 —— `$r()` 不是字符串**:`$r('app.string.x')` 返回 `Resource` 对象(资源令牌),没有重写 `toString()`。Android `getString(R.string.x)` / Compose `stringResource(R.string.x)` 返回的是真 `String`,**不能**译成 `$r('app.string.x').toString()`、`String($r(…))`、模板插值或与字符串 `+` 拼接,这些写法都得到字面量 `"[object Object]"`,编译与运行都不报错。只展示时把 `Resource` 直接交给 `Text()` / `promptAction.showToast({ message })` 等(它们接受 `Resource`);带参数用 `$r('app.string.x', arg)`;必须拼接或在逻辑里用时,先取真字符串:`this.getUIContext().getHostContext()!.resourceManager.getStringSync($r('app.string.x').id[, arg])`(`getStringSync(resource)` 重载自 API 20 起废弃,传 `.id`)。ViewModel 没有 UIContext,由页面传入 context 或已取好的字符串。GATE `resource-as-string`。
|
|
7
|
+
|
|
8
|
+
**颜色运算 —— 不手写混色函数**:Android 的 `ColorUtils.blendARGB` / `setAlphaComponent` / `Color.parseColor`,以及 Compose 的 `Color.copy(alpha = x)` / `Color(0x…).copy(alpha = …)` / `colorResource(…).copy(alpha = …)`,一律用本 skill 的 `assets/ColorUtils.ets`(`copy(alpha = x)` = `setAlphaComponent(c, x)`)。ArkUI 颜色串是 `#AARRGGBB`,**alpha 在前**;把 alpha 两位拼在 `#RRGGBB` **后面**得到的 `#RRGGBBAA` 合法、不报错,但会被读成另一种颜色(`'#000000' + '1A'` = `#0000001A` → alpha 00,全透明;`'#FFFFFF1A'` → 不透明黄)。GATE `color-alpha-appended`。工程里没有 `<module>/src/main/ets/common/ColorUtils.ets` 时**原样复制**过去,不改写、不另起一份。它已对 androidx 逐位测过(含 `(int)` 截断:`blend(#FFFFFF, #E5E5EA, .62)` = `#EEEEF1`,四舍五入会得 `#EFEFF2`)。输入全是固定 Palette 值的混色,优先**预计算成字面量常量**并在注释写出来源公式。EVIDENCE 里的「公式回代一致」必须是**跑出来的**输出(如 `node -e`),不接受心算。
|
|
9
|
+
|
|
10
|
+
**图标来源分级 —— 逐个图标判定并在报告中标注级别**:
|
|
11
|
+
|
|
12
|
+
`res/drawable` 里没有对应 `<vector>` 是**常态而非异常**:Compose 的 `Icons.Outlined.*`、Phosphor、Feather 等是编译进库的 `ImageVector`,Step 2 只转 `res/`,转不出它们。此时必须走分级,不得自行发明降级方式。
|
|
13
|
+
|
|
14
|
+
素材不在 `res/drawable` 下,**不等于素材不存在**。除了库编译图标,混合壳应用(uni-app / HBuilder / Cordova)把全部业务素材放在 web 包里或 CDN 上,`res/drawable*` 只剩 SDK 装饰(appcompat、混合运行时、第三方登录等)。这类项目已转 media 里**绝大多数零引用**且全是 SDK 装饰,而页面真正需要的入口图标、tab bar 多态图标、业务图标全部在 web 包或 CDN 上。**把这类图标直接归 L3 是错的** —— 它们有 L2.5。
|
|
15
|
+
|
|
16
|
+
| 级别 | 判据 | 做法 |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| **L1** | `res/drawable/` 有对应 `<vector>` | 用 Step 2 的转换产物 |
|
|
19
|
+
| **L2** | 库编译图标,`res/` 无文件,但资源转换阶段已提取出 SVG | 用 Grep 搜索 `resource_mapping.md` 的 **Library Icons Converted** 章节(不要 Read 整个文件),用其中登记的 media,并在报告里注明来自哪个库的哪个符号(可溯源) |
|
|
20
|
+
| **L2.5** | 素材存在但不在 `res/` —— 在混合壳 web 包(`assets/**/www/static/**`)内,或 URL 可静态解析出来 | 用 Grep 搜 `resource_mapping.md` 的 **Hybrid-Shell Packaged Assets** / **Hybrid-Shell Remote Assets** 两节(不要 Read 整份)。命中 Packaged → 直接用其 HarmonyOS Target;命中 Remote → 报告里登记为 `待拉取`,给出已解析的绝对 URL 与建议的 media 名,并按本页需要先用占位。两种情形都要在报告里注明原 web 路径(可溯源) |
|
|
21
|
+
| **L3** | L1/L2/L2.5 都拿不到(含转换报告 **Library Icons Unavailable** 里列出的符号,以及连 URL 都解析不出来的) | 报告中显式登记 `已降级`:缺哪个图标、当前用什么占位、影响哪个位置 |
|
|
22
|
+
|
|
23
|
+
判定顺序固定为 L1 → L2 → L2.5 → L3,**不要自行推断某个图标"应该"长什么样**。`Library Icons Unavailable` 里的每一项都已经是上游确认拿不到的,直接归 L3,不要再尝试补。
|
|
24
|
+
|
|
25
|
+
**跳过 L2.5 直奔 L3 是本分级最容易失效的方式**,因为它很“诚实”:每条降级都登记在册、三条禁令都没破、报告完整,于是审阅一路绿灯 —— 产物却是整套图标被换成 `sys.symbol.*`。判据:在判 L3 之前,必须能说出已经查过 `resource_mapping.md` 的 Hybrid-Shell 两节(或确认过本项目不是混合壳、该文档无此两节)。未查就归 L3 判定失败。
|
|
26
|
+
|
|
27
|
+
**禁止的三种降级**(编译全过、静态引用检查全过,但视觉必错):
|
|
28
|
+
|
|
29
|
+
1. **emoji / Unicode / 文字字形代替图标** —— `←` `✓` `★` `🔍` `≡` 之类。
|
|
30
|
+
2. **语义不符的现有 drawable 顶替** —— 例如拿 `ic_placeholder` 当设置图标、拿箭头图标当勾选标记。「名字存在且能编译」不是选它的理由。
|
|
31
|
+
3. **凭记忆手写 SVG path** —— 手写产物几乎必然带 Material web SVG 的包围盒 path,被 `.fillColor()` 染色后整个图标变实心色块(见 Phase 5「资源引用错用」)。
|
|
32
|
+
|
|
33
|
+
**L3 未登记即判定失败。** 宁可显式记一条「缺图标」,也不要静默换成一个错的。
|
|
34
|
+
|
|
35
|
+
**消费前必须打开文件确认内容可渲染**:`ls media/` 只能证明名字存在。残留 `?attr/...` 主题属性(白框)和资源转换生成的**占位 SVG**(灰框,属于 L3)都能编译、引用名正确,却画不出图形 —— 逐条核对项见 Phase 5「资源引用错用」。
|
|
36
|
+
|
|
37
|
+
**ShapeDrawable / 可拉伸背景特例**:
|
|
38
|
+
|
|
39
|
+
- 当 Android `android:background` 指向 XML `<shape>` 时,必须读取该 drawable XML 的 `shape`、`solid`、`corners`、`stroke` 和 `padding`。
|
|
40
|
+
- 对 rectangle/oval/line 等静态背景,优先映射为 ArkUI 容器样式:`.backgroundColor()`、`.borderRadius()`、`.border()`、`.padding()`。
|
|
41
|
+
- 尤其当 `<shape>` 没有 `<size>` 时,它是随宿主尺寸拉伸的背景,禁止把资源转换阶段生成的 24×24 SVG 作为普通 `Image` 再用 `ImageFit.Fill` 非等比拉伸。
|
|
42
|
+
- 示例:W×H dp 的宿主、`<corners android:radius="Rdp">` 应实现为宿主容器 `.backgroundColor($r('app.color.<bg>')).borderRadius(R)`,不能渲染为圆角已烘焙的 24×24 图片。
|
|
43
|
+
- 只有图形本身是固定尺寸图标,或资源明确声明 `<size>` 且消费尺寸一致时,才使用转换后的 SVG media。
|
|
44
|
+
|
|
45
|
+
**可见资源闭环**:
|
|
46
|
+
- 对参考截图中每个可见 Image/Video/Text,记录 Android 来源、HarmonyOS 目标资源和 ArkUI 代码引用。
|
|
47
|
+
- 已迁移但未在代码中消费的关键可见媒体(例如页面背景视频/背景图)必须补齐绑定;不得用纯色或占位渐变替代后仍判定完成。
|
|
48
|
+
|
|
49
|
+
### Phase 5「资源引用错用」—— SVG 内容核对子项
|
|
50
|
+
|
|
51
|
+
**并且必须确认资源内容本身与 Android 源语义等价 —— 文件存在不等于内容正确**。对由 Android `<vector>` 转换而来的 SVG,打开文件核对:
|
|
52
|
+
- `clip-path` 是否保留(丢失会改变图形的位置、尺寸与可见范围;若 path 铺满 viewport 而靠 clip 裁形,丢失后会渲染成一个纯色矩形)
|
|
53
|
+
- 无 `fillColor` 但有 `strokeColor` 的描边图形是否为 `fill="none"`(被写成具体颜色时,线条图标会渲染成实心色块)
|
|
54
|
+
- `viewBox` 是否与 Android `viewportWidth/Height` 一致
|
|
55
|
+
- **染色通道是否与染色手段匹配**:若代码用 `.fillColor()` 给该 SVG 染色,需要变色的几何**必须位于 `fill` 通道**。`fillColor` 只叠加 fill(SDK `image.d.ts`:*Sets the fill color to be superimposed on the image*),**对 `stroke` 完全无效** —— 描边图形(`fill="none"` + `stroke="#RRGGBB"`)用 `fillColor` 染色时颜色不生效,图形保持原始色(通常是黑)。
|
|
56
|
+
本条与上面那条 `fill="none"` 子项**互为对偶**:上一条要求描边图形必须写成 `fill="none"`(否则线条图标变实心色块),而**正因为它是 `fill="none"`,`fillColor` 才染不上它**。两条必须一起看,不能只满足其中一条就判定通过。
|
|
57
|
+
**`renderMode(ImageRenderMode.Template)` 不改变这一点** —— 「Template 按 alpha 遮罩染色,所以描边也能染」是实测错误的推理(stroke 型图标用 Template + fillColor,颜色照样不变)。
|
|
58
|
+
**首选修法(与几何通道无关)**:去掉 `fillColor`,改用 `.supportSvg2(true)` + `.colorFilter(new ColorFilter([0,0,0,0,r, 0,0,0,0,g, 0,0,0,0,b, 0,0,0,1,0]))`(r/g/b 取 0~1)。该矩阵把 RGB 替换为目标色、保留 alpha,即 Android `colorFilter`/`tint` 的 SRC_IN 语义;`supportSvg2(true)` 下 colorFilter 作用于整个 SVG(fill + stroke)。动态色(随滚动插值等)在 VM 里用 `@Computed` 派生矩阵。`supportSvg2` 与 `colorFilter` **必须一起写**:只写 `colorFilter` 时实测描边图标变色、而 fill 写死颜色的图标不变。核对 `supportSvg2` 是否存在只查壳契约 `SDK` 段的 `component_dts_dir`,不要查机器上的其他 SDK 副本。
|
|
59
|
+
备选:把描边几何改写成等价的 fill 几何(等宽圆环 = 外圆 + 内圆同 path + `fill-rule="evenodd"`);改用目标端原生组件;或按状态准备两份已着色素材。
|
|
60
|
+
**染色检查要追到调用点**:`Image(icon)` 的实参是 `@Builder`/方法参数时,文件里没有 `$r` 字面量与 `.fillColor()` 同处,必须到每个调用点取出实际传入的 media 逐个打开核对。检查器会追调用点;追不到时报 CAND `fillcolor-media-unresolved`,不得视为通过。
|
|
61
|
+
|
|
62
|
+
- **是否存在铺满 viewBox 的 `fill="none"` 包围盒 path**(形如 `<path d="M0 0h24v24H0z" fill="none"/>`)。`fillColor` 叠加到**全部**几何,`fill="none"` 拦不住它 —— 该 path 会被染成实心色块,盖住整个图标。Android `<vector>` 源**不会**产生这条 path(它是 Material web SVG 的写法),所以它的出现即证明该 SVG 是凭记忆手写的,应从 `res/drawable` 重新转换。
|
|
63
|
+
- **`fill`/`stroke` 是否残留未解析的 `?attr/...` 主题属性**。SVG 不认识 Android 主题属性,该几何不会着色(白框)。需回到 Android 源把它解析成 theme 里的具体颜色。
|
|
64
|
+
- **是否是占位 SVG**(灰底矩形 + 资源名文本)。那是资源转换阶段为保证编译而生成的,不是真实图标,界面上渲染为灰框。
|
|
65
|
+
- **是否是合法 XML —— 同一元素上有没有重复属性**。重复属性在 XML 规范下是**致命错误**,解析器拒绝整份文档,于是该图标**一个像素都画不出来**(空白,而非画错)。这一条与上面各条的性质不同:其余各条都是"先假定文件是有效 SVG,再查语义",而本条查的是"这份文件解析得开吗"——语义检查再多也覆盖不到。已知来源是转换器给每个 path 先写死 `fill-opacity="1"`、再把 Android 的 `fillAlpha` 作为**第二个** `fill-opacity` 追加。修法:回 Android `<vector>` 源核对该属性,只保留正确取值(转换器先默认后真值时保留后者)。机械兜底:GATE 规则 `media-duplicate-attribute`。
|
|
66
|
+
|
|
67
|
+
这类缺陷**能编译通过且引用名正确**,只能靠读文件内容发现。若 `a2h-resource-convert` 的报告里有 **Vector Fidelity Issues** 章节,先按其 error 条目修资源,再判定本页通过。
|
|
68
|
+
|
|
69
|
+
## 常见误译(编译期无法发现)
|
|
70
|
+
|
|
71
|
+
| 误译 | 为什么会发生 | 后果 | 自查方法 |
|
|
72
|
+
|---|---|---|---|
|
|
73
|
+
| **选中态只译了底色** | Android 在同一分支里先 `setBackground` 再 `setTextColor`,只看到了第一句 | 深色底上停着默认深色字 | 用同一条件写 `.fontColor()`;Span 继承外层 Text。GATE `text-on-stateful-bg-no-color` + `[text_color]` 实测比对 |
|
|
74
|
+
| `<vector>` 的 `clip-path` / `fill` 语义丢失 | 引用名正确、文件存在,检查即通过 | 图标位置尺寸错乱,或线条图标变实心色块 | → Phase 5「资源引用错用」;资源侧 `a2h-resource-convert` 的 `scripts/svg_fidelity_check.ts` |
|
|
75
|
+
| `$r()` 传模板字符串(如 `$r(\`app.media.${name}\`)`) | 看起来能拼出正确资源名 | `$r()` 要求**字面量**,拼接在运行时不可靠,图片可能不显示 | 动态选图必须建显式映射表(键 → `$r('app.media.xxx')` 字面量),并给未命中的默认值 |
|
|
76
|
+
| 字符串资源残留字面引号 | Android `"…"` 是转义语法,不是文本内容 | UI 上出现可见的引号 | 扫 `element/string.json`,找首尾同为 `"` 的值 |
|
|
77
|
+
| 取值规则的作用域/粒度被改变 | 源侧提到循环外的常量被改成每条目自算(或反向) | 映射与 `$r()` 全对,渲染出的变体系统性错误 | → Phase 4.2「数据驱动的可见变体」:追到值被生成并传入的调用点 |
|
|
78
|
+
| **`.fillColor()` 染 `stroke` 着色的 SVG** | SVG 按规则写成 `fill="none"`,染色按直觉用 `fillColor`,两边都对 | 颜色**完全不生效**(`renderMode(Template)` 也无效),常只在选中态显形 | → Phase 5「资源引用错用」染色通道子项:首选 `.supportSvg2(true)` + `.colorFilter(...)`;`Image(参数)` 追到调用点。GATE `fillcolor-on-stroke-svg` |
|
|
79
|
+
| **`stringResource()` 译成 `$r(…).toString()`** | Android 取到的是 String,`.toString()` 看起来只是显式化 | `Resource` 无 `toString()`,界面显示 `[object Object]`,零报错 | 展示直接传 `Resource`;拼接用 `resourceManager.getStringSync($r(…).id)`;GATE `resource-as-string` |
|
|
80
|
+
| **alpha 拼在颜色串末尾** | Compose `Color.copy(alpha = x)` 直觉译成 `'#RRGGBB' + hex(x)` | `#RRGGBBAA` 被按 `#AARRGGBB` 读:底色全透明或变色,零报错 | `setAlphaComponent()`(`assets/ColorUtils.ets`);GATE `color-alpha-appended` |
|
|
81
|
+
| **凭记忆手写图标 SVG** | 图标是库编译的 `ImageVector`,`res/` 里没有 | 包围盒 path 被 `fillColor` 染成**实心色块** | → Phase 4.3 图标来源分级(拿不到素材就登记 `已降级`);GATE `fillcolor-on-full-viewport-path` |
|
|
82
|
+
| **消费了内容画不出来的 media** | 只用 `ls media/` 确认"存在" | 残留 `?attr/...` → 白框;占位 SVG → 灰框 | → Phase 5「资源引用错用」;GATE `media-unresolved-theme-attr` / `media-placeholder-in-use` |
|
|
83
|
+
| 手写颜色混合/拼接函数 | `blendARGB` 看着只是几行算术,EVIDENCE 心算「回代一致」就过了 | 算错的串(如 `'#FFEDF2EDF2F109'`)被 ArkUI **静默忽略**:背景透明、描边变黑,零报错 | → 4.3「颜色运算」:用 `assets/ColorUtils.ets` 或预计算字面量。GATE `color-literal-malformed`、CAND `color-built-at-runtime` |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# 知识卡 — 状态管理:V1 专有约束
|
|
2
|
+
|
|
3
|
+
> 条件卡:`PARADIGM = V1` 时必读。
|
|
4
|
+
> 本卡由 `conversion-procedure.md` 拆出,规则原文不变;卡内提到的 Phase 编号指 `conversion-procedure.md` 的对应阶段。
|
|
5
|
+
|
|
6
|
+
### Phase 5「观测装饰器缺失」—— V1 段
|
|
7
|
+
|
|
8
|
+
- V1:
|
|
9
|
+
- `@Observed` 类中所有在 UI 中使用的属性是否都加了 `@Track`?没有则补。
|
|
10
|
+
- **一旦类中出现任何 `@Track`,该类未被 `@Track` 装饰的属性就不能在 UI 中使用**,
|
|
11
|
+
否则运行时抛 `BusinessError 140110: Illegal usage of not @Track'ed property 'x' on UI!`
|
|
12
|
+
(依据:`v1-track` §概述 与 §限制条件,API 23 起错误码 140110)。
|
|
13
|
+
这是 all-or-nothing 语义,不是「加了的能属性级刷新、没加的退化为整类刷新」。
|
|
14
|
+
- **`get x()` 无法被 `@Track` 装饰**,因此在「已使用 `@Track` 的类」里用 getter 暴露派生值,
|
|
15
|
+
一旦被 `build()` 读到就必然首帧崩溃。**V1 没有 `@Computed`**(那是 V2 能力),
|
|
16
|
+
所以派生值只有两条合法出路:写成**普通方法**(`title(): string`,UI 侧 `vm.title()`;
|
|
17
|
+
原型方法不是数据属性,不经过 `@Track` 代理),或提升为真正的 `@Track` 字段并在赋值处同步维护。
|
|
18
|
+
注意「getter 被读取时会重新求值」这一点是**对的**,但它只说明**响应性**没问题,
|
|
19
|
+
**不说明合法性** —— 两者极易混为一谈,且混淆后的结论能通过编译与全部静态检查。
|
|
20
|
+
自检:对每个「用了 `@Track` 的 `@Observed` 类」grep `get [a-zA-Z]*(`,命中即缺陷。
|
|
21
|
+
真机崩溃日志在 `/data/log/faultlog/faultlogger/jscrash-<bundle>`。
|
|
22
|
+
机械兜底:GATE 规则 `track-class-getter-in-ui`。
|
|
23
|
+
- 继承成员同理:父类属性若未 `@Track` 而子类实例被 UI 读取,同样触发 140110。
|
|
24
|
+
|
|
25
|
+
## 常见误译(编译期无法发现)
|
|
26
|
+
|
|
27
|
+
| 误译 | 为什么会发生 | 后果 | 自查方法 |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| **(V1)用 `get x()` 给 UI 暴露派生值** | 完备性直觉面向字段,getter 不是字段;V1 没有 `@Computed` | **首帧运行时崩溃** `BusinessError 140110`,编译与 GATE 全过 | → Phase 5「观测装饰器缺失」V1 段;GATE `track-class-getter-in-ui` |
|