Skip to content

Add documentation for fact-checking project reports - #190

Open
cmungall wants to merge 4 commits into
mainfrom
claude/elegant-mendel-1o0b7r
Open

cmungall wants to merge 4 commits into
mainfrom
claude/elegant-mendel-1o0b7r

Conversation

@cmungall

@cmungall cmungall commented Dec 1, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds comprehensive documentation for using LRV to fact-check project status reports and similar documents that cite local markdown sources. It includes both a detailed use case guide and a practical how-to guide with step-by-step instructions.

Changes

  • New use case guide (docs/use-cases/project-reports.md): Comprehensive documentation covering:

    • The problem LRV solves for project managers (hallucinated status claims)
    • A complete workflow for drafting, checking, reviewing, and publishing reports
    • The claim marker convention: [source: <REFERENCE> "<EXCERPT>"]
    • Detailed instructions for snapshotting sources (meetings, GitHub issues, Google Docs, metrics)
    • How to run validation checks and interpret results
    • A proposed helper script (report_claims.py) for linting, stripping, and reviewing markers
    • Integration with Claude Code hooks for automated checking
    • Discussion of regex limitations and alternative syntaxes (HTML spans)
    • Proposed future enhancements to LRV
  • New how-to guide (docs/how-to/check-markdown-reports.md): Step-by-step instructions for checking markdown reports against local sources:

    • Setting up the sources/ and reports/ folder structure
    • Writing source markers with the correct syntax and rules
    • Running the validation check with the regex
    • Fixing validation failures
    • Catching malformed markers with the lint step
    • Reviewing claims in a table format
    • Stripping markers for stakeholder distribution
    • Integrating with agent skills and Claude Code hooks
  • Updated documentation index (docs/index.md): Added links to the new guides in the navigation

  • Updated mkdocs configuration (mkdocs.yml): Added the new how-to guide to the navigation structure

Implementation Details

The documentation introduces a practical convention for embedding source citations in markdown reports that can be validated deterministically by LRV's validate text-file command. The guides include:

  • Real working examples with actual LRV output
  • A reusable Python helper script for linting and processing markers
  • Bash scripts for automated checking
  • Clear rules for when and how to use markers
  • Discussion of trade-offs between different approaches (regex vs. HTML spans)
  • Guidance on preventing common mistakes (agent-written sources, edited excerpts, etc.)

The documentation is grounded in actual working examples that have been tested with the current LRV CLI.

Most docs assume literature references (PMID, DOI). This page shows LRV
checking a PM's monthly report against non-literature sources: meeting
notes, Google Docs exports, GitHub issue snapshots and scripted metrics,
all as local markdown files for v1.

