citation_verification
AGENTS.md8 starsChanged 10 days agoMITView on GitHub
Keep this short — every line costs attention each session. Deep rationale lives in docs/architecture.md and docs/DECISIONS.md; the verification method and the frozen output table live in .claude/skills/verify-citations/SKILL.md. - Install (offline floor): uv pip install -e '.[dev]' (or make install). No claude-agent-sdk, no API key, no network needed for the core. - Test: make test (full pytest suite, offline) · make smoke (tests + run_eval on the in-repo smoke gold). - Lint: make lint (ruff). - Verify a paper (needs…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,040 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- verify-citationsSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 45
Don't commit anything under .env* (except .env.example), secrets/, or *.key.
- Distinctive: line 47
Don't push directly to main — open a PR.
- Distinctive: line 80
Ask a clarifying question before generating code.
- Distinctive: line 81
Prefer surgical changes over big refactors.
- Distinctive: line 82
If a change touches a contract file, raise it with the team first.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — what an agent/contributor reads at session start
Keep this short — every line costs attention each session. Deep rationale lives in
docs/architecture.mdanddocs/DECISIONS.md; the verification method and the frozen output table live in.claude/skills/verify-citations/SKILL.md.
How to run
- Install (offline floor):
uv pip install -e '.[dev]'(ormake install). Noclaude-agent-sdk, no API key, no network needed for the core. - Test:
make test(full pytest suite, offline) ·make smoke(tests +run_evalon the in-repo smoke gold). - Lint:
make lint(ruff). - Verify a paper (needs LLM backend +
.env):cverify <arxiv-id | arxiv-url | path.pdf> --backend agentic|claude_code. - Verify only the comparison tables:
cverify <source> --tables only(--tables offskips them; default is on, with the citations). - Check one reference (no LLM):
python -m citation_verifier.grounding.paper_lookup "<reference string>". - Regenerate / check the schema spec:
make schema. - Build the dataset:
chbench build(full) — seedocs/DATASET.md.
Conventions
- Python 3.11+.
pydanticv2 for the schema. - Functions are short. If something needs a paragraph of comment to explain, refactor it.
- Type-hint module boundaries (the Protocols in
interfaces.pyare the seams); internal code can be lighter. snake_casefunctions,PascalCaseclasses,ALL_CAPSconstants.- The core (schema + render + eval + grounding floor) MUST import and run
without the SDK and without network.
claude-agent-sdkis a lazy, optional import; network calls fail soft.
What's off-limits (the frozen seams — changes need team sign-off)
src/citation_verifier/schema.py,interfaces.py,__init__.py,spec/v0.1/record.schema.json, and.claude/skills/verify-citations/SKILL.mdare the contract. The 8-column table and the four enum vocabularies must stay token-for-token in sync (the tests intests/test_schema.pyenforce this).evals/is the scoring boundary: the agent never importsevals/and vice versa. Gold is built by a different resolver than the agent uses (anti-circularity).- Don't commit anything under
.env*(except.env.example),secrets/, or*.key. Per-paper artifacts underpapers/<id>/are gitignored. - Don't push directly to
main— open a PR.
Where the important stuff lives
src/citation_verifier/schema.py—CitationRecord(the contract) + enums +derive_severity.src/citation_verifier/interfaces.py— Extractor / Resolver / VerificationBackend / StageFn Protocols +PaperSource/RunUsage/VerificationResult.src/citation_verifier/orchestrator.py—run_verification(source, backend=...).src/citation_verifier/{ingest,extract,grounding,stages,backends,render,cli}— the pipeline modules (see the structure table inREADME.md).src/chbench/— CitationHallucinationBench (dataset).evals/—run_eval.py,metrics.py,smoke/gold.jsonl.config/{sources,venues}.yaml— source params + chbench harvest scope (no secrets).src/citation_verifier/data/venues.yaml— the venue alias table (every spelling of a conference/journal → one key), read bycitation_verifier/venues.pyfor the cited-vs-canonical venue check. Add a venue or a spelling there; inspect a pair withpython -m citation_verifier.venues "<cited>" "<canonical>".papers/— per-paper input/artifact dirs.
Operating principles
- Think before coding — state assumptions; surface confusion first.
- Respect the seam — depend only on
schema+interfaces, never another module's internals. - Degrade, don't crash — a stuck
(claim, citation)pair becomes oneunverifiedrow; the run continues. - Never decide correctness from memory — ground every verdict in retrieved
evidence, or mark it
unverified.
When in doubt
- Ask a clarifying question before generating code.
- Prefer surgical changes over big refactors.
- If a change touches a contract file, raise it with the team first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

