@harmonyos-arkts/d2h 0.1.28 → 0.1.32

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 (105) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +13 -1
  3. package/agents/d2h.md +23 -14
  4. package/dist/bin/install-opencode.js +20 -5
  5. package/dist/src/install-opencode.js +6 -4
  6. package/dist/src/install-tui-extension.js +1 -1
  7. package/dist/src/metrics-plugin.js +4 -3
  8. package/dist/src/poc.js +53 -0
  9. package/dist/src/select-agent.js +207 -0
  10. package/docs/architecture-plan-guide.zh-CN.md +30 -46
  11. package/docs/poc-rule-evaluation.md +38 -0
  12. package/package.json +3 -2
  13. package/schemas/code-stats.schema.json +245 -0
  14. package/skills/android2hmos_resources_convert/SKILL.md +1 -9
  15. package/skills/d2h-app-solution/SKILL.md +3 -3
  16. package/skills/d2h-app-solution/references/inventory-schema.md +2 -2
  17. package/skills/d2h-architecture-plan/SKILL.md +23 -22
  18. package/skills/d2h-architecture-plan/references/architecture-plan.example.json +650 -76
  19. package/skills/d2h-architecture-plan/references/directory-creation.md +7 -7
  20. package/skills/d2h-architecture-plan/references/hybrid-design.md +63 -63
  21. package/skills/d2h-architecture-plan/references/json-contract.md +42 -27
  22. package/skills/d2h-architecture-plan/references/layout-reference.md +25 -72
  23. package/skills/d2h-architecture-plan/references/plan-contract.md +24 -34
  24. package/skills/d2h-architecture-plan/references/source-review.md +10 -7
  25. package/skills/d2h-architecture-plan/scripts/architecture_plan.py +50 -16
  26. package/skills/d2h-code-audit/SKILL.md +68 -0
  27. package/skills/d2h-code-audit/references/code-stats-schema.md +260 -0
  28. package/skills/d2h-code-audit/references/metrics.md +94 -0
  29. package/skills/d2h-code-audit/scripts/code_stats.py +600 -0
  30. package/skills/d2h-code-audit/scripts/validate_code_stats.py +446 -0
  31. package/skills/d2h-dashboard/SKILL.md +59 -33
  32. package/skills/d2h-dashboard/app/assets/Analysis-9GrmuIjp.css +1 -0
  33. package/skills/d2h-dashboard/app/assets/Analysis-Dj-4QEJi.js +1 -0
  34. package/skills/d2h-dashboard/app/assets/CodeAudit-Ctt3XEec.css +1 -0
  35. package/skills/d2h-dashboard/app/assets/CodeAudit-TcIcLwQL.js +1 -0
  36. package/skills/d2h-dashboard/app/assets/FeaturesList-C5yGUbRo.js +1 -0
  37. package/skills/d2h-dashboard/app/assets/FeaturesList-CZ40orVY.css +1 -0
  38. package/skills/d2h-dashboard/app/assets/Overview-CNkA3J9F.js +1 -0
  39. package/skills/d2h-dashboard/app/assets/Overview-Cmz8yjX-.css +1 -0
  40. package/skills/d2h-dashboard/app/assets/PageHeading-B5I3tpO8.js +1 -0
  41. package/skills/d2h-dashboard/app/assets/PageHeading-BIDu_a9G.css +1 -0
  42. package/skills/d2h-dashboard/app/assets/Project-BC9Tz1WY.js +1 -0
  43. package/skills/d2h-dashboard/app/assets/Project-BRyXCzsB.css +1 -0
  44. package/skills/d2h-dashboard/app/assets/Review-BfWvqlU9.js +1 -0
  45. package/skills/d2h-dashboard/app/assets/SpecDetail-BHB6smtT.css +1 -0
  46. package/skills/d2h-dashboard/app/assets/SpecDetail-DguVmqAE.js +1 -0
  47. package/skills/d2h-dashboard/app/assets/SpecItemDetail-7s7SaF3O.js +69 -0
  48. package/skills/d2h-dashboard/app/assets/SpecItemDetail-Bf4pGDEN.css +1 -0
  49. package/skills/d2h-dashboard/app/assets/_plugin-vue_export-helper-B9l48Cov.js +1 -0
  50. package/skills/d2h-dashboard/app/assets/batchReport-B3IzPnHF.js +1 -0
  51. package/skills/d2h-dashboard/app/assets/datetime-CHrzCsjX.js +1 -0
  52. package/skills/d2h-dashboard/app/assets/index-B3nfIPBm.js +3 -0
  53. package/skills/d2h-dashboard/app/assets/index-CnjP19Vs.css +1 -0
  54. package/skills/d2h-dashboard/app/assets/navigation-d1Uf6TR4.js +1 -0
  55. package/skills/d2h-dashboard/app/dataApi.mjs +387 -0
  56. package/skills/d2h-dashboard/app/index.html +14 -0
  57. package/skills/d2h-dashboard/app/package.json +12 -0
  58. package/skills/d2h-dashboard/app/serve.mjs +310 -0
  59. package/skills/d2h-hypium-forge/SKILL.md +6 -1
  60. package/skills/d2h-spec-develop/SKILL.md +24 -25
  61. package/skills/d2h-spec-develop/scripts/__pycache__/check_acceptance.cpython-313.pyc +0 -0
  62. package/skills/d2h-spec-develop/scripts/check_acceptance.py +66 -0
  63. package/skills/d2h-spec-generate/SKILL.md +2 -0
  64. package/skills/d2h-spec-plan/SKILL.md +6 -0
  65. package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/__pycache__/native_common.cpython-313.pyc +0 -0
  66. package/skills/d2h-architecture-plan/scripts/test_architecture_plan.py +0 -241
  67. package/skills/d2h-spec-generate/assets/spec-template.md +0 -109
  68. package/skills/d2h-spec-generate/references/from-plan.md +0 -27
  69. package/skills/d2h-spec-generate/references/spec-content.md +0 -32
  70. package/skills/maintaining-migration-report/SKILL.md +0 -144
  71. package/skills/maintaining-migration-report/references/final-acceptance.md +0 -48
  72. package/skills/maintaining-migration-report/references/source-provenance.md +0 -66
  73. /package/skills/{cpp → language/cpp}/d2h-native-library-analyse/SKILL.md +0 -0
  74. /package/skills/{cpp → language/cpp}/d2h-native-library-analyse/scripts/analyse-android-so.py +0 -0
  75. /package/skills/{cpp → language/cpp}/d2h-native-library-build/SKILL.md +0 -0
  76. /package/skills/{cpp → language/cpp}/d2h-native-library-build/references/build-config-mapping.md +0 -0
  77. /package/skills/{cpp → language/cpp}/d2h-native-library-build/references/jni-to-napi-mapping.md +0 -0
  78. /package/skills/{cpp → language/cpp}/d2h-native-library-build/scripts/check-android-so.py +0 -0
  79. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/SKILL.md +0 -0
  80. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-build-sign-run.md +0 -0
  81. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/AppScope/app.json5 +0 -0
  82. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/AppScope/resources/base/element/string.json +0 -0
  83. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/README.md +0 -0
  84. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/build-profile.json5 +0 -0
  85. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/build-profile.json5 +0 -0
  86. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/hvigorfile.ts +0 -0
  87. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/oh-package.json5 +0 -0
  88. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/entryability/EntryAbility.ets +0 -0
  89. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/pages/Index.ets +0 -0
  90. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/pages/NativeVerifyDemo.ets +0 -0
  91. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/module.json5 +0 -0
  92. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/element/color.json +0 -0
  93. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/element/string.json +0 -0
  94. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/profile/main_pages.json +0 -0
  95. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/ets/test/FFmpegVerify.test.ets +0 -0
  96. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/ets/test/List.test.ets +0 -0
  97. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/module.json5 +0 -0
  98. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/hvigor/hvigor-config.json5 +0 -0
  99. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/hvigorfile.ts +0 -0
  100. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/oh-package.json5 +0 -0
  101. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-template.md +0 -0
  102. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/hypium-test-template.md +0 -0
  103. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/device-verify.py +0 -0
  104. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/native_common.py +0 -0
  105. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/verify-ohos-native.py +0 -0
