report-workflow 4.41.2__tar.gz → 4.41.3__tar.gz
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.
- {report_workflow-4.41.2 → report_workflow-4.41.3}/CHANGELOG.md +19 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/PKG-INFO +2 -2
- {report_workflow-4.41.2 → report_workflow-4.41.3}/README.md +1 -1
- {report_workflow-4.41.2 → report_workflow-4.41.3}/pyproject.toml +1 -1
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/__init__.py +1 -1
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/agent_wrapper.py +4 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/artifact_lint.py +9 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/cli.py +33 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/language.py +23 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/docx_render.py +69 -6
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/factuality_check.py +17 -3
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/heading_contract_check.py +5 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/visual_render_check.py +70 -11
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/run_workflow.py +20 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow.egg-info/PKG-INFO +2 -2
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow.egg-info/SOURCES.txt +5 -0
- report_workflow-4.41.3/tests/test_batch1_2026_11_18.py +43 -0
- report_workflow-4.41.3/tests/test_cjk_font_and_toc_2026_11_18.py +128 -0
- report_workflow-4.41.3/tests/test_heading_ordinals_2026_11_18.py +64 -0
- report_workflow-4.41.3/tests/test_thousands_separator_2026_11_18.py +25 -0
- report_workflow-4.41.3/tests/test_visual_render_soffice_2026_11_18.py +83 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/.env.example +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/LICENSE +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/MANIFEST.in +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/requirements.txt +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/setup.cfg +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/SKILL.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/authoring.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/benchmarking.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/engineering-lab.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/figures.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/profiles.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/revision.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/setup-and-preflight.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/reference/tools.md +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/skills/report-workflow/skill.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/__main__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/artifact_contract.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/artifact_packaging/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/artifact_packaging/common.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/artifact_packaging/final_qa.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/artifact_packaging/template_reports.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/automation_harness.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/academic_paper.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/admissions_project_report.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/admissions_report.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/business_report.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/custom.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/engineering_lab_report.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/proposal.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/blueprints/quant_research_memo.yaml +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/config.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/banned_phrases.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/governance_policy.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/guideline_rules.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/style_profiles/academic.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/style_profiles/hybrid.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/style_profiles/work.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/configs/style_vocab.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/connectors/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/connectors/notebooklm_connector.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/connectors/research_backends.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/derived_evidence.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/draft_check.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/engineering_audit.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/errors.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/CHINESE_ENGINEERING.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/CONSORT.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/PRISMA.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/SRQR.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/STARD.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/STROBE.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/guidelines/TRIPOD.json +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/mcp_server.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/abstract_check.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/admissions_monograph_polish.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/admissions_tone_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/agent_tasks.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/artifacts.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/base_document_diff.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/base_document_parse.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/blueprint_plan.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/citation_bind.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/cited_sources.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/claim_plan.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/claim_verify_execute.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/corpus_build.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/derived_evidence.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/evidence_normalize.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/evidence_store.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/figure_build.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/figure_plan_audit.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/figure_quality.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/figure_recommend.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/figure_types.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/figure_utils.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/final_publish.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/front_matter_build.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/guideline_select.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/heading_dedup.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/intake.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/merge_draft.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/methods_protocol_build.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/notebook_sync.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/outline_plan.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/paper_scope_freeze.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/post_render_repair.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/post_render_validate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/project_identity_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/publication_naturalness_pass.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/qa_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/reference_reality_check.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/reference_relevance_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/reference_verify.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/register_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/remediation_router.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/research_execute.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/revision_apply.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/section_contract.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/section_draft.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/section_plan_freeze.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/section_role_check.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/source_appendix_render.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/source_parse.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/source_tables.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/style_pass.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/supplementary_package_build.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/table_transform.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/agent_fallback.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/code_parser.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/office_math.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/semi_structured_parser.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/source_text.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/parsers/structured_parser.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/policies/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/policies/policy_pack.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/preflight.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/preflight_decisions.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/profiles.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/prompt_questions.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/prompts/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/prompts/intake_prompt.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/quote_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/reference_list.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/reference_match.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/runtime_support.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/source_citation.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/source_selection.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/state.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/templates/reference.docx +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/validators/__init__.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/validators/parse_validator.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/verify.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow.egg-info/dependency_links.txt +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow.egg-info/entry_points.txt +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow.egg-info/requires.txt +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow.egg-info/top_level.txt +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_adversarial_benchmark.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_append_only_ledger_contract.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_automation_harness.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_benchmark_contracts.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_calculation_record.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_check_draft.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_chinese_quantity_expressions.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_cited_sources.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_column_roles.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_decimal_comma_evidence.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_declared_citation_propagation.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_declared_source_citations.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_delivered_attributions.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_delivered_layout.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_delivery_contracts.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_document_language.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_docx_render_references.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_emission_intensity_units.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_evidence_traceability.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_external_benchmark.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_fe_names_the_span_it_read.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_figure_recommend.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_figure_recommendation_loss.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_figure_value_support.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_form_feed_line_numbers.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_format_standards.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_formula_derivations.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_grouped_derived_evidence.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_hallucination_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_improvements.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_intake_summary_measures.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_line_chart_markers.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_long_block_evidence.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_mcp_server.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_measurement_and_union_rule.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_mermaid.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_mvp_workflow.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_naturalness_machine_tells.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_outline_brief_lists_required_sections.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_outline_obligations.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_pdf_inline_scripts.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_pdf_table_cells.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_quant_research_memo_profile.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_quote_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_raw_data_reports.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_reference_list.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_reference_match.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_register_gate.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_report_axes.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_report_quality_benchmark.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_revision_change_types.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_revision_diff.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_roadmap_contracts.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_scientific_notation_evidence.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_small_issues_2026_11_17.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_source_selection.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_state_checkpoint.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_structured_draft_paragraphs.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_structured_source_tables.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_table_display_precision.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_trend_claims.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_usability_audit_2026_10_19.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_usability_consolidated_2026_10_21.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_usability_review_2026_10_20.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_usability_round3_2026_10_20.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_verify_adapter.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_version_sync.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_visual_review_status.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/tests/test_wide_table_landscape.py +0 -0
- {report_workflow-4.41.2 → report_workflow-4.41.3}/workflow_config.yaml +0 -0
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.41.3 — 2026-11-18
|
|
4
|
+
|
|
5
|
+
Six fixes found by rewriting a Chinese policy report end to end (2026-11-18). No
|
|
6
|
+
gate, profile or public default changes; each option is opt-in.
|
|
7
|
+
|
|
8
|
+
- FE: 「每度售電成本 4.1007 元/度」 is read as 元/度, not 元/度/度, and
|
|
9
|
+
「每度平均售電價格約為 3.9674 元」 reads as 元/度, so either spelling matches a
|
|
10
|
+
claim of 元/度.
|
|
11
|
+
- FE: 3,668 and 3668 were already the same number (pinned by a test); a missing
|
|
12
|
+
minus is still a different number, on purpose.
|
|
13
|
+
- A title that already starts with its ordinal (一、 / 第一章 / (一) / 2.) is
|
|
14
|
+
not numbered a second time (no more 「二、二、」); artifact lint warns about it.
|
|
15
|
+
- `cjk_font` (prepare / start_report / render, `--cjk-font`) names the East
|
|
16
|
+
Asian font of the rendered DOCX, e.g. 標楷體; the default is unchanged.
|
|
17
|
+
- `toc=False` (`--no-toc`) leaves the empty contents page out of the DOCX; the
|
|
18
|
+
default is unchanged.
|
|
19
|
+
- The visual check runs the real soffice.exe behind a `.cmd` shim, converts a
|
|
20
|
+
non-ASCII path from an ASCII copy, and keeps the whole error message.
|
|
21
|
+
|
|
3
22
|
## 4.41.2 - 2026-11-18
|
|
4
23
|
|
|
5
24
|
Six small fixes found by writing reports end to end; no gate, profile or public
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: report-workflow
|
|
3
|
-
Version: 4.41.
|
|
3
|
+
Version: 4.41.3
|
|
4
4
|
Summary: Turn sources into a submission-ready report, with deterministic gates that block any claim not traceable to the evidence.
|
|
5
5
|
Author-email: 0Smallcat0 <noiroao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -53,7 +53,7 @@ mcp-name: io.github.0Smallcat0/report-workflow
|
|
|
53
53
|
|
|
54
54
|
[](https://github.com/0Smallcat0/report-workflow/actions/workflows/ci.yml)
|
|
55
55
|

|
|
56
|
-

|
|
57
57
|
[](LICENSE)
|
|
58
58
|
|
|
59
59
|
**繁體中文說明 → [README.zh-TW.md](README.zh-TW.md)**
|
|
@@ -11,7 +11,7 @@ mcp-name: io.github.0Smallcat0/report-workflow
|
|
|
11
11
|
|
|
12
12
|
[](https://github.com/0Smallcat0/report-workflow/actions/workflows/ci.yml)
|
|
13
13
|

|
|
14
|
-

|
|
15
15
|
[](LICENSE)
|
|
16
16
|
|
|
17
17
|
**繁體中文說明 → [README.zh-TW.md](README.zh-TW.md)**
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "report-workflow"
|
|
7
|
-
version = "4.41.
|
|
7
|
+
version = "4.41.3"
|
|
8
8
|
description = "Turn sources into a submission-ready report, with deterministic gates that block any claim not traceable to the evidence."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -300,6 +300,8 @@ def start_report_task(
|
|
|
300
300
|
preflight_decisions: dict | None = None,
|
|
301
301
|
allow_degraded_render: bool = False,
|
|
302
302
|
source_citation_columns: list[str] | None = None,
|
|
303
|
+
cjk_font: str | None = None,
|
|
304
|
+
toc: bool | None = None,
|
|
303
305
|
) -> dict:
|
|
304
306
|
"""Step 1: Start the report generation workflow.
|
|
305
307
|
|
|
@@ -375,6 +377,8 @@ def start_report_task(
|
|
|
375
377
|
intent=task_intent,
|
|
376
378
|
artifact_role_map=artifact_role_map,
|
|
377
379
|
source_citation_columns=source_citation_columns,
|
|
380
|
+
cjk_font=cjk_font,
|
|
381
|
+
toc=toc,
|
|
378
382
|
source_citations=source_citations,
|
|
379
383
|
source_selections=source_selections,
|
|
380
384
|
front_matter={
|
|
@@ -8,6 +8,7 @@ from pathlib import Path
|
|
|
8
8
|
from typing import Any
|
|
9
9
|
|
|
10
10
|
from .artifact_contract import load_jsonl_without_contract
|
|
11
|
+
from .language import has_heading_ordinal
|
|
11
12
|
from .runtime_support import PLACEHOLDER_TEXT, write_json_artifact
|
|
12
13
|
from .errors import QAHardBlockError
|
|
13
14
|
from .nodes.claim_plan import _validate_claim_matrix
|
|
@@ -301,6 +302,14 @@ def _lint_outline(
|
|
|
301
302
|
if not isinstance(section, dict):
|
|
302
303
|
_issue(issues, "error", "outline", path, section_path, "Outline section must be an object", "Replace this section with an object.")
|
|
303
304
|
continue
|
|
305
|
+
title = section.get("title")
|
|
306
|
+
if isinstance(title, str) and has_heading_ordinal(title):
|
|
307
|
+
_issue(
|
|
308
|
+
issues, "warning", "outline", path, f"{section_path}.title",
|
|
309
|
+
f"Section title already starts with an ordinal (序號): {title!r}",
|
|
310
|
+
"Headings are numbered by the renderer; the title's own ordinal is kept as written and not numbered again. "
|
|
311
|
+
"Drop it from the title if you want the automatic numbering.",
|
|
312
|
+
)
|
|
304
313
|
raw_claim_ids = section.get("claim_ids", [])
|
|
305
314
|
if not isinstance(raw_claim_ids, list):
|
|
306
315
|
_issue(issues, "error", "outline", path, f"{section_path}.claim_ids", "claim_ids must be a list", "Use an array of claim IDs.")
|
|
@@ -214,6 +214,15 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
214
214
|
type=_parse_template_field_arg,
|
|
215
215
|
help="Fixed-template/front-matter field in KEY=VALUE form; may be repeated",
|
|
216
216
|
)
|
|
217
|
+
prepare.add_argument(
|
|
218
|
+
"--cjk-font",
|
|
219
|
+
help="East Asian font for the rendered document, e.g. 標楷體 or DFKai-SB (default: the template's own)",
|
|
220
|
+
)
|
|
221
|
+
prepare.add_argument(
|
|
222
|
+
"--no-toc",
|
|
223
|
+
action="store_true",
|
|
224
|
+
help="Leave the table of contents out of the rendered document",
|
|
225
|
+
)
|
|
217
226
|
prepare.add_argument(
|
|
218
227
|
"--keyword",
|
|
219
228
|
action="append",
|
|
@@ -260,6 +269,15 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
260
269
|
"--reference-docx",
|
|
261
270
|
help="Path to a .docx whose styles, margins, and header/footer the output should follow",
|
|
262
271
|
)
|
|
272
|
+
render.add_argument(
|
|
273
|
+
"--cjk-font",
|
|
274
|
+
help="East Asian font for the rendered document, e.g. 標楷體 or DFKai-SB (default: the template's own)",
|
|
275
|
+
)
|
|
276
|
+
render.add_argument(
|
|
277
|
+
"--no-toc",
|
|
278
|
+
action="store_true",
|
|
279
|
+
help="Leave the table of contents out of the rendered document",
|
|
280
|
+
)
|
|
263
281
|
|
|
264
282
|
status = subcommands.add_parser("status", help="Show current workflow status")
|
|
265
283
|
status.add_argument("--job-id", required=True, help="Workflow job id")
|
|
@@ -272,6 +290,15 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
272
290
|
"--reference-docx",
|
|
273
291
|
help="Path to a .docx whose styles, margins, and header/footer the output should follow",
|
|
274
292
|
)
|
|
293
|
+
run.add_argument(
|
|
294
|
+
"--cjk-font",
|
|
295
|
+
help="East Asian font for the rendered document, e.g. 標楷體 or DFKai-SB (default: the template's own)",
|
|
296
|
+
)
|
|
297
|
+
run.add_argument(
|
|
298
|
+
"--no-toc",
|
|
299
|
+
action="store_true",
|
|
300
|
+
help="Leave the table of contents out of the rendered document",
|
|
301
|
+
)
|
|
275
302
|
run.add_argument(
|
|
276
303
|
"--verbose",
|
|
277
304
|
action="store_true",
|
|
@@ -920,6 +947,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
920
947
|
notebooklm_notebook_id=cfg.notebooklm_notebook_id,
|
|
921
948
|
notebooklm_storage_path=cfg.notebooklm_storage_path,
|
|
922
949
|
reference_docx=args.reference_docx,
|
|
950
|
+
cjk_font=args.cjk_font,
|
|
951
|
+
toc=False if args.no_toc else None,
|
|
923
952
|
source_citations=source_citations or None,
|
|
924
953
|
source_selections=source_selections or None,
|
|
925
954
|
)
|
|
@@ -944,6 +973,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
944
973
|
args.job_id,
|
|
945
974
|
workspace_root=args.workspace_root,
|
|
946
975
|
reference_docx=args.reference_docx,
|
|
976
|
+
cjk_font=args.cjk_font,
|
|
977
|
+
toc=False if args.no_toc else None,
|
|
947
978
|
)
|
|
948
979
|
_print_state(state)
|
|
949
980
|
return 0
|
|
@@ -964,6 +995,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
964
995
|
state.job_id,
|
|
965
996
|
workspace_root=args.workspace_root,
|
|
966
997
|
reference_docx=args.reference_docx,
|
|
998
|
+
cjk_font=args.cjk_font,
|
|
999
|
+
toc=False if args.no_toc else None,
|
|
967
1000
|
)
|
|
968
1001
|
_print_state(state)
|
|
969
1002
|
return 0
|
|
@@ -19,6 +19,29 @@ ZH_ORDINAL_PREFIX_RE = re.compile(
|
|
|
19
19
|
r"^(?:[((][一二三四五六七八九十百]+[))]|[一二三四五六七八九十百]+[、..])\s*"
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
+
# Any ordinal an author may already have typed in front of a heading: 一、 /
|
|
23
|
+
# 第一章 / 第3節 / (一) / 1. / 1.2 / 2、 . The renderer numbers headings
|
|
24
|
+
# itself, so a title that carries one must not get a second.
|
|
25
|
+
HEADING_ORDINAL_RE = re.compile(
|
|
26
|
+
r"^\s*(?:"
|
|
27
|
+
r"[((][一二三四五六七八九十百]+[))]"
|
|
28
|
+
r"|[一二三四五六七八九十百]+[、..]"
|
|
29
|
+
r"|第\s*[一二三四五六七八九十百零\d]+\s*[章節节篇部分]"
|
|
30
|
+
r"|\d+(?:\.\d+)*[.、.))]\s*"
|
|
31
|
+
r"|\d+(?:\.\d+)+\s+"
|
|
32
|
+
r")"
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def has_heading_ordinal(title: str) -> bool:
|
|
37
|
+
"""Does this heading title already begin with its own number?"""
|
|
38
|
+
text = (title or "").strip()
|
|
39
|
+
# 「2025 年回顧」 is a year, not an ordinal.
|
|
40
|
+
if re.match(r"\d+\s*[年月日]", text):
|
|
41
|
+
return False
|
|
42
|
+
return bool(HEADING_ORDINAL_RE.match(text))
|
|
43
|
+
|
|
44
|
+
|
|
22
45
|
_CJK_RE = CJK_RE
|
|
23
46
|
_LATIN_RE = re.compile(r"[A-Za-z]")
|
|
24
47
|
_LATIN_WORD_RE = re.compile(r"\b[A-Za-z0-9]+\b")
|
|
@@ -394,7 +394,7 @@ _TOC_PLACEHOLDERS = {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
|
|
397
|
-
def _toc_openxml_block(language: str, page_break_before: bool) -> str:
|
|
397
|
+
def _toc_openxml_block(language: str, page_break_before: bool, include_toc: bool = True) -> str:
|
|
398
398
|
"""Raw OOXML table-of-contents block for the pandoc input.
|
|
399
399
|
|
|
400
400
|
pandoc's own --toc places the TOC ahead of everything, which puts it in
|
|
@@ -403,6 +403,12 @@ def _toc_openxml_block(language: str, page_break_before: bool) -> str:
|
|
|
403
403
|
template, so the heading styles correctly and stays out of the TOC
|
|
404
404
|
field's own listing.
|
|
405
405
|
"""
|
|
406
|
+
if not include_toc:
|
|
407
|
+
# No contents page (``toc: false``): keep only the page break that
|
|
408
|
+
# separates a cover from the body.
|
|
409
|
+
if not page_break_before:
|
|
410
|
+
return ""
|
|
411
|
+
return '```{=openxml}\n<w:p><w:r><w:br w:type="page"/></w:r></w:p>\n```'
|
|
406
412
|
title = _TOC_TITLES.get(language, _TOC_TITLES["en"])
|
|
407
413
|
placeholder = _TOC_PLACEHOLDERS.get(language, _TOC_PLACEHOLDERS["en"])
|
|
408
414
|
parts = []
|
|
@@ -534,6 +540,7 @@ def _inject_toc(
|
|
|
534
540
|
has_front_matter: bool,
|
|
535
541
|
cover_title: str = "",
|
|
536
542
|
title_leads: bool = False,
|
|
543
|
+
include_toc: bool = True,
|
|
537
544
|
) -> str:
|
|
538
545
|
"""Insert the TOC block after the front matter or a leading cover section.
|
|
539
546
|
|
|
@@ -550,7 +557,7 @@ def _inject_toc(
|
|
|
550
557
|
separator = "\n\n---\n\n"
|
|
551
558
|
idx = md_content.find(separator)
|
|
552
559
|
if idx != -1:
|
|
553
|
-
block = _toc_openxml_block(language, page_break_before=True)
|
|
560
|
+
block = _toc_openxml_block(language, page_break_before=True, include_toc=include_toc)
|
|
554
561
|
head = md_content[:idx]
|
|
555
562
|
body = md_content[idx + len(separator):]
|
|
556
563
|
# The front matter is the cover. A cover section with nothing in
|
|
@@ -567,7 +574,7 @@ def _inject_toc(
|
|
|
567
574
|
if headings and cover_title in headings[0].group(0):
|
|
568
575
|
end = headings[1].start() if len(headings) >= 2 else len(md_content)
|
|
569
576
|
cover_body = md_content[headings[0].end():end].strip()
|
|
570
|
-
toc_block = _toc_openxml_block(language, page_break_before=True)
|
|
577
|
+
toc_block = _toc_openxml_block(language, page_break_before=True, include_toc=include_toc)
|
|
571
578
|
head = md_content[:headings[0].start()]
|
|
572
579
|
if cover_body:
|
|
573
580
|
cover_block = _cover_openxml_block(cover_body)
|
|
@@ -578,11 +585,61 @@ def _inject_toc(
|
|
|
578
585
|
# the TOC belongs after it, not on top of it.
|
|
579
586
|
headings = list(re.finditer(r"^# .*$", md_content, flags=re.MULTILINE))
|
|
580
587
|
if len(headings) >= 2:
|
|
581
|
-
block = _toc_openxml_block(language, page_break_before=True)
|
|
588
|
+
block = _toc_openxml_block(language, page_break_before=True, include_toc=include_toc)
|
|
582
589
|
idx = headings[1].start()
|
|
583
590
|
return md_content[:idx] + block + "\n\n" + md_content[idx:]
|
|
584
|
-
block = _toc_openxml_block(language, page_break_before=False)
|
|
585
|
-
return block + "\n\n" + md_content
|
|
591
|
+
block = _toc_openxml_block(language, page_break_before=False, include_toc=include_toc)
|
|
592
|
+
return block + "\n\n" + md_content if block else md_content
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
def _apply_cjk_font(docx_path: str, font: str) -> None:
|
|
596
|
+
"""Name `font` as the East Asian font of every style in the rendered DOCX.
|
|
597
|
+
|
|
598
|
+
The shipped template leaves the East Asian font to the theme, so Chinese
|
|
599
|
+
text came out in whatever Word or LibreOffice picked for it (MingLiU,
|
|
600
|
+
YaHei, JhengHei) and a course that asks for 標楷體 could not be met without
|
|
601
|
+
editing styles by hand. Only the East Asian slot changes: Latin text and
|
|
602
|
+
the document's words stay as they were. The theme reference is removed
|
|
603
|
+
where the font is set, because a theme attribute wins over the explicit name.
|
|
604
|
+
"""
|
|
605
|
+
font = (font or "").strip()
|
|
606
|
+
if not font or not Path(docx_path).exists():
|
|
607
|
+
return
|
|
608
|
+
w = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
|
|
609
|
+
qn_ea, qn_theme = f"{{{w}}}eastAsia", f"{{{w}}}eastAsiaTheme"
|
|
610
|
+
|
|
611
|
+
def restyle(root) -> None:
|
|
612
|
+
for fonts in root.iter(f"{{{w}}}rFonts"):
|
|
613
|
+
fonts.attrib.pop(qn_theme, None)
|
|
614
|
+
fonts.set(qn_ea, font)
|
|
615
|
+
|
|
616
|
+
def ensure_default(root) -> None:
|
|
617
|
+
defaults = root.find(f"{{{w}}}docDefaults")
|
|
618
|
+
if defaults is None:
|
|
619
|
+
return
|
|
620
|
+
run_defaults = defaults.find(f"{{{w}}}rPrDefault")
|
|
621
|
+
if run_defaults is None:
|
|
622
|
+
run_defaults = etree.SubElement(defaults, f"{{{w}}}rPrDefault")
|
|
623
|
+
rpr = run_defaults.find(f"{{{w}}}rPr")
|
|
624
|
+
if rpr is None:
|
|
625
|
+
rpr = etree.SubElement(run_defaults, f"{{{w}}}rPr")
|
|
626
|
+
if rpr.find(f"{{{w}}}rFonts") is None:
|
|
627
|
+
rpr.insert(0, etree.Element(f"{{{w}}}rFonts"))
|
|
628
|
+
|
|
629
|
+
tmp = Path(str(docx_path) + ".cjkfont.tmp")
|
|
630
|
+
with zipfile.ZipFile(docx_path) as source, zipfile.ZipFile(tmp, "w", zipfile.ZIP_DEFLATED) as out:
|
|
631
|
+
for item in source.infolist():
|
|
632
|
+
data = source.read(item.filename)
|
|
633
|
+
if item.filename in {"word/styles.xml", "word/document.xml"} or re.fullmatch(
|
|
634
|
+
r"word/(?:header|footer)\d*\.xml", item.filename
|
|
635
|
+
):
|
|
636
|
+
root = etree.fromstring(data)
|
|
637
|
+
if item.filename == "word/styles.xml":
|
|
638
|
+
ensure_default(root)
|
|
639
|
+
restyle(root)
|
|
640
|
+
data = etree.tostring(root, xml_declaration=True, encoding="UTF-8", standalone=True)
|
|
641
|
+
out.writestr(item, data)
|
|
642
|
+
tmp.replace(docx_path)
|
|
586
643
|
|
|
587
644
|
|
|
588
645
|
def reference_docx_error(path: Path) -> str | None:
|
|
@@ -2108,6 +2165,7 @@ def run_docx_render(state: ReportState) -> ReportState:
|
|
|
2108
2165
|
has_front_matter,
|
|
2109
2166
|
cover_title=cover_title,
|
|
2110
2167
|
title_leads=title_leads,
|
|
2168
|
+
include_toc=state.spec.get("toc") is not False,
|
|
2111
2169
|
),
|
|
2112
2170
|
reference_doc,
|
|
2113
2171
|
)
|
|
@@ -2171,6 +2229,9 @@ def run_docx_render(state: ReportState) -> ReportState:
|
|
|
2171
2229
|
if repaired_figures:
|
|
2172
2230
|
state.output["post_render_figures_repaired"] = repaired_figures
|
|
2173
2231
|
_style_tables_post_render(str(final_docx_path))
|
|
2232
|
+
cjk_font = str(state.spec.get("cjk_font") or "").strip()
|
|
2233
|
+
if cjk_font:
|
|
2234
|
+
_apply_cjk_font(str(final_docx_path), cjk_font)
|
|
2174
2235
|
if has_front_matter:
|
|
2175
2236
|
_style_front_matter_title(
|
|
2176
2237
|
str(final_docx_path), (state.plan.get("front_matter") or {}).get("title", "")
|
|
@@ -2180,6 +2241,8 @@ def run_docx_render(state: ReportState) -> ReportState:
|
|
|
2180
2241
|
record_md, run_dir, _resolve_reference_doc(state.spec) if used_pandoc else None, used_pandoc
|
|
2181
2242
|
)
|
|
2182
2243
|
if record_path:
|
|
2244
|
+
if str(state.spec.get("cjk_font") or "").strip():
|
|
2245
|
+
_apply_cjk_font(str(record_path), str(state.spec["cjk_font"]))
|
|
2183
2246
|
state.output["calculation_record_docx_path"] = str(record_path)
|
|
2184
2247
|
|
|
2185
2248
|
# --- Post-render validation ---
|
{report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/factuality_check.py
RENAMED
|
@@ -584,16 +584,21 @@ _NOUN_CLASSIFIERS = frozenset({
|
|
|
584
584
|
})
|
|
585
585
|
|
|
586
586
|
|
|
587
|
-
|
|
587
|
+
#: Money units that make 「每X ... N 元」 a price per X even across a longer gap.
|
|
588
|
+
_MONEY_UNIT_WORDS = frozenset({"元", "美元", "萬元", "億元", "千元", "新台幣", "新臺幣", "台幣", "臺幣", "美金", "人民幣", "歐元", "日圓", "日元"})
|
|
589
|
+
_PER_PREFIX_MONEY_GAP = 14
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def _per_prefix_unit(text: str, number_start: int, max_gap: int = _PER_PREFIX_MAX_GAP) -> str:
|
|
588
593
|
"""The "每X" denominator governing a number, or "" when none does."""
|
|
589
|
-
window = text[max(0, number_start - (
|
|
594
|
+
window = text[max(0, number_start - (max_gap + 6)):number_start]
|
|
590
595
|
match = None
|
|
591
596
|
for candidate in _PER_PREFIX_RE.finditer(window):
|
|
592
597
|
match = candidate
|
|
593
598
|
if match is None:
|
|
594
599
|
return ""
|
|
595
600
|
between = window[match.end():]
|
|
596
|
-
if len(between) >
|
|
601
|
+
if len(between) > max_gap or _CLAUSE_BREAK_RE.search(between):
|
|
597
602
|
return ""
|
|
598
603
|
# 「每個擺長重複 5 次」 is "for each length, 5 times": 個 is the classifier
|
|
599
604
|
# of the noun that follows it, and that noun is the denominator, not 個.
|
|
@@ -615,8 +620,17 @@ def _per_prefix_unit(text: str, number_start: int) -> str:
|
|
|
615
620
|
def _combined_unit(text: str, number_start: int, suffix_unit: str) -> str:
|
|
616
621
|
"""Join a "每X" denominator to the unit written after the number."""
|
|
617
622
|
prefix = _per_prefix_unit(text, number_start)
|
|
623
|
+
if not prefix and suffix_unit and "/" not in suffix_unit and suffix_unit in _MONEY_UNIT_WORDS:
|
|
624
|
+
# 「每度平均售電價格約為 3.9674 元」: the denominator sits further from the
|
|
625
|
+
# number than the usual gap because the sentence names what is priced.
|
|
626
|
+
# A money amount after a 每X in the same clause is a price per X.
|
|
627
|
+
prefix = _per_prefix_unit(text, number_start, max_gap=_PER_PREFIX_MONEY_GAP)
|
|
618
628
|
if not prefix:
|
|
619
629
|
return suffix_unit
|
|
630
|
+
# 「每度 … 4.1007 元/度」 writes the denominator twice. The sentence already
|
|
631
|
+
# states the rate, so the 每X restates it rather than adding a second /X.
|
|
632
|
+
if suffix_unit.endswith("/" + prefix):
|
|
633
|
+
return suffix_unit
|
|
620
634
|
# A calendar word on both sides is a date, not a rate.
|
|
621
635
|
if prefix in _CALENDAR_UNITS and suffix_unit in _CALENDAR_UNITS:
|
|
622
636
|
return suffix_unit
|
|
@@ -10,6 +10,7 @@ from ..language import (
|
|
|
10
10
|
ZH_ORDINAL_PREFIX_RE,
|
|
11
11
|
derived_section_title,
|
|
12
12
|
detect_document_language,
|
|
13
|
+
has_heading_ordinal,
|
|
13
14
|
localized_section_title,
|
|
14
15
|
)
|
|
15
16
|
from ..runtime_support import write_json_artifact
|
|
@@ -91,6 +92,10 @@ def _canonical_heading(section_id: str, title: str, ordinal: int | None, languag
|
|
|
91
92
|
return f"# {title}"
|
|
92
93
|
if ordinal is None:
|
|
93
94
|
return f"# {title}"
|
|
95
|
+
# The author's own 「二、」「第二章」「2.」 stands; numbering it again printed
|
|
96
|
+
# 「二、二、台灣電力現況」. artifact_lint warns about the title.
|
|
97
|
+
if has_heading_ordinal(title):
|
|
98
|
+
return f"# {title}"
|
|
94
99
|
# A Chinese document numbers its first-level headings 一、二、三、 — the
|
|
95
100
|
# form ZH_ORDINAL_PREFIX_RE already reads back — not "1." which is how an
|
|
96
101
|
# English one does it.
|
{report_workflow-4.41.2 → report_workflow-4.41.3}/src/report_workflow/nodes/visual_render_check.py
RENAMED
|
@@ -47,6 +47,65 @@ def _find_executable(name: str, candidates: list[str]) -> str | None:
|
|
|
47
47
|
return None
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
def _resolve_soffice_executable(path: str) -> str:
|
|
51
|
+
"""The soffice.exe a `.cmd`/`.bat` shim launches, else `path` unchanged.
|
|
52
|
+
|
|
53
|
+
A shim such as ``~/.local/bin/soffice.cmd`` hands its arguments to cmd.exe,
|
|
54
|
+
which reads them in the console code page: a document under a Chinese
|
|
55
|
+
folder name came back as "returned non-zero exit status" while the same
|
|
56
|
+
command on soffice.exe converted it in seven seconds. The shim is a text
|
|
57
|
+
file naming the real program, so the program is found by reading it.
|
|
58
|
+
"""
|
|
59
|
+
if not str(path).lower().endswith((".cmd", ".bat")):
|
|
60
|
+
return path
|
|
61
|
+
try:
|
|
62
|
+
text = Path(path).read_text(encoding="utf-8", errors="replace")
|
|
63
|
+
except OSError:
|
|
64
|
+
return path
|
|
65
|
+
for quoted in re.findall(r'"([^"]+?soffice\.exe)"', text, flags=re.IGNORECASE):
|
|
66
|
+
if Path(quoted).exists():
|
|
67
|
+
return quoted
|
|
68
|
+
for name in ("soffice.exe",):
|
|
69
|
+
sibling = Path(path).with_name(name)
|
|
70
|
+
if sibling.exists():
|
|
71
|
+
return str(sibling)
|
|
72
|
+
return path
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _convert_to_pdf(soffice: str, docx_path: str | Path, visual_dir: Path) -> Path:
|
|
76
|
+
"""Convert with soffice; a path with non-ASCII characters goes through an ASCII copy.
|
|
77
|
+
|
|
78
|
+
LibreOffice's command line is fragile with such paths on Windows, so the
|
|
79
|
+
document is copied under an ASCII name in an ASCII temp folder, converted
|
|
80
|
+
there, and the PDF is brought back as ``<docx stem>.pdf`` in `visual_dir`.
|
|
81
|
+
"""
|
|
82
|
+
docx_path = Path(docx_path)
|
|
83
|
+
final_pdf = visual_dir / (docx_path.stem + ".pdf")
|
|
84
|
+
options = dict(capture_output=True, text=True, timeout=120, encoding="utf-8", errors="replace", check=True)
|
|
85
|
+
if str(docx_path).isascii() and str(visual_dir).isascii():
|
|
86
|
+
subprocess.run(
|
|
87
|
+
[soffice, "--headless", "--convert-to", "pdf", "--outdir", str(visual_dir), str(docx_path)],
|
|
88
|
+
**options,
|
|
89
|
+
)
|
|
90
|
+
return final_pdf
|
|
91
|
+
import tempfile
|
|
92
|
+
|
|
93
|
+
with tempfile.TemporaryDirectory(prefix="rw_visual_") as tmp:
|
|
94
|
+
work = Path(tmp)
|
|
95
|
+
source = work / "report.docx"
|
|
96
|
+
shutil.copyfile(docx_path, source)
|
|
97
|
+
out_dir = work / "out"
|
|
98
|
+
out_dir.mkdir()
|
|
99
|
+
subprocess.run(
|
|
100
|
+
[soffice, "--headless", "--convert-to", "pdf", "--outdir", str(out_dir), str(source)],
|
|
101
|
+
**options,
|
|
102
|
+
)
|
|
103
|
+
produced = out_dir / "report.pdf"
|
|
104
|
+
if produced.exists():
|
|
105
|
+
shutil.copyfile(produced, final_pdf)
|
|
106
|
+
return final_pdf
|
|
107
|
+
|
|
108
|
+
|
|
50
109
|
def document_sha256(docx_path: str | Path) -> str:
|
|
51
110
|
"""What a review applies to: the document body and its images.
|
|
52
111
|
|
|
@@ -148,6 +207,8 @@ def run_visual_render_check(state: ReportState) -> ReportState:
|
|
|
148
207
|
r"C:\Program Files\LibreOffice\program\soffice.exe",
|
|
149
208
|
r"C:\Program Files\LibreOffice\program\soffice.com",
|
|
150
209
|
])
|
|
210
|
+
if soffice:
|
|
211
|
+
soffice = _resolve_soffice_executable(soffice)
|
|
151
212
|
pdftoppm = _find_executable("pdftoppm", [
|
|
152
213
|
str(Path.home() / "AppData/Local/Microsoft/WinGet/Packages/oschwartz10612.Poppler_Microsoft.Winget.Source_8wekyb3d8bbwe/poppler-25.07.0/Library/bin/pdftoppm.exe"),
|
|
153
214
|
])
|
|
@@ -186,16 +247,7 @@ def run_visual_render_check(state: ReportState) -> ReportState:
|
|
|
186
247
|
return state
|
|
187
248
|
|
|
188
249
|
try:
|
|
189
|
-
|
|
190
|
-
[soffice, "--headless", "--convert-to", "pdf", "--outdir", str(visual_dir), str(docx_path)],
|
|
191
|
-
capture_output=True,
|
|
192
|
-
text=True,
|
|
193
|
-
timeout=120,
|
|
194
|
-
encoding="utf-8",
|
|
195
|
-
errors="replace",
|
|
196
|
-
check=True,
|
|
197
|
-
)
|
|
198
|
-
pdf_path = visual_dir / (Path(docx_path).stem + ".pdf")
|
|
250
|
+
pdf_path = _convert_to_pdf(soffice, docx_path, visual_dir)
|
|
199
251
|
if not pdf_path.exists():
|
|
200
252
|
raise QAHardBlockError("VISUAL_RENDER_CHECK: LibreOffice did not produce a PDF")
|
|
201
253
|
report["conversion_status"] = "succeeded"
|
|
@@ -242,7 +294,14 @@ def run_visual_render_check(state: ReportState) -> ReportState:
|
|
|
242
294
|
# a missing dependency reading as a defect in the document. Here the
|
|
243
295
|
# tool was on PATH as a shim whose own quoted path would not launch,
|
|
244
296
|
# which is a fact about this machine and about nothing else.
|
|
245
|
-
detail = str(getattr(exc, "stderr", "") or exc).strip()
|
|
297
|
+
detail = str(getattr(exc, "stderr", "") or exc).strip()
|
|
298
|
+
if isinstance(exc, subprocess.CalledProcessError):
|
|
299
|
+
# "returned non-zero exit status 1" says nothing about which command
|
|
300
|
+
# or which file; the full detail is what a person needs to fix it.
|
|
301
|
+
detail = f"exit {exc.returncode}: {detail}"
|
|
302
|
+
if exc.stdout and str(exc.stdout).strip():
|
|
303
|
+
detail += f" | stdout: {str(exc.stdout).strip()}"
|
|
304
|
+
detail = detail[:4000]
|
|
246
305
|
if report["conversion_status"] != "succeeded":
|
|
247
306
|
report["conversion_status"] = "failed"
|
|
248
307
|
if state.flags.get("strict_visual_render_check"):
|
|
@@ -352,6 +352,8 @@ def prepare_workflow(
|
|
|
352
352
|
source_citation_columns: list[str] | None = None,
|
|
353
353
|
source_citations: dict[str, dict] | None = None,
|
|
354
354
|
source_selections: dict[str, dict] | None = None,
|
|
355
|
+
cjk_font: str | None = None,
|
|
356
|
+
toc: bool | None = None,
|
|
355
357
|
) -> ReportState:
|
|
356
358
|
"""Prepare deterministic artifacts and agent task briefs.
|
|
357
359
|
|
|
@@ -370,8 +372,16 @@ def prepare_workflow(
|
|
|
370
372
|
source_selections: ``{"pages": [(start, end), ...]}`` or ``"lines"``
|
|
371
373
|
per source, keyed the same way; only blocks inside the span enter
|
|
372
374
|
the ledger, with their real page and line numbers.
|
|
375
|
+
cjk_font: East Asian font for the rendered document, e.g. 標楷體 or
|
|
376
|
+
DFKai-SB. Unset keeps the template's own choice.
|
|
377
|
+
toc: ``False`` leaves the table of contents out of the rendered
|
|
378
|
+
document; unset or ``True`` keeps it.
|
|
373
379
|
"""
|
|
374
380
|
state = ReportState.new(user_prompt, uploaded_files, output_dir, front_matter=front_matter)
|
|
381
|
+
if cjk_font and str(cjk_font).strip():
|
|
382
|
+
state.spec["cjk_font"] = str(cjk_font).strip()
|
|
383
|
+
if toc is False:
|
|
384
|
+
state.spec["toc"] = False
|
|
375
385
|
if report_profile:
|
|
376
386
|
state.spec["report_profile_override"] = report_profile
|
|
377
387
|
state.spec["task_intent"] = intent
|
|
@@ -553,6 +563,8 @@ def render_workflow(
|
|
|
553
563
|
*,
|
|
554
564
|
workspace_root: str | None = None,
|
|
555
565
|
reference_docx: str | None = None,
|
|
566
|
+
cjk_font: str | None = None,
|
|
567
|
+
toc: bool | None = None,
|
|
556
568
|
) -> ReportState:
|
|
557
569
|
"""Render and package a validated report workflow.
|
|
558
570
|
|
|
@@ -560,10 +572,18 @@ def render_workflow(
|
|
|
560
572
|
reference_docx: optional user-supplied .docx whose styles, margins,
|
|
561
573
|
and header/footer the rendered document should follow. Persists
|
|
562
574
|
into the run's spec so later re-renders keep the same template.
|
|
575
|
+
cjk_font: East Asian font name (e.g. 標楷體); persists in the spec.
|
|
576
|
+
toc: ``False`` drops the table of contents; ``True`` restores it.
|
|
563
577
|
"""
|
|
564
578
|
state = ReportState.resume(job_id, workspace_root=workspace_root)
|
|
565
579
|
if reference_docx:
|
|
566
580
|
state.spec["reference_docx_path"] = str(Path(reference_docx).resolve())
|
|
581
|
+
if cjk_font and str(cjk_font).strip():
|
|
582
|
+
state.spec["cjk_font"] = str(cjk_font).strip()
|
|
583
|
+
if toc is False:
|
|
584
|
+
state.spec["toc"] = False
|
|
585
|
+
elif toc is True:
|
|
586
|
+
state.spec.pop("toc", None)
|
|
567
587
|
_assert_render_ready(state)
|
|
568
588
|
return _run_nodes(state, render_nodes())
|
|
569
589
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: report-workflow
|
|
3
|
-
Version: 4.41.
|
|
3
|
+
Version: 4.41.3
|
|
4
4
|
Summary: Turn sources into a submission-ready report, with deterministic gates that block any claim not traceable to the evidence.
|
|
5
5
|
Author-email: 0Smallcat0 <noiroao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -53,7 +53,7 @@ mcp-name: io.github.0Smallcat0/report-workflow
|
|
|
53
53
|
|
|
54
54
|
[](https://github.com/0Smallcat0/report-workflow/actions/workflows/ci.yml)
|
|
55
55
|

|
|
56
|
-

|
|
57
57
|
[](LICENSE)
|
|
58
58
|
|
|
59
59
|
**繁體中文說明 → [README.zh-TW.md](README.zh-TW.md)**
|
|
@@ -156,11 +156,13 @@ src/report_workflow/validators/parse_validator.py
|
|
|
156
156
|
tests/test_adversarial_benchmark.py
|
|
157
157
|
tests/test_append_only_ledger_contract.py
|
|
158
158
|
tests/test_automation_harness.py
|
|
159
|
+
tests/test_batch1_2026_11_18.py
|
|
159
160
|
tests/test_benchmark_contracts.py
|
|
160
161
|
tests/test_calculation_record.py
|
|
161
162
|
tests/test_check_draft.py
|
|
162
163
|
tests/test_chinese_quantity_expressions.py
|
|
163
164
|
tests/test_cited_sources.py
|
|
165
|
+
tests/test_cjk_font_and_toc_2026_11_18.py
|
|
164
166
|
tests/test_column_roles.py
|
|
165
167
|
tests/test_decimal_comma_evidence.py
|
|
166
168
|
tests/test_declared_citation_propagation.py
|
|
@@ -182,6 +184,7 @@ tests/test_format_standards.py
|
|
|
182
184
|
tests/test_formula_derivations.py
|
|
183
185
|
tests/test_grouped_derived_evidence.py
|
|
184
186
|
tests/test_hallucination_gate.py
|
|
187
|
+
tests/test_heading_ordinals_2026_11_18.py
|
|
185
188
|
tests/test_improvements.py
|
|
186
189
|
tests/test_intake_summary_measures.py
|
|
187
190
|
tests/test_line_chart_markers.py
|
|
@@ -213,6 +216,7 @@ tests/test_state_checkpoint.py
|
|
|
213
216
|
tests/test_structured_draft_paragraphs.py
|
|
214
217
|
tests/test_structured_source_tables.py
|
|
215
218
|
tests/test_table_display_precision.py
|
|
219
|
+
tests/test_thousands_separator_2026_11_18.py
|
|
216
220
|
tests/test_trend_claims.py
|
|
217
221
|
tests/test_usability_audit_2026_10_19.py
|
|
218
222
|
tests/test_usability_consolidated_2026_10_21.py
|
|
@@ -220,5 +224,6 @@ tests/test_usability_review_2026_10_20.py
|
|
|
220
224
|
tests/test_usability_round3_2026_10_20.py
|
|
221
225
|
tests/test_verify_adapter.py
|
|
222
226
|
tests/test_version_sync.py
|
|
227
|
+
tests/test_visual_render_soffice_2026_11_18.py
|
|
223
228
|
tests/test_visual_review_status.py
|
|
224
229
|
tests/test_wide_table_landscape.py
|