@buaa_smat/hometrans 0.1.20 → 26.0.0-devecocli.3
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/LICENSE +21 -21
- package/agents/build-fixer.md +406 -0
- package/agents/code-reviewer.md +461 -496
- package/agents/model-render-worker.md +34 -0
- package/agents/model-worker.md +23 -0
- package/agents/specgen-worker.md +18 -0
- package/commands/hometrans.md +17 -0
- package/devecocli-plugin/common.ts +2203 -0
- package/devecocli-plugin/install.ts +61 -0
- package/devecocli-plugin/uninstall.ts +26 -0
- package/devecocli-plugin/update.ts +66 -0
- package/index.js +1418 -0
- package/package.json +81 -64
- package/platforms/atomcode/agents/build-fixer.frontmatter.md +6 -0
- package/platforms/atomcode/agents/code-reviewer.frontmatter.md +6 -0
- package/platforms/atomcode/agents/model-render-worker.frontmatter.md +6 -0
- package/platforms/atomcode/agents/model-worker.frontmatter.md +6 -0
- package/platforms/atomcode/agents/specgen-worker.frontmatter.md +6 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +5 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +5 -0
- package/plugin.jsonc +12 -0
- package/skills/a2h-app-migrate/SKILL.md +181 -0
- package/skills/a2h-app-migrate/references/config.example.json +27 -0
- package/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/skills/a2h-app-migrate/references/stage-map.md +33 -0
- package/skills/a2h-app-migrate/references/workflow.yaml +1600 -0
- package/skills/a2h-app-migrate/scripts/android_index.mjs +109 -0
- package/skills/a2h-app-migrate/scripts/check_arch_done.mjs +80 -0
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +95 -0
- package/skills/a2h-app-migrate/scripts/check_signing.mjs +152 -0
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +277 -0
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +77 -0
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +147 -0
- package/skills/a2h-app-migrate/scripts/cli_values.mjs +32 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1412 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +651 -0
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +53 -0
- package/skills/a2h-app-migrate/scripts/json_io.mjs +35 -0
- package/skills/a2h-app-migrate/scripts/ledger.mjs +104 -0
- package/skills/a2h-app-migrate/scripts/lib-yaml-lite.mjs +288 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +881 -0
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +205 -0
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +121 -0
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +212 -0
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +30 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +455 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +80 -0
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +92 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +544 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +91 -0
- package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +109 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +315 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +133 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +133 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +158 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +181 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +168 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-arch-generate/SKILL.md +375 -0
- package/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-android.md +103 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-uniapp.md +106 -0
- package/skills/{hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md → a2h-arch-generate/references/arkts-mvvm-v2.md} +1407 -1407
- package/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/skills/a2h-arch-generate/references/clustering-guidance.md +33 -0
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +45 -0
- package/skills/a2h-arch-generate/references/reconciliation-model.md +204 -0
- package/skills/a2h-arch-generate/references/scope-policy.md +28 -0
- package/skills/a2h-arch-generate/references/semantic-review.md +65 -0
- package/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/skills/a2h-arch-generate/references/source-ecosystems.md +54 -0
- package/skills/a2h-arch-generate/references/transformation-model.md +78 -0
- package/skills/a2h-arch-generate/scripts/check_module_staleness.mjs +284 -0
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +260 -0
- package/skills/a2h-arch-generate/scripts/compute_processing_order.mjs +325 -0
- package/skills/a2h-arch-generate/scripts/create_project.mjs +149 -0
- package/skills/a2h-arch-generate/scripts/dump_core_facts.mjs +151 -0
- package/skills/a2h-arch-generate/scripts/extract_core_components.mjs +167 -0
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +363 -0
- package/skills/a2h-arch-generate/scripts/generate_state.mjs +60 -0
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +326 -0
- package/skills/a2h-arch-generate/scripts/inspect_android_project.mjs +3739 -0
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +800 -0
- package/skills/a2h-arch-generate/scripts/inspect_project.mjs +251 -0
- package/skills/a2h-arch-generate/scripts/inspect_uniapp_project.mjs +809 -0
- package/skills/a2h-arch-generate/scripts/lib/py_compat.mjs +1454 -0
- package/skills/a2h-arch-generate/scripts/module_create/create.mjs +136 -0
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +636 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/build-profile.json5 +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/oh-package.json5 +10 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/ets/applicationability/ApplicationAbility.ets +43 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/ets/pages/Index.ets +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/module.json5 +26 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/color.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/string.json +16 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/background.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/foreground.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/layered_image.json +7 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/profile/main_pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/mock/mock-config.json5 +2 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/Index.ets +1 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/build-profile.json5 +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/ets/components/MainPage.ets +19 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/module.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/resources/base/element/string.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/Index.ets +1 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/build-profile.json5 +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/consumer-rules.txt +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/oh-package.json5 +10 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/ets/pages/Index.ets +20 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/ets/utils/Calc.ets +3 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/module.json5 +12 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/element/string.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/profile/main_pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/skills/a2h-arch-generate/scripts/resolve_android_stores.mjs +529 -0
- package/skills/a2h-arch-generate/scripts/scaffold_project.mjs +230 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1122 -0
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +191 -0
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +829 -0
- package/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +937 -0
- package/skills/a2h-arch-generate/scripts/validate_homegraph_artifacts.mjs +542 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +415 -0
- package/skills/a2h-arkts-logic-coder/SKILL.md +125 -0
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +6 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +124 -0
- package/skills/a2h-arkts-logic-coder/scripts/check_module_scope.ts +224 -0
- package/skills/a2h-arkts-logic-coder/scripts/check_mvvm.ts +377 -0
- package/skills/a2h-arkts-logic-coder/scripts/stop_check_hook.ts +443 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_check_scripts.ts +211 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_worktree_compat.ts +81 -0
- package/skills/a2h-batch-ui-align/SKILL.md +321 -0
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +81 -0
- package/skills/a2h-batch-ui-align/flowchart.html +271 -0
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +572 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2535 -2533
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +558 -555
- package/skills/{hmos-incremental-ui-align/references → a2h-batch-ui-align/references/mappings}/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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 → a2h-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 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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 → a2h-batch-ui-align}/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243 → a2h-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-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -206
- package/skills/{hmos-batch-ui-align → a2h-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 -373
- package/skills/{hmos-batch-ui-align → a2h-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 -158
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -750
- package/skills/{hmos-batch-ui-align → a2h-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 -1704
- package/skills/{hmos-batch-ui-align → a2h-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 -1012
- package/skills/{hmos-batch-ui-align → a2h-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 -164
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -840
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -856
- package/skills/{hmos-batch-ui-align → a2h-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 -83
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -294
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-batch-ui-align/references/mvvm-v2}/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -1407
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -1220
- package/skills/{hmos-batch-ui-align → a2h-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 -47
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -133
- package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-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 -840
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +32 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +214 -0
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +196 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +205 -0
- package/skills/a2h-batch-ui-align/scripts/agent_cli.mjs +572 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/scripts/android_parse_fast.ts +246 -39
- package/skills/a2h-batch-ui-align/scripts/answers_check.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/arkts_static_check.ts +3858 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1675 -0
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +258 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1644 -0
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +166 -0
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1627 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +1869 -0
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +696 -0
- package/skills/a2h-batch-ui-align/scripts/harmony_index.mjs +218 -0
- package/skills/a2h-batch-ui-align/scripts/host_env.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1229 -0
- package/skills/a2h-batch-ui-align/scripts/occlusion.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1179 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1036 -0
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +253 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +241 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +341 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +445 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +356 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +564 -0
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +241 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1451 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +170 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +166 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +219 -0
- package/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +57 -0
- package/skills/a2h-dashboard-render/SKILL.md +65 -0
- package/skills/a2h-dashboard-render/references/artifact-contract.jsonc +147 -0
- package/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/skills/a2h-dashboard-render/references//347/234/213/346/235/277/350/257/264/346/230/216.md +83 -0
- package/skills/a2h-dashboard-render/scripts/artifact_contract.mjs +138 -0
- package/skills/a2h-dashboard-render/scripts/check-registry.mjs +87 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +3215 -0
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +2010 -0
- package/skills/a2h-dashboard-render/scripts/page_capture.mjs +828 -0
- package/skills/a2h-dashboard-render/scripts/usage_readers.mjs +459 -0
- package/skills/a2h-dashboard-render/scripts/usage_worker.mjs +13 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +170 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +182 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +64 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1172 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +251 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +303 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +444 -0
- package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/SKILL.md +305 -293
- package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/arkts-strict-patterns.md +219 -219
- package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/known-patterns.md +157 -157
- package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/rdb-entity-pattern.md +131 -131
- package/skills/a2h-module-semantic-docs/SKILL.md +227 -0
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +168 -0
- package/skills/a2h-module-semantic-docs/scripts/lib/py_compat.mjs +688 -0
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +1021 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-resource-convert/SKILL.md +369 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/code-vector-icon-rules.md +335 -335
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/conversion-rules.md +687 -676
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/dependency-analysis-rules.md +410 -410
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/lottie-conversion-rules.md +219 -219
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/resource-mapping-rules.md +493 -482
- package/skills/a2h-resource-convert/references/step3_5-dependency-filter.md +54 -0
- package/skills/a2h-resource-convert/references/step4-qualifiers-and-values.md +142 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +154 -0
- package/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/xml-drawable-to-svg-rules.md +630 -592
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/a2h_resource_convert.ts +2529 -2163
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +1072 -0
- package/skills/a2h-resource-convert/scripts/app_identity.ts +947 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/code_vector_icons.ts +607 -591
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +989 -0
- package/skills/a2h-resource-convert/scripts/extract_project_resources.ts +1464 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/svg_fidelity_check.ts +632 -632
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
- package/skills/a2h-spec-design/SKILL.md +336 -0
- package/skills/a2h-spec-design/scripts/inspect_spec_design_inputs.mjs +146 -0
- package/skills/a2h-spec-design/scripts/lib/py_compat.mjs +481 -0
- package/skills/a2h-spec-design/scripts/move_spec_technical_reference.mjs +159 -0
- package/skills/a2h-spec-design/scripts/resolve_module_design.mjs +102 -0
- package/skills/a2h-spec-design/scripts/validate_spec_design_output.mjs +285 -0
- package/skills/a2h-spec-design/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-spec-design/test/golden/move_design.md +18 -0
- package/skills/a2h-spec-design/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-spec-design/test/golden/move_spec.md +7 -0
- package/skills/a2h-spec-design/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-spec-design/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-spec-design/test/golden/validate_issues.json +57 -0
- package/skills/a2h-spec-design/test/test_spec_design_scripts.mjs +381 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +228 -0
- package/skills/a2h-spec-design-pipeline/package.json +4 -0
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +63 -0
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +69 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +24 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +57 -0
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +21 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +27 -0
- package/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +21 -0
- package/skills/a2h-spec-design-pipeline/scripts/atomic_write.ts +42 -0
- package/skills/a2h-spec-design-pipeline/scripts/audit_claims.ts +252 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +77 -0
- package/skills/a2h-spec-design-pipeline/scripts/deps_ready.ts +195 -0
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +651 -0
- package/skills/a2h-spec-design-pipeline/scripts/git_baseline.ts +124 -0
- package/skills/a2h-spec-design-pipeline/scripts/inflight.mjs +944 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/bgcli.mjs +95 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +502 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_waves.ts +475 -0
- package/skills/a2h-spec-design-pipeline/scripts/reconcile.mjs +218 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +164 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_atomic_write.ts +44 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_audit_claims.ts +301 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_bgcli.mjs +64 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_branch_landed.ts +87 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_deps_ready.ts +265 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +675 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_git_baseline.ts +105 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_inflight.mjs +452 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +375 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_waves.ts +561 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_reconcile.mjs +182 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +138 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_watchdog.mjs +289 -0
- package/skills/a2h-spec-design-pipeline/scripts/watchdog.mjs +441 -0
- package/skills/a2h-spec-generate/SKILL.md +285 -0
- package/skills/a2h-spec-generate/package.json +9 -0
- package/skills/a2h-spec-generate/references/batch-mode.md +151 -0
- package/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +114 -0
- package/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/skills/a2h-spec-generate/references/recall-guide.md +83 -0
- package/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +21 -0
- package/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/skills/a2h-spec-generate/references/specs.schema.json +79 -0
- package/skills/a2h-spec-generate/references/synthesis-rules.md +143 -0
- package/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/skills/a2h-spec-generate/references/worker-rules.md +126 -0
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +514 -0
- package/skills/a2h-spec-generate/scripts/check_spec.ts +361 -0
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +470 -0
- package/skills/a2h-spec-generate/scripts/detect-project.mjs +271 -0
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +188 -0
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +150 -0
- package/skills/a2h-spec-generate/scripts/inspect-uniapp.mjs +733 -0
- package/skills/{hmos-spec-generate → a2h-spec-generate}/scripts/parse_requirements.ts +515 -515
- package/skills/a2h-spec-generate/scripts/prepare-facts.mjs +307 -0
- package/skills/a2h-spec-generate/scripts/publication-verdict.mjs +171 -0
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +280 -0
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +399 -0
- package/skills/a2h-spec-generate/scripts/report.mjs +132 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/dashboard.html +149 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-api.js +49 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-code-view.js +140 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-format.js +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-handoff.js +42 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-splitters.js +78 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-state.js +47 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-tree.js +194 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-virtual-list.js +118 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.css +245 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.html +99 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.js +220 -0
- package/skills/a2h-spec-generate/scripts/reqgen/package-lock.json +47 -0
- package/skills/a2h-spec-generate/scripts/reqgen/package.json +23 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/agent-render/serve.ts +95 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/callback-call-sites.ts +82 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/area-ownership.ts +496 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/callback-flow.ts +386 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/index.ts +24 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/index.ts +22 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1270 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/index.ts +10 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/projection.ts +804 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/render-projection.ts +51 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/android-interaction-registry.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/builder.ts +453 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/compose-api-registry.ts +526 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/index.ts +15 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/connector/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/connector/utg-inbound.ts +763 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/area-graph.ts +383 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/artifact.ts +68 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/common.ts +88 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/diagnostic.ts +64 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/gap-audit.ts +113 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/index.ts +12 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/name-traceability.ts +108 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/raw-fact.ts +377 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/req-model.ts +238 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/run.ts +134 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/semantic-completeness.ts +35 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/source-facts.ts +48 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/utg.ts +133 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/core/output-guard.ts +42 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/core/stable-id.ts +118 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/cross-area-tally-cli.ts +179 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dashboard-cli.ts +188 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump/dump.ts +1184 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump-cli.ts +373 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1014 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-output.ts +32 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +142 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +312 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +310 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +685 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/graph/paths.ts +575 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/homegraph-cli.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/android-resource-resolver.ts +391 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/androidx-preference-contracts.ts +44 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +640 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/cross-area.ts +207 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/finalizer.ts +1297 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/identity.ts +186 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/index.ts +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/planner.ts +312 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/preference-enrichment.ts +793 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/raw-facts.ts +355 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/rules.ts +271 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/scanner.ts +666 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/schema.ts +365 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/stable-key.ts +144 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +301 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/uniapp-utg-adapter.ts +543 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/xml-adapter.ts +262 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/assemble.ts +2079 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +157 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +809 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/index.ts +17 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/io.ts +165 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +806 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/query.ts +360 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/seeds.ts +218 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/spec-bindings-sidecar.ts +240 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +359 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model-cli.ts +500 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/pipeline/index.ts +7 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/pipeline/output.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +172 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-cov/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-cov/source-cov.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/area-graph.ts +490 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/index.ts +23 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-model.ts +957 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +248 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/semantic-area-graph.ts +1600 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/types.ts +10 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/artifact-data.ts +201 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-api.ts +74 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-code-view.ts +180 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-format.ts +18 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-handoff.ts +55 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-splitters.ts +78 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-state.ts +66 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-tree.ts +232 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-virtual-list.ts +179 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz.ts +240 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/contracts.d.ts +86 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/index.ts +3 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/server.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/source-project.ts +316 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz-cli.ts +200 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +290 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1323 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +574 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +831 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +548 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +396 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +298 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/skills/a2h-spec-generate/scripts/reqgen/tsconfig.json +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/tsconfig.viz-client.json +12 -0
- package/skills/{hmos-spec-generate → a2h-spec-generate}/template/REQ.txt +22 -22
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +632 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +200 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +538 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +45 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +147 -0
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +282 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +593 -0
- package/skills/a2h-utg-explorer/SKILL.md +120 -0
- package/skills/a2h-utg-explorer/assets/final_viewer.html +64 -0
- package/skills/a2h-utg-explorer/assets/u2.LICENSE +21 -0
- package/skills/a2h-utg-explorer/assets/u2.NOTICE +25 -0
- package/skills/a2h-utg-explorer/assets/u2.jar +0 -0
- package/skills/a2h-utg-explorer/references/architecture.md +270 -0
- package/skills/a2h-utg-explorer/references/protocol.md +9 -0
- package/skills/a2h-utg-explorer/scripts/app_settings.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +749 -0
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +597 -0
- package/skills/a2h-utg-explorer/scripts/device_health.mjs +227 -0
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +276 -0
- package/skills/a2h-utg-explorer/scripts/evidence.mjs +108 -0
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +428 -0
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +258 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +170 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +467 -0
- package/skills/a2h-utg-explorer/scripts/recover_b.mjs +542 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +369 -0
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +203 -0
- package/skills/a2h-utg-explorer/scripts/report.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +844 -0
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +243 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +223 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +88 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +136 -0
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +251 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +42 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +162 -0
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +355 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +267 -0
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +453 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +131 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/_device_io.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/_py.mjs +2097 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +1231 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/attest.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/chain.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/coverage.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/device_lock.mjs +46 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1200 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +1558 -0
- package/skills/a2h-utg-explorer/scripts/variant.mjs +75 -0
- package/skills/a2h-utg-explorer/scripts/worklist_parts.mjs +122 -0
- package/skills/a2h-utg-static/SKILL.md +361 -0
- package/skills/a2h-utg-static/config.json +19 -0
- package/skills/a2h-utg-static/references/extractors.md +217 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/skills/a2h-utg-static/scripts/_graph.mjs +361 -0
- package/skills/a2h-utg-static/scripts/_py.mjs +2177 -0
- package/skills/a2h-utg-static/scripts/_spawn.mjs +45 -0
- package/skills/a2h-utg-static/scripts/activity_nav.mjs +738 -0
- package/skills/a2h-utg-static/scripts/activity_widgets.mjs +254 -0
- package/skills/a2h-utg-static/scripts/adapter_nav.mjs +229 -0
- package/skills/a2h-utg-static/scripts/androidfragment_nav.mjs +208 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +2065 -0
- package/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/skills/a2h-utg-static/scripts/carry_answers.mjs +201 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +594 -0
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +226 -0
- package/skills/a2h-utg-static/scripts/compose_merge.mjs +263 -0
- package/skills/a2h-utg-static/scripts/compose_nav.mjs +1216 -0
- package/skills/a2h-utg-static/scripts/compose_navbar_nav.mjs +238 -0
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +2760 -0
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +365 -0
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/skills/a2h-utg-static/scripts/dialog_listener_nav.mjs +237 -0
- package/skills/a2h-utg-static/scripts/dialogshow_nav.mjs +308 -0
- package/skills/a2h-utg-static/scripts/fragfactory_nav.mjs +170 -0
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +1136 -0
- package/skills/a2h-utg-static/scripts/guard_subjects.mjs +162 -0
- package/skills/a2h-utg-static/scripts/hg_query.mjs +137 -0
- package/skills/a2h-utg-static/scripts/host_resolve.mjs +393 -0
- package/skills/a2h-utg-static/scripts/hybrid_bundle.mjs +165 -0
- package/skills/a2h-utg-static/scripts/hybrid_pages.mjs +713 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/skills/a2h-utg-static/scripts/io_utils.mjs +59 -0
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +864 -0
- package/skills/a2h-utg-static/scripts/launch_extras.mjs +91 -0
- package/skills/a2h-utg-static/scripts/layout_resolve.mjs +148 -0
- package/skills/a2h-utg-static/scripts/manifest.mjs +483 -0
- package/skills/a2h-utg-static/scripts/measure/measure_corpus.mjs +297 -0
- package/skills/a2h-utg-static/scripts/measure/measure_guards.mjs +98 -0
- package/skills/a2h-utg-static/scripts/media_browse_nav.mjs +356 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +603 -0
- package/skills/a2h-utg-static/scripts/navactions_nav.mjs +255 -0
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +453 -0
- package/skills/a2h-utg-static/scripts/orphan_overlay_nav.mjs +89 -0
- package/skills/a2h-utg-static/scripts/phase_plan.mjs +108 -0
- package/skills/a2h-utg-static/scripts/phase_planner.mjs +119 -0
- package/skills/a2h-utg-static/scripts/plaindialog_nav.mjs +411 -0
- package/skills/a2h-utg-static/scripts/preference_nav.mjs +761 -0
- package/skills/a2h-utg-static/scripts/preference_widgets.mjs +142 -0
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/skills/a2h-utg-static/scripts/registry_nav.mjs +288 -0
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +870 -0
- package/skills/a2h-utg-static/scripts/scope_utils.mjs +430 -0
- package/skills/a2h-utg-static/scripts/screen_merge.mjs +287 -0
- package/skills/a2h-utg-static/scripts/screen_nav.mjs +279 -0
- package/skills/a2h-utg-static/scripts/single_host_nav.mjs +291 -0
- package/skills/a2h-utg-static/scripts/starter_nav.mjs +198 -0
- package/skills/a2h-utg-static/scripts/state_guard.mjs +579 -0
- package/skills/a2h-utg-static/scripts/static_prior.mjs +904 -0
- package/skills/a2h-utg-static/scripts/tests/_zipw.mjs +28 -0
- package/skills/a2h-utg-static/scripts/tests/probe_autoload.mjs +108 -0
- package/skills/a2h-utg-static/scripts/tests/probe_layout_fragments.mjs +90 -0
- package/skills/a2h-utg-static/scripts/tests/probe_unknown_scope.mjs +61 -0
- package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/skills/a2h-utg-static/scripts/tests/test_activity_alias_launcher.mjs +90 -0
- package/skills/a2h-utg-static/scripts/tests/test_activity_supertype_chain.mjs +106 -0
- package/skills/a2h-utg-static/scripts/tests/test_bottom_sheet_container.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_branch_guard.mjs +19 -0
- package/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +103 -0
- package/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/skills/a2h-utg-static/scripts/tests/test_commit_scope.mjs +113 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_file_private_route.mjs +117 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_nested_graph.mjs +166 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_route_holder_collision.mjs +112 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +284 -0
- package/skills/a2h-utg-static/scripts/tests/test_custom_source_root.mjs +71 -0
- package/skills/a2h-utg-static/scripts/tests/test_defensive_null_guard.mjs +77 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialog_orphan_entries.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialog_page_owner.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_builder_forms.mjs +96 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_java_factory.mjs +37 -0
- package/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/skills/a2h-utg-static/scripts/tests/test_edge_dedupe_by_gesture.mjs +111 -0
- package/skills/a2h-utg-static/scripts/tests/test_edge_provenance_lint.mjs +70 -0
- package/skills/a2h-utg-static/scripts/tests/test_enclosing_gesture.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_external_surface_roots.mjs +43 -0
- package/skills/a2h-utg-static/scripts/tests/test_find_package_indirect.mjs +67 -0
- package/skills/a2h-utg-static/scripts/tests/test_forwarding_wrapper.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_fragment_containment.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_fragment_helper_trigger.mjs +92 -0
- package/skills/a2h-utg-static/scripts/tests/test_graph.mjs +55 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_clause.mjs +86 -0
- package/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +119 -0
- package/skills/a2h-utg-static/scripts/tests/test_host_kind_by_chain.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/skills/a2h-utg-static/scripts/tests/test_interaction_sites.mjs +272 -0
- package/skills/a2h-utg-static/scripts/tests/test_item_data_instance.mjs +51 -0
- package/skills/a2h-utg-static/scripts/tests/test_kotlin_fn_spans.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/skills/a2h-utg-static/scripts/tests/test_layout_declared_fragment.mjs +103 -0
- package/skills/a2h-utg-static/scripts/tests/test_listener_call_forms.mjs +79 -0
- package/skills/a2h-utg-static/scripts/tests/test_listener_receiver_binding.mjs +47 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_exported_default.mjs +40 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_filters_modules.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_srcfile.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_namespace.mjs +33 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
- package/skills/a2h-utg-static/scripts/tests/test_multiple_entry_contracts.mjs +80 -0
- package/skills/a2h-utg-static/scripts/tests/test_nav_graph_xml.mjs +35 -0
- package/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_node_id_collision.mjs +57 -0
- package/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/skills/a2h-utg-static/scripts/tests/test_out_of_scope_and_settings.mjs +72 -0
- package/skills/a2h-utg-static/scripts/tests/test_overload_and_climb.mjs +86 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_page_source.mjs +78 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_position_zero.mjs +65 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_variant_guard.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +107 -0
- package/skills/a2h-utg-static/scripts/tests/test_plain_dialog_nodes.mjs +167 -0
- package/skills/a2h-utg-static/scripts/tests/test_plaindialog_shared_anchor.mjs +117 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_click_nav.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_host_binding.mjs +87 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_nesting.mjs +183 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/skills/a2h-utg-static/scripts/tests/test_resolver_tier_parity.mjs +126 -0
- package/skills/a2h-utg-static/scripts/tests/test_result_launcher.mjs +142 -0
- package/skills/a2h-utg-static/scripts/tests/test_review_fixes.mjs +135 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +66 -0
- package/skills/a2h-utg-static/scripts/tests/test_same_name_decl_scope.mjs +236 -0
- package/skills/a2h-utg-static/scripts/tests/test_scope_utils.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_overlay_split.mjs +63 -0
- package/skills/a2h-utg-static/scripts/tests/test_slug_parity.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_starter_node_id.mjs +41 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_arity.mjs +109 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_commented_candidates.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_model_gates.mjs +127 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/skills/a2h-utg-static/scripts/tests/test_template_method_layout.mjs +81 -0
- package/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_trigger_id_spelling.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_action_override.mjs +91 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_nl_hint_key.mjs +89 -0
- package/skills/a2h-utg-static/scripts/tests/test_uiless_host_fold.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_click_refs.mjs +104 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_id_label.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_interactions.mjs +346 -0
- package/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_widget_class_scope.mjs +92 -0
- package/skills/a2h-utg-static/scripts/tests/test_window_nav_kotlin.mjs +158 -0
- package/skills/a2h-utg-static/scripts/tests/test_worklist_parts.mjs +65 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1119 -0
- package/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +721 -0
- package/skills/a2h-utg-static/scripts/view_interactions.mjs +799 -0
- package/skills/a2h-utg-static/scripts/view_widgets.mjs +512 -0
- package/skills/a2h-utg-static/scripts/viewpage_nav.mjs +589 -0
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +422 -0
- package/skills/a2h-utg-static/scripts/window_nav.mjs +240 -0
- package/skills/a2h-utg-static/scripts/worklist_parts.mjs +154 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/skills/a2h-utg-static/tools/package.json +3 -0
- package/README.md +0 -445
- package/agents/logic-coder.md +0 -224
- package/agents/logic-context-builder.md +0 -212
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +0 -567
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +0 -159
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +0 -398
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +0 -250
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +0 -321
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +0 -247
- package/agents/scripts/hmos-precheck/core/config.mjs +0 -184
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +0 -20
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +0 -47
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +0 -50
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +0 -147
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +0 -131
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +0 -67
- package/agents/scripts/hmos-precheck/docs/architecture.md +0 -37
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +0 -28
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +0 -19
- package/agents/scripts/hmos-precheck/docs/validation.md +0 -50
- package/agents/scripts/hmos-precheck/index.mjs +0 -17
- package/agents/scripts/hmos-precheck/invocation.mjs +0 -231
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +0 -32
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +0 -64
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +0 -59
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +0 -54
- package/agents/scripts/platform_query.mjs +0 -626
- package/agents/scripts/platform_query.test.mjs +0 -422
- package/agents/self-test-fixer.md +0 -298
- package/agents/self-tester.md +0 -55
- package/agents/test-case-generation-generator.md +0 -317
- package/agents/test-case-generation-validator.md +0 -231
- package/dist/cli/config-store.js +0 -310
- package/dist/cli/config.js +0 -44
- package/dist/cli/env-vars.js +0 -127
- package/dist/cli/index.js +0 -56
- package/dist/cli/init.js +0 -1187
- package/dist/cli/uninstall.js +0 -427
- package/dist/utils/regex.js +0 -8
- package/env-requirements.json +0 -179
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +0 -103
- package/resource/project_architecture.svg +0 -122
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/resource/set_sdk.png +0 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +0 -413
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +0 -661
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -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 +0 -648
- 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 +0 -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 +0 -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 +0 -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 +0 -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 +0 -903
- 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 +0 -1178
- 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 +0 -355
- 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 +0 -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 +0 -206
- 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 +0 -750
- 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 +0 -840
- 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 +0 -856
- 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 +0 -294
- 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 +0 -1220
- 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 +0 -840
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +0 -1592
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +0 -752
- package/skills/hmos-convert-pipeline/SKILL.md +0 -486
- package/skills/hmos-incremental-ui-align/README.md +0 -251
- package/skills/hmos-incremental-ui-align/SKILL.md +0 -375
- package/skills/hmos-incremental-ui-align/diff_analysis.md +0 -53
- package/skills/hmos-incremental-ui-align/page_align.md +0 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +0 -38
- 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 +0 -2089
- 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 +0 -1033
- 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 +0 -106
- 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 +0 -911
- 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 +0 -373
- 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 +0 -158
- 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 +0 -1704
- 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 +0 -1012
- 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 +0 -164
- 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 +0 -83
- 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 +0 -47
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +0 -74
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +0 -34
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +0 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +0 -555
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +0 -937
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +0 -343
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +0 -76
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +0 -977
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +0 -188
- package/skills/hmos-integration-test/README.md +0 -341
- package/skills/hmos-integration-test/SKILL.md +0 -464
- package/skills/hmos-integration-test/scripts/report-tool.ts +0 -791
- package/skills/hmos-integration-test/scripts/resolve-metadata-tool.ts +0 -125
- package/skills/hmos-integration-test/scripts/self-test-runner.ts +0 -756
- package/skills/hmos-integration-test/scripts/testcases-tool.ts +0 -239
- package/skills/hmos-resources-convert/SKILL.md +0 -891
- package/skills/hmos-spec-generate/SKILL.md +0 -404
- package/skills/hmos-test-case-generation/README.md +0 -241
- package/skills/hmos-test-case-generation/SKILL.md +0 -324
- package/skills/hmos-test-case-generation/references/contract.md +0 -315
- package/skills/hmos-test-case-generation/references/review-notes-template.md +0 -84
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +0 -142
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +0 -550
- package/skills/hmos-test-case-generation/tools/validate.ts +0 -1312
- package/tools/bfs-crawl/README.md +0 -73
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +0 -1662
- /package/{README.en.md → skills/a2h-arch-generate/scripts/module_create/har/consumer-rules.txt} +0 -0
- /package/skills/{hmos-spec-generate → a2h-spec-generate}/template/REQ.xlsx +0 -0
|
@@ -0,0 +1,937 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Validate fixed-format database and preference Markdown against Android inspection facts.
|
|
3
|
+
// Node.js port of validate_data_docs.py; behavior is identical.
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ArgParser,
|
|
7
|
+
expanduser,
|
|
8
|
+
fs,
|
|
9
|
+
isDir,
|
|
10
|
+
path,
|
|
11
|
+
process,
|
|
12
|
+
pyJsonDump,
|
|
13
|
+
pyRstrip,
|
|
14
|
+
pyRstripChars,
|
|
15
|
+
pyStrip,
|
|
16
|
+
parseStrictJson,
|
|
17
|
+
resolveLikePython,
|
|
18
|
+
splitLinesKeepEnds,
|
|
19
|
+
systemExit,
|
|
20
|
+
} from "./lib/py_compat.mjs";
|
|
21
|
+
|
|
22
|
+
// str.splitlines(): exact Python semantics — only the line-boundary sequence
|
|
23
|
+
// is removed, so trailing spaces survive (the shared splitLines helper also
|
|
24
|
+
// rstrips, which would change the exact-match `lines.index("## 存储总览")`
|
|
25
|
+
// lookups for headings that carry trailing whitespace).
|
|
26
|
+
function pySplitLines(text) {
|
|
27
|
+
return splitLinesKeepEnds(text).map((line) => line.replace(/\r\n|[\n\v\f\r\x1c\x1d\x1e\x85\u2028\u2029]$/, ""));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const DATABASE_EMPTY_STATE = `# database_design
|
|
31
|
+
|
|
32
|
+
## 存储总览
|
|
33
|
+
|
|
34
|
+
| 数据库 | 用途 |
|
|
35
|
+
|---|---|
|
|
36
|
+
|
|
37
|
+
## 数据库表
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const PREFERENCES_EMPTY_STATE = `# Preferences
|
|
41
|
+
|
|
42
|
+
## Preferences 相关键
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
// Python re \b / \s / \d are Unicode: word characters are [\p{L}\p{N}_],
|
|
46
|
+
// decimal digits are \p{Nd}. The pattern uses lookarounds instead of \b so
|
|
47
|
+
// CJK text adjacent to TODO/TBD/待确认 behaves exactly like Python.
|
|
48
|
+
const PLACEHOLDER_PATTERN = /(?<![\p{L}\p{N}_])(?:TODO|TBD|Placeholder|Candidate\p{Nd}*|待确认|待补充|占位)(?![\p{L}\p{N}_])/iu;
|
|
49
|
+
|
|
50
|
+
// Python \s (str.isspace set) as an explicit class; JS \s differs.
|
|
51
|
+
const PY_WS_RUN = /[\t\n\v\f\r \x1c-\x1f\x85\xa0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+/g;
|
|
52
|
+
|
|
53
|
+
function pySubWhitespace(value, replacement) {
|
|
54
|
+
return value.replace(PY_WS_RUN, replacement);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const SEPARATOR_ROW_PATTERN = /^:?-{3,}:?$/;
|
|
58
|
+
|
|
59
|
+
const UNIQUE_PATTERN = /(?<![\p{L}\p{N}_])UNIQUE[\t\n\v\f\r \x1c-\x1f\x85\xa0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]*\(([^)]*)\)/iu;
|
|
60
|
+
|
|
61
|
+
const TEXT_TYPES = new Set(["TEXT", "STRING", "CHARSEQUENCE", "CHAR", "VARCHAR", "NVARCHAR", "CLOB", "JSON"]);
|
|
62
|
+
const INTEGER_TYPES = new Set(["INTEGER", "INT", "LONG", "SHORT", "BYTE", "BOOLEAN", "BOOL", "TINYINT", "SMALLINT", "BIGINT"]);
|
|
63
|
+
const REAL_TYPES = new Set(["REAL", "FLOAT", "DOUBLE", "NUMERIC", "DECIMAL"]);
|
|
64
|
+
const BLOB_TYPES = new Set(["BLOB", "BYTEARRAY", "BYTES", "BINARY"]);
|
|
65
|
+
const UNKNOWN_TYPES = new Set(["", "UNKNOWN", "NULL", "NUMBER", "ANY"]);
|
|
66
|
+
|
|
67
|
+
class Report {
|
|
68
|
+
constructor() {
|
|
69
|
+
this.errors = [];
|
|
70
|
+
this.warnings = [];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
error(code, message, context = {}) {
|
|
74
|
+
this.errors.push({ code, message, ...context });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
warning(code, message, context = {}) {
|
|
78
|
+
this.warnings.push({ code, message, ...context });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// dict.get(key, default): the stored value (even None) or the default; throws
|
|
83
|
+
// when the target is not a mapping, like Python's AttributeError.
|
|
84
|
+
function pyGet(obj, key, dflt) {
|
|
85
|
+
if (obj === null || typeof obj !== "object" || Array.isArray(obj)) {
|
|
86
|
+
throw new TypeError(`'${obj === null ? "NoneType" : Array.isArray(obj) ? "list" : typeof obj}' object has no attribute 'get'`);
|
|
87
|
+
}
|
|
88
|
+
return Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : dflt;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// str(float): shortest round-trip digits with Python's fixed/exponential
|
|
92
|
+
// thresholds ("1.0", "0.0001", "1e-05", "1e+16").
|
|
93
|
+
function pyFloatStr(x) {
|
|
94
|
+
if (Number.isNaN(x)) return "nan";
|
|
95
|
+
if (x === Infinity) return "inf";
|
|
96
|
+
if (x === -Infinity) return "-inf";
|
|
97
|
+
const sign = Object.is(x, -0) || x < 0 ? "-" : "";
|
|
98
|
+
const ax = Math.abs(x);
|
|
99
|
+
if (ax === 0) return `${sign}0.0`;
|
|
100
|
+
const sci = ax.toExponential();
|
|
101
|
+
const m = /^(\d)(?:\.(\d+))?e([+-]\d+)$/.exec(sci);
|
|
102
|
+
const digits = m[1] + (m[2] || "");
|
|
103
|
+
const decpt = parseInt(m[3], 10) + 1;
|
|
104
|
+
const n = digits.length;
|
|
105
|
+
if (decpt < -3 || decpt > 16) {
|
|
106
|
+
let mantissa = digits[0];
|
|
107
|
+
if (n > 1) mantissa += `.${digits.slice(1)}`;
|
|
108
|
+
const e = decpt - 1;
|
|
109
|
+
const eSign = e < 0 ? "-" : "+";
|
|
110
|
+
const eAbs = Math.abs(e).toString().padStart(2, "0");
|
|
111
|
+
return `${sign}${mantissa}e${eSign}${eAbs}`;
|
|
112
|
+
}
|
|
113
|
+
if (decpt >= n) {
|
|
114
|
+
return `${sign}${digits}${"0".repeat(decpt - n)}.0`;
|
|
115
|
+
}
|
|
116
|
+
if (decpt > 0) {
|
|
117
|
+
return `${sign}${digits.slice(0, decpt)}.${digits.slice(decpt)}`;
|
|
118
|
+
}
|
|
119
|
+
return `${sign}0.${"0".repeat(-decpt)}${digits}`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// str(value) for JSON-decoded values (None/True/False/int/float/str).
|
|
123
|
+
function pyStr(value) {
|
|
124
|
+
if (value === null) return "None";
|
|
125
|
+
if (value === true) return "True";
|
|
126
|
+
if (value === false) return "False";
|
|
127
|
+
if (typeof value === "bigint") return value.toString();
|
|
128
|
+
if (typeof value === "number") return pyFloatStr(value);
|
|
129
|
+
return String(value);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Python truthiness for JSON values and the parser's Map/Object results.
|
|
133
|
+
function pyTruthy(value) {
|
|
134
|
+
if (value === null || value === undefined || value === false) return false;
|
|
135
|
+
if (value === true) return true;
|
|
136
|
+
if (typeof value === "number") return value !== 0;
|
|
137
|
+
if (typeof value === "bigint") return value !== 0n;
|
|
138
|
+
if (typeof value === "string" || Array.isArray(value)) return value.length > 0;
|
|
139
|
+
if (value instanceof Map || value instanceof Set) return value.size > 0;
|
|
140
|
+
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
141
|
+
return Boolean(value);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// len() for the shapes that can reach the payload statistics.
|
|
145
|
+
function pyLen(value) {
|
|
146
|
+
if (typeof value === "string" || Array.isArray(value)) return value.length;
|
|
147
|
+
if (value instanceof Map || value instanceof Set) return value.size;
|
|
148
|
+
if (value !== null && typeof value === "object") return Object.keys(value).length;
|
|
149
|
+
return value.length;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// sorted(): code-point order (JS default sort is UTF-16 code-unit order).
|
|
153
|
+
function cmpCodePoints(a, b) {
|
|
154
|
+
let i = 0;
|
|
155
|
+
let j = 0;
|
|
156
|
+
while (i < a.length && j < b.length) {
|
|
157
|
+
const ca = a.codePointAt(i);
|
|
158
|
+
const cb = b.codePointAt(j);
|
|
159
|
+
if (ca !== cb) return ca < cb ? -1 : 1;
|
|
160
|
+
i += ca > 0xffff ? 2 : 1;
|
|
161
|
+
j += cb > 0xffff ? 2 : 1;
|
|
162
|
+
}
|
|
163
|
+
const restA = a.length - i;
|
|
164
|
+
const restB = b.length - j;
|
|
165
|
+
return restA === restB ? 0 : restA > restB ? 1 : -1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// str.strip(chars): strip any of the given characters from both ends.
|
|
169
|
+
function stripChars(s, chars) {
|
|
170
|
+
const set = new Set(chars);
|
|
171
|
+
let start = 0;
|
|
172
|
+
let end = s.length;
|
|
173
|
+
while (start < end && set.has(s[start])) start += 1;
|
|
174
|
+
while (end > start && set.has(s[end - 1])) end -= 1;
|
|
175
|
+
return s.slice(start, end);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function removeSuffix(s, suffix) {
|
|
179
|
+
return s.endsWith(suffix) ? s.slice(0, s.length - suffix.length) : s;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function arraysEqual(a, b) {
|
|
183
|
+
if (a === b) return true;
|
|
184
|
+
if (a.length !== b.length) return false;
|
|
185
|
+
for (let i = 0; i < a.length; i += 1) {
|
|
186
|
+
if (a[i] !== b[i]) return false;
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// bytes.decode("utf-8") with CPython's exact UnicodeDecodeError messages.
|
|
192
|
+
function pyDecodeUtf8(buf) {
|
|
193
|
+
const hex = (b) => b.toString(16).padStart(2, "0");
|
|
194
|
+
const n = buf.length;
|
|
195
|
+
let out = "";
|
|
196
|
+
let i = 0;
|
|
197
|
+
while (i < n) {
|
|
198
|
+
const b0 = buf[i];
|
|
199
|
+
if (b0 < 0x80) {
|
|
200
|
+
out += String.fromCharCode(b0);
|
|
201
|
+
i += 1;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
let size;
|
|
205
|
+
let contMin;
|
|
206
|
+
let contMax;
|
|
207
|
+
if (b0 >= 0xc2 && b0 <= 0xdf) {
|
|
208
|
+
size = 2; contMin = 0x80; contMax = 0xbf;
|
|
209
|
+
} else if (b0 === 0xe0) {
|
|
210
|
+
size = 3; contMin = 0xa0; contMax = 0xbf;
|
|
211
|
+
} else if (b0 >= 0xe1 && b0 <= 0xec) {
|
|
212
|
+
size = 3; contMin = 0x80; contMax = 0xbf;
|
|
213
|
+
} else if (b0 === 0xed) {
|
|
214
|
+
size = 3; contMin = 0x80; contMax = 0x9f;
|
|
215
|
+
} else if (b0 >= 0xee && b0 <= 0xef) {
|
|
216
|
+
size = 3; contMin = 0x80; contMax = 0xbf;
|
|
217
|
+
} else if (b0 === 0xf0) {
|
|
218
|
+
size = 4; contMin = 0x90; contMax = 0xbf;
|
|
219
|
+
} else if (b0 >= 0xf1 && b0 <= 0xf3) {
|
|
220
|
+
size = 4; contMin = 0x80; contMax = 0xbf;
|
|
221
|
+
} else if (b0 === 0xf4) {
|
|
222
|
+
size = 4; contMin = 0x80; contMax = 0x8f;
|
|
223
|
+
} else {
|
|
224
|
+
throw new TypeError(`'utf-8' codec can't decode byte 0x${hex(b0)} in position ${i}: invalid start byte`);
|
|
225
|
+
}
|
|
226
|
+
let codePoint = b0 & (size === 2 ? 0x1f : size === 3 ? 0x0f : 0x07);
|
|
227
|
+
let j = 1;
|
|
228
|
+
for (; j < size; j += 1) {
|
|
229
|
+
if (i + j >= n) {
|
|
230
|
+
const what = j === 1
|
|
231
|
+
? `byte 0x${hex(b0)} in position ${i}`
|
|
232
|
+
: `bytes in position ${i}-${i + j - 1}`;
|
|
233
|
+
throw new TypeError(`'utf-8' codec can't decode ${what}: unexpected end of data`);
|
|
234
|
+
}
|
|
235
|
+
const b = buf[i + j];
|
|
236
|
+
const lo = j === 1 ? contMin : 0x80;
|
|
237
|
+
const hi = j === 1 ? contMax : 0xbf;
|
|
238
|
+
if (b < lo || b > hi) {
|
|
239
|
+
const what = j === 1
|
|
240
|
+
? `byte 0x${hex(b0)} in position ${i}`
|
|
241
|
+
: `bytes in position ${i}-${i + j - 1}`;
|
|
242
|
+
throw new TypeError(`'utf-8' codec can't decode ${what}: invalid continuation byte`);
|
|
243
|
+
}
|
|
244
|
+
codePoint = (codePoint << 6) | (b & 0x3f);
|
|
245
|
+
}
|
|
246
|
+
if (codePoint > 0xffff) {
|
|
247
|
+
const v = codePoint - 0x10000;
|
|
248
|
+
out += String.fromCharCode(0xd800 + (v >> 10), 0xdc00 + (v & 0x3ff));
|
|
249
|
+
} else {
|
|
250
|
+
out += String.fromCharCode(codePoint);
|
|
251
|
+
}
|
|
252
|
+
i += size;
|
|
253
|
+
}
|
|
254
|
+
return out;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Path.read_text(encoding="utf-8"): fatal decode + universal newlines.
|
|
258
|
+
function readUtf8Text(p) {
|
|
259
|
+
return pyDecodeUtf8(fs.readFileSync(p)).replace(/\r\n?/g, "\n");
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function loadJson(p) {
|
|
263
|
+
let value;
|
|
264
|
+
try {
|
|
265
|
+
value = parseStrictJson(readUtf8Text(p));
|
|
266
|
+
} catch (err) {
|
|
267
|
+
if (err && err.code === "ENOENT") {
|
|
268
|
+
systemExit(`Required JSON file does not exist: ${p}`);
|
|
269
|
+
}
|
|
270
|
+
if (err instanceof SyntaxError) {
|
|
271
|
+
systemExit(`Invalid JSON in ${p}: ${err.message}`);
|
|
272
|
+
}
|
|
273
|
+
throw err;
|
|
274
|
+
}
|
|
275
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
276
|
+
systemExit(`JSON root must be an object: ${p}`);
|
|
277
|
+
}
|
|
278
|
+
return value;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// tempfile.mkstemp + os.replace atomic write (mode/content like the Python original).
|
|
282
|
+
function atomicWriteJson(p, data) {
|
|
283
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
284
|
+
const tmp = path.join(
|
|
285
|
+
path.dirname(p),
|
|
286
|
+
`${path.basename(p)}.${process.pid}.${Date.now()}.${Math.floor(Math.random() * 1e9)}.tmp`,
|
|
287
|
+
);
|
|
288
|
+
try {
|
|
289
|
+
fs.writeFileSync(tmp, `${pyJsonDump(data)}\n`, "utf8");
|
|
290
|
+
fs.renameSync(tmp, p);
|
|
291
|
+
} catch (err) {
|
|
292
|
+
try {
|
|
293
|
+
fs.unlinkSync(tmp);
|
|
294
|
+
} catch { /* best effort */ }
|
|
295
|
+
throw err;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function splitMarkdownRow(line) {
|
|
300
|
+
const value = pyStrip(line);
|
|
301
|
+
if (!value.startsWith("|") || !value.endsWith("|")) {
|
|
302
|
+
return [];
|
|
303
|
+
}
|
|
304
|
+
const cells = [];
|
|
305
|
+
let current = "";
|
|
306
|
+
let escape = false;
|
|
307
|
+
for (const char of value.slice(1, -1)) {
|
|
308
|
+
if (escape) {
|
|
309
|
+
current += char;
|
|
310
|
+
escape = false;
|
|
311
|
+
} else if (char === "\\") {
|
|
312
|
+
escape = true;
|
|
313
|
+
} else if (char === "|") {
|
|
314
|
+
cells.push(pyStrip(current));
|
|
315
|
+
current = "";
|
|
316
|
+
} else {
|
|
317
|
+
current += char;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
cells.push(pyStrip(current));
|
|
321
|
+
return cells;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function isSeparatorRow(line, columns) {
|
|
325
|
+
const cells = splitMarkdownRow(line);
|
|
326
|
+
return cells.length === columns && cells.every((cell) => SEPARATOR_ROW_PATTERN.test(cell.replace(" ", "")));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function parseTable(lines, start, expectedHeader, report, location) {
|
|
330
|
+
let index = start;
|
|
331
|
+
while (index < lines.length && !pyStrip(lines[index])) {
|
|
332
|
+
index += 1;
|
|
333
|
+
}
|
|
334
|
+
if (index >= lines.length || !arraysEqual(splitMarkdownRow(lines[index]), expectedHeader)) {
|
|
335
|
+
report.error("invalid_table_header", `${location} must use the fixed table header`, { expected: expectedHeader });
|
|
336
|
+
return [[], index];
|
|
337
|
+
}
|
|
338
|
+
index += 1;
|
|
339
|
+
if (index >= lines.length || !isSeparatorRow(lines[index], expectedHeader.length)) {
|
|
340
|
+
report.error("invalid_table_separator", `${location} must contain a Markdown separator row`);
|
|
341
|
+
return [[], index];
|
|
342
|
+
}
|
|
343
|
+
index += 1;
|
|
344
|
+
const rows = [];
|
|
345
|
+
while (index < lines.length) {
|
|
346
|
+
const line = lines[index];
|
|
347
|
+
if (!pyStrip(line)) {
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
const cells = splitMarkdownRow(line);
|
|
351
|
+
if (cells.length === 0) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
if (cells.length !== expectedHeader.length) {
|
|
355
|
+
report.error("invalid_table_row", `${location} contains a row with the wrong number of columns`, { line: index + 1 });
|
|
356
|
+
} else {
|
|
357
|
+
rows.push(cells);
|
|
358
|
+
}
|
|
359
|
+
index += 1;
|
|
360
|
+
}
|
|
361
|
+
return [rows, index];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function cleanHeadingName(value) {
|
|
365
|
+
value = pyStrip(value);
|
|
366
|
+
if (value.startsWith("`") && value.endsWith("`")) {
|
|
367
|
+
value = value.slice(1, -1);
|
|
368
|
+
}
|
|
369
|
+
return pyStrip(value);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function parseDatabaseDoc(p, report) {
|
|
373
|
+
let content;
|
|
374
|
+
try {
|
|
375
|
+
content = readUtf8Text(p);
|
|
376
|
+
} catch (err) {
|
|
377
|
+
if (err && err.code === "ENOENT") {
|
|
378
|
+
report.error("missing_database_document", `Required database document is absent: ${p}`);
|
|
379
|
+
return { overview: new Map(), databases: new Map(), content: null };
|
|
380
|
+
}
|
|
381
|
+
if (err instanceof TypeError) {
|
|
382
|
+
report.error("database_document_not_utf8", `database_design.md is not UTF-8: ${p}`, { error: err.message });
|
|
383
|
+
return { overview: new Map(), databases: new Map(), content: null };
|
|
384
|
+
}
|
|
385
|
+
throw err;
|
|
386
|
+
}
|
|
387
|
+
if (PLACEHOLDER_PATTERN.test(content)) {
|
|
388
|
+
report.error("database_placeholder", "database_design.md contains unresolved placeholder text");
|
|
389
|
+
}
|
|
390
|
+
const lines = pySplitLines(content);
|
|
391
|
+
const h1 = lines.filter((line) => line.startsWith("# ")).map((line) => pyStrip(line));
|
|
392
|
+
const h2 = lines.filter((line) => line.startsWith("## ")).map((line) => pyStrip(line));
|
|
393
|
+
if (!arraysEqual(h1, ["# database_design"])) {
|
|
394
|
+
report.error("database_title_contract", "database_design.md must contain exactly '# database_design' as its level-one title");
|
|
395
|
+
}
|
|
396
|
+
if (!arraysEqual(h2, ["## 存储总览", "## 数据库表"])) {
|
|
397
|
+
report.error("database_section_contract", "database_design.md must contain exactly 存储总览 and 数据库表 sections");
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const overview = new Map();
|
|
401
|
+
const databases = new Map();
|
|
402
|
+
const overviewMarker = lines.indexOf("## 存储总览");
|
|
403
|
+
if (overviewMarker !== -1) {
|
|
404
|
+
const [rows] = parseTable(lines, overviewMarker + 1, ["数据库", "用途"], report, "存储总览");
|
|
405
|
+
for (const [name, purpose] of rows) {
|
|
406
|
+
if (!name || !purpose) {
|
|
407
|
+
report.error("database_overview_empty", "Database overview rows require a database name and purpose");
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
if (overview.has(name)) {
|
|
411
|
+
report.error("duplicate_database_overview", `Duplicate database in overview: ${name}`);
|
|
412
|
+
}
|
|
413
|
+
overview.set(name, purpose);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const tablesMarker = lines.indexOf("## 数据库表");
|
|
418
|
+
let index = tablesMarker === -1 ? lines.length : tablesMarker + 1;
|
|
419
|
+
let currentDatabase = null;
|
|
420
|
+
while (index < lines.length) {
|
|
421
|
+
const line = pyStrip(lines[index]);
|
|
422
|
+
if (line.startsWith("### ") && !line.startsWith("#### ")) {
|
|
423
|
+
currentDatabase = cleanHeadingName(line.slice(4));
|
|
424
|
+
if (!currentDatabase) {
|
|
425
|
+
report.error("empty_database_heading", "Database headings must not be empty", { line: index + 1 });
|
|
426
|
+
} else if (databases.has(currentDatabase)) {
|
|
427
|
+
report.error("duplicate_database_section", `Duplicate database section: ${currentDatabase}`);
|
|
428
|
+
} else {
|
|
429
|
+
databases.set(currentDatabase, { tables: new Map() });
|
|
430
|
+
}
|
|
431
|
+
index += 1;
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
if (line.startsWith("#### ")) {
|
|
435
|
+
const tableName = removeSuffix(cleanHeadingName(line.slice(5)), "(已废弃)");
|
|
436
|
+
if (currentDatabase === null) {
|
|
437
|
+
report.error("table_without_database", `Table section has no database parent: ${tableName}`, { line: index + 1 });
|
|
438
|
+
index += 1;
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
const tableMap = databases.get(currentDatabase).tables;
|
|
442
|
+
if (tableMap.has(tableName)) {
|
|
443
|
+
report.error("duplicate_table_section", `Duplicate table section: ${currentDatabase}.${tableName}`);
|
|
444
|
+
}
|
|
445
|
+
let headerIndex = index + 1;
|
|
446
|
+
while (headerIndex < lines.length) {
|
|
447
|
+
const candidate = pyStrip(lines[headerIndex]);
|
|
448
|
+
if (candidate.startsWith("### ") || candidate.startsWith("## ")) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
if (arraysEqual(splitMarkdownRow(lines[headerIndex]), ["字段", "类型", "键", "约束"])) {
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
headerIndex += 1;
|
|
455
|
+
}
|
|
456
|
+
const [rows, end] = parseTable(lines, headerIndex, ["字段", "类型", "键", "约束"], report, `${currentDatabase}.${tableName}`);
|
|
457
|
+
const columns = new Map();
|
|
458
|
+
for (const [field, fieldType, key, constraint] of rows) {
|
|
459
|
+
if (!field || !fieldType) {
|
|
460
|
+
report.error("database_column_required", `Fields and types must be non-empty in ${currentDatabase}.${tableName}`);
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
if (columns.has(field)) {
|
|
464
|
+
report.error("duplicate_database_column", `Duplicate field in ${currentDatabase}.${tableName}: ${field}`);
|
|
465
|
+
}
|
|
466
|
+
columns.set(field, { type: fieldType, key, constraint });
|
|
467
|
+
}
|
|
468
|
+
tableMap.set(tableName, { columns });
|
|
469
|
+
index = Math.max(index + 1, end);
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
index += 1;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
for (const name of overview.keys()) {
|
|
476
|
+
if (!databases.has(name)) {
|
|
477
|
+
report.error("overview_database_missing_detail", `Database in overview has no detail section: ${name}`);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
for (const name of databases.keys()) {
|
|
481
|
+
if (!overview.has(name)) {
|
|
482
|
+
report.error("database_detail_missing_overview", `Database detail is absent from overview: ${name}`);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return { overview, databases, content };
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function parsePreferencesDoc(p, report) {
|
|
489
|
+
let content;
|
|
490
|
+
try {
|
|
491
|
+
content = readUtf8Text(p);
|
|
492
|
+
} catch (err) {
|
|
493
|
+
if (err && err.code === "ENOENT") {
|
|
494
|
+
report.error("missing_preferences_document", `Required preferences document is absent: ${p}`);
|
|
495
|
+
return { stores: new Map(), content: null };
|
|
496
|
+
}
|
|
497
|
+
if (err instanceof TypeError) {
|
|
498
|
+
report.error("preferences_document_not_utf8", `preferences_design.md is not UTF-8: ${p}`, { error: err.message });
|
|
499
|
+
return { stores: new Map(), content: null };
|
|
500
|
+
}
|
|
501
|
+
throw err;
|
|
502
|
+
}
|
|
503
|
+
if (PLACEHOLDER_PATTERN.test(content)) {
|
|
504
|
+
report.error("preferences_placeholder", "preferences_design.md contains unresolved placeholder text");
|
|
505
|
+
}
|
|
506
|
+
const lines = pySplitLines(content);
|
|
507
|
+
const h1 = lines.filter((line) => line.startsWith("# ")).map((line) => pyStrip(line));
|
|
508
|
+
const h2 = lines.filter((line) => line.startsWith("## ")).map((line) => pyStrip(line));
|
|
509
|
+
if (!arraysEqual(h1, ["# Preferences"])) {
|
|
510
|
+
report.error("preferences_title_contract", "preferences_design.md must contain exactly '# Preferences' as its level-one title");
|
|
511
|
+
}
|
|
512
|
+
if (!arraysEqual(h2, ["## Preferences 相关键"])) {
|
|
513
|
+
report.error("preferences_section_contract", "preferences_design.md must contain exactly Preferences 相关键");
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
const stores = new Map();
|
|
517
|
+
let index = 0;
|
|
518
|
+
while (index < lines.length) {
|
|
519
|
+
const line = pyStrip(lines[index]);
|
|
520
|
+
if (line.startsWith("### ")) {
|
|
521
|
+
const name = cleanHeadingName(line.slice(4));
|
|
522
|
+
if (stores.has(name)) {
|
|
523
|
+
report.error("duplicate_preference_store", `Duplicate preference store: ${name}`);
|
|
524
|
+
}
|
|
525
|
+
const [rows, end] = parseTable(lines, index + 1, ["键", "类型", "默认值"], report, name);
|
|
526
|
+
const keys = new Map();
|
|
527
|
+
for (const [key, valueType, defaultValue] of rows) {
|
|
528
|
+
if (!key || !valueType) {
|
|
529
|
+
report.error("preference_key_required", `Preference keys and types must be non-empty in ${name}`);
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
if (keys.has(key)) {
|
|
533
|
+
report.error("duplicate_preference_key", `Duplicate preference key in ${name}: ${key}`);
|
|
534
|
+
}
|
|
535
|
+
keys.set(key, { type: valueType, default: defaultValue });
|
|
536
|
+
}
|
|
537
|
+
stores.set(name, { keys });
|
|
538
|
+
index = Math.max(index + 1, end);
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
index += 1;
|
|
542
|
+
}
|
|
543
|
+
return { stores, content };
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function normalizeTextDocument(value) {
|
|
547
|
+
const replaced = value.split("\r\n").join("\n").split("\r").join("\n");
|
|
548
|
+
return pyStrip(replaced).split("\n").map((line) => pyRstrip(line)).join("\n") + "\n";
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
function normalizeType(value) {
|
|
552
|
+
return pySubWhitespace(value, "").toUpperCase();
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function storageClass(value) {
|
|
556
|
+
// Map a recovered or documented type onto a canonical storage class.
|
|
557
|
+
//
|
|
558
|
+
// Recovery vocabularies differ by source: Kotlin/Java types from Room source
|
|
559
|
+
// entities, SQL affinity from Room exported schemas, SQL DDL types from
|
|
560
|
+
// literal CREATE TABLE statements, JS types from uniapp. The planned document
|
|
561
|
+
// naturally uses RDB storage types. Type comparison is therefore performed on
|
|
562
|
+
// storage classes rather than exact tokens. Ambiguous tokens map to UNKNOWN,
|
|
563
|
+
// which skips the comparison.
|
|
564
|
+
const normalized = pyRstripChars(normalizeType(value), "?");
|
|
565
|
+
if (UNKNOWN_TYPES.has(normalized)) {
|
|
566
|
+
return "UNKNOWN";
|
|
567
|
+
}
|
|
568
|
+
if (TEXT_TYPES.has(normalized)) {
|
|
569
|
+
return "TEXT";
|
|
570
|
+
}
|
|
571
|
+
if (INTEGER_TYPES.has(normalized)) {
|
|
572
|
+
return "INTEGER";
|
|
573
|
+
}
|
|
574
|
+
if (REAL_TYPES.has(normalized)) {
|
|
575
|
+
return "REAL";
|
|
576
|
+
}
|
|
577
|
+
if (BLOB_TYPES.has(normalized)) {
|
|
578
|
+
return "BLOB";
|
|
579
|
+
}
|
|
580
|
+
return normalized;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function normalizeKey(value) {
|
|
584
|
+
value = value.toUpperCase().replaceAll("→", "->").replaceAll("主键", "PK").replaceAll("外键", "FK");
|
|
585
|
+
return pySubWhitespace(value, "");
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function normalizeConstraint(value) {
|
|
589
|
+
value = value.toUpperCase().replaceAll("AUTOINCREMENT", "AUTO_INCREMENT");
|
|
590
|
+
value = value.replaceAll("_", " ");
|
|
591
|
+
return pyStrip(pySubWhitespace(value, " "));
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function normalizeDefault(value) {
|
|
595
|
+
return stripChars(pyStrip(pySubWhitespace(value, " ")), "`\"'");
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
function expectedSeverity(confidence) {
|
|
599
|
+
return confidence === "review_required" ? "warning" : "error";
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
function emit(report, severity, code, message, context) {
|
|
603
|
+
if (severity === "warning") {
|
|
604
|
+
report.warning(code, message, context);
|
|
605
|
+
} else {
|
|
606
|
+
report.error(code, message, context);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function compareDatabase(inspection, parsed, report) {
|
|
611
|
+
const documentDatabases = parsed.databases;
|
|
612
|
+
const expectedDatabases = new Map();
|
|
613
|
+
for (const database of pyGet(inspection, "database_schemas", [])) {
|
|
614
|
+
const name = pyStr(pyGet(database, "name", ""));
|
|
615
|
+
if (name) {
|
|
616
|
+
expectedDatabases.set(name, database);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
for (const [databaseName, database] of expectedDatabases) {
|
|
621
|
+
const confidence = pyStr(pyGet(database, "confidence", "review_required"));
|
|
622
|
+
const severity = expectedSeverity(confidence);
|
|
623
|
+
if (!documentDatabases.has(databaseName)) {
|
|
624
|
+
emit(report, severity, "database_missing_from_document", `Recovered database is missing from database_design.md: ${databaseName}`, { source_kind: pyGet(database, "source_kind", null) });
|
|
625
|
+
continue;
|
|
626
|
+
}
|
|
627
|
+
const tables = documentDatabases.get(databaseName).tables;
|
|
628
|
+
const expectedTables = new Map();
|
|
629
|
+
for (const table of pyGet(database, "tables", [])) {
|
|
630
|
+
const tableName = pyStr(pyGet(table, "name", ""));
|
|
631
|
+
if (tableName) {
|
|
632
|
+
expectedTables.set(tableName, table);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
for (const [tableName, table] of expectedTables) {
|
|
636
|
+
const tableConfidence = pyStr(pyGet(table, "confidence", confidence));
|
|
637
|
+
const tableSeverity = expectedSeverity(tableConfidence);
|
|
638
|
+
if (!tables.has(tableName)) {
|
|
639
|
+
emit(report, tableSeverity, "table_missing_from_document", `Recovered table is missing: ${databaseName}.${tableName}`, { source_path: pyGet(table, "source_path", null) });
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
const columns = tables.get(tableName).columns;
|
|
643
|
+
const expectedColumns = new Map();
|
|
644
|
+
for (const column of pyGet(table, "columns", [])) {
|
|
645
|
+
const field = pyStr(pyGet(column, "field", ""));
|
|
646
|
+
if (field) {
|
|
647
|
+
expectedColumns.set(field, column);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
for (const [field, expected] of expectedColumns) {
|
|
651
|
+
const columnConfidence = pyStr(pyGet(expected, "confidence", tableConfidence));
|
|
652
|
+
const columnSeverity = expectedSeverity(columnConfidence);
|
|
653
|
+
if (!columns.has(field)) {
|
|
654
|
+
emit(report, columnSeverity, "column_missing_from_document", `Recovered field is missing: ${databaseName}.${tableName}.${field}`, { source_path: pyGet(expected, "source_path", null) });
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
const actual = columns.get(field);
|
|
658
|
+
const expectedClass = storageClass(pyStr(pyGet(expected, "type", "")));
|
|
659
|
+
const actualClass = storageClass(pyGet(actual, "type", ""));
|
|
660
|
+
if (
|
|
661
|
+
expectedClass !== "UNKNOWN"
|
|
662
|
+
&& actualClass !== "UNKNOWN"
|
|
663
|
+
&& expectedClass !== actualClass
|
|
664
|
+
) {
|
|
665
|
+
emit(report, columnSeverity, "database_type_mismatch", `Field type differs for ${databaseName}.${tableName}.${field}`, { expected: pyGet(expected, "type", null), actual: pyGet(actual, "type", null), source_path: pyGet(expected, "source_path", null) });
|
|
666
|
+
}
|
|
667
|
+
const expectedKey = normalizeKey(pyStr(pyGet(expected, "key", "")));
|
|
668
|
+
const actualKey = normalizeKey(pyGet(actual, "key", ""));
|
|
669
|
+
if (expectedKey && !actualKey.includes(expectedKey)) {
|
|
670
|
+
emit(report, columnSeverity, "database_key_missing", `Primary/foreign key information is missing or inconsistent for ${databaseName}.${tableName}.${field}`, { expected: pyGet(expected, "key", null), actual: pyGet(actual, "key", null), source_path: pyGet(expected, "source_path", null) });
|
|
671
|
+
}
|
|
672
|
+
const actualConstraint = normalizeConstraint(pyGet(actual, "constraint", ""));
|
|
673
|
+
for (const expectedConstraint of pyGet(expected, "constraints", [])) {
|
|
674
|
+
const normalized = normalizeConstraint(pyStr(expectedConstraint));
|
|
675
|
+
if (normalized && !actualConstraint.includes(normalized)) {
|
|
676
|
+
emit(report, columnSeverity, "database_constraint_missing", `A recovered constraint is missing for ${databaseName}.${tableName}.${field}`, { expected: expectedConstraint, actual: pyGet(actual, "constraint", null), source_path: pyGet(expected, "source_path", null) });
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
for (const extraField of [...columns.keys()].filter((f) => !expectedColumns.has(f)).sort(cmpCodePoints)) {
|
|
682
|
+
report.warning(
|
|
683
|
+
"database_column_not_in_inspection",
|
|
684
|
+
`A documented field was not present in deterministic inspection and requires source review: ${databaseName}.${tableName}.${extraField}`,
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const tableColumns = pyGet(table, "columns", null);
|
|
689
|
+
if (pyTruthy(tableColumns) && ![...columns.values()].some((column) => normalizeKey(pyGet(column, "key", "")).includes("PK"))) {
|
|
690
|
+
report.warning("document_table_without_primary_key", `No primary key is documented for ${databaseName}.${tableName}; verify whether the table relies on an implicit row identifier`);
|
|
691
|
+
}
|
|
692
|
+
for (const tableConstraint of pyGet(table, "table_constraints", [])) {
|
|
693
|
+
const rawConstraint = pyStr(tableConstraint);
|
|
694
|
+
const uniqueMatch = UNIQUE_PATTERN.exec(rawConstraint);
|
|
695
|
+
if (uniqueMatch) {
|
|
696
|
+
const fields = uniqueMatch[1].split(",")
|
|
697
|
+
.filter((value) => pyStrip(value))
|
|
698
|
+
.map((value) => stripChars(pyStrip(value), "`\"[]"));
|
|
699
|
+
const missing = fields.filter(
|
|
700
|
+
(field) => !columns.has(field) || !normalizeConstraint(pyGet(columns.get(field), "constraint", "")).includes("UNIQUE"),
|
|
701
|
+
);
|
|
702
|
+
if (missing.length > 0) {
|
|
703
|
+
emit(report, tableSeverity, "table_unique_constraint_missing", `A table-level UNIQUE constraint is not represented consistently for ${databaseName}.${tableName}`, { fields, missing_fields: missing, constraint: rawConstraint });
|
|
704
|
+
}
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
const normalizedTableConstraint = normalizeConstraint(rawConstraint);
|
|
708
|
+
const represented = [...columns.values()].some(
|
|
709
|
+
(column) => pyTruthy(normalizedTableConstraint) && normalizeConstraint(pyGet(column, "constraint", "")).includes(normalizedTableConstraint),
|
|
710
|
+
);
|
|
711
|
+
if (!represented) {
|
|
712
|
+
emit(report, tableSeverity, "table_constraint_not_represented", `A table-level constraint requires explicit representation in the fixed field-level format: ${databaseName}.${tableName}`, { constraint: rawConstraint });
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
for (const extraTable of [...tables.keys()].filter((t) => !expectedTables.has(t)).sort(cmpCodePoints)) {
|
|
718
|
+
report.warning(
|
|
719
|
+
"database_table_not_in_inspection",
|
|
720
|
+
`A documented table was not present in deterministic inspection and requires source review: ${databaseName}.${extraTable}`,
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
for (const extraDatabase of [...documentDatabases.keys()].filter((d) => !expectedDatabases.has(d)).sort(cmpCodePoints)) {
|
|
726
|
+
report.warning(
|
|
727
|
+
"database_not_in_inspection",
|
|
728
|
+
`A documented database was not present in deterministic inspection and requires source review: ${extraDatabase}`,
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function comparePreferences(inspection, parsed, report) {
|
|
734
|
+
const documentStores = parsed.stores;
|
|
735
|
+
const expectedStores = new Map();
|
|
736
|
+
for (const store of pyGet(inspection, "preference_stores", [])) {
|
|
737
|
+
const name = pyStr(pyGet(store, "name", ""));
|
|
738
|
+
if (name) {
|
|
739
|
+
expectedStores.set(name, store);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
for (const [storeName, expectedStore] of expectedStores) {
|
|
743
|
+
const confidence = pyStr(pyGet(expectedStore, "confidence", "review_required"));
|
|
744
|
+
const severity = expectedSeverity(confidence);
|
|
745
|
+
if (!documentStores.has(storeName)) {
|
|
746
|
+
emit(report, severity, "preference_store_missing", `Recovered preference store is missing: ${storeName}`, { sources: pyGet(expectedStore, "sources", null) });
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
const actualKeys = documentStores.get(storeName).keys;
|
|
750
|
+
const expectedKeys = new Map();
|
|
751
|
+
for (const keyEntry of pyGet(expectedStore, "keys", [])) {
|
|
752
|
+
const keyName = pyStr(pyGet(keyEntry, "key", ""));
|
|
753
|
+
if (keyName) {
|
|
754
|
+
expectedKeys.set(keyName, keyEntry);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
for (const [keyName, expected] of expectedKeys) {
|
|
758
|
+
const keySeverity = expectedSeverity(pyStr(pyGet(expected, "confidence", confidence)));
|
|
759
|
+
if (!actualKeys.has(keyName)) {
|
|
760
|
+
emit(report, keySeverity, "preference_key_missing", `Recovered preference key is missing: ${storeName}.${keyName}`, { source_path: pyGet(expected, "source_path", null) });
|
|
761
|
+
continue;
|
|
762
|
+
}
|
|
763
|
+
const actual = actualKeys.get(keyName);
|
|
764
|
+
const expectedClass = storageClass(pyStr(pyGet(expected, "type", "")));
|
|
765
|
+
const actualClass = storageClass(pyGet(actual, "type", ""));
|
|
766
|
+
if (
|
|
767
|
+
expectedClass !== "UNKNOWN"
|
|
768
|
+
&& actualClass !== "UNKNOWN"
|
|
769
|
+
&& expectedClass !== actualClass
|
|
770
|
+
) {
|
|
771
|
+
emit(report, keySeverity, "preference_type_mismatch", `Preference type differs for ${storeName}.${keyName}`, { expected: pyGet(expected, "type", null), actual: pyGet(actual, "type", null) });
|
|
772
|
+
}
|
|
773
|
+
const rawDefault = pyGet(expected, "default", null);
|
|
774
|
+
if (rawDefault !== null) {
|
|
775
|
+
const expectedDefault = normalizeDefault(pyStr(rawDefault));
|
|
776
|
+
const actualDefault = normalizeDefault(pyGet(actual, "default", ""));
|
|
777
|
+
if (expectedDefault !== actualDefault) {
|
|
778
|
+
emit(report, keySeverity, "preference_default_mismatch", `Preference default differs for ${storeName}.${keyName}`, { expected: expectedDefault, actual: actualDefault });
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
for (const extraKey of [...actualKeys.keys()].filter((k) => !expectedKeys.has(k)).sort(cmpCodePoints)) {
|
|
783
|
+
report.warning(
|
|
784
|
+
"preference_key_not_in_inspection",
|
|
785
|
+
`A documented preference key was not present in deterministic inspection and requires source review: ${storeName}.${extraKey}`,
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
for (const extraStore of [...documentStores.keys()].filter((s) => !expectedStores.has(s)).sort(cmpCodePoints)) {
|
|
791
|
+
report.warning(
|
|
792
|
+
"preference_store_not_in_inspection",
|
|
793
|
+
`A documented preference store was not present in deterministic inspection and requires source review: ${extraStore}`,
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function validateEmptyState(parsed, expected, report, kind) {
|
|
799
|
+
const content = pyGet(parsed, "content", null);
|
|
800
|
+
if (typeof content !== "string") {
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
if (normalizeTextDocument(content) !== normalizeTextDocument(expected)) {
|
|
804
|
+
report.error(
|
|
805
|
+
`${kind}_empty_state_contract`,
|
|
806
|
+
`${kind} document must use the exact empty-state format when corresponding storage does not exist`,
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
function main() {
|
|
812
|
+
const parser = new ArgParser(
|
|
813
|
+
path.basename(process.argv[1] || "validate_data_docs.mjs"),
|
|
814
|
+
"Validate fixed-format database and preference Markdown against Android inspection facts.",
|
|
815
|
+
)
|
|
816
|
+
.addOption("--inspection", { required: true })
|
|
817
|
+
.addOption("--database-doc", { required: true })
|
|
818
|
+
.addOption("--preferences-doc", { required: true })
|
|
819
|
+
.addOption("--report", { required: true });
|
|
820
|
+
const args = parser.parse(process.argv.slice(2));
|
|
821
|
+
|
|
822
|
+
const inspectionPath = resolveLikePython(expanduser(args.inspection));
|
|
823
|
+
const inspection = loadJson(inspectionPath);
|
|
824
|
+
// Reconcile-mode signal, discovered by convention: the reconcile workflow
|
|
825
|
+
// persists its reconciliation JSONs in a sibling `reconcile/` directory
|
|
826
|
+
// next to inspection.json. Generate mode never creates it. In reconcile
|
|
827
|
+
// mode the storage contract is a superset floor: every source-recovered
|
|
828
|
+
// fact must appear in the planned document, while content beyond the
|
|
829
|
+
// source facts (existing HarmonyOS storage or a reconciled introduction)
|
|
830
|
+
// is legitimate and only recorded as an informational warning.
|
|
831
|
+
const reconcileMode = isDir(path.join(path.dirname(inspectionPath), "reconcile"));
|
|
832
|
+
const databaseDoc = resolveLikePython(expanduser(args.database_doc));
|
|
833
|
+
const preferencesDoc = resolveLikePython(expanduser(args.preferences_doc));
|
|
834
|
+
const reportPath = resolveLikePython(expanduser(args.report));
|
|
835
|
+
const report = new Report();
|
|
836
|
+
|
|
837
|
+
let storagePresence = pyGet(inspection, "storage_presence", null);
|
|
838
|
+
if (storagePresence === null || typeof storagePresence !== "object" || Array.isArray(storagePresence)) {
|
|
839
|
+
report.error("storage_presence_missing", "inspection.json must contain storage_presence");
|
|
840
|
+
storagePresence = {};
|
|
841
|
+
}
|
|
842
|
+
let databasePresent = pyGet(storagePresence, "database", null);
|
|
843
|
+
let preferencesPresent = pyGet(storagePresence, "preferences", null);
|
|
844
|
+
if (typeof databasePresent !== "boolean") {
|
|
845
|
+
report.error("database_presence_invalid", "storage_presence.database must be boolean");
|
|
846
|
+
databasePresent = pyTruthy(pyGet(inspection, "database_schemas", null));
|
|
847
|
+
}
|
|
848
|
+
if (typeof preferencesPresent !== "boolean") {
|
|
849
|
+
report.error("preferences_presence_invalid", "storage_presence.preferences must be boolean");
|
|
850
|
+
preferencesPresent = pyTruthy(pyGet(inspection, "preference_stores", null));
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
const databaseParsed = parseDatabaseDoc(databaseDoc, report);
|
|
854
|
+
const preferencesParsed = parsePreferencesDoc(preferencesDoc, report);
|
|
855
|
+
|
|
856
|
+
if (databasePresent) {
|
|
857
|
+
if (!pyTruthy(pyGet(inspection, "database_schemas", null))) {
|
|
858
|
+
report.error("database_presence_without_schema", "Database presence is true but no database schema facts are available");
|
|
859
|
+
}
|
|
860
|
+
compareDatabase(inspection, databaseParsed, report);
|
|
861
|
+
} else {
|
|
862
|
+
const hasDatabaseContent = databaseParsed.overview.size > 0 || databaseParsed.databases.size > 0;
|
|
863
|
+
if (reconcileMode) {
|
|
864
|
+
if (hasDatabaseContent) {
|
|
865
|
+
report.warning(
|
|
866
|
+
"content_beyond_source_storage",
|
|
867
|
+
"database_design.md contains content absent from source inspection; confirm it is existing HarmonyOS storage or a reconciled introduction",
|
|
868
|
+
);
|
|
869
|
+
} else {
|
|
870
|
+
validateEmptyState(databaseParsed, DATABASE_EMPTY_STATE, report, "database");
|
|
871
|
+
}
|
|
872
|
+
} else {
|
|
873
|
+
validateEmptyState(databaseParsed, DATABASE_EMPTY_STATE, report, "database");
|
|
874
|
+
if (hasDatabaseContent) {
|
|
875
|
+
report.error("invented_database_content", "database_design.md contains database content although no database storage was recovered");
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
if (preferencesPresent) {
|
|
881
|
+
if (!pyTruthy(pyGet(inspection, "preference_stores", null))) {
|
|
882
|
+
report.error("preferences_presence_without_facts", "Preferences presence is true but no preference store facts are available");
|
|
883
|
+
}
|
|
884
|
+
comparePreferences(inspection, preferencesParsed, report);
|
|
885
|
+
} else {
|
|
886
|
+
const hasPreferencesContent = preferencesParsed.stores.size > 0;
|
|
887
|
+
if (reconcileMode) {
|
|
888
|
+
if (hasPreferencesContent) {
|
|
889
|
+
report.warning(
|
|
890
|
+
"content_beyond_source_storage",
|
|
891
|
+
"preferences_design.md contains content absent from source inspection; confirm it is existing HarmonyOS storage or a reconciled introduction",
|
|
892
|
+
);
|
|
893
|
+
} else {
|
|
894
|
+
validateEmptyState(preferencesParsed, PREFERENCES_EMPTY_STATE, report, "preferences");
|
|
895
|
+
}
|
|
896
|
+
} else {
|
|
897
|
+
validateEmptyState(preferencesParsed, PREFERENCES_EMPTY_STATE, report, "preferences");
|
|
898
|
+
if (hasPreferencesContent) {
|
|
899
|
+
report.error("invented_preferences_content", "preferences_design.md contains store or key content although no key-value storage was recovered");
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
const status = report.errors.length > 0 ? "incomplete" : (report.warnings.length > 0 ? "complete_with_warnings" : "complete");
|
|
905
|
+
const payload = {
|
|
906
|
+
schema_version: "1.0",
|
|
907
|
+
validation_status: status,
|
|
908
|
+
blocking_errors: report.errors,
|
|
909
|
+
warnings: report.warnings,
|
|
910
|
+
inspection: String(inspectionPath),
|
|
911
|
+
reconcile_mode: reconcileMode,
|
|
912
|
+
storage_presence: {
|
|
913
|
+
database: databasePresent,
|
|
914
|
+
preferences: preferencesPresent,
|
|
915
|
+
},
|
|
916
|
+
documents: {
|
|
917
|
+
database: String(databaseDoc),
|
|
918
|
+
preferences: String(preferencesDoc),
|
|
919
|
+
},
|
|
920
|
+
statistics: {
|
|
921
|
+
inspection_databases: pyLen(pyGet(inspection, "database_schemas", [])),
|
|
922
|
+
document_databases: databaseParsed.databases.size,
|
|
923
|
+
inspection_preference_stores: pyLen(pyGet(inspection, "preference_stores", [])),
|
|
924
|
+
document_preference_stores: preferencesParsed.stores.size,
|
|
925
|
+
},
|
|
926
|
+
};
|
|
927
|
+
atomicWriteJson(reportPath, payload);
|
|
928
|
+
process.stdout.write(`${pyJsonDump({
|
|
929
|
+
validation_status: status,
|
|
930
|
+
report: String(reportPath),
|
|
931
|
+
errors: report.errors.length,
|
|
932
|
+
warnings: report.warnings.length,
|
|
933
|
+
}, { indent: null })}\n`);
|
|
934
|
+
return report.errors.length > 0 ? 2 : 0;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
process.exitCode = main();
|