@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.
Files changed (235) hide show
  1. package/README.md +162 -54
  2. package/agents/code-reviewer.md +321 -65
  3. package/agents/logic-coder.md +113 -88
  4. package/agents/logic-context-builder.md +47 -29
  5. package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
  6. package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
  7. package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
  8. package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
  9. package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
  10. package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
  11. package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
  12. package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
  13. package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
  14. package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
  15. package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
  16. package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
  17. package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
  18. package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
  19. package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
  20. package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
  21. package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
  22. package/agents/scripts/hmos-precheck/index.mjs +17 -0
  23. package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
  24. package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
  25. package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
  26. package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
  27. package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
  28. package/agents/scripts/platform_query.mjs +626 -0
  29. package/agents/scripts/platform_query.test.mjs +422 -0
  30. package/agents/self-test-fixer.md +36 -34
  31. package/agents/self-tester.md +123 -143
  32. package/agents/test-case-generation-generator.md +317 -0
  33. package/agents/test-case-generation-validator.md +231 -0
  34. package/dist/cli/config-store.js +16 -63
  35. package/dist/cli/env-vars.js +1 -3
  36. package/dist/cli/index.js +0 -11
  37. package/dist/cli/init.js +127 -144
  38. package/dist/cli/uninstall.js +76 -110
  39. package/dist/utils/regex.js +8 -0
  40. package/env-requirements.json +55 -54
  41. package/package.json +6 -6
  42. package/resource/convert_pipeline_process.svg +103 -0
  43. package/resource/project_architecture.svg +122 -0
  44. package/resource/title_dark.png +0 -0
  45. package/skills/hmos-batch-ui-align/SKILL.md +345 -41
  46. package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
  47. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  48. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  49. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
  80. package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
  81. package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
  82. package/skills/hmos-convert-pipeline/SKILL.md +168 -121
  83. package/skills/hmos-fix-build-errors/SKILL.md +87 -67
  84. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
  85. package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
  86. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
  87. package/skills/hmos-incremental-ui-align/README.md +53 -36
  88. package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
  89. package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
  90. package/skills/hmos-incremental-ui-align/page_align.md +62 -62
  91. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
  121. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
  122. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  123. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  124. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  125. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
  126. package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
  127. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
  128. package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
  129. package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
  130. package/skills/hmos-integration-test/README.md +61 -70
  131. package/skills/hmos-integration-test/SKILL.md +128 -111
  132. package/skills/hmos-resources-convert/SKILL.md +334 -66
  133. package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
  134. package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
  135. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
  136. package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
  137. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
  138. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
  139. package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
  140. package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
  141. package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
  142. package/skills/hmos-spec-generate/SKILL.md +293 -214
  143. package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
  144. package/skills/hmos-spec-generate/template/REQ.txt +22 -0
  145. package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
  146. package/skills/hmos-test-case-generation/README.md +241 -0
  147. package/skills/hmos-test-case-generation/SKILL.md +324 -0
  148. package/skills/hmos-test-case-generation/references/contract.md +315 -0
  149. package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
  150. package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
  151. package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
  152. package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
  153. package/tools/bfs-crawl/README.md +73 -0
  154. package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
  155. package/tools/test-tools/autotest/config.ts +175 -0
  156. package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
  157. package/tools/test-tools/autotest/docs/README.md +266 -0
  158. package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
  159. package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
  160. package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
  161. package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
  162. package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
  163. package/tools/test-tools/autotest/paths.ts +41 -0
  164. package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
  165. package/tools/test-tools/autotest/runner/logger.ts +45 -0
  166. package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
  167. package/tools/test-tools/autotest/validate.ts +167 -0
  168. package/agents/build-fixer.md +0 -385
  169. package/agents/logic-coder/scripts/platform_context_query.py +0 -568
  170. package/agents/review-fixer.md +0 -405
  171. package/agents/spec-generator.md +0 -541
  172. package/dist/cli/mcp-setup.js +0 -258
  173. package/dist/cli/mcp.js +0 -94
  174. package/dist/context/index.js +0 -694
  175. package/resource/migration_process.svg +0 -94
  176. package/resource/migration_process_transparent.svg +0 -93
  177. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
  178. package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
  179. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
  180. package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
  181. package/skills/hmos-resources-convert/evals/evals.json +0 -171
  182. package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
  183. package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
  184. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
  185. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
  186. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
  187. package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
  188. package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
  189. package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
  190. package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
  191. package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
  192. package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
  193. package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
  194. package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
  195. package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
  196. package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
  197. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
  198. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
  199. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
  200. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
  201. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
  202. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
  203. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
  204. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
  205. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
  206. package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
  207. package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
  208. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
  209. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
  210. package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
  211. package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
  212. package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
  213. package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
  214. package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
  215. package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
  216. package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
  217. package/skills/hmos-resources-convert/tools/apktool.bat +0 -85
  218. package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
  219. package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
  220. package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
  221. package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
  222. package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
  223. package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
  224. package/tools/test-tools/autotest/README.md +0 -238
  225. package/tools/test-tools/autotest/pyproject.toml +0 -26
  226. package/tools/test-tools/autotest/report_tool.py +0 -759
  227. package/tools/test-tools/autotest/self_test_runner.py +0 -895
  228. package/tools/test-tools/autotest/testcases_tool.py +0 -215
  229. package/tools/test-tools/autotest/uv.lock +0 -3156
  230. package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
  231. package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
  232. package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
  233. package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
  234. package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
  235. package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
