@buaa_smat/hometrans 0.1.16 → 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 +162 -54
- 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 +127 -144
- package/dist/cli/uninstall.js +76 -110
- 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 -41
- 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.bat +0 -85
- 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
|
@@ -11,15 +11,15 @@ allowed-tools:
|
|
|
11
11
|
|
|
12
12
|
# Self-Test Skill
|
|
13
13
|
|
|
14
|
-
You are a **Self-Test Runner**. Your job is to invoke the `self-tester` with the correct parameters, optionally drive a test-and-fix loop (test → fix → build → retest, default up to 3 rounds, configurable via `
|
|
14
|
+
You are a **Self-Test Runner**. Your job is to invoke the `self-tester` with the correct parameters, optionally drive a test-and-fix loop (test → fix → build → retest, default up to 3 rounds, configurable via `max-rounds`), and surface results to the user. You do NOT run test tools directly — you delegate all test work to `self-tester`.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
## Prerequisites
|
|
19
19
|
|
|
20
|
-
The skill requires two user inputs: `
|
|
20
|
+
The skill requires two user inputs: `test-case-path` and `hap-path`. `project-dir` (the HarmonyOS project root containing `AppScope/app.json5` — the self-tester resolves `bundle_name`/`app_name` from it via the resolve-metadata tool during round 1's `setup: true`) is derived automatically when omitted: walk up from each `hap-path` entry (directory entries first, then file entries' parent dirs), then from `test-case-path`'s directory, looking for a directory containing `AppScope/app.json5`. Ask the user only if derivation finds nothing. `output-path` is optional — if omitted, it defaults to the directory containing `test-case-path`. After the initial test the skill can optionally enter a test-and-fix loop. Each round's outputs are snapshotted into `<output-path>/round-{n}/` (the agent always writes to `<output-path>/` root; round dirs are populated by the snapshot step); the canonical "latest" copies live at `<output-path>/` root.
|
|
21
21
|
|
|
22
|
-
A
|
|
22
|
+
A package is required (this test installs the app on a connected real HarmonyOS device or emulator). `hap-path` accepts **one or more** comma-separated paths; **each entry may be a single `.hap`/`.hsp` file or a directory**. The union of all entries must form the full package set — exactly one entry HAP plus any feature HAPs and **in-app HSPs** (Harmony Shared Packages built together with the app). In-app HSPs cannot install standalone — they depend on the main HAP — so every listed path is gathered and installed together in one `hdc install -r` transaction; the entry HAP and the HSPs **need not live in the same directory**. Confirm the package source(s) with the user before proceeding.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -29,10 +29,10 @@ This skill (via `self-tester`) resolves each setting along the standard chain
|
|
|
29
29
|
|
|
30
30
|
| Variable | config.json fallback | Purpose | Valid when |
|
|
31
31
|
|---|---|---|---|
|
|
32
|
-
| `HOMETRANS_MODEL_API_KEY`
|
|
33
|
-
| `HOMETRANS_TOOL_PATH` |
|
|
32
|
+
| `HOMETRANS_MODEL_API_KEY` | `autotest.unified_model.api_key` | multimodal LLM key AutoTest uses to drive test cases (shared with UI alignment) | non-empty / not the placeholder |
|
|
33
|
+
| `HOMETRANS_TOOL_PATH` | none — no config.json layer; falls back to `~/.hometrans/tools` when env unset | HomeTrans tools dir (`<HOMETRANS_TOOL_PATH>/test-tools/autotest`) — the single tools-dir env var; there is no autotest-specific override | path exists on disk; if unset everywhere, falls back to `~/.hometrans/tools` |
|
|
34
34
|
|
|
35
|
-
The runner (`
|
|
35
|
+
The runner (`self-test-runner.ts`, invoked directly via `node`) applies this same chain at run time (env `HOMETRANS_MODEL_API_KEY` overrides `autotest.unified_model.api_key`). If **neither** the env var **nor** `autotest.unified_model.api_key` in `~/.hometrans/config.json` provides a real key, **stop and ask the user to provide it** before proceeding (suggest running `ht init` to persist it as a machine environment variable). The self-tester resolves the tools directory from the npm package install itself — `HOMETRANS_TOOL_PATH` / `~/.hometrans/tools` is only a fallback for the `resolve-dir` diagnostic and may be left unset.
|
|
36
36
|
|
|
37
37
|
## Step 1 — Parse Inputs
|
|
38
38
|
|
|
@@ -40,12 +40,13 @@ Extract the following from the user's message. If any required input is missing,
|
|
|
40
40
|
|
|
41
41
|
| Variable | Required | Meaning | Typical Phrasing |
|
|
42
42
|
|----------|----------|---------|------------------|
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
43
|
+
| `test-case-path` | yes | Path to test_case.md | "测试用例在...", "用例文件...", "test case path" |
|
|
44
|
+
| `hap-path` | yes | **One or more** comma-separated `.hap`/`.hsp` files or dirs forming the full package set (see **Prerequisites**): one entry HAP + any feature HAPs / in-app HSPs, possibly in different dirs, installed in one transaction. | "HAP路径...", "安装包在...", "包目录...", "hap和hsp在...", "hap/hsp...", "hap file..." |
|
|
45
|
+
| `project-dir` | no (derived from `hap-path` / `test-case-path`; ask only if derivation fails) | Path to the HarmonyOS project root (the directory containing `AppScope/app.json5`). The self-tester resolves `bundle_name`/`app_name` from it via the resolve-metadata tool during `setup: true`. | "工程目录...", "HarmonyOS工程...", "项目根...", "project dir..." |
|
|
46
|
+
| `output-path` | no (default: directory of `test-case-path`) | Directory for all output artifacts | "输出到...", "产物目录...", "output to..." |
|
|
47
|
+
| `pre-test-case-path` | no | Path to pre_test_case.md | "前置用例...", "pre test case..." |
|
|
48
|
+
| `android-project-path` | no (for fix loop) | Path to Android source project for reference-based fixing | "Android路径...", "android project..." |
|
|
49
|
+
| `max-rounds` | no (default `3`) | Max iterations for the test-and-fix loop. Must be a positive integer (`>= 1`). Only meaningful when the fix loop is enabled. | "最多 X 轮", "max rounds X", "迭代 X 次" |
|
|
49
50
|
|
|
50
51
|
**AskUserQuestion template (use this exact shape — do NOT ad-lib free-form questions):**
|
|
51
52
|
|
|
@@ -57,11 +58,11 @@ choices:
|
|
|
57
58
|
|
|
58
59
|
Map the user's reply back to the variable.
|
|
59
60
|
|
|
60
|
-
**Default `
|
|
61
|
+
**Default `output-path`**: If the user did not provide `output-path`, set it to the parent directory of `test-case-path` (the directory portion, without the filename). Use this resolved value everywhere downstream.
|
|
61
62
|
|
|
62
63
|
**Validation command** (platform-agnostic — adapt to OS):
|
|
63
64
|
|
|
64
|
-
Verify that `
|
|
65
|
+
Verify that `test-case-path` points to a readable file; that **every** comma-separated entry in `hap-path` points to a readable file **or directory**; and that, across all entries, the aggregated package set contains **at least one `.hap`** (the entry package). `output-path` is an existing directory (create if missing).
|
|
65
66
|
|
|
66
67
|
| OS | Example check |
|
|
67
68
|
|----|---------------|
|
|
@@ -70,6 +71,8 @@ Verify that `test_case_path` and `hap_path` point to readable files and `output_
|
|
|
70
71
|
|
|
71
72
|
Pick whichever shell is available — the operation, not the syntax, is what matters.
|
|
72
73
|
|
|
74
|
+
**HSP auto-discovery guard**: After validating `hap-path`, scan the **parent directory of the entry HAP** and any listed **directory entries** for `*.hsp` files and an `hsp/` subdirectory — this catches the common failure where only the entry HAP is passed but the app needs its in-app HSPs at runtime. For any `*.hsp` **not already covered** by `hap-path`, append its containing directory (or the individual files) to `hap-path` as extra comma-separated entries, and warn the user: "Auto-discovered N in-app HSP(s) in `<path>` and appended to hap-path — omitting them makes the app malfunction on the device." If none are found → proceed normally (single-module project).
|
|
75
|
+
|
|
73
76
|
---
|
|
74
77
|
|
|
75
78
|
## Step 2 — Test-and-Fix Loop
|
|
@@ -91,11 +94,12 @@ Substitute `<MAX_ROUNDS>` in the question text with the parsed value (default `3
|
|
|
91
94
|
|
|
92
95
|
### 2.0 — Loop Setup
|
|
93
96
|
|
|
94
|
-
1. Record `CURRENT_HAP = <
|
|
95
|
-
2. Initialize `round = 1`, `MAX_ROUNDS = <
|
|
96
|
-
3. Set `ROUND_DIR = <
|
|
97
|
-
4. `
|
|
98
|
-
5.
|
|
97
|
+
1. Record `CURRENT_HAP = <hap-path>` (the full comma-separated list as the user gave it) and keep an immutable copy `ORIGINAL_HAP_PATH = <hap-path>`. `CURRENT_HAP` is passed verbatim as `hap-path` to `self-tester` (package-set format: see **Prerequisites**).
|
|
98
|
+
2. Initialize `round = 1`, `MAX_ROUNDS = <max-rounds from Step 1, default 3>`. If the parsed value is missing or not a positive integer, use `3`.
|
|
99
|
+
3. Set `ROUND_DIR = <output-path>/round-1`. Create the directory.
|
|
100
|
+
4. **Resolve `project-dir`** (if the user did not provide it): walk up from each `hap-path` entry — for directory entries, check the entry itself then each parent; for file entries, start from the file's parent — looking for a directory containing `AppScope/app.json5`. If no `hap-path` entry yields it, repeat the walk from `test-case-path`'s directory. If still nothing, use `AskUserQuestion` to get it. Store as `<project-dir>`.
|
|
101
|
+
5. `PROJECT_ROOT` is **unset** at this point — it will be read after round 1's agent invocation produces `<output-path>/app-metadata.json`.
|
|
102
|
+
6. Mark step description with round info (e.g., "**Round 1/<MAX_ROUNDS>**").
|
|
99
103
|
|
|
100
104
|
---
|
|
101
105
|
|
|
@@ -114,12 +118,13 @@ Agent(
|
|
|
114
118
|
Assemble the prompt by joining these lines with `\n`, skipping any line whose value is unset:
|
|
115
119
|
|
|
116
120
|
- `hap_path: <CURRENT_HAP>`
|
|
117
|
-
- `output_path: <
|
|
118
|
-
- `
|
|
119
|
-
- `
|
|
121
|
+
- `output_path: <output-path>` (the ROOT — the agent always writes here)
|
|
122
|
+
- `project_dir: <project-dir>`
|
|
123
|
+
- `test_case_path: <test-case-path>`
|
|
124
|
+
- `pre_test_case_path: <pre-test-case-path>` (only if provided / resolved)
|
|
120
125
|
- `setup: true`
|
|
121
126
|
|
|
122
|
-
After the agent returns, read `<
|
|
127
|
+
After the agent returns, read `<output-path>/app-metadata.json` and extract `project_root` → store as `PROJECT_ROOT`. This is the canonical source from now on.
|
|
123
128
|
|
|
124
129
|
**Round 2+ invocation** — skips the parse phase and reuses the JSONs round 1 produced:
|
|
125
130
|
|
|
@@ -127,22 +132,32 @@ After the agent returns, read `<output_path>/app-metadata.json` and extract `pro
|
|
|
127
132
|
Agent(
|
|
128
133
|
subagent_type="self-tester",
|
|
129
134
|
description="Run Device Tests (Round {round})",
|
|
130
|
-
prompt="hap_path: <CURRENT_HAP>\noutput_path: <
|
|
135
|
+
prompt="hap_path: <CURRENT_HAP>\noutput_path: <output-path>\nsetup: false"
|
|
131
136
|
)
|
|
132
137
|
```
|
|
133
138
|
|
|
134
|
-
Before each round 2+ invocation,
|
|
139
|
+
Before each round 2+ invocation, re-read `<output-path>/app-metadata.json` (canonical source).
|
|
135
140
|
|
|
136
141
|
---
|
|
137
142
|
|
|
138
143
|
### 2A.1 — Detect early-exit (sentinel) reports first
|
|
139
144
|
|
|
140
|
-
The agent writes a degraded sentinel report when T1 / T3 / T4 /
|
|
145
|
+
The agent writes a degraded sentinel report when T1 / T3 / T4 / T6 fail before the case table is rendered. First, guard the empty-suite case — the batch launcher returns early without writing `summary.json` when there are 0 cases, which the sentinel check below would otherwise misreport as a batch crash:
|
|
141
146
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
- If `<output-path>/testcases.json` exists and contains 0 cases → set `stop_reason = no_testcases`, surface a clear message to the user (`<output-path>/testcases.json contains 0 cases — nothing to run`), snapshot the round (2.5), and exit the loop. Do NOT enter 2B. (The 2A.2 `total == 0` guard remains as a secondary safety net.)
|
|
148
|
+
|
|
149
|
+
Then check that the report exists:
|
|
150
|
+
|
|
151
|
+
- If `<output-path>/self-test-report.md` does **not** exist (e.g., T8 failure or a hard error not covered by the sentinel set) → set `stop_reason = agent_early_exit`, `early_exit_reason = "no self-test-report.md written — agent failed before producing a report"`, snapshot the round (2.5), and exit the loop. Do NOT enter 2B.
|
|
152
|
+
|
|
153
|
+
Then grep the report for the first `status:` line and the first `reason:` line:
|
|
154
|
+
|
|
155
|
+
| Shell | Example |
|
|
156
|
+
|-------|---------|
|
|
157
|
+
| bash / sh | `grep -m1 -E '^status:' "<output-path>/self-test-report.md"` |
|
|
158
|
+
| PowerShell | `Select-String -Path "<output-path>/self-test-report.md" -Pattern '^status:' | Select-Object -First 1` |
|
|
159
|
+
|
|
160
|
+
Run both `status:` and `reason:` checks.
|
|
146
161
|
|
|
147
162
|
- If the first line matches `status: FAIL` → this is a sentinel report. Set `stop_reason = agent_early_exit`, capture the `reason:` line for the user (`early_exit_reason = <reason>`), snapshot the round (2.5), and exit the loop. Do NOT enter 2B (the fixer cannot fix an environment / connectivity / config issue).
|
|
148
163
|
- Otherwise → proceed to 2A.2 below.
|
|
@@ -151,12 +166,12 @@ grep -m1 -E '^reason:' "<output_path>/self-test-report.md"
|
|
|
151
166
|
|
|
152
167
|
### 2A.2 — Parse the normal case table
|
|
153
168
|
|
|
154
|
-
Read `<
|
|
169
|
+
Read `<output-path>/self-test-report.md` (first 80 lines). Extract:
|
|
155
170
|
- `total` — total test cases
|
|
156
171
|
- `passed` — passed count
|
|
157
172
|
- `failed` — failed count
|
|
158
173
|
|
|
159
|
-
**Empty-suite guard**: If `total == 0` (e.g., `testcases.json` happened to be empty), set `stop_reason = no_testcases`, surface a clear message to the user (`<
|
|
174
|
+
**Empty-suite guard**: If `total == 0` (e.g., `testcases.json` happened to be empty), set `stop_reason = no_testcases`, surface a clear message to the user (`<output-path>/testcases.json contains 0 cases — nothing to run`), snapshot the round (2.5), and exit the loop. Do NOT enter the fix loop.
|
|
160
175
|
|
|
161
176
|
Otherwise: Set `round_all_passed = true` if `failed == 0` and `passed == total` (and `total > 0`, which the guard above ensures).
|
|
162
177
|
|
|
@@ -177,17 +192,17 @@ Launch `self-test-fixer`. Use `PROJECT_ROOT`:
|
|
|
177
192
|
Agent(
|
|
178
193
|
subagent_type="self-test-fixer",
|
|
179
194
|
description="Fix Self-Test Failures (Round {round})",
|
|
180
|
-
prompt="self_test_report_path: <
|
|
195
|
+
prompt="self_test_report_path: <output-path>/self-test-report.md\nharmony_project_dir: <PROJECT_ROOT>\noutput_path: <ROUND_DIR>"
|
|
181
196
|
)
|
|
182
197
|
```
|
|
183
198
|
|
|
184
|
-
> `android_project_dir` is optional — if the user mentioned an Android source path, add the line `android_project_dir: <
|
|
199
|
+
> `android_project_dir` is optional — if the user mentioned an Android source path, add the line `android_project_dir: <android-project-path>` to the prompt. Omit otherwise.
|
|
185
200
|
|
|
186
|
-
After completion, read `<ROUND_DIR>/self-test-fix-report.md` (first 60 lines). Extract:
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
201
|
+
After completion, read `<ROUND_DIR>/self-test-fix-report.md` (first 60 lines). Extract from its 概览 section (Chinese field names per self-test-fixer.md, English semantics in parentheses):
|
|
202
|
+
- `白盒确认问题存在` (confirmed — white-box confirmed defect count)
|
|
203
|
+
- `白盒判定为误报` (false positives count)
|
|
204
|
+
- `修复成功` (successfully fixed count)
|
|
205
|
+
- `修复失败(2次尝试后)` (failed to fix count)
|
|
191
206
|
|
|
192
207
|
Set `round_no_confirmed_defects = true` if `confirmed == 0` (all failures are false positives).
|
|
193
208
|
|
|
@@ -206,24 +221,33 @@ If `round_no_confirmed_defects`:
|
|
|
206
221
|
|
|
207
222
|
If `confirmed > 0`:
|
|
208
223
|
|
|
209
|
-
|
|
224
|
+
**Capture `BUILD_START`** immediately before invoking `hmos-fix-build-errors` — e.g. `touch "<ROUND_DIR>/.build_start_marker"` (or record a timestamp). This marks the moment the rebuild begins, so the re-collection step below can tell freshly-rebuilt module outputs from stale ones left by a prior build.
|
|
210
225
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)
|
|
217
|
-
```
|
|
226
|
+
**Determine signing mode**: Check `ORIGINAL_HAP_PATH` (the user's original input). If it contains `*-signed.hap` or `*-signed.hsp` entries → the original packages were signed (real device path) → pass `--signed` to assert signed output. If not (emulator path, unsigned packages) → omit `--signed` so the skill produces unsigned output. This prevents the rebuilt HAP from failing `hdc install -r` on a real device while allowing unsigned testing on emulators.
|
|
227
|
+
|
|
228
|
+
Then invoke the `hmos-fix-build-errors` skill with `<PROJECT_ROOT>` (and `--signed` if determined above) for a rebuild.
|
|
229
|
+
|
|
230
|
+
After completion, locate the authoritative entry directly from `<PROJECT_ROOT>/entry/build/default/outputs/default/`. Identify `ENTRY_HAP` in this priority order:
|
|
218
231
|
|
|
219
|
-
|
|
232
|
+
1. `<PROJECT_ROOT>/entry/build/default/outputs/default/entry-default-*.hap`
|
|
233
|
+
2. First `*.hap` under `<PROJECT_ROOT>/entry/build/default/outputs/default/`
|
|
220
234
|
|
|
221
|
-
|
|
222
|
-
2. First `<ROUND_DIR>/*-signed.hap`
|
|
235
|
+
If no `.hap` is found → report "Build did not produce a HAP — cannot re-test." Set `stop_reason = no_hap`. Snapshot the round (2.5) and exit the loop.
|
|
223
236
|
|
|
224
|
-
|
|
237
|
+
**Assemble the next round's install set into `<ROUND_DIR>/package-set/`** — the rebuilt entry + freshly-rebuilt in-app HSPs + any original packages the rebuild did not reproduce, all in ONE directory. Use `<ROUND_DIR>/package-set/` (a dedicated subdir), **not** `<ROUND_DIR>` itself, because step 1 clears the destination and `<ROUND_DIR>` holds the round's reports and `.build_start_marker`.
|
|
225
238
|
|
|
226
|
-
|
|
239
|
+
1. **Clear/create** `<ROUND_DIR>/package-set/`, then copy `ENTRY_HAP` into it. The entry is placed **unconditionally** (it is authoritative; the freshness gate below does NOT apply to it).
|
|
240
|
+
2. **Re-collect freshly-rebuilt in-app HSPs** from the build tree `<PROJECT_ROOT>/*/build/default/outputs/default/` into `<ROUND_DIR>/package-set/`, admitting **only `*.hsp` whose mtime ≥ `BUILD_START`** (cross-platform: `find "<dir>" -newer "<ROUND_DIR>/.build_start_marker"`, or compare `stat` mtimes). The mtime gate is essential: incremental rebuilds run no clean, so non-entry module dirs still hold *stale* `.hsp` from prior builds — only the ones rebuilt *this* round (mtime ≥ `BUILD_START`) are admitted. **Do NOT re-collect feature HAPs here** (leave them entirely to the carry-forward in step 3). Skip `*ohosTest*` / `*-test-*`.
|
|
241
|
+
3. **Carry-forward gap-fill** from the **original** package set (`ORIGINAL_HAP_PATH`, expanded: every `.hap`/`.hsp` across all its files/dirs), copying into `<ROUND_DIR>/package-set/` only basenames **still absent** after steps 1–2. **The rebuilt entry is always authoritative — never let an original entry HAP survive next to it:**
|
|
242
|
+
- **In-app HSPs** (`.hsp`): copy forward every one whose basename is not already in `package-set/`. (A freshly-rebuilt HSP from step 2 already occupies its basename → its stale original is correctly skipped.)
|
|
243
|
+
- **The original entry HAP: never carry it forward.** Identify it deterministically: a `.hap` named `entry-*`; else, if there is **exactly one** `.hap` among the original packages, that one. Copying it would leave **two entry HAPs** and install stale code.
|
|
244
|
+
- **Feature HAPs** (any other, clearly non-entry, module `.hap`): copy forward those whose basename is not already in `package-set/`. **If there are multiple non-`entry-*` `.hap` files and none is the sole `.hap`** — you cannot confidently tell feature from entry — **do NOT copy any of them and log that they were dropped.**
|
|
245
|
+
|
|
246
|
+
Use the cross-platform copy syntax from 2.5.
|
|
247
|
+
4. **Entry-uniqueness fallback:** if `package-set/` does not end with exactly one `entry-*.hap` (or assembly otherwise failed), discard `package-set/` and fall back to **today's** behavior — copy `ENTRY_HAP` from the build tree into `<ROUND_DIR>`, carry the originals forward directly into `<ROUND_DIR>`, and set `CURRENT_HAP = <ROUND_DIR>`. This keeps the loop no-worse-than-before on a malformed build.
|
|
248
|
+
5. Otherwise set `CURRENT_HAP = <ROUND_DIR>/package-set/`.
|
|
249
|
+
|
|
250
|
+
This yields one directory holding exactly one entry HAP (the rebuilt one) + freshly-rebuilt in-app HSPs + carried-forward originals for anything not rebuilt — collision-free, installed together by the next round's `hdc install -r`. If the original input was a lone `.hap` with no extras and no HSP was rebuilt, `package-set/` simply holds the rebuilt entry.
|
|
227
251
|
|
|
228
252
|
---
|
|
229
253
|
|
|
@@ -231,13 +255,13 @@ Update `CURRENT_HAP` to the new HAP path.
|
|
|
231
255
|
|
|
232
256
|
```
|
|
233
257
|
# stop_reason may already be set by 2A.1 (agent_early_exit), 2A.2 (no_testcases),
|
|
234
|
-
# 2B (all_passed / no_confirmed_defects), or 2C (
|
|
258
|
+
# 2B (all_passed / no_confirmed_defects), or 2C (no_hap).
|
|
235
259
|
if stop_reason is set: snapshot (2.5) and exit loop
|
|
236
260
|
elif round >= MAX_ROUNDS: stop_reason = max_rounds_reached; snapshot (2.5); exit loop
|
|
237
261
|
else:
|
|
238
262
|
snapshot (2.5) # snapshot the just-completed round
|
|
239
263
|
round += 1
|
|
240
|
-
ROUND_DIR = <
|
|
264
|
+
ROUND_DIR = <output-path>/round-{round}
|
|
241
265
|
create ROUND_DIR
|
|
242
266
|
go to 2A
|
|
243
267
|
```
|
|
@@ -246,19 +270,19 @@ else:
|
|
|
246
270
|
|
|
247
271
|
### 2.5 — Per-round Snapshot
|
|
248
272
|
|
|
249
|
-
After every round's 2A returns (round 1 and rounds 2+), snapshot these files from `<
|
|
273
|
+
After every round's 2A returns (round 1 and rounds 2+), snapshot these files from `<output-path>/` to `<ROUND_DIR>`. Each copy follows the rule **"skip if source missing"**.
|
|
250
274
|
|
|
251
275
|
| Source | Destination | Notes |
|
|
252
276
|
|--------|-------------|-------|
|
|
253
|
-
| `<
|
|
254
|
-
| `<
|
|
255
|
-
| `<
|
|
277
|
+
| `<output-path>/self-test-report.md` | `<ROUND_DIR>/self-test-report.md` | Always expected after a successful T8. If missing, sentinel-FAIL detection in 2A.1 already routed via `agent_early_exit`. |
|
|
278
|
+
| `<output-path>/task/` | `<ROUND_DIR>/task/` | Per-round runner artifacts. Skip if missing (e.g., agent FAILed before T6 created the dir). |
|
|
279
|
+
| `<output-path>/_extracted.json` | `<ROUND_DIR>/_extracted.json` | Only present after round 1 (S3.2 wrote it). Skip in rounds 2+. |
|
|
256
280
|
|
|
257
281
|
**NOT snapshotted** (these stay at root only as the canonical, cross-round artifacts):
|
|
258
|
-
- `<
|
|
259
|
-
- `<
|
|
282
|
+
- `<output-path>/testcases.json` — written once by round 1; rounds 2+ read it in place.
|
|
283
|
+
- `<output-path>/app-metadata.json` — written once by round 1; rounds 2+ read it in place.
|
|
260
284
|
|
|
261
|
-
**`task/` cleanup ordering**: T5 (inside the agent) cleans `<
|
|
285
|
+
**`task/` cleanup ordering**: T5 (inside the agent) cleans `<output-path>/task/` at the start of each test invocation. The invariant: by the time T5 wipes the root `task/` at the start of round N, the previous round's `task/` has already been snapshotted into `<output-path>/round-{N-1}/task/`.
|
|
262
286
|
|
|
263
287
|
**Cross-platform copy syntax**:
|
|
264
288
|
|
|
@@ -271,37 +295,44 @@ Use forward slashes for cross-platform safety; both shells accept them.
|
|
|
271
295
|
|
|
272
296
|
---
|
|
273
297
|
|
|
274
|
-
### 2.6 — Loop Finalization (
|
|
298
|
+
### 2.6 — Loop Finalization (package mirror only)
|
|
299
|
+
|
|
300
|
+
When the loop exits, mirror the final package(s) from `CURRENT_HAP` (which may live under the last `<ROUND_DIR>`) to `<output-path>/`. This is the only "latest" artifact whose primary location is a round dir; `self-test-report.md`, `testcases.json`, `app-metadata.json`, and `task/` already live at `<output-path>/` as canonical copies.
|
|
275
301
|
|
|
276
|
-
|
|
302
|
+
`CURRENT_HAP` may be a single file, a directory, or a comma-separated list of files/dirs. Walk **every** entry:
|
|
303
|
+
- For each entry that is a **directory** → copy every `.hap`/`.hsp` in it to `<output-path>/` (keep filenames). Do not copy non-package files.
|
|
304
|
+
- For each entry that is a **`.hap`/`.hsp` file** → copy it to `<output-path>/` (a lone single-`.hap` entry is copied to `<output-path>/entry-default.hap`; any other entry keeps its filename).
|
|
277
305
|
|
|
278
|
-
|
|
306
|
+
The goal: after finalization, `<output-path>/` holds the **complete installable set** (entry HAP + all HSPs / feature HAPs) so a later `hdc install -r` of every `.hap`/`.hsp` under `<output-path>/` (the engine expands a directory into its `.hap`/`.hsp` file list) reproduces the tested install.
|
|
307
|
+
|
|
308
|
+
Use the same cross-platform copy syntax as above. Skip any copy whose source already resides at the destination.
|
|
279
309
|
|
|
280
310
|
---
|
|
281
311
|
|
|
282
312
|
## Step 3 — Surface Results
|
|
283
313
|
|
|
284
|
-
Read `<
|
|
314
|
+
Read `<output-path>/self-test-report.md` (first 80 lines) and extract the overview section:
|
|
285
315
|
|
|
286
316
|
```
|
|
287
|
-
##
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
317
|
+
## 测试概览
|
|
318
|
+
|
|
319
|
+
- **测试套件**: <suite-name>
|
|
320
|
+
- **测试时间**: <time-range>
|
|
321
|
+
- **设备**: <device-serial>
|
|
322
|
+
- **应用**: <app-name> (<bundle-name>)
|
|
323
|
+
- **HAP**: <entry-hap-basename>
|
|
324
|
+
- **总用例数**: <total>(前置 <pre-total> + 常规 <regular-total>)
|
|
325
|
+
- **通过**: <passed>(前置 <pre-pass> / 常规 <regular-pass>)
|
|
326
|
+
- **失败**: <failed>(FAIL <fail-count> + UNKNOWN <unknown-count>)
|
|
327
|
+
- **常规通过率**: <regular-pass-rate>(仅功能场景,反映本次需求质量)
|
|
328
|
+
- **含前置通过率**: <pass-rate>(仅供整体参考;前置用例属于数据/环境准备,与本次需求功能无关)
|
|
298
329
|
```
|
|
299
330
|
|
|
300
|
-
> If the report file is missing or malformed, report the error to the user with the agent's output path — do NOT fabricate results. If the report exists but is truncated or unexpectedly formatted, read up to the first 80 lines for the overview section, and point the user to the full file at `<
|
|
331
|
+
> If the report file is missing or malformed, report the error to the user with the agent's output path — do NOT fabricate results. If the report exists but is truncated or unexpectedly formatted, read up to the first 80 lines for the overview section, and point the user to the full file at `<output-path>/self-test-report.md`.
|
|
301
332
|
|
|
302
333
|
**Pre-case reminder**: If pre-cases failed, note that these are environment/setup issues (permissions, media imports, tutorial skipping), NOT application defects. The regular pass rate (常规通过率) is the primary quality metric.
|
|
303
334
|
|
|
304
|
-
**Point the user to the full report**: `<
|
|
335
|
+
**Point the user to the full report**: `<output-path>/self-test-report.md` and per-round artifacts at `<output-path>/round-{N}/`.
|
|
305
336
|
|
|
306
337
|
### Loop Summary (if loop ran)
|
|
307
338
|
|
|
@@ -320,12 +351,12 @@ After the report, present:
|
|
|
320
351
|
`<stop_reason>` is one of:
|
|
321
352
|
- `all_passed` — all cases passed, loop exited successfully.
|
|
322
353
|
- `no_confirmed_defects` — failures exist but fixer judged them all as false positives.
|
|
323
|
-
- `
|
|
354
|
+
- `no_hap` — the rebuild did not produce an entry HAP in the build output, so the loop cannot continue.
|
|
324
355
|
- `max_rounds_reached` — hit the configured `MAX_ROUNDS` cap (default 3) with failures remaining.
|
|
325
|
-
- `no_testcases` — `<
|
|
326
|
-
- `agent_early_exit` — `self-tester` wrote a sentinel FAIL report (config / device / autotest-dir / batch crash / `setup: false` precondition failure). Surface the captured `early_exit_reason` so the user knows what to fix manually.
|
|
356
|
+
- `no_testcases` — `<output-path>/testcases.json` contained 0 cases; nothing to run. Surface the path so the user can inspect.
|
|
357
|
+
- `agent_early_exit` — `self-tester` wrote a sentinel FAIL report (config / device / autotest-dir / batch crash / `setup: false` precondition failure), or no `self-test-report.md` was written (agent failed before producing a report). Surface the captured `early_exit_reason` so the user knows what to fix manually.
|
|
327
358
|
|
|
328
|
-
If failures remain (for `max_rounds_reached`), list them briefly (scenario names from the report overview). Also surface
|
|
359
|
+
If failures remain (for `max_rounds_reached`), list them briefly (scenario names from the report overview). Also surface `<ROUND_DIR>/self-test-fix-report.md` when it exists, and describe the final rebuild outcome from the loop summary instead of relying on a removed build-stage report artifact.
|
|
329
360
|
|
|
330
361
|
---
|
|
331
362
|
|
|
@@ -333,48 +364,34 @@ If failures remain (for `max_rounds_reached`), list them briefly (scenario names
|
|
|
333
364
|
|
|
334
365
|
| Scenario | Action |
|
|
335
366
|
|----------|--------|
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
|
|
|
340
|
-
|
|
|
367
|
+
| `test-case-path` does not exist | Ask user for correct path, do not proceed |
|
|
368
|
+
| any `hap-path` entry does not exist | Name the missing entry, ask user for the correct path, do not proceed |
|
|
369
|
+
| `hap-path` entries all exist but none contributes a `.hap` (no entry package) | Report: "No entry HAP found across the given paths — at least one `.hap` is required." Do not proceed |
|
|
370
|
+
| `output-path` parent does not exist | Create it, proceed |
|
|
371
|
+
| Agent returns error / times out | Report the error to user. Suggest: check device connection (`npx --yes devecocli device list`), verify HAP is valid, check the `HOMETRANS_MODEL_API_KEY` env var or `autotest.unified_model.api_key` in `~/.hometrans/config.json` has a real api_key |
|
|
372
|
+
| `<output-path>/self-test-report.md` missing after agent completes | Report: "Agent completed but no report was generated. Check agent output at <output-path>." |
|
|
341
373
|
| `self-test-report.md` exists but format is unrecognizable | Show the file path, report the first 80 lines as context, let user investigate |
|
|
342
|
-
| Device not found (agent reports "No device") | Remind user: connect device
|
|
374
|
+
| Device not found (agent reports "No device") | Remind user: connect a HarmonyOS device or emulator, verify `npx --yes devecocli device list` shows it |
|
|
343
375
|
| Pre-case failures in report | Note: these are environment issues, not app defects. Highlight regular pass rate |
|
|
344
|
-
| `<
|
|
345
|
-
| `<
|
|
346
|
-
| `self-tester` writes a sentinel FAIL report (first line `status: FAIL`) | Capture the `reason:` line. Exit loop with `stop_reason = agent_early_exit` and surface the captured reason. Do NOT enter the fix loop — these failures (config / device / autotest-dir / crash / timeout / setup=false preconditions) are not application defects. |
|
|
376
|
+
| `<output-path>/testcases.json` or `app-metadata.json` missing after round 1 | Round 1 setup may have failed; inspect agent output at `<output-path>/` |
|
|
377
|
+
| `<output-path>/testcases.json` is empty (`total == 0` in 2A) | Report: "testcases.json contains 0 cases — nothing to run." Exit loop with `stop_reason = no_testcases`. Do NOT enter the fix loop. |
|
|
378
|
+
| `self-tester` writes a sentinel FAIL report (first line `status: FAIL`), or no `self-test-report.md` was written (agent failed before producing a report) | Capture the `reason:` line. Exit loop with `stop_reason = agent_early_exit` and surface the captured reason. Do NOT enter the fix loop — these failures (config / device / autotest-dir / crash / timeout / setup=false preconditions / report not produced) are not application defects. |
|
|
347
379
|
| Fixer returns `confirmed == 0` (all false positives) | Exit loop with `stop_reason = no_confirmed_defects`. Surface the fix report summary. |
|
|
348
|
-
|
|
|
380
|
+
| hmos-fix-build-errors produces no HAP in build output | Report: "Build did not produce a HAP — cannot re-test." Exit loop with `stop_reason = no_hap`. |
|
|
349
381
|
| Loop reaches `MAX_ROUNDS` (default 3) with failures remaining | Report `stop_reason = max_rounds_reached`. Surface final pass rate and remaining failures. |
|
|
350
382
|
| `app-metadata.json` missing after round 1 (PROJECT_ROOT unknown) | Surface agent error; PROJECT_ROOT cannot be resolved. Do NOT enter 2B. |
|
|
351
|
-
| Signing config missing in `build-profile.json5` before build | Report: "Signing configuration not found. Please open project in DevEco Studio, go to File → Project Structure → Signing Configs, enable Automatically generate signature, then re-run." Exit loop. |
|
|
352
383
|
|
|
353
384
|
---
|
|
354
385
|
|
|
355
386
|
## Key Constraints
|
|
356
387
|
|
|
357
|
-
- **Delegation only**: Do NOT run test tools directly. Never call `hdc`, `
|
|
388
|
+
- **Delegation only**: Do NOT run test tools directly. Never call `hdc`, `self-test-runner.ts`, `batch-launcher.ts`, or `report-tool.ts` yourself, and never read `test_case.md` or modify test cases — all of that goes through `self-tester`.
|
|
358
389
|
- **Parameter purity**: Pass only parameter values to the agent's prompt in `key: value` format. Do NOT add extra instructions, format descriptions, schema hints, or implementation suggestions. The agent has its own built-in workflow.
|
|
359
|
-
- **Do NOT read full reports**: Self-test reports can be very large (10KB–200KB). Only read the overview (first 80 lines for test report, first 60 lines for fix report). Point the user to the full file.
|
|
390
|
+
- **Do NOT read full reports**: Self-test reports can be very large (10KB–200KB). Only read the overview (first 80 lines for test report, first 60 lines for fix report). Point the user to the full file; never fabricate results when a report is missing or unreadable.
|
|
360
391
|
- **Quote all paths**: Paths may contain spaces. Always wrap paths in double quotes in commands.
|
|
361
392
|
- **Pre-cases are environment scripts**: Their failures indicate testing-environment issues, not app bugs. The regular pass rate is the primary quality metric.
|
|
362
393
|
- **Fix-and-retest loop is opt-in**: Follow Step 2 Entry — ask the user unless they already opted in with "自动修复".
|
|
363
394
|
- **Test → Fix → Build is the mandatory order**: Never re-test without rebuilding after a fix (would test old code). Never skip the build step in the loop.
|
|
364
|
-
- **`CURRENT_HAP` must track the latest build**: After each 2C rebuild, update `CURRENT_HAP` to the new
|
|
365
|
-
- **Per-round snapshots**: Each round writes its latest artifacts to `<
|
|
366
|
-
- **Loop stop conditions**: Normal exits (3) — `all_passed`, `no_confirmed_defects`, `max_rounds_reached`. Error exits (3) — `no_signed_hap` (build did not produce HAP), `no_testcases` (empty testcases.json), `agent_early_exit` (self-tester sentinel FAIL: config / device / autotest-dir / crash / timeout / `setup: false` precondition failure).
|
|
395
|
+
- **`CURRENT_HAP` must track the latest build**: After each 2C rebuild, update `CURRENT_HAP` to the new HAP from `ROUND_DIR`. Never re-test with the old HAP.
|
|
396
|
+
- **Per-round snapshots**: Each round writes its latest artifacts to `<output-path>/` (root), then the SKILL snapshots per-round outputs to `<output-path>/round-{N}/`. The persistent JSONs (`testcases.json`, `app-metadata.json`) are written exactly once by round 1 and consumed unchanged by rounds 2+. Never pass `output_path: <output-path>/round-N` to the agent — it always writes to `<output-path>/` root; round dirs are populated only by this snapshot step.
|
|
367
397
|
- **Loop iterations are strictly sequential**: Never launch more than one fixer or tester at a time.
|
|
368
|
-
|
|
369
|
-
## Forbidden
|
|
370
|
-
|
|
371
|
-
- ❌ Running `hdc list targets`, `hdc install`, or any `hdc` command directly
|
|
372
|
-
- ❌ Calling `self_test_runner.py` or `report_tool.py` directly
|
|
373
|
-
- ❌ Reading `test_case.md` or modifying test cases — the agent handles this
|
|
374
|
-
- ❌ Reading the full `self-test-report.md` (read only first 80 lines for summary)
|
|
375
|
-
- ❌ Reading the full `self-test-fix-report.md` (read only first 60 lines for summary)
|
|
376
|
-
- ❌ Fabricating results when the report is missing or unreadable
|
|
377
|
-
- ❌ Passing `output_path: <output_path>/round-N` to the agent — the agent always writes to `<output_path>/` root; per-round directories are populated by the SKILL's snapshot step
|
|
378
|
-
- ❌ Skipping the build step in the loop (rebuild is mandatory after each confirmed fix)
|
|
379
|
-
- ❌ Re-testing with an old HAP after a build
|
|
380
|
-
- ❌ Launching more than one fixer or tester at a time — loop rounds are strictly sequential
|