@harmonyos-arkts/d2h 0.1.14 → 0.1.15

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.14",
4
+ "version": "0.1.15",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "android",
package/agents/d2h.md CHANGED
@@ -15,7 +15,7 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
15
15
 
16
16
  ## 产物边界
17
17
 
18
- - `.migration/spec/` 中的 Facts 是范围索引,不替代 Android 源码阅读。
18
+ - `.migration/spec/` 中的 Facts 是 AppGraph 从 Android 源码确定性提取的结构化事实基线,用于范围发现、实体与交互关联、报告初始化和遗漏检查。Facts 可能包含 unresolved 项或存在抽取遗漏,不能替代对 Android 源码及必要运行行为的阅读核验。
19
19
  - `.migration/utg/page.json` 是页面、到达路径和导航计划的输入,也是页面 Spec 使用的运行路径依据。
20
20
  - `.migration/page-specs/pages.json` 保存 AI 作出的页面范围、顺序、评分和证据决策。
21
21
  - 每个 `.migration/page-specs/page_NNNN_<name>-<id>/` 只包含 `spec.md`。不得生成 `ui-design.md`,也不得复制截图或 `view.xml` 到页面包。
@@ -85,14 +85,14 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
85
85
 
86
86
  ### 五、逐页代码串行开发
87
87
 
88
- 加载 `d2h-page-develop`,以严格串行方式执行页面开发。任意时刻最多只能有一个页面处于开发或修复状态:
88
+ 加载 `d2h-page-develop`,由当前主 Agent 以严格串行方式执行页面开发。任意时刻最多只能有一个页面处于开发或修复状态,页面实现、构建、测试、报告、提交和账本更新不得委派给独立 worker 或其他子 Agent:
89
89
 
90
90
  1. 主 Agent 按 `batch_report.md` 选择顺序最前且未达到 `implemented/passed/passed` 的页面。
91
- 2. 只派发一个独立 page-worker,且该 worker 只负责当前一个页面。worker 必须加载 `d2h-page-develop`,不得领取、预研或修改后续页面。
91
+ 2. 主 Agent 只处理当前一个页面,不得领取、预研或修改后续页面,并负责执行 `d2h-page-develop` 定义的完整单页闭环。
92
92
  3. 进入测试阶段时加载 `d2h-hypium-forge`,生成或更新该页面的 Python Hypium 测试资产,并通过 `droid2hmos` 受管入口执行定向测试。
93
93
  4. 页面实现与测试通过后加载 `maintaining-migration-report`,记录真实实现文件、Android 源码依据和本次受管证据。
94
- 5. worker 完成实现提交并原位更新 `batch_report.md`;主 Agent 独立复核实现、构建、测试、证据、提交和工作区状态。
95
- 6. 当前页面未闭环、仍有页面所属未提交修改或复核失败时,只能继续修复当前页面。当前页面完整闭环并通过主 Agent 复核后,才能按顺序选择并派发下一页。
94
+ 5. 主 Agent 完成当前页面的实现提交,原位更新 `batch_report.md`,并按 Skill 的页面完成清单复核实现、构建、测试、证据、提交和工作区状态。
95
+ 6. 当前页面未闭环、仍有页面所属未提交修改或复核失败时,只能继续修复当前页面。当前页面完整闭环并通过复核后,才能按顺序选择下一页。
96
96
 
97
97
  ### 六、批次回归与最终门禁
98
98
 
@@ -101,20 +101,13 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
101
101
  1. 按 `d2h-page-develop` 的批次回归规则,显式枚举全部 Python Hypium test list,通过受管 runner 执行批次回归。Python runner 不使用 `--all`。
102
102
  2. 需要诊断 UI 自动化、构建或运行故障时加载 `harmonyos-migration-playbook`;失败必须回到对应页面修复,不能降低验收标准。
103
103
  3. 更新并校验迁移报告及 final acceptance。
104
- 4. 按 Migration Kernel 最终门禁执行独立的 ArkTS full-run:
105
-
106
- ```text
107
- droid2hmos test harmony <ANDROID_PROJECT> --runner arkts --all ...
108
- ```
109
-
110
- 5. 执行 `droid2hmos complete <ANDROID_PROJECT>`。只有成功退出后才能宣布迁移完成。
111
- 6. 执行 `droid2hmos report render <ANDROID_PROJECT>` 生成交付报告。
112
- 7. 完整结束或明确中止后加载 `reviewing-migration-process` 生成流程复盘;复盘不是完成条件。
104
+ 4. 完整结束或明确中止后加载 `reviewing-migration-process` 生成流程复盘;复盘不是完成条件。
113
105
 
114
106
  ## 持续执行与人工介入
115
107
 
116
108
  迁移开始后默认连续执行,不得在页面或阶段之间询问“是否继续”。只有以下情况允许暂停:
117
109
 
110
+ - 禁止依据模型自行估算的“剩余 token”“上下文百分比”“本轮剩余容量”等决定停止、收尾、汇报后等待或要求用户开启新会话。此类估算不可信。
118
111
  - 用户主动中断、修改需求或发出新指令。
119
112
  - 真机签名、开发者账号、权限或凭据必须由用户完成,且没有可用替代方案。
120
113
  - 设备、CLI、构建环境或外部服务持续不可用,完成自诊和有限重试后仍确认是外部问题。
@@ -152,6 +145,5 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
152
145
  - Facts 或 UTG 遗漏、但经源码或运行时发现的行为也已实现并验证。
153
146
  - 无法等价的差异已经明确呈现,没有被静默标记为完成。
154
147
  - 每个页面实现都有可恢复提交,用户已有和无关改动未被覆盖。
155
- - ArkTS full-run 和 `droid2hmos complete <ANDROID_PROJECT>` 均成功。
156
148
 
157
149
  完成报告不等于完成迁移;机器门禁成功也不能替代对真实用户可观察结果的 AI 审查。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harmonyos-arkts/d2h",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Install Android-to-HarmonyOS migration agents and skills into OpenCode or DevEco Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -105,7 +105,7 @@ After every page task is complete:
105
105
  2. Run one managed command with all required `--test-list` values on the qualified device, using only refs actually asserted by the batch.
106
106
  3. Require non-zero execution with no failures, errors, or ignored tests.
107
107
  4. Append the managed batch evidence and timestamp to `batch_report.md`, then update and validate the migration report.
108
- 5. A targeted Python batch receipt does not replace the separate ArkTS `--all` receipt required by the Migration Kernel final completion gate.
108
+ 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.
109
109
 
110
110
  ## Final result
111
111
 
@@ -21,7 +21,7 @@ Resolve these paths before writing:
21
21
  - `legacy_tasks_root`: optional `<migration_root>/.migration/tasks`; use existing briefs, core facts, source context, and acceptance files only as read-only evidence from an older flow.
22
22
  - `output_root`: default `<migration_root>/.migration/page-specs`.
23
23
 
24
- Facts and legacy Task artifacts are indexes, not substitutes for Android source. Existing HarmonyOS files and tests are implementation evidence, not proof that a behavior is complete.
24
+ Facts are the deterministic structured evidence baseline extracted from Android source. They support scope discovery, entity and interaction linkage, report initialization, and omission checks, but unresolved items and extraction gaps mean they are not substitutes for reading Android source and, where necessary, observing runtime behavior. Legacy Task artifacts are read-only indexes from the older flow. Existing HarmonyOS files and tests are implementation evidence, not proof that a behavior is complete.
25
25
 
26
26
  ## Output contract
27
27