@@ -0,0 +1,422 @@
1
+ import assert from 'node:assert/strict';
2
+ import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ import test from 'node:test';
6
+
7
+ import { __test__, main } from './platform_query.mjs';
8
+
9
+ async function withTempDir(run) {
10
+ const tempDir = await mkdtemp(path.join(os.tmpdir(), 'platform-query-test-'));
11
+ try {
12
+ return await run(tempDir);
13
+ } finally {
14
+ await rm(tempDir, { recursive: true, force: true });
15
+ }
16
+ }
17
+
18
+ async function writeRequest(tempDir, request) {
19
+ const requestPath = path.join(tempDir, 'request.json');
20
+ await writeFile(requestPath, `${JSON.stringify(request, null, 2)}\n`, 'utf8');
21
+ return requestPath;
22
+ }
23
+
24
+ async function readJson(filePath) {
25
+ return JSON.parse(await readFile(filePath, 'utf8'));
26
+ }
27
+
28
+ async function runMainQuietly(args) {
29
+ const writes = [];
30
+ const originalWrite = process.stdout.write;
31
+ process.stdout.write = ((chunk, encoding, callback) => {
32
+ writes.push(String(chunk));
33
+ if (typeof encoding === 'function') encoding();
34
+ if (typeof callback === 'function') callback();
35
+ return true;
36
+ });
37
+ try {
38
+ const exitCode = await main(args);
39
+ return { exitCode, stdout: writes.join('') };
40
+ } finally {
41
+ process.stdout.write = originalWrite;
42
+ }
43
+ }
44
+
45
+ function mockResponse({ ok = true, status = 200, statusText = 'OK', body = '' }) {
46
+ return {
47
+ ok,
48
+ status,
49
+ statusText,
50
+ async text() {
51
+ return body;
52
+ },
53
+ };
54
+ }
55
+
56
+ test('parseArgs parses required flags and dry-run mode', () => {
57
+ const parsed = __test__.parseArgs([
58
+ '--request',
59
+ '/tmp/request.json',
60
+ '--out-dir',
61
+ '/tmp/out',
62
+ '--api-level',
63
+ '24',
64
+ '--dry-run',
65
+ ]);
66
+ assert.deepEqual(parsed, {
67
+ request: '/tmp/request.json',
68
+ outDir: '/tmp/out',
69
+ apiLevel: 24,
70
+ dryRun: true,
71
+ });
72
+ });
73
+
74
+ test('parseArgs rejects partially numeric API levels', () => {
75
+ assert.throws(
76
+ () => __test__.parseArgs(['--request', 'r', '--out-dir', 'o', '--api-level', '22oops']),
77
+ /--api-level must be an integer/,
78
+ );
79
+ });
80
+
81
+ test('validateRequest normalizes fields and deduplicates query types', () => {
82
+ const request = __test__.validateRequest({
83
+ stage: ' coder ',
84
+ focus_point: ' photo picker ',
85
+ task_excerpt: ' use system picker ',
86
+ project_evidence: ' entry/src/main ',
87
+ platform_surfaces: [' PhotoAccessHelper ', '', 'PhotoAccessHelper'],
88
+ extra_constraints: [' one ', ' ', 'two'],
89
+ query_types: [' api ', 'pattern', 'api'],
90
+ }, 22);
91
+ assert.deepEqual(request, {
92
+ stage: 'coder',
93
+ api_level: 22,
94
+ focus_point: 'photo picker',
95
+ task_excerpt: 'use system picker',
96
+ project_evidence: 'entry/src/main',
97
+ platform_surfaces: ['PhotoAccessHelper', 'PhotoAccessHelper'],
98
+ extra_constraints: ['one', 'two'],
99
+ query_types: ['api', 'pattern'],
100
+ });
101
+ });
102
+
103
+ test('request normalization accepts scalar list fields and common aliases', () => {
104
+ const warnings = [];
105
+ const canonical = __test__.canonicalizeRequest({
106
+ stage: 'planner',
107
+ focus_point: 'ForEach identity',
108
+ task_excerpt: 'verify retained item updates',
109
+ platformSurfaces: 'ForEach',
110
+ extra_contraints: { mutation: 'array replacement', key: 'stable id' },
111
+ }, warnings);
112
+ const request = __test__.validateRequest(canonical, 22, warnings);
113
+
114
+ assert.deepEqual(request.platform_surfaces, ['ForEach']);
115
+ assert.deepEqual(request.extra_constraints, ['{"mutation":"array replacement","key":"stable id"}']);
116
+ assert.deepEqual(warnings, [
117
+ 'platformSurfaces was normalized to platform_surfaces',
118
+ 'extra_contraints was normalized to extra_constraints',
119
+ 'platform_surfaces was normalized to a one-item list',
120
+ 'extra_constraints was normalized to a one-item list',
121
+ ]);
122
+ });
123
+
124
+ test('request normalization repairs common query type shapes but rejects malformed content', () => {
125
+ const scalarWarnings = [];
126
+ const scalar = __test__.validateRequest({
127
+ stage: 'planner',
128
+ focus_point: 'migration path',
129
+ task_excerpt: 'verify replacement',
130
+ query_types: 'migration',
131
+ }, 22, scalarWarnings);
132
+ assert.deepEqual(scalar.query_types, ['migration']);
133
+ assert.deepEqual(scalarWarnings, ['query_types was normalized to a one-item list']);
134
+
135
+ const emptyWarnings = [];
136
+ const empty = __test__.validateRequest({
137
+ stage: 'coder',
138
+ focus_point: 'ForEach update',
139
+ task_excerpt: 'verify rendering',
140
+ query_types: [],
141
+ }, 22, emptyWarnings);
142
+ assert.deepEqual(empty.query_types, []);
143
+ assert.deepEqual(emptyWarnings, []);
144
+
145
+ assert.throws(
146
+ () => __test__.normalizeList([['ForEach']], 'platform_surfaces'),
147
+ /platform_surfaces must contain only strings or objects/,
148
+ );
149
+ assert.throws(
150
+ () => __test__.normalizeList([22], 'platform_surfaces'),
151
+ /platform_surfaces must contain only strings or objects/,
152
+ );
153
+ assert.throws(
154
+ () => __test__.validateRequest({
155
+ stage: 'planner',
156
+ focus_point: { name: 'ForEach' },
157
+ task_excerpt: 'verify rendering',
158
+ }, 22),
159
+ /focus_point must be a non-empty string/,
160
+ );
161
+ assert.throws(
162
+ () => __test__.validateRequest({
163
+ stage: 'planner',
164
+ focus_point: 'ForEach',
165
+ task_excerpt: { mutation: 'replace' },
166
+ }, 22),
167
+ /task_excerpt must be a non-empty string/,
168
+ );
169
+ assert.throws(
170
+ () => __test__.validateRequest({
171
+ stage: 'planner',
172
+ focus_point: 'ForEach',
173
+ task_excerpt: 'verify rendering',
174
+ project_evidence: { file: 'Index.ets' },
175
+ }, 22),
176
+ /project_evidence must be a string/,
177
+ );
178
+ });
179
+
180
+ test('buildQueries uses stage-appropriate slots and query count', () => {
181
+ const queries = __test__.buildQueries({
182
+ stage: 'planner',
183
+ api_level: 22,
184
+ focus_point: 'media picker',
185
+ task_excerpt: 'pick a photo',
186
+ project_evidence: 'none',
187
+ platform_surfaces: ['PhotoAccessHelper'],
188
+ extra_constraints: ['Caller-specific constraint'],
189
+ query_types: ['api', 'pattern'],
190
+ });
191
+ assert.equal(queries.length, 2);
192
+ assert.equal(queries[0].module, 'planner_media_picker');
193
+ assert.match(queries[0].query, /Use these slots when applicable: feasibility, owner_boundary/);
194
+ assert.match(queries[0].query, /Anchor on the named surfaces; do not silently substitute them/);
195
+ assert.equal((queries[0].query.match(/OUTPUT CONTRACT: Total response must be at most 1800 characters and 8 lines/g) ?? []).length, 2);
196
+ assert.match(queries[0].query, /Caller-specific constraint/);
197
+ assert.match(queries[1].query, /Platform surfaces: PhotoAccessHelper\./);
198
+ });
199
+
200
+ test('cleanEvidenceResponse preserves structured, unknown, and unmatched evidence', () => {
201
+ const cleaned = __test__.cleanEvidenceResponse(`
202
+ Summary:
203
+ The user is asking for a platform fact check.
204
+ - exact_api: use ohos.file.photoAccessHelper.createPhotoViewPicker()
205
+ - strange_slot: keep this fact
206
+ Here are details
207
+ - extra:custom: already namespaced
208
+ Source conflict: API level differs between documents
209
+ View this search on DeepWiki: https://deepwiki.com/search/example
210
+ `);
211
+ assert.equal(cleaned.structured, true);
212
+ assert.equal(
213
+ cleaned.cleaned,
214
+ [
215
+ '- exact_api: use ohos.file.photoAccessHelper.createPhotoViewPicker()',
216
+ '- extra:strange_slot: keep this fact',
217
+ '- extra:custom: already namespaced',
218
+ '- extra:unstructured: Source conflict: API level differs between documents',
219
+ ].join('\n'),
220
+ );
221
+
222
+ const truncated = __test__.cleanEvidenceResponse('- exact_api: use picker\n[truncated]');
223
+ assert.equal(truncated.structured, false);
224
+ assert.match(truncated.cleaned, /extra:unstructured: \[truncated\]/);
225
+ });
226
+
227
+ test('truncateResponse keeps only complete evidence lines', () => {
228
+ const first = `- exact_api: ${'x'.repeat(1200)}`;
229
+ const second = `- return_error: ${'y'.repeat(1400)}`;
230
+ const truncated = __test__.truncateResponse(`${first}\n${second}`);
231
+ assert.equal(truncated, `${first}\n[truncated]`);
232
+ });
233
+
234
+ test('parseSseResponse extracts text payload and surfaces provider errors', () => {
235
+ const content = [
236
+ 'data: {"result":{"content":[{"type":"text","text":"- exact_api: use picker"}]}}',
237
+ 'data: {"result":{"content":[{"type":"text","text":"\\n- local_validation: no extra permission"}]}}',
238
+ ].join('\n');
239
+ assert.equal(
240
+ __test__.parseSseResponse(content),
241
+ '- exact_api: use picker\n- local_validation: no extra permission',
242
+ );
243
+ assert.equal(
244
+ __test__.parseSseResponse('data: {"error":"rate limited"}'),
245
+ '[provider_error] rate limited',
246
+ );
247
+ });
248
+
249
+ test('askDeepwikiOnce retries only fetch transport TypeErrors', async () => {
250
+ const originalFetch = global.fetch;
251
+ try {
252
+ global.fetch = async () => { throw new TypeError('fetch failed'); };
253
+ assert.equal((await __test__.askDeepwikiOnce('repo', 'question')).retryable, true);
254
+
255
+ global.fetch = async () => { throw new TypeError('response parsing bug'); };
256
+ assert.equal((await __test__.askDeepwikiOnce('repo', 'question')).retryable, false);
257
+ } finally {
258
+ global.fetch = originalFetch;
259
+ }
260
+ });
261
+
262
+ test('main dry-run writes request, query, result, and trace artifacts', async () => {
263
+ await withTempDir(async (tempDir) => {
264
+ const outDir = path.join(tempDir, 'out');
265
+ const requestPath = await writeRequest(tempDir, {
266
+ stage: 'coder',
267
+ focus_point: 'photo picker',
268
+ task_excerpt: 'verify exact API usage',
269
+ project_evidence: ' ',
270
+ platformSurfaces: 'PhotoAccessHelper',
271
+ extraConstraints: { permission: 'none' },
272
+ });
273
+ const { exitCode, stdout } = await runMainQuietly([
274
+ '--request',
275
+ requestPath,
276
+ '--out-dir',
277
+ outDir,
278
+ '--dry-run',
279
+ ]);
280
+
281
+ assert.equal(exitCode, 0);
282
+ assert.match(stdout, /platform-context-result\.json/);
283
+
284
+ const result = await readJson(path.join(outDir, 'platform-context-result.json'));
285
+ const trace = await readJson(path.join(outDir, 'platform-context-trace.json'));
286
+ const queries = await readJson(path.join(outDir, 'provider', 'provider-queries.json'));
287
+
288
+ assert.equal(result.status, 'dry_run');
289
+ assert.deepEqual(result.platform_surfaces, ['PhotoAccessHelper']);
290
+ assert.equal(result.normalization_warnings, undefined);
291
+ assert.deepEqual(trace.normalization_warnings, [
292
+ 'platformSurfaces was normalized to platform_surfaces',
293
+ 'extraConstraints was normalized to extra_constraints',
294
+ 'project_evidence was normalized to none',
295
+ 'platform_surfaces was normalized to a one-item list',
296
+ 'extra_constraints was normalized to a one-item list',
297
+ ]);
298
+ assert.equal(result.evidence_count, 0);
299
+ assert.equal(result.structured_missing_count, 0);
300
+ assert.equal(trace.status, 'dry_run');
301
+ assert.equal(trace.query_count, 2);
302
+ assert.equal(queries.length, 2);
303
+ assert.match(queries[0].query, /Project evidence: none\./);
304
+ });
305
+ });
306
+
307
+ test('main rejects partially numeric request API levels', async () => {
308
+ await withTempDir(async (tempDir) => {
309
+ const requestPath = await writeRequest(tempDir, {
310
+ stage: 'planner',
311
+ focus_point: 'API gate',
312
+ task_excerpt: 'verify availability',
313
+ api_level: '22oops',
314
+ });
315
+ await assert.rejects(
316
+ () => runMainQuietly(['--request', requestPath, '--out-dir', path.join(tempDir, 'out'), '--dry-run']),
317
+ /api_level must be an integer/,
318
+ );
319
+ });
320
+ });
321
+
322
+ test('main returns partial_ok when at least one provider query succeeds', async () => {
323
+ await withTempDir(async (tempDir) => {
324
+ const outDir = path.join(tempDir, 'out');
325
+ const requestPath = await writeRequest(tempDir, {
326
+ stage: 'coder',
327
+ focus_point: 'photo picker',
328
+ task_excerpt: 'verify exact API usage',
329
+ project_evidence: 'entry/src/main/ets/pages/Index.ets',
330
+ platform_surfaces: ['PhotoAccessHelper'],
331
+ query_types: ['api', 'pattern'],
332
+ });
333
+
334
+ const originalFetch = global.fetch;
335
+ const responses = [
336
+ new TypeError('fetch failed'),
337
+ mockResponse({
338
+ body: 'data: {"result":{"content":[{"type":"text","text":"- exact_api: use PhotoAccessHelper.createPicker()"}]}}\n',
339
+ }),
340
+ mockResponse({
341
+ ok: false,
342
+ status: 503,
343
+ statusText: 'Service Unavailable',
344
+ }),
345
+ mockResponse({
346
+ ok: false,
347
+ status: 503,
348
+ statusText: 'Service Unavailable',
349
+ }),
350
+ ];
351
+ global.fetch = async () => {
352
+ const next = responses.shift();
353
+ assert.ok(next, 'unexpected extra fetch call');
354
+ if (next instanceof Error) throw next;
355
+ return next;
356
+ };
357
+
358
+ try {
359
+ const { exitCode } = await runMainQuietly([
360
+ '--request',
361
+ requestPath,
362
+ '--out-dir',
363
+ outDir,
364
+ ]);
365
+ assert.equal(exitCode, 0);
366
+ const result = await readJson(path.join(outDir, 'platform-context-result.json'));
367
+ const trace = await readJson(path.join(outDir, 'platform-context-trace.json'));
368
+ assert.equal(result.status, 'partial_ok');
369
+ assert.equal(result.verified_evidence_count, 1);
370
+ assert.equal(result.failed_evidence_count, 1);
371
+ assert.equal(result.structured_evidence.some((item) => item.structured), true);
372
+ assert.match(trace.provider_stderr, /provider_error|http_error/);
373
+ assert.equal(responses.length, 0);
374
+ } finally {
375
+ global.fetch = originalFetch;
376
+ }
377
+ });
378
+ });
379
+
380
+ test('main returns provider_failed when all provider queries fail', async () => {
381
+ await withTempDir(async (tempDir) => {
382
+ const outDir = path.join(tempDir, 'out');
383
+ const requestPath = await writeRequest(tempDir, {
384
+ stage: 'planner',
385
+ focus_point: 'media permission',
386
+ task_excerpt: 'check feasibility',
387
+ project_evidence: 'none',
388
+ platform_surfaces: ['PhotoAccessHelper'],
389
+ query_types: ['api'],
390
+ });
391
+
392
+ const originalFetch = global.fetch;
393
+ const responses = Array.from({ length: 3 }, () => mockResponse({
394
+ ok: false,
395
+ status: 429,
396
+ statusText: 'Too Many Requests',
397
+ }));
398
+ global.fetch = async () => {
399
+ const next = responses.shift();
400
+ assert.ok(next, 'unexpected extra fetch call');
401
+ return next;
402
+ };
403
+
404
+ try {
405
+ const { exitCode } = await runMainQuietly([
406
+ '--request',
407
+ requestPath,
408
+ '--out-dir',
409
+ outDir,
410
+ ]);
411
+ assert.equal(exitCode, 1);
412
+ const result = await readJson(path.join(outDir, 'platform-context-result.json'));
413
+ const trace = await readJson(path.join(outDir, 'platform-context-trace.json'));
414
+ assert.equal(result.status, 'provider_failed');
415
+ assert.equal(result.verified_evidence_count, 0);
416
+ assert.equal(result.failed_evidence_count, 1);
417
+ assert.equal(trace.status, 'provider_failed');
418
+ } finally {
419
+ global.fetch = originalFetch;
420
+ }
421
+ });
422
+ });
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: self-test-fixer
3
3
  description: Fixes issues identified by self-testing — reads self-test report, white-box verifies failures in HarmonyOS code, plans and executes fixes in order, produces detailed report
