Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

### Added

- **External anchoring of the ledger head.** `protocolith anchor` (also `core.anchor_head` and the MCP tool `protocolith_anchor`)
writes an anchor statement (canonical JSON of the head; its sha256 is the `anchor_id`) to `<store>/anchors/`, and optionally
adds an RFC 3161 time-stamp (`--tsa URL`; the signature is not verified by the core, the `openssl ts -verify` command is printed),
a Wayback snapshot (`--wayback URL`), a local git tag (`--git-tag [--sign]`, never pushed) and a statement file
(`--write-head FILE`). Nothing networked or git-related happens without its option. `verify-ledger --anchors`
(`core.verify(store, anchors=True)`, `core.verify_anchors`, MCP `protocolith_verify` with `anchors`) reports
`ANCHOR_MISMATCH` (ledger rewritten), `ANCHOR_AHEAD` (truncated) and `ANCHOR_INVALID`; `summary` shows the number of
anchors and the last anchored `seq`. New error codes: `ANCHOR_MISMATCH`, `ANCHOR_AHEAD`, `ANCHOR_INVALID`,
`ANCHOR_EXISTS`, `ANCHOR_FAILED`, `NOT_A_GIT_REPO`, `EMPTY_LEDGER`, `BAD_URL`. Conformance vectors: `spec/vectors/anchors.json`.
Specification section 13 and the guide [Anchor your results](docs/guides/anchor-your-results.md).
- **`claim_check`** (`protocolith claim-check --seq N | --protocol ID`, `core.claim_check`, MCP `protocolith_claim_check`):
what may and may not be said about a record (`supported`, `may_say`, `must_not_say`, anchored, frozen before the record,
independent reproduction), from fixed templates. Specification section 14.
- **MCP prompts**: `prompts/list` and `prompts/get` with `research-agent-protocol`, instructions for an AI agent;
`initialize` advertises tools, resources and prompts. The server now has thirteen tools.
- `mypy --strict` runs in CI over `protocolith.core` (`uv run mypy`); `mypy` joins the `dev` extra.
- README badges for status, package, repository and project facts; a ledger and core issue form; a ledger demo GIF generated from a real run (`scripts/build_demo_gif.py`).

Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ protocolith atlas --cards docs/evidence_cards --out site/

## MCP client configuration

`protocolith mcp` is a stdio server with eleven tools (`protocolith_summary`, `protocolith_log`, `protocolith_show`,
`protocolith_schema`, `protocolith_capture`, `protocolith_atlas`, `protocolith_freeze`, `protocolith_record`,
`protocolith_deviation`, `protocolith_verify`, `protocolith_issue`) and read-only resources (`protocolith://summary`, `protocolith://ledger`,
`protocolith://schema/<name>`), so an agent can discover the formats itself. It uses no network and writes only
inside the store, apart from the atlas page that `protocolith_atlas` writes inside the working directory. Add it to an MCP client:
`protocolith mcp` is a stdio server with thirteen tools (`protocolith_summary`, `protocolith_log`, `protocolith_show`,
`protocolith_schema`, `protocolith_capture`, `protocolith_atlas`, `protocolith_claim_check`, `protocolith_anchor`, `protocolith_freeze`, `protocolith_record`,
`protocolith_deviation`, `protocolith_verify`, `protocolith_issue`) read-only resources (`protocolith://summary`, `protocolith://ledger`,
`protocolith://schema/<name>`) and the prompt `research-agent-protocol`, so an agent can discover the formats and the rules
itself; `protocolith_claim_check` tells it what it may and may not say about a result. It uses the network only when
`protocolith_anchor` is given a time-stamp URL, and writes only inside the store, apart from the atlas page that `protocolith_atlas` writes inside the working directory. Add it to an MCP client:

```json
{
Expand Down Expand Up @@ -240,7 +241,9 @@ All take `--store DIR` (or `PROTOCOLITH_STORE`; default `.protocolith`) and, exc
- **No protection against replacing a whole ledger.** Someone who can rewrite the file can write a new, valid
one, or cut off its end. Publish or anchor the output of `protocolith head` somewhere you do not control
alone (for example a signed git tag), then check against it with `protocolith verify-ledger --expect-head SEQ:HASH`.
See [anchoring the head](docs/guides/anchoring-the-head.md).
See [anchoring the head](docs/guides/anchoring-the-head.md). `protocolith anchor` automates this (a local anchor file, and
optionally an RFC 3161 time-stamp, a Wayback snapshot or a git tag), and `verify-ledger --anchors` detects a rewritten or
truncated ledger: see [anchor your results](docs/guides/anchor-your-results.md).
- It does not show that a protocol is sound, that data is true, or that a result generalises.

## Earlier name and unrelated works
Expand Down
22 changes: 22 additions & 0 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ Verify the ledger (rules R1 to R11).
- `--store STORE` — Store directory (env PROTOCOLITH_STORE, default .protocolith).
- `--json` — Print the result as canonical JSON.
- `--expect-head SEQ:HASH` — Also require the entry at SEQ to have this hash (detects a removed tail); else HEAD_MISMATCH, exit 1.
- `--anchors` — Also check every anchor in the store: ANCHOR_MISMATCH (rewritten), ANCHOR_AHEAD (truncated), exit 1.

## `protocolith anchor`

Anchor the ledger head: a local anchor file, and optionally a time-stamp, an archive copy or a git tag.

- `--store STORE` — Store directory (env PROTOCOLITH_STORE, default .protocolith).
- `--json` — Print the result as canonical JSON.
- `--tsa URL` — Also get an RFC 3161 time-stamp (a network request; the signature is not verified here).
- `--wayback URL` — Ask the Wayback Machine to save URL, where you published the statement.
- `--git-tag` — Create the git tag anchor/SEQ-HASH12 in this repository (never pushed).
- `--sign` — Sign the git tag (needs --git-tag and a configured key).
- `--write-head FILE` — Write the anchor statement to FILE to publish or archive it.

## `protocolith claim-check`

State what the ledger supports about a record (what may and may not be said).

- `--store STORE` — Store directory (env PROTOCOLITH_STORE, default .protocolith).
- `--json` — Print the result as canonical JSON.
- `--seq N` — The record at ledger seq N.
- `--protocol ID` — The latest record of this protocol_id.

## `protocolith issue`

Expand Down
1 change: 1 addition & 0 deletions docs/assets/protocolith/concept_e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/protocolith/concept_e_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading