Metadata-Version: 2.4
Name: memoryledger
Version: 0.1.1
Summary: Auditable long-term project memory ledger and AGENTS.md renderer
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer
Requires-Dist: ledgercore<0.3,>=0.2
Requires-Dist: PyYAML
Requires-Dist: tomli; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Dynamic: license-file

# memoryledger

`memoryledger` is an auditable long-term project memory ledger and deterministic `AGENTS.md` renderer.

`AGENTS.md` is a generated entry point. Canonical durable memory lives in
`.memoryledger/`.

## Quick start

```bash
memoryledger init
cat <<'EOF' | memoryledger memory create --kind rule --title "Use plans" --scope repo --stdin
Always plan before implementation.
EOF
memoryledger review accept memory-0001 --reason "User approved project rule."
memoryledger render --print
memoryledger export
```

The short alias `memledger` exposes the same CLI.

To build or update `AGENTS.md`, update memory records first, then render and
export. Do not edit generated `AGENTS.md` files directly.

Rendered targets are owned only when configured and marked with
`<!-- Generated by memoryledger. Do not edit directly. -->`. Do not edit those
files directly. Files under `agent_docs/` without the marker may be manual.
Export refuses to overwrite any manual target, including when `--backup` is
passed. Use `memoryledger agents adopt AGENTS.md --json` for a read-only
preview that reports source hash, headings, proposed memories, placement, and
root shrink expectations. After user approval, run
`memoryledger agents adopt AGENTS.md --apply --backup --accept --reason "..."`,
then verify with `memoryledger agents verify-adoption --source AGENTS.md.memoryledger-adopt-1.bak`. Adoption preserves the full original source
as generated linked memory and the root links to it.

For multiline or shell-sensitive content, prefer `--stdin` with a
single-quoted heredoc instead of `--text`. Use `memoryledger schema values` to
list valid kinds, scopes, render targets, statuses, and evidence kinds.

Example:

```bash
cat <<'EOF' | memoryledger memory create --kind rule --title "Use memoryledger for AGENTS" --scope repo --stdin
Do not edit AGENTS.md directly; update memoryledger records and export.
EOF
memoryledger review accept memory-0001 --reason "User approved project memory workflow."
memoryledger finalize --accept-all --reason "User approved project memory workflow." --export
```

Additional intake commands are `templates list/show/apply/sync/remove`,
`evidence scan`, and `import run-html`. All producer output remains candidate
memory until explicit review. Structured evidence is managed with
`memory evidence list/add`. Both `memoryledger` and `memledger` expose the same
commands.

Storage v2 stores each memory as `.memoryledger/memories/memory-NNNN.md` with
YAML front matter. Legacy sidecar storage can be migrated with
`memoryledger migrate storage-v2 --plan` and
`memoryledger migrate storage-v2 --apply --backup`. Generated linked documents now
default to `agent_docs/`; migrate generated files only with
`memoryledger migrate linked-docs-dir --from docs/agents --to agent_docs --plan`
then `--apply`.