4
- color: cyan
4
+ color: info
5
+ mode: subagent
5
6
  ---
6
7
 
7
8
  # Self-Test Fixer Agent
@@ -108,8 +109,8 @@ For each fix item in the plan:
108
109
  - Use the Android behavior as the specification for the fix
109
110
 
110
111
  2. **Look up HarmonyOS APIs**:
111
- - Use Context7 MCP tool to search for relevant ArkTS / ArkUI API documentation
112
- - Use WebSearch for HarmonyOS developer guides if Context7 doesn't have what you need
112
+ - Prefer `npx --yes devecocli docs search` / `npx --yes devecocli docs read` for relevant ArkTS / ArkUI API documentation.
113
+ - Use WebSearch only if the local docs flow does not provide enough detail.
113
114
  - **Do not guess API signatures** — verify them
114
115
 
115
116
  3. **Implement the fix**:
@@ -124,72 +125,72 @@ For each fix item in the plan:
124
125
 
125
126
  ### 3c. Compile Once After All Fixes
126
127
 
127
- After **all** fix items are complete, launch the **build-fixer** agent **once** to verify compilation:
128
+ After **all** fix items are complete, invoke the `hmos-fix-build-errors` skill **once** to verify compilation:
128
129
 
129
- - Pass `harmony_project_dir` and `output_path` to the build-fixer agent
130
- - If compilation fails, build-fixer will auto-fix compile errors
131
- - Compilation issues do NOT count as effective fix attempts
130
+ - Pass the current HarmonyOS project path into `hmos-fix-build-errors`. The skill itself detects signing mode from `build-profile.json5` — do not pass `--signed` unless the caller has an explicit reason to assert signed output.
131
+ - If compilation fails, let the skill handle the compile-error fix loop — these retries do **not** count as an effective attempt.
132
+ - Compilation issues introduced by the cumulative fixes do NOT count as effective fix attempts.
132
133
 
