Skip to content

[Feature] Add repository harness - #15

Merged
adabeyta merged 4 commits into
mainfrom
feat/repo-harness
Jul 23, 2026
Merged

[Feature] Add repository harness#15
adabeyta merged 4 commits into
mainfrom
feat/repo-harness

Conversation

@adabeyta

@adabeyta adabeyta commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Add repository harnesses: TorchTalk beyond PyTorch

TorchTalk's indexing pipeline was hardwired to one repo's anatomy PyTorch's directory layout, YAML files, test conventions, and cache identity were baked into constants scattered across the codebase. This PR introduces the repository harness: a declarative ConventionManifest that captures everything TorchTalk needs to know to index a package C++/Python/test search directories, exclusion patterns, registration macros and macro aliases, YAML data sources, decorator/string registries, and package identity. The engine consumes only the manifest; the repo-specific knowledge lives in ~30 lines of data per package.

Three harnesses ship built-in pytorch, vllm, torchvision and register_harness() accepts new ones without engine changes. Graphs built from different manifests merge via package-qualified symbol IDs (pytorch@<rev>/at::native::add).

The harness boundary is enforced everywhere

Every scan binding detection, implementation search, C++ call graph (full and incremental), Python registration extraction, test-infrastructure analysis is bounded by the active manifest's search dirs, exclusion patterns, and prefilters. Incremental updates (index update --since) apply the identical boundary, so they can never produce an index a full rebuild wouldn't.

Identity is harness-qualified

Caches are keyed by package and source (bindings_vllm_<hash>.json), so indexing two repos or one checkout under two harnesses never collides. Snapshots record which harness built them (schema v3, migrated transparently) and refuse cross-harness load/update with an actionable error. Baselines from older cache formats are rejected instead of silently merging mixed-schema rows.

Multi-repo config, end to end

torchtalk init --harness vllm --source /repos/vllm --set-default
torchtalk index build            # default harness from config
torchtalk status                 # per-harness sources, validity, caches

Sources live per-harness in [sources]; resolution is flag → TORCHTALK_SOURCE_<HARNESS> env (derived from the name, nothing hardcoded) → config. Validation is manifest-driven, so init accepts a vLLM checkout and still holds PyTorch to its old strictness. --pytorch-source, PYTORCH_SOURCE, and the legacy config key remain as compatible aliases; the Claude Code plugin pins --harness pytorch.

Symbol IDs take the form <package>@<revision>/<symbol> so indexes from
different checkouts merge by string equality. Revision comes from git
HEAD (version files as fallback); the content fingerprint moves to the
shared symbols module.
@adabeyta
adabeyta requested a review from arkadip-maitra July 17, 2026 01:30
adabeyta added 2 commits July 17, 2026 01:33
A ConventionManifest turns per-repo conventions into data: search dirs,
macro aliases and token maps for the binding detector, decorator/string
registries, registration calls, and string dispatchers. PyTorch, vLLM,
and torchvision register as harnesses; YAML op sources are optional and
string-derived records carry candidate markers with evidence.
affected() renders file::Class::function node IDs with a paste-ready
pytest block, replaces whole-file OpInfo expansion with -k runs gated
to precisely-resolved APIs, reseeds the mention vocabulary from op and
OpInfo names (spread-based cap), bridges dispatch stubs through their
call sites and kernel TU helpers, parses structured kernel class names,
and adds gradient runs for backward changes.
@adabeyta
adabeyta force-pushed the feat/repo-harness branch from 5468c23 to 00fb3e3 Compare July 17, 2026 01:33
@arkadip-maitra

Copy link
Copy Markdown
Collaborator

@adabeyta few tweaks can maybe be made but otherwise good to merge

Comment thread src/torchtalk/indexer.py
Comment thread src/torchtalk/indexer.py
Comment thread src/torchtalk/indexer.py Outdated
@adabeyta
adabeyta requested a review from arkadip-maitra July 23, 2026 00:26
@adabeyta adabeyta changed the title [ Feature ] Add repository harness [Feature] Add repository harness Jul 23, 2026
@adabeyta
adabeyta merged commit 4644e9e into main Jul 23, 2026
2 checks passed
@adabeyta
adabeyta deleted the feat/repo-harness branch July 23, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants