@ohos-cpf/3rdloop 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +425 -0
- package/bin/3rdloop.mjs +48 -0
- package/lib/cli.js +741 -0
- package/lib/config.js +318 -0
- package/lib/doctor.js +114 -0
- package/lib/exit-codes.js +31 -0
- package/lib/opencode.js +156 -0
- package/lib/orch.js +427 -0
- package/lib/queries.js +264 -0
- package/lib/runner.js +979 -0
- package/lib/step.js +326 -0
- package/lib/ui.js +223 -0
- package/lib/workflow.js +291 -0
- package/lib/workflows.js +132 -0
- package/package.json +50 -0
- package/vendor/Server/Agent/SkillSelector/README.md +344 -0
- package/vendor/Server/Agent/SkillSelector/core/Agent.js +207 -0
- package/vendor/Server/Agent/SkillSelector/index.js +14 -0
- package/vendor/Server/Agent/SkillSelector/llm/llmClient.js +313 -0
- package/vendor/Server/Agent/SkillSelector/llm/prompts.js +161 -0
- package/vendor/Server/Agent/SkillSelector/llm/reactSteps.js +144 -0
- package/vendor/Server/Agent/SkillSelector/matcher/fuzzyMatcher.js +433 -0
- package/vendor/Server/Agent/SkillSelector/scanner/skillScanner.js +382 -0
- package/vendor/Server/Agent/SkillSelector/types.js +63 -0
- package/vendor/Server/Agent/SkillSelector/utils/actionWords.js +60 -0
- package/vendor/Server/Brain/AnalysisStrategies.js +422 -0
- package/vendor/Server/Brain/Brain.js +686 -0
- package/vendor/Server/Brain/DecompositionStrategies.js +621 -0
- package/vendor/Server/Brain/PlanPersistence.js +196 -0
- package/vendor/Server/Brain/SkillExecutor.js +251 -0
- package/vendor/Server/Brain/index.js +11 -0
- package/vendor/Server/CLI/cli.js +243 -0
- package/vendor/Server/CLI/opencode/index.js +804 -0
- package/vendor/Server/CLI/opencode.js +5 -0
- package/vendor/Server/DbUse/MessageArchive.js +61 -0
- package/vendor/Server/DbUse/StorageManager.js +107 -0
- package/vendor/Server/DbUse/adapters/BaseAdapter.js +94 -0
- package/vendor/Server/DbUse/adapters/FileAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonlAdapter.js +114 -0
- package/vendor/Server/DbUse/adapters/SqliteAdapter.js +157 -0
- package/vendor/Server/DbUse/index.js +160 -0
- package/vendor/Server/DbUse/stores/SessionStore.js +279 -0
- package/vendor/Server/DbUse/stores/TaskExecutionStore.js +133 -0
- package/vendor/Server/DbUse/stores/TaskRegistryStore.js +262 -0
- package/vendor/Server/DbUse/stores/TaskStepStore.js +279 -0
- package/vendor/Server/FlexRunner/FlexRunner.js +1759 -0
- package/vendor/Server/FlexRunner/index.js +12 -0
- package/vendor/Server/Knowledge/KnowledgeImporter.js +523 -0
- package/vendor/Server/Knowledge/KnowledgeManager.js +341 -0
- package/vendor/Server/Knowledge/index.js +33 -0
- package/vendor/Server/LoopEngine/LoopEngine.js +1133 -0
- package/vendor/Server/LoopEngine/index.js +11 -0
- package/vendor/Server/Orchestrator/Orchestrator.js +1425 -0
- package/vendor/Server/Orchestrator/StepNode.js +312 -0
- package/vendor/Server/Orchestrator/index.js +13 -0
- package/vendor/Server/Routes/controllers/BrainController.js +241 -0
- package/vendor/Server/Routes/controllers/FlexRunnerController.js +1125 -0
- package/vendor/Server/Routes/controllers/HealthController.js +44 -0
- package/vendor/Server/Routes/controllers/KnowledgeImportController.js +355 -0
- package/vendor/Server/Routes/controllers/LoopEngineController.js +788 -0
- package/vendor/Server/Routes/controllers/OrchestratorController.js +911 -0
- package/vendor/Server/Routes/controllers/StatsController.js +57 -0
- package/vendor/Server/Routes/controllers/StreamController.js +67 -0
- package/vendor/Server/Routes/library/logger.js +179 -0
- package/vendor/Server/Routes/library/zipArchive.js +172 -0
- package/vendor/Server/Routes/router/Router.js +204 -0
- package/vendor/Server/Routes/routes/brain.js +47 -0
- package/vendor/Server/Routes/routes/flexrunner.js +72 -0
- package/vendor/Server/Routes/routes/health.js +28 -0
- package/vendor/Server/Routes/routes/index.js +57 -0
- package/vendor/Server/Routes/routes/knowledge.js +55 -0
- package/vendor/Server/Routes/routes/loopengine.js +58 -0
- package/vendor/Server/Routes/routes/orchestrator.js +61 -0
- package/vendor/Server/Routes/routes/registry.js +98 -0
- package/vendor/Server/Routes/routes/stats.js +23 -0
- package/vendor/Server/Routes/routes/stream.js +30 -0
- package/vendor/Server/Routes/server.js +202 -0
- package/vendor/Server/Routes/sse/SseHub.js +308 -0
- package/vendor/Server/Skills/acceptance-check/SKILL.md +174 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE1_ARTIFACT_COLLECTION.md +52 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE2_CRITERIA_EVALUATION.md +77 -0
- package/vendor/Server/Skills/arkts-code-check/SKILL.md +314 -0
- package/vendor/Server/Skills/arkts-code-check/references/CODE_CHECK_GUIDE.md +160 -0
- package/vendor/Server/Skills/arkts-code-check/references/FILE_TYPE_GUIDE.md +29 -0
- package/vendor/Server/Skills/arkts-code-check/references/PHASE1_INFO_COLLECTION.md +222 -0
- package/vendor/Server/Skills/arkts-code-check/references/REPORT_TEMPLATE.md +220 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/SKILL.md +329 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-code/SKILL.md +291 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/API_SIGNATURE_CHECKS.md +68 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/BUILD_VALIDATION.md +184 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/CODE_STANDARDS.md +337 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/EXAMPLES.md +400 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/SYSTEM_API_LOOKUP.md +99 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/TEMPLATE.md +544 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-coverage/SKILL.md +174 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/SKILL.md +321 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/EXAMPLES.md +100 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/TEMPLATE.md +185 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/SKILL.md +234 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +103 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/CHECK_DIMENSIONS.md +89 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/COMPLIANCE_CHECKLIST.md +62 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/KB_QUERY_GUIDE.md +108 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/MCP_TOOL_DISCOVERY.md +124 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/REPORT_TEMPLATE.md +90 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/SCORING_FORMULA.md +57 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/arkts-library-interface-spec/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-memory-leak-check/SKILL.md +392 -0
- package/vendor/Server/Skills/arkts-library-source-clone/SKILL.md +113 -0
- package/vendor/Server/Skills/arkts-library-stability-check/SKILL.md +313 -0
- package/vendor/Server/Skills/arkts-library-stability-check/assets/REPORT_TEMPLATE.md +154 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CHECKLIST.md +166 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CODE_EXAMPLES.md +309 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/SCORING_RULES.md +90 -0
- package/vendor/Server/Skills/arkts-library-stability-check/scripts/validate-skill.cjs +282 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/SKILL.md +361 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/assets/REPORT_TEMPLATE.md +146 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/CHECKLIST.md +253 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +115 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/scripts/validate-skill.cjs +263 -0
- package/vendor/Server/Skills/arkts-library-xts-code/SKILL.md +455 -0
- package/vendor/Server/Skills/arkts-library-xts-code/assets/report-template.md +60 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/ACCESS_MODIFIER_PRECHECK.md +76 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/BUILD_VERIFICATION.md +200 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/CODE_STANDARDS.md +519 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SUBAGENT_PROMPT_TEMPLATE.md +276 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SYSTEM_API_LOOKUP.md +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/XTS_TEMPLATE.md +767 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/precheck-access-modifiers.cjs +221 -0
- package/vendor/Server/Skills/arkts-library-xts-code-fix/SKILL.md +229 -0
- package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/SKILL.md +194 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/EXAMPLES.md +576 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TEMPLATE.md +575 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TESTABILITY_GUIDE.md +182 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/SKILL.md +491 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/references/error-fixing-examples.md +217 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/flutter-code-check/SKILL.md +299 -0
- package/vendor/Server/Skills/flutter-code-check/assets/OUTPUT_TEMPLATE.md +312 -0
- package/vendor/Server/Skills/flutter-code-check/references/CHECKLIST.md +190 -0
- package/vendor/Server/Skills/flutter-code-check/references/PLATFORMS.md +134 -0
- package/vendor/Server/Skills/flutter-code-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/flutter-interface/README.md +75 -0
- package/vendor/Server/Skills/flutter-interface/SKILL.md +291 -0
- package/vendor/Server/Skills/flutter-interface/references/EXAMPLES.md +336 -0
- package/vendor/Server/Skills/flutter-interface/references/GIT_CLONE_GUIDE.md +190 -0
- package/vendor/Server/Skills/flutter-interface/references/SCRIPT_REFERENCE.md +258 -0
- package/vendor/Server/Skills/flutter-interface/references/TEMPLATE.md +254 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/SKILL.md +518 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/CHECKLIST.md +382 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +342 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/PLATFORM_LIMITATION_GUIDE.md +71 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/SKILL.md +519 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/references/CHECKLIST.md +407 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/SKILL.md +653 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/references/CHECKLIST.md +397 -0
- package/vendor/Server/Skills/flutter-library-stability-check/SKILL.md +745 -0
- package/vendor/Server/Skills/flutter-library-stability-check/references/CHECKLIST.md +721 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/SKILL.md +414 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/assets/REPORT_TEMPLATE.md +150 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/CHECKLIST.md +304 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCORING_RULES.md +265 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCRIPT_USAGE.md +286 -0
- package/vendor/Server/Skills/knowledge-import/SKILL.md +383 -0
- package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +165 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_LOCATOR_GUIDE.md +91 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_OPTIMIZATION_GUIDE.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +301 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/assets/PR_ISSUE_TEMPLATE.md +105 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/references/GITCODE_API.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/scripts/gitcode-api.cjs +208 -0
- package/vendor/Server/Skills/rn-code-check/SKILL.md +321 -0
- package/vendor/Server/Skills/rn-code-check/references/API-GUIDE.md +235 -0
- package/vendor/Server/Skills/rn-code-check/references/CHECKLIST.md +189 -0
- package/vendor/Server/Skills/rn-code-check/references/REPORT-TEMPLATE.md +247 -0
- package/vendor/Server/Skills/rn-lib-add-example/SKILL.md +198 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/APP_RENAME_GUIDE.md +40 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/SHELL_ADAPTATION_CHECKLIST.md +78 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/TEMPLATE_REPO_GUIDE.md +70 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/VERIFICATION_GUIDE.md +47 -0
- package/vendor/Server/Skills/rn-lib-add-example/scripts/create-example.cjs +252 -0
- package/vendor/Server/Skills/rn-lib-update-doc/SKILL.md +176 -0
- package/vendor/Server/Skills/rn-lib-update-doc/config.json +5 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/changelog-template.md +35 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/format-diff.md +137 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/link-registry.json +33 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2-overview.md +40 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2.md +429 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/detect-readme-format.cjs +105 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/find-usage-doc.cjs +90 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/link-verify.cjs +213 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-changelog.cjs +73 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-package-meta.cjs +258 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-readme-links.cjs +341 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/resolve-usage-docs.cjs +67 -0
- package/vendor/Server/Skills/rn-library-consistency-check/SKILL.md +299 -0
- package/vendor/Server/Skills/rn-library-consistency-check/assets/REPORT_TEMPLATE.md +293 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_COMPONENT_CHECK_GUIDE.md +857 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_TURBOMODULE_CHECK_GUIDE.md +856 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CHECKLIST.md +157 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_COMPONENT_CHECK_GUIDE.md +801 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_TURBOMODULE_CHECK_GUIDE.md +684 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +233 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/NATIVE_COMPONENT_IDENTIFICATION.md +1373 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/SCORING_STANDARD.md +220 -0
- package/vendor/Server/Skills/rn-library-consistency-check/scripts/validate-skill.py +245 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL.md +414 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL_en.md +413 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +311 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CHECK_CHECKLIST.md +355 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CROSS_VALIDATION_GUIDE.md +115 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/DOC_COLLECTION_GUIDE.md +139 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/EXAMPLES.md +586 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/GOTCHAS.md +57 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/scripts/validate-skill.py +259 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/SKILL.md +301 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/assets/REPORT_TEMPLATE.md +148 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/DOC_ANNOTATION_GUIDE.md +118 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/SCRIPT_USAGE_GUIDE.md +168 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/URL_PARSING_RULES.md +176 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +274 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/case-template.md +45 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/rule-template.md +25 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/PR_FETCH_GUIDE.md +61 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/RULE_TEMPLATE_GUIDE.md +165 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/scripts/fetch-pr-info.py +239 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/assets/REPORT_TEMPLATE.md +96 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/COMPLIANCE_CHECKLIST.md +58 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/INSPECTION_GUIDE.md +99 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/PRESCREEN_GUIDE.md +64 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/SOURCE_PREP_GUIDE.md +75 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/scripts/validate-known-issue-report.py +164 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/SKILL.md +339 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/assets/REPORT_TEMPLATE.md +83 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/CHECKLIST.md +859 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/HARMONY_CODE_PATTERNS.md +122 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/scripts/scan_harmony_code.py +279 -0
- package/vendor/Server/Skills/rn-library-stability-check/SKILL.md +273 -0
- package/vendor/Server/Skills/rn-library-stability-check/assets/REPORT_TEMPLATE.md +129 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/CHECKLIST.md +581 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/SCORING_RULES.md +138 -0
- package/vendor/Server/Skills/rn-library-stability-check/scripts/scan-harmony-code.py +168 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/SKILL.md +506 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/CHECKLIST.md +280 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/DEMO_LOCATION.md +221 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/REPORT_TEMPLATE.md +209 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/SCRIPT_USAGE.md +325 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/SKILL.md +279 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/assets/TEST_FILE_TEMPLATES.md +404 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_TROUBLESHOOTING.md +185 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_WORKFLOW.md +265 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COMMON_CONFIG.md +189 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/CONFIG_GUIDE.md +203 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COVERAGE_ANALYZER.md +147 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/DESIGN_DOC_GUIDE.md +148 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_FLOW.md +165 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_STRATEGY.md +195 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/HARMONY_SCANNER.md +249 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/JEST_FRAMEWORK.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/PLATFORM_COMPAT.md +161 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/RN_TEST_PATTERNS.md +413 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/SOURCE_PARSER.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TEST_CONVENTIONS.md +245 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TROUBLESHOOTING.md +282 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/USAGE_GUIDE.md +251 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/SKILL.md +469 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/CPTF_TEST_TEMPLATE.md +310 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/DEMO_PAGE_TEMPLATE.md +303 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/CPTF_TEST_GENERATION_GUIDE.md +421 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/DEMO_GENERATION_GUIDE.md +358 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/QUALITY_CHECKLIST.md +114 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/SPEC_PARSING_GUIDE.md +274 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/scripts/validate-rnoh-cptf-api-test.sh +185 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/SKILL.md +191 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/assets/TEST_TEMPLATE.md +216 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/CPTF_SETUP.md +107 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/DEMO_ANALYSIS.md +120 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/scripts/validate-rnoh-cptf-test.sh +108 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/SKILL.md +237 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/references/DEBUG_PLAYBOOK.md +261 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/scripts/validate-run-env.sh +112 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/SKILL.md +498 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/adapt-checklist.md +270 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/api-migration-checklist.md +164 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/common-compile-errors.md +556 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/deveco-cli-tools.md +459 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/edge-cases.md +65 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/har-tgz-build.md +512 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/version-compat-matrix.md +132 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/scripts/auto-integrate.sh +424 -0
- package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/SKILL.md +306 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/DEMO_PAGE_TEMPLATE.md +485 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/INDEX_TEMPLATE.md +172 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/DEMO_CODE_RULES.md +422 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/QUALITY_CHECKLIST.md +95 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/SOURCE_EXPLORATION.md +169 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/SKILL.md +554 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/assets/DEMO_DOC_TEMPLATE.md +106 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/COVERAGE_INCREMENTAL.md +216 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/DEMO_DESIGN_RULES.md +413 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/OUTPUT_FORMAT.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/QUALITY_CHECKLIST.md +98 -0
- package/vendor/Server/Skills/rnoh-lib-func-test/SKILL.md +337 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/SKILL.md +722 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/assets/PORT_REPORT_TEMPLATE.md +219 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/DEMO_PORTING_GUIDE.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/PORT_VERIFICATION.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/RNT_PROJECT_STRUCTURE.md +173 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/analyze-demo-deps.cjs +267 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/detect-rnoh-version.cjs +174 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/find-rnt-demo.sh +111 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/port-demo.sh +186 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/read-lib-meta.cjs +150 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/SKILL.md +296 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/jest-troubleshooting.md +371 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +212 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/runtime-troubleshooting.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/unit-test-template.md +223 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/scripts/port-test-demo.sh +1053 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/SKILL.md +255 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_ADAPTATION.md +77 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_API_LOOKUP.md +224 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/script-reference.md +174 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/detect-upstream-version.js +967 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/generate-diff.js +1798 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/package.json +5 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/templates/report-template.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +145 -0
- package/vendor/Server/Skills/skill-generator/SKILL.md +365 -0
- package/vendor/Server/Skills/skill-generator/assets/SKILL_TEMPLATE.md +183 -0
- package/vendor/Server/Skills/skill-generator/references/COMPLIANCE_CHECKLIST.md +82 -0
- package/vendor/Server/Skills/skill-generator/references/KB_QUERY_GUIDE.md +110 -0
- package/vendor/Server/Skills/skill-generator/references/MCP_TOOL_DISCOVERY.md +122 -0
- package/vendor/Server/Skills/skill-generator/references/SKILL_SPEC.md +121 -0
- package/vendor/Server/Skills/skill-generator/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/task-analysis/SKILL.md +234 -0
- package/vendor/Server/Skills/task-analysis/assets/OUTPUT_EXAMPLES.md +160 -0
- package/vendor/Server/Skills/task-analysis/references/ACCEPTANCE_CRITERIA_GUIDE.md +190 -0
- package/vendor/Server/Skills/task-analysis/references/ANALYSIS_SCHEMA.md +224 -0
- package/vendor/Server/Skills/task-analysis/references/INTEGRATION_CONTEXT.md +162 -0
- package/vendor/Server/Skills/task-analysis/references/LESSONS_LEARNED.md +55 -0
- package/vendor/Server/Skills/task-analysis/references/REPLAN_CONTEXT_GUIDE.md +126 -0
- package/vendor/Server/Skills/task-analysis/scripts/validate-analysis-output.sh +256 -0
- package/vendor/Server/Skills/task-decomposition/SKILL.md +529 -0
- package/vendor/Server/Skills/task-decomposition/assets/OUTPUT_EXAMPLES.md +451 -0
- package/vendor/Server/Skills/task-decomposition/references/ACCEPTANCE_CRITERIA_GUIDE.md +179 -0
- package/vendor/Server/Skills/task-decomposition/references/DEPENDENCY_GRAPH_GUIDE.md +152 -0
- package/vendor/Server/Skills/task-decomposition/references/INTEGRATION_CONTEXT.md +175 -0
- package/vendor/Server/Skills/task-decomposition/references/REPLAN_CONTEXT_GUIDE.md +195 -0
- package/vendor/Server/Skills/task-decomposition/references/TASK_DECOMPOSITION_TEMPLATES.md +226 -0
- package/vendor/Server/Skills/task-decomposition/scripts/list-available-skills.cjs +263 -0
- package/vendor/Server/Skills/task-decomposition/scripts/skill-blacklist.json +29 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-decomposition-output.cjs +376 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-param-consistency.cjs +259 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-specified-skills.cjs +216 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-step-graph.cjs +425 -0
- package/vendor/Server/Skills/tpc-cpp-check/SKILL.md +427 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/CHECKLIST.md +214 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/HPKBUILD_GUIDE.md +235 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/REPORT_TEMPLATE.md +250 -0
- package/vendor/Server/TestCheck/TestCheck.js +775 -0
- package/vendor/Server/TestCheck/index.js +11 -0
- package/vendor/Server/library/McpToolGuide.js +280 -0
- package/vendor/Server/library/StatsService.js +127 -0
- package/vendor/Server/library/cstTime.js +16 -0
- package/vendor/Server/package.json +17 -0
- package/vendor/VERSION +3 -0
- package/workflows/pr-check.mjs +106 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
# Flutter 一致性检视清单
|
|
2
|
+
|
|
3
|
+
本文档列出 Flutter 三方库鸿蒙化代码一致性检视的详细检查项,供检视人员参考。
|
|
4
|
+
|
|
5
|
+
> ⚠️ **核心定位**:本清单**仅检查 ohos 目录下的代码与 Android/iOS 实现的一致性**,不关注 Flutter Dart 层或非鸿蒙化部分的代码。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 0. 代码定位与范围识别
|
|
10
|
+
|
|
11
|
+
### 0.1 鸿蒙化目录检查
|
|
12
|
+
|
|
13
|
+
| 检查项 | 检查内容 | 结果判定 | 处理方式 |
|
|
14
|
+
|--------|----------|----------|----------|
|
|
15
|
+
| `ohos/` 目录存在性 | 是否存在鸿蒙化目录 | 不存在 → 0 分 | 报告标注"未实现鸿蒙化" |
|
|
16
|
+
| `ohos/ets/` 文件数 | ArkTS/ETS 代码文件数量 | 为空 → 0 分 | 报告标注"鸿蒙化代码缺失" |
|
|
17
|
+
| `ohos/src/` 文件数 | C++ Native 代码文件数量 | 为空可接受 | 仅检视 ETS 层 |
|
|
18
|
+
| `android/` 目录存在性 | 是否有 Android 参考实现 | 缺失 → 标注 | "缺少对比参考实现" |
|
|
19
|
+
| `ios/` 目录存在性 | 是否有 iOS 参考实现 | 缺失 → 标注 | "缺少对比参考实现" |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 1. API 契约一致性检查
|
|
24
|
+
|
|
25
|
+
### 1.1 方法签名一致性(15分)
|
|
26
|
+
|
|
27
|
+
| 检查项 | 对比对象 | 扣分规则 | 致命度 |
|
|
28
|
+
|--------|----------|----------|--------|
|
|
29
|
+
| 方法名称匹配 | Dart MethodChannel 名称 vs ArkTS 方法名 | 不匹配扣 5 分 | 中等 |
|
|
30
|
+
| 参数数量匹配 | Dart 调用参数数量 vs ArkTS 接收参数数量 | **不匹配扣 8 分** | 致命 |
|
|
31
|
+
| 参数顺序一致 | 参数位置是否完全对应 | 顺序错误扣 6 分 | 严重 |
|
|
32
|
+
| 方法存在性 | Dart 接口方法是否在 OHOS 实现 | **缺失扣 10 分** | 致命 |
|
|
33
|
+
| Stub 方法检测 | OHOS 方法是否返回固定值无操作 | **stub 扣 8 分** | 致命 |
|
|
34
|
+
| 错误返回检测 | OHOS 方法是否返回错误而非实现 | **返回错误扣 10 分** | 致命 |
|
|
35
|
+
|
|
36
|
+
**Stub 方法识别特征**:
|
|
37
|
+
- 方法体仅有 return 语句,返回固定值
|
|
38
|
+
- 未调用任何 @ohos 模块 API
|
|
39
|
+
- 未执行实际业务操作
|
|
40
|
+
|
|
41
|
+
**错误返回识别特征**:
|
|
42
|
+
- 返回 `{error: "not supported"}` 等错误对象
|
|
43
|
+
- 返回字符串错误消息而非期望类型
|
|
44
|
+
- 功能明确未实现
|
|
45
|
+
|
|
46
|
+
### 1.2 参数类型一致性(20分)⚠️ 最易出错维度
|
|
47
|
+
|
|
48
|
+
| 检查项 | Dart 类型 | ArkTS 解析类型 | 扣分规则 | 致命度 |
|
|
49
|
+
|--------|-----------|---------------|----------|--------|
|
|
50
|
+
| boolean 解析 | bool | boolean | **解析为 string 扣 15 分** | 致命 |
|
|
51
|
+
| integer 解析 | int | number | 精度丢失扣 5 分 | 中等 |
|
|
52
|
+
| double 解析 | double | number | 精度丢失扣 3 分 | 轻微 |
|
|
53
|
+
| String 解析 | String | string | 编码问题扣 2 分 | 轻微 |
|
|
54
|
+
| List 解析 | List<T> | Array<T> | 元素类型不一致扣 8 分 | 严重 |
|
|
55
|
+
| Map 解析 | Map<K,V> | Record/Object | 键值类型不一致扣 8 分 | 严重 |
|
|
56
|
+
| Uint8List 解析 | Uint8List | ArrayBuffer | 字节序问题扣 5 分 | 中等 |
|
|
57
|
+
| 空值处理 | T? | T \| null | 不处理 null 扣 8 分 | 严重 |
|
|
58
|
+
|
|
59
|
+
**致命类型错误示例**:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// ❌ 致命:boolean 被解析为 string
|
|
63
|
+
// Dart: setNotifyValue(force_indications: bool)
|
|
64
|
+
// OHOS:
|
|
65
|
+
const force_indications = call.arguments['force_indications'] as string;
|
|
66
|
+
// 结果:string "false" 在条件判断中仍为 truthy,功能完全失效!
|
|
67
|
+
|
|
68
|
+
// ✅ 正确:
|
|
69
|
+
const force_indications = call.arguments['force_indications'] as boolean;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**类型映射完整对照表**:
|
|
73
|
+
|
|
74
|
+
| Dart 类型 | ArkTS 类型 | as 语句 | 常见错误 | 风险 |
|
|
75
|
+
|-----------|------------|---------|----------|------|
|
|
76
|
+
| bool | boolean | `as boolean` | `as string` → 功能失效 | **致命** |
|
|
77
|
+
| int | number | `as number` | 超出 int64 范围 | 高 |
|
|
78
|
+
| double | number | `as number` | 精度丢失 | 中 |
|
|
79
|
+
| String | string | `as string` | UTF-8 编码 | 低 |
|
|
80
|
+
| List<int> | number[] | `as number[]` | 元素类型混入 string | 高 |
|
|
81
|
+
| List<String> | string[] | `as string[]` | 正确 | 低 |
|
|
82
|
+
| Map<String, dynamic> | Record<string, Object> | `as Record<string, Object>` | 键类型不一致 | 高 |
|
|
83
|
+
| Uint8List | ArrayBuffer | 无需 as | 字节序、长度 | 中 |
|
|
84
|
+
|
|
85
|
+
### 1.3 返回值类型一致性(15分)
|
|
86
|
+
|
|
87
|
+
| 检查项 | 期望类型 | 实际返回 | 扣分规则 | 致命度 |
|
|
88
|
+
|--------|----------|----------|----------|--------|
|
|
89
|
+
| 返回值类型匹配 | Dart 期望类型 | OHOS 实际返回 | **类型错误扣 10 分** | 致命 |
|
|
90
|
+
| 返回值语义一致 | 接口定义语义 | 返回内容语义 | **语义错误扣 8 分** | 致命 |
|
|
91
|
+
| void 返回处理 | void | 无返回或 null | 不正确扣 5 分 | 中等 |
|
|
92
|
+
| 成功指示返回 | bool/void 成功 | boolean 或空 | 格式错误扣 6 分 | 严重 |
|
|
93
|
+
| 错误返回格式 | PlatformException 格式 | OHOS 错误对象 | 格式不标准扣 4 分 | 中等 |
|
|
94
|
+
|
|
95
|
+
**致命返回值错误示例**:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// Dart: Future<void> setOptions(BluetoothOptions options)
|
|
99
|
+
// ❌ 致命:返回设备列表而非 void
|
|
100
|
+
return mConnectedDevices; // 返回 Map 类型,语义完全错误
|
|
101
|
+
|
|
102
|
+
// ✅ 正确:
|
|
103
|
+
return; // 或 return true 表示成功
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 1.4 异常传播一致性(10分)
|
|
107
|
+
|
|
108
|
+
| 检查项 | 检查内容 | 扣分规则 | 致命度 |
|
|
109
|
+
|--------|----------|----------|--------|
|
|
110
|
+
| 异常类型映射 | PlatformException 类型 | 不映射扣 6 分 | 严重 |
|
|
111
|
+
| 错误码一致性 | Android/iOS/OHOS 错误码对比 | 不一致扣 5 分 | 中等 |
|
|
112
|
+
| 错误消息详细度 | 错误描述信息量对比 | 缺少诊断扣 4 分 | 中等 |
|
|
113
|
+
| 错误码硬编码 | 是否固定值而非实际状态 | **硬编码扣 8 分** | 致命 |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 2. 平台实现一致性检查
|
|
118
|
+
|
|
119
|
+
### 2.1 Android vs OHOS 功能对比(25分)⚠️ 核心维度
|
|
120
|
+
|
|
121
|
+
| 功能类别 | 检查项 | 扣分规则 | 致命度 |
|
|
122
|
+
|----------|--------|----------|--------|
|
|
123
|
+
| 核心功能缺失 | Android 有但 OHOS 无(适配缺陷) | **缺失扣 15 分** | 致命 |
|
|
124
|
+
| 🔶 核心功能缺失 | Android 有但 OHOS 无(平台限制,鸿蒙无对应 API 且无替代路径) | **0 分(不扣分)** | 豁免 |
|
|
125
|
+
| 功能行为不一致 | 同一功能行为差异 | **行为不一致扣 12 分** | 致命 |
|
|
126
|
+
| 边界处理不一致 | 边界情况处理差异 | 不一致扣 8 分 | 严重 |
|
|
127
|
+
| 错误处理不一致 | 同一错误处理差异 | 不一致扣 6 分 | 中等 |
|
|
128
|
+
| 默认值不一致 | 配置默认值差异 | 不一致扣 4 分 | 轻微 |
|
|
129
|
+
|
|
130
|
+
> 🔶 **平台限制判定规则**:详见 [PLATFORM_LIMITATION_GUIDE.md](PLATFORM_LIMITATION_GUIDE.md)。确认无法鸿蒙化的接口直接不扣分,无需检查文档化状态。
|
|
131
|
+
|
|
132
|
+
**功能对比检查流程**:
|
|
133
|
+
|
|
134
|
+
1. **提取 Android 方法列表**:
|
|
135
|
+
- 扫描 `android/src/main/java/` 或 `kotlin/` 目录
|
|
136
|
+
- 提取所有公开方法(public/override)
|
|
137
|
+
|
|
138
|
+
2. **逐一对比 OHOS 实现**:
|
|
139
|
+
- 检查 OHOS 是否有同名方法
|
|
140
|
+
- 检查方法是否为 stub(无实际操作)
|
|
141
|
+
- 检查方法是否返回错误消息
|
|
142
|
+
|
|
143
|
+
3. **行为对比**:
|
|
144
|
+
- 对比核心功能调用链
|
|
145
|
+
- 检查参数处理逻辑
|
|
146
|
+
- 检查返回结果格式
|
|
147
|
+
|
|
148
|
+
**Stub 方法检测清单**:
|
|
149
|
+
|
|
150
|
+
| 检测特征 | 说明 | 扣分 |
|
|
151
|
+
|----------|------|------|
|
|
152
|
+
| 仅 return 固定值 | 如 `return true;` 无其他语句 | -8 分 |
|
|
153
|
+
| 未调用 @ohos API | 未使用鸿蒙系统 API | -8 分 |
|
|
154
|
+
| 未执行业务操作 | 无实际功能逻辑 | -8 分 |
|
|
155
|
+
| 方法体为空 | 仅检查连接状态后返回 | -8 分 |
|
|
156
|
+
|
|
157
|
+
**常见功能缺失项**:
|
|
158
|
+
|
|
159
|
+
| 功能类型 | 常见缺失 | 扣分 |
|
|
160
|
+
|----------|----------|------|
|
|
161
|
+
| 设备管理 | removeBond、clearGattCache | 各 -15 分 |
|
|
162
|
+
| 适配器管理 | getAdapterName、turnOff | 各 -15 分 |
|
|
163
|
+
| 连接管理 | requestConnectionPriority | -12 分 |
|
|
164
|
+
| 特征操作 | 缺少流控检查 | -8 分 |
|
|
165
|
+
|
|
166
|
+
### 2.2 iOS vs OHOS 功能对比(15分)
|
|
167
|
+
|
|
168
|
+
| 功能类别 | 检查项 | 扣分规则 | 致命度 |
|
|
169
|
+
|----------|--------|----------|--------|
|
|
170
|
+
| 核心功能缺失 | iOS 有但 OHOS 无(排除平台限制) | **缺失扣 12 分** | 严重 |
|
|
171
|
+
| 平台限制一致 | OHOS 是否有与 iOS 类似限制 | 不一致扣 5 分 | 中等 |
|
|
172
|
+
| 行为一致性 | 同一功能行为对比 | 不一致扣 8 分 | 严重 |
|
|
173
|
+
|
|
174
|
+
**iOS 平台限制注意事项**:
|
|
175
|
+
- MTU 协商:iOS 自动协商,无法主动请求
|
|
176
|
+
- 绑定操作:iOS 有系统限制
|
|
177
|
+
- 扫描过滤:iOS 需客户端过滤
|
|
178
|
+
|
|
179
|
+
### 2.3 平台差异处理(10分)
|
|
180
|
+
|
|
181
|
+
| 检查项 | 检查内容 | 扣分规则 | 致命度 |
|
|
182
|
+
|--------|----------|----------|--------|
|
|
183
|
+
| OHOS 限制标注 | OHOS 特有限制是否文档化 | 未标注扣 5 分 | 中等 |
|
|
184
|
+
| 平台检测机制 | 是否有 Platform.isOHOS 检测 | 缺失扣 4 分 | 中等 |
|
|
185
|
+
| 条件分支正确 | 平台特定逻辑分支 | 错误扣 6 分 | 严重 |
|
|
186
|
+
| 平台差异文档 | 是否有 README 说明差异 | 未文档化扣 3 分 | 轻微 |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 3. 命名一致性检查(15分)⚠️ 降低权重
|
|
191
|
+
|
|
192
|
+
### 3.1 命名规范(10分)
|
|
193
|
+
|
|
194
|
+
| 检查项 | Dart 规范 | ArkTS 规范 | 扣分规则 | 致命度 |
|
|
195
|
+
|--------|-----------|------------|----------|--------|
|
|
196
|
+
| 类名 PascalCase | ✅ PascalCase | ✅ PascalCase | 不规范扣 2 分 | 轻微 |
|
|
197
|
+
| 方法名 camelCase | ✅ 动词开头 | ✅ 动词开头 | **大写开头扣 3 分** | 轻微 |
|
|
198
|
+
| 参数名 camelCase | ✅ 语义明确 | ✅ 语义明确 | 不规范扣 1 分 | 轻微 |
|
|
199
|
+
| 私有成员前缀 | _camelCase | #camelCase 或 mCamelCase | **不一致扣 2 分** | 轻微 |
|
|
200
|
+
| 常量命名 | lowerCamelCase | const UPPER_CASE | 不统一扣 1 分 | 轻微 |
|
|
201
|
+
|
|
202
|
+
**常见命名问题**:
|
|
203
|
+
|
|
204
|
+
| 问题 | 示例 | 标准 | 扣分 |
|
|
205
|
+
|------|------|------|------|
|
|
206
|
+
| 方法名大写开头 | `ConnectStateChanged` | `connectStateChanged` | -3 |
|
|
207
|
+
| 私有成员前缀混用 | `mConnectedDevices` vs `channel` | 统一使用 `m` 或无前缀 | -2 |
|
|
208
|
+
| 回调方法大写 | `OnDiscoveredServices` | `onDiscoveredServices` | -3 |
|
|
209
|
+
|
|
210
|
+
### 3.2 术语一致性(5分)
|
|
211
|
+
|
|
212
|
+
| 检查项 | 检查内容 | 扣分规则 | 致命度 |
|
|
213
|
+
|--------|----------|----------|--------|
|
|
214
|
+
| 概念命名统一 | 同一概念所有平台相同名称 | 不一致扣 2 分 | 轻微 |
|
|
215
|
+
| 缩写一致 | URL/ID/UUID 等缩写格式 | 不一致扣 1 分 | 轻微 |
|
|
216
|
+
| 消息字段名 | MethodChannel 消息字段 | 不一致扣 2 分 | 轻微 |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 4. 评分规则汇总
|
|
221
|
+
|
|
222
|
+
### 4.1 严苛扣分制
|
|
223
|
+
|
|
224
|
+
采用**严苛扣分制**,从 100 分开始扣减:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
初始分数:100 分
|
|
228
|
+
|
|
229
|
+
扣分类型与标准值:
|
|
230
|
+
├── 致命问题:-15 分(最多扣 60 分)
|
|
231
|
+
│ ├── 参数类型致命错误(bool → string 等)............. -15
|
|
232
|
+
│ ├── OHOS 方法缺失(适配缺陷,非平台限制)............ -15
|
|
233
|
+
│ ├── OHOS 方法为 stub(适配缺陷,非平台限制)......... -8
|
|
234
|
+
│ ├── OHOS 方法返回错误而非实现......................... -10
|
|
235
|
+
│ ├── 返回值类型/语义完全错误........................... -10
|
|
236
|
+
│ ├── 功能行为致命不一致............................... -15
|
|
237
|
+
│ └── 错误码硬编码固定值............................... -8
|
|
238
|
+
│
|
|
239
|
+
│ 🔶 平台限制豁免(不扣分):
|
|
240
|
+
│ ├── OHOS 方法缺失(鸿蒙无对应系统 API 且无替代路径).. 0/函数
|
|
241
|
+
│ └── OHOS 方法为 stub(因平台限制无法实现).......... 0/函数
|
|
242
|
+
│
|
|
243
|
+
├── 严重问题:-12 分
|
|
244
|
+
│ ├── 功能行为严重不一致............................... -12
|
|
245
|
+
│ ├── 异常传播不完整................................... -6
|
|
246
|
+
│ ├── 核心功能部分缺失................................. -12
|
|
247
|
+
│ ├── 参数数量不匹配................................... -8
|
|
248
|
+
│ └── 返回值格式不标准................................. -6
|
|
249
|
+
│
|
|
250
|
+
├── 中等问题:-8 分
|
|
251
|
+
│ ├── 边界处理不一致................................... -8
|
|
252
|
+
│ ├── 错误消息缺少诊断信息............................. -4
|
|
253
|
+
│ ├── 类型精度丢失..................................... -5
|
|
254
|
+
│ └── 空值处理不完整................................... -8
|
|
255
|
+
│
|
|
256
|
+
├── 轻微问题:-3 分
|
|
257
|
+
│ ├── 命名不规范....................................... -3
|
|
258
|
+
│ ├── 术语不一致....................................... -2
|
|
259
|
+
│ ├── 私有成员前缀不统一............................... -2
|
|
260
|
+
│ └── 文档化不足....................................... -3
|
|
261
|
+
|
|
262
|
+
特殊规则:
|
|
263
|
+
├── 不存在 ohos 目录 → 0 分
|
|
264
|
+
├── ohos 目录无代码 → 0 分
|
|
265
|
+
├── 致命问题 ≥ 4 个 → 0 分
|
|
266
|
+
├── 致命问题 ≥ 3 个 + 严重问题 ≥ 2 个 → 0 分
|
|
267
|
+
├── 累计扣分超过 60 分 → 0 分
|
|
268
|
+
|
|
269
|
+
最低分数:0 分
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### 4.2 扣分示例计算
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
示例库评分计算:
|
|
276
|
+
|
|
277
|
+
初始分数:100
|
|
278
|
+
|
|
279
|
+
致命问题:
|
|
280
|
+
├── force_indications 参数类型错误(bool → string)... -15
|
|
281
|
+
├── removeBond 为 stub 方法............................ -8
|
|
282
|
+
├── getAdapterName 返回错误............................ -10
|
|
283
|
+
└── 3 个致命问题累计 -33 分
|
|
284
|
+
|
|
285
|
+
严重问题:
|
|
286
|
+
├── disconnect reason 硬编码........................... -8
|
|
287
|
+
├── clearGattCache 🔶 平台限制(鸿蒙无 GATT 缓存 API).. 0
|
|
288
|
+
├── requestConnectionPriority 🔶 平台限制(鸿蒙无此 API).. 0
|
|
289
|
+
└── 1 个严重问题累计 -8 分
|
|
290
|
+
|
|
291
|
+
中等问题:
|
|
292
|
+
├── 边界处理不一致................................... -8
|
|
293
|
+
├── 错误消息缺少诊断................................. -4
|
|
294
|
+
└── 2 个中等问题累计 -12 分
|
|
295
|
+
|
|
296
|
+
轻微问题:
|
|
297
|
+
├── 方法名大写开头................................... -3
|
|
298
|
+
├── 私有成员前缀不一致............................... -2
|
|
299
|
+
└── 2 个轻微问题累计 -5 分
|
|
300
|
+
|
|
301
|
+
总扣分:33 + 8 + 12 + 5 = 58 分
|
|
302
|
+
最终得分:100 - 58 = 42 分
|
|
303
|
+
|
|
304
|
+
(🔶 平台限制 2 项不扣分:clearGattCache、requestConnectionPriority)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 5. 检视流程清单
|
|
310
|
+
|
|
311
|
+
### 5.1 前置准备
|
|
312
|
+
|
|
313
|
+
| 步骤 | 操作 | 输出 |
|
|
314
|
+
|------|------|------|
|
|
315
|
+
| 1 | 检查 `ohos/` 目录存在性 | 目录状态判定 |
|
|
316
|
+
| 2 | 扫描 `ohos/ets/` 文件列表 | ETS 文件清单 |
|
|
317
|
+
| 3 | 扫描 `android/src/` 文件列表 | Android 方法清单 |
|
|
318
|
+
| 4 | 扫描 `ios/Classes/` 文件列表 | iOS 方法清单 |
|
|
319
|
+
| 5 | 读取 `接口规格说明.md` | API 接口定义 |
|
|
320
|
+
|
|
321
|
+
### 5.2 API 契约检查流程
|
|
322
|
+
|
|
323
|
+
| 步骤 | 检查项 | 记录内容 |
|
|
324
|
+
|------|--------|----------|
|
|
325
|
+
| 1 | 提取 OHOS 公开方法列表 | 方法名、参数、返回值 |
|
|
326
|
+
| 2 | 对比 Dart 接口定义 | 方法签名一致性 |
|
|
327
|
+
| 3 | 检查参数类型解析语句 | 类型映射正确性 |
|
|
328
|
+
| 4 | 检查返回值类型 | 返回值语义正确性 |
|
|
329
|
+
| 5 | 检查异常处理流程 | 异常传播完整性 |
|
|
330
|
+
|
|
331
|
+
### 5.3 功能对比检查流程
|
|
332
|
+
|
|
333
|
+
| 步骤 | 检查项 | 记录内容 |
|
|
334
|
+
|------|--------|----------|
|
|
335
|
+
| 1 | 提取 Android 公开方法列表 | 全部功能清单 |
|
|
336
|
+
| 2 | 逐一检查 OHOS 实现 | 实现状态、是否 stub |
|
|
337
|
+
| 3 | 对比核心功能调用链 | 行为一致性 |
|
|
338
|
+
| 4 | 检查边界情况处理 | 边界处理一致性 |
|
|
339
|
+
| 5 | 检查错误码映射 | 错误码一致性 |
|
|
340
|
+
|
|
341
|
+
### 5.4 报告生成检查
|
|
342
|
+
|
|
343
|
+
| 步骤 | 检查项 | 要求 |
|
|
344
|
+
|------|--------|------|
|
|
345
|
+
| 1 | 评分格式 | `**综合评分:XX/100**`(中文冒号) |
|
|
346
|
+
| 2 | 扣分明细 | 每项扣分需有文件位置、代码片段 |
|
|
347
|
+
| 3 | 功能对比表 | Android/iOS/OHOS 三列对比 |
|
|
348
|
+
| 4 | 修复建议 | P0/P1/P2 优先级分类 |
|
|
349
|
+
| 5 | 检视范围标注 | 明确标注检视和非检视目录 |
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## 附录:常见问题速查
|
|
354
|
+
|
|
355
|
+
### A. 参数类型错误速查
|
|
356
|
+
|
|
357
|
+
| 错误类型 | 检测方法 | 典型代码 | 修复方案 |
|
|
358
|
+
|----------|----------|----------|----------|
|
|
359
|
+
| bool → string | 搜索 `as string` 参数解析 | `call.arguments['xxx'] as string` | 改为 `as boolean` |
|
|
360
|
+
| int → string | 搜索 `as string` 数值解析 | `call.arguments['count'] as string` | 改为 `as number` |
|
|
361
|
+
| List 类型混入 | 检查数组元素类型 | `as string[]` 但有 int 元素 | 使用 `as Object[]` |
|
|
362
|
+
|
|
363
|
+
### B. Stub 方法速查
|
|
364
|
+
|
|
365
|
+
| Stub 类型 | 检测特征 | 示例 | 正确实现 |
|
|
366
|
+
|-----------|----------|------|----------|
|
|
367
|
+
| 返回固定 true | `return true;` 无其他语句 | `async method() { return true; }` | 调用实际 API |
|
|
368
|
+
| 仅检查连接 | 仅 `if (!connected) return false; return true;` | 缺少实际操作 | 添加业务逻辑 |
|
|
369
|
+
| 返回错误消息 | 返回 `{error: "xxx"}` | `return {error: "not supported"}` | 实现或抛异常 |
|
|
370
|
+
|
|
371
|
+
### C. 硬编码错误码速查
|
|
372
|
+
|
|
373
|
+
| 错误类型 | 检测方法 | 典型代码 | 修复方案 |
|
|
374
|
+
|----------|----------|----------|----------|
|
|
375
|
+
| disconnect reason 固定 | 搜索 `code: 1` 或类似 | `{code: 1, reason: "xxx"}` | 传递实际状态码 |
|
|
376
|
+
| 错误码固定值 | 搜索 `errorCode: X` | `errorCode: 100` | 使用系统错误码 |
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
**文档版本**:v2.0
|
|
381
|
+
**更新时间**:2026-05-18
|
|
382
|
+
**适用范围**:Flutter 三方库鸿蒙化一致性检视
|