@@ -1,66 +0,0 @@
1
- # Android source provenance
2
-
3
- Use this contract whenever a report item becomes `implemented` or `verified`. Provenance binds a claim to current Android source; it does not prove runtime behavior and does not by itself prove that source was read before target code was written.
4
-
5
- ## Required inputs
6
-
7
- For each report ref collect:
8
-
9
- - the Android project root and exact report ref;
10
- - every Android source file that informed the behavior, including manifests, Kotlin/Java, XML and relevant resources;
11
- - the real HarmonyOS implementation files;
12
- - the current Task and epoch identifiers when the caller has them;
13
- - the current Task source closure, when available.
14
-
15
- A prose summary, fact label, earlier report, or generated plan can help locate source but cannot replace current files.
16
-
17
- ## Safe update
18
-
19
- Use the CLI so it verifies source membership and computes hashes:
20
-
21
- ```text
22
- droid2hmos report update <android-project> \
23
- --ref <report-ref> \
24
- --status implemented \
25
- --harmony-file <harmony-file> \
26
- --android-source <android-file> \
27
- [--android-source <android-file>...]
28
- ```
29
-
30
- `--android-source` records whole-file provenance. Prefer whole files when a symbol cannot be located deterministically. If the active host provides a schema-aware way to record precise ranges, every range must include `symbol`, `startLine`, and `endLine` and must satisfy `migration-report-item.schema.json`; do not bypass the safe update path with an ad hoc report edit.
31
-
32
- ## Source-closure reconciliation
33
-
34
- When a current Task/epoch source closure exists:
35
-
36
- 1. compare its members with the Android files actually read for the behavior;
37
- 2. include every behavior-relevant member in `--android-source`;
38
- 3. treat a newly discovered relevant file as a closure/epoch issue for the caller to resolve;
39
- 4. do not silently add an unrelated file merely to satisfy a count;
40
- 5. do not mark the item `implemented` or `verified` while a relevant closure member is missing from provenance.
41
-
42
- `report validate` generates `.migration/audit/android-source-manifest.json` and checks managed file membership and hashes. When a Task Plan is available it also reconciles report provenance with the plan's source closure.
43
-
44
- ## Evidence levels
45
-
46
- - `declared-hash-validated`: the declared file is in the managed Android project and its SHA-256 matches the current file. This is the normal CLI guarantee.
47
- - `observed-order-audited`: available only when a trusted host/runner supplies ordered Read/Write events for the same session and epoch and D1 passes.
48
- - `enforced-prewrite`: not provided by the current CLI; ordinary writes are not intercepted before they occur.
49
-
50
- Project-created `.migration/audit/source-events.jsonl` is not a trusted event source and must not upgrade the evidence level.
51
-
52
- ## D1 and D2 audits
53
-
54
- D1 writes `.migration/audit/source-order-audit.json`:
55
-
56
- - `passed`: trusted events show declared Android reads before the first target write in the same session/epoch;
57
- - `red-flag`: reads are missing, late, concurrent in an invalid action group, malformed, or inconsistent; report validation fails;
58
- - `unavailable`: no trusted event source exists; hash evidence remains usable, but read-before-write must not be claimed.
59
-
60
- D2 writes `.migration/audit/literal-drift-audit.json`. It deterministically samples up to five implemented/verified refs and compares selected strings, colors, values and simple conditions. D2 warnings require source and behavior review; they are not automatic failures because i18n, resource renaming, unit conversion, theming, and equivalent refactors can be valid.
61
-
62
- ## Existing reports
63
-
64
- `report init` upgrades supported older reports by adding empty `sourceProvenance` arrays without fabricating history. Existing `implemented` or `verified` claims remain invalid until current Android sources are declared and validation passes.
65
-
66
- Return provenance or closure gaps to the caller as `unresolved`. This Skill does not create a checkpoint or invoke completion after provenance validation.