Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / function

lookup_symbol

modules.code.router.lookup_symbol

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (8)
SymbolFileResolved by
source_requestscontext.pythrough an import
Hitretrieval.pythrough an import
secretruntime.pythrough an import
resolve_sourcessource.pythrough an import
chunk_refsymbols.pythrough an import
find_symbolsymbols.pythrough an import
symbol_graphsymbols.pythrough an import
_filtersrouter.pysame file
Inside (1)
SymbolFileResolved by
routerrouter.pysame file
modules.code.router.lookup_symbolbackend/app/modules/code/router.py, lines 259–290Open source
@router.post("/search/symbol")def lookup_symbol(body: SymbolRequest, db: Session = Depends(get_sync_db)):    """Find definitions by (qualified) name, with code and resolved call graph."""    filters = _filters(db, body.repository, None, None, None)    matches = find_symbol(db, body.name, repository_ids=filters.repository_ids, limit=body.limit)    out = []    hits = []    for c in matches:        repo = db.get(Repository, c.repository_id)        item = chunk_ref(c) | {            "repository": {"id": str(repo.id), "name": repo.name, "url": repo.url},            "commit_sha": c.branch_reference,            "summary": c.semantic_summary,            "parser": c.parser,        }        if body.include_graph:            item["graph"] = symbol_graph(db, c.id)        out.append(item)        hits.append(Hit(            chunk_id=str(c.id), score=0.0, evidence=None, repository_id=str(repo.id),  # type: ignore[arg-type]            repository_url=repo.url, path=(c.chunk_metadata or {}).get("path", ""), kind=c.ast_node_type,            start_line=c.start_line, end_line=c.end_line, commit_sha=c.branch_reference,            resource_id=str(c.resource_id),        ))    if body.include_code and hits:        results = resolve_sources(source_requests(db, hits), token=secret(get_settings().GIT_CLONE_TOKEN))        for item in out:            res = results.get(item["chunk_id"])            item["code_status"] = res.status if res else "unavailable:unknown"            item["code"] = res.code if res else None            item["verified"] = bool(res and res.verified)    return {"name": body.name, "matches": out}

What the index recorded

Signature
def lookup_symbol(body: SymbolRequest, db: Session):
File
backend/app/modules/code/router.py
Lines
259–290
Parser
python-ast
Git blob
d914024790aaafe7234adda557677b76e4ad73d5
Call sites
14 named, 9 resolved, 5 left unlinked
Outside this subset
1 more edges reach code outside the graph shown here

Read it on GitHub at this commit