dknowc-dsh 2.3.0 → 2.4.0
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 +14 -50
- package/package.json +2 -2
- package/skills/dk-trace-report/SKILL.md +288 -0
- package/skills/dk-trace-report/config/examples/doc.json +56 -0
- package/skills/dk-trace-report/config/examples/legal.json +51 -0
- package/skills/dk-trace-report/config/examples/ppt.json +47 -0
- package/skills/dk-trace-report/config/examples/tax.json +46 -0
- package/skills/dk-trace-report/config/examples/trusted.json +122 -0
- package/skills/dk-trace-report/reference/sample_input.json +60 -0
- package/skills/dk-trace-report/resources/ECHARTS-NOTICE.txt +10 -0
- package/skills/dk-trace-report/resources/echarts.custom.min.js +48 -0
- package/skills/dk-trace-report/scripts/build_report_input.py +333 -0
- package/skills/{dknowc-trusted-search → dk-trace-report}/scripts/chart_embed.py +4 -1
- package/skills/{dknowc-trusted-search → dk-trace-report}/scripts/render_trace_html.py +1072 -537
- package/skills/dk-trace-report/scripts/run_paths.py +95 -0
- package/skills/dk-trace-report/scripts/trust_digest.py +77 -0
- package/skills/dknowc-legal-assistant/README.md +95 -0
- package/skills/dknowc-legal-assistant/SKILL.md +122 -0
- package/skills/dknowc-legal-assistant/attribution.json +5 -0
- package/skills/dknowc-legal-assistant/reference/answer-and-report.md +221 -0
- package/skills/dknowc-legal-assistant/reference/capability-layer.md +143 -0
- package/skills/dknowc-legal-assistant/reference/legal_claims.example.json +96 -0
- package/skills/dknowc-legal-assistant/reference/onboarding_scripts.md +198 -0
- package/skills/dknowc-legal-assistant/reference/policy_tags.json +2002 -0
- package/skills/dknowc-legal-assistant/reference/retrieval-statute.md +81 -0
- package/skills/dknowc-legal-assistant/reference/retrieval-v2.md +133 -0
- package/skills/dknowc-legal-assistant/reference/sample_search_result.md +33 -0
- package/skills/dknowc-legal-assistant/reference/sample_trace_report.html +940 -0
- package/skills/dknowc-legal-assistant/reference/tags.md +53 -0
- package/skills/dknowc-legal-assistant/reference/troubleshooting.md +50 -0
- package/skills/dknowc-legal-assistant/reference/verification-pass.md +59 -0
- package/skills/dknowc-legal-assistant/resources/echarts.custom.min.js +48 -0
- package/skills/dknowc-legal-assistant/scripts/api_key.py +68 -0
- package/skills/dknowc-legal-assistant/scripts/attribution.py +61 -0
- package/skills/dknowc-legal-assistant/scripts/calc_legal.py +375 -0
- package/skills/dknowc-legal-assistant/scripts/calc_period.py +155 -0
- package/skills/dknowc-legal-assistant/scripts/check_answer.py +664 -0
- package/skills/dknowc-legal-assistant/scripts/initialize.py +188 -0
- package/skills/dknowc-legal-assistant/scripts/legal_client.py +208 -0
- package/skills/dknowc-legal-assistant/scripts/legal_search.py +1059 -0
- package/skills/dknowc-legal-assistant/scripts/merge_search_results.py +630 -0
- package/skills/dknowc-legal-assistant/scripts/path_guard.py +92 -0
- package/skills/dknowc-legal-assistant/scripts/question_profile.py +215 -0
- package/skills/dknowc-legal-assistant/scripts/register_key.mjs +1152 -0
- package/skills/dknowc-legal-assistant/scripts/run_eval.py +109 -0
- package/skills/dknowc-legal-assistant/scripts/source_cards.py +321 -0
- package/skills/dknowc-legal-assistant/scripts/tag_catalog.py +162 -0
- package/skills/dknowc-legal-assistant/scripts/trace_report.config.json +66 -0
- package/skills/dknowc-legal-assistant/scripts/verify_claims.py +448 -0
- package/skills/dknowc-legal-assistant/scripts/websearch_convert.py +396 -0
- package/skills/dknowc-official-doc-writer/README.md +45 -25
- package/skills/dknowc-official-doc-writer/SKILL.md +28 -14
- package/skills/dknowc-official-doc-writer/config/trace_report.config.json +56 -0
- package/skills/dknowc-official-doc-writer/official-docs/input//345/274/225/347/224/250/345/257/271/347/205/247_/351/252/214/346/224/266_materials.json +628 -0
- package/skills/dknowc-official-doc-writer/official-docs/search-results/baseline_1555.json +345 -0
- package/skills/dknowc-official-doc-writer/official-docs/search-results/baseline_my.json +728 -0
- package/skills/dknowc-official-doc-writer/official-docs/search-results/baseline_wp.json +159 -0
- package/skills/dknowc-official-doc-writer/official-docs/search-results/baseline_wp2.json +1006 -0
- package/skills/dknowc-official-doc-writer/official-docs/search-results/test_tz.json +28 -0
- package/skills/dknowc-official-doc-writer/official-docs/search-results/tmp_q.json +1419 -0
- package/skills/dknowc-official-doc-writer/reference/anti_ai_patterns.md +13 -1
- package/skills/dknowc-official-doc-writer/reference/fact_discipline.md +4 -0
- package/skills/dknowc-official-doc-writer/reference/genre_writing_notes.md +4 -0
- package/skills/dknowc-official-doc-writer/reference/initialization.md +28 -20
- package/skills/dknowc-official-doc-writer/reference/material_usage_guidance.md +21 -0
- package/skills/dknowc-official-doc-writer/reference/materials_pipeline.md +64 -7
- package/skills/dknowc-official-doc-writer/reference/onboarding_scripts.md +43 -32
- package/skills/dknowc-official-doc-writer/reference/outline_rules.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/output_guide.md +19 -20
- package/skills/dknowc-official-doc-writer/reference/research_notes.md +5 -3
- package/skills/dknowc-official-doc-writer/reference/review_checklist.md +6 -2
- package/skills/dknowc-official-doc-writer/reference/revision_workflow.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/search_guide.md +45 -33
- package/skills/dknowc-official-doc-writer/reference/search_intro.md +4 -4
- package/skills/dknowc-official-doc-writer/reference/search_policy.md +63 -36
- package/skills/dknowc-official-doc-writer/reference/standards/00_index.md +63 -77
- package/skills/dknowc-official-doc-writer/reference/standards/01_report.md +3 -3
- package/skills/dknowc-official-doc-writer/reference/standards/02_qingshi.md +6 -3
- package/skills/dknowc-official-doc-writer/reference/standards/03_pifu.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/04_tongzhi.md +12 -3
- package/skills/dknowc-official-doc-writer/reference/standards/05_yijian.md +8 -2
- package/skills/dknowc-official-doc-writer/reference/standards/06_han.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/08_tongbao.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/09_tonggao.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/10_gonggao.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/11_fuhan_approve.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/12_fuhan_objection.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/13_reminder.md +3 -3
- package/skills/dknowc-official-doc-writer/reference/standards/14_generic.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/standards/16_decision.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/18_order.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/standards/19_gazette.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/standards/20_motion.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/22_application.md +2 -2
- package/skills/dknowc-official-doc-writer/reference/standards/23_publicity.md +1 -1
- package/skills/dknowc-official-doc-writer/reference/standards/25_plan.md +2 -1
- package/skills/dknowc-official-doc-writer/reference/standards/26_summary.md +7 -1
- package/skills/dknowc-official-doc-writer/reference/standards/27_speech.md +4 -1
- package/skills/dknowc-official-doc-writer/reference/standards/99_expressions.md +1 -2
- package/skills/dknowc-official-doc-writer/reference/task_router.md +5 -5
- package/skills/dknowc-official-doc-writer/reference/working_principles.md +4 -4
- package/skills/dknowc-official-doc-writer/reference/writing_method.md +166 -0
- package/skills/dknowc-official-doc-writer/reference/writing_rules.md +11 -5
- package/skills/dknowc-official-doc-writer/scripts/api_key.py +30 -3
- package/skills/dknowc-official-doc-writer/scripts/attribution.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/build_trace_json.py +216 -22
- package/skills/dknowc-official-doc-writer/scripts/check_materials.py +375 -27
- package/skills/dknowc-official-doc-writer/scripts/deep_convert.py +9 -4
- package/skills/dknowc-official-doc-writer/scripts/deep_query.py +3 -2
- package/skills/dknowc-official-doc-writer/scripts/dkag_search.py +23 -9
- package/skills/dknowc-official-doc-writer/scripts/extract_reference.py +2 -1
- package/skills/dknowc-official-doc-writer/scripts/format_document.py +116 -41
- package/skills/dknowc-official-doc-writer/scripts/initialize.py +246 -12
- package/skills/dknowc-official-doc-writer/scripts/local_memory.py +2 -6
- package/skills/dknowc-official-doc-writer/scripts/mcp_direct.py +2 -3
- package/skills/dknowc-official-doc-writer/scripts/merge_search_results.py +113 -13
- package/skills/dknowc-official-doc-writer/scripts/outline_reference.py +3 -2
- package/skills/dknowc-official-doc-writer/scripts/prose_lint.py +7 -2
- package/skills/dknowc-official-doc-writer/scripts/register.mjs +782 -216
- package/skills/dknowc-official-doc-writer/scripts/review_document.py +2 -1
- package/skills/dknowc-official-doc-writer/scripts/source_note_html.py +120 -13
- package/skills/dknowc-official-doc-writer/scripts/template_generator.py +2 -1
- package/skills/dknowc-official-doc-writer/scripts/update_skill.py +339 -0
- package/skills/dknowc-official-doc-writer/scripts/websearch_convert.py +326 -0
- package/skills/dknowc-ppt-assistant/README.md +21 -9
- package/skills/dknowc-ppt-assistant/SKILL.md +29 -20
- package/skills/dknowc-ppt-assistant/THIRD_PARTY_NOTICES.md +3 -2
- package/skills/dknowc-ppt-assistant/config/trace_report.config.json +65 -0
- package/skills/dknowc-ppt-assistant/references/initialization.md +58 -7
- package/skills/dknowc-ppt-assistant/references/material_usage.md +51 -14
- package/skills/dknowc-ppt-assistant/references/onboarding_scripts.md +51 -18
- package/skills/dknowc-ppt-assistant/references/sample_trace_report.html +372 -920
- package/skills/dknowc-ppt-assistant/references/search_intro.md +2 -2
- package/skills/dknowc-ppt-assistant/references/svg-authoring.md +3 -3
- package/skills/dknowc-ppt-assistant/references/upstream-example/README.md +2 -0
- package/skills/dknowc-ppt-assistant/scripts/api_key.py +11 -27
- package/skills/dknowc-ppt-assistant/scripts/attribution.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/build_trace_input.py +188 -0
- package/skills/dknowc-ppt-assistant/scripts/compact_svg_coordinates.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/config.py +9 -9
- package/skills/dknowc-ppt-assistant/scripts/console_encoding.py +1 -2
- package/skills/dknowc-ppt-assistant/scripts/error_helper.py +3 -3
- package/skills/dknowc-ppt-assistant/scripts/hyperlink_contract.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/initialize.py +248 -15
- package/skills/dknowc-ppt-assistant/scripts/language_tags.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/mcp_convert.py +7 -14
- package/skills/dknowc-ppt-assistant/scripts/mcp_direct.py +3 -2
- package/skills/dknowc-ppt-assistant/scripts/merge_search_results.py +604 -0
- package/skills/dknowc-ppt-assistant/scripts/native_payloads.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_animations.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/__init__.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/errors.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/formula.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/loader.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/models.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/registry.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantic_hash.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantics.py +3 -3
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/animation_import.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/formula_import.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/hyperlinks.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_authoring.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_registry_to_svg.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_svg_markup.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/slide_to_svg.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/transition_import.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/pptx_transitions.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/preset_shape_svg.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/preview_slide_html.py +4 -11
- package/skills/dknowc-ppt-assistant/scripts/project_utils.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/register_key.mjs +890 -341
- package/skills/dknowc-ppt-assistant/scripts/resource_paths.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/shape_boolean_svg.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/slide_roster.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/__init__.py +2 -9
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/align_embed_images.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/crop_images.py +3 -3
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/__init__.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/checker.py +9 -10
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/cli.py +4 -4
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/svg_contracts.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/xml_support.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_quality_checker.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/hyperlinks.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_colors.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_fonts.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/geometry_properties.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_ast.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_compiler.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_omml.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_parser.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_profile.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_run_properties.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/inline_formula.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/builder.py +9 -11
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/cli.py +7 -5
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_structure.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_validation.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/semantic_markers.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/shape_boolean.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/text_outline.py +2 -2
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx.py +1 -1
- package/skills/dknowc-ppt-assistant/scripts/trusted_search.py +51 -17
- package/skills/dknowc-ppt-assistant/scripts/update_skill.py +314 -0
- package/skills/dknowc-ppt-assistant/scripts/update_spec.py +25 -1
- package/skills/dknowc-ppt-assistant/scripts/websearch_convert.py +326 -0
- package/skills/dknowc-ppt-assistant/workflows/generate-pptx.md +99 -34
- package/skills/dknowc-tax-assistant/README.md +54 -0
- package/skills/dknowc-tax-assistant/SKILL.md +99 -0
- package/skills/dknowc-tax-assistant/attribution.json +5 -0
- package/skills/dknowc-tax-assistant/reference/answer-and-report.md +100 -0
- package/skills/dknowc-tax-assistant/reference/capability-layer.md +205 -0
- package/skills/dknowc-tax-assistant/reference/onboarding_scripts.md +68 -0
- package/skills/dknowc-tax-assistant/reference/policy_tags.json +2002 -0
- package/skills/dknowc-tax-assistant/reference/retrieval-policy.md +43 -0
- package/skills/dknowc-tax-assistant/reference/retrieval-v2.md +58 -0
- package/skills/dknowc-tax-assistant/reference/tags.md +53 -0
- package/skills/dknowc-tax-assistant/reference/tax_claims.example.json +76 -0
- package/skills/dknowc-tax-assistant/reference/trace_report.config.json +46 -0
- package/skills/dknowc-tax-assistant/reference/troubleshooting.md +70 -0
- package/skills/dknowc-tax-assistant/reference/websearch-fallback.md +59 -0
- package/skills/dknowc-tax-assistant/resources/THIRD_PARTY_NOTICES.md +9 -0
- package/skills/dknowc-tax-assistant/resources/echarts.custom.min.js +48 -0
- package/skills/dknowc-tax-assistant/scripts/api_key.py +60 -0
- package/skills/dknowc-tax-assistant/scripts/attribution.py +61 -0
- package/skills/dknowc-tax-assistant/scripts/calc_period.py +156 -0
- package/skills/dknowc-tax-assistant/scripts/calc_tax.py +179 -0
- package/skills/dknowc-tax-assistant/scripts/check_answer.py +210 -0
- package/skills/dknowc-tax-assistant/scripts/initialize.py +208 -0
- package/skills/dknowc-tax-assistant/scripts/merge_search_results.py +631 -0
- package/skills/dknowc-tax-assistant/scripts/path_guard.py +23 -0
- package/skills/dknowc-tax-assistant/scripts/question_profile.py +444 -0
- package/skills/dknowc-tax-assistant/scripts/register_key.mjs +1173 -0
- package/skills/dknowc-tax-assistant/scripts/run_dir.py +149 -0
- package/skills/dknowc-tax-assistant/scripts/source_cards.py +372 -0
- package/skills/dknowc-tax-assistant/scripts/tag_catalog.py +164 -0
- package/skills/dknowc-tax-assistant/scripts/tax_client.py +218 -0
- package/skills/dknowc-tax-assistant/scripts/tax_search.py +403 -0
- package/skills/dknowc-tax-assistant/scripts/verify_claims.py +587 -0
- package/skills/dknowc-tax-assistant/scripts/websearch_convert.py +352 -0
- package/skills/dknowc-trusted-search/README.md +29 -23
- package/skills/dknowc-trusted-search/SKILL.md +257 -107
- package/skills/dknowc-trusted-search/config/trace_report.config.json +119 -0
- package/skills/dknowc-trusted-search/reference/onboarding_scripts.md +40 -15
- package/skills/dknowc-trusted-search/reference/sample_trace_report.html +286 -191
- package/skills/dknowc-trusted-search/resources/ECHARTS-NOTICE.txt +10 -0
- package/skills/dknowc-trusted-search/scripts/api_key.py +10 -26
- package/skills/dknowc-trusted-search/scripts/attribution.py +1 -1
- package/skills/dknowc-trusted-search/scripts/build_trace_input.py +173 -0
- package/skills/dknowc-trusted-search/scripts/deep_convert.py +79 -30
- package/skills/dknowc-trusted-search/scripts/deep_query.py +23 -34
- package/skills/dknowc-trusted-search/scripts/initialize.py +353 -12
- package/skills/dknowc-trusted-search/scripts/mcp_direct.py +3 -2
- package/skills/dknowc-trusted-search/scripts/merge_search_results.py +222 -35
- package/skills/dknowc-trusted-search/scripts/register_key.mjs +845 -291
- package/skills/dknowc-trusted-search/scripts/source_display.py +59 -0
- package/skills/dknowc-trusted-search/scripts/trusted_search.py +69 -36
- package/skills/dknowc-trusted-search/scripts/update_skill.py +300 -0
- package/skills/dknowc-trusted-search/scripts/websearch_convert.py +328 -0
- package/src/index.js +15 -0
- package/skills/dknowc-official-doc-writer/scripts/mcp_convert.py +0 -287
- package/skills/dknowc-official-doc-writer/scripts/render_trace_html.py +0 -2574
- package/skills/dknowc-ppt-assistant/references/upstream-docs/svg-pipeline.md +0 -842
- package/skills/dknowc-ppt-assistant/scripts/finalize_svg.py +0 -507
- package/skills/dknowc-ppt-assistant/scripts/render_trace_html.py +0 -2642
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/svg_rect_to_path.py +0 -346
- package/skills/dknowc-trusted-search/official-docs/output/.gitkeep +0 -0
- package/skills/dknowc-trusted-search/official-docs/search-results/.gitkeep +0 -0
- package/skills/dknowc-trusted-search/scripts/mcp_convert.py +0 -198
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""从「素材清单 + 正文(带角标)+ 合并产物」装配溯源核验报告 JSON。
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
背景旧实现模型写完正文才反查"正文 [n] 对应哪篇素材",再手写临时脚本拼
|
|
5
5
|
溯源 JSON——写作时引用情况无保障,溯源核验沦为"事后圆场"。修复后强制顺序:
|
|
6
6
|
素材四分类 → 素材清单落盘(materials_<任务>.json)→ 用户确认 → 基于清单写正文(边写边标 [n])
|
|
7
7
|
本脚本只做**装配**(不反查、不挑拣):
|
|
@@ -33,9 +33,13 @@ import json
|
|
|
33
33
|
import re
|
|
34
34
|
import sys
|
|
35
35
|
from pathlib import Path
|
|
36
|
+
from typing import Optional
|
|
37
|
+
|
|
38
|
+
# 同一角标多次出现时的句子绑定与事后校验共用一套归一化,避免两处口径不一致
|
|
39
|
+
from check_materials import check_mark_occurrence_binding, cmp_norm, mark_occurrences
|
|
36
40
|
|
|
37
41
|
SKILL_ROOT = Path(__file__).resolve().parent.parent
|
|
38
|
-
# 工作区根:dsh 场景通过环境变量 DKNWOC_WS_ROOT 指向会话工作区,未设置时回退到 cwd
|
|
42
|
+
# 工作区根:dsh 场景通过环境变量 DKNWOC_WS_ROOT 指向会话工作区,未设置时回退到 cwd
|
|
39
43
|
import os as _os
|
|
40
44
|
_ws = _os.environ.get("DKNWOC_WS_ROOT")
|
|
41
45
|
if not _ws:
|
|
@@ -44,6 +48,7 @@ if not _ws:
|
|
|
44
48
|
_sid = _os.environ.get("DSH_SESSION_ID", "")
|
|
45
49
|
_ws = str(Path(_os.getcwd()) / "dknowc-output" / (_sid[:8] if _sid else "_default"))
|
|
46
50
|
WS_ROOT = Path(_ws).resolve()
|
|
51
|
+
|
|
47
52
|
INPUT_DIR = WS_ROOT / "official-docs" / "input"
|
|
48
53
|
|
|
49
54
|
# 合并产物文章字段(--clean 同构,deep_convert / merge 产物均含)
|
|
@@ -57,7 +62,7 @@ ART_SNAPSHOT_FIELDS = ("快照链接", "screenShotPath", "snapshot")
|
|
|
57
62
|
SEL_TYPE_FIELDS = ("type", "素材类型", "类型")
|
|
58
63
|
SEL_TITLE_FIELDS = ("标题", "文章标题", "title", "material_name")
|
|
59
64
|
SEL_URL_FIELDS = ("源网址", "source_url", "sourceUrl", "原文链接", "url")
|
|
60
|
-
# 分组键兜底链不含"搜索地域"
|
|
65
|
+
# 分组键兜底链不含"搜索地域"地域名("中国"/"浙江省")做分组键无意义,
|
|
61
66
|
# "搜索目的"为空的篇目会退化成地域胶囊(避免大量篇目退化);全部落空时归"其他检索"。
|
|
62
67
|
SEL_SEARCH_KEY_FIELDS = ("search_key", "搜索条件", "deep_group")
|
|
63
68
|
|
|
@@ -123,9 +128,12 @@ def map_article_fields(art: dict) -> dict:
|
|
|
123
128
|
"search_key": (first_value(art, ("搜索目的", "purpose"))
|
|
124
129
|
or first_value(art, SEL_SEARCH_KEY_FIELDS)
|
|
125
130
|
or "其他检索"),
|
|
126
|
-
# 检索通道(深知深度搜索 /
|
|
127
|
-
#
|
|
131
|
+
# 检索通道(深知深度搜索 / 深知可信搜索 / 联网检索):由 deep_convert / dkag_search /
|
|
132
|
+
# websearch_convert 打标,溯源报告据此区分接口来源与各自检索路数
|
|
128
133
|
"检索通道": first_value(art, ("检索通道",)),
|
|
134
|
+
# 外部联网材料标记:溯源报告据此打「非官方来源」徽标(联网检索/宿主 WebSearch 路)
|
|
135
|
+
"非官方来源": True if art.get("非官方来源") else "",
|
|
136
|
+
"数据权威性": first_value(art, ("数据权威性", "authority")),
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
|
|
@@ -140,6 +148,158 @@ def extract_citations(content: str) -> list[int]:
|
|
|
140
148
|
return out
|
|
141
149
|
|
|
142
150
|
|
|
151
|
+
def count_marks(content: str) -> dict[int, int]:
|
|
152
|
+
"""统计每个角标在正文中出现的次数(引用实例必须逐处对应)。"""
|
|
153
|
+
counts: dict[int, int] = {}
|
|
154
|
+
for m in re.finditer(r"[\[【]\s*(\d+)\s*[\]】]", content):
|
|
155
|
+
n = int(m.group(1))
|
|
156
|
+
counts[n] = counts.get(n, 0) + 1
|
|
157
|
+
return counts
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def flat(text: str) -> str:
|
|
161
|
+
return re.sub(r"\s+", "", str(text or ""))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
CIT_USAGE_VALUES = ("依据", "借鉴")
|
|
165
|
+
CIT_STATUS_VALUES = ("现行", "历史", "参考")
|
|
166
|
+
CIT_REGION_VALUES = ("本地", "上级", "外省", "全国")
|
|
167
|
+
# 引文片段下限(去空白后的字符数):过短的片段容易在原文中偶然命中,撑不起该句
|
|
168
|
+
CIT_QUOTE_MIN = 10
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def find_citation_file(args, materials_path: Path) -> Optional[Path]:
|
|
172
|
+
"""定位引用对照文件:显式 --citations 优先;否则按素材清单同名规则查找。"""
|
|
173
|
+
if args.citations:
|
|
174
|
+
p = Path(args.citations).expanduser()
|
|
175
|
+
if not p.is_absolute():
|
|
176
|
+
p = (INPUT_DIR / p.name).resolve()
|
|
177
|
+
return p if p.is_file() else None
|
|
178
|
+
stem = materials_path.stem
|
|
179
|
+
task = stem[len("materials_"):] if stem.startswith("materials_") else stem
|
|
180
|
+
for cand in (materials_path.parent / f"引用对照_{task}.json",
|
|
181
|
+
materials_path.parent / "引用对照.json",
|
|
182
|
+
INPUT_DIR / f"引用对照_{task}.json",
|
|
183
|
+
INPUT_DIR / "引用对照.json"):
|
|
184
|
+
if cand.is_file():
|
|
185
|
+
return cand
|
|
186
|
+
return None
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def load_citation_records(path: Optional[Path], body: str, material_count: int) -> list:
|
|
190
|
+
"""读取并初校验引用对照;返回按正文出现顺序排列的引用实例列表。
|
|
191
|
+
|
|
192
|
+
硬约束:正文出现的每个角标,都要有等量的引用实例(同一角标用几处,就交几条 quote)。
|
|
193
|
+
这是"引用从篇级降到片段级"的落点——没有 quote 就无法逐字核验,直接阻断。
|
|
194
|
+
"""
|
|
195
|
+
counts = count_marks(body)
|
|
196
|
+
if not counts:
|
|
197
|
+
return []
|
|
198
|
+
if path is None:
|
|
199
|
+
raise SystemExit(
|
|
200
|
+
"错误:正文含 [n] 角标,但未找到引用对照文件。\n"
|
|
201
|
+
"请先按 reference/materials_pipeline.md 生成 official-docs/input/引用对照_<任务>.json:\n"
|
|
202
|
+
' {"task": "...", "citations": [{"mark": 1, "material": 1, '
|
|
203
|
+
'"sentence": "正文中的原句", "quote": "该句依据的原文片段", "用法": "依据"}]}\n'
|
|
204
|
+
"正文每出现一次 [n],就要交一条对应实例(同一角标多处引用=多条)。"
|
|
205
|
+
)
|
|
206
|
+
data = load_json(path)
|
|
207
|
+
records = data.get("citations") if isinstance(data, dict) else None
|
|
208
|
+
if not isinstance(records, list) or not records:
|
|
209
|
+
raise SystemExit(f"错误:{path.name} 的 citations 为空或不是数组")
|
|
210
|
+
|
|
211
|
+
errors: list[str] = []
|
|
212
|
+
per_mark: dict[int, int] = {}
|
|
213
|
+
cleaned: list = []
|
|
214
|
+
flat_body = flat(body)
|
|
215
|
+
for i, rec in enumerate(records, 1):
|
|
216
|
+
if not isinstance(rec, dict):
|
|
217
|
+
errors.append(f"引用[{i}] 不是对象")
|
|
218
|
+
continue
|
|
219
|
+
try:
|
|
220
|
+
mark = int(rec.get("mark"))
|
|
221
|
+
except (TypeError, ValueError):
|
|
222
|
+
errors.append(f"引用[{i}] 缺 mark(正整数,对应正文角标)")
|
|
223
|
+
continue
|
|
224
|
+
material = rec.get("material", mark)
|
|
225
|
+
try:
|
|
226
|
+
material = int(material)
|
|
227
|
+
except (TypeError, ValueError):
|
|
228
|
+
errors.append(f"引用[{i}] 的 material 不是整数")
|
|
229
|
+
continue
|
|
230
|
+
if mark not in counts:
|
|
231
|
+
errors.append(f"引用[{i}] 的 mark={mark} 在正文中不存在")
|
|
232
|
+
continue
|
|
233
|
+
if material < 1 or material > material_count:
|
|
234
|
+
errors.append(f"引用[{i}] 的 material={material} 超出素材清单范围(1..{material_count})")
|
|
235
|
+
continue
|
|
236
|
+
if material != mark:
|
|
237
|
+
errors.append(
|
|
238
|
+
f"引用[{i}] 的 material={material} 与 mark={mark} 不一致——"
|
|
239
|
+
f"角标号即素材清单序号,两者必须相同,否则正文 [{mark}] 可以拿第 {material} 篇的原文通过校验")
|
|
240
|
+
continue
|
|
241
|
+
quote = str(rec.get("quote") or "").strip()
|
|
242
|
+
sentence = str(rec.get("sentence") or "").strip()
|
|
243
|
+
usage = str(rec.get("用法") or rec.get("usage") or "").strip()
|
|
244
|
+
if len(flat(quote)) < CIT_QUOTE_MIN:
|
|
245
|
+
errors.append(
|
|
246
|
+
f"引用[{i}](mark={mark})quote 为空或过短(须≥{CIT_QUOTE_MIN}字原文片段,"
|
|
247
|
+
f"当前 {len(flat(quote))} 字)")
|
|
248
|
+
if not sentence:
|
|
249
|
+
errors.append(f"引用[{i}](mark={mark})缺 sentence(正文中该角标所在的原句)")
|
|
250
|
+
elif not re.search(rf"[\[【]\s*{mark}\s*[\]】]", sentence):
|
|
251
|
+
errors.append(
|
|
252
|
+
f"引用[{i}](mark={mark})的 sentence 必须包含角标 [{mark}] 本身"
|
|
253
|
+
f"(照抄正文原句,含角标):{sentence[:30]}")
|
|
254
|
+
elif flat(sentence) not in flat_body:
|
|
255
|
+
errors.append(f"引用[{i}](mark={mark})的 sentence 在正文中找不到:{sentence[:30]}")
|
|
256
|
+
if usage not in CIT_USAGE_VALUES:
|
|
257
|
+
errors.append(f"引用[{i}](mark={mark})的用法须为「依据」或「借鉴」,当前:{usage or '空'}")
|
|
258
|
+
per_mark[mark] = per_mark.get(mark, 0) + 1
|
|
259
|
+
cleaned.append({"mark": mark, "material": material, "quote": quote,
|
|
260
|
+
"sentence": sentence, "usage": usage})
|
|
261
|
+
|
|
262
|
+
for mark, need in counts.items():
|
|
263
|
+
got = per_mark.get(mark, 0)
|
|
264
|
+
if got != need:
|
|
265
|
+
errors.append(
|
|
266
|
+
f"角标 [{mark}] 在正文出现 {need} 处,但引用对照只有 {got} 条——"
|
|
267
|
+
f"每处引用都要交一条对应原文片段(不能一篇材料只交一段、多处复用)")
|
|
268
|
+
# 同一角标多次出现时,每条 sentence 必须对上各自的第 k 处(不能多句套同一处)
|
|
269
|
+
errors.extend(check_mark_occurrence_binding(body, cleaned))
|
|
270
|
+
if errors:
|
|
271
|
+
raise SystemExit("错误:引用对照校验未通过:\n- " + "\n- ".join(errors))
|
|
272
|
+
|
|
273
|
+
# 按正文出现次序装配:按句子内容逐处认领,认领不到即报错(杜绝靠条数糊弄)
|
|
274
|
+
pool = list(cleaned)
|
|
275
|
+
ordered = []
|
|
276
|
+
for mark, seg in mark_occurrences(body):
|
|
277
|
+
hit = next((r for r in pool if r["mark"] == mark and cmp_norm(r["sentence"]) == seg), None)
|
|
278
|
+
if hit is None:
|
|
279
|
+
raise SystemExit(
|
|
280
|
+
f"错误:引用对照与正文错位——角标 [{mark}] 的正文原句「{seg[:26]}」没有对应的引用记录,"
|
|
281
|
+
"请按出现次序逐处补齐 sentence"
|
|
282
|
+
)
|
|
283
|
+
pool.remove(hit)
|
|
284
|
+
ordered.append(hit)
|
|
285
|
+
return ordered
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def require_inside(path_value: str, label: str) -> Path:
|
|
289
|
+
"""输入路径必须落在本技能目录内(official-docs 之下),否则拒绝读取。
|
|
290
|
+
|
|
291
|
+
关标统一由脚本自身定位,不接受目录外的绝对路径,避免把任意文件读进产物。
|
|
292
|
+
"""
|
|
293
|
+
path = Path(path_value).expanduser().resolve()
|
|
294
|
+
allowed = [(WS_ROOT / "official-docs").resolve()]
|
|
295
|
+
if not any(path.is_relative_to(base) for base in allowed):
|
|
296
|
+
raise SystemExit(
|
|
297
|
+
f"错误:{label} 必须位于 {WS_ROOT / 'official-docs'} 之内,当前为 {path}。"
|
|
298
|
+
)
|
|
299
|
+
if path.suffix.lower() != ".json" and label != "问题文件":
|
|
300
|
+
raise SystemExit(f"错误:{label} 必须是 JSON 文件:{path}")
|
|
301
|
+
return path
|
|
302
|
+
|
|
143
303
|
def resolve_selected_index(selected: list, by_title: dict, by_url: dict) -> list:
|
|
144
304
|
"""为清单每条定位合并产物文章;返回 (条目, 文章或None)。"""
|
|
145
305
|
resolved = []
|
|
@@ -152,12 +312,14 @@ def resolve_selected_index(selected: list, by_title: dict, by_url: dict) -> list
|
|
|
152
312
|
if art is None and t:
|
|
153
313
|
art = by_title.get(norm_key(t))
|
|
154
314
|
if art is None and t:
|
|
155
|
-
# 标题前缀匹配(政策文件名常带"关于印发…的通知"
|
|
315
|
+
# 标题前缀匹配(政策文件名常带"关于印发…的通知"变体):
|
|
316
|
+
# 只接受“共同前缀 ≥12 字”的变体,避免短前缀命中无关文件
|
|
156
317
|
tk = norm_key(t)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
318
|
+
if len(tk) >= 12:
|
|
319
|
+
for k, a in by_title.items():
|
|
320
|
+
if len(k) >= 12 and (k.startswith(tk[:12]) or tk.startswith(k[:12])):
|
|
321
|
+
art = a
|
|
322
|
+
break
|
|
161
323
|
resolved.append((item, art))
|
|
162
324
|
return resolved
|
|
163
325
|
|
|
@@ -174,6 +336,8 @@ def main() -> int:
|
|
|
174
336
|
"溯源报告顶部展示完整原问题,供报告独立使用)")
|
|
175
337
|
parser.add_argument("--question-file", help="用户原始问题全文文件(多行/长 prompt 优先用此参数,"
|
|
176
338
|
"避免只传首行导致溯源报告原问题被截断)")
|
|
339
|
+
parser.add_argument("--citations", help="引用对照 JSON(official-docs/input/引用对照_<任务>.json);"
|
|
340
|
+
"缺省按素材清单同名自动查找")
|
|
177
341
|
parser.add_argument("--output", "-o", help="输出溯源 JSON 文件名(写入 official-docs/input/)")
|
|
178
342
|
parser.add_argument("--sample", action="store_true", help="打印素材清单示例结构")
|
|
179
343
|
args = parser.parse_args()
|
|
@@ -182,19 +346,28 @@ def main() -> int:
|
|
|
182
346
|
print(json.dumps({
|
|
183
347
|
"task": "任务名",
|
|
184
348
|
"selected": [
|
|
185
|
-
{"type": "政策依据型", "标题": "国务院关于印发新一代人工智能发展规划的通知", "源网址": "https://..."
|
|
186
|
-
|
|
349
|
+
{"type": "政策依据型", "标题": "国务院关于印发新一代人工智能发展规划的通知", "源网址": "https://...",
|
|
350
|
+
"发布机关": "国务院", "status": "现行", "region": "全国"},
|
|
351
|
+
{"type": "数据支撑型", "标题": "北京市人工智能产业发展报告", "源网址": "https://...",
|
|
352
|
+
"发布机关": "北京市经济和信息化局", "status": "现行", "region": "外省"},
|
|
187
353
|
],
|
|
354
|
+
"引用对照示例": {
|
|
355
|
+
"task": "任务名",
|
|
356
|
+
"citations": [
|
|
357
|
+
{"mark": 1, "material": 1, "sentence": "正文中该角标所在的原句",
|
|
358
|
+
"quote": "该句依据的原文片段(须在材料中逐字存在)", "用法": "依据"},
|
|
359
|
+
],
|
|
360
|
+
},
|
|
188
361
|
}, ensure_ascii=False, indent=2))
|
|
189
362
|
return 0
|
|
190
363
|
|
|
191
364
|
if not (args.materials_list and args.body_file and args.merged_json):
|
|
192
365
|
raise SystemExit("用法:python3 scripts/build_trace_json.py <素材清单> <正文文件> <合并产物JSON> --title <标题> --output <溯源JSON>")
|
|
193
366
|
|
|
194
|
-
materials_list = load_json(
|
|
367
|
+
materials_list = load_json(require_inside(args.materials_list, "素材清单"))
|
|
195
368
|
question_text = (args.question or "").strip()
|
|
196
369
|
if args.question_file:
|
|
197
|
-
question_path =
|
|
370
|
+
question_path = require_inside(args.question_file, "问题文件")
|
|
198
371
|
try:
|
|
199
372
|
question_text = question_path.read_text(encoding="utf-8").strip()
|
|
200
373
|
except OSError as exc:
|
|
@@ -209,7 +382,7 @@ def main() -> int:
|
|
|
209
382
|
"请先保存到 official-docs/input/ 后再装配溯源 JSON。"
|
|
210
383
|
)
|
|
211
384
|
body = body_path.read_text(encoding="utf-8")
|
|
212
|
-
merged = load_json(
|
|
385
|
+
merged = load_json(require_inside(args.merged_json, "合并产物"))
|
|
213
386
|
|
|
214
387
|
selected = materials_list.get("selected") or []
|
|
215
388
|
if not selected:
|
|
@@ -220,6 +393,8 @@ def main() -> int:
|
|
|
220
393
|
|
|
221
394
|
# ① materials:按正文角标序取清单对应篇
|
|
222
395
|
citations = extract_citations(body)
|
|
396
|
+
citation_file = find_citation_file(args, Path(args.materials_list).expanduser())
|
|
397
|
+
citation_records = load_citation_records(citation_file, body, len(resolved))
|
|
223
398
|
by_pos = {n: item for n, item in enumerate(resolved, 1)}
|
|
224
399
|
materials = []
|
|
225
400
|
for n in citations:
|
|
@@ -240,13 +415,19 @@ def main() -> int:
|
|
|
240
415
|
mat["excerpt"] = excerpt[:400]
|
|
241
416
|
mat["excerpts"] = [excerpt[:400]] if excerpt else []
|
|
242
417
|
mat["search_key"] = first_value(item, SEL_SEARCH_KEY_FIELDS) or mat.get("search_key", "")
|
|
418
|
+
# 版本与地域元数据(素材清单必填):供报告展示与 check_materials 拦截"引用历史版本/外省依据"
|
|
419
|
+
mat["status"] = first_value(item, ("status", "效力状态", "版本状态"))
|
|
420
|
+
mat["region"] = first_value(item, ("region", "地域属性", "地域"))
|
|
421
|
+
mat["issue_org"] = first_value(item, ("发布机关", "发文机关", "发布或实施机构"))
|
|
422
|
+
# 引用实例:本篇在正文中被引用的每一处,各带自己的原文片段
|
|
423
|
+
mat["citations"] = [c for c in citation_records if c["material"] == n]
|
|
243
424
|
materials.append(mat)
|
|
244
425
|
|
|
245
426
|
if not materials:
|
|
246
427
|
raise SystemExit("错误:正文没有任何 [n] 角标对应素材清单,请先基于清单写作并标注角标")
|
|
247
428
|
|
|
248
429
|
# 按角标号(=素材清单序号)升序重排:渲染层按"位置"给材料编号,只有 materials 处于
|
|
249
|
-
# 1..N 的 id
|
|
430
|
+
# 1..N 的 id 顺序时,位置才等于角标号。旧实现按正文"出现顺序"输出,只要正文首个引用
|
|
250
431
|
# 不是 [1](如先引 [23]),胶囊标题与角标号就会整体错位——溯源错配,务必升序。
|
|
251
432
|
materials.sort(key=lambda m: m["id"])
|
|
252
433
|
|
|
@@ -266,6 +447,11 @@ def main() -> int:
|
|
|
266
447
|
seen_keys.add(key)
|
|
267
448
|
rm = map_article_fields(art)
|
|
268
449
|
rm["type"] = first_value(item, SEL_TYPE_FIELDS) or "材料"
|
|
450
|
+
# 来自素材清单的条目:版本/地域/发布机关与 selected 一样必须齐备(check_materials 校验)
|
|
451
|
+
rm["from_selected"] = True
|
|
452
|
+
rm["status"] = first_value(item, ("status", "效力状态", "版本状态"))
|
|
453
|
+
rm["region"] = first_value(item, ("region", "地域属性", "地域"))
|
|
454
|
+
rm["issue_org"] = first_value(item, ("发布机关", "发文机关", "发布或实施机构"))
|
|
269
455
|
recalled.append(rm)
|
|
270
456
|
# 合并产物中未被清单覆盖的剩余材料
|
|
271
457
|
for art in merged.get("articles") or []:
|
|
@@ -277,13 +463,15 @@ def main() -> int:
|
|
|
277
463
|
seen_keys.add(key)
|
|
278
464
|
rm = map_article_fields(art)
|
|
279
465
|
rm["type"] = "材料"
|
|
466
|
+
# 合并产物里未被清单选中的召回材料:不受"三字段必填"约束
|
|
467
|
+
rm["from_selected"] = False
|
|
280
468
|
recalled.append(rm)
|
|
281
469
|
|
|
282
|
-
# ③ self_check
|
|
283
|
-
#
|
|
284
|
-
#
|
|
285
|
-
#
|
|
286
|
-
#
|
|
470
|
+
# ③ self_check 骨架(五项待模型填写,两轨验收的 Agent 轨)
|
|
471
|
+
# 每项填结构化对象:{"verdict": "pass|fail|pending", "basis": "结论依据", "evidence": ["可回查证据", …]}。
|
|
472
|
+
# 硬约束:verdict=pass 时 evidence 必须含可回查要素(材料角标 [n]/条款号/文号/日期/
|
|
473
|
+
# 文件名/GB 标准号任一),裸写「通过」或证据无要素会被渲染器按 evidence_missing 拦截;
|
|
474
|
+
# fail 否决、pending 只表示待人工复核。骨架用空字符串占位(如实显示"未记录")。
|
|
287
475
|
self_check = {k: "" for k in SELF_CHECK_ITEMS}
|
|
288
476
|
|
|
289
477
|
trace = {
|
|
@@ -297,6 +485,12 @@ def main() -> int:
|
|
|
297
485
|
"document_content": body,
|
|
298
486
|
"materials": materials,
|
|
299
487
|
"recalled_materials": recalled,
|
|
488
|
+
# 引用实例全量(逐处 quote):check_materials 据此做"角标↔原句↔原文片段"三方校验
|
|
489
|
+
"citations": citation_records,
|
|
490
|
+
# 装配所用的合并产物:渲染前的引用门禁据此比对 quote 是否真在该材料原文中
|
|
491
|
+
"merged_json": (str(Path(args.merged_json).expanduser().resolve().relative_to(WS_ROOT))
|
|
492
|
+
if Path(args.merged_json).expanduser().resolve().is_relative_to(WS_ROOT)
|
|
493
|
+
else str(Path(args.merged_json).expanduser().resolve())),
|
|
300
494
|
"self_check": self_check,
|
|
301
495
|
# 用户明确字数要求时由素材清单传入(如 {"min": 4000, "max": 5000});
|
|
302
496
|
# 未提字数时为空,check_materials 不做篇幅校验。
|
|
@@ -322,7 +516,7 @@ def main() -> int:
|
|
|
322
516
|
"materials": len(materials),
|
|
323
517
|
"recalled_materials": len(recalled),
|
|
324
518
|
"citations": citations,
|
|
325
|
-
"note": "溯源 JSON
|
|
519
|
+
"note": "溯源 JSON 已装配。请把 self_check 五项填成结构化结果(verdict/basis/evidence,pass 必须带可回查证据),再运行 check_materials.py 校验、source_note_html.py 渲染。",
|
|
326
520
|
}, ensure_ascii=False, indent=2))
|
|
327
521
|
return 0
|
|
328
522
|
|