133
- > **Design rationale**: Compiling once at the end (not per-scenario) saves significant time. Build-fixer handles any compilation errors introduced by the cumulative changes.
134
+ > **Design rationale**: Compiling once at the end (not per-scenario) saves significant time. `hmos-fix-build-errors` handles any compilation errors introduced by the cumulative changes.
135
+
136
+ ### 3d. Retry Logic (Maximum 2 Effective Attempts)
137
+
138
+ An "effective attempt" = code was modified AND compilation succeeded, but code review suggests the fix may be incomplete.
139
+
140
+ - After successful compilation in 3c, review all changes holistically
141
+ - If any fix item appears incomplete or incorrect:
142
+ - This counts as 1 effective attempt for the affected scenario(s)
143
+ - If attempts < 2: revise the fix, then re-invoke `hmos-fix-build-errors` to re-compile
144
+ - If attempts = 2: mark as failed, move on
145
+ - Scenarios that are fixed correctly on the first attempt are marked as success
134
146
 
135
147
  ### 3.5 Git Commit (if fixes were applied)
136
148
 
137
- After Step 3c compilation succeeds, commit the changes if any source files were modified.
149
+ After Step 3d retry logic completes (all fixes and retries are done), commit the changes if any source files were modified.
138
150
 
139
151
  **Condition**: Run this step only when at least one confirmed failure was successfully fixed (i.e., modified source files exist).
