Skip to main content

memory-lint

memory-lint is a deterministic, flags-only linter for Markdown memory and documentation corpora. It reads target files and reports findings; it has no write or auto-fix path for the corpus.

Install

Install the released package from PyPI:

python -m pip install memory-lint
memory-lint --help

For development from a clone:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
memory-lint --config sample-config.yaml --now 2026-08-10
memory-lint --config sample-config.yaml --format json --now 2026-08-10

Every input is a named flag. The CLI accepts no positional corpus path. corpus_root resolves relative to the config file; --corpus-root can point the same surface profiles at another corpus without editing the config.

Checks

  • Frontmatter: required top-level keys, quoted top-level scalar keys (including description), and a configurable type enum per surface profile.
  • Links: corpus-contained [[wikilinks]] and relative Markdown .md links, including missing, escaping, and ambiguous targets.
  • Indexes: Markdown list rows whose targets are missing, duplicate rows, and included files missing from the index. Table rows do not count as index entries.
  • Managed markers: orphaned, nested, mismatched, and unclosed marker blocks. These always report at error severity.
  • Revision comparisons: SHA-256-identical and whitespace-only file pairs; under --against, missing linted files are errors and files that lose at least half their lines are warnings.
  • Staleness and structure: configurable age checks for every unfenced *Updated:* YYYY-MM-DD header, missing or invalid headers, duplicate heading anchors, duplicate explicit anchors, and configurable maximum line length.

Profiles select files and settings independently:

version: 1
corpus_root: ./docs
profiles:
  notes:
    include: [notes/**/*.md]
    exclude: [notes/archive/**/*.md]
    checks:
      frontmatter:
        required_keys: [title, description, type]
        quoted_keys: [description]
        type_enum: [memory, note]
      links: true
      managed_markers:
        pairs:
          - begin: "<!-- BEGIN MANAGED -->"
            end: "<!-- END MANAGED -->"
      staleness:
        max_age_days: 90
        updated_required: true
      structure:
        max_line_length: 2000
indexes:
  - path: MEMORY.md
    include: [notes/**/*.md]
    exclude: [notes/archive/**/*.md]

Glob patterns and configured index paths may not be absolute, contain .., or end in a bare ** component. Use a terminal file pattern such as **/*.md for recursive discovery. Resolved links are also contained to the corpus root.

Revision comparisons

Compare two explicit revisions:

memory-lint \
  --config sample-config.yaml \
  --compare-before fixtures/revisions/identical-before.md \
  --compare-after fixtures/revisions/identical-after.md

Compare linted files changed from a Git commit:

memory-lint --config path/to/config.yaml --against origin/main

--against uses read-only git rev-parse, git diff, and git show calls. Added files have no earlier revision and are skipped by the no-op comparison. Files matched by a profile at the ref but deleted from the worktree emit file-missing-vs-ref errors. Modified files that lose at least 50% of their lines emit file-shrunk-vs-ref warnings.

Output and exit codes

--format table prints a stable human-readable table. --format json emits a versioned object containing corpus_root, finding_count, and sorted finding objects (code, severity, path, line, message, profile).

Exit Meaning
0 Clean
1 One or more findings
2 CLI, config, filesystem, or Git tool error

Use --now YYYY-MM-DD to pin staleness checks in CI and tests; otherwise the current UTC date is used.

Synthetic fixture suite

All fixtures in this repository are invented for this tool. fixtures/clean must stay quiet. fixtures/defects plants all 13 core defect classes. fixtures/revisions contains explicit no-op pairs. No real user memory or vault content belongs here.

pytest -q

Releases are published from version tags through PyPI Trusted Publishing with attestations.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memory_lint-0.1.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memory_lint-0.1.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file memory_lint-0.1.0.tar.gz.

File metadata

  • Download URL: memory_lint-0.1.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for memory_lint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 128f50f6fc839eafea9b40566c145678a8552c8527ebcb8ce1b6367dbdc2dbcf
MD5 499f6e2b92df98062fb1ee4e36455af7
BLAKE2b-256 601bbda5ecc903b84327632bded524b5dd2e3aa2e3dc783d5808d0dbd5590919

See more details on using hashes here.

Provenance

The following attestation bundles were made for memory_lint-0.1.0.tar.gz:

Publisher: release.yml on kiloloop/memory-lint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memory_lint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: memory_lint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for memory_lint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3ed9db8f37d3fac393bbafb883d4ee30eb33bcce860e7701e5d8ceb723358a0
MD5 cf06713ec1e556dd3388922082a90ebc
BLAKE2b-256 1bb44a52d42310efa934e69204eb891b498af60d7a2528ff5e88c477cc1636d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for memory_lint-0.1.0-py3-none-any.whl:

Publisher: release.yml on kiloloop/memory-lint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page