
stacks
com.jakubdudek.stacks/stacks
Research cards: each claim with its source, a verbatim quote and a valid-until date. Read-only.
Documentation
stacks
A library of research cards in which every claim carries its source, a verbatim quote, the day it was checked and the day until which it is valid. The tool keeps the cards honest with mechanical gates, publishes the ones you allow as a reading room, and serves them to other people's agents through a read-only MCP server.
A card does not say that something is true today. It says what a source said on the day it was checked.
A library published with it: https://stacks.jakubdudek.com (its MCP server: https://stacks.jakubdudek.com/mcp).
What is in the box
- The card format (
docs/format.md): plain Markdown, one file per question. Conclusions in your own words, then claimsc1,c2, … each with a source, a quote,checkedandvalid until. A claim that is overturned moves to## Historywith its reason; its id never disappears. - Gates: a card is saved only when every quote is verbatim in the page you saved, every link was fetched, every
conclusion cites a claim that exists.
stacks refstells any document which of its[[card#c4]]references are live, in history or missing. - Publishing (
docs/publishing.md): a blacklist, a hold list, a privacy scan of the finished data, and, when the library is not written in the language you publish in, a translation gate that compares claim numbers, quotes, addresses and dates with the original. - The reading room and the MCP server (
docs/reading-room.md): one small server. Card pages, a permanent address for every claim, search, a change feed (RSS and JSON),llms.txt, every card as Markdown and JSON, and/mcpwith five read-only tools. - An invented example library (
example/): three cards about a harbour town that does not exist.
Start your own library
Python 3.11 or newer and git; nothing to install. Node 24 only for the reading room.
git clone <this repository> && cd stacks && export PATH="$PWD/bin:$PATH"
stacks init my-stacks && cd my-stacks
stacks fetch /tmp/run-1 https://example.org/some-page some-page # saves the page with the time in its name
stacks take my-first-question /tmp/run-1 # writes /tmp/run-1/card.md from the template
$EDITOR /tmp/run-1/card.md # conclusions, claims, quotes copied from the saved page
stacks save /tmp/run-1 # gates the card, writes it, rebuilds INDEX.md, commits
stacks status # which claims are past their date
stacks scan # dry run of publishing: what would go out, what is held and why
stacks serve # the reading room and the MCP server on http://localhost:4321
To look before you write anything: stacks --config example/stacks.toml serve.
Decisions
- The date belongs to the claim, not to the page. A card with forty claims does not go stale at once; each
claim has its own
valid until, set from the card's domain (30 days for AI tools, a year for law;[domains]instacks.toml). The room shows a claim past its date as not rechecked since that date. Nothing re-checks claims automatically: the room shows their state, a person renews them. - Nothing is deleted. A wrong or outdated claim moves to History with the reason and, where there is one, its successor. Its address keeps answering.
- A quote is copied, never retyped. The save gate looks for it, character for character, in the page saved by
stacks fetch. A translated quote is a paraphrase: it is shown without quote marks, under the original. - Saved pages are never published. They are other people's text and the evidence for the gates. Only the link and the quote go out.
- Publishing is opt-out by list, and the lists must be readable. A card goes out unless it is on
blacklist.txtorholds.txtor a gate holds it. If a list cannot be read, the export stops instead of treating it as empty. - Python with no dependencies for the tool: it runs where the notes are, including inside an agent's sandbox.
- Astro for the reading room. Pages are rendered on the server and read without JavaScript; the same process
answers the JSON, the feeds and
/mcp; a theme is a folder of components swapped with one setting, so a library keeps its own look outside this repository. The Content-Security-Policy allows no inline script. - English and Polish field names are both read (
quote/cytat,valid until/ważne do), because the first library written with this tool is Polish. New cards use the language set instacks.toml. - Replaceable parts. Fetching (
[fetch]: built in, or any command), search ([search]: Brave, Exa, SearXNG, or any command) and the optional panel of models that measures a checker with planted false claims ([panel]).
Tests
python3 -I tests/test_stacks.py # the tool, on throwaway copies of the example
stacks --config example/stacks.toml build # exports the example and builds the reading room
cd site && STACKS_DATA=../example/build/data STACKS_TODAY=2026-12-04 npm start &
STACKS_TEST_URL=http://127.0.0.1:4321 npm test # the MCP server, asked with the official client
The room listens on HOST and PORT (default localhost:4321); set them when the port is taken.
Licence
MIT, including the invented example library. See LICENSE.
No installation packages available.