140
152
 
141
153
  1. **Check if the project is in a git repository**:
142
154
  ```bash
143
- cd "<project-dir>" && git rev-parse --is-inside-work-tree
155
+ cd "<harmony_project_dir>" && git rev-parse --is-inside-work-tree
144
156
  ```
145
157
 
146
- 2. **If yes, commit all changes**:
158
+ 2. **If yes, stage and commit only the modified files** (never use `git add -A` or `git add .` — that would sweep pipeline artifacts into the app repo):
147
159
  ```bash
148
- cd "<project-dir>"
149
- git add -A
160
+ cd "<harmony_project_dir>"
161
+ # Stage only the files modified during 3b/3d — one explicit git add per path
162
+ git add "<file1>" "<file2>" ...
163
+ git status --short # verify the staged set matches the All Modified Files table
150
164
  git commit -m "fix(test): fix {N} self-test failures
151
165
 
152
166
  Fixed: {N}/{M} failed scenarios
153
167
  "
154
168
  ```
155
- (where N = successfully fixed confirmed failures, M = total confirmed failures)
169
+ (where N = successfully fixed confirmed failures, M = total confirmed failures; the file list comes from the fix records accumulated in 3b step 4 and any 3d retries)
156
170
 
157
171
  3. **Capture the commit ID**:
