@buaa_smat/hometrans 0.1.17 → 0.1.19
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/README.md +120 -56
- package/agents/code-reviewer.md +321 -65
- package/agents/logic-coder.md +113 -88
- package/agents/logic-context-builder.md +47 -29
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
- package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
- package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
- package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
- package/agents/scripts/hmos-precheck/index.mjs +17 -0
- package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
- package/agents/scripts/platform_query.mjs +626 -0
- package/agents/scripts/platform_query.test.mjs +422 -0
- package/agents/self-test-fixer.md +36 -34
- package/agents/self-tester.md +123 -143
- package/agents/test-case-generation-generator.md +317 -0
- package/agents/test-case-generation-validator.md +231 -0
- package/dist/cli/config-store.js +16 -63
- package/dist/cli/env-vars.js +1 -3
- package/dist/cli/index.js +0 -11
- package/dist/cli/init.js +123 -204
- package/dist/cli/uninstall.js +3 -127
- package/dist/utils/regex.js +8 -0
- package/env-requirements.json +55 -54
- package/package.json +6 -6
- package/resource/convert_pipeline_process.svg +103 -0
- package/resource/project_architecture.svg +122 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +345 -43
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-batch-ui-align/references/mvvm/@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 -648
- package/skills/hmos-batch-ui-align/references/mvvm/@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 +2088 -2088
- package/skills/hmos-batch-ui-align/references/mvvm/@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 -1033
- package/skills/hmos-batch-ui-align/references/mvvm/@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 -1183
- package/skills/hmos-batch-ui-align/references/mvvm/@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 -576
- package/skills/hmos-batch-ui-align/references/mvvm/@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 -297
- package/skills/hmos-batch-ui-align/references/mvvm/@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 -395
- package/skills/hmos-batch-ui-align/references/mvvm/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 +902 -902
- package/skills/hmos-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-batch-ui-align/references/mvvm/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 -1178
- package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/hmos-batch-ui-align/references/mvvm/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 +354 -354
- package/skills/hmos-batch-ui-align/references/mvvm//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 -11
- package/skills/hmos-batch-ui-align/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-batch-ui-align/references/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 +373 -0
- package/skills/hmos-batch-ui-align/references/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 +158 -0
- package/skills/hmos-batch-ui-align/references/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 +750 -0
- package/skills/hmos-batch-ui-align/references/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 +1704 -0
- package/skills/hmos-batch-ui-align/references/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 +1012 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/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 +164 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-batch-ui-align/references/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 +856 -0
- package/skills/hmos-batch-ui-align/references/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 +83 -0
- package/skills/hmos-batch-ui-align/references/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 +294 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-batch-ui-align/references/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 +1220 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
- package/skills/hmos-convert-pipeline/SKILL.md +168 -121
- package/skills/hmos-fix-build-errors/SKILL.md +87 -67
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
- package/skills/hmos-incremental-ui-align/README.md +53 -36
- package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
- package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
- package/skills/hmos-incremental-ui-align/page_align.md +62 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 +2088 -2088
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@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 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/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 +902 -902
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/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 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/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 +354 -354
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//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 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +373 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +158 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +750 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +1704 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +1012 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/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 +164 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +856 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@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 +83 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/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 +294 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/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 +1220 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
- package/skills/hmos-integration-test/README.md +61 -70
- package/skills/hmos-integration-test/SKILL.md +128 -111
- package/skills/hmos-resources-convert/SKILL.md +334 -66
- package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
- package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
- package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
- package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
- package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
- package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
- package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
- package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
- package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
- package/skills/hmos-spec-generate/SKILL.md +293 -214
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
- package/skills/hmos-spec-generate/template/REQ.txt +22 -0
- package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
- package/skills/hmos-test-case-generation/README.md +241 -0
- package/skills/hmos-test-case-generation/SKILL.md +324 -0
- package/skills/hmos-test-case-generation/references/contract.md +315 -0
- package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
- package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
- package/tools/bfs-crawl/README.md +73 -0
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
- package/tools/test-tools/autotest/config.ts +175 -0
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +266 -0
- package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
- package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
- package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
- package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
- package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
- package/tools/test-tools/autotest/paths.ts +41 -0
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
- package/tools/test-tools/autotest/runner/logger.ts +45 -0
- package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
- package/tools/test-tools/autotest/validate.ts +167 -0
- package/agents/build-fixer.md +0 -385
- package/agents/logic-coder/scripts/platform_context_query.py +0 -568
- package/agents/review-fixer.md +0 -405
- package/agents/spec-generator.md +0 -541
- package/dist/cli/mcp-setup.js +0 -258
- package/dist/cli/mcp.js +0 -94
- package/dist/context/index.js +0 -694
- package/resource/migration_process.svg +0 -94
- package/resource/migration_process_transparent.svg +0 -93
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
- package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
- package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
- package/skills/hmos-resources-convert/evals/evals.json +0 -171
- package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
- package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
- package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
- package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
- package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
- package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
- package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
- package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
- package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
- package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
- package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
- package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
- package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
- package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
- package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
- package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
- package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
- package/tools/test-tools/autotest/README.md +0 -238
- package/tools/test-tools/autotest/pyproject.toml +0 -26
- package/tools/test-tools/autotest/report_tool.py +0 -759
- package/tools/test-tools/autotest/self_test_runner.py +0 -895
- package/tools/test-tools/autotest/testcases_tool.py +0 -215
- package/tools/test-tools/autotest/uv.lock +0 -3156
- package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { findArktsTool, findHmsSdkEts, findSystemResourceFile } from "./backends/arkts.mjs";
|
|
6
|
+
import { findCodelinterTool } from "./backends/codelinter.mjs";
|
|
7
|
+
import { PROJECT_CONFIG_NAME, commandlineToolsHelp, defaultHomeTransConfigPath, defaultUserConfigPath, initConfig, isObject, resolveCommandlineToolsInfo, resolveProfiles } from "./core/config.mjs";
|
|
8
|
+
import { compactRunResult } from "./core/result_projection.mjs";
|
|
9
|
+
import { runStaticPrecheck } from "./backends/static_precheck.mjs";
|
|
10
|
+
const DEFAULT_PROFILES = ["arkts-diff", "codelinter-diff"];
|
|
11
|
+
async function writeJson(pathname, payload) {
|
|
12
|
+
await mkdir(path.dirname(pathname), { recursive: true });
|
|
13
|
+
await writeFile(pathname, `${JSON.stringify(payload, null, 2)}\n`, "utf8");
|
|
14
|
+
}
|
|
15
|
+
function splitCsv(values) {
|
|
16
|
+
const items = [];
|
|
17
|
+
for (const value of values) {
|
|
18
|
+
items.push(...value.split(",").map((item) => item.trim()).filter(Boolean));
|
|
19
|
+
}
|
|
20
|
+
return items;
|
|
21
|
+
}
|
|
22
|
+
function parseFlags(argv, flag) {
|
|
23
|
+
const values = [];
|
|
24
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
25
|
+
if (argv[i] === flag && argv[i + 1]) values.push(argv[i + 1]);
|
|
26
|
+
}
|
|
27
|
+
return values;
|
|
28
|
+
}
|
|
29
|
+
function singleFlag(argv, flag) {
|
|
30
|
+
const index = argv.indexOf(flag);
|
|
31
|
+
return index >= 0 ? argv[index + 1] : void 0;
|
|
32
|
+
}
|
|
33
|
+
async function writeCliFailure(baseOutputDir, problem, fix, kind) {
|
|
34
|
+
const runId = randomUUID().replace(/-/g, "");
|
|
35
|
+
const resolvedBase = path.resolve(baseOutputDir);
|
|
36
|
+
await mkdir(resolvedBase, { recursive: true });
|
|
37
|
+
const runDir = path.join(resolvedBase, `run-${runId}`);
|
|
38
|
+
await mkdir(runDir, { recursive: true });
|
|
39
|
+
const resultPath = path.join(runDir, "hmos-precheck-result.json");
|
|
40
|
+
await writeJson(resultPath, {
|
|
41
|
+
schema_version: "hmos_precheck.agent.v1",
|
|
42
|
+
run_id: runId,
|
|
43
|
+
status: "fail",
|
|
44
|
+
summary: "Fix the blocking environment issue(s) first.",
|
|
45
|
+
evidence_status: "partial",
|
|
46
|
+
raw_files: [],
|
|
47
|
+
issues: [{ kind, blocking: true, agent_fixable: false, problem, fix, fix_policy: "off", origin: { profile: "invocation", source_class: "policy" }, evidence: { status: "partial" } }]
|
|
48
|
+
});
|
|
49
|
+
return { ok: false, read_file: resultPath };
|
|
50
|
+
}
|
|
51
|
+
function fallbackOutputDir(argv) {
|
|
52
|
+
const explicit = singleFlag(argv, "--output-dir");
|
|
53
|
+
if (explicit) return path.resolve(explicit);
|
|
54
|
+
return path.join(os.tmpdir(), "hmos-precheck-cli-failures");
|
|
55
|
+
}
|
|
56
|
+
function unsupportedArktsOption(argv) {
|
|
57
|
+
if (argv.includes("--fix")) return "--fix is not supported; hmos-precheck does not mutate source files";
|
|
58
|
+
if (argv.includes("--upstream-arkts-script")) return "--upstream-arkts-script was removed; ArkTS checks use the local implementation";
|
|
59
|
+
const backend = singleFlag(argv, "--arkts-backend");
|
|
60
|
+
if (backend && !["auto", "builtin"].includes(backend)) return `--arkts-backend ${backend} was removed; use auto or builtin`;
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
async function cmdRun(argv) {
|
|
64
|
+
try {
|
|
65
|
+
const projectRoot = singleFlag(argv, "--project-root");
|
|
66
|
+
const outputDir = singleFlag(argv, "--output-dir");
|
|
67
|
+
if (!projectRoot || !outputDir) throw new Error("--project-root and --output-dir are required");
|
|
68
|
+
const commandlineToolsInfo = await resolveCommandlineToolsInfo({
|
|
69
|
+
projectRoot: path.resolve(projectRoot),
|
|
70
|
+
explicitPath: singleFlag(argv, "--commandline-tools")
|
|
71
|
+
});
|
|
72
|
+
const explicitProfiles = splitCsv(parseFlags(argv, "--profile"));
|
|
73
|
+
const profiles = await resolveProfiles({
|
|
74
|
+
explicitProfiles: explicitProfiles.length ? explicitProfiles : null,
|
|
75
|
+
projectRoot: path.resolve(projectRoot)
|
|
76
|
+
}) ?? DEFAULT_PROFILES;
|
|
77
|
+
const payload = await runStaticPrecheck({
|
|
78
|
+
projectRoot: path.resolve(projectRoot),
|
|
79
|
+
outputDir: path.resolve(outputDir),
|
|
80
|
+
commandlineTools: commandlineToolsInfo,
|
|
81
|
+
profiles,
|
|
82
|
+
baseRef: singleFlag(argv, "--base-ref") ?? "HEAD",
|
|
83
|
+
headRef: singleFlag(argv, "--head-ref") ?? null,
|
|
84
|
+
incremental: Boolean(singleFlag(argv, "--base-ref")),
|
|
85
|
+
debugArtifact: argv.includes("--debug-artifact")
|
|
86
|
+
});
|
|
87
|
+
const result = compactRunResult(payload);
|
|
88
|
+
console.log(JSON.stringify(result));
|
|
89
|
+
return result.ok ? 0 : 1;
|
|
90
|
+
} catch (error) {
|
|
91
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
92
|
+
const invalidProfile = message.startsWith("unsupported profile(s):");
|
|
93
|
+
const result = await writeCliFailure(
|
|
94
|
+
fallbackOutputDir(argv),
|
|
95
|
+
invalidProfile ? `invalid profile configuration: ${message}` : message,
|
|
96
|
+
invalidProfile ? "Remove unsupported profiles from CLI/config and use only supported profiles." : "Resolve the reported blocking issue and rerun hmos-precheck.",
|
|
97
|
+
invalidProfile ? "invalid-profile" : "internal-error"
|
|
98
|
+
);
|
|
99
|
+
console.log(JSON.stringify(result));
|
|
100
|
+
return 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function cmdPrecommit(argv) {
|
|
104
|
+
const projectRoot = singleFlag(argv, "--project-root");
|
|
105
|
+
const outputDir = singleFlag(argv, "--output-dir");
|
|
106
|
+
if (!projectRoot || !outputDir) throw new Error("--project-root and --output-dir are required");
|
|
107
|
+
const resolvedProjectRoot = path.resolve(projectRoot);
|
|
108
|
+
const commandlineTools = await resolveCommandlineToolsInfo({
|
|
109
|
+
projectRoot: resolvedProjectRoot,
|
|
110
|
+
explicitPath: singleFlag(argv, "--commandline-tools")
|
|
111
|
+
});
|
|
112
|
+
const payload = await runStaticPrecheck({
|
|
113
|
+
projectRoot: resolvedProjectRoot,
|
|
114
|
+
outputDir: path.resolve(outputDir),
|
|
115
|
+
commandlineTools,
|
|
116
|
+
profiles: ["arkts-diff"],
|
|
117
|
+
baseRef: "HEAD",
|
|
118
|
+
headRef: null,
|
|
119
|
+
incremental: true,
|
|
120
|
+
debugArtifact: argv.includes("--debug-artifact")
|
|
121
|
+
});
|
|
122
|
+
const result = compactRunResult(payload);
|
|
123
|
+
console.log(JSON.stringify(result));
|
|
124
|
+
return result.ok ? 0 : 1;
|
|
125
|
+
}
|
|
126
|
+
async function cmdDoctor(argv) {
|
|
127
|
+
const projectRoot = singleFlag(argv, "--project-root") ? path.resolve(singleFlag(argv, "--project-root")) : void 0;
|
|
128
|
+
const info = await resolveCommandlineToolsInfo({
|
|
129
|
+
projectRoot,
|
|
130
|
+
explicitPath: singleFlag(argv, "--commandline-tools")
|
|
131
|
+
});
|
|
132
|
+
const configuredProfiles = await resolveProfiles({ projectRoot });
|
|
133
|
+
const codelinter = await findCodelinterTool(info.sdkRoot);
|
|
134
|
+
const arktsTool = await findArktsTool(info.sdkRoot);
|
|
135
|
+
const hmsSdkEts = await findHmsSdkEts(info.sdkRoot);
|
|
136
|
+
const systemResourceFile = await findSystemResourceFile(info.sdkRoot);
|
|
137
|
+
const payload = {
|
|
138
|
+
tool: "hmos-precheck",
|
|
139
|
+
status: info.available ? "pass" : "warn",
|
|
140
|
+
commandline_tools: info.path,
|
|
141
|
+
commandline_tools_source: info.source,
|
|
142
|
+
node: process.execPath,
|
|
143
|
+
codelinter,
|
|
144
|
+
arkts_backend: { name: "builtin", reason: "local ArkTS implementation" },
|
|
145
|
+
checks: {
|
|
146
|
+
commandline_tools_configured: info.configured,
|
|
147
|
+
commandline_tools_found: info.available,
|
|
148
|
+
node_found: true,
|
|
149
|
+
ets_loader_found: Boolean(arktsTool.etsLoader),
|
|
150
|
+
hms_sdk_found: Boolean(hmsSdkEts),
|
|
151
|
+
system_resource_file_found: Boolean(systemResourceFile),
|
|
152
|
+
codelinter_found: Boolean(codelinter)
|
|
153
|
+
},
|
|
154
|
+
config_paths: {
|
|
155
|
+
project: projectRoot ? path.join(projectRoot, PROJECT_CONFIG_NAME) : null,
|
|
156
|
+
hometrans: defaultHomeTransConfigPath(),
|
|
157
|
+
user: defaultUserConfigPath()
|
|
158
|
+
},
|
|
159
|
+
profiles: {
|
|
160
|
+
default: DEFAULT_PROFILES,
|
|
161
|
+
supported: DEFAULT_PROFILES,
|
|
162
|
+
configured: configuredProfiles
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
if (info.message) payload.toolchain_warning = { message: info.message, hint: info.hint };
|
|
166
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
167
|
+
return 0;
|
|
168
|
+
}
|
|
169
|
+
async function cmdInit(argv) {
|
|
170
|
+
const projectRoot = singleFlag(argv, "--project-root") ? path.resolve(singleFlag(argv, "--project-root")) : void 0;
|
|
171
|
+
const info = await resolveCommandlineToolsInfo({
|
|
172
|
+
projectRoot,
|
|
173
|
+
explicitPath: singleFlag(argv, "--commandline-tools")
|
|
174
|
+
});
|
|
175
|
+
if (!info.sdkRoot) throw new Error("commandline_tools could not be resolved; pass --commandline-tools");
|
|
176
|
+
const scope = singleFlag(argv, "--scope") ?? "project";
|
|
177
|
+
const target = scope === "project" ? path.join(projectRoot ?? path.resolve("."), PROJECT_CONFIG_NAME) : defaultUserConfigPath();
|
|
178
|
+
await initConfig(target, info.sdkRoot, { portable: scope === "project" && info.source === "env" });
|
|
179
|
+
console.log(JSON.stringify({ written: target, commandline_tools: info.sdkRoot, source: info.source }, null, 2));
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
async function runInvocation(argv = process.argv.slice(2)) {
|
|
183
|
+
try {
|
|
184
|
+
const [command, ...rest] = argv;
|
|
185
|
+
if (!command) {
|
|
186
|
+
const result2 = await writeCliFailure(
|
|
187
|
+
fallbackOutputDir(argv),
|
|
188
|
+
"usage: hmos-precheck <run|precommit|doctor|init> ...",
|
|
189
|
+
"Invoke one supported command and rerun hmos-precheck.",
|
|
190
|
+
"invalid-command"
|
|
191
|
+
);
|
|
192
|
+
console.log(JSON.stringify(result2));
|
|
193
|
+
return 1;
|
|
194
|
+
}
|
|
195
|
+
if (["run", "precommit", "doctor"].includes(command)) {
|
|
196
|
+
const unsupported = unsupportedArktsOption(rest);
|
|
197
|
+
if (unsupported) {
|
|
198
|
+
const result = await writeCliFailure(
|
|
199
|
+
fallbackOutputDir(rest),
|
|
200
|
+
unsupported,
|
|
201
|
+
"Remove the unsupported option and rerun hmos-precheck.",
|
|
202
|
+
"unsupported-option"
|
|
203
|
+
);
|
|
204
|
+
console.log(JSON.stringify(result));
|
|
205
|
+
return 1;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (command === "run") return await cmdRun(rest);
|
|
209
|
+
if (command === "precommit") return await cmdPrecommit(rest);
|
|
210
|
+
if (command === "doctor") return await cmdDoctor(rest);
|
|
211
|
+
if (command === "init") return await cmdInit(rest);
|
|
212
|
+
const result = await writeCliFailure(
|
|
213
|
+
fallbackOutputDir(argv),
|
|
214
|
+
`unknown command: ${command}`,
|
|
215
|
+
"Use one of: run, precommit, doctor, init.",
|
|
216
|
+
"invalid-command"
|
|
217
|
+
);
|
|
218
|
+
console.log(JSON.stringify(result));
|
|
219
|
+
return 1;
|
|
220
|
+
} catch (error) {
|
|
221
|
+
const result = await writeCliFailure(
|
|
222
|
+
fallbackOutputDir(argv),
|
|
223
|
+
error instanceof Error ? error.message : String(error),
|
|
224
|
+
"Resolve the reported blocking issue and rerun hmos-precheck.",
|
|
225
|
+
"internal-error"
|
|
226
|
+
);
|
|
227
|
+
console.log(JSON.stringify(result));
|
|
228
|
+
return 1;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
export { runInvocation };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
rule_id,executor,positive,near_negative,boundary_variant,suppression,oracle,known_limit
|
|
2
|
+
arkts.syntax-type,sdk-checker,type mismatch,matching explicit type,multiple declarations,SDK declaration exclusion,checker,dynamic SDK rule IDs
|
|
3
|
+
arkts.strict-rules,sdk-checker,explicit any,explicit concrete type,generic concrete type,ambient declaration exclusion,checker,dynamic SDK rule IDs
|
|
4
|
+
arkts.module-resolution,sdk-checker,missing relative module,existing relative module,index and extension variants,SDK module resolution,checker,package aliases require project graph
|
|
5
|
+
sys-resource-name,builtin-regex,unknown sys resource,known sys resource,quote and whitespace variants,comment and string cases,build,line regex misses multiline and matches inert text
|
|
6
|
+
app-resource-name,local-project,unknown app resource,defined module resource,qualifier and kind variants,comment and string cases,build,line regex misses multiline and matches inert text
|
|
7
|
+
page-file-exists,project-integrity,registered missing page,registered existing page,multiple modules and extension,path traversal rejected,build,buildFunction is separate
|
|
8
|
+
page-entry-count,local-project,zero or duplicate Entry,one Entry,inline and separate decorators,comment-only decorator,build,SDK AST path is precise; fallback remains shadow
|
|
9
|
+
route-map-json,project-integrity,malformed JSON,valid JSON,route and router filename,absent route profile,build,strict JSON only
|
|
10
|
+
route-map-schema,project-integrity,missing or unknown key,all required keys,multiple entries,non-object entry,build,no source symbol resolution
|
|
11
|
+
route-target-exists,project-integrity,missing pageSourceFile,existing pageSourceFile,module-local and extension variants,path traversal rejected,build,buildFunction unverified
|
|
12
|
+
project-config-json,project-integrity,malformed referenced config,valid JSON5 comments,trailing comma and nested values,absent optional config,build,JSONC fallback without SDK parser
|
|
13
|
+
module-profile-exists,project-integrity,missing profile,existing profile,multiple qualifiers,module-local same-name isolation,build,manifest must parse structurally
|
|
14
|
+
module-ability-src-entry-exists,project-integrity,missing srcEntry,existing srcEntry,nested ability path,path traversal rejected,build,no ability class symbol check
|
|
15
|
+
module-main-element-exists,project-integrity,unknown mainElement,declared ability,multiple abilities,missing optional mainElement,build,name equality only
|
|
16
|
+
manifest-resource-reference-exists,project-integrity,missing manifest resource,defined resource,qualifiers and element kinds,module-local same-name isolation,build,source r calls excluded
|
|
17
|
+
build-profile-module-path-exists,project-integrity,missing module path,existing module manifest,nested module srcPath,path traversal rejected,build,symlink policy follows filesystem
|
|
18
|
+
build-profile-module-name-match,project-integrity,mismatched names,matching names,multiple HAP HSP HAR modules,missing optional module entry,build,name equality only
|
|
19
|
+
model-version-consistency,project-integrity,mismatched modelVersion,matching modelVersion,quoted and JSON5 forms,missing either file,build,SDK JSON5 parser when available
|
|
20
|
+
permission-name-exists,project-integrity,unknown permission,SDK or custom permission,multiple grant modes,custom definePermissions,build,SDK TypeScript declaration AST capability gated
|
|
21
|
+
permission-reason-required,project-integrity,missing or literal reason,string resource reason,comments and trailing comma,system grant permission,build,user grant catalog capability gated
|
|
22
|
+
permission-reason-resource,project-integrity,missing string key,existing string key,multiple string entries,unparseable string catalog,build,user grant catalog capability gated
|
|
23
|
+
permission-usedscene-recommended,project-integrity,missing usedScene,present usedScene,multiple abilities,system grant permission,store-policy,advisory only and never blocking
|
|
24
|
+
component-decorator-version,local-project,V1 V2 decorator mismatch,matching decorator family,inline and exported struct,block comment member,build,SDK AST path is precise; fallback remains shadow
|
|
25
|
+
observed-v2-state-type,local-project,V1 state uses ObservedV2,plain class or V2 member,cross-file and SDK class,block comment property,build,name index is not symbol resolution
|
|
26
|
+
regular-property-init,local-project,V2 regular property initialized,V2 Param property initialized,cross-file and nested object,block comment declaration,build,name index is not symbol resolution
|
|
27
|
+
local-property-init,local-project,V2 Local property initialized,V2 Param property initialized,separate decorator line,nested object key,build,line and brace scanner
|
|
28
|
+
entry-build-root,local-project,multiple or leaf root,single container root,nested container and modifier,block comment root,build,line and brace scanner
|
|
29
|
+
builder-body-ui-only,local-project,local or loop in UI body,UI syntax and event closure,Builder and build variants,block comment statement,build,line and brace scanner
|
|
30
|
+
v1-decorator-function-type,local-project,V1 decorated function type,plain callback or V2 Param,Function and arrow variants,block comment member,build,line regex
|
|
31
|
+
param-requires-require,local-project,Param without default or Require,Require or default value,generic type and separate Require,optional/default/comment cases,build,SDK AST path is precise; fallback remains shadow
|
|
32
|
+
codelinter,codelinter,raw structured SDK report,valid ArkTS source,full and incremental file set,changed-line projection,codelinter,concrete rule semantics are profile and SDK version dependent
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
rule_id,group,scope,phase,kind,source_class,implementation_status,confidence,oracle,default_mode,severity,fix_policy,inventory_status,notes
|
|
2
|
+
arkts.syntax-type,compiler,file,checker,detector,official_checker,delegated,authoritative,checker,enabled,error,off,dynamic_sdk,Enumerate concrete SDK rule IDs from structured diagnostics; do not hardcode a partial list
|
|
3
|
+
arkts.strict-rules,compiler,file,checker,detector,official_checker,delegated,authoritative,checker,enabled,error,off,dynamic_sdk,Includes arkts-no-standalone-this and arkts-no-obj-literals-as-types families
|
|
4
|
+
arkts.module-resolution,compiler,file,checker,detector,official_checker,delegated,authoritative,checker,enabled,error,off,dynamic_sdk,Module and symbol resolution diagnostics
|
|
5
|
+
arkts.sdk-hms-types,environment,project,discovery,policy,official_checker,delegated,authoritative,checker,enabled,error,off,dynamic_sdk,HMS/SDK declaration loading
|
|
6
|
+
sys-resource-name,resource,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,Text regex cannot exclude comments and strings or parse multiline calls
|
|
7
|
+
app-resource-name,resource,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,Local text scan remains shadow until structural parsing fixtures pass
|
|
8
|
+
page-file-exists,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,main_pages.json target exists
|
|
9
|
+
page-entry-count,project-config,project,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,SDK AST removes comment and syntax-shape ambiguity; build oracle is still missing
|
|
10
|
+
route-map-json,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,route_map/router_map JSON parse
|
|
11
|
+
route-map-schema,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,Allowed and required routerMap keys
|
|
12
|
+
route-target-exists,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,pageSourceFile resolves inside the declaring module
|
|
13
|
+
project-config-json,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,Referenced project JSON or JSON5 config parses structurally
|
|
14
|
+
module-profile-exists,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,Manifest profile reference exists in the declaring module
|
|
15
|
+
module-ability-src-entry-exists,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,Ability srcEntry resolves inside the declaring module
|
|
16
|
+
module-main-element-exists,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,mainElement names a declared ability
|
|
17
|
+
manifest-resource-reference-exists,resource,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,Manifest resource reference exists in the declaring module
|
|
18
|
+
build-profile-module-path-exists,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,build profile module srcPath contains a manifest
|
|
19
|
+
build-profile-module-name-match,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,build profile module name matches module manifest
|
|
20
|
+
model-version-consistency,project-config,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,hvigor and oh-package versions
|
|
21
|
+
permission-name-exists,permission,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,SDK or module-defined permission
|
|
22
|
+
permission-reason-required,permission,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,user_grant reason format
|
|
23
|
+
permission-reason-resource,permission,project,project-scan,detector,project_rule,implemented,deterministic,build,enabled,error,off,listed,$string key exists
|
|
24
|
+
permission-usedscene-recommended,permission,project,project-scan,detector,project_rule,shadow_only,heuristic,none,shadow,warning,off,listed,Store-review recommendation and not a compiler failure
|
|
25
|
+
component-decorator-version,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,SDK AST binds component and member decorators; build oracle is still missing
|
|
26
|
+
observed-v2-state-type,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,V1 state property cannot use ObservedV2 class
|
|
27
|
+
regular-property-init,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,ComponentV2 regular property call-site initialization
|
|
28
|
+
local-property-init,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,ComponentV2 Local property call-site initialization
|
|
29
|
+
entry-build-root,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,Single container root
|
|
30
|
+
builder-body-ui-only,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,No local declaration or loop in UI body
|
|
31
|
+
v1-decorator-function-type,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,V1 Prop/Link/State function type
|
|
32
|
+
param-requires-require,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,shadow,warning,off,listed,SDK AST resolves optional/default/Require forms; build oracle is still missing
|
|
33
|
+
objectlink-observed-type,arkui-model,file,project-scan,detector,project_rule,implemented,heuristic,build,disabled,error,off,listed,Implementation exists but is intentionally not wired
|
|
34
|
+
false-positive-filter,diagnostic-quality,diagnostic,normalize,policy,policy,implemented,deterministic,none,enabled,info,off,listed,SDK declarations/outside project/FA/binding sugar
|
|
35
|
+
project-config-suppression,diagnostic-quality,diagnostic,normalize,policy,project_rule,unsupported,unknown,build,disabled,info,off,listed,Disabled because message regex suppression can hide authoritative diagnostics
|
|
36
|
+
autofix-generic-suggestion-safety,autofix-safety,file,fix,fix,official_checker,unsupported,deterministic,checker,disabled,info,off,listed,Local precheck does not mutate source files
|
|
37
|
+
autofix-rename,autofix,file,fix,fix,official_checker,unsupported,authoritative,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
38
|
+
autofix-default-import,autofix,file,fix,fix,official_checker,unsupported,authoritative,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
39
|
+
autofix-promise-return,autofix,file,fix,fix,official_checker,unsupported,authoritative,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
40
|
+
autofix-remove-ets-suffix,autofix,file,fix,fix,official_checker,unsupported,authoritative,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
41
|
+
autofix-component-version,autofix,file,fix,fix,project_rule,unsupported,heuristic,build,disabled,error,off,listed,Local precheck does not mutate source files
|
|
42
|
+
autofix-hoist-import,autofix,file,fix,fix,official_checker,unsupported,deterministic,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
43
|
+
autofix-relative-import,autofix,file,fix,fix,official_checker,unsupported,heuristic,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
44
|
+
autofix-add-export,autofix,file,fix,fix,official_checker,unsupported,heuristic,checker,disabled,error,off,listed,Local precheck does not mutate source files
|
|
45
|
+
autofix-recheck-revert,autofix-safety,file,fix,fix,official_checker,unsupported,authoritative,checker,disabled,info,off,listed,Required before a future fixer can be enabled
|
|
46
|
+
autofix-also-modified,autofix-safety,file,fix,fix,policy,unsupported,authoritative,none,disabled,info,off,listed,Required before a future fixer can be enabled
|
|
47
|
+
git-changed-files,orchestration,project,scope,orchestration,git,implemented,authoritative,git,enabled,info,off,listed,Incremental scope
|
|
48
|
+
git-changed-lines,orchestration,project,scope,orchestration,git,implemented,authoritative,git,enabled,info,off,listed,Changed line ranges
|
|
49
|
+
git-diagnostic-scope,orchestration,project,scope,orchestration,git,implemented,authoritative,git,enabled,error,off,listed,Changed-line repair and impacted-context warning classification
|
|
50
|
+
codelinter,lint,file,lint,detector,codelinter,implemented,authoritative,codelinter,enabled,error,off,listed,Independent CodeLinter profile
|
|
51
|
+
evidence-status,evidence,run,orchestration,policy,policy,implemented,authoritative,none,enabled,info,off,listed,raw_structured/partial/not_checked
|
|
52
|
+
backend-availability,evidence,run,orchestration,policy,policy,implemented,authoritative,none,enabled,error,off,listed,No silent success on unavailable backend
|
|
53
|
+
backend-selection,backend-policy,run,orchestration,policy,policy,implemented,authoritative,none,enabled,info,off,listed,Local ArkTS implementation is selected deterministically; upstream is reference-only
|
|
54
|
+
backend-capability-negotiation,backend-policy,run,orchestration,policy,policy,implemented,authoritative,none,enabled,error,off,listed,Requested capability missing must be not_checked
|
|
55
|
+
backend-one-shot-daemon,execution,run,orchestration,policy,policy,planned,unknown,none,disabled,info,off,listed,Fresh one-shot processes are used until profiling justifies a persistent daemon
|
|
56
|
+
backend-cache-invalidation,execution,run,orchestration,policy,policy,planned,unknown,none,disabled,info,off,listed,Fresh per-run caches avoid stale reuse; shared-cache invalidation is not implemented
|
|
57
|
+
backend-payload-validation,evidence,run,orchestration,policy,policy,implemented,authoritative,none,enabled,error,off,listed,Reject malformed or missing structured checker payloads
|
|
58
|
+
codelinter-timeout-report,evidence,run,orchestration,policy,policy,implemented,authoritative,none,enabled,error,off,listed,Timeout/malformed report/missing report are not successful checks
|
|
59
|
+
profile-selection,orchestration,project,scope,orchestration,policy,implemented,authoritative,none,enabled,info,off,listed,Explicit profile selection and unsupported profile failure
|
|
60
|
+
build-artifact,acceptance,project,acceptance,acceptance,hvigor,unsupported,authoritative,hvigor,disabled,error,off,listed,Out of precheck backend; build remains required
|
|
61
|
+
runtime-device,acceptance,project,acceptance,acceptance,runtime,unsupported,authoritative,device,disabled,error,off,listed,Out of static checker scope
|
|
62
|
+
unsupported.route-build-function-exists,project-config,project,project-scan,detector,project_rule,unsupported,unknown,build,disabled,info,off,listed,Build function symbol resolution requires an ArkTS AST or compiler oracle
|
|
63
|
+
unsupported.resource-compiler-completeness,resource,file,project-scan,detector,project_rule,unsupported,unknown,build,disabled,info,off,listed,Malformed/unindexed resource formats remain build-owned
|
|
64
|
+
unsupported.runtime-ui-semantics,acceptance,project,acceptance,acceptance,runtime,unsupported,unknown,runtime,disabled,info,off,listed,Static rules do not prove rendered UI behavior
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const columns = [
|
|
6
|
+
"rule_id",
|
|
7
|
+
"group",
|
|
8
|
+
"scope",
|
|
9
|
+
"phase",
|
|
10
|
+
"kind",
|
|
11
|
+
"source_class",
|
|
12
|
+
"implementation_status",
|
|
13
|
+
"confidence",
|
|
14
|
+
"oracle",
|
|
15
|
+
"default_mode",
|
|
16
|
+
"severity",
|
|
17
|
+
"fix_policy",
|
|
18
|
+
"inventory_status",
|
|
19
|
+
"notes"
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const allowed = {
|
|
23
|
+
kind: new Set(["detector", "policy", "fix", "acceptance", "orchestration"]),
|
|
24
|
+
source_class: new Set(["official_checker", "project_rule", "codelinter", "git", "hvigor", "runtime", "policy"]),
|
|
25
|
+
implementation_status: new Set(["implemented", "delegated", "shadow_only", "planned", "unsupported"]),
|
|
26
|
+
confidence: new Set(["authoritative", "deterministic", "heuristic", "unknown"]),
|
|
27
|
+
default_mode: new Set(["enabled", "shadow", "disabled"]),
|
|
28
|
+
severity: new Set(["error", "warning", "info"]),
|
|
29
|
+
fix_policy: new Set(["off", "explicit", "agent-default"]),
|
|
30
|
+
inventory_status: new Set(["listed", "dynamic_sdk", "unsupported"])
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const defaultPath = path.join(
|
|
34
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
35
|
+
"rule_inventory.csv"
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
async function loadRuleInventory(inventoryPath = defaultPath) {
|
|
39
|
+
const lines = (await readFile(inventoryPath, "utf8")).trim().split(/\r?\n/);
|
|
40
|
+
if (lines.shift() !== columns.join(",")) throw new Error("invalid rule inventory header");
|
|
41
|
+
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
return lines.map((line, index) => {
|
|
44
|
+
const values = line.split(",");
|
|
45
|
+
if (values.length !== columns.length) throw new Error(`invalid field count on row ${index + 2}`);
|
|
46
|
+
const rule = Object.fromEntries(columns.map((column, columnIndex) => [column, values[columnIndex].trim()]));
|
|
47
|
+
for (const column of columns) {
|
|
48
|
+
if (!rule[column]) throw new Error(`missing ${column} on row ${index + 2}`);
|
|
49
|
+
}
|
|
50
|
+
if (seen.has(rule.rule_id)) throw new Error(`duplicate rule_id '${rule.rule_id}'`);
|
|
51
|
+
seen.add(rule.rule_id);
|
|
52
|
+
for (const [column, valuesSet] of Object.entries(allowed)) {
|
|
53
|
+
if (!valuesSet.has(rule[column])) throw new Error(`unknown ${column} '${rule[column]}'`);
|
|
54
|
+
}
|
|
55
|
+
return rule;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { loadRuleInventory };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const aliases = new Map([
|
|
2
|
+
["resource-name-check", "sys-resource-name"],
|
|
3
|
+
["app-resource-name-check", "app-resource-name"],
|
|
4
|
+
["route-map-invalid-json", "route-map-json"],
|
|
5
|
+
["route-map-unknown-key", "route-map-schema"],
|
|
6
|
+
["route-map-missing-key", "route-map-schema"],
|
|
7
|
+
["component-decorator-version-mismatch", "component-decorator-version"],
|
|
8
|
+
["observed-v2-state-property-type", "observed-v2-state-type"],
|
|
9
|
+
["entry-build-root-node", "entry-build-root"],
|
|
10
|
+
["object-link-observed-type", "objectlink-observed-type"]
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
function normalizeRuleDiagnostic(diagnostic, inventory, context = {}) {
|
|
14
|
+
const rawRule = diagnostic.rule || "no-rule";
|
|
15
|
+
const ruleId = aliases.get(rawRule) ?? rawRule;
|
|
16
|
+
const definition = inventory.find((rule) => rule.rule_id === ruleId);
|
|
17
|
+
if (!definition) {
|
|
18
|
+
const sourceClass = diagnostic.source_class
|
|
19
|
+
?? context.sourceClass
|
|
20
|
+
?? (String(rawRule).startsWith("arkts-") ? "official_checker" : "policy");
|
|
21
|
+
const official = sourceClass === "official_checker";
|
|
22
|
+
return {
|
|
23
|
+
...diagnostic,
|
|
24
|
+
raw_rule: rawRule,
|
|
25
|
+
rule_id: ruleId,
|
|
26
|
+
group: "compiler",
|
|
27
|
+
source_class: sourceClass,
|
|
28
|
+
confidence: official ? "authoritative" : "unknown",
|
|
29
|
+
default_mode: official ? "enabled" : "shadow",
|
|
30
|
+
fix_policy: "off"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
...diagnostic,
|
|
35
|
+
raw_rule: rawRule,
|
|
36
|
+
rule_id: ruleId,
|
|
37
|
+
group: definition.group,
|
|
38
|
+
source_class: definition.source_class,
|
|
39
|
+
confidence: definition.confidence,
|
|
40
|
+
default_mode: definition.default_mode,
|
|
41
|
+
policy_severity: definition.severity,
|
|
42
|
+
fix_policy: definition.fix_policy
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function classifyRuleDiagnostic(diagnostic) {
|
|
47
|
+
if (diagnostic.default_mode === "disabled") return null;
|
|
48
|
+
if (diagnostic.default_mode === "shadow") return "strong_warn";
|
|
49
|
+
if (diagnostic.severity === "error") return "hard_fixable";
|
|
50
|
+
if (diagnostic.severity === "warning") return "strong_warn";
|
|
51
|
+
return "risk_only";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { classifyRuleDiagnostic, normalizeRuleDiagnostic };
|