Metadata-Version: 2.4
Name: documentledger
Version: 0.2.1
Summary: Documentation freshness ledger for coding-agent workflows
Author: Documentledger Contributors
License: Apache-2.0
Project-URL: Homepage, https://github.com/documentledger/documentledger
Project-URL: Repository, https://github.com/documentledger/documentledger
Project-URL: Documentation, https://documentledger.readthedocs.io/
Project-URL: Changelog, https://github.com/documentledger/documentledger/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/documentledger/documentledger/issues
Keywords: documentation,freshness,ledger,coding-agent,docs
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer
Requires-Dist: click
Requires-Dist: ledgercore<0.7.0,>=0.6.0
Requires-Dist: PyYAML
Requires-Dist: tomli; python_version < "3.11"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=1.24.0; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Dynamic: license-file

[![PyPI - Version](https://img.shields.io/pypi/v/documentledger)](https://pypi.org/project/documentledger/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/documentledger)

# Documentledger

Documentledger is a documentation freshness ledger for coding-agent workflows. It maps documentation sections to source units and reports affected documentation when linked implementation changes.

## Install

```bash
python -m pip install documentledger
documentledger --version
```

For development, install `python -m pip install -e ".[test,docs,dev]"`. Documentledger supports Python 3.10 through 3.13 and requires `ledgercore>=0.6.0,<0.7.0`.

## Quickstart

```bash
documentledger init --project-name example
documentledger --json status
documentledger --json scan
documentledger document build-context --bootstrap --out /tmp/documentledger-bootstrap.md
documentledger link propose --all-docs --out-dir /tmp/documentledger-maps
documentledger --json link import-map --directory /tmp/documentledger-maps --check-and-apply
documentledger --json link audit
documentledger --json coverage
```

After updating and validating an affected section:

```bash
documentledger document mark-fresh --doc docs/usage.md --section usage-scan --reason "Updated after scan version VERSION."
```

## Canonical storage

The shared authority is `.ledger/ledger.toml` schema 3. Documentledger's tool config is `.ledger/documentledger/config.toml` version 2. Durable state is in the resolved `data` mount; rendered context and proposals use the resolved cache `artifacts` mount. Legacy root configs are migration inputs only.

## Workflow

1. Initialize the canonical project.
2. Scan to establish or update the deterministic baseline.
3. Inspect `document affected` and bounded `document build-context` output.
4. Link sections to source units with `link add-section` or review deterministic proposals.
5. Update affected documentation and run validation.
6. Mark updated sections fresh, audit links, and run `documentledger --json check`.

<!-- docledger-section: status -->

## Status

`documentledger --json status` reports initialization, storage bindings, latest scan counts, and the recommended next action.

<!-- docledger-section: commands -->

## Commands

Use `documentledger commands` or the [complete CLI reference](docs/cli.md) to inspect canonical command paths.

<!-- docledger-section: state-model -->

## State model

Documentledger persists deterministic hashes and integer versions in the canonical data mount. Rendered context and proposals are derived cache artifacts.

<!-- docledger-section: storage-migration -->

## Storage migration

Use `documentledger migrate status`, `migrate plan`, `migrate apply`, `migrate recover`, and `migrate cleanup` for explicit legacy migration.

## Bootstrapping a new repository

The first scan is a baseline; use `documentledger document build-context --bootstrap`, review deterministic link proposals and coverage (including intentional no-op mappings), then apply them before marking all configured documents fresh with `--allow-unlinked`.

## Documentation and development

The full Sphinx site is in [`docs/`](docs/index.md). Build it with:

```bash
python -m pip install -e ".[docs]"
python -m sphinx -W --keep-going -b html docs docs/_build/html
```

Run tests with `python -m pytest -q` and compile checks with `python -m compileall -q documentledger tests`.

## Compatibility

`docledger`, plural command groups, root `mark-fresh`, and legacy storage migration wrappers remain temporary compatibility interfaces. New automation must use `documentledger` and canonical singular command paths.

## License

Apache-2.0. See [`LICENSE`](LICENSE).
