Documentledger
Documentledger is a documentation freshness ledger for coding-agent workflows. It records repository scans, maps documentation files to source files, reports stale documentation when linked source files change or disappear, and renders update context for agents.
- Usage
- Architecture
- API reference
file_unit_id()module_unit_id()qualified_unit_id()hash_text()semantic_dump()line_span()slice_source()function_signature()class_signature()docstring_value()without_docstring()public_literal_values()exported_assignments()decorator_hash()function_unit()class_unit()module_unit()file_unit()index_python_source()source_units_for_file()source_inventory()source_inventory_for_paths()ConfigToolConfigWorkspacePathsWorkspaceSourceUnitDocSectionScanResult
- Bootstrapping a new repository
- Troubleshooting
Documentation freshness workflow
The supported workflow is:
Run
docledger --json statusto confirm that the workspace is initialized.Run
docledger --json scanto rewrite.ledger/documentledger/data/scan.yamlwhen current source hashes, documentation hashes, source-unit inventory, or changed source units differ from the latest baseline.Run
docledger --json docs affectedto find the documentation sections whose linked source units changed.Run
docledger docs build-context --affected --printto render update context for affected sections and unlinked changed sources.Inspect the affected sections and linked changed source units before editing documentation.
Update only the affected sections by default, run configured validation commands, then mark the updated section or doc fresh with
docledger mark-fresh --doc DOC --section SECTION --reason "Docs updated after scan version VERSION.".
Documentledger stores its durable state under .ledger/documentledger/data/. Do not edit the canonical .ledger/ layout directly.