Repository avatar
Version Control
v0.6.1
active

refract

io.github.zz-plant/refract

git log for Wikipedia: typed events for changed sentences, citations, and structure on any page.

Documentation

Refract

git log for Wikipedia.

See how a page's sentences, citations, and structure changed, revision by revision, as data you can check. Runs locally, with no API key or model.

Documentation · CLI reference · Compared to XTools and WikiBlame

CI Version License: AGPL-3.0

Watch Pluto stop being a planet

On 24 August 2006, the International Astronomical Union reclassified Pluto as a dwarf planet. Wikipedia's Pluto article went through 43 revisions in under an hour that afternoon. Here is what Refract reports for its first sentence:

UTCFirst sentenceSource
13:39Pluto is the ninth and smallest of the traditional planets of the Solar system, though its status as a planet has been disputed…revision
13:40Pluto is the ninth and smallest of the traditional planets of the Solar system, but on August 24, 2006 it was 'demoted'…diff
13:41Pluto was until recently considered the ninth…diff
13:59Pluto is considered the ninth and smallest of the traditional planets of the Solar system, except by the IAU…diff
14:09Pluto is widely considered the ninth…diff
14:10Pluto was considered the ninth…diff
14:20Pluto at one time was considered the ninth…diff
14:37Pluto was considered the ninth and smallest of the planets of the Solar system…diff

Rows are excerpts and skip the edits between them. Captured events · Walkthrough. Article text by Wikipedia contributors, CC BY-SA.

Follow that sentence yourself (Node.js 20+ and network access). This prints it from each of the 43 revisions:

npx @refract-org/cli claim Pluto --text "ninth and smallest" --from 71593043 --to 71601937

Browse every change from that hour as a timeline. Fetching takes about a minute, then your browser opens:

npx @refract-org/cli explore Pluto --from 71593043 --to 71601937

Refract reports what changed. Why it changed, and whether that matters, is for you to judge.

Who it's for

  • Researchers and journalists who need to show when a statement appeared, changed, or lost its citation.
  • Developers feeding wiki content to RAG pipelines or agents who need change events alongside the current text.
  • Anyone who relies on a set of wiki pages and wants to see what changed since they last checked.

Refract reads Wikipedia and any other MediaWiki wiki. It does not fetch arbitrary web pages; the libraries accept versioned text you supply. Events carry no editor identity, and the misuse policy rules out editor targeting.

Questions it answers

Your questionCommandWhat you receiveStart here
“What changed in my pages since my last review?”refract reviewPending changes with full text, source links, coverage, and explicit acknowledgmentReview a watchlist
“When did this text appear, change, or disappear?”refract claimCandidate text, match kind, latest revision, and status within the fetched revisionsInspect changes to a passage
“What did the page say at an earlier date?”refract snapshotA text preview and revision ID at or before the requested dateInspect an earlier record
“My application needs changes as data.”refract exportNDJSON events to filter, store, or pass to your review processBuild a review feed

Install

npm install -g @refract-org/cli
refract analyze "Bitcoin" --depth detailed --json

This reads the page's latest 20 revisions. Use a page title, not a URL. For another wiki, pass its api.php endpoint with --api.

Choose a history range and output mode · Install compatibility

Try it offline

init runs the analyzers on a bundled fictional library history and makes no wiki requests:

npx @refract-org/cli init

Three observations from the fictional Rivergate Library sample: changed wording, removed reference, and returned text

review keeps changes pending until you acknowledge an inspected report, then compares later runs against that point:

npx @refract-org/cli review --sample --from 1 --state-dir ./review-state

Complete review workflow · Captured review · Offline recipe

What Refract captures

Part of the recordExamples
SentencesFirst observed, modified, removed, reintroduced
CitationsAdded, removed, replaced
Document structureSection changes, lead/body changes, page moves
Links, categories, templatesAdded, removed, template parameters changed
Revision activityRevert patterns and edit clusters
Talk pages and access controlsNearby talk-page activity and protection changes

Events can carry deterministic enrichment fields such as change magnitude, extracted terms, and certainty-marker counts. Event reference

How it works

Refract compares revisions under deterministic rules and makes no model calls. The same captured inputs, analyzer versions, and configuration produce the same events; export timestamps can differ. Coverage is limited to the analyzed revisions and the matching rules.

A citation does not establish that a statement is supported, and changed wording does not establish that editors disputed it. Your application decides what the events mean.

Architecture · Claim-state timelines · Repository boundary · Share or check a result

Use it in your application

InterfaceUse it whenExample
CLIYou want to inspect or export a page's historyrefract export "Bitcoin" --from 369361755 --to 369393212 --format ndjson
LibrariesYou already fetch revisions or own versioned text inputsbuildRevisionEvents(revisions, { depth: "detailed" })
MCPAn agent needs to request histories and receive structured observationsrefract mcp
PythonYou work in Python and want events as dataclasses, DataFrames, or LangChain documentspip install "git+https://github.com/refract-org/refract.git#subdirectory=clients/python"
Agent skillYour coding agent should know which command answers which questioncp -R skills/refract ~/.claude/skills/
ViewerYou want to browse an exported file in a browserapps/ui

Library adapter and data integrations · MCP setup · Agent skill · Private wiki access

Development and testing

git clone https://github.com/refract-org/refract.git
cd refract
bun install
bun run build
bun run test
bun run lint

The apps are workspaces with their own checks, run from their directories: bun run lint, bun run test and bun run build in apps/docs or apps/ui. The Python adapter uses Hatch and pytest in clients/python. CI runs them in docs-site.yml, viewer.yml and python.yml, separately from the engine gate.

PackageRole
@refract-org/evidence-graphTypes, schemas, identity and verification primitives
@refract-org/ingestionMediaWiki access, pagination, retries, and authentication
@refract-org/analyzersDeterministic revision comparisons and enrichment
@refract-org/cliCommands and the local browser explorer
@refract-org/mcpMCP library; the executable is refract mcp from the CLI
@refract-org/persistenceLocal SQLite persistence; not published
@refract-org/evalEvaluation harness and independently sourced labels

Runnable examples · Benchmark corpus · Repository map and related projects

License

AGPL-3.0. See LICENSE.

If you modify this software and deploy it as a network service, you must release your modifications.

Commercial use: NextConsensus offers commercial licenses for proprietary integration without AGPL obligations. See nextconsensus.com.

Community

NPM
@refract-org/cli
Install Command
npm install @refract-org/cli