@buaa_smat/hometrans 0.1.17 → 0.1.19
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 +120 -56
- package/agents/code-reviewer.md +321 -65
- package/agents/logic-coder.md +113 -88
- package/agents/logic-context-builder.md +47 -29
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
- package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
- package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
- package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
- package/agents/scripts/hmos-precheck/index.mjs +17 -0
- package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
- package/agents/scripts/platform_query.mjs +626 -0
- package/agents/scripts/platform_query.test.mjs +422 -0
- package/agents/self-test-fixer.md +36 -34
- package/agents/self-tester.md +123 -143
- package/agents/test-case-generation-generator.md +317 -0
- package/agents/test-case-generation-validator.md +231 -0
- package/dist/cli/config-store.js +16 -63
- package/dist/cli/env-vars.js +1 -3
- package/dist/cli/index.js +0 -11
- package/dist/cli/init.js +123 -204
- package/dist/cli/uninstall.js +3 -127
- package/dist/utils/regex.js +8 -0
- package/env-requirements.json +55 -54
- package/package.json +6 -6
- package/resource/convert_pipeline_process.svg +103 -0
- package/resource/project_architecture.svg +122 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +345 -43
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-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 +648 -648
- package/skills/hmos-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 +2088 -2088
- package/skills/hmos-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 +1033 -1033
- package/skills/hmos-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 +1183 -1183
- package/skills/hmos-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 +576 -576
- package/skills/hmos-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 +297 -297
- package/skills/hmos-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 +395 -395
- package/skills/hmos-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 +902 -902
- package/skills/hmos-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 +106 -106
- package/skills/hmos-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 +1178 -1178
- package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/hmos-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 +354 -354
- package/skills/hmos-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 +11 -11
- package/skills/hmos-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 +206 -0
- package/skills/hmos-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 +373 -0
- package/skills/hmos-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 +158 -0
- package/skills/hmos-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 +750 -0
- package/skills/hmos-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 +1704 -0
- package/skills/hmos-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 +1012 -0
- package/skills/hmos-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 +164 -0
- package/skills/hmos-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 +840 -0
- package/skills/hmos-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 +856 -0
- package/skills/hmos-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 +83 -0
- package/skills/hmos-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 +294 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-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 +1220 -0
- package/skills/hmos-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 +47 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -0
- package/skills/hmos-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 +840 -0
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
- package/skills/hmos-convert-pipeline/SKILL.md +168 -121
- package/skills/hmos-fix-build-errors/SKILL.md +87 -67
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
- package/skills/hmos-incremental-ui-align/README.md +53 -36
- package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
- package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
- package/skills/hmos-incremental-ui-align/page_align.md +62 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +648 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +2088 -2088
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +1033 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +1183 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +576 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +297 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +395 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/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 +902 -902
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/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 +1178 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/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 +354 -354
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//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 +11 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +373 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +158 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +750 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +1704 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +1012 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +164 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +840 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +856 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +83 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/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 +294 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/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 +1220 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//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 +840 -0
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
- package/skills/hmos-integration-test/README.md +61 -70
- package/skills/hmos-integration-test/SKILL.md +128 -111
- package/skills/hmos-resources-convert/SKILL.md +334 -66
- package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
- package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
- package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
- package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
- package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
- package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
- package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
- package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
- package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
- package/skills/hmos-spec-generate/SKILL.md +293 -214
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
- package/skills/hmos-spec-generate/template/REQ.txt +22 -0
- package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
- package/skills/hmos-test-case-generation/README.md +241 -0
- package/skills/hmos-test-case-generation/SKILL.md +324 -0
- package/skills/hmos-test-case-generation/references/contract.md +315 -0
- package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
- package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
- package/tools/bfs-crawl/README.md +73 -0
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
- package/tools/test-tools/autotest/config.ts +175 -0
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +266 -0
- package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
- package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
- package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
- package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
- package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
- package/tools/test-tools/autotest/paths.ts +41 -0
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
- package/tools/test-tools/autotest/runner/logger.ts +45 -0
- package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
- package/tools/test-tools/autotest/validate.ts +167 -0
- package/agents/build-fixer.md +0 -385
- package/agents/logic-coder/scripts/platform_context_query.py +0 -568
- package/agents/review-fixer.md +0 -405
- package/agents/spec-generator.md +0 -541
- package/dist/cli/mcp-setup.js +0 -258
- package/dist/cli/mcp.js +0 -94
- package/dist/context/index.js +0 -694
- package/resource/migration_process.svg +0 -94
- package/resource/migration_process_transparent.svg +0 -93
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
- package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
- package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
- package/skills/hmos-resources-convert/evals/evals.json +0 -171
- package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
- package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
- package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
- package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
- package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
- package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
- package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
- package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
- package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
- package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
- package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
- package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
- package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
- package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
- package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
- package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
- package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
- package/tools/test-tools/autotest/README.md +0 -238
- package/tools/test-tools/autotest/pyproject.toml +0 -26
- package/tools/test-tools/autotest/report_tool.py +0 -759
- package/tools/test-tools/autotest/self_test_runner.py +0 -895
- package/tools/test-tools/autotest/testcases_tool.py +0 -215
- package/tools/test-tools/autotest/uv.lock +0 -3156
- package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Android 定时连续采集工具 (TypeScript 版) —— 每隔1秒自动采集一次 view tree + 截图,持续 x 秒。
|
|
4
|
+
*
|
|
5
|
+
* 用于捕获动态UI效果(动画中间态、Toast、瞬态弹窗等)。
|
|
6
|
+
* 零第三方依赖,仅使用 Node 内置模块。
|
|
7
|
+
*
|
|
8
|
+
* 用法:
|
|
9
|
+
* node page_capture_burst.ts --device adb -o ./output --duration 10
|
|
10
|
+
* node page_capture_burst.ts --device adb -o ./output --duration 5 --serial emulator-5554
|
|
11
|
+
*
|
|
12
|
+
* 等价于原 page_capture_burst.py(functional equivalence,非逐字节一致)。
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { spawnSync } from 'node:child_process';
|
|
16
|
+
import * as fs from 'node:fs';
|
|
17
|
+
import * as path from 'node:path';
|
|
18
|
+
import { pathToFileURL } from 'node:url';
|
|
19
|
+
|
|
20
|
+
function sleep(seconds: number): void {
|
|
21
|
+
const end = Date.now() + seconds * 1000;
|
|
22
|
+
const sab = new SharedArrayBuffer(4);
|
|
23
|
+
const ia = new Int32Array(sab);
|
|
24
|
+
while (Date.now() < end) {
|
|
25
|
+
Atomics.wait(ia, 0, 0, Math.min(50, end - Date.now()));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function adb(args: string[], serial: string | null = null, timeout = 15): string {
|
|
30
|
+
const full: string[] = [];
|
|
31
|
+
if (serial) full.push('-s', serial);
|
|
32
|
+
full.push(...args);
|
|
33
|
+
const res = spawnSync('adb', full, {
|
|
34
|
+
timeout: timeout * 1000,
|
|
35
|
+
maxBuffer: 128 * 1024 * 1024,
|
|
36
|
+
windowsHide: true,
|
|
37
|
+
});
|
|
38
|
+
if (res.error && (res.error as NodeJS.ErrnoException).code === 'ETIMEDOUT') {
|
|
39
|
+
console.log(` [WARN] adb timeout: ${args.join(' ')}`);
|
|
40
|
+
return '';
|
|
41
|
+
}
|
|
42
|
+
const out = (res.stdout as Buffer) ?? Buffer.alloc(0);
|
|
43
|
+
return out.toString('utf-8').trim();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function adbShell(args: string[], serial: string | null = null, timeout = 15): string {
|
|
47
|
+
return adb(['shell', ...args], serial, timeout);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function adbScreenshot(outputDir: string, filename: string, serial: string | null = null): boolean {
|
|
51
|
+
const localPath = path.join(outputDir, filename);
|
|
52
|
+
const args: string[] = [];
|
|
53
|
+
if (serial) args.push('-s', serial);
|
|
54
|
+
args.push('exec-out', 'screencap', '-p');
|
|
55
|
+
const res = spawnSync('adb', args, {
|
|
56
|
+
timeout: 15 * 1000,
|
|
57
|
+
maxBuffer: 128 * 1024 * 1024,
|
|
58
|
+
windowsHide: true,
|
|
59
|
+
});
|
|
60
|
+
if (res.error && (res.error as NodeJS.ErrnoException).code === 'ETIMEDOUT') {
|
|
61
|
+
console.log(' [WARN] screenshot timeout');
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
const stdoutBuf = (res.stdout as Buffer) ?? Buffer.alloc(0);
|
|
65
|
+
if (stdoutBuf.length > 0) {
|
|
66
|
+
fs.writeFileSync(localPath, stdoutBuf);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function adbDumpXml(outputDir: string, filename: string, serial: string | null = null): string {
|
|
73
|
+
const remotePath = '/sdcard/ui_dump.xml';
|
|
74
|
+
adbShell(['rm', '-f', '/sdcard/ui_dump.xml', '&&', 'uiautomator', 'dump', '/sdcard/ui_dump.xml'], serial, 20);
|
|
75
|
+
for (let i = 0; i < 6; i++) {
|
|
76
|
+
const check = adbShell(['ls', remotePath], serial);
|
|
77
|
+
if (check.includes(remotePath)) break;
|
|
78
|
+
sleep(0.2);
|
|
79
|
+
}
|
|
80
|
+
const xmlContent = adbShell(['cat', remotePath], serial, 15);
|
|
81
|
+
if (xmlContent) {
|
|
82
|
+
fs.writeFileSync(path.join(outputDir, filename), xmlContent, 'utf-8');
|
|
83
|
+
}
|
|
84
|
+
return xmlContent;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface CliArgs {
|
|
88
|
+
device: 'adb';
|
|
89
|
+
outputDir: string;
|
|
90
|
+
duration: number;
|
|
91
|
+
serial: string | null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function parseArgs(argv: string[]): CliArgs {
|
|
95
|
+
const args: CliArgs = { device: 'adb', outputDir: '', duration: 10, serial: null };
|
|
96
|
+
for (let i = 0; i < argv.length; i++) {
|
|
97
|
+
const a = argv[i];
|
|
98
|
+
const next = (): string => {
|
|
99
|
+
if (i + 1 >= argv.length) {
|
|
100
|
+
console.error(`Missing value for ${a}`);
|
|
101
|
+
process.exit(2);
|
|
102
|
+
}
|
|
103
|
+
return argv[++i];
|
|
104
|
+
};
|
|
105
|
+
if (a === '--device') {
|
|
106
|
+
const v = next();
|
|
107
|
+
if (v !== 'adb') {
|
|
108
|
+
console.error('--device must be adb (currently adb only)');
|
|
109
|
+
process.exit(2);
|
|
110
|
+
}
|
|
111
|
+
args.device = v;
|
|
112
|
+
} else if (a === '--output-dir' || a === '-o') {
|
|
113
|
+
args.outputDir = next();
|
|
114
|
+
} else if (a === '--duration' || a === '-d') {
|
|
115
|
+
args.duration = parseInt(next(), 10);
|
|
116
|
+
} else if (a === '--serial') {
|
|
117
|
+
args.serial = next();
|
|
118
|
+
} else if (a === '-h' || a === '--help') {
|
|
119
|
+
printHelp();
|
|
120
|
+
process.exit(0);
|
|
121
|
+
} else {
|
|
122
|
+
console.error(`Unknown argument: ${a}`);
|
|
123
|
+
process.exit(2);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (!args.outputDir) {
|
|
127
|
+
console.error('error: --output-dir/-o is required');
|
|
128
|
+
process.exit(2);
|
|
129
|
+
}
|
|
130
|
+
return args;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function printHelp(): void {
|
|
134
|
+
console.log(
|
|
135
|
+
[
|
|
136
|
+
'Burst capture: take view tree + screenshot every 1s for N seconds',
|
|
137
|
+
'',
|
|
138
|
+
'Usage: node page_capture_burst.ts --device adb -o <dir> [--duration N] [--serial S]',
|
|
139
|
+
'',
|
|
140
|
+
' --device Device type (currently adb only)',
|
|
141
|
+
' --output-dir,-o Output directory for captured files (required)',
|
|
142
|
+
' --duration,-d Total capture duration in seconds (default: 10)',
|
|
143
|
+
' --serial ADB device serial (optional)',
|
|
144
|
+
].join('\n'),
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function main(): number {
|
|
149
|
+
const args = parseArgs(process.argv.slice(2));
|
|
150
|
+
fs.mkdirSync(args.outputDir, { recursive: true });
|
|
151
|
+
|
|
152
|
+
console.log(`[Burst Capture] duration=${args.duration}s, output=${args.outputDir}`);
|
|
153
|
+
console.log('[Burst Capture] Starting continuous capture...');
|
|
154
|
+
|
|
155
|
+
const startTime = Date.now();
|
|
156
|
+
let frame = 0;
|
|
157
|
+
|
|
158
|
+
while (true) {
|
|
159
|
+
const elapsed = (Date.now() - startTime) / 1000;
|
|
160
|
+
if (elapsed >= args.duration) break;
|
|
161
|
+
|
|
162
|
+
frame += 1;
|
|
163
|
+
const frameStart = Date.now();
|
|
164
|
+
const frameStr = String(frame).padStart(3, '0');
|
|
165
|
+
process.stdout.write(` Frame ${frame} (t=${elapsed.toFixed(1)}s)... `);
|
|
166
|
+
|
|
167
|
+
const xmlOk = !!adbDumpXml(args.outputDir, `view_${frameStr}.xml`, args.serial);
|
|
168
|
+
const shotOk = adbScreenshot(args.outputDir, `screenshot_${frameStr}.png`, args.serial);
|
|
169
|
+
|
|
170
|
+
console.log(xmlOk && shotOk ? 'OK' : 'partial');
|
|
171
|
+
|
|
172
|
+
const frameElapsed = (Date.now() - frameStart) / 1000;
|
|
173
|
+
const sleepTime = Math.max(0, 1.0 - frameElapsed);
|
|
174
|
+
if (sleepTime > 0 && (Date.now() - startTime) / 1000 + sleepTime < args.duration) {
|
|
175
|
+
sleep(sleepTime);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
console.log(`\n[Burst Capture] Done. ${frame} frames captured to ${args.outputDir}`);
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const isEntry = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
184
|
+
if (isEntry) {
|
|
185
|
+
process.exit(main());
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { adbDumpXml, adbScreenshot, parseArgs };
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## 简介
|
|
4
4
|
|
|
5
|
-
**Self-Test** 是 HomeTrans 的端到端真机自测能力——你把一份 Markdown 测试用例和一个 HAP
|
|
5
|
+
**Self-Test** 是 HomeTrans 的端到端真机自测能力——你把一份 Markdown 测试用例和一个 HAP 交给我,我帮你把用例跑在鸿蒙真机或模拟器上,产出可读的测试报告。如果测试失败,我还能**自动分析原因、修改代码、重建 HAP、重新测试**,直到全部通过。测试和修复不是两个功能拼在一起,而是一条统一的工作流:你只需要说一句话,剩下的事情系统自动完成。
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## 我能做什么
|
|
10
10
|
|
|
11
11
|
- **把 Markdown 测试用例变成机器可读的 JSON**:解析你写的 `test_case.md`,自动提取包名、替换应用名,生成 AutoTest 可执行的 `testcases.json`。
|
|
12
|
-
-
|
|
13
|
-
- **测试失败后自动修复并重测**:读到失败报告 → 白盒审查源码 → 修改代码 →
|
|
12
|
+
- **在鸿蒙真机或模拟器上跑自动化测试**:连接真机或启动模拟器,安装 HAP,逐条执行用例,生成带通过率和失败详情的报告。
|
|
13
|
+
- **测试失败后自动修复并重测**:读到失败报告 → 白盒审查源码 → 修改代码 → 重新编译 HAP → 重新测试 → 如果还有失败则继续循环,默认最多 3 轮(可通过 `max-rounds` 参数配置)。
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -22,28 +22,19 @@
|
|
|
22
22
|
|
|
23
23
|
更完整的写法(指定所有路径):
|
|
24
24
|
|
|
25
|
-
> 跑自测,测试用例在 `D:\project\test_case.md`,HAP 在 `D:\project\entry-default
|
|
25
|
+
> 跑自测,测试用例在 `D:\project\test_case.md`,HAP 在 `D:\project\entry-default.hap`,输出到 `D:\project\output`
|
|
26
26
|
|
|
27
27
|
**然后会发生什么:**
|
|
28
28
|
|
|
29
|
-
1. **测试与修复循环** — 默认最多 3 轮(可通过 `
|
|
30
|
-
- 首轮:解析 `test_case.md` → 写出 `
|
|
31
|
-
- 测试完成后,SKILL 把当轮的 `self-test-report.md`、`task/`、`_extracted.json`(若有)快照到 `
|
|
29
|
+
1. **测试与修复循环** — 默认最多 3 轮(可通过 `max-rounds` 参数配置),每轮跑完后产物快照到 `output-path/round-{n}/`:
|
|
30
|
+
- 首轮:解析 `test_case.md` → 写出 `output-path/testcases.json` 与 `app-metadata.json` → 连接真机或模拟器、安装 HAP、跑 AutoTest → 产出 `output-path/self-test-report.md`
|
|
31
|
+
- 测试完成后,SKILL 把当轮的 `self-test-report.md`、`task/`、`_extracted.json`(若有)快照到 `output-path/round-{n}/`
|
|
32
32
|
- Fix:白盒审查代码 → 修改源码 → 产出 `round-{n}/self-test-fix-report.md`
|
|
33
|
-
- Build
|
|
33
|
+
- Build:调用 `hmos-fix-build-errors` 重新编译 → 从构建输出重新收集包集合并更新下一轮使用的 HAP/HSP
|
|
34
34
|
- 后续轮:跳过解析阶段,直接读首轮已生成的 `testcases.json` + `app-metadata.json`,用新 HAP 跑测试 → 同样快照到对应轮 `round-{n}/`
|
|
35
|
-
2. **HAP 镜像** —
|
|
35
|
+
2. **HAP 镜像** — 循环结束后,最后一轮的 HAP 复制到 `output-path/entry-default.hap`,方便直接取用
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| 文件 | 位置 | 内容 |
|
|
40
|
-
|------|------|------|
|
|
41
|
-
| `testcases.json` | 根目录 | 结构化用例,首轮生成后所有轮共享 |
|
|
42
|
-
| `app-metadata.json` | 根目录 | 包名、应用名、项目路径,首轮生成后所有轮共享 |
|
|
43
|
-
| `self-test-report.md` | 根目录(每轮覆盖,最终为最后一轮) | 测试报告 |
|
|
44
|
-
| `task/` | 根目录(每轮覆盖,最终为最后一轮) | AutoTest 原始产物 |
|
|
45
|
-
| `entry-default-signed.hap` | 根目录(循环结束后镜像) | 最后一轮编译的签名 HAP |
|
|
46
|
-
| `round-{n}/` | 子目录(每轮历史快照) | 每轮跑完后的 `self-test-report.md`、`task/`、`self-test-fix-report.md`、`build-fix-report.md`、`entry-default-signed.hap` 等 |
|
|
37
|
+
**最终产物**:都在 `output-path/` 下——`testcases.json` / `app-metadata.json`(根目录,跨轮共享)、`self-test-report.md` 与 `task/`(根目录,最新一轮)、`entry-default.hap`(循环结束后镜像),以及每轮历史快照 `round-{n}/`。完整清单见下方 [输出产物](#输出产物) 一节。
|
|
47
38
|
|
|
48
39
|
---
|
|
49
40
|
|
|
@@ -53,11 +44,13 @@
|
|
|
53
44
|
|
|
54
45
|
| 参数 | 是否必填 | 说明 |
|
|
55
46
|
|------|----------|------|
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
47
|
+
| `hap-path` | 必填 | 包路径,支持**一个或多个**(用逗号分隔)。每一项可以是 `.hap`/`.hsp` 文件,也可以是目录。所有项汇总起来要凑齐完整包集合:恰好一个 entry HAP + 其余 feature HAP / 应用内 HSP。**entry HAP 和 HSP 可以放在不同目录**——系统会把所有列出路径里的 `.hap`/`.hsp` 收集到一起,一次事务安装(应用内 HSP 不能单独装,必须和主包同一事务)。例:`D:\out\entry-default.hap, D:\hsp_out` |
|
|
48
|
+
| `output-path` | 可选,默认 = `test-case-path` 所在目录 | 所有产物输出到这个目录(`testcases.json`、`app-metadata.json`、`self-test-report.md`、`task/` 都写在此根目录)。不指定时直接写在用例文件同目录 |
|
|
49
|
+
| `project-dir` | 可选(自动从 `hap-path` / `test-case-path` 向上查找 `AppScope/app.json5` 推导;推导失败才询问) | HarmonyOS 工程根目录(含 `AppScope/app.json5`),用于解析 `bundle_name` / `app_name` |
|
|
50
|
+
| `test-case-path` | `setup=true` 时必填 | `test_case.md` 的路径 |
|
|
51
|
+
| `pre-test-case-path` | 可选 | 前置用例 `pre_test_case.md` 的路径。不传会自动在同目录查找 |
|
|
52
|
+
| `max-rounds` | 可选,默认 `3` | 测试修复循环的最大迭代轮数。必须为正整数(`>= 1`)。仅在启用修复循环时生效 |
|
|
53
|
+
| `setup` | 可选,默认 `true` | `true` = 解析 `test_case.md` 写出 JSON,再跑测试;`false` = 跳过解析阶段,直接读取 `<output-path>/testcases.json` 与 `<output-path>/app-metadata.json` 跑测试。两个 JSON 都不存在或为空时硬失败,需要重跑一次 `setup=true` |
|
|
61
54
|
|
|
62
55
|
### 自动修复参数
|
|
63
56
|
|
|
@@ -65,29 +58,27 @@
|
|
|
65
58
|
|
|
66
59
|
| 参数 | 必填 | 说明 |
|
|
67
60
|
|------|------|------|
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
61
|
+
| `harmony-project-dir` | 是 | 自动从 `app-metadata.json` 的 `project_root` 字段读取 |
|
|
62
|
+
| `android-project-path` | 否 | Android 参考项目路径。提供后 fixer 会参考 Android 实现来修 bug,质量更高 |
|
|
70
63
|
|
|
71
64
|
---
|
|
72
65
|
|
|
73
66
|
## 输出产物
|
|
74
67
|
|
|
75
|
-
`testcases.json` 和 `app-metadata.json` 在首轮(`setup=true`)写入 `
|
|
68
|
+
`testcases.json` 和 `app-metadata.json` 在首轮(`setup=true`)写入 `output-path/` 根目录,后续轮直接复用,不再重新生成。`self-test-report.md` 与 `task/` 每轮都会在根目录覆盖更新,跑完每轮后由 SKILL 快照到 `output-path/round-{n}/`。循环结束后,最后一轮的 HAP 镜像到根目录。
|
|
76
69
|
|
|
77
70
|
| 文件 | 写入位置 | 内容 |
|
|
78
71
|
|------|----------|------|
|
|
79
|
-
| `testcases.json` | `
|
|
80
|
-
| `app-metadata.json` | `
|
|
81
|
-
| `_extracted.json` | `
|
|
82
|
-
| `self-test-report.md` | `
|
|
83
|
-
| `task/task_<时间戳>/` | `
|
|
84
|
-
| `self-test-fix-report.md` | `
|
|
85
|
-
| `self-test-fix-commit-info.md` | `
|
|
86
|
-
| `
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
> **提示**:`output_path/` 根目录下的报告和 task 始终是最近一轮的最新产物;要查看某一轮的历史快照,进入对应的 `round-{n}/` 目录即可。
|
|
72
|
+
| `testcases.json` | `output-path/` 根目录(首轮写入,跨轮共享) | 结构化的用例列表,供 AutoTest 逐条执行 |
|
|
73
|
+
| `app-metadata.json` | `output-path/` 根目录(首轮写入,跨轮共享) | `{ bundle_name, app_name, project_root }` |
|
|
74
|
+
| `_extracted.json` | `output-path/` 根目录(首轮写入,跨轮快照保留) | 用例提取的中间文件,排查问题时有用,通常不需要关注 |
|
|
75
|
+
| `self-test-report.md` | `output-path/` 根目录(每轮覆盖,跨轮快照保留) | 可读的测试报告,含通过率、失败原因、每条用例的 AutoTest 任务路径 |
|
|
76
|
+
| `task/task_<时间戳>/` | `output-path/task/`(每轮覆盖,跨轮快照保留) | 每条用例的 HTML 报告、截图、Agent 日志 |
|
|
77
|
+
| `self-test-fix-report.md` | `output-path/round-{n}/`(Fix 步骤,有失败的轮次) | 白盒审查结论、根因分析、修改内容、修复结果 |
|
|
78
|
+
| `self-test-fix-commit-info.md` | `output-path/round-{n}/`(Fix 步骤) | `commit_id: <hash>` 或 `commit_id: none` |
|
|
79
|
+
| `entry-default.hap` | 构建输出目录(Build 步骤);循环结束后可镜像到 `output-path/` 根目录 | 修复后重新编译的 entry HAP |
|
|
80
|
+
|
|
81
|
+
> **提示**:`output-path/` 根目录下的报告和 task 始终是最近一轮的最新产物;要查看某一轮的历史快照,进入对应的 `round-{n}/` 目录即可。
|
|
91
82
|
|
|
92
83
|
---
|
|
93
84
|
|
|
@@ -102,16 +93,16 @@
|
|
|
102
93
|
┌─ 解析阶段(仅首轮)─────────────────────────────────────────┐
|
|
103
94
|
│ │
|
|
104
95
|
│ 读取 test_case.md → LLM 提取动作/预期结果 → 替换应用名为包名 │
|
|
105
|
-
│ →
|
|
96
|
+
│ → testcases-tool 生成 testcases.json + 写入 app-metadata.json │
|
|
106
97
|
│ │
|
|
107
98
|
└──────────────────────────────┬───────────────────────────────┘
|
|
108
99
|
│
|
|
109
100
|
▼
|
|
110
|
-
┌─ 测试与修复循环(每轮跑完后快照到
|
|
101
|
+
┌─ 测试与修复循环(每轮跑完后快照到 output-path/round-{n}/)──┐
|
|
111
102
|
│ │
|
|
112
103
|
│ ┌── Test ─────────────────────────────────────────────┐ │
|
|
113
|
-
│ │
|
|
114
|
-
│ │ → 每 60
|
|
104
|
+
│ │ 检测真机/模拟器连接 → 安装 HAP → AutoTest 批量执行用例 │ │
|
|
105
|
+
│ │ → 每 60 秒轮询 → 产出至 output-path/ → 快照 round-{n}/ │ │
|
|
115
106
|
│ └──────────────────────┬──────────────────────────────┘ │
|
|
116
107
|
│ │ │
|
|
117
108
|
│ 全部通过? │
|
|
@@ -132,9 +123,8 @@
|
|
|
132
123
|
│ 否(退出循环) 是(进入编译) │
|
|
133
124
|
│ │ │
|
|
134
125
|
│ ┌── Build ────────────────────────────────────────────┐ │
|
|
135
|
-
│ │ build-
|
|
136
|
-
│ │ →
|
|
137
|
-
│ │ → 产出 round-{n}/entry-default-signed.hap │ │
|
|
126
|
+
│ │ 调 `hmos-fix-build-errors` 重新编译 → 从构建输出重新收集 entry/HSP │ │
|
|
127
|
+
│ │ → 组装到 round-{n}/package-set/ 供下一轮安装 │ │
|
|
138
128
|
│ └──────────────────────┬──────────────────────────────┘ │
|
|
139
129
|
│ │ │
|
|
140
130
|
│ 未达上限? n++; 回到 Test │
|
|
@@ -145,7 +135,8 @@
|
|
|
145
135
|
└──────────────────────────────────────────────────────────────┘
|
|
146
136
|
│
|
|
147
137
|
▼
|
|
148
|
-
|
|
138
|
+
循环结束 → 仅镜像最终轮的签名安装包 (HAP/HSP) 到 output-path/;
|
|
139
|
+
self-test-report.md 已位于 output-path/ 根目录,无需镜像
|
|
149
140
|
```
|
|
150
141
|
|
|
151
142
|
### 循环停止条件
|
|
@@ -156,10 +147,10 @@
|
|
|
156
147
|
|------|-------------|------|
|
|
157
148
|
| 全部通过 | `all_passed` | 报告 `failed == 0`,所有用例通过 |
|
|
158
149
|
| 无确认缺陷 | `no_confirmed_defects` | fixer 判定所有失败都是测试误报(false positive),没有需要修改的代码缺陷 |
|
|
159
|
-
| 达到最大轮数 | `max_rounds_reached` | 已完成配置的最大轮数循环(`
|
|
160
|
-
| 编译未产出 HAP(异常) | `
|
|
150
|
+
| 达到最大轮数 | `max_rounds_reached` | 已完成配置的最大轮数循环(`max-rounds`,默认 3),仍有失败未解决 |
|
|
151
|
+
| 编译未产出 HAP(异常) | `no_hap` | 重建后在构建输出中找不到 entry HAP,无法继续测试 |
|
|
161
152
|
| 用例列表为空(异常) | `no_testcases` | `testcases.json` 里 0 条用例,没有可跑的内容。常见原因:解析阶段没识别到 `### Scenario:` 区块 |
|
|
162
|
-
| 自测 agent 早退(异常) | `agent_early_exit` | `self-tester` 在跑用例之前就退出了(设备没连、模型 api_key 没配(`HOMETRANS_MODEL_API_KEY` 环境变量或 `~/.hometrans/config.json` 的 `autotest.unified_model.api_key`)、`test-tools/autotest` 目录找不到(`HOMETRANS_TOOL_PATH` 环境变量未配置或失效)、batch 启动失败 / 超时 / 崩溃、`setup=false` 但所需 JSON
|
|
153
|
+
| 自测 agent 早退(异常) | `agent_early_exit` | `self-tester` 在跑用例之前就退出了(设备没连、模型 api_key 没配(`HOMETRANS_MODEL_API_KEY` 环境变量或 `~/.hometrans/config.json` 的 `autotest.unified_model.api_key`)、`test-tools/autotest` 目录找不到(`HOMETRANS_TOOL_PATH` 环境变量未配置或失效)、batch 启动失败 / 超时 / 崩溃、`setup=false` 但所需 JSON 缺失等),或根本没生成 `self-test-report.md`(agent 在产出报告前就失败退出)。报告首行会是 `status: FAIL`,第二行 `reason: <原因>`。**这种情况下不会进入 fix 循环**——这些是环境/前置条件问题,不是应用缺陷 |
|
|
163
154
|
|
|
164
155
|
---
|
|
165
156
|
|
|
@@ -180,9 +171,10 @@
|
|
|
180
171
|
|
|
181
172
|
每份报告包含以下部分:
|
|
182
173
|
|
|
183
|
-
-
|
|
174
|
+
- **测试概览**:测试套件名、测试时间、设备序列号、应用名(含 bundle_name)、HAP 文件名、总用例数(前置+常规拆分)、通过/失败数(均拆分子项)、常规通过率、含前置通过率
|
|
184
175
|
- **前置用例**:`[PRE]` 开头的用例,与常规用例分开列出,各自从 1 开始编号(Pre 1、Pre 2... / Case 1、Case 2...)
|
|
185
176
|
- **用例详情**:每条用例的动作、预期结果、AutoTest 判定结果、失败原因
|
|
177
|
+
- **测试总结**:总计用例、常规通过率(反映需求质量)、前置通过率、总计通过/未通过、未通过用例列表、建议
|
|
186
178
|
- **每条用例都标注了 `**AutoTest 任务路径**`**:指向该用例的原始执行目录(HTML 报告、截图、日志)
|
|
187
179
|
|
|
188
180
|
**PASS / FAIL / UNKNOWN 的含义:**
|
|
@@ -200,11 +192,12 @@
|
|
|
200
192
|
- **修复计划**:按依赖关系排序的修复列表
|
|
201
193
|
- **修复详情**:每条修复的 Android 参考、根因、具体修改、有效尝试次数、结果
|
|
202
194
|
- **误报说明**:为什么判定为误报,测试 agent 出了什么问题
|
|
203
|
-
- **编译验证**:编译结果及 build-
|
|
195
|
+
- **编译验证**:编译结果及 `hmos-fix-build-errors` 触发的编译修复情况(如有)
|
|
196
|
+
- **所有修改文件汇总**:文件路径、修改类型、关联 Scenario 的汇总表
|
|
204
197
|
|
|
205
|
-
###
|
|
198
|
+
### 编译阶段
|
|
206
199
|
|
|
207
|
-
|
|
200
|
+
编译阶段的关键结果是:项目是否重新编过、是否成功得到新的 entry HAP、以及下一轮测试使用的包集合是否已从构建输出重新收集完成。
|
|
208
201
|
|
|
209
202
|
---
|
|
210
203
|
|
|
@@ -239,18 +232,16 @@ build-fixer 的输出摘要:编译状态、签名类型、迭代次数、修
|
|
|
239
232
|
|
|
240
233
|
### 基础环境
|
|
241
234
|
|
|
242
|
-
- 操作系统:**Windows** 是主要测试目标;macOS/Linux 上的核心命令(`hdc
|
|
235
|
+
- 操作系统:**Windows** 是主要测试目标;macOS/Linux 上的核心命令(`hdc`、POSIX 工具链)也能跑,Skill 里涉及到的复制操作会按可用 shell 自适应
|
|
243
236
|
- `hdc` 已安装并在 PATH 中
|
|
244
|
-
- `
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
- 签名后的 `.hap` 文件
|
|
237
|
+
- api_key 已配置(与 UI 对齐共用同一个多模态模型)。统一链路「环境变量 → config.json → 询问」:`self-test-runner.ts` 跑用例前优先读 OS 环境变量 `HOMETRANS_MODEL_API_KEY`(由 `ht init` 导出),缺失时回落 `~/.hometrans/config.json` 的 `autotest.unified_model.api_key`;环境变量存在时会覆盖 config.json 里的对应字段。运行时由脚本读取整个 `autotest` 块、把 api_key/model/device 映射成 `AUTOTEST_*` 环境变量传给 `batch-launcher.ts`(`new AutoTestAgent({...})` 构造器),不再需要 `config.yaml`
|
|
238
|
+
- 鸿蒙真机或模拟器已连接,`npx --yes devecocli device list` 能看到设备
|
|
239
|
+
- `.hap` 文件(多模块应用:把 entry HAP + 应用内 HSP / feature HAP 一并传入;可以放进一个目录整目录传,也可以用逗号列出多个文件/目录,entry HAP 和 HSP 不在同一目录也行)
|
|
248
240
|
|
|
249
241
|
### 自动修复附加条件
|
|
250
242
|
|
|
251
243
|
- `app-metadata.json` 存在(setup 阶段自动产出,内含 `project_root`)
|
|
252
244
|
- 建议项目在 Git 仓库中(不在也可以修复,但不会自动 commit;`commit_id: none`)
|
|
253
|
-
- 签名配置已存在于 `build-profile.json5`(DevEco Studio → File → Project Structure → Signing Configs → Automatically generate signature)
|
|
254
245
|
|
|
255
246
|
---
|
|
256
247
|
|
|
@@ -258,11 +249,11 @@ build-fixer 的输出摘要:编译状态、签名类型、迭代次数、修
|
|
|
258
249
|
|
|
259
250
|
**Q: 报 "No HarmonyOS device connected"?**
|
|
260
251
|
|
|
261
|
-
A:
|
|
252
|
+
A: 检查设备/模拟器连接,跑 `npx --yes devecocli device list` 看看有没有设备 SN。真机请重新插拔 USB 并在设备上重新授权 USB 调试;模拟器请确认已启动。
|
|
262
253
|
|
|
263
254
|
**Q: 报 autotest 配置缺失 或 api_key 没填?**
|
|
264
255
|
|
|
265
|
-
A: 按统一链路「环境变量 → config.json → 询问」配置 api_key,三选一:① 设置环境变量 `HOMETRANS_MODEL_API_KEY`(优先级最高,`
|
|
256
|
+
A: 按统一链路「环境变量 → config.json → 询问」配置 api_key,三选一:① 设置环境变量 `HOMETRANS_MODEL_API_KEY`(优先级最高,`self-test-runner.ts` 跑用例前会用它覆盖 config.json);② 重新跑 `ht init` 配置统一模型,它会写入 `~/.hometrans/config.json` 的 `autotest.unified_model` 并导出 `HOMETRANS_MODEL_*` 环境变量;③ 手动编辑 `~/.hometrans/config.json`,把 `autotest.unified_model.api_key` 的 `YOUR_API_KEY_HERE` 替换成真实的 API Key。
|
|
266
257
|
|
|
267
258
|
**Q: 前置用例失败了要不要修代码?**
|
|
268
259
|
|
|
@@ -274,19 +265,19 @@ A: `PASS` — 通过;`FAIL` — 失败/超时/崩溃,有原因说明;`UNKN
|
|
|
274
265
|
|
|
275
266
|
**Q: 测试跑多久?**
|
|
276
267
|
|
|
277
|
-
A: 每条用例大约 6 分钟(含 Agent 决策和执行时间)。整体超时上限 = 用例数 ×
|
|
268
|
+
A: 每条用例大约 6 分钟(含 Agent 决策和执行时间)。整体超时上限 = 用例数 × 12 分钟(`--timeout auto` = N×720 秒,CLI 自动从用例数推导,含每条用例 10 分钟 CASE_TIMEOUT + 20% 余量),超过后自动终止并产出部分报告。
|
|
278
269
|
|
|
279
270
|
**Q: 怎么只重跑失败的用例?**
|
|
280
271
|
|
|
281
|
-
A: 目前每次都跑 `testcases.json` 的全部用例。你可以手动删掉已通过的条目,只保留失败的,然后用 `setup=false` 重新跑(会跳过解析阶段,直接读取 `<
|
|
272
|
+
A: 目前每次都跑 `testcases.json` 的全部用例。你可以手动删掉已通过的条目,只保留失败的,然后用 `setup=false` 重新跑(会跳过解析阶段,直接读取 `<output-path>/testcases.json`)。
|
|
282
273
|
|
|
283
274
|
**Q: 产物在哪个目录?**
|
|
284
275
|
|
|
285
|
-
A: `testcases.json` 和 `app-metadata.json` 在 `
|
|
276
|
+
A: `testcases.json` 和 `app-metadata.json` 在 `output-path/` 根目录。测试和修复的每轮产物在 `output-path/round-1/`、`output-path/round-2/`... 子目录中。循环结束后,最终轮的关键文件(报告、HAP)会镜像到 `output-path/` 根目录,方便直接查看。
|
|
286
277
|
|
|
287
278
|
**Q: 怎么启用自动修复?**
|
|
288
279
|
|
|
289
|
-
A: 说"跑自测,自动修复";或者跑完测试后看到有失败,Skill 会主动问你要不要启用,回复"是"就进去了。默认最多 3 轮,需要更多/更少可以加一句"最多 N 轮"(对应 `
|
|
280
|
+
A: 说"跑自测,自动修复";或者跑完测试后看到有失败,Skill 会主动问你要不要启用,回复"是"就进去了。默认最多 3 轮,需要更多/更少可以加一句"最多 N 轮"(对应 `max-rounds` 参数)。
|
|
290
281
|
|
|
291
282
|
**Q: 自动修复会改我的代码吗?**
|
|
292
283
|
|
|
@@ -294,16 +285,16 @@ A: 会修改鸿蒙源码来修 bug,但只在**白盒审查确认是真问题**
|
|
|
294
285
|
|
|
295
286
|
**Q: 自动修复一轮多久?**
|
|
296
287
|
|
|
297
|
-
A: Fix(白盒分析 + 改代码)约 5-10 分钟,Build(编译)约 2-5 分钟,Retest(重新跑用例)约 N×
|
|
288
|
+
A: Fix(白盒分析 + 改代码)约 5-10 分钟,Build(编译)约 2-5 分钟,Retest(重新跑用例)约 N×12 分钟。可以随时中断。
|
|
298
289
|
|
|
299
290
|
**Q: 什么情况下循环会停?**
|
|
300
291
|
|
|
301
|
-
A: 正常退出 3 种:① 全部通过(`all_passed`);② 所有失败都是误报,无代码缺陷需要修复(`no_confirmed_defects`);③ 跑满 `
|
|
292
|
+
A: 正常退出 3 种:① 全部通过(`all_passed`);② 所有失败都是误报,无代码缺陷需要修复(`no_confirmed_defects`);③ 跑满 `max-rounds` 轮(默认 3)仍有失败(`max_rounds_reached`)。异常退出 3 种:编译未产出 HAP(`no_hap`);`testcases.json` 为空(`no_testcases`);自测 agent 早退,写出首行 `status: FAIL` 的 sentinel 报告(`agent_early_exit`,常见原因:设备没连、api_key 没填、batch 崩溃 / 超时)。异常退出不会进入 fix 循环——那些是环境问题,不是代码缺陷。
|
|
302
293
|
|
|
303
294
|
**Q: 需要提供 Android 项目路径吗?**
|
|
304
295
|
|
|
305
296
|
A: 不必须。提供了 fixer 会参考 Android 实现来修 bug,质量更高。不提供也能独立完成,基于白盒代码分析和 HarmonyOS API 文档修复。
|
|
306
297
|
|
|
307
|
-
**Q: 报 "Build did not produce a
|
|
298
|
+
**Q: 报 "Build did not produce a HAP"?**
|
|
308
299
|
|
|
309
|
-
A:
|
|
300
|
+
A: 通常是编译失败或构建配置有误。检查 `hmos-fix-build-errors` 的编译输出,确认项目能正常构建后继续循环。
|