Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

lorexplore (lxp)

Local-first codebase intelligence, git archaeology, temporal co-change coupling, and progressive-disclosure MCP/CLI engine.

Single SQLite WAL + FTS5 index per repository. Zero cloud services, zero LLM API calls required for indexing or retrieval, strict token budgets, and real-time dirty working-tree overlay.

Status: Alpha (0.1.0a*). CLI flags and MCP tool schemas may evolve before 0.1.0.

Architecture

Static AST search alone misses why code exists and which files silently break together. lorexplore joins four local layers into one queryable SQLite WAL index:

flowchart LR
    subgraph Inputs["Repository Inputs (Local Only)"]
        SRC["Source Files\n(Python AST + 6 Tree-sitter Grammars)"]
        GIT["Git History\n(Non-Squashed Commits, Renames, Lore Trailers)"]
        DOCS["Plans, ADRs & Runbooks\n(Bi-Temporal Supersession Chains)"]
        DIRTY["Dirty Working Tree\n(Uncommitted Edits Overlay)"]
    end

    subgraph Engine["SQLite WAL + FTS5 Engine (<= 64 MiB Cache, 0-mmap)"]
        AST["Symbols & Static Call Graph\n(EXTRACTED vs HEURISTIC)"]
        PPR["Personalized PageRank\n(Query & Focus-Seeded)"]
        CO["Temporal Co-Change Graph\n(90d Decay, <= 30-File Filter)"]
        FTS["Acronym-Safe FTS5\n(BM25 + RRF Fusion)"]
    end

    subgraph Surface["Progressive-Disclosure Interface"]
        CLI["CLI: lorexplore / lxp\n(Markdown & --json)"]
        MCP["MCP Server (MIT mcp SDK)\n(stdio & Localhost Streamable HTTP)"]
    end

    SRC --> AST
    SRC --> FTS
    AST --> PPR
    GIT --> CO
    GIT --> FTS
    DOCS --> FTS
    DIRTY -. "Live Overlay" .-> FTS
    DIRTY -. "Live Overlay" .-> PPR

    PPR --> CLI
    CO --> CLI
    FTS --> CLI
    PPR --> MCP
    CO --> MCP
    FTS --> MCP
  1. Structural AST & Call Graph: Python stdlib ast (with error-tolerant tree-sitter-python fallback for broken dirty files) + offline official MIT Tree-sitter grammars for TypeScript/TSX, JavaScript, Go, Rust, and Bash.
  2. Git Archaeology & Temporal Coupling: Non-squashed commit mining, Lore commit trailers (Plan:, Directive:, Rejected:), git mv rename lineage, symbol-level diff tracking (-U0), and 90-day time-decayed co-change coupling (excluding bulk >30-file sweeps).
  3. Bi-Temporal Docs & ADRs: Indexes Plans/ADRs/runbooks, resolves Supersedes: chains, and flags drifted docs whose referenced files were deleted or heavily churned.
  4. FTS5 + Personalized PageRank: Acronym-safe BM25 + Reciprocal Rank Fusion (RRF) with live dirty working-tree overlay.

Progressive-Disclosure Workflow

Instead of dumping full files into an LLM context window, agents orient in bounded hops and check blast radius before editing:

sequenceDiagram
    participant Agent as Coding Agent / Dev
    participant LXP as lorexplore (CLI / MCP)

    Agent->>LXP: 1. repo_map(focus_paths, max_tokens=1024)
    LXP-->>Agent: PageRank-ranked files + top signatures
    Agent->>LXP: 2. locate(query="token_bucket", scope="all")
    LXP-->>Agent: RRF hits across code, commits & ADRs (with cursor)
    Agent->>LXP: 3. read_symbol(targets, mode="skeleton")
    LXP-->>Agent: Compact AST signatures (~70% token savings)
    Agent->>LXP: 4. explain_why(target="src/auth/policy.py")
    LXP-->>Agent: Lore directives, fix/revert history, rename lineage & ADRs
    Agent->>LXP: 5. co_change_impact(target="working_tree")
    LXP-->>Agent: Static callers + implicit temporal co-change companions
    Note over Agent,LXP: Targeted edit -> lxp draft-lore -> commit with Lore trailers

Install

# Run directly via uvx (alpha pre-release)
uvx --prerelease=allow lorexplore --help

# Install into a project environment (alpha pre-release)
uv pip install --prerelease=allow lorexplore

# Local development install
uv sync --group dev

Quickstart

# 1. Build local index (~/.cache/lorexplore/<repo_hash>.db)
lxp sync

# 2. Keep index fresh automatically on commit, merge, and checkout
lxp install-hooks

# 3. Progressive-disclosure queries (add --json for machine output)
lxp map --focus src/auth --max-tokens 1024
lxp locate "token_bucket"
lxp read src/auth/policy.py --mode skeleton
lxp trace src/auth/policy.py --direction callers
lxp why src/auth/policy.py
lxp impact working_tree
lxp history "TOKEN_TTL" --fixes-only
lxp stale
lxp timeline --target src/auth --since 30d
lxp draft-lore

Agent Skills

Install the packaged progressive-disclosure SKILL.md so coding agents orient with map/locate/read, check why/impact before editing, and run impact working_tree + draft-lore + stale before committing:

# Workspace-local skill (.agents/skills/lorexplore/SKILL.md)
lxp init-skill

