Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / Recorded run
A question reaches verified source
One question, asked the way an assistant asks it: a real MCP call, a real dense search, and five files fetched from GitHub and checked against their Git blobs.
RECORDED Captured from a real run on November 2, 2026. Nothing is running now.
PHAROS at 975a38dMIT license
What happened, in order
01The token is checkedMCP server
The read token is compared in constant time, then matched against what that scope may call. MCP is on the read-only list.
Observed running
principal_for_token× 1, 0.008 msallowed_for× 1, 0.003 ms
Source that ran
02The MCP tool takes the questionMCP server
The tool clamps its limits and hands off to the call REST and the CLI also use.
- Chunks requested
- 5
Observed running
retrieve_context× 1, 104.68 msassemble_context× 1, 104.44 ms
Source that ran
03The repository is resolvedContext assembly
This call names a repository, so the search is limited to it. A call that names none would span the whole index.
- Repository
- ram-tewari/pharos
- Indexed commit
- 975a38d
Observed running
resolve_repositories× 1, 0.58 msrepositories_matching× 1, 0.58 ms
Source that ran
04Auto chooses a modeRetriever
Vectors from this model exist for this repository and the caller passed no hints, so auto means dense.
- Requested
- auto
- Used
- dense
Observed running
Retriever.search× 1, 18.79 msRetriever._dense_unavailable_reason× 1, 0.34 ms
Source that ran
05The question is embeddedEmbeddings
The model runs on the CPU in this process, with the same model that embedded the index.
- Model
- granite-embedding-english-r2-int8
- Time
- 4.36 ms
Observed running
OnnxEmbedder.embed_query× 1, 4.36 msOnnxEmbedder.encode_raw× 1, 4.35 ms
Source that ran
06pgvector finds candidatesRetriever
Fifty candidates come back through the HNSW index. The observed calls show one ranking callback for each of the fifty.
- Time
- 12.2 ms
Observed running
Retriever._dense× 1, 12.19 ms_supports_iterative_scan× 1, 0.011 ms
Source that ran
07Scores become a rankingRetriever
Dense mode keeps cosine similarity as the score. Each path is checked for tests, docs and examples; none of the top five needed the penalty.
- Top hit
- backend.app.codeintel.git_source.Checkout.read_blob
- Its score
- 0.865354
- Time
- 0.98 ms
Observed running
Retriever._fuse× 1, 0.064 msRetriever._finalize× 1, 0.91 mspath_role× 50, 0.10 ms
Source that ran
08Hits become pointersRetriever
Each hit gains its path, line span, commit and parser. There is still no code in this response.
- Time
- 0.86 ms
Observed running
Retriever._hydrate× 1, 0.84 ms
Source that ran
09Source is fetched and verifiedSource verification
Each pointer is resolved at the commit. The bytes come from raw.githubusercontent.com, are hashed as a Git blob and are compared with the SHA from the index. All five matched.
- First result
- resolved
- Verified
- yes
- Time for all five
- 82.09 ms
Observed running
source_requests× 1, 0.51 msresolve_sources× 1, 81.55 ms_resolve_one× 5, 369.35 ms_fetch_https× 5, 369.03 msgit_blob_sha× 5, 0.055 ms
11The answer is renderedContext assembly
Verified code becomes Markdown with citations, inside the budget.
- Characters
- 5396
- Truncated
- no
- Total time
- 104.43 ms
Observed running
_render× 1, 0.022 ms_Budget.take× 7, 0.004 ms
Source that ran
Times are measured with instrumentation on, which slows every call. They show where time went in one local run, not how fast PHAROS is.
What came back
Auto used dense retrieval, and the function that performs the comparison ranked fifth. The ranking is shown as it was returned. Passing hints moves it to first.
| Rank | Symbol | Lines | Score | Blob check |
|---|---|---|---|---|
| 1 | codeintel.git_source.Checkout.read_blob | 383–406 | 0.865354 | Verified |
| 2 | codeintel.git_source | 1–465 | 0.846622 | Verified |
| 3 | learning.memory.file_evidence | 52–57 | 0.842446 | Verified |
| 4 | codeintel.git_source.read_file_at_commit | 446–461 | 0.837611 | Verified |
| 5 | codeintel.source.git_blob_sha | 85–86 | 0.836114 | Verified |
How this was recorded
- Transport
- MCP tools/call retrieve_context over streamable HTTP
- Index
- Indexed from GitHub at this commit through the production path: PostgreSQL, pgvector HNSW and ONNX embeddings.
- Database
- PostgreSQL 17.11 with pgvector 0.8.7
- Embedding model
- granite-embedding-english-r2-int8
- Where
- Local Mac, loopback only; not the deployed service
- Repeatability
- 3 further runs returned the same ranking.
Every function that ran72 PHAROS functions, in first-seen orderOpen list
_install_auth_middleware.<locals>.authentication_middleware__init__.py:159 × 1is_publicshared/auth.py:122 × 1, 0.005 msparse_bearershared/auth.py:113 × 1, 0.003 msprincipal_for_tokenshared/auth.py:102 × 1, 0.008 ms_configuredshared/auth.py:97 × 2, 0.004 msallowed_forshared/auth.py:126 × 1, 0.003 msPrincipal.is_adminshared/auth.py:74 × 1, 0.001 msPrincipal.as_stateshared/auth.py:83 × 1, 0.015 msPrincipal.user_uuidshared/auth.py:78 × 1, 0.011 ms_install_pool_monitor.<locals>.monitor_connection_pool__init__.py:199 × 1build_mcp_server.<locals>.retrieve_contextmodules/mcp/native_server.py:88 × 1, 104.68 mssession_scopecodeintel/runtime.py:21 × 1ensure_databasecodeintel/runtime.py:15 × 1, 0.001 msget_embeddercodeintel/embeddings.py:475 × 1, 0.006 msresolve_backendcodeintel/embeddings.py:467 × 1, 0.001 mssecretcodeintel/runtime.py:31 × 1, 0.001 msassemble_contextcodeintel/context.py:154 × 1, 104.44 msresolve_repositoriescodeintel/context.py:82 × 1, 0.58 msrepositories_matchingcodeintel/retrieval.py:614 × 1, 0.58 ms_setup_event_listeners.<locals>.receive_before_cursor_executeshared/database.py:398 × 24, 0.018 ms_setup_event_listeners.<locals>.receive_after_cursor_executeshared/database.py:406 × 24, 0.028 msGUID.process_result_valueshared/base_model.py:46 × 241, 0.080 msRetriever.__init__codeintel/retrieval.py:197 × 1, 0.002 msRetriever.searchcodeintel/retrieval.py:204 × 1, 18.79 msquery_termscodeintel/text.py:58 × 2, 0.035 mstokenizecodeintel/text.py:39 × 2, 0.030 mssplit_identifiercodeintel/text.py:28 × 13, 0.020 mssplit_identifier.<locals>.<genexpr>codeintel/text.py:35 × 13Retriever._dense_unavailable_reasoncodeintel/retrieval.py:281 × 1, 0.34 msRetriever._filter_clausescodeintel/retrieval.py:305 × 2, 0.064 msGUID.load_dialect_implshared/base_model.py:29 × 9, 0.044 msGUID.process_bind_paramshared/base_model.py:35 × 79, 0.057 msOnnxEmbedder.embed_querycodeintel/embeddings.py:341 × 1, 4.36 msOnnxEmbedder.encode_rawcodeintel/embeddings.py:344 × 1, 4.35 msOnnxEmbedder._loadcodeintel/embeddings.py:312 × 1, 0.001 msOnnxEmbedder.encode_raw.<locals>.<genexpr>codeintel/embeddings.py:363 × 1_padcodeintel/embeddings.py:64 × 1, 0.015 msRetriever._densecodeintel/retrieval.py:370 × 1, 12.19 ms_supports_iterative_scancodeintel/retrieval.py:596 × 1, 0.011 msEmbeddingVector.__init__shared/vector_type.py:86 × 1, 0.005 ms_VectorText.process_bind_paramshared/vector_type.py:68 × 1, 0.22 msto_vector_literalshared/vector_type.py:38 × 1, 0.21 msRetriever._dense.<locals>.<genexpr>codeintel/retrieval.py:403 × 1Retriever._dense.<locals>.<lambda>codeintel/retrieval.py:404 × 50, 0.014 msRetriever._fusecodeintel/retrieval.py:409 × 1, 0.064 msRetriever._fuse.<locals>.hitcodeintel/retrieval.py:413 × 50, 0.045 mswanted_rolescodeintel/retrieval.py:160 × 1, 0.006 msRetriever._finalizecodeintel/retrieval.py:511 × 1, 0.91 mspath_rolecodeintel/retrieval.py:149 × 50, 0.10 msis_test_pathcodeintel/retrieval.py:145 × 50, 0.045 msRetriever._finalize.<locals>.<lambda>codeintel/retrieval.py:530 × 50, 0.014 msRetriever._hydratecodeintel/retrieval.py:535 × 1, 0.84 msEmbeddingVector.process_result_valueshared/vector_type.py:101 × 17, 0.69 msparse_vector_literalshared/vector_type.py:49 × 17, 0.68 mshit_to_dictcodeintel/context.py:91 × 5, 0.026 msEvidence.as_dictcodeintel/retrieval.py:97 × 5, 0.004 msweb_file_urlcodeintel/git_source.py:108 × 5, 0.010 mssource_requestscodeintel/context.py:116 × 1, 0.51 msresolve_sourcescodeintel/source.py:165 × 1, 81.55 msresolve_sources.<locals>.<lambda>codeintel/source.py:172 × 5, 369.36 ms_resolve_onecodeintel/source.py:141 × 5, 369.35 ms_loadcodeintel/source.py:121 × 5, 369.10 ms_FileCache.getcodeintel/source.py:67 × 5, 0.005 msraw_file_urlcodeintel/git_source.py:94 × 5, 0.014 ms_fetch_httpscodeintel/source.py:97 × 5, 369.03 ms_FileCache.putcodeintel/source.py:74 × 5, 0.013 msgit_blob_shacodeintel/source.py:85 × 5, 0.055 ms_slicecodeintel/source.py:89 × 5, 0.16 msRetriever.neighborscodeintel/retrieval.py:567 × 1, 0.88 msselect_rulescodeintel/context.py:264 × 1, 0.36 ms_rendercodeintel/context.py:321 × 1, 0.022 ms_Budget.takecodeintel/context.py:70 × 7, 0.004 ms
Claims this supports
In a recorded run at commit 975a38d, a question sent through native MCP returned five chunks, each fetched from GitHub and matched against its indexed Git blob.
One local run with a question chosen by the author. Not a benchmark and not the deployed service.
Source context is checked against the indexed Git blob SHA.
Integrity checking is not semantic code correctness or security certification.
Native MCP exposes search, context, symbol, repository and repository-memory tools.
