android2harmony 0.1.6 → 0.1.8

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 (227) hide show
  1. package/agents/api-analyzer.md +113 -0
  2. package/agents/app-action.md +122 -0
  3. package/agents/code-reviewer.md +191 -295
  4. package/agents/coder.md +377 -0
  5. package/agents/self-tester.md +8 -8
  6. package/agents/spec-designer.md +56 -0
  7. package/package.json +1 -1
  8. package/skills/a2h-app-req-gen/SKILL.md +174 -0
  9. package/skills/a2h-app-req-gen/references/spec-handoff.md +99 -0
  10. package/skills/a2h-app-req-gen/references/subagent-render.md +115 -0
  11. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/build.gradle.kts +41 -0
  12. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle/wrapper/gradle-wrapper.jar +0 -0
  13. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle/wrapper/gradle-wrapper.properties +8 -0
  14. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle.properties +3 -0
  15. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradlew +251 -0
  16. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradlew.bat +94 -0
  17. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/settings.gradle.kts +17 -0
  18. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawAnalysisDetector.java +1911 -0
  19. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawIssueRegistry.java +37 -0
  20. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawJson.java +146 -0
  21. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawLocation.java +96 -0
  22. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawRecordWriter.java +227 -0
  23. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry +1 -0
  24. package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/resources/dev/reqgen/analyzer/jvm/raw-record-v1.schema.json +93 -0
  25. package/skills/a2h-app-req-gen/scripts/reqgen/assets/dashboard.html +151 -0
  26. package/skills/a2h-app-req-gen/scripts/reqgen/gradle/reqgen-lint.init.gradle +60 -0
  27. package/skills/a2h-app-req-gen/scripts/reqgen/gradle/reqgen-model.init.gradle +204 -0
  28. package/skills/a2h-app-req-gen/scripts/reqgen/package.json +14 -0
  29. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/backend.js +323 -0
  30. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/cli.js +811 -0
  31. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/gap-audit-link.js +62 -0
  32. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/index.js +66 -0
  33. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/merge.js +605 -0
  34. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/name-trace.js +153 -0
  35. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/orchestrate.js +1324 -0
  36. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/output-parse.js +50 -0
  37. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/overview.js +10 -0
  38. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/pool.js +23 -0
  39. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/post-merge-fix.js +146 -0
  40. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompt-loader.js +51 -0
  41. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompt.js +967 -0
  42. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompts.md +301 -0
  43. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/serve.js +78 -0
  44. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/short-id.js +46 -0
  45. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/snapshot.js +267 -0
  46. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/types.js +1 -0
  47. package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/validate.js +122 -0
  48. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/callback-call-sites.js +62 -0
  49. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/gap-audit/build.js +1291 -0
  50. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/gap-audit/index.js +1 -0
  51. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/area-ownership.js +392 -0
  52. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/build.js +1995 -0
  53. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/callback-flow.js +277 -0
  54. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/component-variants.js +725 -0
  55. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/index.js +15 -0
  56. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/index.js +12 -0
  57. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/policy.js +469 -0
  58. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/traceability.js +468 -0
  59. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/req-model/build.js +1066 -0
  60. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/req-model/index.js +1 -0
  61. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/android-interaction-registry.js +174 -0
  62. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/android.js +1062 -0
  63. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/area-titles.js +678 -0
  64. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/builder.js +350 -0
  65. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose-api-registry.js +395 -0
  66. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose-call-sites.js +2008 -0
  67. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose.js +9059 -0
  68. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/dynamic-repeated-call-sites.js +529 -0
  69. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/index.js +1 -0
  70. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/interaction-effects.js +1149 -0
  71. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/jvm.js +6272 -0
  72. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/normalize.js +33 -0
  73. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/pending-intents.js +565 -0
  74. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/resource-id.js +42 -0
  75. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/route-state-variants.js +781 -0
  76. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/state.js +234 -0
  77. package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/types.js +1 -0
  78. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/extract.js +40 -0
  79. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/index.js +6 -0
  80. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/manifest.js +513 -0
  81. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/resources.js +398 -0
  82. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/types.js +1 -0
  83. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/views.js +447 -0
  84. package/skills/a2h-app-req-gen/scripts/reqgen/src/android/xml-parser.js +175 -0
  85. package/skills/a2h-app-req-gen/scripts/reqgen/src/cli.js +398 -0
  86. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/area-graph.js +1 -0
  87. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/artifact.js +1 -0
  88. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/common.js +16 -0
  89. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/diagnostic.js +10 -0
  90. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/gap-audit.js +14 -0
  91. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/index.js +11 -0
  92. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/name-traceability.js +26 -0
  93. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/raw-fact.js +40 -0
  94. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/req-model.js +1 -0
  95. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/run.js +19 -0
  96. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/semantic-completeness.js +11 -0
  97. package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/source-facts.js +1 -0
  98. package/skills/a2h-app-req-gen/scripts/reqgen/src/core/output-guard.js +41 -0
  99. package/skills/a2h-app-req-gen/scripts/reqgen/src/core/stable-id.js +92 -0
  100. package/skills/a2h-app-req-gen/scripts/reqgen/src/dashboard-cli.js +169 -0
  101. package/skills/a2h-app-req-gen/scripts/reqgen/src/diagnostics.js +104 -0
  102. package/skills/a2h-app-req-gen/scripts/reqgen/src/dump/dump.js +1028 -0
  103. package/skills/a2h-app-req-gen/scripts/reqgen/src/dump/index.js +1 -0
  104. package/skills/a2h-app-req-gen/scripts/reqgen/src/dump-cli.js +251 -0
  105. package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/artifacts.js +49 -0
  106. package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/index.js +18 -0
  107. package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/quality-report.js +125 -0
  108. package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/render.js +353 -0
  109. package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/types.js +2 -0
  110. package/skills/a2h-app-req-gen/scripts/reqgen/src/graph/paths.js +474 -0
  111. package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/index.js +15 -0
  112. package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/protocol.js +408 -0
  113. package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/runner.js +452 -0
  114. package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/index.js +8 -0
  115. package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/output.js +165 -0
  116. package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/run-stage1.js +891 -0
  117. package/skills/a2h-app-req-gen/scripts/reqgen/src/project/discovery.js +299 -0
  118. package/skills/a2h-app-req-gen/scripts/reqgen/src/project/gradle-model.js +358 -0
  119. package/skills/a2h-app-req-gen/scripts/reqgen/src/project/gradle-runner.js +165 -0
  120. package/skills/a2h-app-req-gen/scripts/reqgen/src/project/resource-profile.js +60 -0
  121. package/skills/a2h-app-req-gen/scripts/reqgen/src/project/types.js +1 -0
  122. package/skills/a2h-app-req-gen/scripts/reqgen/src/spec-handoff-cli.js +151 -0
  123. package/skills/a2h-app-req-gen/scripts/reqgen/src/spec-handoff.js +1004 -0
  124. package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-cli.js +109 -0
  125. package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-input.js +419 -0
  126. package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-name-trace-input.js +95 -0
  127. package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/area-graph.js +444 -0
  128. package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/index.js +7 -0
  129. package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/req-model.js +580 -0
  130. package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/req-text.js +195 -0
  131. package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/semantic-area-graph.js +1431 -0
  132. package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/types.js +1 -0
  133. package/skills/a2h-app-req-gen/scripts/reqgen-audit.mjs +298 -0
  134. package/skills/a2h-app-req-gen/scripts/reqgen-selfcheck.mjs +555 -0
  135. package/skills/a2h-code-review/SKILL.md +379 -0
  136. package/skills/{hmos-integration-test → a2h-integration-test}/README.md +6 -6
  137. package/skills/{hmos-integration-test → a2h-integration-test}/SKILL.md +6 -6
  138. package/skills/{hmos-integration-test → a2h-integration-test}/scripts/report-tool.mjs +1 -1
  139. package/skills/a2h-spec-design/SKILL.md +330 -0
  140. package/skills/a2h-spec-design/scripts/inspect_spec_design_inputs.mjs +207 -0
  141. package/skills/a2h-spec-design/scripts/move_spec_technical_reference.mjs +198 -0
  142. package/skills/a2h-spec-design/scripts/validate_spec_design_output.mjs +256 -0
  143. package/skills/a2h-spec-generate/SKILL.md +696 -0
  144. package/skills/a2h-spec-generate/references/trace-template.md +115 -0
  145. package/skills/a2h-spec-generate/scripts/parse_requirements.mjs +537 -0
  146. package/skills/a2h-spec-generate/template/REQ.txt +22 -0
  147. package/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
  148. package/skills/a2h-spec-implement/SKILL.md +548 -0
  149. package/skills/a2h-spec-implement/references/harmony-pitfalls.md +186 -0
  150. package/skills/a2h-spec-implement/references/l1-unit-test.md +185 -0
  151. package/skills/a2h-spec-implement/references/l3-e2e-uitest.md +167 -0
  152. package/skills/a2h-spec-implement/references/test-core.md +132 -0
  153. package/skills/a2h-spec-implement/rules/arkts/arkts-standards.md +184 -0
  154. package/skills/a2h-spec-implement/rules/arkts/conventions/coding-style.md +96 -0
  155. package/skills/a2h-spec-implement/rules/arkts/conventions/security.md +126 -0
  156. package/skills/a2h-spec-implement/rules/arkts/language/arkts-rules.md +650 -0
  157. package/skills/a2h-spec-implement/rules/arkts/language/arkui-structure-rules.md +173 -0
  158. package/skills/a2h-spec-implement/rules/arkts/language/ts-to-arkts-rewrites.md +58 -0
  159. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 -0
  160. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 +2089 -0
  161. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 -0
  162. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 -0
  163. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 -0
  164. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 -0
  165. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@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 -0
  166. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/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 +903 -0
  167. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -0
  168. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/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 -0
  169. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -0
  170. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/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 +355 -0
  171. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1//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 -0
  172. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +216 -0
  173. package/skills/a2h-spec-implement/rules/arkts/official/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 +442 -0
  174. package/skills/a2h-spec-implement/rules/arkts/official/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 +169 -0
  175. package/skills/a2h-spec-implement/rules/arkts/official/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 +763 -0
  176. package/skills/a2h-spec-implement/rules/arkts/official/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 +2088 -0
  177. package/skills/a2h-spec-implement/rules/arkts/official/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 +1258 -0
  178. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Once/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 +175 -0
  179. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Param/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +850 -0
  180. package/skills/a2h-spec-implement/rules/arkts/official/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 +862 -0
  181. package/skills/a2h-spec-implement/rules/arkts/official/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 +110 -0
  182. package/skills/a2h-spec-implement/rules/arkts/official/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 +301 -0
  183. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1411 -0
  184. package/skills/a2h-spec-implement/rules/arkts/official/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 +1392 -0
  185. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/getTarget/346/216/245/345/217/243/357/274/232/350/216/267/345/217/226/347/212/266/346/200/201/347/256/241/347/220/206/346/241/206/346/236/266/344/273/243/347/220/206/345/211/215/347/232/204/345/216/237/345/247/213/345/257/271/350/261/241.md +288 -0
  186. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/makeObserved/346/216/245/345/217/243/357/274/232/345/260/206/351/235/236/350/247/202/345/257/237/346/225/260/346/215/256/345/217/230/344/270/272/345/217/257/350/247/202/345/257/237/346/225/260/346/215/256.md +768 -0
  187. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/222/214V2/346/267/267/347/224/250/346/214/207/345/257/274/357/274/210API version 19/345/217/212/344/271/213/345/220/216/357/274/211.md" +829 -0
  188. package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206/346/246/202/350/277/260.md +184 -0
  189. package/skills/a2h-spec-implement/rules/arkts/ui/component-cookbook.md +431 -0
  190. package/skills/a2h-spec-implement/rules/arkts/ui/state-management.md +152 -0
  191. package/skills/a2h-spec-implement/rules/arkts/ui/ui-quality.md +67 -0
  192. package/skills/a2h-spec-implement/rules/arkts/ui/ui-runtime-diagnosis.md +32 -0
  193. package/skills/a2h-spec-implement/rules/pipeline/build/package-set-collection.md +43 -0
  194. package/skills/a2h-spec-implement/scripts/_lib/common.mjs +97 -0
  195. package/skills/a2h-spec-implement/scripts/_lib/config.mjs +70 -0
  196. package/skills/a2h-spec-implement/scripts/_lib/lessons_cli.mjs +48 -0
  197. package/skills/a2h-spec-implement/scripts/build_lessons.mjs +24 -0
  198. package/skills/a2h-spec-implement/scripts/code_pattern_lessons.mjs +26 -0
  199. package/skills/a2h-spec-implement/scripts/device_ui.mjs +433 -0
  200. package/skills/a2h-spec-implement/scripts/device_ui_core.mjs +895 -0
  201. package/skills/a2h-spec-implement/scripts/ledger/aggregate_run.mjs +207 -0
  202. package/skills/a2h-spec-implement/scripts/manifest/emit_summary_line.mjs +37 -0
  203. package/skills/a2h-spec-implement/scripts/manifest/finalize_run.mjs +115 -0
  204. package/skills/a2h-spec-implement/scripts/manifest/render_final_summary.mjs +78 -0
  205. package/skills/a2h-spec-implement/scripts/manifest/root_mirror.mjs +137 -0
  206. package/skills/a2h-spec-implement/scripts/package.json +12 -0
  207. package/skills/a2h-spec-implement/scripts/state_propagation_check.mjs +676 -0
  208. package/skills/a2h-spec-implement/scripts/test/l2_run.mjs +244 -0
  209. package/skills/a2h-spec-implement/scripts/test/tp_coverage.mjs +231 -0
  210. package/skills/a2h-spec-implement/scripts/ui_memory.mjs +161 -0
  211. package/skills/a2h-spec-implement/scripts/utils/ensure_app.mjs +134 -0
  212. package/skills/a2h-ui-transfer/SKILL.md +20 -9
  213. package/skills/a2h-ui-transfer/scripts/arkts_static_check.js +80 -0
  214. package/skills/hmos-convert-pipeline/SKILL.md +7 -5
  215. package/skills/hmos-incremental-ui-align/README.md +7 -7
  216. package/skills/hmos-incremental-ui-align/SKILL.md +1 -1
  217. package/skills/hmos-incremental-ui-align/page_align.md +1 -1
  218. package/skills/hmos-spec-generate/SKILL.md +2 -2
  219. package/skills/hmos-spec-generate/scripts/parse_requirements.mjs +537 -0
  220. package/skills/hmos-fix-build-errors/SKILL.md +0 -266
  221. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +0 -219
  222. package/skills/hmos-fix-build-errors/references/known-patterns.md +0 -157
  223. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +0 -131
  224. package/skills/hmos-spec-generate/scripts/parse_requirements.ts +0 -515
  225. /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/resolve-metadata-tool.mjs +0 -0
  226. /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/self-test-runner.mjs +0 -0
  227. /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/testcases-tool.mjs +0 -0