# Global skill for a specific agent runtime
lxp init-skill --target antigravity --global   # ~/.gemini/config/skills/lorexplore/SKILL.md
lxp init-skill --target claude --global        # ~/.claude/skills/lorexplore/SKILL.md
lxp init-skill --target cursor --global        # ~/.cursor/skills/lorexplore/SKILL.md

# Preview without writing or verify installed skill is up to date
lxp init-skill --print
lxp init-skill --target antigravity --global --check

MCP Server

Runs on the official MIT mcp SDK (MCPServer). Defaults to zero-socket stdio; --read-only opens SQLite read-only and omits record_decision (11 read-only tools vs 12).

  • Multi-repo mode (recommended for global agent configs): Omit --repo (or pass --multi-repo) and bound access with repeatable --allow-root <dir> flags. Every tool accepts an optional repo argument.
  • Single-repo pinned mode: Pass --repo /path/to/repo without --multi-repo to strictly restrict queries to that repository.
# Global multi-repo stdio server bounded to ~/workspace
lxp --read-only serve --allow-root ~/workspace

# Strictly pinned single-repo stdio server
lxp --repo /path/to/repo --read-only serve

# Optional localhost-only stateless Streamable HTTP (DNS-rebinding Host/Origin guard)
lxp --read-only serve --allow-root ~/workspace --transport streamable-http --host 127.0.0.1 --port 8770

Example global MCP client configuration (multi-repo):

{
  "mcpServers": {
    "lorexplore": {
      "command": "lxp",
      "args": ["--read-only", "serve", "--allow-root", "/path/to/workspaces"]
    }
  }
}

Tool Surface

Every tool accepts an optional repo path in multi-repo mode:

Tool Purpose Read-Only
repo_status Index health, last indexed SHA, object counts, and DB location Yes
repo_map Personalized PageRank file/signature skeleton map Yes
locate RRF search across symbols, commits, and ADRs Yes
read_symbol Batch AST skeletons or exact line/symbol bodies Yes
trace_graph N-hop static callers, callees, imports, and tests Yes
explain_why Commits, Lore trailers, rename lineage, ADRs, and co-changes Yes
co_change_impact Pre-edit blast radius (static callers + temporal co-change) Yes
search_history FTS5 search over commits, Lore trailers, and ADRs Yes
audit_stale_docs Flags active docs with deleted or heavily churned file refs Yes
draft_lore Drafts Lore commit trailers + pre-commit invariant/co-change checklist Yes
build_timeline Chronological SHA-anchored feed for onboarding or synthesis Yes
record_decision Records a bi-temporal decision and emits Lore trailers No

Lore Commit Trailers

lorexplore indexes structured commit trailers automatically:

Plan: Plan 02
Directive: Enforce token_bucket bounds; never re-enable legacy fixed fallback.
Rejected: Unbounded burst quota.
Verified-By: pytest tests/test_policy.py

Generate a pre-commit trailer draft and missed-companion check from your staged diff with lxp draft-lore.

Quality & Security Gates

Every commit is verified across Linux, macOS, and Windows (Python 3.11–3.14):

  • Static & Complexity: ruff (lint, format, McCabe C901 <= 12, branches <= 12, statements <= 50) + complexipy (Sonar cognitive complexity <= 15).
  • Type Safety: mypy --strict + Astral ty.
  • Security & Compliance: bandit SAST, pip-audit CVE scan, and automated runtime permissive license allowlist (MIT, Apache-2.0, BSD, ISC, PSF-2.0).
  • Testing & Performance: >= 90% combined line and branch coverage (pytest --cov-branch), Hypothesis property fuzzing, <= 50 ms p95 query latency, <= 150 MB peak RSS, and < 50 ms lazy CLI cold start.
  • Releases: Dynamic hatch-vcs versioning with automated PyPI OIDC Trusted Publishing and CycloneDX SBOM generation on merges to main.

Optional Extras

  • lorexplore[polyglot]: Opt-in tree-sitter-language-pack for long-tail languages beyond the 6 offline core grammars.
  • eval dependency group: Offline agentic evaluation & Pareto prompt optimization (Inspect AI, DSPy + GEPA, local SQLite MLflow).

License

Licensed under Apache-2.0.

Metadata

Release files for lorexplore 0.1.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lorexplore 0.1.0a5
File Size Uploaded Provenance Actions
lorexplore-0.1.0a5.tar.gz 130.9 kB Without provenance Details for lorexplore-0.1.0a5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lorexplore 0.1.0a5
File Interpreter ABI Platform Actions
lorexplore-0.1.0a5-py3-none-any.whl Python 3 none any Details for lorexplore-0.1.0a5-py3-none-any.whl

Total release size: 218.6 kB

Release files / lorexplore-0.1.0a5.tar.gz

Download URL lorexplore-0.1.0a5.tar.gz
Size 130.9 kB
Tags Source
SHA-256 checksum
How to use checksums
15950fd9c4863b36fa9d42fd34600196df3068caa3dcad86ddeba45e3ea082dd
BLAKE2b-256 checksum
How to use checksums
02de4d6cd0304e660cdc661993652ab76649c1296eb80dc1f5e528a84d23657a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lorexplore-0.1.0a5-py3-none-any.whl

Download URL lorexplore-0.1.0a5-py3-none-any.whl
Size 87.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34f61550b95139d3f2fc6742b75c37297a32dbd9f74d8df0f4bbcd69ff3ce3d4
BLAKE2b-256 checksum
How to use checksums
93b971cff1e0acdc411acd8ba693445c4760702deb7efef391fa2890ef1aed25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lorexplore 0.1.0a5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page