agentleFS
QuarktexQuarktex/qcobrain/skills/verify-provenance/SKILL.md

verify-provenance

Skill4 starsChanged 4 months agoMITView on GitHub

The model-free proof of qcobrain's one promise: every claim in wiki/ re-resolves, verbatim, in sources/. /wiki-doctor describes this check as a reasoning workflow; this skill makes it a plain script anyone — a contributor, CI, or a skeptic evaluating the repo — can run to PROVE the graph holds with no LLM in the loop. If it exits 0, cite-or-refuse is intact; if it exits non-zero, something drifted and the message says exactly what. It needs nothing but Python 3…

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every `src block names a source key that is registered in sources/_sources.md.

    line 34
  2. Very specific:

    Every superseded_by: / supersedes: target resolves to a real note.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: verify-provenance

The model-free proof of qcobrain's one promise: every claim in wiki/ re-resolves, verbatim, in sources/. /wiki-doctor describes this check as a reasoning workflow; this skill makes it a plain script anyone — a contributor, CI, or a skeptic evaluating the repo — can run to PROVE the graph holds with no LLM in the loop. If it exits 0, cite-or-refuse is intact; if it exits non-zero, something drifted and the message says exactly what.

Run it

python3 skills/verify-provenance/verify_provenance.py          # full report
python3 skills/verify-provenance/verify_provenance.py --quiet  # summary + failures only (CI mode)
python3 skills/verify-provenance/verify_provenance.py --root .  # explicit repo root

It needs nothing but Python 3 (standard library) and reads only wiki/ and sources/. No network, no config, no API key, no model.

What it checks

For every wiki/<id>.md note (it skips README.md and any file without a frontmatter id:):

Hard checks — any failure exits non-zero:

  1. Every ```src block names a source key that is registered in sources/_sources.md.
  2. The registered source file exists on disk.
  3. The source's live sha256[:12] matches the hash recorded in sources/_sources.md (no silent drift).
  4. The block's quote re-resolves as a verbatim substring of that source (whitespace-normalized).
  5. A note carries at least one ```src block — a wiki/ note with no citation belongs in inbox/.
  6. Every superseded_by: / supersedes: target resolves to a real note.

Soft checks — reported as warnings, never fail the build:

  • The block hash: differs from the live source (note captured against an older source version — the quote still re-resolves, so it is informational).
  • The block anchor: heading is not found in the source.
  • A links: or inline [[wikilink]] target note does not exist; an active note nothing links to (orphan).

How it relates to the other integrity tools

  • /wiki-doctor is the broader, model-driven weekly sweep: it ALSO regenerates INDEX.md and digests/ and burns down inbox/. This script does none of that — it only verifies, deterministically.
  • CI (.github/workflows/provenance.yml) runs this on every pull request, so a citation can never silently drift on main.

It is read-only: it never edits a note or a source. When it reports drift, the fix is the same as ever — repair the note, never edit the source to match it (references/kernel.md).

Files

  • verify_provenance.py — the runnable verifier (Python 3 stdlib only; --root / --quiet flags; exit 0 = sound, 1 = at least one hard failure).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.