@@ -0,0 +1,186 @@
1
+ # HarmonyOS Boundary Decisions
2
+
3
+ Match the requirement's action, state, or failure wording against a heading.
4
+ Load every matching block; one scenario may cross several boundaries.
5
+
6
+ ## Scenario construction contract
7
+
8
+ Reduce the behavior to:
9
+
10
+ ```text
11
+ source/baseline → identity → command → owner write → public readback
12
+ ```
13
+
14
+ At an external boundary, distinguish `payload → success/result → cancel/denial/unavailable → consumer`.
15
+
16
+ Freeze `identity · source · unit/time rule · allowed outcomes · visible state` from the specification.
17
+ Use project source to resolve any fact the specification leaves open.
18
+ The blocks below supply reusable implementation and review decisions, not application-specific values.
19
+
20
+ ## Coder contract — 闭环实现
21
+
22
+ For each delivered scenario, write a compact closure row before coding:
23
+
24
+ ```text
25
+ baseline/input → identity → visible entry → eligibility → command → owner state
26
+ → public sentinel → fresh readback
27
+ ```
28
+
29
+ Freeze the expected transition for normal, boundary, empty, cancel, and reopen/restart paths.
30
+ A row is complete only when every step has a concrete source, owner, and observable result;
31
+ an absent step is an implementation gap, not a reason to weaken the assertion.
32
+
33
+ Keep external evidence separate from implementation decisions. Fixture setup, device availability,
34
+ system UI, and acceptance scoring belong to the orchestrator. Coder consumes their reported state,
35
+ preserves explicit `unavailable` / `error` branches, and records the dependency instead of
36
+ fabricating data or bypassing the path.
37
+
38
+ When a failure returns, classify it before editing: missing entry, action not delivered,
39
+ state not committed, public result not rendered, or readback mismatch. Change the first
40
+ broken edge and leave one falsifier for the next run.
41
+
42
+ ## Identity — 共享/删除/收藏/选择/重排
43
+
44
+ Saving an array index or copying an entity into a child can write stale or wrong data after sorting or removal.
45
+
46
+ Carry the business ID in every command. Keep one owner and writer; children return intent.
47
+ Re-find the entity by ID at commit time.
48
+
49
+ Review by reordering or deleting a neighbor, then performing the original action and rereading the same ID.
50
+
51
+ ## Gesture — 拖拽/滑动/长按/锁定
52
+
53
+ A gesture can reach a container while the intended row stays unchanged.
54
+ A visible handle can exist without a mutation path.
55
+
56
+ Bind the gesture to a stable target and explicit eligibility. Locking or disabling gates both delivery and mutation.
57
+ Commit reorder once in the owner.
58
+
59
+ Review one target before and after the gesture; compare public order and state.
60
+
61
+ ## Commit — 输入/数字/焦点/选区/格式化/保存
62
+
63
+ A command can read an old field or stale selection and update only a visual draft.
64
+
65
+ Separate draft, selection, committed, and saved values.
66
+ Bind a text transform to document ID, revision, and normalized range.
67
+ Share one owner command for keyboard, toolbar, and button submission.
68
+
69
+ Review after changing the selection and after valid, invalid, or boundary input; compare exact public content.
70
+
71
+ ## Surface — 弹窗/Picker/日期/确认/取消/返回
72
+
73
+ Closing before the page owner receives a result loses confirmed data.
74
+ Treating surface disappearance as success turns cancel, denial, and unavailable handlers into false success.
75
+
76
+ Give each result an operation ID. Branch confirm, cancel, denial, and unavailable; commit before close or return.
77
+ Cancel preserves prior owner state; discard is explicit.
78
+
79
+ Review confirm and cancel, reopen the surface, and reread the caller owner.
80
+
81
+ ## Durable — 保存/重启/重开/恢复
82
+
83
+ A default projection or the write-side object can be mistaken for persisted truth.
84
+
85
+ Classify lifetime and schema. Register fields through one storage owner and hydrate before the first truthful consumer.
86
+ Read back from a fresh source; keep independent settings in independent owner fields.
87
+
88
+ Review reset → write → reload or fresh reader → compare durable source and UI.
89
+
90
+ ## Async — 加载/刷新/离开/重入/重试
91
+
92
+ Old work can write a new owner, leave pending stuck, or duplicate an effect after a retry.
93
+
94
+ Give each operation an owner and generation ID. Invalidate or cancel before leave.
95
+ Accept only the current winner, clear pending on every terminal path, and clean up.
96
+
97
+ Review leave/reentry during delayed work, then verify no stale write and that the next operation is accepted.
98
+
99
+ ## Query — 搜索/筛选/排序/空列表
100
+
101
+ Sorting or filtering can mutate the source, use an unstable comparator, or retain rows when the result should be empty.
102
+
103
+ Keep source and query projection separate. Freeze comparator and direction.
104
+ Model empty, zero, and no-data explicitly; cancelling a chooser leaves source unchanged.
105
+
106
+ Review apply, cancel, and repeat; reread source identity and visible order.
107
+
108
+ ## Derived — 统计/日期/数量/单位
109
+
110
+ A plausible value can use the wrong source set, time window, or unit, especially at empty or boundary states.
111
+
112
+ Compute from a named source snapshot with explicit temporal and unit rules.
113
+ Define invalidation and distinguish empty, zero, and no-data before rendering.
114
+
115
+ Review non-empty, empty, boundary-time, and conversion inputs, then reread result.
116
+
117
+ ## Playback — 播放/暂停/跳转/队列/进度/系统输出
118
+
119
+ A callback or moving slider can look active while the track, queue, or system projection is stale.
120
+
121
+ Let one session own media ID, queue, position, and play state. A new track or session invalidates old callbacks.
122
+ Treat OS output as a separate consumer.
123
+
124
+ Review switch, seek, and repeat; compare current ID and position for each consumer.
125
+
126
+ ## Source — Feed/文件/网络/系统处理器
127
+
128
+ An unavailable source can be mistaken for empty business data or silently replaced with fabricated data.
129
+
130
+ Keep unavailable, empty, and business error distinct.
131
+ Resolve the source boundary before building the consumer projection.
132
+
133
+ Review the unavailable branch first, then inspect the named consumer state.
134
+
135
+ ## Visual — 主题/深色/纯黑/颜色/资源
136
+
137
+ A stored preference can change while the rendered surface or semantic tree remains unchanged.
138
+
139
+ Make semantic theme/resource state drive each relevant projection. Keep independent options independent.
140
+
141
+ Review each mode by comparing the intended surface or semantic tree, not storage.
142
+
143
+ ## Platform — 导入/声明/签名/回调
144
+
145
+ An Android-shaped import or guessed callback may compile in the wrong context or outlive its owner.
146
+
147
+ Resolve the local SDK declaration or an existing project call.
148
+ Confirm type, result shape, and owner/lifecycle contract before choosing the API.
149
+
150
+ Review with the smallest compile or runtime probe that can falsify the assumption.
151
+
152
+ ## Outcome — 控件/标签/状态/结果/完成
153
+
154
+ A handler, callback, log, or closed surface proves transport only.
155
+ The named result may still be absent from the consumer.
156
+
157
+ Render the required semantic control or state from the authoritative owner and connect it to the committed result.
158
+
159
+ Review by locating the result before the action and rereading it afterward.
160
+
161
+ ## Delivery self-check
162
+
163
+ Before returning, check only the blocks matched by the scenario:
164
+
165
+ - [ ] Identity/Gesture: commands carry a stable business ID.
166
+ The owner rereads the same entity and public order after the action.
167
+ - [ ] Commit/Surface: draft, selection, commit, and save are distinct.
168
+ Every confirm/cancel/denial/unavailable path has an explicit result before close.
169
+ - [ ] Durable/Async: hydration precedes the first truthful consumer.
170
+ Fresh readback and generation invalidation prevent default or stale writes.
171
+ - [ ] Query/Derived/Playback/Source: source, projection, time/unit, and media ID are explicit.
172
+ Unavailable/empty/error branches are explicit and independently reread.
173
+ - [ ] Visual/Platform/Outcome: the required surface/semantic state is driven by the authoritative result.
174
+ Imports, signatures, callbacks, and lifecycle are confirmed from the local SDK or project code.
175
+ - [ ] Evidence: static/build checks are not reported as runtime or device proof.
176
+ An unchecked runtime edge is recorded as `runtime_debt` with one falsifier.
177
+ - [ ] Coder closure: every delivered scenario has a baseline, stable identity, owner command,
178
+ committed state, public sentinel, and fresh readback; normal and negative paths are explicit.
179
+ - [ ] Scope: fixture/device/acceptance failures are recorded as external dependencies;
180
+ no business code or assertion is changed to hide them.
181
+
182
+ ## Evidence boundary
183
+
184
+ Static or build evidence does not prove consumer readback.
185
+ Persistence, async, system-surface, visual, and device claims require the matching capable oracle.
186
+ Otherwise keep the edge `unknown` or `runtime_debt` with one falsifier.
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: l1-unit-test
3
+ description: "Operational contract for the L1 unit-test layer. Covers derivation from the acceptance test set, authoring rules (path, suite prefix, level constant, registration, imports, APIs), the single-shot `aa test` invocation, failure handling for the development self-test and delivery-time gates, and the result records produced."
4
+ ---
5
+
6
+ # L1 — Logic Unit Tests (Instrument JsUnit)
7
+
8
+ ## 1. Contract
9
+
10
+ L1 is the fast, deterministic gate for UI-independent logic. It runs after build and the lint gate, and before any e2e execution.
11
+
12
+ HarmonyOS host-only tests have no automatable CLI path, so L1 uses instrument JsUnit under `src/ohosTest`. Because `aa test` has about five seconds of fixed startup overhead, all L1 suites for one delivery unit run in one invocation.
13
+
14
+ - **`coder`**: authors, builds and runs L1 within the development self-test (step3).
15
+ - **Round orchestrator**: decides what derives to L1 and stops the round when L1 remains red.
16
+
17
+ ---
18
+
19
+ ## 2. Derivation
20
+
21
+ The test-case generator produces only the e2e acceptance set. L1 is derived from that set during the code phase.
22
+
23
+ - **What derives to L1**: deterministic, UI-independent logic behind a TP — computations, formatting, state transitions, filtering, ordering, deduplication and boundary rules in service/model classes.
24
+ - **What stays e2e**: the TP itself and its user-visible UI behaviour.
25
+ - **Boundary duty**: every computational L1 target gets at least one nominal and one relevant boundary test, such as zero duration, empty list, duplicate input, or first/last item.
26
+ - **What never derives**: rendered UI, navigation, UI interaction, visual assertions or real device-service state.
27
+ - **No duplicate assertions**: do not restate an e2e assertion as L1 unless it isolates a distinct logic contract.
28
+
29
+ ### 2.1 L1 → E2E dependency via plan.md
30
+
31
+ The L1 → E2E dependency is declared inline in `OUTPUT/logic/plan.md` on each case as a `unit_dep` field (the unit suite whose failure should block the E2E case). This keeps the contract in the same place as the case definition rather than scattered across a separate per-round artifact.
32
+
33
+ | Case | `unit_dep` |
34
+ |------|------------|
35
+ | `scenario_1_1` | `L1_ProgressRatio` |
36
+ | `scenario_1_2` | `L1_ProgressRatio` |
37
+ | every case in `media_sorter` feature | `L1_MediaSorter` (feature-wide) |
38
+
39
+ When a case's `unit_dep` is unset, no L1 → E2E block applies. Step ⑤ § 6 reads `unit_dep` from `plan.md` to write the derived `class=fixture, failing_point=L2-BLOCK:<suite>` line; the prefix `L2-BLOCK` is preserved as the canonical slug for both L1 and E2E layers.
40
+
41
+ ---
42
+
43
+ ## 3. Authoring
44
+
45
+ - **Path**: `entry/src/ohosTest/ets/test/<feature>/L1_<unit>.test.ets`
46
+ - **Suite**: `L1_<unit>`
47
+ - **Level**: `it(name, Level.LEVEL1, …)`
48
+ - **Registration**: add the suite to `List.test.ets` per `test-core.md` § Suite packaging.
49
+ - **Imports**: import production code directly from `../../../main/ets/…`.
50
+ - **Test API**: plain JsUnit only — `describe`, `it`, `expect`.
51
+ - **No UI APIs**: no `Driver`, `ON`, selectors, gestures or UI assertions. Those belong in `E2E_*`.
52
+ - **Specification-derived assertions**: expected values come from the specification, not from the implementation being tested.
53
+ - **Fixture isolation**: Test fixtures shall be provisioned through the designated initialization entry point using a test-scoped storage instance rather than by writing to production-named identifiers, and the provisioned instance shall be destroyed in `afterAll`.
54
+
55
+ ### 3.1 Suite and Test Identifiers
56
+
57
+ ```typescript
58
+ describe('L1_ProgressRatio', () => {
59
+ it('nominal_1/2', Level.LEVEL1, () => { ... });
60
+ it('nominal_1/4', Level.LEVEL1, () => { ... });
61
+ it('boundary_duration_zero', Level.LEVEL1, () => { ... });
62
+ it('boundary_duration_negative', Level.LEVEL1, () => { ... });
63
+ it('clamp_above_one', Level.LEVEL1, () => { ... });
64
+ });
65
+ ```
66
+
67
+ | Token | Rule | Example |
68
+ |-------|------|---------|
69
+ | Suite prefix | `L1_` (literal) | `L1_ProgressRatio` |
70
+ | Unit name | PascalCase, semantic | `ProgressRatio`, `MediaSorter` |
71
+ | Test name | snake_case, scenario-shaped | `nominal_1/2`, `boundary_empty_list` |
72
+ | Level constant | `Level.LEVEL1` (canonical value) | — |
73
+
74
+ ### 3.2 Forbidden APIs
75
+
76
+ | API | Reason |
77
+ |-----|--------|
78
+ | `Driver`, `ON`, `text(...)`, `id(...)` | UI-layer API; belongs to E2E |
79
+ | `hdc shell ...`, `aa test ...` | Cross-device boundary; orchestrator concern |
80
+ | `systemCapability.*` direct calls | Platform channel; not under unit-test jurisdiction |
81
+ | Sleeps, timers, `setTimeout` (unless boundary-of-interest) | Determinism violation |
82
+
83
+ ---
84
+
85
+ ## 4. Gate
86
+
87
+ Run L1 after build and the lint gate are green, before the unit's e2e, on the exclusively bound device.
88
+
89
+ ```bash
90
+ hdc -t <device> shell 'pidof uitest && kill -9 $(pidof uitest) || true'
91
+
92
+ hdc -t <device> shell aa test -b <bundle> -m entry_test \
93
+ -s unittest OpenHarmonyTestRunner \
94
+ -s class <L1 suites, comma-joined> \
95
+ -s breakOnError true \
96
+ -s timeout 15000 \
97
+ > <round-dev-dir>/l1/l1-report.log 2>&1
98
+ ```
99
+
100
+ - **Single sweep**: comma-join all L1 suites for the delivery unit into one `aa test` run.
101
+ - **Exclusive channel**: clear any residual `uitest` process before execution.
102
+ - **Pinned output**: write stdout and stderr to `<round-dev-dir>/l1/l1-report.log`.
103
+
104
+ ---
105
+
106
+ ## 5. Failure Handling
107
+
108
+ - **Any L1 red**: fix immediately within the development self-test budget, rebuild the test HAP and rerun.
109
+ - **Still red at delivery**:
110
+ - record all failing `suite#it` assertions as a gap;
111
+ - skip the unit's e2e (Round Step ⑤ marks the affected E2E cases as `source=uitest, verdict=BLOCKED, class=fixture, failing_point=L2-BLOCK:<suite>`);
112
+ - carry the unresolved failure into the next round as `prior-attempts`;
113
+ - **append a `source=unit, verdict=FAIL, class=code` line per affected (scenario, suite) pair to the convergence ledger.** This is the round's record of the unit-layer failure and feeds `no_progress` detection and the run's defect counts. It is **not** an E2E acceptance verdict; the E2E verdict is the BLOCKED fixture line appended at Step ⑤.
114
+
115
+ `prior-attempts` should include the failed test, expected and actual values, attempted fixes, relevant source/test/log paths, suspected cause and recommended next action.
116
+
117
+ This contract is the authoritative reconciliation between `l1-unit-test.md` and `SKILL.md` Round Step ③ — both files MUST agree on it. The convergence ledger (not the E2E acceptance ledger) is the source of truth for unit-layer failures.
118
+
119
+ ---
120
+
121
+ ## 6. Result Records
122
+
123
+ ### 6.1 Round Notes
124
+
125
+ Record L1 gate status in the round notes under the code section. Use the canonical tokens `<suite>#<it>` and `<assertion_name>` (matches `SKILL.md` Round Step ③):
126
+
127
+ ```text
128
+ L1: PASS <passed>/<executed>
129
+ ```
130
+
131
+ or:
132
+
133
+ ```text
134
+ L1: FAIL <passed>/<executed> planned=<n> | <suite>#<it>:<assertion_name>
135
+ ```
136
+
137
+ - `<passed>` — number of (scenario, suite) pairs that pass.
138
+ - `<executed>` — number of (scenario, suite) pairs actually executed.
139
+ - `<n>` — total number of L1 suites the slice planned to run (planned but not necessarily executed; a SKIPPED round still counts `<n>`).
140
+
141
+ For multi-failure aggregation, see § 6.2.
142
+
143
+ ### 6.2 Multi-Failure Aggregation
144
+
145
+ When a single (scenario, suite) pair produces multiple assertion failures, the round notes still show only one `<suite>#<it>:<assertion_name>` slug — the first failure in execution order. The ledger follows the same rule (`SKILL.md` Round Step ③ § 3). Subsequent failures in the same pair are not appended as separate ledger lines; they are recorded in the gap log (§ 6.3) for traceability.
146
+
147
+ For counting only:
148
+
149
+ - A suite with three executed (scenario, suite) pairs and one failure contributes `<passed>=2`, `<executed>=3`.
150
+ - `planned=<n>` reflects the slice's planned L1 suites, not the executed count; a SKIPPED round uses `planned=<n>` and omits the `| <suite>#<it>:...` suffix.
151
+
152
+ ### 6.3 Gap Record
153
+
154
+ Unresolved L1 failures at delivery are recorded as a gap entry:
155
+
156
+ ```json
157
+ {
158
+ "type": "gap",
159
+ "suite": "L1_<unit>",
160
+ "test": "<it_name>",
161
+ "expected": "<expected_value>",
162
+ "actual": "<actual_value>",
163
+ "attempted_fixes": ["..."]
164
+ }
165
+ ```
166
+
167
+ ### 6.4 Result Boundary
168
+
169
+ The result boundary separates the unit-layer signal from the acceptance signal:
170
+
171
+ ```text
172
+ L1 round notes / gap → unit-layer signal (this file)
173
+ L1 convergence ledger → unit-layer signal (SKILL.md, source=unit)
174
+ E2E ledger (Step ⑤/⑥) → acceptance verdict
175
+ ```
176
+
177
+ L1 green does not by itself create an acceptance `PASS`. L1 red does not create an acceptance `FAIL`; it prevents the e2e case from running and routes the scenario to Step ⑦ for code-layer repair.
178
+
179
+ ---
180
+
181
+ ## 7. Cross-References
182
+
183
+ - Skill entry point: [`../SKILL.md`](../SKILL.md)
184
+ - E2E layer: [`l3-e2e-uitest.md`](./l3-e2e-uitest.md)
185
+ - Shared contract: [`test-core.md`](./test-core.md)
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: l3-e2e-uitest
3
+ description: "Contract for the E2E device-side end-to-end UITest layer. Covers transcription of each TP into an `E2E_*` instrument suite, authoring rules, the development self-test run, the acceptance run, failure handling, and the pinned host command for the single-shot execution."
4
+ ---
5
+
6
+ # E2E — Device-side Suites
7
+
8
+ ## 1. Contract
9
+
10
+ E2E is the single executable carrier for device-side end-to-end acceptance cases.
11
+
12
+ Each TP in the delivery unit is transcribed into an `E2E_*` instrument suite. The same suite is:
13
+
14
+ - self-run by `coder` before delivery (step5);
15
+ - acceptance-run by the round's test orchestrator to produce the case verdict.
16
+
17
+ The suite is authored once. Development self-test and acceptance are separate executions of the same carrier.
18
+
19
+ ---
20
+
21
+ ## 2. Transcription
22
+
23
+ - **Source**: transcribe directly from the TP in `test_case.md`.
24
+ - **Coverage**: preserve the TP's preconditions, actions and user-visible assertions.
25
+ - **Selectors**: take selectors from grounded UI records; never invent them.
26
+ - **Independence from L1**: L1 may cover underlying logic, but E2E must still verify the complete UI-visible behaviour.
27
+ - **Preconditions**: each suite establishes its own preconditions through `beforeAll` or `beforeEach`.
28
+ - **Check before establish**: fixture hooks use a check-and-establish pair rather than assuming state.
29
+ - **Untranscribable establish**: treat an establishable precondition that cannot be encoded as a suite defect, not as a case property.
30
+
31
+ ---
32
+
33
+ ## 3. Authoring
34
+
35
+ - **Path**: `entry/src/ohosTest/ets/test/<feature>/E2E_<feature>_<caseId>.test.ets`
36
+ - **Suite**: `E2E_<feature>_<caseId>`
37
+ - **Registration**: `List.test.ets` (per `test-core.md` § Suite packaging).
38
+ - **API**: Hypium plus the approved device UI-test APIs.
39
+ - **Packaging**: share the feature's test HAP with its L1 suites.
40
+ - **Fixtures**: follow `test-core.md` § Fixture isolation.
41
+ - **Level**: `it(name, Level.LEVEL2, …)`.
42
+
43
+ ### 3.1 Suite and Test Identifiers
44
+
45
+ Sanitize `-` → `_`: a feature `playbar-progress` and case `1-2` form the suite `E2E_playbar_progress_1_2`.
46
+
47
+ ```typescript
48
+ describe('E2E_SortByDateFlow', () => {
49
+ it('opens_sort_dialog', Level.LEVEL2, async () => { ... });
50
+ it('applies_date_descending', Level.LEVEL2, async () => { ... });
51
+ });
52
+ ```
53
+
54
+ | Token | Rule | Example |
55
+ |-------|------|---------|
56
+ | Suite prefix | `E2E_` (literal) | `E2E_playbar_progress_1_2` |
57
+ | Feature | snake_case, spec-derived | `playbar_progress` |
58
+ | Case identifier | stable per test case | `1_2`, `4_1`, `5_1` |
59
+ | Level constant | `Level.LEVEL2` (canonical value) | — |
60
+
61
+ ---
62
+
63
+ ## 4. Development Self-Test
64
+
65
+ `coder` runs every E2E suite it authored or changed; no sampling.
66
+
67
+ Use the pinned `scripts/test/l2_run.mjs` command from this document. The runner resets the fixture before the batch, runs the selected suites and stores evidence under:
68
+
69
+ ```text
70
+ <output-dir>/dev/e2e/<case-id>/
71
+ ```
72
+
73
+ Green means every coded device assertion passed.
74
+
75
+ A self-test run:
76
+
77
+ - does not produce an acceptance verdict;
78
+ - does not update the ledger;
79
+ - only establishes that the delivery unit is ready for acceptance.
80
+
81
+ ---
82
+
83
+ ## 5. Acceptance Run
84
+
85
+ The round's test orchestrator executes the delivered E2E suites under the acceptance workflow.
86
+
87
+ Only this run may:
88
+
89
+ - assign the TP verdict;
90
+ - write the acceptance report;
91
+ - append or update the ledger.
92
+
93
+ The result boundary is:
94
+
95
+ ```text
96
+ E2E development self-test → delivery readiness
97
+ E2E acceptance run → TP verdict and ledger
98
+ ```
99
+
100
+ ---
101
+
102
+ ## 6. Failure Handling
103
+
104
+ - **Self-test red**: `coder` fixes and reruns within its budget.
105
+ - **Still red at delivery**: record the failing case and assertion as a gap; the round orchestrator carries it into the next round as `prior-attempts`.
106
+ - **Acceptance red**: preserve the verdict and evidence; repair routing belongs to the round orchestrator.
107
+ - **L1 → E2E dependency block**: when an L1 suite fails at Round Step ③, the affected E2E cases are skipped and a derived `source=uitest, verdict=BLOCKED, class=fixture, failing_point=L2-BLOCK:<suite>` line is appended per the `unit_dep` field on `OUTPUT/logic/plan.md` (see `l1-unit-test.md` § 2.1 and `SKILL.md` Round Step ⑤ § 6).
108
+
109
+ ### 6.1 Failure-Class Taxonomy
110
+
111
+ Failures from E2E route to the repair loop following the cheapest-first policy:
112
+
113
+ | Failure Class | Repair Path | Cost |
114
+ |---------------|-------------|------|
115
+ | `selector_drift` | Inline edit of the offending `E2E_*.test.ets`; rebuild; rerun | Low |
116
+ | `fixture` | Resolve the blocking prerequisite scenario; rerun affected subset | Medium |
117
+ | `code` | Repair agent — white-box verification and code repair | High |
118
+ | `environment` | Resolve environment deficiency (excluded from quality-rate denominator) | — |
119
+
120
+ The `class` field on the convergence ledger is what drives this routing. `source=uitest` is the carrier; `class` is the discriminator. PASS lines carry `failing_point=""` so their `failing_point|root_cause` signature is `|` and never matches a non-PASS signature for `no_progress`.
121
+
122
+ ---
123
+
124
+ ## 7. Pinned Commands
125
+
126
+ ### 7.1 Test HAP Build
127
+
128
+ Per `test-core.md` § Device channel & install.
129
+
130
+ ### 7.2 Installation
131
+
132
+ Per `test-core.md` § Device channel & installation.
133
+
134
+ ### 7.3 E2E Self-Run
135
+
136
+ ```bash
137
+ # Execute suite(s) — ONE pinned invocation: fixture reset (force-stop + bm clean -d,
138
+ # built into the script) → per case aa test (restart pairs via @pair) +
139
+ # observation pull + obs assembly.
140
+ # Raise --timeout for establish-bearing suites (an instrumented SAF picker
141
+ # interaction ≈30s, measured).
142
+ node <plugin-path>/scripts/test/l2_run.mjs --device <device> --bundle <bundle> \
143
+ --out-dir <round-dev-dir>/e2e --cases <suite[,suite…][@pair]> --timeout 300000
144
+
145
+ # --cases takes FULL suite names (E2E_<feature>_<caseId>) — no derivation in the script:
146
+ # one identifier keys the aa test class, the per-suite output dir, and the obs filenames.
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 8. Process-Restart-Crossing Cases
152
+
153
+ A case whose actions cross an app restart is transcribed as **two suites** (`<suite>_pre` / `<suite>_post`) with the restart between them as a pinned host step:
154
+
155
+ ```bash
156
+ hdc -t <device> shell aa force-stop <bundle>
157
+ ```
158
+
159
+ then run the `_post` suite (its `startAbility` is the relaunch). Both suites append to the same `obs_<suite>.json` (filesDir survives a force-stop), so `_post` can assert against `_pre`'s recorded values; `scripts/test/l2_run.mjs` assembles one result from both `aa-test.log`s (`<suite>@pair`).
160
+
161
+ ---
162
+
163
+ ## 9. Cross-References
164
+
165
+ - Skill entry point: [`../SKILL.md`](../SKILL.md)
166
+ - L1 layer: [`l1-unit-test.md`](./l1-unit-test.md)
167
+ - Shared contract: [`test-core.md`](./test-core.md)
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: test-core
3
+ description: "Shared contract for the L1 unit-test and E2E device-side instrument suites. Covers suite packaging (path, prefix), suite registration via `List.test.ets`, the device channel and install procedure, and the fixture-isolation invariants that apply to every suite riding the `ohosTest` instrument HAP."
4
+ ---
5
+
6
+ # Test Core — Shared Contract for Instrument Suites
7
+
8
+ Shared infrastructure for L1 logic suites and E2E device-side suites lives here. Layer documents reference this file and do not restate it.
9
+
10
+ Pinned host commands use POSIX shell syntax: `(cd … && …)`, `$(…)`, and single-quote discipline. On Windows, run them through Git Bash or another POSIX shell, never PowerShell or `cmd`.
11
+
12
+ ---
13
+
14
+ ## 1. Suite Packaging
15
+
16
+ - All suites for one feature live under `entry/src/ohosTest/ets/test/<feature>/`.
17
+ - L1 suites use `L1_*`; e2e suites use `E2E_*`.
18
+ - Feature-local fixture and setup helpers live in the same feature directory.
19
+ - Register every suite in `List.test.ets`, with imports grouped by feature.
20
+ - Suite names are globally unique. Directories do not namespace Hypium registration or `aa test -s class`.
21
+ - One `ohosTest` sourceset produces one test HAP for all L1 and E2E suites.
22
+
23
+ ### 1.1 Suite Registration Mechanism
24
+
25
+ ```typescript
26
+ // entry/src/ohosTest/ets/test/List.test.ets
27
+ import './<feature>/L1_ProgressRatio.test.ets';
28
+ import './<feature>/L1_MediaSorter.test.ets';
29
+ import './<feature>/E2E_playbar_progress_1_2.test.ets';
30
+ import './<feature>/E2E_sort_by_date.test.ets';
31
+ // ... additional suite imports
32
+ ```
33
+
34
+ Each `*.test.ets` is imported **once**; the runtime registry is built by the JsUnit harness. Imports are listed in topological order (L1 suites before E2E suites that depend on their units).
35
+
36
+ ---
37
+
38
+ ## 2. Device Channel and Installation
39
+
40
+ Install only changed artifacts:
41
+
42
+ ```bash
43
+ # App HAP changed
44
+ (cd <package-set-dir> && hdc -t <device> install -r <app.hap>)
45
+
46
+ # L2/L3 suites changed
47
+ (cd <ohosTest-out-dir> && hdc -t <device> install -r <entry-ohosTest-signed.hap | entry-ohosTest-unsigned.hap>)
48
+ ```
49
+
50
+ App and test HAPs must come from the same project version.
51
+ The test HAP follows the project's signing mode, exactly like the app HAP: a project configured for signing emits `entry-ohosTest-signed.hap`, one with empty `app.signingConfigs` emits `entry-ohosTest-unsigned.hap`. Install whichever the build actually produced — never assume the filename. A device that refuses an unsigned package is an environment result (`class=environment`), not a code defect.
52
+
53
+ For downgrade error `9568263`, uninstall before reinstalling:
54
+
55
+ ```bash
56
+ hdc -t <device> shell bm uninstall -n <bundle>
57
+ ```
58
+
59
+ Do not reinstall the app HAP when only test suites changed. App reinstall may drop persisted URI grants.
60
+
61
+ The device `uitest`/AAMS channel is exclusive. Before every `aa test`-based run:
62
+
63
+ ```bash
64
+ hdc -t <device> shell 'pidof uitest && kill -9 $(pidof uitest) || true'
65
+ ```
66
+
67
+ Use single quotes so command substitution runs on the device, not the host.
68
+
69
+ ---
70
+
71
+ ## 3. Fixture Isolation
72
+
73
+ Applies to all L1 and E2E suites.
74
+
75
+ - Never seed user-visible persistent data through production-named RDB stores, `Preferences`, `PersistentStorage`, or indexed files.
76
+ - Establish preconditions through the application UI by default.
77
+ - Programmatic seeding is allowed only through an initialization seam into a test-scoped store.
78
+ - Bind the production singleton to the test store before the application ability launches.
79
+ - Delete the test store in `afterAll`.
80
+ - `bm clean` is runner preparation, not fixture cleanup; it may revoke external application bindings.
81
+ - A minimal configurable store-name seam is allowed in production code. Test-only business behaviour is not.
82
+
83
+ ### 3.1 L1-Specific
84
+
85
+ - No production-named storage writes; test fixtures write only to test-scoped storage via the initialisation seam.
86
+ - The `afterAll` hook of each suite must delete its test-scoped storage; no suite leaves persistent state visible to subsequent suites.
87
+
88
+ ### 3.2 E2E-Specific
89
+
90
+ - Each suite establishes its own preconditions through `beforeAll` or `beforeEach` (check-before-establish).
91
+ - The pinned runner (`scripts/test/l2_run.mjs`) force-stops and `bm clean -d`s the bundle before every batch; green is earned only from an empty fixture.
92
+
93
+ ---
94
+
95
+ ## 4. Reporting
96
+
97
+ | Layer | Output Path |
98
+ |:-----:|-------------|
99
+ | L1 | `<round-dev-dir>/l1/l1-report.log` |
100
+ | E2E | `<round-dev-dir>/e2e/e2e-report.log` |
101
+
102
+ The convergence ledger (`convergence.jsonl`) records one line per (round, case, source) tuple. The `source` field uses the canonical values defined in `SKILL.md` Round Step ⑧:
103
+
104
+ | `source` | Layer | Cost |
105
+ |:--------:|:-----:|------|
106
+ | `unit` | L1 Unit Tests | fixed ~5 s |
107
+ | `uitest` | E2E UITest | ~18 s / scenario |
108
+ | `integration` | Step ⑥ AutoTest | highest |
109
+ | `review` | Step ④ Code Review | mid |
110
+ | `fixer` | Step ⑦ Repair | — |
111
+
112
+ ### 4.1 Ledger Constraint
113
+
114
+ The convergence ledger is one unified log; layer rows are not segregated. The constraint is on **what counts as the acceptance verdict**, not on whether a line is written:
115
+
116
+ | Layer State | Ledger Row? | Counts as acceptance verdict? |
117
+ |-------------|:-----------:|:-----------------------------:|
118
+ | L1 green | Yes (`source=unit, verdict=PASS, failing_point=""`) | No (precondition) |
119
+ | L1 red | Yes (`source=unit, verdict=FAIL, class=code`) | No (routes to Step ⑦) |
120
+ | E2E green | Yes (`source=uitest, verdict=PASS, class=code`) | Yes |
121
+ | E2E red | Yes (`source=uitest, verdict=FAIL, class=code`) | Yes |
122
+ | E2E blocked by L1 | Yes (`source=uitest, verdict=BLOCKED, class=fixture, failing_point=L2-BLOCK:<suite>`) | Yes (fixture) |
123
+
124
+ PASS lines carry `failing_point=""` (empty string, never omitted) so the schema is uniform and the `no_progress` signature `failing_point|root_cause` collapses to `|` for PASS — a value that never matches a non-PASS signature. See `SKILL.md` Defect Tracking § Ledger line schema for the canonical schema and `l1-unit-test.md` § 6.4 for the result-boundary narrative.
125
+
126
+ ---
127
+
128
+ ## 5. Cross-References
129
+
130
+ - Skill entry point: [`../SKILL.md`](../SKILL.md)
131
+ - L1 contract: [`l1-unit-test.md`](./l1-unit-test.md)
132
+ - E2E contract: [`l3-e2e-uitest.md`](./l3-e2e-uitest.md)