Metadata-Version: 2.4
Name: watchbook
Version: 0.1.0a1
Summary: Living research registers: typed, linked tables kept current by agents, with every change cited, quote-checked and accepted by a person.
Author: Coefficient Systems Ltd
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: httpx>=0.25.0
Requires-Dist: markdown-it-py>=3.0.0
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: pydantic>=2.11.0
Requires-Dist: pypdf>=4.0.0
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: sqlalchemy>=2.0.31
Requires-Dist: typer>=0.18.0
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/CoefficientSystems/watchbook
Project-URL: Source, https://github.com/CoefficientSystems/watchbook
Project-URL: Changelog, https://github.com/CoefficientSystems/watchbook/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/CoefficientSystems/watchbook/issues
Description-Content-Type: text/markdown

# Watchbook

Watchbook keeps a research register true over time. A register is a set of typed, linked tables. Agents propose additions and corrections, each backed by a source and a verbatim quote that the engine checks, and nothing changes until a person accepts it. People get a spreadsheet; agents get a CLI now, and an MCP (Model Context Protocol) server is coming.

> **Developer preview (0.1.0a1).** The loop works from a terminal: load a schema, seed a register from a spreadsheet, take proposals with their quotes checked, review them, keep the history and export the register again. Not there yet: the MCP server, the review UI (`watchbook serve`) and the bundled agent skills, all due in v0.1. Formats and commands may still change.

