Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / Source
Attach pointers to hits
Loads path, span, commit and parser. Source is still not in the database.
PINNED SOURCE Copied from the repository at this commit. Source, not an execution.
PHAROS at 975a38dMIT license
Retriever._hydratebackend/app/codeintel/retrieval.py, lines 535–563Open source
def _hydrate(self, hits: list[Hit]) -> None: if not hits: return ids = [uuid.UUID(h.chunk_id) for h in hits] rows = self.db.execute( select(DocumentChunk, Repository) .join(Repository, Repository.id == DocumentChunk.repository_id) .where(DocumentChunk.id.in_(ids)) ).all() by_id = {str(c.id): (c, r) for c, r in rows} for h in hits: c, r = by_id[h.chunk_id] meta = c.chunk_metadata or {} h.repository_id = str(r.id) h.repository_name = r.name h.repository_url = r.url h.source_type = r.source_type h.path = meta.get("path", "") h.language = c.language h.kind = c.ast_node_type h.symbol = c.symbol_name h.name = meta.get("name") h.start_line, h.end_line = c.start_line, c.end_line h.commit_sha = c.branch_reference h.parser = c.parser h.summary = c.semantic_summary h.raw_url = c.github_uri h.resource_id = str(c.resource_id) h.fallback_reason = meta.get("fallback_reason")Where this comes from
- Commit
975a38d5d17839c26ee219295a5be6ac66b6d910- File
backend/app/codeintel/retrieval.py- Lines
- 535–563
- Git blob
884729a39ae0b3d340ad83f75946677dcddf3791- License
- MIT, © 2024–2026 Pharos Contributors. Notice
Read it on GitHub at this commit
Check it yourself
From a clone of the repository, the first command prints the blob above and the second prints these lines.
git rev-parse 975a38d:backend/app/codeintel/retrieval.py
git show 975a38d:backend/app/codeintel/retrieval.py | sed -n '535,563p'