tpt-weave

Rust

Rust workspace for indexing and understanding codebases — parses source into symbol records (structs, enums, traits, impls, functions) and builds a cross-file symbol graph (modules, crates, dependencies, references, callers/callees) for downstream tooling.

0 stars0 forks0 watchersMIT License

Languages

Rust98.9%PowerShell1.1%
README

tpt-weave

Cross-repository AI-context optimisation for the TPT Solutions ecosystem.

tpt-weave is the reusable AI-context infrastructure layer for TPT Solutions repositories. It indexes Rust workspaces deterministically, builds hierarchical source representations, and delivers only the context a coding task needs — so expensive models such as GLM-5.3-Flash receive far fewer tokens without losing the information required to complete the task correctly.

Status: pre-alpha. The design specification is Proposed. Phases 0–17 are implemented, with Phase 15 performance work, Phase 16 privacy/security controls, and Phase 17 experiment/benchmark APIs. Phase 18 workload capture/reporting infrastructure is implemented; live JEv/production workload measurements and Phases 18–20 conclusions remain pending.

Core principle

Do not compress information merely because it is large. Determine what information is necessary, expose the smallest useful representation first, and retrieve more detail only when required.

Deterministic algorithms run first; JEv (via OpenRouter) only makes small structured decisions over the already-reduced candidate set. See spec.md §4.

Workspace layout

Start as one repository with a workspace (spec §25):

CrateStatusPurpose
crates/tpt-weave-corePhase 1 doneCore types, token accounting, .tpt-weave/manifest.toml configuration
crates/tpt-weave-indexPhase 2 doneCargo metadata + git indexing (status, diff, history)
crates/tpt-weave-rustPhase 2 doneRust source extraction via syn (symbols, signatures, locations, skeletons)
crates/tpt-weave-graphPhase 3 doneSymbol/module/crate/dependency graph, references, persistence
crates/tpt-weave-contextPhases 4–5 doneHierarchical representations (levels 0–5), expansion, deterministic retrieval
crates/tpt-weave-toolsPhase 6 doneDeterministic tool-output reduction (cargo/git/tests/diffs/logs/JSON) with raw storage
crates/tpt-weave-cachePhase 7 doneFilesystem cache: revision/schema keys, invalidation, clear, statistics
crates/tpt-weave-decisionsPhase 8 doneDecisionProvider trait, mock/fallback providers, JEv categories, policy engine, decision log
crates/tpt-weave-openrouterPhase 8 doneOpenRouter Decisions API (JEv) blocking client: retries, timeouts, usage/confidence
crates/tpt-weave-mcpPhase 9 doneMCP server (stdio): 11 tools, dynamic tool filter, compact schemas
crates/tpt-weave-cliPhase 10 donetpt-weave binary: adopt/init/index/doctor/overview/symbol/refs/expand/context/diff/stats/cache
crates/tpt-weave-evalPhases 11/15/17/18 infraEval harness, benchmark primitives, experiment matrices, workload capture/reporting (spec §23)

Quick start

Development (current):

cargo test --workspace

Planned CLI (UX defined in docs/decisions.md, implemented in Phase 10):

cd tpt-cv
tpt-weave init
tpt-weave index
tpt-weave context "fix the image resampling bug"

Or, for an existing repository, adopt in one step:

cd tpt-cv
tpt-weave adopt

Documentation

Toolchain

  • MSRV: Rust 1.85 (edition 2024), enforced via rust-version in the workspace manifest
  • Edition: 2024
  • License: MIT (see LICENSE)