@harmonyos-arkts/d2h 0.1.19 → 0.1.20

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "android-to-hmos-migration",
3
3
  "description": "基于确定性 facts、迁移报告与端到端验证的 Android 到 HarmonyOS 迁移插件",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "android",
package/agents/d2h.md CHANGED
@@ -92,7 +92,7 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
92
92
 
93
93
  1. 主 Agent 按 `batch_report.md` 选择顺序最前且未达到 `implemented/passed/passed` 的页面。
94
94
  2. 只派发一个独立 page-worker,且该 worker 只负责当前一个页面。worker 必须加载 `d2h-page-develop`,不得领取、预研或修改后续页面。
95
- 3. 进入测试阶段时加载 `d2h-hypium-forge`,生成或更新该页面的 Python Hypium 测试资产。先确认本次构建的 HAP 已安装到目标设备,再按该 Skill 执行当前页面及受影响功能的定向测试,保留实际结果、日志和必要截图。主 Agent 核对执行用例及其断言是否覆盖 Spec 功能项,不能仅凭进程退出码或汇总文案判定通过。
95
+ 3. 进入测试阶段时加载 `d2h-hypium-forge`,生成或更新该页面的 Python Hypium 测试资产。先确认本次构建的 HAP 已安装到目标设备,再按该 Skill 执行当前页面的定向测试(仅本页面的 `pageNNNN_*` 用例,不回归其他页面),保留实际结果、日志和必要截图。主 Agent 核对执行用例及其断言是否覆盖 Spec 功能项,不能仅凭进程退出码或汇总文案判定通过。
96
96
  4. 页面实现与测试通过后,在 `batch_report.md` 当前页面明细中记录真实实现文件、Android 源码依据、本次构建与 Forge 测试的实际结果及证据路径,以及差异或阻塞。未产出或未保存的结果、日志如实记录为缺失,不得填写假定存在的路径或据此标记通过。
97
97
  5. 主 Agent 完成当前页面的实现提交,原位更新 `batch_report.md`,并按 Skill 的页面完成清单复核实现、构建、测试、证据、提交和工作区状态。
98
98
  6. 前页面未闭环、仍有页面所属未提交修改或复核失败时,只能继续修复当前页面。当前页面完整闭环并通过主 Agent 复核后,才能按顺序选择并派发下一页。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harmonyos-arkts/d2h",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Install Android-to-HarmonyOS migration agents and skills into OpenCode or DevEco Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,7 +26,7 @@ Implement and verify one ordered page task at a time. The parent agent selects a
26
26
  5. Wait for the worker to complete the selected page. If it is incomplete or fails review, send the same page back for repair; do not select another page.
27
27
  6. Independently verify the resulting implementation, current managed build/test evidence, migration report, commits, batch ledger, and Git status.
28
28
  7. Only after the selected task is genuinely `implemented/passed/passed` may the parent select the next task.
29
- 8. After all tasks are complete, explicitly enumerate every Python Hypium test list and run one managed batch regression. Append the batch evidence to `batch_report.md` and the migration report.
29
+ 8. Only when the user explicitly requests it, enumerate every Python Hypium test list and run one managed batch regression. Append the batch evidence to `batch_report.md` and the migration report.
30
30
 
31
31
  Use this worker prompt contract:
32
32
 
@@ -66,7 +66,7 @@ If independent page-worker execution is unavailable, return that the required mo
66
66
  - Implement all page-scoped UI, navigation, overlays, state transitions, persistence/data effects, error paths, resources, and required shared integration.
67
67
  - Use the Android source and observable behavior for functional truth. Use HarmonyOS-native architecture and components for the target implementation.
68
68
  - Give tested interactive elements stable, unique semantic locators. Do not add controls solely to make testing easier.
69
- - Load the applicable domain Skill for identity, i18n, drawable conversion, icon sizing, or third-party substitution when the page touches that domain. Before implementing platform capabilities or uncertain HarmonyOS APIs (`@kit.*` Kit imports or `@ohos.*` modules), and when build or test failures point to API signatures or behavior, load `d2h-cloud-knowledge`: check `.migration/knowledge/kb_cache.json` first, query only on cache miss, and record conclusions with doc `title`/`uri` back into the cache, the page spec evidence, and the migration report.
69
+ - Load the applicable domain Skill for identity, i18n, drawable conversion, icon sizing, or third-party substitution when the page touches that domain.
70
70
  - Keep shared changes limited to capabilities this page actually needs and record downstream consumers.
71
71
  - Do not leave stubs, fixed success values, swallowed errors, unreachable pages, placeholder controls, or TODO implementations.
72
72
 
@@ -81,12 +81,12 @@ If independent page-worker execution is unavailable, return that the required mo
81
81
 
82
82
  - Load `d2h-hypium-forge`. Add or update executable Python Hypium tests for every `F-xxx`, with paired `.py` and `.json` test-list assets and stable semantic locators.
83
83
  - Cover navigation or overlay lifecycle, state changes, data effects, and error behavior required by the Spec. Assertions must prove the declared result, not merely that a page or button exists.
84
- - Run the affected lists through the managed entry point:
84
+ - Run only the current page's test lists (the `pageNNNN_*` lists owned by this task) through the managed entry point. Do not append regression lists from other pages.
85
85
 
86
86
  ```text
87
87
  droid2hmos test harmony <ANDROID_PROJECT> \
88
88
  --runner python --hypium-project <HARMONY_PROJECT>/.hypium_forge \
89
- --test-list <AFFECTED_LIST> --target <DEVICE> \
89
+ --test-list <THIS_PAGE_LIST> --target <DEVICE> \
90
90
  --ref <ACTUALLY_ASSERTED_REF>...
91
91
  ```
92
92
 
@@ -120,13 +120,7 @@ Review failure returns the same task for repair. The worker never selects or sta
120
120
 
121
121
  ## Batch regression
122
122
 
123
- After every page task is complete:
124
-
125
- 1. Enumerate every current Python Hypium test list explicitly; the Python runner does not use `--all`.
126
- 2. Run one managed command with all required `--test-list` values on the qualified device, using only refs actually asserted by the batch.
127
- 3. Require non-zero execution with no failures, errors, or ignored tests.
128
- 4. Append the managed batch evidence and timestamp to `batch_report.md`, then update and validate the migration report.
129
- 5. Treat this managed Python batch as the primary application-wide regression for the page-spec workflow. Run ArkTS `--all` only as supplemental coverage when the project maintains relevant ArkTS ohosTest assets; it is not a fixed completion gate for this workflow.
123
+ Run the batch regression only when the user explicitly requests it. During ordinary page development, run only the current page's test lists (see Step 4).
130
124
 
131
125
  ## Worker result
132
126
  Return the task ID and page, final states, implementation and test files, managed build command/HAP/evidence, managed test command/evidence, implementation and ledger commit IDs, unrelated Git changes left untouched, and any genuine blocker or unresolved item.