Covers a [source: <ref> "<excerpt>"] claim convention checked with the
existing `validate text-file --regex`, snapshot scripts for GitHub issues
and counts, what a pass does and doesn't establish, the regex's silent
skips and a lint for them, a deterministic strip step for the stakeholder
copy, a draft agent skill, and possible future gdoc:/gh: prefixes. All
LRV outputs shown come from real runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjkEiwfjfgydYqJ3iMEQkR
Adds why `validate text-file --regex` is today's only route for prose
reports and where it is awkward (#40),
compares the bracket marker with an inline HTML span form, including how
each fares in Google Docs, and points to the span proposal in
#91.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjkEiwfjfgydYqJ3iMEQkR
Says up front that the PM runs the check through the skill or a Claude
Code PostToolUse hook rather than typing commands, with a tested hook
script. Calls the Google Docs export step clunky and sketches a
gdrive:<fileId> prefix (with a tab for Sheets) in place of the earlier
gdoc: idea.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjkEiwfjfgydYqJ3iMEQkR
A step-by-step guide for the PM use case that assumes every source is a
local markdown file: lay out sources/, add [source: file:... "..."]
markers, run validate text-file with the marker regex, fix each failure
message, lint for markers the regex skips, wrap both in one script,
review claims beside excerpts, and strip markers for the stakeholder
copy. Ends with extensions (url:, Google Docs, GitHub issues, a built-in
claim syntax). Every file and command was extracted from the page and
run in a fresh folder; outputs shown are real.

Linked from the How-To nav and from the project-reports use case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjkEiwfjfgydYqJ3iMEQkR
@claude

claude Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cmungall's task in 2m 9s —— View job


PR review: docs for fact-checking project reports

  • Read the how-to and use-case guides
  • Re-ran the how-to's worked example with the real CLI from this branch
  • Ran report_claims.py (lint / review / strip) on the example files and on some edge cases
  • Checked cross-links and ran mkdocs build --strict
  • Posted review

Overall: These are strong pages. The how-to's example reproduces exactly as written. I built the sources/ and reports/ files from the page, and validate text-file printed the same output byte for byte (6 matches, 4 valid, 2 invalid, exit 1). The messages in the failure table are also real:

  • No source found for reference type
  • File not found
  • Text part occurs only inside longer words
  • No matches found in file., which exits 0

The lint, review and strip outputs match the page too. mkdocs build --strict passes, and every anchor resolves, including #local-files-are-not-cached and cli.md#validate-text-file. The GHISSUE:acme/disease-db/issues/234 example works: slashes pass through url_template.format, and the cache filename comes out as GHISSUE_acme_disease-db_issues_234.md.

Most of my comments are about the helper script. The pages are the only test for it, so small gaps there matter.

1. The script is copied into both pages, and the copies already differ

report_claims.py and check-report.sh appear in full on both pages:

  • report_claims.py: docs/how-to/check-markdown-reports.md:238-297 and docs/use-cases/project-reports.md:450-509
  • check-report.sh: docs/how-to/check-markdown-reports.md:318-327 and docs/use-cases/project-reports.md:526-534

The differences so far:

  • The use-case page runs python, the how-to runs python3.
  • The use-case check-report.sh has no cd "$(dirname "$0")/..". Its hook works around this with its own cd, but running the script by hand from a subfolder breaks the file: paths.

I'd keep the full listing only in the how-to and link to it from the use case. Better still, since CLAUDE.md asks for tested code, ship it as a real file (e.g. examples/project-reports/) with a small pytest that runs the example. That turns "every output shown comes from running the current CLI" into something CI checks. Fix this →

2. A mistyped mode exits 0

python3 scripts/report_claims.py reveiw report.md runs lint, prints nothing and exits 0, because __main__ has no else branch. In a page about checks that pass silently, the helper should fail loudly. Suggestion:

    if mode not in ("lint", "strip", "review"):
        sys.exit(f"usage: {sys.argv[0]} {{lint|strip|review}} REPORT.md")

3. A report with no markers passes both checks

A report that is only prose (e.g. Prose paragraph claiming 300 diseases.) passes lint, because only bullets are checked. LRV then prints No matches found and exits 0, so check-report.sh reports success. The how-to mentions the exit-0 case in its table. It would be cheap for lint to fail when it finds no strict markers at all, which closes the gap for the hook and the skill.

4. strip doesn't check that the report passed

strip and review run lint first, but they don't run LRV. I ran strip on the uncorrected draft and it produced a tidy stakeholder copy that still says "Carla has already approved the loader PR". The skill says to strip "only after the check passes", but nothing enforces it. Possible fixes:

  • Add one sentence to how-to step 8 and the use-case's Stakeholder copy section saying strip doesn't validate.
  • Or add a scripts/publish-report.sh that runs check-report.sh && report_claims.py strip.

5. Lint flags ordinary markdown links (minor)

LOOSE = r"\[\s*sources?\b" also matches ordinary links such as [Source code](https://…). I confirmed that - See [Source code](https://x) for details [assessment] gets reported as a malformed marker. Requiring a colon would stop this and still catch the Source: case typo:

LOOSE = re.compile(r"\[\s*sources?\s*:", re.IGNORECASE)

The catch is that a marker missing its colon would no longer be flagged. Either choice is fine, but the docs should say which one was made.

6. Smaller points

  • Hook pattern: */reports/*.md in check-report-hook.sh (project-reports.md:566) matches any folder named reports, including sources/foo/reports/x.md. That's probably harmless. The hook also needs jq, which the page doesn't list as a requirement.
  • Lint output on the use-case page (project-reports.md:511-521): it lists lines 6–8 of reports/brittle.md, but the page only shows those three lines, not the whole file. That's fine, but showing the file or saying "lines 6–8 of an 8-marker file" would make the output easier to follow.
  • PR description: it says docs/index.md links the new guides, but only the use-case page was added there. index.md doesn't list how-tos anyway, so this is only a description fix.

Performance and security

  • Performance: no concerns.
  • Security: both pages correctly stress that file: content is never cached, and that GHISSUE content is written to cache_dir and shouldn't be committed for a private repo.
  • gh api snapshot script: it writes issue bodies straight into markdown. That's fine because LRV only reads them as text.

Test coverage

This PR only changes docs, so no tests were added. Point 1 suggests a cheap way to keep the example from going stale.

@cmungall
cmungall requested a review from nlharris December 4, 2026 02:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants