Skip to main content

Report Workflow

CI Python Tests License: MIT

Give your coding agent a folder of sources and one sentence. Get back a DOCX you can hand in — and a refusal for every claim that cannot be traced to those sources.

The package calls no LLM and needs no API key. It owns source parsing, the evidence ledger, the gates, and rendering; your agent (Claude Code, Codex, …) owns the judgment and the writing. Nothing the agent drafts reaches the page unless the numbers, quotes, and citations in it appear in your material — so an invented statistic or a fabricated reference is blocked, with the gate and the reason that stopped it.

What comes out

Three pages of a pipeline-rendered DOCX report: a title-and-abstract page, a table of contents, and a page with a line chart derived from the source data with a self-contained caption.

A finished document, and the audit trail that says why each sentence was allowed to ship. Both are in this repository, produced by the example below:

Seven document types — lab report, academic paper, business report, proposal, two admissions formats, and a general one — in English or Chinese, optionally following your own Word template. The quantitative analysis a grader looks for (a fitted slope against theory, R², a budget total) is computed from your data and registered as citable evidence, so the agent never has to invent it.

Profiles, Chinese-document handling, templates, and the gate list: docs/OUTPUT.md.

Drive it from your agent

In Claude Code, install the plugin — it brings the skill and the tool server together, and nothing needs cloning:

/plugin marketplace add 0Smallcat0/report-workflow

Then /plugin install report-workflow@report-workflow. Any other MCP-capable agent (Codex, Cursor, your own harness) gets the same tools with one command:

claude mcp add report-workflow -- uvx --from "report-workflow[mcp]" report-workflow-mcp

Then ask in your own words:

Use report-workflow to turn the files in ./data into a business report for the operations manager: what changed, what it costs, whether to adopt it.

The skill hands the agent the contract — prepare the sources, write claims and prose against the evidence ledger, submit for validation — and the pipeline answers. A claim it cannot support comes back blocked with the gate that caught it, so the agent has to fix the sentence, not the verdict.

No agent to hand? The same path runs offline with a scripted author standing in for one:

python examples/source_to_report.py

Three files and one sentence in, the DOCX and QA pack above out. Swap the paths at the top of that script for your own material; the honest note about what it does on your agent's behalf is in examples/README.md.

The CLI

The same pipeline, driven by hand or from a script:

report-workflow prepare --prompt "write an engineering lab report" \
  --source source.txt --output out --profile engineering_lab_report \
  --preflight-decisions preflight.json
report-workflow validate --job-id <job_id>
report-workflow render   --job-id <job_id>

Exit codes: 0 success, 1 crash, 2 hard-block, 3 waiting for user decisions or agent-authored artifacts. Add --reference-docx your.docx to follow your own Word template. Between prepare and validate something has to write the claims, outline, and drafts — that is the agent's half.

MCP server

The whole pipeline is exposed as tools, not just the gate: start_reportget_next_action / submit_actionpublish_report, with verify_claims, query_evidence, and lint_artifacts alongside. An agent with the server installed can take a folder of sources to a finished DOCX without a copy of this repository. Payloads: docs/mcp.md.

claude mcp add report-workflow -- uvx --from "report-workflow[mcp]" report-workflow-mcp

The gate on its own

No pipeline, no schema, no API key — pass an answer and the source it was supposed to be grounded in:

from report_workflow import verify

result = verify(
    answer="The error rate fell to 0.2% [1].",
    sources={"1": "The error rate fell to 3.5% under the structured workflow."},
)
result["publishable"]                      # False
result["sentence_results"][0]["checker"]   # "FE"
result["sentence_results"][0]["reason"]    # "Claim number '0.2'% not found in evidence content..."

A pure function of (answer, sources): same verdict every run, zero tokens, works offline and in CI. Scope, stated plainly: a fidelity gate, not a general hallucination detector. It catches invented numbers, fabricated citations, misquotes, and unit swaps; it does not judge meaning, so a fluent paraphrase that reverses the source is out of scope. That boundary is measured on 10,000 outside pairs, with catch rates, baselines, and the comparison to LLM-as-judge tools: docs/EVIDENCE.md.

Runnable, no local install: Open In Colab

Install

pip install report-workflow covers the gates, verify(), and the report-workflow CLI — the whole source-to-DOCX pipeline. Add pandoc 3.x for full rendering; without it the renderer falls back to python-docx with degraded table and layout fidelity. Clone the repository for the agent skill, the example scripts, and the benchmarks: pip install ships the package, not the examples.

pip install -r requirements.txt
pip install -e .
pandoc --version

Optional: pip install -e .[mcp] for the MCP server, mmdc for Mermaid diagrams, TAVILY_API_KEY / SERPER_API_KEY / SERPAPI_API_KEY for web research, notebooklm-py for NotebookLM sync.

If the report-workflow command fails silently — common on Windows when a stale report-workflow.exe sits on PATH — use python -m report_workflow, which always runs against the interpreter you invoke.

Where to go next

Specified, integrated, and verified by its author, with coding agents doing much of the implementation — the deterministic gates and the benchmark harness exist so a human, not a model, holds the final "is this correct?" decision.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

report_workflow-4.28.2.tar.gz (563.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

report_workflow-4.28.2-py3-none-any.whl (422.8 kB view details)

Uploaded Python 3

File details

Details for the file report_workflow-4.28.2.tar.gz.

File metadata

  • Download URL: report_workflow-4.28.2.tar.gz
  • Upload date:
  • Size: 563.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for report_workflow-4.28.2.tar.gz
Algorithm Hash digest
SHA256 b3a47241afd982cba18c696b560d149410846af8eabdbb4bb7780b9d0dfd0cc4
MD5 903f746b0670d69a5d71b384ef53246c
BLAKE2b-256 d71d4b7719d86ef153ec179847595541ee0aa6b144014eb705722273c7e5e925

See more details on using hashes here.

Provenance

The following attestation bundles were made for report_workflow-4.28.2.tar.gz:

Publisher: release.yml on 0Smallcat0/report-workflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file report_workflow-4.28.2-py3-none-any.whl.

File metadata

File hashes

Hashes for report_workflow-4.28.2-py3-none-any.whl
Algorithm Hash digest
SHA256 337007d77e3a769aea7dcc1ea9b632868dd3baf89a67842d1b779c95d3b2647d
MD5 3c8525d72615318b69b478bf50e6794b
BLAKE2b-256 bad6dff229b62e80b8e36a81f0f8c126c9af30a52d313bdd8bba4d92bcd37285

See more details on using hashes here.

Provenance

The following attestation bundles were made for report_workflow-4.28.2-py3-none-any.whl:

Publisher: release.yml on 0Smallcat0/report-workflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

4.39.0

2 files

4.38.0

2 files

4.37.0

2 files

4.36.1

2 files

4.36.0

2 files

4.35.0

2 files

4.34.0

2 files

4.33.0

2 files

4.31.0

2 files

4.29.1

2 files

4.29.0

2 files

This release

4.28.2 This release

2 files

4.28.1

2 files

4.28.0

2 files

4.27.1

2 files

4.27.0

2 files

4.23.1

2 files

4.23.0

2 files

4.22.1

2 files

4.22.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page