Report Workflow
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
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:
examples/output/report.docx— table of contents, page numbers, a real Word table, a chart drawn from the source CSVexamples/output/client_readable_qa_note.md— every claim, its verdict, and the source row it rests on
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_report →
get_next_action / submit_action → publish_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.
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
- What the output looks like, profiles, templates, gates → docs/OUTPUT.md
- Measured catch rates and honest limits → docs/EVIDENCE.md
- Why it is built this way, threat model → docs/DESIGN.md
- Driving it from an agent → agent_skill/SKILL.md
- Developing this repository → AGENTS.md (authoritative contract)
- Reporting a bug, and what is in scope → CONTRIBUTING.md
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file report_workflow-4.28.0.tar.gz.
File metadata
- Download URL: report_workflow-4.28.0.tar.gz
- Upload date:
- Size: 561.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8b447b70cbb2a296ae388161a27b8865cf443c257c6f6d2b7ea5881b50b3f24
|
|
| MD5 |
5f2b594df8bbbd279bdc18789b9c12ab
|
|
| BLAKE2b-256 |
4c85602352977333974fdb68ab01c9f7074b22302119ff60080d4019c19c6e46
|
Provenance
The following attestation bundles were made for report_workflow-4.28.0.tar.gz:
Publisher:
release.yml on 0Smallcat0/report-workflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
report_workflow-4.28.0.tar.gz -
Subject digest:
f8b447b70cbb2a296ae388161a27b8865cf443c257c6f6d2b7ea5881b50b3f24 - Sigstore transparency entry: 2341562609
- Sigstore integration time:
-
Permalink:
0Smallcat0/report-workflow@2f9d2dae8b307446ffe805a238475985248cbe65 -
Branch / Tag:
refs/tags/v4.28.0 - Owner: https://github.com/0Smallcat0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2f9d2dae8b307446ffe805a238475985248cbe65 -
Trigger Event:
push
-
Statement type:
File details
Details for the file report_workflow-4.28.0-py3-none-any.whl.
File metadata
- Download URL: report_workflow-4.28.0-py3-none-any.whl
- Upload date:
- Size: 422.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26a2f52039b79278f7a3b37653f3c805ec5c81fb1785bef6eeca3c31144bbffc
|
|
| MD5 |
3f1279d7ddece1776bad1c7f5494fefd
|
|
| BLAKE2b-256 |
6fe138df7068b269ae63949d0d3cf659303fe361d2a36096b58b74649078bee7
|
Provenance
The following attestation bundles were made for report_workflow-4.28.0-py3-none-any.whl:
Publisher:
release.yml on 0Smallcat0/report-workflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
report_workflow-4.28.0-py3-none-any.whl -
Subject digest:
26a2f52039b79278f7a3b37653f3c805ec5c81fb1785bef6eeca3c31144bbffc - Sigstore transparency entry: 2341562630
- Sigstore integration time:
-
Permalink:
0Smallcat0/report-workflow@2f9d2dae8b307446ffe805a238475985248cbe65 -
Branch / Tag:
refs/tags/v4.28.0 - Owner: https://github.com/0Smallcat0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2f9d2dae8b307446ffe805a238475985248cbe65 -
Trigger Event:
push
-
Statement type: