@harmonyos-arkts/d2h 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +15 -13
- package/.claude-plugin/plugin.json +13 -7
- package/AGENTS.md +5 -5
- package/README.md +212 -212
- package/agents/android-to-hmos-00-orchestrator.md +318 -318
- package/agents/d2h.md +157 -157
- package/dist/bin/install-opencode.js +30 -30
- package/docs/environment-check.md +86 -86
- package/install-opencode.sh +160 -160
- package/opencode/agents.json +16 -16
- package/opencode/vscode-d2h-package.json +7 -7
- package/opencode/vscode-d2h-plugin.mjs +29 -29
- package/package.json +54 -54
- package/schemas/android-source-manifest.schema.json +25 -25
- package/schemas/checkpoint-provenance.schema.json +67 -67
- package/schemas/final-acceptance.schema.json +29 -29
- package/schemas/managed-evidence-index.schema.json +15 -15
- package/schemas/managed-evidence.schema.json +114 -114
- package/schemas/migration-config.schema.json +51 -51
- package/schemas/migration-report-index.schema.json +39 -39
- package/schemas/migration-report-item.schema.json +51 -51
- package/schemas/migration-report-summary.schema.json +25 -25
- package/schemas/migration-status.schema.json +202 -202
- package/schemas/preflight.schema.json +60 -60
- package/schemas/source-order-audit.schema.json +16 -16
- package/schemas/source-provenance-event.schema.json +19 -19
- package/schemas/spec-app-shard.schema.json +45 -45
- package/schemas/spec-fact-corrections-shard.schema.json +13 -13
- package/schemas/spec-features-shard.schema.json +43 -43
- package/schemas/spec-index.schema.json +26 -26
- package/schemas/spec-interactions-shard.schema.json +40 -40
- package/schemas/spec-page.schema.json +98 -98
- package/schemas/spec-pages-index.schema.json +1 -1
- package/schemas/spec-unresolved-shard.schema.json +1 -1
- package/schemas/task-envelope.schema.json +109 -109
- package/schemas/task-plan.schema.json +341 -341
- package/scripts/check-environment.mjs +320 -320
- package/skills/android2hmos_resources_convert/SKILL.md +180 -180
- package/skills/android2hmos_resources_convert/references/image-conversion-rules.md +230 -230
- package/skills/android2hmos_resources_convert/references/svg-fix-patterns.md +175 -175
- package/skills/android2hmos_resources_convert/references/xml-drawable-to-svg-rules.md +513 -513
- package/skills/arkts-app-identity/SKILL.md +238 -238
- package/skills/arkts-i18n/SKILL.md +496 -496
- package/skills/arkts-i18n/evals/evals.json +84 -84
- package/skills/arkts-i18n/references/code-examples.md +302 -302
- package/skills/arkts-i18n/references/common-pitfalls.md +391 -391
- package/skills/arkts-i18n/references/dynamic-language-switch.md +604 -604
- package/skills/arkts-i18n/references/hardcoded-string-scanner.md +348 -348
- package/skills/arkts-i18n/references/language-codes.md +104 -104
- package/skills/arkts-i18n/references/resource-file-structure.md +775 -775
- package/skills/arkts-i18n/references/static-vs-dynamic.md +242 -242
- package/skills/arkts-i18n/references/v1-compat.md +244 -244
- package/skills/arkts-i18n/scripts/audit_i18n_completeness.sh +174 -174
- package/skills/arkts-icon-sizing/SKILL.md +211 -211
- package/skills/arkts-icon-sizing/scripts/icon_audit.py +131 -131
- package/skills/arkts-icon-sizing/scripts/icon_autofix.py +88 -88
- package/skills/arkts-icon-sizing/scripts/icon_dims.py +179 -179
- package/skills/arkts-icon-sizing/scripts/icon_fix.py +119 -119
- package/skills/arkts-mvvm-architecture/SKILL.md +613 -613
- package/skills/d2h-hypium-forge/SKILL.md +309 -309
- package/skills/d2h-hypium-forge/references/functional-spec-template.md +140 -140
- package/skills/d2h-hypium-forge/references/official-api.md +135 -135
- package/skills/d2h-hypium-forge/references/pitfalls.md +98 -98
- package/skills/d2h-hypium-forge/references/testability-template.md +71 -71
- package/skills/d2h-hypium-forge/scripts/_common_template.py +659 -659
- package/skills/d2h-hypium-forge/scripts/analyze_results.py +165 -165
- package/skills/d2h-hypium-forge/scripts/assert_audit.py +107 -107
- package/skills/d2h-hypium-forge/scripts/collect_runtime_pages.py +169 -169
- package/skills/d2h-hypium-forge/scripts/forge_report.py +325 -325
- package/skills/d2h-hypium-forge/scripts/inject_resource_ids.py +114 -114
- package/skills/d2h-hypium-forge/scripts/lint_asserts.py +80 -80
- package/skills/d2h-hypium-forge/scripts/lint_locate.py +60 -60
- package/skills/d2h-hypium-forge/scripts/merge_appgraph.py +249 -249
- package/skills/d2h-hypium-forge/scripts/precondition.py +140 -140
- package/skills/d2h-hypium-forge/scripts/preinject_ids.py +232 -232
- package/skills/d2h-hypium-forge/scripts/probe.py +197 -197
- package/skills/d2h-hypium-forge/scripts/run_direct.py +823 -823
- package/skills/d2h-hypium-forge/scripts/run_parallel.py +121 -121
- package/skills/d2h-hypium-forge/scripts/scan_features.py +255 -255
- package/skills/d2h-hypium-forge/scripts/upgrade_asserts.py +66 -66
- package/skills/d2h-hypium-forge/scripts/validate_scenarios.py +84 -84
- package/skills/d2h-page-develop/SKILL.md +112 -112
- package/skills/d2h-page-develop/agents/openai.yaml +7 -7
- package/skills/d2h-page-spec-generate/SKILL.md +206 -206
- package/skills/d2h-page-spec-generate/scripts/build_batch_report.py +227 -227
- package/skills/d2h-utg-ai-generate/SKILL.md +128 -128
- package/skills/d2h-utg-ai-generate/references/click-paths-schema.json +76 -76
- package/skills/d2h-utg-ai-generate/references/extraction-guide.md +34 -34
- package/skills/d2h-utg-ai-generate/references/facts-contract.md +96 -96
- package/skills/d2h-utg-ai-generate/references/page-schema.json +61 -61
- package/skills/d2h-utg-ai-generate/references/utg-schema.json +89 -89
- package/skills/d2h-utg-ai-generate/scripts/build_page_json.py +314 -314
- package/skills/d2h-utg-ai-generate/scripts/build_utg.py +123 -123
- package/skills/d2h-utg-ai-generate/scripts/capture_from_page_json.ts +280 -280
- package/skills/d2h-utg-ai-generate/scripts/utg_common.py +524 -524
- package/skills/d2h-utg-ai-generate/scripts/utg_html.py +489 -489
- package/skills/d2h-utg-ai-generate/scripts/validate_utg.py +69 -69
- package/skills/d2h-utg-ai-generate/scripts/vendor/D3-LICENSE +13 -13
- package/skills/d2h-utg-ai-generate/scripts/vendor/d3-7.9.0.min.js +2 -2
- package/skills/d2h-utg-ai-generate/tests/test_pipeline.py +369 -369
- package/skills/d2h-utg-static-generate/SKILL.md +73 -73
- package/skills/d2h-utg-static-generate/references/discoveries.md +38 -38
- package/skills/d2h-utg-static-generate/scripts/generate.py +499 -499
- package/skills/d2h-utg-static-generate/tests/test_static.py +335 -335
- package/skills/d2h-utg-static-generate/tests/verify-offline-html.py +60 -60
- package/skills/d2h-utg-static-generate/tests/verify-produced-fixture.py +131 -131
- package/skills/harmonyos-migration-playbook/SKILL.md +83 -83
- package/skills/harmonyos-migration-playbook/agents/openai.yaml +7 -7
- package/skills/harmonyos-migration-playbook/references/arkts-compile.md +24 -24
- package/skills/harmonyos-migration-playbook/references/harmony-runtime.md +53 -53
- package/skills/harmonyos-migration-playbook/references/lesson-lifecycle.md +45 -45
- package/skills/harmonyos-migration-playbook/references/protocol-e2e.md +23 -23
- package/skills/harmonyos-migration-playbook/references/ui-automation.md +53 -53
- package/skills/harmonyos-migration-playbook/references/windows-environment.md +38 -38
- package/skills/maintaining-migration-report/SKILL.md +144 -144
- package/skills/maintaining-migration-report/references/final-acceptance.md +48 -48
- package/skills/maintaining-migration-report/references/source-provenance.md +66 -66
- package/skills/managing-d2h-toolchain/SKILL.md +24 -24
- package/skills/managing-d2h-toolchain/environment-requirements.json +16 -16
- package/skills/managing-d2h-toolchain/scripts/manage-toolchain.mjs +98 -98
- package/skills/managing-d2h-toolchain/toolchain.json +16 -16
- package/skills/native-library-substitution/SKILL.md +384 -384
- package/skills/native-library-substitution/references/native-library-substitution.json +56905 -56905
- package/skills/native-library-substitution/references/native-library-substitution.md +163 -163
- package/skills/preparing-migration-workspace/SKILL.md +131 -131
- package/skills/reviewing-migration-process/SKILL.md +62 -62
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""validate_scenarios.py — 场景库质量门禁(下游唯一基础的准入校验)。
|
|
3
|
-
|
|
4
|
-
校验规则(不通过进 scenarios_blocker.md,禁止进入用例生成):
|
|
5
|
-
1. 必备字段:id / name / desc / converted / test_intent
|
|
6
|
-
2. 可观察业务效果:desc 须含效果关键词(新增/删除/…),纯导航词(进入/打开/跳转XX页)
|
|
7
|
-
且无效果词 = 拦截
|
|
8
|
-
3. 入口可定位:page_path 或前置路径字段存在(深层链路须写明)
|
|
9
|
-
4. converted=false 必须带 reason(未迁移/能力缺失/暂不测试)
|
|
10
|
-
5. 行为预期依据:source_ref / spec_ref 至少其一(默认值/联动从源码或规格推导)
|
|
11
|
-
|
|
12
|
-
用法: python3 validate_scenarios.py scenarios.json [--out scenarios_blocker.md]
|
|
13
|
-
退出码:0=全过(或仅警告);1=存在 blocker。
|
|
14
|
-
"""
|
|
15
|
-
import argparse
|
|
16
|
-
import json
|
|
17
|
-
import re
|
|
18
|
-
import sys
|
|
19
|
-
|
|
20
|
-
REQUIRED = ['id', 'name', 'desc', 'converted', 'test_intent']
|
|
21
|
-
EFFECT_WORDS = ['新增', '删除', '修改', '保存', '收藏', '取消', '成功', '失败', '提示',
|
|
22
|
-
'计数', '状态', '切换', '变为', '出现', '消失', '显示', '回显', '+1', '变更为']
|
|
23
|
-
NAV_ONLY = re.compile(r'^(进入|打开|跳转|前往|查看)[^,。]{1,12}(页|面|界面)$')
|
|
24
|
-
INTENTS = ('资源渲染', '功能交互', '配置生效', '导航流转', '状态机', '数据输入')
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def check(sc):
|
|
28
|
-
bid = sc.get('id', '?')
|
|
29
|
-
errs, warns = [], []
|
|
30
|
-
for f in REQUIRED:
|
|
31
|
-
if not str(sc.get(f, '')).strip():
|
|
32
|
-
errs.append(f'缺必备字段 {f}')
|
|
33
|
-
desc = str(sc.get('desc', ''))
|
|
34
|
-
if desc:
|
|
35
|
-
if NAV_ONLY.match(desc.strip()):
|
|
36
|
-
errs.append('desc 纯导航无可观察效果("进入XX页"不是业务效果)')
|
|
37
|
-
elif not any(w in desc for w in EFFECT_WORDS):
|
|
38
|
-
errs.append(f'desc 无效果关键词(须含 {"/".join(EFFECT_WORDS[:6])}… 之一)')
|
|
39
|
-
if not (sc.get('page_path') or sc.get('precond_pages') or '前置' in desc or '路径' in desc):
|
|
40
|
-
warns.append('入口路径未标注(深层链路须在 desc 写前置路径)')
|
|
41
|
-
if sc.get('converted') is False and not str(sc.get('reason', '')).strip():
|
|
42
|
-
errs.append('converted=false 必须带 reason(未迁移/能力缺失/暂不测试)')
|
|
43
|
-
if not (sc.get('source_ref') or sc.get('spec_ref') or sc.get('evidence')):
|
|
44
|
-
warns.append('行为预期无源码/规格依据标注(默认值/联动禁直觉推断)')
|
|
45
|
-
ti = str(sc.get('test_intent', ''))
|
|
46
|
-
if ti and not any(t in ti for t in INTENTS):
|
|
47
|
-
errs.append(f'test_intent 非法 "{ti}"')
|
|
48
|
-
return bid, errs, warns
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def main():
|
|
52
|
-
ap = argparse.ArgumentParser()
|
|
53
|
-
ap.add_argument('scenarios')
|
|
54
|
-
ap.add_argument('--out', default='scenarios_blocker.md')
|
|
55
|
-
args = ap.parse_args()
|
|
56
|
-
try:
|
|
57
|
-
scenes = json.load(open(args.scenarios, encoding='utf-8'))
|
|
58
|
-
except Exception as e:
|
|
59
|
-
print(f'✗ scenarios.json 解析失败: {e}')
|
|
60
|
-
sys.exit(1)
|
|
61
|
-
if not scenes:
|
|
62
|
-
print('✗ 场景库为空——空库不允许生成用例(空跑=伪覆盖)')
|
|
63
|
-
sys.exit(1)
|
|
64
|
-
|
|
65
|
-
lines = ['# 场景库 Blocker(未通过质量门禁,禁止进入用例生成)', '']
|
|
66
|
-
n_err = n_warn = 0
|
|
67
|
-
for sc in scenes:
|
|
68
|
-
bid, errs, warns = check(sc)
|
|
69
|
-
for e in errs:
|
|
70
|
-
lines.append(f'- **BLOCKER** {bid}: {e}')
|
|
71
|
-
for w in warns:
|
|
72
|
-
lines.append(f'- ⚠ {bid}: {w}')
|
|
73
|
-
n_err += len(errs)
|
|
74
|
-
n_warn += len(warns)
|
|
75
|
-
print(f'场景库校验: {len(scenes)} 场景 | {n_err} blocker / {n_warn} 警告')
|
|
76
|
-
if n_err:
|
|
77
|
-
open(args.out, 'w', encoding='utf-8').write('\n'.join(lines) + '\n')
|
|
78
|
-
print(f'→ {args.out}(blocker 场景退回宿主 agent 修复)')
|
|
79
|
-
sys.exit(1)
|
|
80
|
-
print('✓ 全部通过(警告项自行斟酌)')
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if __name__ == '__main__':
|
|
84
|
-
main()
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""validate_scenarios.py — 场景库质量门禁(下游唯一基础的准入校验)。
|
|
3
|
+
|
|
4
|
+
校验规则(不通过进 scenarios_blocker.md,禁止进入用例生成):
|
|
5
|
+
1. 必备字段:id / name / desc / converted / test_intent
|
|
6
|
+
2. 可观察业务效果:desc 须含效果关键词(新增/删除/…),纯导航词(进入/打开/跳转XX页)
|
|
7
|
+
且无效果词 = 拦截
|
|
8
|
+
3. 入口可定位:page_path 或前置路径字段存在(深层链路须写明)
|
|
9
|
+
4. converted=false 必须带 reason(未迁移/能力缺失/暂不测试)
|
|
10
|
+
5. 行为预期依据:source_ref / spec_ref 至少其一(默认值/联动从源码或规格推导)
|
|
11
|
+
|
|
12
|
+
用法: python3 validate_scenarios.py scenarios.json [--out scenarios_blocker.md]
|
|
13
|
+
退出码:0=全过(或仅警告);1=存在 blocker。
|
|
14
|
+
"""
|
|
15
|
+
import argparse
|
|
16
|
+
import json
|
|
17
|
+
import re
|
|
18
|
+
import sys
|
|
19
|
+
|
|
20
|
+
REQUIRED = ['id', 'name', 'desc', 'converted', 'test_intent']
|
|
21
|
+
EFFECT_WORDS = ['新增', '删除', '修改', '保存', '收藏', '取消', '成功', '失败', '提示',
|
|
22
|
+
'计数', '状态', '切换', '变为', '出现', '消失', '显示', '回显', '+1', '变更为']
|
|
23
|
+
NAV_ONLY = re.compile(r'^(进入|打开|跳转|前往|查看)[^,。]{1,12}(页|面|界面)$')
|
|
24
|
+
INTENTS = ('资源渲染', '功能交互', '配置生效', '导航流转', '状态机', '数据输入')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def check(sc):
|
|
28
|
+
bid = sc.get('id', '?')
|
|
29
|
+
errs, warns = [], []
|
|
30
|
+
for f in REQUIRED:
|
|
31
|
+
if not str(sc.get(f, '')).strip():
|
|
32
|
+
errs.append(f'缺必备字段 {f}')
|
|
33
|
+
desc = str(sc.get('desc', ''))
|
|
34
|
+
if desc:
|
|
35
|
+
if NAV_ONLY.match(desc.strip()):
|
|
36
|
+
errs.append('desc 纯导航无可观察效果("进入XX页"不是业务效果)')
|
|
37
|
+
elif not any(w in desc for w in EFFECT_WORDS):
|
|
38
|
+
errs.append(f'desc 无效果关键词(须含 {"/".join(EFFECT_WORDS[:6])}… 之一)')
|
|
39
|
+
if not (sc.get('page_path') or sc.get('precond_pages') or '前置' in desc or '路径' in desc):
|
|
40
|
+
warns.append('入口路径未标注(深层链路须在 desc 写前置路径)')
|
|
41
|
+
if sc.get('converted') is False and not str(sc.get('reason', '')).strip():
|
|
42
|
+
errs.append('converted=false 必须带 reason(未迁移/能力缺失/暂不测试)')
|
|
43
|
+
if not (sc.get('source_ref') or sc.get('spec_ref') or sc.get('evidence')):
|
|
44
|
+
warns.append('行为预期无源码/规格依据标注(默认值/联动禁直觉推断)')
|
|
45
|
+
ti = str(sc.get('test_intent', ''))
|
|
46
|
+
if ti and not any(t in ti for t in INTENTS):
|
|
47
|
+
errs.append(f'test_intent 非法 "{ti}"')
|
|
48
|
+
return bid, errs, warns
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def main():
|
|
52
|
+
ap = argparse.ArgumentParser()
|
|
53
|
+
ap.add_argument('scenarios')
|
|
54
|
+
ap.add_argument('--out', default='scenarios_blocker.md')
|
|
55
|
+
args = ap.parse_args()
|
|
56
|
+
try:
|
|
57
|
+
scenes = json.load(open(args.scenarios, encoding='utf-8'))
|
|
58
|
+
except Exception as e:
|
|
59
|
+
print(f'✗ scenarios.json 解析失败: {e}')
|
|
60
|
+
sys.exit(1)
|
|
61
|
+
if not scenes:
|
|
62
|
+
print('✗ 场景库为空——空库不允许生成用例(空跑=伪覆盖)')
|
|
63
|
+
sys.exit(1)
|
|
64
|
+
|
|
65
|
+
lines = ['# 场景库 Blocker(未通过质量门禁,禁止进入用例生成)', '']
|
|
66
|
+
n_err = n_warn = 0
|
|
67
|
+
for sc in scenes:
|
|
68
|
+
bid, errs, warns = check(sc)
|
|
69
|
+
for e in errs:
|
|
70
|
+
lines.append(f'- **BLOCKER** {bid}: {e}')
|
|
71
|
+
for w in warns:
|
|
72
|
+
lines.append(f'- ⚠ {bid}: {w}')
|
|
73
|
+
n_err += len(errs)
|
|
74
|
+
n_warn += len(warns)
|
|
75
|
+
print(f'场景库校验: {len(scenes)} 场景 | {n_err} blocker / {n_warn} 警告')
|
|
76
|
+
if n_err:
|
|
77
|
+
open(args.out, 'w', encoding='utf-8').write('\n'.join(lines) + '\n')
|
|
78
|
+
print(f'→ {args.out}(blocker 场景退回宿主 agent 修复)')
|
|
79
|
+
sys.exit(1)
|
|
80
|
+
print('✓ 全部通过(警告项自行斟酌)')
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == '__main__':
|
|
84
|
+
main()
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: d2h-page-develop
|
|
3
|
-
description: Implement ordered Android-to-HarmonyOS page tasks from pages.json, batch_report.md, and page-scoped spec.md files. Use during page development when the current agent must complete each page serially through ArkTS implementation, managed build, Python Hypium tests, scoped commits, migration-report evidence, and in-place ledger updates before starting the next page. Do not delegate page work to subagents.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Page development loop
|
|
7
|
-
|
|
8
|
-
Implement and verify one ordered page task at a time in the current agent. Own each page's complete loop and do not delegate page implementation, build, testing, reporting, commits, or ledger updates to subagents.
|
|
9
|
-
|
|
10
|
-
## Inputs and boundaries
|
|
11
|
-
|
|
12
|
-
- Use `.migration/page-specs/pages.json` as the immutable page order and `batch_report.md` as the mutable execution ledger.
|
|
13
|
-
- Use the selected page package's `spec.md` as the authority for page scope, behavior, acceptance sequences, Android evidence, and expected HarmonyOS files.
|
|
14
|
-
- Read `.migration/utg/page.json` when the Spec references a UTG node or the arrival path needs clarification. Read cited Android source before implementing behavior.
|
|
15
|
-
- Do not require or generate `ui-design.md`, copied screenshots, copied `view.xml`, or any other page-package artifact. Each `page_NNNN_<name>-<id>/` directory continues to contain only `spec.md`.
|
|
16
|
-
- Do not regenerate `pages.json`, page Specs, or `batch_report.md` during ordinary development. Correct an owning artifact only when current source proves it wrong, record the reason, and preserve execution history.
|
|
17
|
-
- Use `droid2hmos` managed build and test entry points. Do not use task-planning commands or static scripts to choose or execute page work.
|
|
18
|
-
- Preserve unrelated user changes. Never reset, discard, or include them in a page commit.
|
|
19
|
-
|
|
20
|
-
## Single-agent mode
|
|
21
|
-
|
|
22
|
-
1. Read `pages.json` and `batch_report.md`; use AI judgment to verify their task IDs, order, links, counts, and current states agree.
|
|
23
|
-
2. Select the earliest ordered page whose development/build/validation states are not `implemented/passed/passed` and whose declared dependencies are satisfied.
|
|
24
|
-
3. Resolve the page package, Android root, HarmonyOS root, repository root, current `HEAD`, Git status, device target, and task evidence directory.
|
|
25
|
-
4. Record the current `HEAD` and Git status as the task baseline, then execute the selected page through the complete per-page loop below.
|
|
26
|
-
5. Verify the resulting implementation, current managed build/test evidence, migration report, commits, batch ledger, and Git status.
|
|
27
|
-
6. If the page is incomplete or fails verification, repair the same page; do not select another page.
|
|
28
|
-
7. Only after the selected task is genuinely `implemented/passed/passed` may the current agent 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.
|
|
30
|
-
|
|
31
|
-
## Per-page execution
|
|
32
|
-
|
|
33
|
-
### 1. Claim and understand the page
|
|
34
|
-
|
|
35
|
-
- Confirm the task is the earliest incomplete eligible row and no other task is `in_progress`.
|
|
36
|
-
- Compare the checkout with the recorded task baseline. Preserve and avoid unrelated dirty files; if ownership conflicts with a build-affecting file, return the exact conflict instead of overwriting it.
|
|
37
|
-
- Mark only the selected task `in_progress` in the working copy of `batch_report.md`.
|
|
38
|
-
- Read the complete `spec.md`, the referenced `.migration/utg/page.json` node, every cited Fact, and every cited Android source file. Follow handlers, state transitions, repositories, navigation, persistence, error paths, and platform side effects far enough to establish the observable result.
|
|
39
|
-
- Inspect the HarmonyOS architecture, routes, resources, shared components, tests, and current implementation. Load `arkts-mvvm-architecture` before planning or writing ArkTS.
|
|
40
|
-
- Build a private checklist mapping every `F-xxx` to reachable code, a stable semantic locator, an executed test assertion, and an observable result. Do not create another planning file.
|
|
41
|
-
- Resume valid existing work for this same task instead of duplicating it.
|
|
42
|
-
|
|
43
|
-
### 2. Implement
|
|
44
|
-
|
|
45
|
-
- Implement all page-scoped UI, navigation, overlays, state transitions, persistence/data effects, error paths, resources, and required shared integration.
|
|
46
|
-
- Use the Android source and observable behavior for functional truth. Use HarmonyOS-native architecture and components for the target implementation.
|
|
47
|
-
- Give tested interactive elements stable, unique semantic locators. Do not add controls solely to make testing easier.
|
|
48
|
-
- Load the applicable domain Skill for identity, i18n, drawable conversion, icon sizing, or third-party substitution when the page touches that domain.
|
|
49
|
-
- Keep shared changes limited to capabilities this page actually needs and record downstream consumers.
|
|
50
|
-
- Do not leave stubs, fixed success values, swallowed errors, unreachable pages, placeholder controls, or TODO implementations.
|
|
51
|
-
|
|
52
|
-
### 3. Managed build
|
|
53
|
-
|
|
54
|
-
- Run a fresh, non-interactive, bounded build through `droid2hmos build harmony <ANDROID_PROJECT>` using the resolved project configuration.
|
|
55
|
-
- Save the exact command, exit status, timestamps, relevant log, produced HAP path, and HAP SHA-256 in the task evidence directory.
|
|
56
|
-
- Treat compilation errors caused or exposed by the implementation as work to fix. Repeat edit/build until the managed build passes.
|
|
57
|
-
- An older HAP, static analysis result, direct Hvigor run, or previous log is not current build evidence.
|
|
58
|
-
|
|
59
|
-
### 4. Managed page tests
|
|
60
|
-
|
|
61
|
-
- 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.
|
|
62
|
-
- 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.
|
|
63
|
-
- Run the affected lists through the managed entry point:
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
droid2hmos test harmony <ANDROID_PROJECT> \
|
|
67
|
-
--runner python --hypium-project <HARMONY_PROJECT>/.hypium_forge \
|
|
68
|
-
--test-list <AFFECTED_LIST> --target <DEVICE> \
|
|
69
|
-
--ref <ACTUALLY_ASSERTED_REF>...
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
- Save the exact command, result, native report/log, device target, timestamps, hashes, and returned `managedEvidence` in the task evidence directory.
|
|
73
|
-
- A written-but-unexecuted test, screenshot-only check, coordinate-only replay, direct local runner, old log, or zero-test result is not a pass.
|
|
74
|
-
- Fix implementation or test defects and repeat managed build/test until both pass. Only a persistent external environment, signing, or device failure may become `blocked`, after bounded retries with diagnostics recorded.
|
|
75
|
-
|
|
76
|
-
### 5. Report and commit
|
|
77
|
-
|
|
78
|
-
- Load `maintaining-migration-report` while evidence is fresh. Record real HarmonyOS files, Android source provenance, current managed evidence, differences, and source-proven discoveries; run report validation.
|
|
79
|
-
- Inspect Git status and diff. Stage only the selected page's implementation, resources, tests, necessary shared files, and a source-proven correction to this page's `spec.md` when required. Do not include unrelated changes.
|
|
80
|
-
- Create a scoped implementation commit only after the managed build and page tests pass. Record its commit ID.
|
|
81
|
-
- If build-affecting page changes remain after the commit, correct the commit and rerun build/test so the evidence proves the committed tree.
|
|
82
|
-
- Update the existing `batch_report.md` queue row, detail section, counts, evidence, files, implementation commit, timestamp, blocker, and chronological notes in place. Do not rerun `build_batch_report.py`.
|
|
83
|
-
- Set `implemented/passed/passed` only when all three states are supported by current evidence. Use AI inspection to confirm queue/detail/count consistency and preserve all prior history.
|
|
84
|
-
- Commit the ledger and immutable task evidence separately from the implementation commit. Do not create a self-referential commit field.
|
|
85
|
-
|
|
86
|
-
## Page completion verification
|
|
87
|
-
|
|
88
|
-
Before marking the page complete, confirm:
|
|
89
|
-
|
|
90
|
-
- every `F-xxx` has reachable implementation, a stable locator, and an actually executed assertion;
|
|
91
|
-
- the page is reachable from the real app entry without a test-only route or replacement control;
|
|
92
|
-
- build logs, HAP hash, test reports, managed evidence, and migration-report refs correspond to the implementation commit;
|
|
93
|
-
- `batch_report.md` is internally consistent and the selected row is `implemented/passed/passed`;
|
|
94
|
-
- both scoped commits exist and no uncommitted change owned by the page remains;
|
|
95
|
-
- user changes and other pages were not reset or included;
|
|
96
|
-
- no implementation defect was reclassified as a platform difference or external blocker.
|
|
97
|
-
|
|
98
|
-
If verification fails, repair the same task before selecting or starting the next task.
|
|
99
|
-
|
|
100
|
-
## Batch regression
|
|
101
|
-
|
|
102
|
-
After every page task is complete:
|
|
103
|
-
|
|
104
|
-
1. Enumerate every current Python Hypium test list explicitly; the Python runner does not use `--all`.
|
|
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
|
-
3. Require non-zero execution with no failures, errors, or ignored tests.
|
|
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.
|
|
109
|
-
|
|
110
|
-
## Final result
|
|
111
|
-
|
|
112
|
-
Return each task ID and page, final states, implementation and test files, managed build command/HAP/evidence, managed test command/evidence, implementation and ledger commit IDs, batch regression evidence, unrelated Git changes left untouched, and any genuine blocker or unresolved item.
|
|
1
|
+
---
|
|
2
|
+
name: d2h-page-develop
|
|
3
|
+
description: Implement ordered Android-to-HarmonyOS page tasks from pages.json, batch_report.md, and page-scoped spec.md files. Use during page development when the current agent must complete each page serially through ArkTS implementation, managed build, Python Hypium tests, scoped commits, migration-report evidence, and in-place ledger updates before starting the next page. Do not delegate page work to subagents.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Page development loop
|
|
7
|
+
|
|
8
|
+
Implement and verify one ordered page task at a time in the current agent. Own each page's complete loop and do not delegate page implementation, build, testing, reporting, commits, or ledger updates to subagents.
|
|
9
|
+
|
|
10
|
+
## Inputs and boundaries
|
|
11
|
+
|
|
12
|
+
- Use `.migration/page-specs/pages.json` as the immutable page order and `batch_report.md` as the mutable execution ledger.
|
|
13
|
+
- Use the selected page package's `spec.md` as the authority for page scope, behavior, acceptance sequences, Android evidence, and expected HarmonyOS files.
|
|
14
|
+
- Read `.migration/utg/page.json` when the Spec references a UTG node or the arrival path needs clarification. Read cited Android source before implementing behavior.
|
|
15
|
+
- Do not require or generate `ui-design.md`, copied screenshots, copied `view.xml`, or any other page-package artifact. Each `page_NNNN_<name>-<id>/` directory continues to contain only `spec.md`.
|
|
16
|
+
- Do not regenerate `pages.json`, page Specs, or `batch_report.md` during ordinary development. Correct an owning artifact only when current source proves it wrong, record the reason, and preserve execution history.
|
|
17
|
+
- Use `droid2hmos` managed build and test entry points. Do not use task-planning commands or static scripts to choose or execute page work.
|
|
18
|
+
- Preserve unrelated user changes. Never reset, discard, or include them in a page commit.
|
|
19
|
+
|
|
20
|
+
## Single-agent mode
|
|
21
|
+
|
|
22
|
+
1. Read `pages.json` and `batch_report.md`; use AI judgment to verify their task IDs, order, links, counts, and current states agree.
|
|
23
|
+
2. Select the earliest ordered page whose development/build/validation states are not `implemented/passed/passed` and whose declared dependencies are satisfied.
|
|
24
|
+
3. Resolve the page package, Android root, HarmonyOS root, repository root, current `HEAD`, Git status, device target, and task evidence directory.
|
|
25
|
+
4. Record the current `HEAD` and Git status as the task baseline, then execute the selected page through the complete per-page loop below.
|
|
26
|
+
5. Verify the resulting implementation, current managed build/test evidence, migration report, commits, batch ledger, and Git status.
|
|
27
|
+
6. If the page is incomplete or fails verification, repair the same page; do not select another page.
|
|
28
|
+
7. Only after the selected task is genuinely `implemented/passed/passed` may the current agent 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.
|
|
30
|
+
|
|
31
|
+
## Per-page execution
|
|
32
|
+
|
|
33
|
+
### 1. Claim and understand the page
|
|
34
|
+
|
|
35
|
+
- Confirm the task is the earliest incomplete eligible row and no other task is `in_progress`.
|
|
36
|
+
- Compare the checkout with the recorded task baseline. Preserve and avoid unrelated dirty files; if ownership conflicts with a build-affecting file, return the exact conflict instead of overwriting it.
|
|
37
|
+
- Mark only the selected task `in_progress` in the working copy of `batch_report.md`.
|
|
38
|
+
- Read the complete `spec.md`, the referenced `.migration/utg/page.json` node, every cited Fact, and every cited Android source file. Follow handlers, state transitions, repositories, navigation, persistence, error paths, and platform side effects far enough to establish the observable result.
|
|
39
|
+
- Inspect the HarmonyOS architecture, routes, resources, shared components, tests, and current implementation. Load `arkts-mvvm-architecture` before planning or writing ArkTS.
|
|
40
|
+
- Build a private checklist mapping every `F-xxx` to reachable code, a stable semantic locator, an executed test assertion, and an observable result. Do not create another planning file.
|
|
41
|
+
- Resume valid existing work for this same task instead of duplicating it.
|
|
42
|
+
|
|
43
|
+
### 2. Implement
|
|
44
|
+
|
|
45
|
+
- Implement all page-scoped UI, navigation, overlays, state transitions, persistence/data effects, error paths, resources, and required shared integration.
|
|
46
|
+
- Use the Android source and observable behavior for functional truth. Use HarmonyOS-native architecture and components for the target implementation.
|
|
47
|
+
- Give tested interactive elements stable, unique semantic locators. Do not add controls solely to make testing easier.
|
|
48
|
+
- Load the applicable domain Skill for identity, i18n, drawable conversion, icon sizing, or third-party substitution when the page touches that domain.
|
|
49
|
+
- Keep shared changes limited to capabilities this page actually needs and record downstream consumers.
|
|
50
|
+
- Do not leave stubs, fixed success values, swallowed errors, unreachable pages, placeholder controls, or TODO implementations.
|
|
51
|
+
|
|
52
|
+
### 3. Managed build
|
|
53
|
+
|
|
54
|
+
- Run a fresh, non-interactive, bounded build through `droid2hmos build harmony <ANDROID_PROJECT>` using the resolved project configuration.
|
|
55
|
+
- Save the exact command, exit status, timestamps, relevant log, produced HAP path, and HAP SHA-256 in the task evidence directory.
|
|
56
|
+
- Treat compilation errors caused or exposed by the implementation as work to fix. Repeat edit/build until the managed build passes.
|
|
57
|
+
- An older HAP, static analysis result, direct Hvigor run, or previous log is not current build evidence.
|
|
58
|
+
|
|
59
|
+
### 4. Managed page tests
|
|
60
|
+
|
|
61
|
+
- 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.
|
|
62
|
+
- 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.
|
|
63
|
+
- Run the affected lists through the managed entry point:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
droid2hmos test harmony <ANDROID_PROJECT> \
|
|
67
|
+
--runner python --hypium-project <HARMONY_PROJECT>/.hypium_forge \
|
|
68
|
+
--test-list <AFFECTED_LIST> --target <DEVICE> \
|
|
69
|
+
--ref <ACTUALLY_ASSERTED_REF>...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- Save the exact command, result, native report/log, device target, timestamps, hashes, and returned `managedEvidence` in the task evidence directory.
|
|
73
|
+
- A written-but-unexecuted test, screenshot-only check, coordinate-only replay, direct local runner, old log, or zero-test result is not a pass.
|
|
74
|
+
- Fix implementation or test defects and repeat managed build/test until both pass. Only a persistent external environment, signing, or device failure may become `blocked`, after bounded retries with diagnostics recorded.
|
|
75
|
+
|
|
76
|
+
### 5. Report and commit
|
|
77
|
+
|
|
78
|
+
- Load `maintaining-migration-report` while evidence is fresh. Record real HarmonyOS files, Android source provenance, current managed evidence, differences, and source-proven discoveries; run report validation.
|
|
79
|
+
- Inspect Git status and diff. Stage only the selected page's implementation, resources, tests, necessary shared files, and a source-proven correction to this page's `spec.md` when required. Do not include unrelated changes.
|
|
80
|
+
- Create a scoped implementation commit only after the managed build and page tests pass. Record its commit ID.
|
|
81
|
+
- If build-affecting page changes remain after the commit, correct the commit and rerun build/test so the evidence proves the committed tree.
|
|
82
|
+
- Update the existing `batch_report.md` queue row, detail section, counts, evidence, files, implementation commit, timestamp, blocker, and chronological notes in place. Do not rerun `build_batch_report.py`.
|
|
83
|
+
- Set `implemented/passed/passed` only when all three states are supported by current evidence. Use AI inspection to confirm queue/detail/count consistency and preserve all prior history.
|
|
84
|
+
- Commit the ledger and immutable task evidence separately from the implementation commit. Do not create a self-referential commit field.
|
|
85
|
+
|
|
86
|
+
## Page completion verification
|
|
87
|
+
|
|
88
|
+
Before marking the page complete, confirm:
|
|
89
|
+
|
|
90
|
+
- every `F-xxx` has reachable implementation, a stable locator, and an actually executed assertion;
|
|
91
|
+
- the page is reachable from the real app entry without a test-only route or replacement control;
|
|
92
|
+
- build logs, HAP hash, test reports, managed evidence, and migration-report refs correspond to the implementation commit;
|
|
93
|
+
- `batch_report.md` is internally consistent and the selected row is `implemented/passed/passed`;
|
|
94
|
+
- both scoped commits exist and no uncommitted change owned by the page remains;
|
|
95
|
+
- user changes and other pages were not reset or included;
|
|
96
|
+
- no implementation defect was reclassified as a platform difference or external blocker.
|
|
97
|
+
|
|
98
|
+
If verification fails, repair the same task before selecting or starting the next task.
|
|
99
|
+
|
|
100
|
+
## Batch regression
|
|
101
|
+
|
|
102
|
+
After every page task is complete:
|
|
103
|
+
|
|
104
|
+
1. Enumerate every current Python Hypium test list explicitly; the Python runner does not use `--all`.
|
|
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
|
+
3. Require non-zero execution with no failures, errors, or ignored tests.
|
|
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.
|
|
109
|
+
|
|
110
|
+
## Final result
|
|
111
|
+
|
|
112
|
+
Return each task ID and page, final states, implementation and test files, managed build command/HAP/evidence, managed test command/evidence, implementation and ledger commit IDs, batch regression evidence, unrelated Git changes left untouched, and any genuine blocker or unresolved item.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "HarmonyOS Page Development Loop"
|
|
3
|
-
short_description: "按 spec.md 完成单页面受管开发、测试与提交闭环"
|
|
4
|
-
default_prompt: "Use $d2h-page-develop to serially implement ordered HarmonyOS page tasks from pages.json, batch_report.md, and spec.md in the current agent without delegating page work to subagents."
|
|
5
|
-
|
|
6
|
-
policy:
|
|
7
|
-
allow_implicit_invocation: true
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "HarmonyOS Page Development Loop"
|
|
3
|
+
short_description: "按 spec.md 完成单页面受管开发、测试与提交闭环"
|
|
4
|
+
default_prompt: "Use $d2h-page-develop to serially implement ordered HarmonyOS page tasks from pages.json, batch_report.md, and spec.md in the current agent without delegating page work to subagents."
|
|
5
|
+
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: true
|