158
172
  ```bash
159
- cd "<project-dir>" && git rev-parse HEAD
173
+ cd "<harmony_project_dir>" && git rev-parse HEAD
160
174
  ```
161
175
 
162
- 4. **Write commit info** to `<output_path>/self-test-fix-commit-info.md`:
176
+ 4. **Write commit info** to `<output_path>/self-test-fix-commit-info.md` (if `output_path` was not provided, default to cwd):
163
177
  ```
164
178
  commit_id: <commit_id>
165
179
  ```
166
180
 
167
181
  **If no files were modified** (all failures were false positives):
168
- - Write `<output_path>/self-test-fix-commit-info.md` with:
182
+ - Write `<output_path>/self-test-fix-commit-info.md` (or cwd) with:
169
183
  ```
170
184
  commit_id: none
171
185
  ```
172
186
 
173
187
  **If not in a git repository**:
174
188
  - Record issue "Not a git repository — skipped commit" in `self-test-fix-report.md`.
175
- - Write `<output_path>/self-test-fix-commit-info.md` with:
189
+ - Write `<output_path>/self-test-fix-commit-info.md` (or cwd) with:
176
190
  ```
177
191
  commit_id: none
178
192
  ```
179
193
 
180
- **If `output_path` was not provided**, skip writing `self-test-fix-commit-info.md`.
181
-
182
- ### 3d. Retry Logic (Maximum 2 Effective Attempts)
183
-
184
- An "effective attempt" = code was modified AND compilation succeeded, but code review suggests the fix may be incomplete.
185
-
186
- - After successful compilation in 3c, review all changes holistically
187
- - If any fix item appears incomplete or incorrect:
188
- - This counts as 1 effective attempt for the affected scenario(s)
189
- - If attempts < 2: revise the fix, re-compile
190
- - If attempts = 2: mark as failed, move on
191
- - Scenarios that are fixed correctly on the first attempt are marked as success
192
-
193
194
  ---
