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 before0.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
- Structural AST & Call Graph: Python stdlib
ast(with error-toleranttree-sitter-pythonfallback for broken dirty files) + offline official MIT Tree-sitter grammars for TypeScript/TSX, JavaScript, Go, Rust, and Bash. - Git Archaeology & Temporal Coupling: Non-squashed commit mining, Lore commit trailers (
Plan:,Directive:,Rejected:),git mvrename lineage, symbol-level diff tracking (-U0), and 90-day time-decayed co-change coupling (excluding bulk>30-file sweeps). - Bi-Temporal Docs & ADRs: Indexes Plans/ADRs/runbooks, resolves
Supersedes:chains, and flags drifted docs whose referenced files were deleted or heavily churned. - 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 optionalrepoargument. - Single-repo pinned mode: Pass
--repo /path/to/repowithout--multi-repoto 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, McCabeC901 <= 12, branches<= 12, statements<= 50) +complexipy(Sonar cognitive complexity<= 15). - Type Safety:
mypy --strict+ Astralty. - Security & Compliance:
banditSAST,pip-auditCVE 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 msp95 query latency,<= 150 MBpeak RSS, and< 50 mslazy CLI cold start. - Releases: Dynamic
hatch-vcsversioning with automated PyPI OIDC Trusted Publishing and CycloneDX SBOM generation on merges tomain.
Optional Extras
lorexplore[polyglot]: Opt-intree-sitter-language-packfor long-tail languages beyond the 6 offline core grammars.evaldependency group: Offline agentic evaluation & Pareto prompt optimization (Inspect AI,DSPy+GEPA, local SQLiteMLflow).
License
Licensed under Apache-2.0.
Metadata
Release files for lorexplore 0.1.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lorexplore-0.1.0a4.tar.gz | 128.7 kB | Without provenance | Details for lorexplore-0.1.0a4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lorexplore-0.1.0a4-py3-none-any.whl | Python 3 | none | any | Details for lorexplore-0.1.0a4-py3-none-any.whl |
Total release size: 215.6 kB
Release files / lorexplore-0.1.0a4.tar.gz
| Download URL | lorexplore-0.1.0a4.tar.gz |
|---|---|
| Size | 128.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cfd70adaa86824a13785feb1fad7a07fa0e91800530f7389a5ec7ab17e07dc59
|
|
BLAKE2b-256 checksum How to use checksums |
3b5cf5e28b693b623f3750d965f195d87974728516454fa383cabe711ad7497c
|
| 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.0a4-py3-none-any.whl
| Download URL | lorexplore-0.1.0a4-py3-none-any.whl |
|---|---|
| Size | 86.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d56e8278e7a6c8c2c8d51257d52a0af1b26eab5ed44099fafcb2f3e5a45cf8c0
|
|
BLAKE2b-256 checksum How to use checksums |
f24d1a3910a49bc465b87f8388d0b02ea9e658cc2f94d207a95e5f5682f44d70
|
| 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.0a4
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.