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,render]" 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,render]" 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. Rendering wants pandoc; pip install "report-workflow[render]" carries it in the wheel, so there is nothing to install by hand. Without pandoc the renderer falls back to python-docx, with no real Word tables and none of the template's layout. The skill and the tool server arrive with the plugin, so cloning is only for 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.29.0.tar.gz (565.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.29.0-py3-none-any.whl (423.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: report_workflow-4.29.0.tar.gz
  • Upload date:
  • Size: 565.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.29.0.tar.gz
Algorithm Hash digest
SHA256 e3231c8b0b5029baad4f554f0b9373c0ff2fdef14bb72597e5835699d451e72f
MD5 db84aa2fa796bfad1294aa56c0c6ec3d
BLAKE2b-256 55eb498f2208bc8c4ddcece84048191184215c5516c1926d877da074ed8b30e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for report_workflow-4.29.0.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.29.0-py3-none-any.whl.

File metadata

File hashes

Hashes for report_workflow-4.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39cc4da981321e6bba92337ddd125cc4ec09f984516cb58f3ed6594e344dfa62
MD5 ab3259c82f535c522fa9acf967f7619e
BLAKE2b-256 43e4a054504eb43d4151111191b0a33f06762a212064a13c5d3bd834c19f883f

See more details on using hashes here.

Provenance

The following attestation bundles were made for report_workflow-4.29.0-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

This release

4.29.0 This release

2 files

4.28.2

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