See also the [changelog](https://github.com/CoefficientSystems/watchbook/blob/main/CHANGELOG.md) and the [security policy](https://github.com/CoefficientSystems/watchbook/blob/main/SECURITY.md).

## Install

Watchbook needs Python 3.12 or later. Pre-releases are hidden from a plain install, so ask for one:

```sh
pip install --pre watchbook
# or
uv tool install --prerelease allow watchbook
watchbook --version
```

## Quickstart

The example register lives in this repository. Clone it and run the loop on a copy (the quote check fetches pages, so it needs a network connection):

```sh
git clone https://github.com/CoefficientSystems/watchbook && cd watchbook
DEMO="$(mktemp -d)/frameworks" && cp -R examples/frameworks "$DEMO" && rm -rf "$DEMO/data"
watchbook import "$DEMO/frameworks.xlsx" -p "$DEMO"                 # seed the register
watchbook propose --jsonl "$DEMO/demo/proposals.jsonl" -p "$DEMO"   # what an agent sends
watchbook review -p "$DEMO"                                          # a person decides, at a terminal
watchbook export "$DEMO/reviewed.xlsx" -p "$DEMO"
```

To start a register of your own, run `watchbook init my-register`, edit `my-register/schema/register.yaml`, then `watchbook schema check -p my-register`.

## Developing

You need [uv](https://docs.astral.sh/uv/).

```sh
uv sync
uv run watchbook --version
uv run pytest
```

[CONTRIBUTING.md](https://github.com/CoefficientSystems/watchbook/blob/main/CONTRIBUTING.md#development) has the full set of checks CI runs.

### Try the schema commands

The schema loader is the first part of the engine that works. Point it at the example register:

```sh
uv run watchbook schema check -p examples/frameworks          # frameworks: schema OK, 3 tables in 1 schema file
uv run watchbook schema show frameworks -p examples/frameworks
uv run watchbook schema check -p examples/frameworks --json   # what agents read
```

Then break a copy to see how problems are reported, with file, line and a stable code:

```sh
T=$(mktemp -d) && cp -R examples/frameworks/watchbook.yaml examples/frameworks/schema "$T"
sed -i.bak 's/name_field: version/name_field: verison/' "$T/schema/register.yaml"
uv run watchbook schema check -p "$T"          # ...register.yaml:111: tables.releases.name_field: name_field 'verison' is not a field; did you mean 'version'?
uv run watchbook schema check -p "$T" --json   # exit code 3, code "schema.name_field"
```

To start a register of your own, `watchbook init` writes `watchbook.yaml` and a placeholder schema to edit, and creates the store:

```sh
uv run watchbook init my-register    # then edit my-register/schema/register.yaml
uv run watchbook schema check -p my-register
```

[docs/cli.md](https://github.com/CoefficientSystems/watchbook/blob/main/docs/cli.md) lists every error code and exit code.

### Try the loop

The whole cycle works from a terminal: an agent proposes changes with a source and a quote, Watchbook fetches each page and checks the quote, a person reviews, and the spreadsheet is exported. [examples/frameworks/DEMO.md](https://github.com/CoefficientSystems/watchbook/blob/main/examples/frameworks/DEMO.md) runs it on a copy of the example register in five commands (the quote check needs a network connection):

```sh
DEMO="$(mktemp -d)/frameworks" && cp -R examples/frameworks "$DEMO" && rm -rf "$DEMO/data"
uv run watchbook import "$DEMO/frameworks.xlsx" -p "$DEMO"                 # seed the register
uv run watchbook propose --jsonl "$DEMO/demo/proposals.jsonl" -p "$DEMO"   # what an agent sends
uv run watchbook proposals -p "$DEMO"                                       # verified, not_found, fetch_failed
uv run watchbook review -p "$DEMO"                                          # a person decides, at a terminal
uv run watchbook export "$DEMO/reviewed.xlsx" -p "$DEMO"
```

Agents use `propose`, `search`, `get`, `proposals` and `history`, each with `--json`. Deciding is for people: `review`, `accept` and `reject` refuse to run without an interactive terminal. [docs/cli.md](https://github.com/CoefficientSystems/watchbook/blob/main/docs/cli.md#commands) describes every command and its JSON output.

## Documentation

| Read | For |
|------|-----|
| [CONTEXT.md](https://github.com/CoefficientSystems/watchbook/blob/main/CONTEXT.md) | The domain words: register, record, proposal, claim, quote check |
| [docs/adr/](https://github.com/CoefficientSystems/watchbook/blob/main/docs/adr/README.md) | The architecture decisions and the reasons behind them |
| [docs/formats.md](https://github.com/CoefficientSystems/watchbook/blob/main/docs/formats.md) | The project config and schema formats (version 1) |
| [docs/cli.md](https://github.com/CoefficientSystems/watchbook/blob/main/docs/cli.md) | The command line: every command, `--json` output, the quote check, exit codes and error codes |
| [docs/store.md](https://github.com/CoefficientSystems/watchbook/blob/main/docs/store.md) | The store, for engine developers: opening a register, reading and writing records, transactions, history and errors |
| [examples/frameworks/](https://github.com/CoefficientSystems/watchbook/blob/main/examples/frameworks/README.md) | A worked example register, also the shared test fixture |
| [examples/frameworks/DEMO.md](https://github.com/CoefficientSystems/watchbook/blob/main/examples/frameworks/DEMO.md) | The loop end to end: propose with quotes, the quote check, review and export |
| [CONTRIBUTING.md](https://github.com/CoefficientSystems/watchbook/blob/main/CONTRIBUTING.md) | How to work on Watchbook, and the rules on client content and code provenance |
| [CLAUDE.md](https://github.com/CoefficientSystems/watchbook/blob/main/CLAUDE.md) | Notes for coding agents working in this repository |

## Repository layout

| Path | What it holds |
|------|---------------|
| `src/watchbook/` | The package. `schema`, `store`, `cli`, `init` and `evidence` are implemented; `core` has validation, lint, proposals, decisions, the bulk-accept policy, history and undo; and `io` has the YAML snapshot and the XLSX import and export. `mcp`, `web` and `skills` are placeholders until v0.1 fills them |
| `tests/` | The test suite |
| `examples/frameworks/` | The example register and its recorded source pages |
| `docs/` | The format spec, the CLI contract, the store guide and the ADRs |

## Licence

BSD 3-Clause. See [LICENSE](https://github.com/CoefficientSystems/watchbook/blob/main/LICENSE).
