Skip to content

feat(review): extract a codebase-grounded repo profile from RAG + signals #2999

Description

@JSONbored

Context

Part of the repo-specific CLAUDE.md/AGENT.md generation roadmap. Before we can generate anything, we need a structured, factual profile of a target repo: architecture facts, naming/style conventions, a key-module map, test/build commands, and contribution-workflow facts (how PRs get merged, what gates exist). The self-host stack already builds a RAG index per repo (src/review/rag.ts, src/review/rag-index.ts) and runs deterministic signal extraction (src/signals/engine.ts, src/signals/repo-policy-compiler.ts) for review purposes -- this issue is about querying that same infrastructure outside the review-time path to produce a reusable profile object rather than a one-off review artifact.

This extraction primitive must be shared, not bespoke to this feature. The review-quality-culture-profile work and the Autonomous Miner System's per-target-repo merge-bar inference both need the same kind of grounded repo profile -- one implementation, multiple consumers, to avoid three divergent copies of "what does this repo actually look like" logic.

Goal

Build a single repo-profile-extraction module that turns a repo's RAG index and deterministic signals into a structured, versioned profile object consumable by any downstream feature.

Requirements

  • Land as a standalone module (e.g. under src/review or src/signals, consistent with existing placement of rag.ts and repo-policy-compiler.ts) with no dependency on the generation or PR-writing pieces of this roadmap.
  • Profile output covers at minimum: architecture/module map, naming and style conventions, test and build commands, contribution workflow facts (gate presence, linked-issue rules, CI structure) derived from the repo's own files rather than hard-coded assumptions.
  • Must run against the repo's existing RAG index (src/review/rag.ts) and existing signal outputs (src/signals) without introducing a second embedding or indexing pipeline.
  • Must return an explicit insufficient-data state (not a partially filled guess) when the repo has no RAG index configured or indexed yet, so downstream consumers can fail closed per the epic's design principles.
  • Include a stable, versioned shape (schema version field) since at least three separate features will consume this profile and need to evolve independently of one another.

Deliverables

  • Repo-profile-extraction module with a documented, versioned output type
  • Integration against an existing repo's RAG index and signal set, with a fixture-backed test
  • Explicit insufficient-data / RAG-not-configured path with test coverage
  • Short internal doc or module-level comment describing the intended shared-consumer contract

Expected outcomes

  • A single profile-extraction call path exists that the CLAUDE.md/AGENT.md generator, the review-quality-culture-profile feature, and the miner merge-bar inference feature can all call without duplicating RAG/signal query logic
  • Profile extraction against a repo with no RAG index returns the explicit insufficient-data result instead of throwing or emitting a degraded profile

Part of the repo-doc generation roadmap: #2993

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions