repo-indexlisted
Install: claude install-skill WangChangxin0809/cc-repo-harness
# One graph, two tiers
Governs: shared/scripts/index/
Retrieval fails in repositories for a specific reason: the useful unit is not a
paragraph, it is a symbol and its neighbourhood. A chunk-and-embed pipeline
returns files that talk *about* authentication; what the task needs is the four
functions that would break.
So: **one graph, built from source, queried two ways.** Not a stack of
retrievers — an extra retriever whose results have to be merged is a second
ranking problem on top of the one you had.
## The graph
Nodes are `file:<path>`, `sym:<path>:<name>`, and `doc:<path>`. Edges:
| Edge | From | Weight |
|---|---|---|
| defines | file → symbol | tree-sitter tags |
| references | file → symbol | tree-sitter tags, split across definers |
| imports | file → file | resolved import statements |
| calls | symbol → symbol | call sites inside a definition's span |
| governs | doc → path | a `Governs: src/billing/` line in the doc's head |
| supersedes | doc → doc | `Supersedes: 0004` |
**A symbol node is keyed by the file that defines it.** Keying by bare name
merges every definition sharing it, and the merged node then dominates the
graph: in this plugin's own repository `sym:main` — sixteen unrelated
`def main()` — had a higher degree than any real file, and seeding on one guard
ranked an *empty template* second because five guards define `check`. Bare names
are still how a reference resolves and how `--seed` matches; they are just no
longer the node. A reference to an