@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,239 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# @tool fetch-pr-info
|
|
3
|
+
# @description 获取 GitCode PR 元数据与 diff,生成可读摘要材料(rn-library-issue-generalizer 专用)
|
|
4
|
+
# @param prUrl: string - GitCode PR 地址,https://gitcode.com/{owner}/{repo}/pull/{number}
|
|
5
|
+
# @param outputDir: string - 输出目录绝对路径,材料写入 {outputDir}/pr-info/
|
|
6
|
+
# @param token: string - 可选,GitCode API Token(私有仓库/限流时使用)
|
|
7
|
+
|
|
8
|
+
"""fetch-pr-info.py — GitCode PR 材料获取脚本
|
|
9
|
+
|
|
10
|
+
用法:
|
|
11
|
+
python3 fetch-pr-info.py '{"prUrl": "https://gitcode.com/owner/repo/pull/123", "outputDir": "/abs/path", "token": "xxx"}'
|
|
12
|
+
|
|
13
|
+
产出:
|
|
14
|
+
{outputDir}/pr-info/{repo}-{number}.md 可读摘要(标题/描述/状态/变更文件/diff)
|
|
15
|
+
{outputDir}/pr-info/{repo}-{number}.json API 原始响应
|
|
16
|
+
|
|
17
|
+
依赖: 仅 Python 标准库(urllib),无第三方依赖
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import json
|
|
21
|
+
import sys
|
|
22
|
+
import time
|
|
23
|
+
import urllib.error
|
|
24
|
+
import urllib.request
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
from urllib.parse import urlparse
|
|
27
|
+
|
|
28
|
+
API_BASE = "https://gitcode.com/api/v5"
|
|
29
|
+
REQUEST_TIMEOUT = 20 # 单次请求超时(秒)
|
|
30
|
+
MAX_RETRIES = 3 # 限流/网络错误重试次数
|
|
31
|
+
RETRY_BASE_DELAY = 2 # 重试基础间隔(秒),按次数递增
|
|
32
|
+
PER_PAGE = 100 # files 接口分页大小
|
|
33
|
+
MAX_FILES_PAGES = 5 # files 接口最多翻页数(防超大 PR)
|
|
34
|
+
MAX_PATCH_CHARS = 20000 # 单文件 patch 截断阈值
|
|
35
|
+
MAX_TOTAL_PATCH_CHARS = 200000 # 全部 patch 总量截断阈值
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def parse_pr_url(pr_url: str):
|
|
39
|
+
"""解析 PR 地址,返回 (owner, repo, number)"""
|
|
40
|
+
parsed = urlparse(pr_url)
|
|
41
|
+
if "gitcode.com" not in (parsed.hostname or ""):
|
|
42
|
+
raise ValueError(f"仅支持 gitcode.com 地址: {pr_url}")
|
|
43
|
+
parts = [p for p in parsed.path.split("/") if p]
|
|
44
|
+
if len(parts) < 4 or parts[2] != "pull":
|
|
45
|
+
raise ValueError(f"PR 地址格式无效(应为 owner/repo/pull/number): {pr_url}")
|
|
46
|
+
owner, repo = parts[0], parts[1]
|
|
47
|
+
if repo.endswith(".git"):
|
|
48
|
+
repo = repo[:-4]
|
|
49
|
+
try:
|
|
50
|
+
number = int(parts[3])
|
|
51
|
+
except ValueError:
|
|
52
|
+
raise ValueError(f"PR 序号无效: {parts[3]}")
|
|
53
|
+
if number <= 0:
|
|
54
|
+
raise ValueError(f"PR 序号无效: {number}")
|
|
55
|
+
return owner, repo, number
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def api_get(path: str, token: str = "") -> dict:
|
|
59
|
+
"""GET {API_BASE}{path},带重试,返回 JSON dict"""
|
|
60
|
+
url = f"{API_BASE}{path}"
|
|
61
|
+
req = urllib.request.Request(url, headers={"Accept": "application/json"})
|
|
62
|
+
if token:
|
|
63
|
+
req.add_header("Authorization", f"Bearer {token}")
|
|
64
|
+
|
|
65
|
+
last_err = None
|
|
66
|
+
for attempt in range(1, MAX_RETRIES + 1):
|
|
67
|
+
try:
|
|
68
|
+
with urllib.request.urlopen(req, timeout=REQUEST_TIMEOUT) as resp:
|
|
69
|
+
return json.loads(resp.read().decode("utf-8"))
|
|
70
|
+
except urllib.error.HTTPError as e:
|
|
71
|
+
# 403/429 视为限流,可重试;401/404 等直接失败
|
|
72
|
+
if e.code in (403, 429) and attempt < MAX_RETRIES:
|
|
73
|
+
last_err = e
|
|
74
|
+
time.sleep(RETRY_BASE_DELAY * attempt)
|
|
75
|
+
continue
|
|
76
|
+
raise ValueError(f"HTTP {e.code}: {url}") from e
|
|
77
|
+
except (urllib.error.URLError, TimeoutError) as e:
|
|
78
|
+
if attempt < MAX_RETRIES:
|
|
79
|
+
last_err = e
|
|
80
|
+
time.sleep(RETRY_BASE_DELAY * attempt)
|
|
81
|
+
continue
|
|
82
|
+
raise ValueError(f"网络错误: {url} ({e})") from e
|
|
83
|
+
raise ValueError(f"重试耗尽: {url} ({last_err})")
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def normalize_patch(file_entry: dict) -> None:
|
|
87
|
+
"""归一化 patch 字段:GitCode 返回 dict(含 diff/old_path/new_path),GitHub 风格为字符串。
|
|
88
|
+
统一转换为字符串,并补充 filename(若缺失)。原地修改。"""
|
|
89
|
+
patch = file_entry.get("patch")
|
|
90
|
+
if isinstance(patch, dict):
|
|
91
|
+
diff = patch.get("diff") or ""
|
|
92
|
+
if not file_entry.get("filename"):
|
|
93
|
+
file_entry["filename"] = patch.get("new_path") or patch.get("old_path") or "?"
|
|
94
|
+
file_entry["patch"] = diff
|
|
95
|
+
elif patch is None:
|
|
96
|
+
file_entry["patch"] = ""
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def fetch_pr_files(owner: str, repo: str, number: int, token: str) -> list:
|
|
100
|
+
"""分页获取 PR 变更文件列表(含 patch 字段)"""
|
|
101
|
+
all_files = []
|
|
102
|
+
for page in range(1, MAX_FILES_PAGES + 1):
|
|
103
|
+
data = api_get(
|
|
104
|
+
f"/repos/{owner}/{repo}/pulls/{number}/files?per_page={PER_PAGE}&page={page}",
|
|
105
|
+
token,
|
|
106
|
+
)
|
|
107
|
+
if not data:
|
|
108
|
+
break
|
|
109
|
+
all_files.extend(data)
|
|
110
|
+
if len(data) < PER_PAGE:
|
|
111
|
+
break
|
|
112
|
+
for f in all_files:
|
|
113
|
+
normalize_patch(f)
|
|
114
|
+
return all_files
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def truncate_patch(files: list) -> tuple:
|
|
118
|
+
"""截断超大 patch,返回 (处理后的文件列表, 是否发生截断)"""
|
|
119
|
+
truncated = False
|
|
120
|
+
total = 0
|
|
121
|
+
for f in files:
|
|
122
|
+
patch = f.get("patch")
|
|
123
|
+
if not patch:
|
|
124
|
+
continue
|
|
125
|
+
total += len(patch)
|
|
126
|
+
if len(patch) > MAX_PATCH_CHARS or total > MAX_TOTAL_PATCH_CHARS:
|
|
127
|
+
keep = min(len(patch), max(0, MAX_PATCH_CHARS), max(0, MAX_TOTAL_PATCH_CHARS - total + len(patch)))
|
|
128
|
+
if keep < len(patch):
|
|
129
|
+
f["patch"] = patch[:keep] + "\n... [diff 已截断]"
|
|
130
|
+
truncated = True
|
|
131
|
+
return files, truncated
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def render_markdown(pr: dict, files: list, truncated: bool) -> str:
|
|
135
|
+
"""渲染可读摘要 markdown"""
|
|
136
|
+
lines = []
|
|
137
|
+
lines.append(f"# PR #{pr.get('number', '?')}: {pr.get('title', '(无标题)')}")
|
|
138
|
+
lines.append("")
|
|
139
|
+
lines.append(f"- **状态**: {pr.get('state', 'unknown')}")
|
|
140
|
+
lines.append(f"- **作者**: {(pr.get('user') or {}).get('login', 'unknown')}")
|
|
141
|
+
lines.append(f"- **创建时间**: {pr.get('created_at', '')}")
|
|
142
|
+
lines.append(f"- **分支**: {pr.get('head', {}).get('ref', '')} → {pr.get('base', {}).get('ref', '')}")
|
|
143
|
+
lines.append(f"- **变更文件数**: {len(files)}")
|
|
144
|
+
if truncated:
|
|
145
|
+
lines.append("- **⚠️ 注意**: diff 过大已截断,变更文件列表完整保留")
|
|
146
|
+
lines.append("")
|
|
147
|
+
|
|
148
|
+
body = (pr.get("body") or "").strip()
|
|
149
|
+
if body:
|
|
150
|
+
lines.append("## PR 描述")
|
|
151
|
+
lines.append("")
|
|
152
|
+
lines.append(body[:5000])
|
|
153
|
+
lines.append("")
|
|
154
|
+
|
|
155
|
+
lines.append("## 变更文件")
|
|
156
|
+
lines.append("")
|
|
157
|
+
lines.append("| 文件 | 变更 | +行 | -行 |")
|
|
158
|
+
lines.append("|------|------|-----|-----|")
|
|
159
|
+
for f in files:
|
|
160
|
+
name = f.get("filename", "?")
|
|
161
|
+
status = f.get("status", "?")
|
|
162
|
+
add = f.get("additions", 0)
|
|
163
|
+
dele = f.get("deletions", 0)
|
|
164
|
+
lines.append(f"| `{name}` | {status} | +{add} | -{dele} |")
|
|
165
|
+
lines.append("")
|
|
166
|
+
|
|
167
|
+
lines.append("## Diff")
|
|
168
|
+
lines.append("")
|
|
169
|
+
for f in files:
|
|
170
|
+
patch = f.get("patch")
|
|
171
|
+
lines.append(f"### `{f.get('filename', '?')}`")
|
|
172
|
+
lines.append("")
|
|
173
|
+
if patch:
|
|
174
|
+
lines.append(f"```diff\n{patch}\n```")
|
|
175
|
+
else:
|
|
176
|
+
lines.append("(无 patch 内容:二进制文件或 diff 不可用)")
|
|
177
|
+
lines.append("")
|
|
178
|
+
|
|
179
|
+
return "\n".join(lines)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def main() -> int:
|
|
183
|
+
try:
|
|
184
|
+
args = json.loads(sys.argv[1]) if len(sys.argv) > 1 else {}
|
|
185
|
+
except json.JSONDecodeError as e:
|
|
186
|
+
print(json.dumps({"ok": False, "error": f"参数 JSON 解析失败: {e}"}, ensure_ascii=False))
|
|
187
|
+
return 1
|
|
188
|
+
|
|
189
|
+
pr_url = args.get("prUrl", "")
|
|
190
|
+
output_dir = args.get("outputDir", "")
|
|
191
|
+
token = args.get("token", "")
|
|
192
|
+
|
|
193
|
+
if not pr_url or not output_dir:
|
|
194
|
+
print(json.dumps({"ok": False, "error": "prUrl 与 outputDir 为必填参数"}, ensure_ascii=False))
|
|
195
|
+
return 1
|
|
196
|
+
|
|
197
|
+
try:
|
|
198
|
+
owner, repo, number = parse_pr_url(pr_url)
|
|
199
|
+
except ValueError as e:
|
|
200
|
+
print(json.dumps({"ok": False, "error": str(e)}, ensure_ascii=False))
|
|
201
|
+
return 1
|
|
202
|
+
|
|
203
|
+
pr_dir = Path(output_dir) / "pr-info"
|
|
204
|
+
md_path = pr_dir / f"{repo}-{number}.md"
|
|
205
|
+
json_path = pr_dir / f"{repo}-{number}.json"
|
|
206
|
+
|
|
207
|
+
# 幂等:已有材料直接复用
|
|
208
|
+
if md_path.exists():
|
|
209
|
+
print(json.dumps({"ok": True, "cached": True, "mdPath": str(md_path)}, ensure_ascii=False))
|
|
210
|
+
return 0
|
|
211
|
+
|
|
212
|
+
try:
|
|
213
|
+
pr = api_get(f"/repos/{owner}/{repo}/pulls/{number}", token)
|
|
214
|
+
files = fetch_pr_files(owner, repo, number, token)
|
|
215
|
+
except ValueError as e:
|
|
216
|
+
print(json.dumps({"ok": False, "error": str(e), "prUrl": pr_url}, ensure_ascii=False))
|
|
217
|
+
return 1
|
|
218
|
+
|
|
219
|
+
files, truncated = truncate_patch(files)
|
|
220
|
+
|
|
221
|
+
pr_dir.mkdir(parents=True, exist_ok=True)
|
|
222
|
+
json_path.write_text(
|
|
223
|
+
json.dumps({"pr": pr, "files": files}, ensure_ascii=False, indent=2), encoding="utf-8"
|
|
224
|
+
)
|
|
225
|
+
md_path.write_text(render_markdown(pr, files, truncated), encoding="utf-8")
|
|
226
|
+
|
|
227
|
+
print(json.dumps({
|
|
228
|
+
"ok": True,
|
|
229
|
+
"cached": False,
|
|
230
|
+
"mdPath": str(md_path),
|
|
231
|
+
"jsonPath": str(json_path),
|
|
232
|
+
"filesCount": len(files),
|
|
233
|
+
"truncated": truncated,
|
|
234
|
+
}, ensure_ascii=False))
|
|
235
|
+
return 0
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
if __name__ == "__main__":
|
|
239
|
+
sys.exit(main())
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rn-library-known-issue-check
|
|
3
|
+
description: 对 RN 三方库鸿蒙化代码进行已知问题检视,读取 RN 已知问题知识库(BadCase/rn 的 INDEX.md + rules/ + cases/),按预筛特征筛选适用规则,逐条对照源码检查是否命中历史案例中的问题模式,生成已知问题检视报告(0-100分)。作为 RN 仓库检视流程的并发维度之一,与稳定性/一致性/内存泄露/文档质量/用例覆盖度并行执行。Use when 需要对 RN 鸿蒙化库进行历史已知问题回归检视、避免重复踩坑、评估库对已知问题模式的规避程度。
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
compatibility: 需要访问 RN 已知问题知识库目录(BadCase/rn)、访问源码目录、分析 ArkTS/ETS 与 C++ 源码
|
|
6
|
+
metadata:
|
|
7
|
+
author: CPPAgent
|
|
8
|
+
version: "2.0.0"
|
|
9
|
+
category: rn-library-check
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# rn-library-known-issue-check
|
|
13
|
+
|
|
14
|
+
对 RN 三方库的**鸿蒙化实现代码**进行已知问题检视:读取**已知问题知识库**(`BadCase/rn`),按"预筛特征"筛选出适用于当前库的规则,逐条对照源码检查是否命中历史案例中的问题模式——**发现一例,避免一类**。
|
|
15
|
+
|
|
16
|
+
> ⚠️ **核心定位**:
|
|
17
|
+
> 1. 本 SKILL 是**知识库消费者**:只读 `BadCase/rn`(INDEX.md + rules/ + cases/),不修改知识库
|
|
18
|
+
> 2. **预筛优先**:先读 INDEX.md 按"预筛特征"筛选适用规则,再按需读取规则/案例文件,避免全量检查
|
|
19
|
+
> 3. **只消费 active 状态规则**:draft 状态规则未经验证,不参与检视
|
|
20
|
+
> 4. **评分 = 通过率**:命中一条规则扣 30 分(总分 100,最低 0 分),命中规则在报告中引用案例作为修复指引
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 任务参数
|
|
25
|
+
|
|
26
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
27
|
+
|------|------|------|------|
|
|
28
|
+
| `repoUrl` | string | ✅ | 鸿蒙化仓库地址(ohosRepoUrl) |
|
|
29
|
+
| `outputDir` | string | ✅ | 输出目录绝对路径 |
|
|
30
|
+
| `interfaceDocPath` | string | ✅ | 接口规格说明文档路径 |
|
|
31
|
+
| `repoName` | string | ✅ | 仓库名称 |
|
|
32
|
+
| `knowledgeDir` | string | ❌ | 已知问题知识库根目录绝对路径,默认 `BadCase/rn`(相对 3rdLibraryLoop 仓库根) |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 输入依赖
|
|
37
|
+
|
|
38
|
+
- **前置 SKILL**: `rn-library-interface-analyzer`(阶段 1 已生成接口规格说明文档)
|
|
39
|
+
- **输入文件**: `接口规格说明.md`(位于 outputDir)
|
|
40
|
+
- **仓库源码**: 已克隆到 `{outputDir}/source/ohos/`(鸿蒙化)+ `{outputDir}/source/RN/`(上游原库)
|
|
41
|
+
- **知识库**: `{knowledgeDir}`(默认 `BadCase/rn`),结构如下:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
{knowledgeDir}/
|
|
45
|
+
├── INDEX.md # 一级:分类 + 规则/案例索引(预筛入口)
|
|
46
|
+
├── rules/ # 二级:规则知识(检查点/特征 + 案例索引)
|
|
47
|
+
│ └── R-{XX}-{规则名}.md
|
|
48
|
+
├── cases/ # 二级:案例知识(few-shot 参考 + 修复指引)
|
|
49
|
+
│ └── KI-{XXX}-{库名现象}.md
|
|
50
|
+
└── pr-info/ # 案例原始 PR diff 证据材料(可选参考)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> 源码准备细节参见 [源码准备指南](references/SOURCE_PREP_GUIDE.md)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 工作流程概览
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Phase 1: 读取知识库索引(INDEX.md)→ 获取规则清单
|
|
61
|
+
↓
|
|
62
|
+
Phase 2: 预筛适用规则(按"预筛特征"匹配当前库)
|
|
63
|
+
↓
|
|
64
|
+
Phase 3: 逐条规则检视(读规则文件 → 对照源码检查 → 判定命中/通过)
|
|
65
|
+
↓
|
|
66
|
+
Phase 4: 评分计算(命中一条扣 30 分,最低 0 分)
|
|
67
|
+
↓
|
|
68
|
+
Phase 5: 报告生成(命中清单 + 修复指引 + 案例链接)
|
|
69
|
+
↓
|
|
70
|
+
Phase 6: 合规自检(对照检查清单 + 运行校验脚本)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Phase 1:读取知识库索引
|
|
76
|
+
|
|
77
|
+
1. 读取 `{knowledgeDir}/INDEX.md`,获取:
|
|
78
|
+
- **规则分类索引表**:规则编号(R-XX)、规则名、严重级别、案例数、规则文件链接
|
|
79
|
+
- **案例索引表**:案例编号(KI-XXX)、库名、现象简述、所属规则、案例文件链接
|
|
80
|
+
2. 记录所有规则编号与文件路径,进入 Phase 2
|
|
81
|
+
|
|
82
|
+
> ⚠️ 若 `{knowledgeDir}` 不存在或 INDEX.md 缺失,视为知识库未初始化:报告评分 100 分,标注"知识库未初始化,跳过已知问题检视"。
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Phase 2:预筛适用规则
|
|
87
|
+
|
|
88
|
+
对每条规则,读取其规则文件(`rules/R-XX-*.md`)的**适用范围 + 预筛特征**,结合当前库的实际情况判定是否适用:
|
|
89
|
+
|
|
90
|
+
| 预筛维度 | 判定依据 |
|
|
91
|
+
|----------|----------|
|
|
92
|
+
| **依赖特征** | 当前库的 oh-package.json5 / package.json 依赖中是否包含规则描述的依赖类型 |
|
|
93
|
+
| **文件特征** | 源码中是否存在规则描述的文件类型(.ets / .cpp / module.json5 等) |
|
|
94
|
+
| **API 特征** | 源码中是否调用规则描述的 API(sensor.on / .gesture() / window API 等) |
|
|
95
|
+
| **能力声明** | 接口规格说明.md / README 中是否声明规则描述的能力(全屏/横屏/传感器等) |
|
|
96
|
+
|
|
97
|
+
**判定规则**:
|
|
98
|
+
- 命中任一预筛特征 → 规则**适用**,进入 Phase 3 深度检查
|
|
99
|
+
- 未命中任何预筛特征 → 规则**不适用**,跳过(记录跳过原因)
|
|
100
|
+
|
|
101
|
+
> 💡 **预筛是核心**:19 条规则不可能全部适用于每个库(如 R-01 全屏管理只适用于媒体类库)。预筛不适用规则不计入评分分母。
|
|
102
|
+
>
|
|
103
|
+
> 📖 预筛详细操作、常见误判与规避参见 [预筛指南](references/PRESCREEN_GUIDE.md)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Phase 3:逐条规则检视
|
|
108
|
+
|
|
109
|
+
对每条**适用规则**,执行以下步骤:
|
|
110
|
+
|
|
111
|
+
### 3.1 读取规则文件
|
|
112
|
+
|
|
113
|
+
读取 `rules/R-XX-*.md`,获取:
|
|
114
|
+
- **问题本质**:机制层描述,理解这类问题为什么会发生
|
|
115
|
+
- **检查点**:逐条可判定的源码检查动作
|
|
116
|
+
- **错误特征**:命中此类问题的典型代码形态
|
|
117
|
+
- **正确特征**:修复后的代码形态
|
|
118
|
+
- **来源案例**:案例索引(编号/库/现象/案例文件)
|
|
119
|
+
|
|
120
|
+
### 3.2 对照源码检查
|
|
121
|
+
|
|
122
|
+
按规则文件的**检查点**逐条对照 `{outputDir}/source/ohos/` 源码检查,每条检查点给出 **是/否/疑似** 判定:
|
|
123
|
+
|
|
124
|
+
| 判定 | 含义 | 处理 |
|
|
125
|
+
|------|------|------|
|
|
126
|
+
| **是**(命中) | 源码存在规则描述的**错误特征** | 记录为命中问题,引用案例作为修复指引 |
|
|
127
|
+
| **否**(通过) | 源码符合**正确特征** | 记录为通过 |
|
|
128
|
+
| **疑似** | 无法确定,需进一步确认 | 记录为疑似命中,报告中标注"需人工复核" |
|
|
129
|
+
|
|
130
|
+
### 3.3 判定规则命中
|
|
131
|
+
|
|
132
|
+
- 规则中**任一检查点命中错误特征** → 该规则**命中**(记 1 个问题)
|
|
133
|
+
- 所有检查点均通过 → 该规则**通过**
|
|
134
|
+
- 疑似命中 → 按命中处理(报告中标注"疑似"),避免漏报
|
|
135
|
+
|
|
136
|
+
> 💡 **few-shot 参考**:判定困难时,读取规则文件引用的案例文件(`cases/KI-XXX-*.md`),对照"错误代码/正确代码"片段辅助判定。
|
|
137
|
+
>
|
|
138
|
+
> 📖 检视详细操作、判定技巧与常见陷阱参见 [规则检视指南](references/INSPECTION_GUIDE.md)
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Phase 4:评分计算
|
|
143
|
+
|
|
144
|
+
**评分公式**:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
评分 = max(0, 100 - 30 × 命中规则数)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
- 命中 1 条规则 → 70 分
|
|
151
|
+
- 命中 2 条规则 → 40 分
|
|
152
|
+
- 命中 3 条规则 → 10 分
|
|
153
|
+
- 命中 4 条及以上 → 0 分
|
|
154
|
+
- 无适用规则 → 100 分(标注"无适用规则")
|
|
155
|
+
|
|
156
|
+
> ⚠️ **扣分制**:本维度不参与综合评分加权,作为**独立扣分项**作用于总分。命中一条已知问题,总分扣 30 分。
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Phase 5:报告生成
|
|
161
|
+
|
|
162
|
+
生成 `已知问题检视报告.md`(位于 `{outputDir}`),结构如下:
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
# {repoName} 已知问题检视报告
|
|
166
|
+
|
|
167
|
+
## 一、检视概览
|
|
168
|
+
|
|
169
|
+
| 字段 | 内容 |
|
|
170
|
+
|------|------|
|
|
171
|
+
| **仓库名称** | {repoName} |
|
|
172
|
+
| **检视时间** | {时间} |
|
|
173
|
+
| **适用规则数** | {N} 条 |
|
|
174
|
+
| **命中规则数** | {M} 条 |
|
|
175
|
+
| **评分** | {score}/100 |
|
|
176
|
+
|
|
177
|
+
## 二、规则命中清单
|
|
178
|
+
|
|
179
|
+
| 规则编号 | 规则名 | 严重级别 | 判定 | 命中检查点 | 参考案例 |
|
|
180
|
+
|----------|--------|----------|------|------------|----------|
|
|
181
|
+
| R-XX | {规则名} | {high/medium/low} | 命中/通过/疑似 | {检查点描述} | [KI-XXX](案例链接) |
|
|
182
|
+
|
|
183
|
+
## 三、命中问题详情
|
|
184
|
+
|
|
185
|
+
### R-XX {规则名}(严重级别:{high/medium/low})
|
|
186
|
+
|
|
187
|
+
- **问题本质**:{问题本质}
|
|
188
|
+
- **命中检查点**:{命中的检查点}
|
|
189
|
+
- **错误特征**:{源码中命中的错误特征,引用文件位置}
|
|
190
|
+
- **修复指引**:{正确特征}
|
|
191
|
+
- **参考案例**:[KI-XXX {库名} {现象}]({案例文件路径})
|
|
192
|
+
|
|
193
|
+
## 四、检视结论
|
|
194
|
+
|
|
195
|
+
{总结:命中问题对库质量的影响,建议修复优先级}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
> 📖 完整报告模板(含不适用规则清单、通过规则说明、数据置信度说明、风险评估)参见 [报告模板](assets/REPORT_TEMPLATE.md)
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Phase 6:合规自检
|
|
203
|
+
|
|
204
|
+
报告生成后,执行质量自检:
|
|
205
|
+
|
|
206
|
+
### 6.1 对照检查清单
|
|
207
|
+
|
|
208
|
+
对照 [合规检查清单](references/COMPLIANCE_CHECKLIST.md) 逐项检查:
|
|
209
|
+
- 输入是否完整(知识库/源码/接口文档)
|
|
210
|
+
- 预筛是否有明确判定依据
|
|
211
|
+
- 命中问题是否有证据(文件路径 + 行号 + 代码片段)
|
|
212
|
+
- 评分公式是否正确
|
|
213
|
+
- 报告五部分是否齐全
|
|
214
|
+
|
|
215
|
+
### 6.2 运行校验脚本
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
python3 {skillDir}/scripts/validate-known-issue-report.py '{"reportDir": "{outputDir}"}'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
脚本输出 `ALL CHECKS PASSED` 表示通过,否则列出失败项并修复。
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 输出产物
|
|
226
|
+
|
|
227
|
+
| 产物 | 文件名 | 说明 |
|
|
228
|
+
|------|--------|------|
|
|
229
|
+
| 已知问题检视报告 | `已知问题检视报告.md` | 评分 + 规则命中清单 + 命中详情 + 修复指引 |
|
|
230
|
+
|
|
231
|
+
所有产物写入 `{outputDir}` 目录。
|
|
232
|
+
|
|
233
|
+
> ⚠️ **输出文件自检**:写入结果文件前,先确认 `已知问题检视报告.md` 已存在且内容完整(**独立文件,禁止只写入 result 执行结果文件**)。若报告内容仅在草稿中,必须先将其保存为上述独立文件。
|
|
234
|
+
|
|
235
|
+
### 结构化指标输出(必须执行)
|
|
236
|
+
|
|
237
|
+
执行环境会在任务 prompt 中下发一个**结构化指标文件输出路径**(`stepId{X}_loop{L}_meta_{N}.json`)。
|
|
238
|
+
检视完成后,**必须**将最终评分以下述 JSON 对象写入该路径:
|
|
239
|
+
|
|
240
|
+
```json
|
|
241
|
+
{
|
|
242
|
+
"knownIssueScore": 100,
|
|
243
|
+
"scoreReason": "命中 R-08 手势重复绑定等 2 条规则(一句话判定依据,≤50字)"
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| 字段 | 类型 | 说明 |
|
|
248
|
+
|------|------|------|
|
|
249
|
+
| `knownIssueScore` | number | 已知问题评分(0-100 整数,与报告中 `**综合评分:XX/100**` 的数值一致;命中 K 条规则 = 100 − 30×K,最低 0) |
|
|
250
|
+
| `scoreReason` | string | 评分判定依据摘要(可选,前端悬浮提示展示;命中规则时列出规则编号) |
|
|
251
|
+
|
|
252
|
+
**说明**:该文件由执行框架自动收割入库(前端/历史列表直接读取评分,无需解析报告文本)。若 prompt 未下发该路径则跳过本节。
|
|
253
|
+
|
|
254
|
+
> ⚠️ **独立扣分项口径**:本维度评分不参与 5 维加权综合评分,作为独立扣分项作用于总分(命中一条已知问题,总分扣 30 分)。`knownIssueScore` 仅表征本维度通过率。
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 与其他 SKILL 的关系
|
|
259
|
+
|
|
260
|
+
| SKILL | 关系 |
|
|
261
|
+
|-------|------|
|
|
262
|
+
| `rn-library-issue-generalizer`(问题泛化器) | **生产者**:将历史问题 PR 泛化为规则/案例写入知识库,本 SKILL 消费其产出 |
|
|
263
|
+
| RN 仓库检视流水线 | 本 SKILL 作为阶段 2 并发维度之一,与其他 5 个检视 SKILL 并行执行;评分作为独立扣分项作用于总分 |
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# {repoName} 已知问题检视报告
|
|
2
|
+
|
|
3
|
+
## 一、检视概览
|
|
4
|
+
|
|
5
|
+
| 字段 | 内容 |
|
|
6
|
+
|------|------|
|
|
7
|
+
| **仓库名称** | {repoName} |
|
|
8
|
+
| **鸿蒙化仓库** | {ohosRepoUrl} |
|
|
9
|
+
| **上游原库** | {upstreamRepoUrl}(可选) |
|
|
10
|
+
| **检视时间** | {时间} |
|
|
11
|
+
| **知识库规则总数** | {N} 条 |
|
|
12
|
+
| **适用规则数** | {M} 条 |
|
|
13
|
+
| **命中规则数** | {K} 条 |
|
|
14
|
+
| **评分** | {score} / 100(命中 {K} 条 → 100 − 30×{K}) |
|
|
15
|
+
|
|
16
|
+
> ⚠️ **数据置信度说明**(如适用):本次检视时知识库中 {X} 条规则的状态字段均为 `draft`(未经人工验证)。按 SKILL 核心定位原则 #3「只消费 active 状态规则」,draft 规则原则上不参与检视。但若全部跳过将导致 Phase 2/3(预筛与逐条检视)这一关键环节被架空,与任务「不可跳过或合并关键环节」的要求冲突。故本次仍按预筛特征对 draft 规则执行完整检视,**所有结论标注为「参考级」,待规则转为 active 后复核生效**。
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 二、规则命中清单
|
|
21
|
+
|
|
22
|
+
### 适用规则判定结果
|
|
23
|
+
|
|
24
|
+
| 规则编号 | 规则名 | 严重级别 | 判定 | 命中检查点 | 参考案例 |
|
|
25
|
+
|----------|--------|----------|------|------------|----------|
|
|
26
|
+
| R-XX | {规则名} | {high/medium/low} | 命中/通过/疑似 | {检查点描述} | [KI-XXX](#r-xx) |
|
|
27
|
+
| ... | ... | ... | ... | ... | ... |
|
|
28
|
+
|
|
29
|
+
### 不适用规则清单(预筛未命中,跳过)
|
|
30
|
+
|
|
31
|
+
| 规则编号 | 规则名 | 不适用原因 |
|
|
32
|
+
|----------|--------|------------|
|
|
33
|
+
| R-XX | {规则名} | {具体原因} |
|
|
34
|
+
| ... | ... | ... |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 三、命中问题详情
|
|
39
|
+
|
|
40
|
+
<a id="r-xx"></a>
|
|
41
|
+
|
|
42
|
+
### R-XX {规则名}(严重级别:{high/medium/low})
|
|
43
|
+
|
|
44
|
+
- **参考案例**:[KI-XXX {库名} {现象}]({案例文件相对路径})
|
|
45
|
+
- **问题本质**:{问题本质}
|
|
46
|
+
|
|
47
|
+
#### 命中检查点
|
|
48
|
+
|
|
49
|
+
| 检查点 | 判定 | 说明 |
|
|
50
|
+
|--------|------|------|
|
|
51
|
+
| 1. {检查点描述} | **命中** | {证据说明} |
|
|
52
|
+
| 2. {检查点描述} | 通过 | {说明} |
|
|
53
|
+
| ... | ... | ... |
|
|
54
|
+
|
|
55
|
+
#### 错误特征(源码位置)
|
|
56
|
+
|
|
57
|
+
**{缺陷描述}**:
|
|
58
|
+
```cpp
|
|
59
|
+
// {文件路径}:{行号}
|
|
60
|
+
{错误代码片段,用 // ← 标注缺陷点}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### 修复指引(正确特征)
|
|
64
|
+
|
|
65
|
+
按 {案例编号} 案例的正确代码,{修复方案描述}:
|
|
66
|
+
|
|
67
|
+
```cpp
|
|
68
|
+
// {文件路径}
|
|
69
|
+
{正确代码片段,用 ①②③ 标注修复步骤}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### 风险评估
|
|
73
|
+
|
|
74
|
+
- {风险描述:影响场景、严重程度}
|
|
75
|
+
- **缓解因素**:{如有}
|
|
76
|
+
- 建议优先级:{高/中/低}
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 四、通过规则简要说明
|
|
81
|
+
|
|
82
|
+
| 规则 | 通过依据 |
|
|
83
|
+
|------|----------|
|
|
84
|
+
| R-XX | {通过理由,含源码证据} |
|
|
85
|
+
| ... | ... |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 五、检视结论
|
|
90
|
+
|
|
91
|
+
1. **命中 {K} 条 {级别} 已知问题(R-XX)**:{总结命中问题及影响}
|
|
92
|
+
2. **其余 {M-K} 条适用规则全部通过**:{总结通过情况}
|
|
93
|
+
3. **{N-M} 条规则预筛不适用**:{总结不适用原因}
|
|
94
|
+
4. **评分 {score}/100**:{评分说明}。建议 {修复建议} 后复检可恢复至 {目标分}。
|
|
95
|
+
|
|
96
|
+
> ⚠️ 如适用:因知识库规则当前均为 `draft` 状态,本报告所有判定为「参考级」,待规则经人工验证转为 `active` 后正式生效。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 已知问题检视合规检查清单
|
|
2
|
+
|
|
3
|
+
> 检视流程完成后,对照此清单进行自检,确保检视质量。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 输入检查
|
|
8
|
+
|
|
9
|
+
| # | 检查项 | 通过条件 |
|
|
10
|
+
|---|--------|----------|
|
|
11
|
+
| 1.1 | 知识库 INDEX.md 存在 | `{knowledgeDir}/INDEX.md` 可读取 |
|
|
12
|
+
| 1.2 | 鸿蒙化源码目录存在 | `{outputDir}/source/ohos/` 非空 |
|
|
13
|
+
| 1.3 | 接口规格说明存在 | `{outputDir}/接口规格说明.md` 可读取 |
|
|
14
|
+
| 1.4 | 上游原库代码存在 | `{outputDir}/source/RN/` 非空(可选) |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 2. 预筛检查
|
|
19
|
+
|
|
20
|
+
| # | 检查项 | 通过条件 |
|
|
21
|
+
|---|--------|----------|
|
|
22
|
+
| 2.1 | 已读取所有规则文件 | 覆盖 INDEX.md 列出的全部规则 |
|
|
23
|
+
| 2.2 | 适用规则有明确判定依据 | 每条规则记录「适用/不适用」及原因 |
|
|
24
|
+
| 2.3 | 预筛特征准确 | 依赖/文件/API/能力四维度至少使用两个维度 |
|
|
25
|
+
| 2.4 | 不适用规则记录原因 | 不适用原因具体化,非模板化描述 |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 3. 检视检查
|
|
30
|
+
|
|
31
|
+
| # | 检查项 | 通过条件 |
|
|
32
|
+
|---|--------|----------|
|
|
33
|
+
| 3.1 | 每条适用规则已逐条检查 | 所有检查点已给出判定 |
|
|
34
|
+
| 3.2 | 命中问题有证据 | 文件路径 + 行号 + 代码片段 |
|
|
35
|
+
| 3.3 | 命中问题引用案例 | 至少引用一个案例作为修复指引 |
|
|
36
|
+
| 3.4 | 通过规则有通过依据 | 简要说明通过的理由 |
|
|
37
|
+
| 3.5 | 疑似命中已标注 | 标注"需人工复核" |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 4. 评分检查
|
|
42
|
+
|
|
43
|
+
| # | 检查项 | 通过条件 |
|
|
44
|
+
|---|--------|----------|
|
|
45
|
+
| 4.1 | 评分公式正确 | `max(0, 100 - 30 × 命中规则数)` |
|
|
46
|
+
| 4.2 | 不适用规则不计入分母 | 评分基于「适用规则」计算 |
|
|
47
|
+
| 4.3 | 无适用规则时评分 100 | 标注"无适用规则" |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 5. 报告检查
|
|
52
|
+
|
|
53
|
+
| # | 检查项 | 通过条件 |
|
|
54
|
+
|---|--------|----------|
|
|
55
|
+
| 5.1 | 报告包含五部分 | 检视概览、规则命中清单、命中问题详情、通过规则说明、检视结论 |
|
|
56
|
+
| 5.2 | 不适用规则清单完整 | 列出所有不适用规则及原因 |
|
|
57
|
+
| 5.3 | 命中问题详情有修复指引 | 含正确特征描述或修复方案 |
|
|
58
|
+
| 5.4 | 报告路径正确 | 生成到 `{outputDir}/已知问题检视报告.md` |
|