@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
|
@@ -35,8 +35,9 @@ Define shorthand variables for the instructions below:
|
|
|
35
35
|
|----------|---------|
|
|
36
36
|
| `ANDROID` | android_project_dir |
|
|
37
37
|
| `HMOS` | harmony_project_dir |
|
|
38
|
-
| `SPEC` | spec_file_path — requirement spec document, consumed directly by Stage 1 (`spec_file`) and Stage 3 (`
|
|
38
|
+
| `SPEC` | spec_file_path — requirement spec document, consumed directly by Stage 1 (`spec_file`) and Stage 3 (`scenario_doc_path`) |
|
|
39
39
|
| `OUTPUT` | assets_output_path; defaults to `HMOS/.hometrans` when not provided (created on demand) |
|
|
40
|
+
| `SCRIPTS_PATH` | absolute path to `agents/scripts` in this repo |
|
|
40
41
|
| `TEST_CASE` | test_case_path; defaults to `OUTPUT/test_case.md` when not provided |
|
|
41
42
|
| `PRE_TEST_CASE` | pre_test_case_path; defaults to `OUTPUT/pre_test_case.md` when not provided |
|
|
42
43
|
| `MAX_ROUNDS_REVIEW` | max_rounds_review — positive integer (default `2`). Controls Stage 3→3a→3b code-review-fix loop. |
|
|
@@ -51,25 +52,44 @@ The pipeline's sub-agents resolve each setting along the standard chain — **OS
|
|
|
51
52
|
|
|
52
53
|
| Variable | config.json fallback | Needed for | Valid when |
|
|
53
54
|
|---|---|---|---|
|
|
54
|
-
| `DEVECO_HOME` *(or `DEVECO_SDK_HOME`)* | `env.DEVECO_HOME` / `env.DEVECO_SDK_HOME` | Stage 2 build + Stage
|
|
55
|
-
| `HOMETRANS_MODEL_API_KEY`
|
|
56
|
-
| `HOMETRANS_TOOL_PATH` |
|
|
55
|
+
| `DEVECO_HOME` *(or `DEVECO_SDK_HOME`)* | `env.DEVECO_HOME` / `env.DEVECO_SDK_HOME` | Stage 2 build + Stage 3b/4b rebuilds | resolves to a valid DevEco install |
|
|
56
|
+
| `HOMETRANS_MODEL_API_KEY` | `autotest.unified_model.api_key` | Stage 4 self-test (only when `SKIP_TEST=false`) | non-empty / not the placeholder |
|
|
57
|
+
| `HOMETRANS_TOOL_PATH` | env unset → fall back to `~/.hometrans/tools` | Stage 4 self-test AutoTest dir | path exists on disk |
|
|
57
58
|
|
|
58
|
-
For each value, if the env var is unset, fall back to the listed `~/.hometrans/config.json` field. If neither yields a value:
|
|
59
|
+
For each value, if the env var is unset, fall back to the listed `~/.hometrans/config.json` field. If neither yields a value:
|
|
60
|
+
|
|
61
|
+
- **DevEco path** — **ask the user**; no stage can build without it.
|
|
62
|
+
- **model api_key** — **ask the user**, or accept `skip_test=true` to drop Stage 4 entirely.
|
|
63
|
+
- **`HOMETRANS_TOOL_PATH`** — do not ask and do not fail. The self-tester resolves its own tool directory from the npm package (with `~/.hometrans/tools` as fallback), so an unset value is normal. Record one manifest note and continue; only treat it as a problem if Stage 4 later reports `AutoTest directory not found`.
|
|
64
|
+
|
|
65
|
+
Suggest running `ht init` to persist these as machine environment variables.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Output Directory Guard (run before Stage 1)
|
|
70
|
+
|
|
71
|
+
When the resolved `OUTPUT` lies **under `HMOS`** (the default `HMOS/.hometrans` does), make the HarmonyOS project ignore it:
|
|
72
|
+
|
|
73
|
+
1. Compute `OUTPUT`'s path relative to `HMOS` — for the default, `.hometrans/`.
|
|
74
|
+
2. Read `HMOS/.gitignore`, creating it if absent.
|
|
75
|
+
3. If no existing rule already covers that path, append it on its own line with a trailing `/`.
|
|
76
|
+
4. Verify with `git -C "<HMOS>" check-ignore -q "<OUTPUT>"` (exit 0 = ignored). If it still is not ignored, stop and tell the user.
|
|
77
|
+
5. Note in the manifest whether the rule was pre-existing or added by this run.
|
|
78
|
+
|
|
79
|
+
Skip this guard when `OUTPUT` sits outside `HMOS`, or when `HMOS` is not a git repository — note the reason in the manifest either way.
|
|
59
80
|
|
|
60
81
|
---
|
|
61
82
|
|
|
62
83
|
## Progress Tracking
|
|
63
84
|
|
|
64
|
-
Before any agent runs, create tasks for all pipeline stages listed below so the user sees the full plan immediately. Stages are sequential — each stage depends on the previous one completing first. For the Stage 3 and Stage 4 loops, create one umbrella task per sub-stage (3 /
|
|
85
|
+
Before any agent runs, create tasks for all pipeline stages listed below so the user sees the full plan immediately. Stages are sequential — each stage depends on the previous one completing first. For the Stage 3 and Stage 4 loops, create one umbrella task per sub-stage (3 / 3b and 4 / 4a / 4b) covering the full multi-round cycle rather than creating per-round tasks. If `SKIP_TEST == true`, still create Stage 4 / 4a / 4b tasks but mark them as completed immediately with a "Skipped" note.
|
|
65
86
|
|
|
66
87
|
| # | subject | activeForm |
|
|
67
88
|
|---|---------|------------|
|
|
68
89
|
| 1 | Logic Development (Context Builder) | Building logic decision contract |
|
|
69
90
|
| 1a | Logic Coding | Converting business logic to ArkTS |
|
|
70
91
|
| 2 | Compilation and Build | Building HarmonyOS project |
|
|
71
|
-
| 3 | Code Review | Reviewing HarmonyOS code
|
|
72
|
-
| 3a | Review Fix | Fixing code review issues |
|
|
92
|
+
| 3 | Code Review + Fix | Reviewing and fixing HarmonyOS code |
|
|
73
93
|
| 3b | Rebuild after Review Fix | Rebuilding after review fixes |
|
|
74
94
|
| 4 | Self-Testing | Running on-device tests |
|
|
75
95
|
| 4a | Self-Test Fix | Fixing self-test failures |
|
|
@@ -79,18 +99,18 @@ For each stage: mark `in_progress` before launching the agent, then `completed`
|
|
|
79
99
|
|
|
80
100
|
### Stage Duration Tracking
|
|
81
101
|
|
|
82
|
-
For every stage (including each Stage 3 /
|
|
102
|
+
For every stage (including each Stage 3 / 3b review round and each Stage 4 / 4a / 4b test round), capture wall-clock duration:
|
|
83
103
|
|
|
84
104
|
1. Just before marking a stage `in_progress`, record `stage_start_iso` using the current local time (e.g., run `date -Iseconds` via Bash, or capture a timestamp in ISO-8601 `YYYY-MM-DDTHH:MM:SS` form).
|
|
85
105
|
2. Just after the stage's agent returns, record `stage_end_iso` the same way.
|
|
86
106
|
3. Compute `duration_seconds = stage_end_iso - stage_start_iso` and format as `H:MM:SS` (hours, minutes, seconds).
|
|
87
|
-
4. Record `start`, `end`, and `duration` in the manifest's **Duration Summary** table (see format below). For Stage 3 review loop rounds, record one row per execution using labels like `3 - Code Review (Round 1)`, etc. For Stage 4 test loop rounds, use labels like `4 - Self-Testing (Round 1)`, etc.
|
|
107
|
+
4. Record `start`, `end`, and `duration` in the manifest's **Duration Summary** table (see format below). For Stage 3 review loop rounds, record one row per execution using labels like `3 - Code Review + Fix (Round 1)`, etc. For Stage 4 test loop rounds, use labels like `4 - Self-Testing (Round 1)`, etc.
|
|
88
108
|
|
|
89
109
|
For the Stage 3 review loop:
|
|
90
110
|
- Mark Stage 3 `in_progress` when Round 1 starts, and keep it `in_progress` until the full review loop exits.
|
|
91
|
-
- Mark Stage
|
|
92
|
-
- Append brief per-round summaries into the Stage 3 /
|
|
93
|
-
- Only mark Stage 3 /
|
|
111
|
+
- Mark Stage 3b `in_progress` when the first Stage 3b round starts.
|
|
112
|
+
- Append brief per-round summaries into the Stage 3 / 3b task descriptions.
|
|
113
|
+
- Only mark Stage 3 / 3b `completed` after the review loop finishes (either `all_passed`, `no_progress`, or `max_rounds_reached`).
|
|
94
114
|
|
|
95
115
|
For the Stage 4 test loop:
|
|
96
116
|
- Mark Stage 4 `in_progress` when Round 1 starts, and keep it `in_progress` until the full test loop exits.
|
|
@@ -125,10 +145,9 @@ After each **review**, **fix**, or **test** stage completes, read the correspond
|
|
|
125
145
|
|
|
126
146
|
| Stage | Report File | What to Extract |
|
|
127
147
|
|-------|-------------|-----------------|
|
|
128
|
-
| **3 — Code Review** | `review-round-N/code-review-report.md` | From the **Overview** section, extract `Total Scenarios
|
|
129
|
-
| **
|
|
130
|
-
| **
|
|
131
|
-
| **4a — Self-Test Fix** | `round-N/self-test-fix-report.md` | From the **概览** section, extract: `报告中失败 scenario 总数` (total failed), `白盒确认问题存在` (confirmed), `白盒判定为误报` (false positives), `修复成功` (fixed), `修复失败` (failed to fix). **Defects fixed** = `修复成功`. **Defects not fixed** = `修复失败`. Use this to populate the same round row as Stage 4. |
|
|
148
|
+
| **3 — Code Review** | `review-round-N/code-review-report.md` | From the **Overview** section, extract `Total Scenarios`, the verdict breakdown (`PASS`, `PARTIAL`, `FAIL`, `UNABLE TO VERIFY` counts), `Total Defects Found`, `Successfully Fixed`, `Failed to Fix`, `Fix Success Rate`, and **Overall Verdict** (`PASS` / `PASS WITH ISSUES` / `NEEDS REWORK`). **Defects found** = `Total Defects Found`. **Defects fixed** = `Successfully Fixed`. **Defects not fixed** = `Failed to Fix`. Record one row per review round. |
|
|
149
|
+
| **4 — Self-Testing** | `round-N/self-test-report.md` | From the **测试概览** section (fall back to **测试总结**), extract: `总用例数` (total cases), `通过` (passed), `失败` (failed), and **`常规通过率`** as the pass rate — the report carries two rates and the regular-only one is the quality metric; keep `含前置通过率` as a secondary note when present. **Defects found** = `失败` count. Record one row per round. |
|
|
150
|
+
| **4a — Self-Test Fix** | `round-N/self-test-fix-report.md` | From the **概览** section, extract: `报告中失败 scenario 总数` (total failed), `白盒确认问题存在` (confirmed), `白盒判定为误报` (false positives), `修复成功` (fixed), `修复失败(2次尝试后)` (failed to fix). **Defects fixed** = `修复成功`. **Defects not fixed** = `修复失败(2次尝试后)`. Use this to populate the same round row as Stage 4. |
|
|
132
151
|
|
|
133
152
|
### How to extract
|
|
134
153
|
|
|
@@ -143,25 +162,53 @@ In `OUTPUT/pipeline-manifest.md`, include a **Defect Summary** table after the D
|
|
|
143
162
|
|
|
144
163
|
| Stage | Report File | Defects Found | Defects Fixed | Not Fixed | Details |
|
|
145
164
|
|-------|-------------|---------------|---------------|-----------|---------|
|
|
146
|
-
| 3 Loop - Round 1 | review-round-1/code-review-report.md
|
|
147
|
-
| 3 Loop - Round 2 | review-round-2/code-review-report.md
|
|
148
|
-
| 3 Loop - Summary | review-round-*/... | Total found across rounds | Total fixed across rounds | Remaining in final round | Rounds executed: N / MAX_ROUNDS_REVIEW; stop reason: all_passed/
|
|
165
|
+
| 3 Loop - Round 1 | review-round-1/code-review-report.md | X (Y FAIL + Z PARTIAL) | D fixed | E not fixed | Overall: PASS WITH ISSUES; rebuild=SUCCESS |
|
|
166
|
+
| 3 Loop - Round 2 | review-round-2/code-review-report.md | 0 | — | — | Overall: PASS; stop=all_passed; 3b skipped — round passed |
|
|
167
|
+
| 3 Loop - Summary | review-round-*/... | Total found across rounds | Total fixed across rounds | Remaining in final round | Rounds executed: N / MAX_ROUNDS_REVIEW; stop reason: all_passed/no_progress/max_rounds_reached |
|
|
149
168
|
| 4 Loop - Round 1 | round-1/self-test-report.md + round-1/self-test-fix-report.md | X failed / Y total | C | D | Pass rate: ZZ%; confirmed=B; false positives=F; rebuild=SUCCESS |
|
|
150
|
-
| 4 Loop - Round 2 | round-2/self-test-report.md + round-2/self-test-fix-report.md |
|
|
151
|
-
| 4 Loop - Summary | round-*/... | Total found across rounds | Total fixed across rounds | Remaining in final round | Rounds executed: N / MAX_ROUNDS_TEST; stop reason: all_passed/max_rounds_reached |
|
|
169
|
+
| 4 Loop - Round 2 | round-2/self-test-report.md + round-2/self-test-fix-report.md | 0 failed / Y total | — | — | Pass rate: ZZ%; confirmed=0; false positives=0; rebuild=SUCCESS; stop=all_passed; 4a/4b skipped — round passed |
|
|
170
|
+
| 4 Loop - Summary | round-*/... | Total found across rounds | Total fixed across rounds | Remaining in final round | Rounds executed: N / MAX_ROUNDS_TEST; stop reason: all_passed/no_confirmed_defects/max_rounds_reached |
|
|
152
171
|
```
|
|
153
172
|
|
|
154
173
|
For stages that are not review/fix/test (Stages 1–2), no row is needed in this table.
|
|
155
|
-
For the Stage 3 loop,
|
|
174
|
+
For the Stage 3 loop, `code-reviewer` reviews and fixes in the same pass, so one row per round captures both.
|
|
156
175
|
For the Stage 4 loop, combine test and fix results into one row per round plus one summary row.
|
|
157
176
|
|
|
158
177
|
---
|
|
159
178
|
|
|
160
179
|
## Pipeline Execution
|
|
161
180
|
|
|
181
|
+
### Package-Set Collection (shared procedure)
|
|
182
|
+
|
|
183
|
+
Several stages below need the **full signed package set** — the entry HAP plus any in-app HSPs (and any feature HAP the build freshly produced) — so the self-tester installs them in one `hdc install -r` transaction (in-app HSPs cannot install standalone). Those stages call this procedure.
|
|
184
|
+
|
|
185
|
+
**Inputs:**
|
|
186
|
+
- `BUILD_ROOT` — the project root rebuilt by `hmos-fix-build-errors` (= `HMOS`).
|
|
187
|
+
- `DEST` — a dedicated `package-set/` directory to populate; **must never be the directory where you mirror the authoritative entry HAP** (step 1 clears `DEST`).
|
|
188
|
+
- `BUILD_START` — a marker captured **immediately before** invoking the build stage, e.g. `touch "<DEST>/../.build_start_marker"` (or record a timestamp). Used to tell freshly-rebuilt artifacts from stale ones. A touched marker + `find -newer` avoids clock-skew between the build stage and the host.
|
|
189
|
+
- `AUTHORITATIVE_ENTRY` — the authoritative signed entry HAP resolved directly from `HMOS/entry/build/default/outputs/default/` after `hmos-fix-build-errors` succeeds. Once resolved for the stage, treat it as authoritative regardless of mtime.
|
|
190
|
+
|
|
191
|
+
**Procedure:**
|
|
192
|
+
1. **Clear/create `DEST`** (remove prior contents, recreate) so stale packages never leak forward. `DEST` is a dedicated `package-set/` subdir, distinct from the location where you mirror the authoritative entry for this stage.
|
|
193
|
+
2. **Place the authoritative entry:** copy `AUTHORITATIVE_ENTRY` into `DEST`. Included **unconditionally — the mtime gate does NOT apply to the entry** (an incremental build may leave the build-tree entry UP-TO-DATE, but the resolved entry HAP still reflects the current build result).
|
|
194
|
+
3. **Discover non-entry outputs** under depth-1 modules `BUILD_ROOT/*/build/default/outputs/default/`, admitting **only files with mtime ≥ `BUILD_START`** (freshly rebuilt this invocation; cross-platform: `find "<dir>" -newer "<marker>"` or compare `stat` mtimes). Incremental rebuilds run **no clean**, so non-entry dirs still hold *prior*-build packages — the mtime gate is the only reliable way to reject those stale artifacts:
|
|
195
|
+
- **HSPs:** `*-signed.hsp` (the fresh in-app HSPs).
|
|
196
|
+
- **Feature HAPs:** `*-signed.hap` from non-entry modules the build freshly rebuilt; skip any whose basename equals `AUTHORITATIVE_ENTRY`'s.
|
|
197
|
+
4. **Exclude test artifacts:** skip `*ohosTest*` and `*-test-signed.*`.
|
|
198
|
+
5. **Unsigned-HSP rule (all-or-nothing):** if any module dir has a **freshly-rebuilt** `*.hsp` but **no** fresh `*-signed.hsp`, mark the collection **incomplete** → the caller falls back to the entry-only / legacy set and logs the unsigned HSP as a build-config gap. (A *stale* unsigned `.hsp` is ignored — it never passes the mtime gate.) Rationale: all packages install in one transaction; a single unsigned package fails the whole `hdc install -r`, so the entry would never install — strictly worse than today. A *partial* set is also unsafe.
|
|
199
|
+
6. **Copy** the selected non-entry files into `DEST` (flat). (The entry is already there from step 2.)
|
|
200
|
+
7. **Invariants:**
|
|
201
|
+
- **≥ 1 `.hap`** — guaranteed by step 2. If `AUTHORITATIVE_ENTRY` is missing, collection **fails** → caller fallback.
|
|
202
|
+
- **Exactly one `entry-*.hap`** (the authoritative one). If the fresh harvest still yields a second, differently-named `entry-*.hap`, **fail** the collection and log the conflict (the self-tester picks `entry-*` first and cannot disambiguate two entries). Non-`entry-*` feature HAPs may be many.
|
|
203
|
+
- On a same-basename collision in `DEST`, abort with a logged error listing sources.
|
|
204
|
+
- Manifest inventory line: `package-set: 1 entry hap + F feature hap(s) + M signed hsp(s) → DEST` (and `WARNING: K unsigned .hsp skipped — build-config gap` if any).
|
|
205
|
+
8. **Result:** the caller sets `CURRENT_HAP = DEST`.
|
|
206
|
+
|
|
207
|
+
> **Build-completeness caveat.** Whether `assembleHap -p module=entry` freshly emits a signed `.hsp` depends on hvigor's transitive-build behavior; if nothing fresh is emitted this procedure collects **entry-only** and equals today — never worse. Independent feature modules (off entry's dependency path) are never rebuilt by `-p module=entry`; harvesting their HAPs needs a build change (out of scope).
|
|
208
|
+
|
|
162
209
|
### Stage 1 — Logic Development (Context Builder)
|
|
163
210
|
|
|
164
|
-
Flags: `skip-plan-builder: true|false` (default `false`) — when `true`, skip this stage and reuse an existing `OUTPUT/logic/plan.md`.
|
|
211
|
+
Flags: `skip-plan-builder: true|false` (default `false`) — an internal flag, not accepted as a pipeline argument; when `true`, skip this stage and reuse an existing `OUTPUT/logic/plan.md`.
|
|
165
212
|
|
|
166
213
|
Prompt format (applies to both Stage 1 and Stage 1a): ONLY the key-value lines below. No natural language, step lists, or Markdown.
|
|
167
214
|
|
|
@@ -169,7 +216,7 @@ Prompt format (applies to both Stage 1 and Stage 1a): ONLY the key-value lines b
|
|
|
169
216
|
```
|
|
170
217
|
Agent(
|
|
171
218
|
subagent_type="logic-context-builder",
|
|
172
|
-
prompt="harmony_project_dir: HMOS\nspec_file: SPEC\noutput_path: OUTPUT/logic"
|
|
219
|
+
prompt="harmony_project_dir: HMOS\nspec_file: SPEC\noutput_path: OUTPUT/logic\nscripts_path: SCRIPTS_PATH"
|
|
173
220
|
)
|
|
174
221
|
```
|
|
175
222
|
2. Verify `OUTPUT/logic/plan.md` exists.
|
|
@@ -180,87 +227,77 @@ Prompt format (applies to both Stage 1 and Stage 1a): ONLY the key-value lines b
|
|
|
180
227
|
```
|
|
181
228
|
Agent(
|
|
182
229
|
subagent_type="logic-coder",
|
|
183
|
-
prompt="harmony_project_dir: HMOS\nplan_file: OUTPUT/logic/plan.md\noutput_path: OUTPUT/logic"
|
|
230
|
+
prompt="harmony_project_dir: HMOS\nplan_file: OUTPUT/logic/plan.md\noutput_path: OUTPUT/logic\nscripts_path: SCRIPTS_PATH"
|
|
184
231
|
)
|
|
185
232
|
```
|
|
186
|
-
2. Copy `OUTPUT/logic/commit-info.md` → `OUTPUT/commit-info.md
|
|
187
|
-
3. `OUTPUT/
|
|
233
|
+
2. Copy `OUTPUT/logic/commit-info.md` → `OUTPUT/commit-info.md`.
|
|
234
|
+
3. Read `OUTPUT/commit-info.md` and use it as the canonical handoff for the
|
|
235
|
+
following steps.
|
|
188
236
|
|
|
189
237
|
### Stage 2 — Compilation and Build
|
|
190
238
|
|
|
191
|
-
1.
|
|
192
|
-
2.
|
|
193
|
-
3.
|
|
194
|
-
4.
|
|
195
|
-
|
|
239
|
+
1. Capture `BUILD_START` (touch a marker) — the package-set mtime gate needs a marker taken before any build output is written.
|
|
240
|
+
2. Invoke `hmos-fix-build-errors <HMOS>`.
|
|
241
|
+
3. Treat the build stage as a compile/fix gate only — do **not** expect build-stage report or commit-info artifacts.
|
|
242
|
+
4. After a successful build, resolve `AUTHORITATIVE_ENTRY` directly from `HMOS/entry/build/default/outputs/default/` (resolve in order: `entry-default-signed.hap` → any `*-signed.hap` → `entry-default-unsigned.hap` → any `entry-*.hap`) and note it in the manifest, recording whether it is signed.
|
|
243
|
+
4.1. **Signing check for Stage 4** — if `AUTHORITATIVE_ENTRY` is **unsigned** and `SKIP_TEST == false`, log a manifest **WARNING**: `Stage 2 produced an unsigned entry HAP — on-device install in Stage 4 requires a signed package; configure signing in DevEco Studio (File → Project Structure → Signing Configs) or pass skip_test=true`. Continue the pipeline; Stage 4 Loop Setup will surface the missing package on its own.
|
|
244
|
+
5. **If the build succeeded**, run **Package-Set Collection** with `BUILD_ROOT = HMOS`, `DEST = OUTPUT/package-set/`, the resolved `AUTHORITATIVE_ENTRY`, and the captured `BUILD_START`. Record the inventory in the manifest. (If the build failed there is no fresh entry to collect; collection's ≥1-`.hap` guard fails and Stage 4 Loop Setup's legacy fallback applies.)
|
|
245
|
+
6. Do not read a build-stage commit-info file; `OUTPUT/commit-info.md` from Stage 1a remains the canonical commit handoff for later review stages.
|
|
196
246
|
|
|
197
|
-
### Stage 3 — Code Review Loop (Review
|
|
247
|
+
### Stage 3 — Code Review Loop (Review-and-Fix → Rebuild)
|
|
198
248
|
|
|
199
|
-
Treat Stage 3 →
|
|
249
|
+
Treat Stage 3 → 3b as a loop that runs up to `MAX_ROUNDS_REVIEW` times. `code-reviewer` performs review and defect fixing in the same pass (no separate `review-fixer` agent).
|
|
200
250
|
|
|
201
251
|
#### Review Loop Setup
|
|
202
252
|
|
|
203
253
|
1. **Resolve the initial commit ID for code review** using the following priority:
|
|
204
|
-
- Read `OUTPUT/commit-info.md` (written by Stage
|
|
205
|
-
- IMPORTANT: Use `commit-info.md` from Stage
|
|
206
|
-
- If neither file exists or both have `commit_id: none`, the code-reviewer agent will review the project holistically without commit-scoped extraction.
|
|
254
|
+
- Read `OUTPUT/commit-info.md` (written by Stage 1a) and use its `commit_id` when available.
|
|
255
|
+
- IMPORTANT: Use `commit-info.md` from Stage 1a. The build stage no longer produces a separate commit-info artifact.
|
|
207
256
|
- Store this as `REVIEW_COMMIT_ID`.
|
|
208
257
|
2. Initialize loop state:
|
|
209
258
|
- `review_round = 1`
|
|
210
259
|
- `review_rounds_executed = 0`
|
|
211
260
|
- `review_stop_reason = none`
|
|
212
|
-
|
|
261
|
+
- `LAST_GOOD_REVIEW_SET = none` — the package-set dir from the **last review round whose 3b rebuild succeeded** (used at finalization; stays `none` if no review round ever rebuilt).
|
|
262
|
+
3. Mark Stage 3 `in_progress` when Round 1 begins. Keep Stage 3 / 3b tasks open until the full loop exits.
|
|
213
263
|
|
|
214
|
-
#### Per-Round Stage 3 /
|
|
264
|
+
#### Per-Round Stage 3 / 3b Execution Order
|
|
215
265
|
|
|
216
|
-
For each `review_round` from `1..MAX_ROUNDS_REVIEW`, set `REVIEW_ROUND_DIR = OUTPUT/review-round-{review_round}` and execute the following
|
|
266
|
+
For each `review_round` from `1..MAX_ROUNDS_REVIEW`, set `REVIEW_ROUND_DIR = OUTPUT/review-round-{review_round}` and execute the following two steps in order:
|
|
217
267
|
|
|
218
|
-
##### Review Round Step A — Stage 3 Code Review
|
|
268
|
+
##### Review Round Step A — Stage 3 Code Review + Fix
|
|
219
269
|
|
|
220
270
|
1. Launch the **code-reviewer** agent.
|
|
221
271
|
2. Input:
|
|
222
272
|
- `harmony_project_dir`: `HMOS`
|
|
223
273
|
- `commit_id`: For Round 1, use `REVIEW_COMMIT_ID`. For Round 2+, review the project holistically (omit `commit_id` or pass `none`) since fixes have modified the codebase beyond the original commit scope.
|
|
224
274
|
- `output_path`: `REVIEW_ROUND_DIR`
|
|
225
|
-
- `
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
- `
|
|
275
|
+
- `scenario_doc_path`: `SPEC` (the requirement spec is the user-scenario design document; it is **not** the self-test `TEST_CASE`)
|
|
276
|
+
- `android_project_dir`: `ANDROID` (enables reference-based fixing for missing pages / APIs / event handlers)
|
|
277
|
+
3. If a valid `commit_id` is available, the agent will automatically run the **ArkAnalysis** extractor via `npx --yes arkanalysis@latest` to extract commit-scoped code context before reviewing. If it fails (e.g. the package is unpublished or unreachable), the agent falls back to direct git-diff analysis. If no `commit_id` is available, the agent reviews the project holistically without commit-scoped extraction.
|
|
278
|
+
4. The agent reviews every user scenario, fixes every FAIL / PARTIAL / cross-cutting defect it finds, and writes `REVIEW_ROUND_DIR/code-review-report.md` (merged review + fix report) plus `REVIEW_ROUND_DIR/code-review-commit-info.md` (git commit id or `none`).
|
|
279
|
+
5. **Extract defect stats**: Read `REVIEW_ROUND_DIR/code-review-report.md`, extract the verdict breakdown (PASS/PARTIAL/FAIL/UNABLE TO VERIFY counts), `Total Defects Found`, `Successfully Fixed`, `Failed to Fix`, `Fix Success Rate`, and Overall Verdict.
|
|
280
|
+
6. Compute loop-control flags:
|
|
281
|
+
- `review_all_passed` = `true` if the overall verdict is `PASS` and there are zero `FAIL` or `PARTIAL` verdicts AND zero cross-cutting defects; else `false`.
|
|
282
|
+
- `review_no_progress` = `true` if `Total Defects Found > 0` AND `Successfully Fixed == 0` (nothing was fixed this round — a next round would repeat); else `false`.
|
|
232
283
|
If the report is missing or malformed, do **not** treat the round as passed.
|
|
233
|
-
7.
|
|
234
|
-
|
|
284
|
+
7. **Early exit on a green round**: if `review_all_passed == true`, set `review_stop_reason = all_passed`, increment `review_rounds_executed`, **skip Step B**, and exit the loop. Do Step B's bookkeeping here before leaving:
|
|
285
|
+
- Append the `3 Loop - Round {review_round}` Defect Summary row from the Stage 3 stats alone (`Defects Found = 0`; fix columns `—`, note `3b skipped — round passed`).
|
|
286
|
+
- Mark Stage 3b `completed` with `Skipped — round {review_round} passed, no fixes needed`, and record `Duration = SKIPPED`.
|
|
287
|
+
8. If `review_no_progress == true`, set `review_stop_reason = no_progress`, still run Stage 3b (to leave the tree buildable), then exit the loop after 3b.
|
|
288
|
+
9. Update the Stage 3 task description with a brief round summary (for example: `Round 1: 8 PASS, 2 PARTIAL, 1 FAIL; fixed=2, failed=1`).
|
|
235
289
|
|
|
236
|
-
##### Review Round Step B — Stage
|
|
237
|
-
|
|
238
|
-
1. Mark Stage 3a `in_progress` when the first Stage 3a round begins.
|
|
239
|
-
2. Launch the **review-fixer** agent.
|
|
240
|
-
3. Input:
|
|
241
|
-
- `review_report_path`: `REVIEW_ROUND_DIR/code-review-report.md`
|
|
242
|
-
- `harmony_project_dir`: `HMOS`
|
|
243
|
-
- `android_project_dir`: `ANDROID`
|
|
244
|
-
- `output_path`: `REVIEW_ROUND_DIR`
|
|
245
|
-
4. The agent verifies each issue from the code review report, fixes confirmed issues, and writes `REVIEW_ROUND_DIR/review-fix-report.md`.
|
|
246
|
-
5. **Extract defect stats**: Read `REVIEW_ROUND_DIR/review-fix-report.md`, extract total issues, confirmed, false positives, successfully fixed, failed to fix, and fix success rate.
|
|
247
|
-
6. Compute `review_no_confirmed_defects`:
|
|
248
|
-
- `true` if the fix report exists AND confirmed issues == 0 (all reported issues are false positives).
|
|
249
|
-
- `false` otherwise.
|
|
250
|
-
7. Update the Stage 3a task description with a brief round summary (for example: `Round 1: confirmed=3, fixed=2, failed=1`).
|
|
251
|
-
|
|
252
|
-
##### Review Round Step C — Stage 3b Rebuild after Review Fix
|
|
290
|
+
##### Review Round Step B — Stage 3b Rebuild after Review Fix
|
|
253
291
|
|
|
254
292
|
1. Mark Stage 3b `in_progress` when the first Stage 3b round begins.
|
|
255
|
-
2.
|
|
256
|
-
3.
|
|
257
|
-
4.
|
|
258
|
-
5.
|
|
259
|
-
6.
|
|
260
|
-
7.
|
|
261
|
-
8.
|
|
262
|
-
|
|
263
|
-
- If `review_no_confirmed_defects == true`, set `review_stop_reason = no_confirmed_defects` and exit the loop. Rationale: all reported issues were judged as false positives by verification, no real defects remain.
|
|
293
|
+
2. Capture `BUILD_START` (touch a marker), then invoke `hmos-fix-build-errors <HMOS>` (the skill detects signed vs unsigned from `build-profile.json5`; the pipeline does not force a mode).
|
|
294
|
+
3. Treat this as a compile/fix gate only — do **not** expect a rebuild report artifact in `REVIEW_ROUND_DIR`.
|
|
295
|
+
4. If the build succeeds, resolve `AUTHORITATIVE_ENTRY` directly from `HMOS/entry/build/default/outputs/default/` (resolve in order: `entry-default-signed.hap` → any `*-signed.hap` → `entry-default-unsigned.hap` → any `entry-*.hap`), note it in the manifest, and **then run Package-Set Collection** with `BUILD_ROOT = HMOS`, `DEST = REVIEW_ROUND_DIR/package-set/`, the resolved `AUTHORITATIVE_ENTRY`, and the captured `BUILD_START`; on success set `LAST_GOOD_REVIEW_SET = REVIEW_ROUND_DIR/package-set/`. **If the 3b build failed, do NOT run collection and keep the previous `LAST_GOOD_REVIEW_SET`** (a failed rebuild leaves stale sibling-module outputs on disk; the mtime gate already prevents harvesting them, and skipping collection avoids re-touching `LAST_GOOD_REVIEW_SET` with an entry-less set).
|
|
296
|
+
5. Append one Defect Summary row for this round using the parsed Stage 3 stats, labeled `3 Loop - Round {review_round}`.
|
|
297
|
+
6. Update the Stage 3b task description with a brief round summary (for example: `Round 1: build success`).
|
|
298
|
+
7. Increment `review_rounds_executed`.
|
|
299
|
+
8. **Loop stop decision** (after 3b completes):
|
|
300
|
+
- If `review_stop_reason` was already set to `no_progress` in Step A, exit the loop.
|
|
264
301
|
- Else if `review_round == MAX_ROUNDS_REVIEW`, set `review_stop_reason = max_rounds_reached` and exit the loop.
|
|
265
302
|
- Else continue to the next round.
|
|
266
303
|
|
|
@@ -272,22 +309,18 @@ After the review loop exits:
|
|
|
272
309
|
2. Add a short review loop summary in the manifest, including:
|
|
273
310
|
- `Configured max rounds: MAX_ROUNDS_REVIEW`
|
|
274
311
|
- `Rounds executed: review_rounds_executed`
|
|
275
|
-
- `Stop reason: review_stop_reason` — one of: `all_passed` (all scenarios PASS in code review), `
|
|
312
|
+
- `Stop reason: review_stop_reason` — one of: `all_passed` (all scenarios PASS in code review), `no_progress` (defects found but none could be fixed this round), `max_rounds_reached` (hit the round limit with real defects remaining)
|
|
276
313
|
- `Final round: review-round-{review_rounds_executed}`
|
|
277
314
|
3. Mirror the final review round outputs back to the root `OUTPUT` directory using the canonical filenames for backward compatibility:
|
|
278
315
|
- `OUTPUT/code-review-report.md`
|
|
279
|
-
- `OUTPUT/review-
|
|
280
|
-
- `OUTPUT/build-fix-report.md` (overwrites Stage 2 report, if 3b ran in the final round)
|
|
316
|
+
- `OUTPUT/code-review-commit-info.md`
|
|
281
317
|
- If the final round's build produced a signed `.hap`, copy it to `OUTPUT` (replaces Stage 2 `.hap` if present).
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
### Stage 3a — Review Fix
|
|
285
|
-
|
|
286
|
-
Stage 3a is executed as **Review Round Step B** inside the Stage 3 loop above. Do not run Stage 3a outside that loop.
|
|
318
|
+
- **Mirror the package set:** if `LAST_GOOD_REVIEW_SET != none` (some review round rebuilt successfully), clear-then-copy `LAST_GOOD_REVIEW_SET` → `OUTPUT/package-set/`. **If `LAST_GOOD_REVIEW_SET == none`, leave `OUTPUT/package-set/` (the Stage-2 set) untouched — never clear it.** No self-copy guard is needed: `LAST_GOOD_REVIEW_SET` is always a `review-round-*/package-set/`, never `OUTPUT/package-set/`.
|
|
319
|
+
4. Mark Stage 3 / 3b `completed` only after the full loop finishes.
|
|
287
320
|
|
|
288
321
|
### Stage 3b — Rebuild after Review Fix
|
|
289
322
|
|
|
290
|
-
Stage 3b is executed as **Review Round Step
|
|
323
|
+
Stage 3b is executed as **Review Round Step B** inside the Stage 3 loop above. Do not run Stage 3b outside that loop.
|
|
291
324
|
|
|
292
325
|
### Stage 4 — Self-Testing Loop (On-Device Verification)
|
|
293
326
|
|
|
@@ -297,8 +330,15 @@ Treat Stage 4 → 4a → 4b as a loop that runs up to `MAX_ROUNDS_TEST` times.
|
|
|
297
330
|
|
|
298
331
|
#### Loop Setup
|
|
299
332
|
|
|
300
|
-
1. **
|
|
301
|
-
|
|
333
|
+
1. **Resolve the initial package set**: The self-tester needs the **complete signed package set** (entry HAP + any in-app HSPs) in one `hdc install -r` transaction (rationale in **Package-Set Collection** above).
|
|
334
|
+
- **Priority 1 — `OUTPUT/package-set/` directory**: If it exists and contains **≥ 1 `.hap`**, set `CURRENT_HAP = OUTPUT/package-set/` (any `.hsp` present comes along; `.hsp` presence is **not** required — a single-module project yields exactly one entry HAP and must still take this branch) (the set mirrored by Stage 2 or, if a review round rebuilt, by the review-loop finalization).
|
|
335
|
+
- **Priority 2 — Comma-separated assembly**: If `OUTPUT/package-set/` does not exist, find the entry HAP and any HSPs separately and assemble a comma-separated `CURRENT_HAP`:
|
|
336
|
+
- Entry HAP: `OUTPUT/entry-default-signed.hap` → first `*-signed.hap` in `OUTPUT/` → search `HMOS/entry/build/default/outputs/default/`.
|
|
337
|
+
- In-app HSPs: search `HMOS/*/build/default/outputs/default/` for `*-signed.hsp` (skip `*ohosTest*` / `*-test-signed*`). If found, copy them into `OUTPUT/hsp/` and include `OUTPUT/hsp/` in the comma-separated list.
|
|
338
|
+
- Example: `CURRENT_HAP = OUTPUT/entry-default-signed.hap,OUTPUT/hsp` (entry HAP file + HSP directory, comma-separated).
|
|
339
|
+
- **Priority 3 — Legacy single file**: If no HSPs are found anywhere (single-module project), set `CURRENT_HAP` to just the entry HAP file path.
|
|
340
|
+
- Log the resolved `CURRENT_HAP` in the manifest. If HSPs were found and included, note: "Package set includes N in-app HSP(s)". If HSPs were found but omitted (legacy fallback), log a **WARNING**: "In-app HSPs exist but were not included in CURRENT_HAP — app may not function on device".
|
|
341
|
+
2. Store the resolved path (a **directory**, a **comma-separated list**, or a single file) as `CURRENT_HAP`.
|
|
302
342
|
3. **`TEST_CASE` existence guard**: If `TEST_CASE` does not exist, mark Stage 4 / 4a / 4b as failed with note "No test case file available" and skip the loop entirely.
|
|
303
343
|
4. Initialize loop state:
|
|
304
344
|
- `round = 1`
|
|
@@ -312,13 +352,14 @@ For each `round` from `1..MAX_ROUNDS_TEST`, set `ROUND_DIR = OUTPUT/round-{round
|
|
|
312
352
|
|
|
313
353
|
##### Round Step A — Stage 4 Self-Testing
|
|
314
354
|
|
|
315
|
-
> ⚠️ **`CURRENT_HAP` must reflect the latest build**: If a previous round's Stage 4b produced a new signed
|
|
355
|
+
> ⚠️ **`CURRENT_HAP` must reflect the latest build**: If a previous round's Stage 4b produced a new signed package set, `CURRENT_HAP` should already point to it (a directory, e.g. `round-{N-1}/package-set/`; or, via the legacy fallback, a single file like `round-{N-1}/entry-default-signed.hap`). Do NOT reuse the original package from Stage 2/3b in subsequent rounds.
|
|
316
356
|
|
|
317
357
|
1. If `CURRENT_HAP` is missing, do **not** launch the test. Record this round as Stage 4 failure with note "No HAP file available — build may have failed in Stage 2/3b or a previous 4b round".
|
|
318
358
|
2. If `CURRENT_HAP` exists, launch the **self-tester**.
|
|
319
359
|
3. Input (round 1):
|
|
320
360
|
- `hap_path`: `CURRENT_HAP`
|
|
321
361
|
- `output_path`: `OUTPUT` (the ROOT — the agent always writes here)
|
|
362
|
+
- `project_dir`: `HMOS` (the HarmonyOS project root containing `AppScope/app.json5` — the self-tester resolves `bundle_name`/`app_name` from it via the resolve-metadata tool)
|
|
322
363
|
- `test_case_path`: `TEST_CASE`
|
|
323
364
|
- `pre_test_case_path`: `PRE_TEST_CASE` (only include this line when the file exists)
|
|
324
365
|
- `setup`: `true`
|
|
@@ -326,24 +367,33 @@ For each `round` from `1..MAX_ROUNDS_TEST`, set `ROUND_DIR = OUTPUT/round-{round
|
|
|
326
367
|
- `hap_path`: `CURRENT_HAP`
|
|
327
368
|
- `output_path`: `OUTPUT` (still the ROOT)
|
|
328
369
|
- `setup`: `false`
|
|
329
|
-
5. The agent verifies device connectivity, invokes
|
|
330
|
-
6. After
|
|
370
|
+
5. The agent verifies device connectivity, invokes the selftest runner to install the HAP and run test cases. **Pre-cases are folded into `OUTPUT/testcases.json` by the agent's S3/S4 step during round 1's `setup: true` invocation; they run first in the same batch — no separate pre-case file or parameter is needed downstream.** The agent writes `OUTPUT/self-test-report.md`, `OUTPUT/task/`, and (round 1 only) `OUTPUT/testcases.json` + `OUTPUT/app-metadata.json` + `OUTPUT/_extracted.json`.
|
|
371
|
+
6. After the agent returns, read `OUTPUT/app-metadata.json` and extract `project_root` → `PROJECT_ROOT`; **Stage 4a passes it as `harmony_project_dir`**. If the file is missing or carries no usable `project_root`, set `PROJECT_ROOT = HMOS` and note the fallback in the manifest. `app-metadata.json` is written once by round 1 and read in place by later rounds — it is never snapshotted into a round directory, so do not look for a round-dir copy.
|
|
331
372
|
7. Snapshot per-round artifacts to `ROUND_DIR` after the agent returns: copy `OUTPUT/self-test-report.md` → `ROUND_DIR/self-test-report.md`, `OUTPUT/task/` → `ROUND_DIR/task/`, and (round 1 only) `OUTPUT/_extracted.json` → `ROUND_DIR/_extracted.json`. Skip any source that is missing.
|
|
332
373
|
8. Read `ROUND_DIR/self-test-report.md` and extract total cases, passed, failed, and pass rate when the report exists.
|
|
333
|
-
9.
|
|
334
|
-
-
|
|
335
|
-
-
|
|
336
|
-
-
|
|
337
|
-
|
|
338
|
-
|
|
374
|
+
9. **Sentinel early exit (environmental failure)**: before treating the round as a normal failure, check for the self-tester's early-exit conditions (per the integration-test skill's sentinel semantics, 2A.1 — device / config / tooling failures, not application defects, so the fixer cannot address them). If any of the following holds, record this round as an **environmental failure** — update the Stage 4 task description with the failure and (when captured) `early_exit_reason`, append the `4 Loop - Round {round}` Defect Summary row with note `environmental failure — 4a/4b skipped`, increment `rounds_executed`, set the matching `stop_reason`, mark Stage 4a and Stage 4b `completed` with `Skipped — environmental failure ({stop_reason})` and `Duration = SKIPPED`, then **skip Step B and Step C** and go straight to Loop Finalization:
|
|
375
|
+
- **No test cases (file-level check)**: `<output-path>/testcases.json` exists and contains 0 cases (the batch launcher returns early without writing `summary.json` when there are 0 cases — nothing to run) → `stop_reason = no_testcases`. (If `testcases.json` does not exist, the agent failed before S4 and is caught by the report-missing or `status: FAIL` branches below.)
|
|
376
|
+
- **Report missing**: `<output-path>/self-test-report.md` does not exist (e.g. T8 failure or a hard error not covered by the sentinel set) → `stop_reason = agent_early_exit`, `early_exit_reason = "no self-test-report.md written — agent failed before producing a report"`.
|
|
377
|
+
- **Report sentinel `status: FAIL`**: grep the report for the first `status:` line and the first `reason:` line; if the first line matches `status: FAIL` (device not connected, `HOMETRANS_MODEL_API_KEY` / `autotest.unified_model.api_key` not configured, AutoTest directory missing, or the batch launcher crashed) → `stop_reason = agent_early_exit`; capture the `reason:` line into the manifest as `early_exit_reason`.
|
|
378
|
+
10. Compute `round_all_passed` only when the report can be parsed clearly and:
|
|
379
|
+
- `总用例数` is known
|
|
380
|
+
- `失败 == 0`
|
|
381
|
+
- `通过 == 总用例数`
|
|
382
|
+
If the report is missing or fields are malformed, do **not** treat the round as passed.
|
|
383
|
+
11. Update the Stage 4 task description with a brief round summary (for example: `Round 1: 3/12 failed`).
|
|
384
|
+
12. **Early exit on a green round**: if `round_all_passed == true`, set `stop_reason = all_passed`, increment `rounds_executed`, **skip Step B and Step C**, and exit the loop. `CURRENT_HAP` already points at the package that just passed on device. Do Steps B/C's bookkeeping here before leaving:
|
|
385
|
+
- Append the `4 Loop - Round {round}` Defect Summary row from the Stage 4 stats alone (`Defects Found = 0`; fix columns `—`, note `4a/4b skipped — round passed`).
|
|
386
|
+
- Mark Stage 4a and Stage 4b `completed` with `Skipped — round {round} passed, no fixes needed`, and record `Duration = SKIPPED` for both.
|
|
339
387
|
|
|
340
388
|
##### Round Step B — Stage 4a Self-Test Fix
|
|
341
389
|
|
|
390
|
+
> Reached only when `round_all_passed == false`.
|
|
391
|
+
|
|
342
392
|
1. Mark Stage 4a `in_progress` when the first Stage 4a round begins.
|
|
343
393
|
2. If `ROUND_DIR/self-test-report.md` exists, launch the **self-test-fixer** agent.
|
|
344
394
|
3. Input:
|
|
345
395
|
- `self_test_report_path`: `ROUND_DIR/self-test-report.md`
|
|
346
|
-
- `harmony_project_dir`: `HMOS`
|
|
396
|
+
- `harmony_project_dir`: `PROJECT_ROOT` (resolved in Round Step A step 6; falls back to `HMOS`)
|
|
347
397
|
- `android_project_dir`: `ANDROID`
|
|
348
398
|
- `output_path`: `ROUND_DIR`
|
|
349
399
|
4. The agent analyzes failed feature points from the self-test report, references Android source for correct behavior, fixes HarmonyOS code, and writes `ROUND_DIR/self-test-fix-report.md`.
|
|
@@ -357,19 +407,15 @@ For each `round` from `1..MAX_ROUNDS_TEST`, set `ROUND_DIR = OUTPUT/round-{round
|
|
|
357
407
|
##### Round Step C — Stage 4b Rebuild after Self-Test Fix
|
|
358
408
|
|
|
359
409
|
1. Mark Stage 4b `in_progress` when the first Stage 4b round begins.
|
|
360
|
-
2.
|
|
361
|
-
3.
|
|
362
|
-
4.
|
|
363
|
-
5.
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
8. Increment `rounds_executed`.
|
|
370
|
-
9. **Loop stop decision** (after 4b completes):
|
|
371
|
-
- If `round_all_passed == true`, set `stop_reason = all_passed` and exit the loop.
|
|
372
|
-
- Else if `round_no_confirmed_defects == true`, set `stop_reason = no_confirmed_defects` and exit the loop. Rationale: all failures were judged as false positives (AutoTest limitations / environment issues) by white-box review, no code was changed, so repeating the test would yield identical results.
|
|
410
|
+
2. Capture `BUILD_START` (touch a marker), then invoke `hmos-fix-build-errors <HMOS>` (the skill detects signed vs unsigned from `build-profile.json5`; the pipeline does not force a mode).
|
|
411
|
+
3. Treat this as a compile/fix gate only — do **not** expect rebuild-stage report or commit-info artifacts in `ROUND_DIR`.
|
|
412
|
+
4. ⚠️ **CRITICAL — Update `CURRENT_HAP` for the next round**: If the build succeeds, resolve `AUTHORITATIVE_ENTRY` directly from `HMOS/entry/build/default/outputs/default/` (resolve in order: `entry-default-signed.hap` → any `*-signed.hap` → `entry-default-unsigned.hap` → any `entry-*.hap`), **run Package-Set Collection** with `BUILD_ROOT = HMOS`, `DEST = ROUND_DIR/package-set/`, that resolved `AUTHORITATIVE_ENTRY`, and the captured `BUILD_START`, and then set `CURRENT_HAP = ROUND_DIR/package-set/` so the next round's Stage 4 self-tester uses the freshly built set. If collection **fails** or yields zero HAPs, **keep the previous `CURRENT_HAP`** (the prior round's full set — fresher than any legacy single-file resolution) and record that this round produced no fresh package set.
|
|
413
|
+
5. Append one Defect Summary row for this round by combining the parsed Stage 4 and Stage 4a results into a single row labeled `4 Loop - Round {round}`.
|
|
414
|
+
6. Update the Stage 4b task description with a brief round summary (for example: `Round 1: build success, hap=...`).
|
|
415
|
+
7. Increment `rounds_executed`.
|
|
416
|
+
8. **Loop stop decision** (after 4b completes):
|
|
417
|
+
- `round_all_passed == true` never reaches here — it exits at Round Step A step 12.
|
|
418
|
+
- If `round_no_confirmed_defects == true`, set `stop_reason = no_confirmed_defects` and exit the loop. Rationale: all failures were judged as false positives (AutoTest limitations / environment issues) by white-box review, no code was changed, so repeating the test would yield identical results.
|
|
373
419
|
- Else if `round == MAX_ROUNDS_TEST`, set `stop_reason = max_rounds_reached` and exit the loop.
|
|
374
420
|
- Else continue to the next round.
|
|
375
421
|
|
|
@@ -381,14 +427,14 @@ After the loop exits:
|
|
|
381
427
|
2. Add a short Stage 4 loop summary in the manifest, including:
|
|
382
428
|
- `Configured max rounds: MAX_ROUNDS_TEST`
|
|
383
429
|
- `Rounds executed: rounds_executed`
|
|
384
|
-
- `Stop reason: stop_reason` — one of: `all_passed` (all tests green), `no_confirmed_defects` (failures exist but all judged as false positives by white-box review), `max_rounds_reached` (hit the round limit with real defects remaining)
|
|
430
|
+
- `Stop reason: stop_reason` — one of: `all_passed` (all tests green), `no_confirmed_defects` (failures exist but all judged as false positives by white-box review), `max_rounds_reached` (hit the round limit with real defects remaining), or an environmental early exit — `agent_early_exit` (sentinel `status: FAIL` report, or no `self-test-report.md` written), `no_testcases` (`testcases.json` contains 0 cases — nothing to run)
|
|
385
431
|
- `Final round: round-{rounds_executed}`
|
|
386
|
-
3. Mirror the final round's `OUTPUT/round-{rounds_executed}/` Fix
|
|
432
|
+
3. Mirror the final round's `OUTPUT/round-{rounds_executed}/` Fix artifacts back to `OUTPUT/` root using the canonical filenames (the test report and `task/` are already at `OUTPUT/` root as the latest copies — they do NOT need mirroring):
|
|
387
433
|
- `OUTPUT/self-test-fix-report.md` ← `OUTPUT/round-{rounds_executed}/self-test-fix-report.md` (if present)
|
|
388
|
-
- `OUTPUT/build-fix-report.md` ← `OUTPUT/round-{rounds_executed}/build-fix-report.md` (if present)
|
|
389
434
|
- `OUTPUT/self-test-fix-commit-info.md` ← `OUTPUT/round-{rounds_executed}/self-test-fix-commit-info.md` (if present)
|
|
390
|
-
-
|
|
391
|
-
|
|
435
|
+
- **Final package set** — branch on the type of `CURRENT_HAP`:
|
|
436
|
+
- **If `CURRENT_HAP` is a directory** (a `package-set/`): mirror `CURRENT_HAP/` → `OUTPUT/package-set/` (clear-then-copy), **but skip entirely when `CURRENT_HAP` already resolves to `OUTPUT/package-set/`** (source == dest — happens when every 4b build failed and `CURRENT_HAP` still holds the Loop-Setup value; a clear-then-copy onto itself would destroy the set). Then, best-effort, copy the single `entry-*.hap` out of the set to `OUTPUT/entry-default-*.hap` for back-compat, naming it by the actual signature status recorded in the manifest — `entry-default-signed.hap` when signed, `entry-default-unsigned.hap` when unsigned (never inferred from the filename); skip if absent.
|
|
437
|
+
- **If `CURRENT_HAP` is a single file** (legacy fallback — no package set was ever produced): copy it to `OUTPUT/entry-default-signed.hap` or `OUTPUT/entry-default-unsigned.hap` according to its actual signature status as recorded in the manifest (never inferred from the filename), skipping when `CURRENT_HAP` is already that destination path. Do not attempt a directory mirror.
|
|
392
438
|
- `OUTPUT/screenshots/` when the final report still references `screenshots/...`
|
|
393
439
|
4. When mirroring Fix/Build files back to `OUTPUT`, treat the final round directory as the source of truth and ensure the mirrored root-level reports still reference files that actually exist at the root level.
|
|
394
440
|
5. Mark Stage 4 / 4a / 4b `completed` only after the full loop finishes.
|
|
@@ -406,13 +452,14 @@ Stage 4b is executed as **Round Step C** inside the Stage 4 loop above. Do not r
|
|
|
406
452
|
## Error Handling
|
|
407
453
|
|
|
408
454
|
- If a stage **fails**, log the error in the manifest and task, then **continue to the next stage** unless the loop logic says to continue to the next round.
|
|
409
|
-
- Stage 3 uses a bounded Stage 3 →
|
|
410
|
-
-
|
|
411
|
-
- Stage 4 uses a bounded Stage 4 → 4a → 4b test loop (up to `MAX_ROUNDS_TEST` rounds). Stage 4a addresses failures found by Stage 4, followed by Stage 4b (Rebuild) to ensure compilation, then the pipeline either continues to the next round or exits the loop based on `all_passed` / `no_confirmed_defects` / `max_rounds_reached`.
|
|
455
|
+
- Stage 3 uses a bounded Stage 3 → 3b review loop (up to `MAX_ROUNDS_REVIEW` rounds). `code-reviewer` reviews and fixes defects in the same pass; Stage 3b (Rebuild) then ensures the fixes still compile. The loop exits when all scenarios pass (`all_passed`), no defect could be fixed this round (`no_progress`), or `MAX_ROUNDS_REVIEW` is reached.
|
|
456
|
+
- Stage 4 uses a bounded Stage 4 → 4a → 4b test loop (up to `MAX_ROUNDS_TEST` rounds). **When a round is not green**, Stage 4a addresses the failures Stage 4 found, followed by Stage 4b (Rebuild) to ensure compilation, then the pipeline either continues to the next round or exits on `no_confirmed_defects` / `max_rounds_reached` — or an environmental sentinel early exit (`agent_early_exit` / `no_testcases`). A **green** round never reaches 4a/4b — it exits earlier with `all_passed` (see below).
|
|
412
457
|
- If Stage 4a determines that all failures are false positives (`confirmed == 0`), the test loop exits after 4b with `stop_reason = no_confirmed_defects` — because no code was changed and repeating the test would yield identical results.
|
|
413
|
-
- If
|
|
458
|
+
- If the root-level `OUTPUT/self-test-report.md` exists but step 7's snapshot to `ROUND_DIR/self-test-report.md` failed (a disk error or other non-sentinel cause; the sentinel case where the root report itself is missing is handled in step 9), do not call Stage 4a with a missing report; record the round accordingly and continue to Stage 4b.
|
|
414
459
|
- If a Stage 4 report is malformed or required fields are missing, do not treat the round as passed; continue until `MAX_ROUNDS_TEST` is reached or a later round clearly passes.
|
|
415
|
-
- If a Stage 4 round
|
|
460
|
+
- If a Stage 4 round exits early on an environmental sentinel (`status: FAIL` report, no `self-test-report.md` written, or `no_testcases`), skip Stage 4a and Stage 4b for that round and go straight to Loop Finalization — no code was changed, so there is nothing to fix or rebuild, and repeating the test would fail identically.
|
|
461
|
+
- A green round never reaches Stage 4b: `round_all_passed == true` exits at **Round Step A step 12** with `stop_reason = all_passed`, skipping Steps B and C. `CURRENT_HAP` keeps pointing at the package set that just passed on device, and Loop Finalization mirrors it back to `OUTPUT/package-set/` (or skips the mirror when `CURRENT_HAP` already *is* that path). There is therefore no "the round passed but its own 4b rebuild failed" case to handle.
|
|
462
|
+
- If a Stage 4b rebuild fails, Round Step C step 4 leaves `CURRENT_HAP` unchanged. Record in the manifest that this round produced no fresh package set — the next round re-installs the previous package with this round's fixes **not** compiled in, so it is expected to reproduce the same failures.
|
|
416
463
|
|
|
417
464
|
---
|
|
418
465
|
|