194
195
 
195
196
  ## Step 4 — Generate Detailed Fix Report
@@ -259,8 +260,8 @@ Write `self-test-fix-report.md` to `output_path`. The report must be comprehensi
259
260
 
260
261
  ## 编译验证
261
262
 
262
- - **编译结果**: 通过 / 失败后由 build-fixer 修复
263
- - **build-fixer 修复的编译问题**: <list if any>
263
+ - **编译结果**: 通过 / 失败后由 `hmos-fix-build-errors` 处理
264
+ - **编译阶段处理的问题**: <list if any>
264
265
 
265
266
  ---
266
267
 
@@ -287,7 +288,8 @@ Write `self-test-fix-report.md` to `output_path`. The report must be comprehensi
287
288
  - **Do not hardcode report format**: Read and understand `self-test-report.md` as-is. Adapt to whatever structure it uses.
288
289
  - **White-box before fixing**: Always verify failures through code analysis before modifying anything. Do not blindly trust test agent results.
289
290
  - **Sequential execution only**: Never launch parallel subagents for code modifications. Fix one item at a time in the planned order.
290
- - **Look up before you guess**: Use Context7 or WebSearch to verify HarmonyOS API usage. Do not assume API signatures.
291
+ - **Look up before you guess**: Prefer `npx --yes devecocli docs search` / `npx --yes devecocli docs read` to verify HarmonyOS API usage. Fall back to WebSearch only when the local docs flow is insufficient. Do not assume API signatures.
292
+ - **Use device logs for runtime evidence**: When a self-test failure needs device-side confirmation, prefer `npx --yes devecocli log --level E` and `npx --yes devecocli log --crash --bundle-name <bundle>` before broader manual diagnosis.
291
293
  - **Read before you edit**: Always read a file before modifying it. Understand the surrounding context.
292
294
  - **Minimal changes**: Only fix the specific feature failure. Do not refactor or "improve" unrelated code.
293
295
  - **Android as specification**: When available, treat the Android implementation as the ground truth for expected behavior.