@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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// static_check/rules/container_align.ts — split out of arkts_static_check.ts (logic unchanged).
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import { attributeChains, chainContainer } from '../core/parse.ts';
|
|
5
|
+
import type { ContainerOfChain } from '../core/parse.ts';
|
|
6
|
+
import type { FileCtx } from '../core/scan.ts';
|
|
7
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
8
|
+
|
|
9
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
10
|
+
export const meta: RuleMeta[] = [
|
|
11
|
+
{
|
|
12
|
+
id: "container-align-unset",
|
|
13
|
+
levels: ["CAND"],
|
|
14
|
+
invariant: "geometry",
|
|
15
|
+
card: "alignment",
|
|
16
|
+
needs: [],
|
|
17
|
+
summary: "`Column`/`Row` 直接含 Text(或顶层渲染 Text 的 @Builder 调用),却没写决定水平位置的属性(Column 的 alignItems / Row 的 justifyContent)。",
|
|
18
|
+
fix: "Android LinearLayout / Compose Column 默认 start。若 Android 侧未写水平 gravity,应显式译成 .alignItems(HorizontalAlign.Start)(Column)/ .justifyContent(FlexAlign.Start)(Row);若该处本就该居中(空态插图、按钮内图标),忽略本条。",
|
|
19
|
+
escape: null,
|
|
20
|
+
cases: [
|
|
21
|
+
"实测 mihon-statistics 的居中缺陷正是这种形状 —— 只认字面 Text 时该页零命中。",
|
|
22
|
+
"实测漏检:日期分隔行因此居中,而该容器\"已写 alignItems\",检查器不报、编译通过、逐属性对照亦\"忠实\"。",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export function checkContainerAlign(fctx: FileCtx): void {
|
|
33
|
+
const { file, rel, src, code, rawLines, codeLines, inBlock } = fctx;
|
|
34
|
+
// ---- Pre-scan: which @Builder methods render Text directly at their own top level
|
|
35
|
+
//
|
|
36
|
+
// Required, otherwise R8 misses the most common form: the container's direct child is `this.SectionTitle(title)`
|
|
37
|
+
// rather than a literal `Text(...)`.
|
|
38
|
+
const textBuilders: Set<string> = new Set<string>();
|
|
39
|
+
for (let i = 0; i < codeLines.length; i++) {
|
|
40
|
+
if (!/^\s*@Builder\b/.test(codeLines[i])) { continue; }
|
|
41
|
+
// The method signature may be on the line after @Builder or the one after that
|
|
42
|
+
let sig: number = -1;
|
|
43
|
+
for (let k = i + 1; k < Math.min(i + 4, codeLines.length); k++) {
|
|
44
|
+
if (/^\s*(?:private\s+|public\s+)?[A-Za-z_$][A-Za-z0-9_$]*\s*\(/.test(codeLines[k])) { sig = k; break; }
|
|
45
|
+
}
|
|
46
|
+
if (sig < 0) { continue; }
|
|
47
|
+
const nm: RegExpMatchArray | null =
|
|
48
|
+
codeLines[sig].match(/(?:private\s+|public\s+)?([A-Za-z_$][A-Za-z0-9_$]*)\s*\(/);
|
|
49
|
+
if (nm === null) { continue; }
|
|
50
|
+
|
|
51
|
+
// Brace-balance from the { of the signature line to get the method body; check whether there is a Text( at depth===1 in the body
|
|
52
|
+
let depth: number = 0;
|
|
53
|
+
let started: boolean = false;
|
|
54
|
+
let direct: boolean = false;
|
|
55
|
+
for (let k = sig; k < codeLines.length; k++) {
|
|
56
|
+
const ln: string = codeLines[k];
|
|
57
|
+
for (let c = 0; c < ln.length; c++) {
|
|
58
|
+
if (ln[c] === '{') { depth++; started = true; continue; }
|
|
59
|
+
if (ln[c] === '}') { depth--; continue; }
|
|
60
|
+
if (started && depth === 1 && ln.startsWith('Text(', c)) {
|
|
61
|
+
const prev: string = c > 0 ? ln[c - 1] : ' ';
|
|
62
|
+
if (!/[A-Za-z0-9_.$]/.test(prev)) { direct = true; }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (started && depth <= 0) { break; }
|
|
66
|
+
}
|
|
67
|
+
if (direct) { textBuilders.add(nm[1]); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ---- CAND R8: Column/Row containing shrink-width children without an explicit alignItems
|
|
71
|
+
//
|
|
72
|
+
// ArkUI Column defaults to HorizontalAlign.Center and Row to VerticalAlign.Center;
|
|
73
|
+
// Android LinearLayout / Compose Column default to **start**. When neither side writes an alignment attribute
|
|
74
|
+
// the text is literally identical, so attribute-by-attribute comparison confirms it as "translated correctly", while one renders centered and the other left-aligned.
|
|
75
|
+
//
|
|
76
|
+
// CAND, not GATE: centering is sometimes right (empty-state illustrations, icons in buttons, value columns in cards).
|
|
77
|
+
// Only reported when the container directly contains Text(, to avoid listing every pure layout container.
|
|
78
|
+
for (const ch of attributeChains(codeLines)) {
|
|
79
|
+
// attributeChains' chain head only looks back one line; for a container **with children** that line is `}` rather than
|
|
80
|
+
// `Column() {`. Here brace balancing goes up from the chain-head line to find the real container declaration line,
|
|
81
|
+
// and the child content between { ... } is extracted too (needed to decide whether the container directly contains Text).
|
|
82
|
+
const ctr: ContainerOfChain | null = chainContainer(codeLines, ch);
|
|
83
|
+
if (ctr === null) { continue; }
|
|
84
|
+
const head: string = ctr.head;
|
|
85
|
+
const bodyLines: string[] = ctr.bodyLines;
|
|
86
|
+
|
|
87
|
+
const m: RegExpMatchArray | null = head.match(/\b(Column|Row)\s*\(/);
|
|
88
|
+
if (m === null) { continue; }
|
|
89
|
+
const attrs: string = ch.lines.join('\n');
|
|
90
|
+
// The **axis that decides horizontal position** must be checked, and the two containers name that axis's attribute differently:
|
|
91
|
+
// Column -> horizontal is the cross axis -> alignItems(HorizontalAlign)
|
|
92
|
+
// Row -> horizontal is the main axis -> justifyContent(FlexAlign)
|
|
93
|
+
// If only alignItems were checked, a **perfectly correct**
|
|
94
|
+
// .alignItems(VerticalAlign.Center) on a Row (vertical centering, usually exactly Android's
|
|
95
|
+
// verticalAlignment=CenterVertically) would silently let this rule pass — yet it governs the vertical axis,
|
|
96
|
+
// and has nothing to do with "text left-aligned or centered".
|
|
97
|
+
const axisAttr: string = m[1] === 'Column' ? 'alignItems' : 'justifyContent';
|
|
98
|
+
if (new RegExp('\\.' + axisAttr + '\\(').test(attrs)) { continue; }
|
|
99
|
+
// Only reported when the container **directly** contains Text. Brace depth must be used to filter: otherwise the outermost container
|
|
100
|
+
// would be hit because some deeply nested child container has a Text (that Text's alignment is decided by that
|
|
101
|
+
// child container, unrelated to this one), typically the Column wrapping the whole page in build().
|
|
102
|
+
if (bodyLines.length > 0) {
|
|
103
|
+
let depth: number = 0;
|
|
104
|
+
let directText: boolean = false;
|
|
105
|
+
for (let k = 0; k < bodyLines.length && !directText; k++) {
|
|
106
|
+
const ln: string = bodyLines[k];
|
|
107
|
+
for (let c = 0; c < ln.length; c++) {
|
|
108
|
+
if (ln[c] === '{') { depth++; continue; }
|
|
109
|
+
if (ln[c] === '}') { depth--; continue; }
|
|
110
|
+
// depth === 1 is the top level inside this container's braces
|
|
111
|
+
if (depth !== 1) { continue; }
|
|
112
|
+
// (a) literal Text(
|
|
113
|
+
if (ln.startsWith('Text(', c)) {
|
|
114
|
+
const prev: string = c > 0 ? ln[c - 1] : ' ';
|
|
115
|
+
if (!/[A-Za-z0-9_.$]/.test(prev)) { directText = true; break; }
|
|
116
|
+
}
|
|
117
|
+
// (b) this.SomeBuilder(...) where that @Builder renders Text directly at top level
|
|
118
|
+
if (ln.startsWith('this.', c)) {
|
|
119
|
+
const bm: RegExpMatchArray | null =
|
|
120
|
+
ln.slice(c).match(/^this\.([A-Za-z_$][A-Za-z0-9_$]*)\s*\(/);
|
|
121
|
+
if (bm !== null && textBuilders.has(bm[1])) { directText = true; break; }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (!directText) { continue; }
|
|
126
|
+
} else if (!/\bText\s*\(/.test(attrs)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const kind: string = m[1];
|
|
130
|
+
const want: string = kind === 'Column'
|
|
131
|
+
? 'alignItems(HorizontalAlign.Start)'
|
|
132
|
+
: 'justifyContent(FlexAlign.Start)';
|
|
133
|
+
report('CAND', 'container-align-unset', rel, ch.start,
|
|
134
|
+
`${kind} directly contains a Text child but has no explicit .${axisAttr}() — that is this container's **horizontal** ` +
|
|
135
|
+
`alignment attribute (horizontal is the cross axis alignItems for Column, the main axis justifyContent for Row). ` +
|
|
136
|
+
`Android LinearLayout / Compose Column default to start. If the Android side sets no horizontal gravity, ` +
|
|
137
|
+
`translate it explicitly as .${want}; if it really should be centered (empty-state illustration, icon inside a button), ignore this entry. ` +
|
|
138
|
+
`Note: an existing .alignItems(VerticalAlign.*) on a Row controls the vertical axis and does not satisfy this entry`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// static_check/rules/entry_root_builtin.ts — split out of arkts_static_check.ts (logic unchanged).
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import type { FileScan } from '../core/scan.ts';
|
|
5
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
6
|
+
|
|
7
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
8
|
+
export const meta: RuleMeta[] = [
|
|
9
|
+
{
|
|
10
|
+
id: "entry-root-not-builtin",
|
|
11
|
+
levels: ["GATE"],
|
|
12
|
+
invariant: "build",
|
|
13
|
+
card: "build",
|
|
14
|
+
needs: [],
|
|
15
|
+
summary: "@Entry 组件 build() 的第一个根节点名在本工程里有 struct 声明(自定义组件当根)。",
|
|
16
|
+
fix: "用内建容器包一层 —— `Column() { Name({ … }) }`.width('100%').height('100%')。若 Name 自身已是 100%/100%,这层包装是布局透明的,不改变任何可见几何",
|
|
17
|
+
escape: null,
|
|
18
|
+
cases: [
|
|
19
|
+
"实测一次增量迁移 12 个页面里 11 个中招,且这是那一批唯一的一类编译错误 —— 却要付一整轮构建才暴露。",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* GATE: the @Entry build() root node is a custom component — compile error 10905210.
|
|
31
|
+
*
|
|
32
|
+
* ArkTS requires an @Entry component's build() to have exactly one root node, which must be a **built-in container**.
|
|
33
|
+
* Using a custom component as the root (even if its own root is a Column) always fails:
|
|
34
|
+
* 「In an '@Entry' decorated component, the 'build' method can have only one
|
|
35
|
+
* root node, which must be a container component.」
|
|
36
|
+
*
|
|
37
|
+
* Why a rule of its own: once a project establishes a "page shell" shared component (SettingsScaffold,
|
|
38
|
+
* PageShell and the like), **every** page using it hits — yet it costs a full build round to surface.
|
|
39
|
+
* Same origin as state-name-shadows-attribute / builder-invokes-callback-param:
|
|
40
|
+
* replacing a compile error with a sub-second lexical hit.
|
|
41
|
+
*
|
|
42
|
+
* Why the criterion is "the root node name has a struct declaration in this project" rather than "not in a built-in container allowlist":
|
|
43
|
+
* an allowlist is bound to be incomplete (ArkUI container components grow with versions), and GATE must be cleared, so **a false positive directly
|
|
44
|
+
* blocks the build** — an allowlist that may always miss items does not belong on a GATE. Conversely, "a same-name struct is declared
|
|
45
|
+
* in this project" is deterministic evidence: it must be a custom component and must trigger 10905210.
|
|
46
|
+
* The cost is missing "a non-container built-in component as root" (e.g. Text() directly as root); that form is rare,
|
|
47
|
+
* and one build round finds it — trading possible misses for zero false positives is the right trade-off for GATE.
|
|
48
|
+
*/
|
|
49
|
+
export function checkEntryRootBuiltin(scans: FileScan[]): void {
|
|
50
|
+
// struct names declared anywhere in the project (cross-file union)
|
|
51
|
+
const projectStructs: Set<string> = new Set();
|
|
52
|
+
for (const s of scans) {
|
|
53
|
+
for (const n of s.declaredStructs) { projectStructs.add(n); }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
for (const s of scans) {
|
|
57
|
+
if (s.entryRoot === null) { continue; }
|
|
58
|
+
const { name, line } = s.entryRoot;
|
|
59
|
+
if (!projectStructs.has(name)) { continue; } // not a component of this project ⇒ treated as built-in, passes
|
|
60
|
+
report('GATE', 'entry-root-not-builtin', s.rel, line,
|
|
61
|
+
`the root node of the @Entry build() is the custom component \`${name}\` (a struct with that name is declared in this project)` +
|
|
62
|
+
' — ArkTS requires the @Entry root to be a built-in container component; a custom component does not qualify even when its own root is a Column' +
|
|
63
|
+
', and the compiler reports 10905210「the \'build\' method can have only one root node,' +
|
|
64
|
+
' which must be a container component」。' +
|
|
65
|
+
`Fix: wrap it in a built-in container — \`Column() { ${name}({ … }) }\`` +
|
|
66
|
+
'.width(\'100%\').height(\'100%\'). If ' + name + ' is already 100%/100% itself, ' +
|
|
67
|
+
'this wrapper is layout-transparent and changes no visible geometry');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// static_check/rules/entry_route.ts — split out of arkts_static_check.ts (logic unchanged).
|
|
2
|
+
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import { report } from '../core/findings.ts';
|
|
5
|
+
import { isScaffoldPage } from '../core/scan.ts';
|
|
6
|
+
import type { FileScan } from '../core/scan.ts';
|
|
7
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
8
|
+
|
|
9
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
10
|
+
export const meta: RuleMeta[] = [
|
|
11
|
+
{
|
|
12
|
+
id: "entry-route-not-converted",
|
|
13
|
+
levels: ["GATE"],
|
|
14
|
+
invariant: "interaction",
|
|
15
|
+
card: "interaction",
|
|
16
|
+
needs: [],
|
|
17
|
+
summary: "UIAbility 的 loadContent() 目标页不存在、是 DevEco 脚手架残留页,或工程内已有转换页却没有一个被 loadContent 加载。",
|
|
18
|
+
fix: "`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.",
|
|
19
|
+
escape: null,
|
|
20
|
+
cases: [],
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* GATE R11: the converted pages never became the launch route.
|
|
31
|
+
*
|
|
32
|
+
* "Registered" does not mean "loaded": pages/X in main_pages.json only shows it can be routed to;
|
|
33
|
+
* what really decides the launch screen is loadContent('pages/Y') in the UIAbility. When the two disagree:
|
|
34
|
+
* - compilation always passes (both files valid, resources all exist);
|
|
35
|
+
* - static reference checks all pass;
|
|
36
|
+
* - the only symptom is seeing the scaffold's Hello World after launch, with the conversion never displayed once.
|
|
37
|
+
* This defect is only found by launching on a real device, but its criterion is purely lexical — hence GATE.
|
|
38
|
+
*
|
|
39
|
+
* Criteria (three branches, any hit reports):
|
|
40
|
+
* (1) the loadContent target .ets does not exist;
|
|
41
|
+
* (2) the target is a leftover DevEco scaffold page (@Entry + 'Hello World' literal + no app resource references);
|
|
42
|
+
* (3) the project has several @Entry pages, but no non-scaffold page is loaded by any loadContent.
|
|
43
|
+
* Criterion (2) judges features of the scaffold template, identical for all new DevEco projects, without any app-specific knowledge.
|
|
44
|
+
*/
|
|
45
|
+
export function checkEntryRoute(scans: FileScan[], etsRoots: string[]): void {
|
|
46
|
+
const abilityFiles: FileScan[] = scans.filter((s) => /ability/i.test(s.rel));
|
|
47
|
+
if (abilityFiles.length === 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Collect all loadContent targets
|
|
52
|
+
const targets: { rel: string; line: number; target: string }[] = [];
|
|
53
|
+
for (const a of abilityFiles) {
|
|
54
|
+
const lines: string[] = fs.readFileSync(a.abs, 'utf8').split('\n');
|
|
55
|
+
lines.forEach((l, i) => {
|
|
56
|
+
const m = /loadContent\(\s*['"]([^'"]+)['"]/.exec(l);
|
|
57
|
+
if (m !== null) {
|
|
58
|
+
targets.push({ rel: a.rel, line: i + 1, target: m[1] });
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (targets.length === 0) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// loadContent targets are written as in-module paths, but in multi-module projects the entry page may not be in the same module as the UIAbility
|
|
67
|
+
// (HSP shared pages), so each --ets root is tried in turn, taking the first that really exists;
|
|
68
|
+
// when none exists fall back to the first root, so the later isScaffoldPage cannot read the file and judges it non-scaffold.
|
|
69
|
+
const absOf = (target: string): string => {
|
|
70
|
+
const suffix: string = target.replace(/^\/+/, '') + '.ets';
|
|
71
|
+
for (const r of etsRoots) {
|
|
72
|
+
const cand: string = r + '/' + suffix;
|
|
73
|
+
if (fs.existsSync(cand)) { return cand; }
|
|
74
|
+
}
|
|
75
|
+
return etsRoots[0] + '/' + suffix;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// **Precondition: the project must contain at least one converted page.**
|
|
79
|
+
// In an empty project with no pages converted yet, loadContent pointing at the scaffold page is the **correct** state —
|
|
80
|
+
// there is no "conversion output" to demand, an error would be pure noise, and GATE noise trains users to ignore it.
|
|
81
|
+
// So all three criteria presuppose "there is converted output".
|
|
82
|
+
const convertedPages: FileScan[] = scans.filter((s) => s.isPage && !isScaffoldPage(s.abs));
|
|
83
|
+
if (convertedPages.length === 0) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let loadsAConvertedPage: boolean = false;
|
|
88
|
+
|
|
89
|
+
for (const t of targets) {
|
|
90
|
+
const abs: string = absOf(t.target);
|
|
91
|
+
if (!fs.existsSync(abs)) {
|
|
92
|
+
report('GATE', 'entry-route-not-converted', t.rel, t.line,
|
|
93
|
+
`loadContent target page does not exist: '${t.target}' — expected file ${abs.replace(/\\/g, '/')}`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (isScaffoldPage(abs)) {
|
|
97
|
+
report('GATE', 'entry-route-not-converted', t.rel, t.line,
|
|
98
|
+
`loadContent loads the leftover DevEco scaffold page '${t.target}' (matches >= 3 template features), ` +
|
|
99
|
+
`while the project already has ${convertedPages.length} converted pages (${convertedPages.map((s) => s.rel).join(', ')})` +
|
|
100
|
+
' — no converted page ever becomes the launch route. Switch to the entry page produced by this batch' +
|
|
101
|
+
' (usually the one matching the Android Activity with MAIN/LAUNCHER)');
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
loadsAConvertedPage = true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Criterion (3): converted pages exist, but none is loaded (the target is neither scaffold nor in the conversion output,
|
|
108
|
+
// e.g. pointing at an intermediate or placeholder page)
|
|
109
|
+
if (!loadsAConvertedPage) {
|
|
110
|
+
report('GATE', 'entry-route-not-converted', targets[0].rel, targets[0].line,
|
|
111
|
+
`the project has ${convertedPages.length} converted pages (${convertedPages.map((s) => s.rel).join(', ')}), ` +
|
|
112
|
+
'but none is loaded by loadContent — at least one non-scaffold page must become the launch route');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// static_check/rules/fixed_size_safe_area.ts — split out of arkts_static_check.ts (logic unchanged).
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import { attrsWithArgs, chainHead, lineOfIndex, matchBracket, splitTopLevel, structMembers } from '../core/parse.ts';
|
|
5
|
+
import type { UiAttr } from '../core/parse.ts';
|
|
6
|
+
import { RE_PCT, maskedOf, reachesSystemBar } from '../core/scan.ts';
|
|
7
|
+
import type { FileScan } from '../core/scan.ts';
|
|
8
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
9
|
+
|
|
10
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
11
|
+
export const meta: RuleMeta[] = [
|
|
12
|
+
{
|
|
13
|
+
id: "fixed-size-expand-safe-area",
|
|
14
|
+
levels: ["GATE", "CAND"],
|
|
15
|
+
invariant: "window",
|
|
16
|
+
card: "window",
|
|
17
|
+
needs: [],
|
|
18
|
+
summary: "链上最后生效的高度是固定值(数值字面量 / 声明为 number 的成员)的组件写了 `expandSafeArea`;显式 SafeAreaEdge.TOP 时 GATE,其余为 CAND。",
|
|
19
|
+
fix: "层自身定高、不加 expandSafeArea,背景改 .background(<色或 builder>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] }) —— 背景区域包含扩展的安全区,组件布局不变(背景设置文档 BackgroundOptions);或里层用百分比高度再 expandSafeArea(百分比除外)。 CAND 命中时在报告里写明该高度表达式的实际取值。",
|
|
20
|
+
escape: null,
|
|
21
|
+
cases: [
|
|
22
|
+
"实测(weather1031 首页,API 24):头图层 .height(345.9vp 的折叠插值) + expandSafeArea(TOP),头图从屏幕顶画到 345.9vp,底边比 Android(状态栏 + 345.9)短一个栏高,日期行第二行 \"Night …\" 露在图外。",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* fixed-size-expand-safe-area: a component with a fixed height (number / 'Nvp' / 'auto') extended to the top with expandSafeArea.
|
|
34
|
+
*
|
|
35
|
+
* Safe-area doc constraint on expandSafeArea: with a fixed width/height or 'auto' only extension toward TOP / START is supported, and
|
|
36
|
+
* **the extended component keeps its size** — the whole component moves up by one status-bar height and its bottom edge moves up with it, ending
|
|
37
|
+
* one bar height shorter than Android (status bar + height). Looking only at "drawn into the status bar" misses this; check the bottom edge.
|
|
38
|
+
* Fix: the layer keeps its own height without expandSafeArea, and the background becomes .background(<color or builder>,
|
|
39
|
+
* { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] }) — the background area includes the extended safe area while
|
|
40
|
+
* the component layout is unchanged (background doc BackgroundOptions); or an inner layer uses a percentage height and then expandSafeArea (percentages excepted).
|
|
41
|
+
* The height is the last effective .height() / .size({ height }) on the chain: a numeric literal, or this.x / this.x() declared as number (not a union type)
|
|
42
|
+
* among the members of its struct, is GATE; other expressions' values cannot be seen (they may return a percentage), so CAND.
|
|
43
|
+
* Only an explicit SafeAreaEdge.TOP is GATE: without edges (default = all directions) it may be a bottom-pinned bar
|
|
44
|
+
* (bottom tab bar Row().height(56).expandSafeArea()), which extends toward the bottom, where this rule's fix does not apply, so CAND.
|
|
45
|
+
* 'auto' is also only CAND: the doc says it is subject to the same constraint, but only numeric heights were measured.
|
|
46
|
+
*/
|
|
47
|
+
/** Category of a height argument: 'pct' percentage / LayoutPolicy unconstrained, 'fixed' definitely a fixed value, 'unknown' undecidable ('auto' falls here). */
|
|
48
|
+
export function heightKind(arg: string, members: string): 'pct' | 'fixed' | 'unknown' {
|
|
49
|
+
const a: string = arg.trim();
|
|
50
|
+
if (RE_PCT.test(a) || /\bLayoutPolicy\./.test(a)) { return 'pct'; }
|
|
51
|
+
if (/^\d+(?:\.\d+)?$/.test(a) || /^(['"])\d+(?:\.\d+)?(?:vp|px|fp)?\1$/.test(a)) { return 'fixed'; }
|
|
52
|
+
const m: RegExpExecArray | null = /^this\.([A-Za-z_$][\w$]*)\s*(\(\s*\))?$/.exec(a);
|
|
53
|
+
if (m !== null) {
|
|
54
|
+
// (?<![\w$]) rather than \b: there is no word character before `$h`, so \b does not hold. Union types (number | string) may be percentages and do not count
|
|
55
|
+
const name: string = m[1].replace(/\$/g, '\\$');
|
|
56
|
+
const decl: RegExp = m[2] !== undefined
|
|
57
|
+
? new RegExp(`(?<![\\w$])${name}\\s*\\([^)]*\\)\\s*:\\s*number\\b(?!\\s*\\|)`)
|
|
58
|
+
: new RegExp(`(?<![\\w$])${name}\\s*:\\s*number\\b(?!\\s*\\|)`);
|
|
59
|
+
if (decl.test(members)) { return 'fixed'; }
|
|
60
|
+
}
|
|
61
|
+
return 'unknown';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The last effective height on the chain: .height(x) or .size({ height: x }), later ones override earlier ones; null if none. */
|
|
65
|
+
export function lastHeight(attrs: UiAttr[]): string | null {
|
|
66
|
+
let out: string | null = null;
|
|
67
|
+
for (const a of attrs) {
|
|
68
|
+
if (a.name === 'height') { out = a.args; continue; }
|
|
69
|
+
if (a.name !== 'size') { continue; }
|
|
70
|
+
const body: string = a.args.trim().replace(/^\{/, '').replace(/\}$/, '');
|
|
71
|
+
for (const part of splitTopLevel(body)) {
|
|
72
|
+
const kv: RegExpExecArray | null = /^\s*height\s*:\s*([\s\S]+?)\s*$/.exec(part);
|
|
73
|
+
if (kv !== null) { out = kv[1]; }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function checkFixedSizeExpandSafeArea(scans: FileScan[]): void {
|
|
80
|
+
for (const s of scans) {
|
|
81
|
+
const masked: string = maskedOf(s);
|
|
82
|
+
const re: RegExp = /\.expandSafeArea\s*\(/g;
|
|
83
|
+
let m: RegExpExecArray | null;
|
|
84
|
+
while ((m = re.exec(masked)) !== null) {
|
|
85
|
+
const close: number = matchBracket(s.code, m.index + m[0].length - 1);
|
|
86
|
+
const args: string = close < 0 ? '' : s.code.slice(m.index + m[0].length, close);
|
|
87
|
+
if (!reachesSystemBar(args, /\bSafeAreaEdge\.TOP\b/)) { continue; }
|
|
88
|
+
const edgeGiven: boolean = (splitTopLevel(args)[1] ?? '').trim() !== '';
|
|
89
|
+
const head = chainHead(masked, m.index);
|
|
90
|
+
if (head === null) { continue; }
|
|
91
|
+
const hv: string | null = lastHeight(attrsWithArgs(s.code, head.paren));
|
|
92
|
+
if (hv === null) { continue; }
|
|
93
|
+
const kind = heightKind(hv, structMembers(masked, m.index));
|
|
94
|
+
if (kind === 'pct') { continue; }
|
|
95
|
+
report(kind === 'fixed' && edgeGiven ? 'GATE' : 'CAND', 'fixed-size-expand-safe-area', s.rel,
|
|
96
|
+
lineOfIndex(s.code, m.index),
|
|
97
|
+
`${head.name} has fixed height ${hv.trim()} with expandSafeArea(TOP) — a fixed size stays the same after expansion, ` +
|
|
98
|
+
'so the component moves up by a status bar height and its bottom edge moves up too. Keep the layer\'s own fixed height without expandSafeArea and set the background with .background(<color or builder>, ' +
|
|
99
|
+
'{ ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] }); when moving up is really intended, state the basis' +
|
|
100
|
+
(edgeGiven ? '' : '. No edges given (default = all directions): if this is a bottom-anchored bar (bottom tab bar etc.) that extends at the bottom, this entry does not apply'));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// static_check/rules/format_string.ts — split out of arkts_static_check.ts (logic unchanged).
|
|
2
|
+
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { report } from '../core/findings.ts';
|
|
6
|
+
import { lineOfIndex, matchBracket, splitTopLevel } from '../core/parse.ts';
|
|
7
|
+
import { maskedOf } from '../core/scan.ts';
|
|
8
|
+
import type { FileScan } from '../core/scan.ts';
|
|
9
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
10
|
+
|
|
11
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
12
|
+
export const meta: RuleMeta[] = [
|
|
13
|
+
{
|
|
14
|
+
id: "format-string-without-args",
|
|
15
|
+
levels: ["GATE"],
|
|
16
|
+
invariant: "resources",
|
|
17
|
+
card: "resources",
|
|
18
|
+
needs: ["--resources"],
|
|
19
|
+
summary: "string.json 里带格式占位符(%1$s / %d …)的资源被无参 `$r('app.string.x')` 直接交给 Text/Span 显示(含经字段/变量中转)。",
|
|
20
|
+
fix: "传参:$r('app.string.x', value),或 getStringSync(id, value)",
|
|
21
|
+
escape: null,
|
|
22
|
+
cases: [
|
|
23
|
+
"实测(weather1029v2 首页):degree_feels_like = \"Feels like %1$s\",VM 字段 feelsLikeText = $r('app.string.degree_feels_like'),页面 Text(this.viewModel.forecast.feelsLikeText),屏幕显示 \"Feels like %1$s\"。",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/** Java/Android format placeholders: %s %d %1$s %.1f %,d … (%% is a literal percent sign; the space flag is not recognized, so "50% off" does not match). */
|
|
34
|
+
// A % right after a digit is a percent sign ("100%off", "50%cotton"); o / e / c / x / g followed by more letters is a word ("%extra").
|
|
35
|
+
// %s %d %f followed by a unit still count ("%dkm", "%.1fMB", "%1$sKB").
|
|
36
|
+
export const RE_FORMAT_SPEC: RegExp = /(?<![%\d])%(?:\d+\$)?[-#+0,(]*\d*(?:\.\d+)?(?:[sdf]|[xXoeEgGc](?![A-Za-z]))/;
|
|
37
|
+
|
|
38
|
+
/** name -> value of every string.json under the resource roots whose value contains a format placeholder (counted if any locale directory has one). */
|
|
39
|
+
export function formatStrings(resRoots: string[]): Map<string, string> {
|
|
40
|
+
const out: Map<string, string> = new Map();
|
|
41
|
+
const walk = (dir: string): void => {
|
|
42
|
+
let entries: fs.Dirent[];
|
|
43
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
44
|
+
for (const e of entries) {
|
|
45
|
+
const p: string = path.join(dir, e.name);
|
|
46
|
+
if (e.isDirectory()) { walk(p); continue; }
|
|
47
|
+
if (e.name !== 'string.json') { continue; }
|
|
48
|
+
try {
|
|
49
|
+
const j = JSON.parse(fs.readFileSync(p, 'utf8')) as { string?: { name: string; value: string }[] };
|
|
50
|
+
for (const it of j.string ?? []) {
|
|
51
|
+
if (typeof it.value === 'string' && RE_FORMAT_SPEC.test(it.value) && !out.has(it.name)) { out.set(it.name, it.value); }
|
|
52
|
+
}
|
|
53
|
+
} catch { /* bad JSON is reported by other checks */ }
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
resRoots.forEach((r) => walk(r));
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** The innermost unclosed call containing index pos: name and top-level argument count; null when not inside call arguments. */
|
|
61
|
+
export function enclosingCall(code: string, masked: string, pos: number): { name: string; argc: number } | null {
|
|
62
|
+
let depth: number = 0;
|
|
63
|
+
for (let i = pos - 1; i >= 0; i--) {
|
|
64
|
+
const c: string = masked[i];
|
|
65
|
+
if (c === ')' || c === '}' || c === ']') { depth++; continue; }
|
|
66
|
+
if (c !== '(' && c !== '{' && c !== '[') { continue; }
|
|
67
|
+
if (depth > 0) { depth--; continue; }
|
|
68
|
+
if (c !== '(') { return null; }
|
|
69
|
+
const close: number = matchBracket(code, i);
|
|
70
|
+
const nm: RegExpMatchArray | null = masked.slice(Math.max(0, i - 60), i).match(/([\w$]+)\s*$/);
|
|
71
|
+
return { name: nm === null ? '' : nm[1], argc: close < 0 ? 0 : splitTopLevel(code.slice(i + 1, close)).length };
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether field has some write that is not bad (that original argument-less $r text): `field = x`, `field: T = x`, object literal
|
|
78
|
+
* `{ field: x }` (struct call arguments). A written value starting with bad and not followed by a `,` continuation argument counts as the same bad write.
|
|
79
|
+
*/
|
|
80
|
+
export function hasOtherWrite(scans: FileScan[], field: string, bad: string): boolean {
|
|
81
|
+
const norm = (t: string): string => t.replace(/\s+/g, '').replace(/"/g, "'");
|
|
82
|
+
const badN: string = norm(bad);
|
|
83
|
+
const re: RegExp = new RegExp('(?<![\\w$])' + field.replace(/\$/g, '\\$') + '\\s*(=(?![=>])|:)', 'g');
|
|
84
|
+
for (const s of scans) {
|
|
85
|
+
re.lastIndex = 0;
|
|
86
|
+
let m: RegExpExecArray | null;
|
|
87
|
+
while ((m = re.exec(s.code)) !== null) {
|
|
88
|
+
let rest: string = s.code.slice(m.index + m[0].length, m.index + m[0].length + 300);
|
|
89
|
+
if (m[1] === ':') {
|
|
90
|
+
const ta: RegExpMatchArray | null = rest.match(/^[\w$.<>|\[\]\s]+?=(?![=>])/); // type annotation followed by =
|
|
91
|
+
if (ta !== null) { rest = rest.slice(ta[0].length); }
|
|
92
|
+
else if (/^\s*[\w$.<>|\[\]\s]+\s*[;\n]/.test(rest) && !/^\s*this\./.test(rest)) { continue; } // bare declaration
|
|
93
|
+
}
|
|
94
|
+
if (!norm(rest.slice(0, bad.length + 20)).startsWith(badN)) { return true; }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const RE_FORMATTING_CALL: RegExp = /^(?:get(?:Plural)?String(?:Value)?(?:Sync|ByName(?:Sync)?)?|format\w*)$/;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* GATE format-string-without-args: a string.json resource with format placeholders (%1$s / %d …) handed directly to Text / Span for display as an argument-less
|
|
104
|
+
* $r('app.string.x') — the UI shows the placeholder verbatim.
|
|
105
|
+
*
|
|
106
|
+
* On Android it is getString(R.string.x, arg); copied as an argument-less $r, the screen shows "… %1$s".
|
|
107
|
+
* Two shapes are judged: $r directly as the only argument of Text/Span; $r assigned to a field/variable whose name appears somewhere as the only argument of Text/Span
|
|
108
|
+
* and is never used via .id / getString* / format*.
|
|
109
|
+
* Fix: pass arguments with $r('app.string.x', value), or getContext().resourceManager.getStringSync(id, value).
|
|
110
|
+
*/
|
|
111
|
+
export function checkFormatStringWithoutArgs(scans: FileScan[], resRoots: string[]): void {
|
|
112
|
+
const fmt: Map<string, string> = formatStrings(resRoots);
|
|
113
|
+
if (fmt.size === 0) { return; }
|
|
114
|
+
const DISPLAY: RegExp = /^(?:Text|Span)$/;
|
|
115
|
+
for (const s of scans) {
|
|
116
|
+
const masked: string = maskedOf(s);
|
|
117
|
+
const re: RegExp = /\$r\(\s*(['"])app\.string\.([\w]+)\1\s*\)/g;
|
|
118
|
+
let m: RegExpExecArray | null;
|
|
119
|
+
while ((m = re.exec(s.code)) !== null) {
|
|
120
|
+
const name: string = m[2];
|
|
121
|
+
if (!fmt.has(name)) { continue; }
|
|
122
|
+
const after: string = s.code.slice(m.index + m[0].length, m.index + m[0].length + 8);
|
|
123
|
+
if (/^\s*\.\s*id\b/.test(after)) { continue; }
|
|
124
|
+
const call = enclosingCall(s.code, masked, m.index);
|
|
125
|
+
if (call !== null && (RE_FORMATTING_CALL.test(call.name) || call.argc > 1)) { continue; }
|
|
126
|
+
let shown: boolean = call !== null && DISPLAY.test(call.name) && call.argc === 1;
|
|
127
|
+
if (!shown && call === null) {
|
|
128
|
+
// Assignment/initialization: take the assigned name and see where it is consumed
|
|
129
|
+
const before: string = masked.slice(Math.max(0, m.index - 160), m.index);
|
|
130
|
+
const am: RegExpMatchArray | null = before.match(/([\w$]+)\s*(?::\s*[\w$.<>|\s]+)?=\s*$/);
|
|
131
|
+
if (am === null) { continue; }
|
|
132
|
+
const field: string = am[1];
|
|
133
|
+
// When the name has other writes (parameterized $r, strings, caller arguments { field: x } …), this is only a default value, not reported
|
|
134
|
+
if (hasOtherWrite(scans, field, m[0])) { continue; }
|
|
135
|
+
let formatted: boolean = false;
|
|
136
|
+
for (const t of scans) {
|
|
137
|
+
const tm: string = maskedOf(t);
|
|
138
|
+
const use: RegExp = new RegExp('(?<![\\w$])' + field.replace(/\$/g, '\\$') + '(?![\\w$])(?!\\s*(?::[^=]|=(?!=)))', 'g');
|
|
139
|
+
let u: RegExpExecArray | null;
|
|
140
|
+
while ((u = use.exec(t.code)) !== null) {
|
|
141
|
+
if (/^\s*\.\s*id\b/.test(t.code.slice(u.index + field.length, u.index + field.length + 8))) { formatted = true; break; }
|
|
142
|
+
const uc = enclosingCall(t.code, tm, u.index);
|
|
143
|
+
if (uc === null) { continue; }
|
|
144
|
+
if (RE_FORMATTING_CALL.test(uc.name)) { formatted = true; break; }
|
|
145
|
+
if (DISPLAY.test(uc.name) && uc.argc === 1) { shown = true; }
|
|
146
|
+
}
|
|
147
|
+
if (formatted) { break; }
|
|
148
|
+
}
|
|
149
|
+
if (formatted) { shown = false; }
|
|
150
|
+
}
|
|
151
|
+
if (!shown) { continue; }
|
|
152
|
+
report('GATE', 'format-string-without-args', s.rel, lineOfIndex(s.code, m.index),
|
|
153
|
+
`app.string.${name} = ${JSON.stringify(fmt.get(name))} contains format placeholders, but is referenced here without arguments and passed straight to Text — ` +
|
|
154
|
+
`the UI shows the placeholders verbatim. Pass the arguments: $r('app.string.${name}', value), or getStringSync(id, value)`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|