Back to the room

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

  1. MCP server
  2. Context assembly
  3. Retriever
  4. Embeddings
  5. Source verification
  1. 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

  2. 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

  3. 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
  4. 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
  5. 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

    Source that ran

  6. 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

  7. 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

  8. 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
  9. 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

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.

RankSymbolLinesScoreBlob check
1codeintel.git_source.Checkout.read_blob383–4060.865354Verified
2codeintel.git_source1–4650.846622Verified
3learning.memory.file_evidence52–570.842446Verified
4codeintel.git_source.read_file_at_commit446–4610.837611Verified
5codeintel.source.git_blob_sha85–860.836114Verified

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
  1. _install_auth_middleware.<locals>.authentication_middleware __init__.py:159 × 1
  2. is_public shared/auth.py:122 × 1, 0.005 ms
  3. parse_bearer shared/auth.py:113 × 1, 0.003 ms
  4. principal_for_token shared/auth.py:102 × 1, 0.008 ms
  5. _configured shared/auth.py:97 × 2, 0.004 ms
  6. allowed_for shared/auth.py:126 × 1, 0.003 ms
  7. Principal.is_admin shared/auth.py:74 × 1, 0.001 ms
  8. Principal.as_state shared/auth.py:83 × 1, 0.015 ms
  9. Principal.user_uuid shared/auth.py:78 × 1, 0.011 ms
  10. _install_pool_monitor.<locals>.monitor_connection_pool __init__.py:199 × 1
  11. build_mcp_server.<locals>.retrieve_context modules/mcp/native_server.py:88 × 1, 104.68 ms
  12. session_scope codeintel/runtime.py:21 × 1
  13. ensure_database codeintel/runtime.py:15 × 1, 0.001 ms
  14. get_embedder codeintel/embeddings.py:475 × 1, 0.006 ms
  15. resolve_backend codeintel/embeddings.py:467 × 1, 0.001 ms
  16. secret codeintel/runtime.py:31 × 1, 0.001 ms
  17. assemble_context codeintel/context.py:154 × 1, 104.44 ms
  18. resolve_repositories codeintel/context.py:82 × 1, 0.58 ms
  19. repositories_matching codeintel/retrieval.py:614 × 1, 0.58 ms
  20. _setup_event_listeners.<locals>.receive_before_cursor_execute shared/database.py:398 × 24, 0.018 ms
  21. _setup_event_listeners.<locals>.receive_after_cursor_execute shared/database.py:406 × 24, 0.028 ms
  22. GUID.process_result_value shared/base_model.py:46 × 241, 0.080 ms
  23. Retriever.__init__ codeintel/retrieval.py:197 × 1, 0.002 ms
  24. Retriever.search codeintel/retrieval.py:204 × 1, 18.79 ms
  25. query_terms codeintel/text.py:58 × 2, 0.035 ms
  26. tokenize codeintel/text.py:39 × 2, 0.030 ms
  27. split_identifier codeintel/text.py:28 × 13, 0.020 ms
  28. split_identifier.<locals>.<genexpr> codeintel/text.py:35 × 13
  29. Retriever._dense_unavailable_reason codeintel/retrieval.py:281 × 1, 0.34 ms
  30. Retriever._filter_clauses codeintel/retrieval.py:305 × 2, 0.064 ms
  31. GUID.load_dialect_impl shared/base_model.py:29 × 9, 0.044 ms
  32. GUID.process_bind_param shared/base_model.py:35 × 79, 0.057 ms
  33. OnnxEmbedder.embed_query codeintel/embeddings.py:341 × 1, 4.36 ms
  34. OnnxEmbedder.encode_raw codeintel/embeddings.py:344 × 1, 4.35 ms
  35. OnnxEmbedder._load codeintel/embeddings.py:312 × 1, 0.001 ms
  36. OnnxEmbedder.encode_raw.<locals>.<genexpr> codeintel/embeddings.py:363 × 1
  37. _pad codeintel/embeddings.py:64 × 1, 0.015 ms
  38. Retriever._dense codeintel/retrieval.py:370 × 1, 12.19 ms
  39. _supports_iterative_scan codeintel/retrieval.py:596 × 1, 0.011 ms
  40. EmbeddingVector.__init__ shared/vector_type.py:86 × 1, 0.005 ms
  41. _VectorText.process_bind_param shared/vector_type.py:68 × 1, 0.22 ms
  42. to_vector_literal shared/vector_type.py:38 × 1, 0.21 ms
  43. Retriever._dense.<locals>.<genexpr> codeintel/retrieval.py:403 × 1
  44. Retriever._dense.<locals>.<lambda> codeintel/retrieval.py:404 × 50, 0.014 ms
  45. Retriever._fuse codeintel/retrieval.py:409 × 1, 0.064 ms
  46. Retriever._fuse.<locals>.hit codeintel/retrieval.py:413 × 50, 0.045 ms
  47. wanted_roles codeintel/retrieval.py:160 × 1, 0.006 ms
  48. Retriever._finalize codeintel/retrieval.py:511 × 1, 0.91 ms
  49. path_role codeintel/retrieval.py:149 × 50, 0.10 ms
  50. is_test_path codeintel/retrieval.py:145 × 50, 0.045 ms
  51. Retriever._finalize.<locals>.<lambda> codeintel/retrieval.py:530 × 50, 0.014 ms
  52. Retriever._hydrate codeintel/retrieval.py:535 × 1, 0.84 ms
  53. EmbeddingVector.process_result_value shared/vector_type.py:101 × 17, 0.69 ms
  54. parse_vector_literal shared/vector_type.py:49 × 17, 0.68 ms
  55. hit_to_dict codeintel/context.py:91 × 5, 0.026 ms
  56. Evidence.as_dict codeintel/retrieval.py:97 × 5, 0.004 ms
  57. web_file_url codeintel/git_source.py:108 × 5, 0.010 ms
  58. source_requests codeintel/context.py:116 × 1, 0.51 ms
  59. resolve_sources codeintel/source.py:165 × 1, 81.55 ms
  60. resolve_sources.<locals>.<lambda> codeintel/source.py:172 × 5, 369.36 ms
  61. _resolve_one codeintel/source.py:141 × 5, 369.35 ms
  62. _load codeintel/source.py:121 × 5, 369.10 ms
  63. _FileCache.get codeintel/source.py:67 × 5, 0.005 ms
  64. raw_file_url codeintel/git_source.py:94 × 5, 0.014 ms
  65. _fetch_https codeintel/source.py:97 × 5, 369.03 ms
  66. _FileCache.put codeintel/source.py:74 × 5, 0.013 ms
  67. git_blob_sha codeintel/source.py:85 × 5, 0.055 ms
  68. _slice codeintel/source.py:89 × 5, 0.16 ms
  69. Retriever.neighbors codeintel/retrieval.py:567 × 1, 0.88 ms
  70. select_rules codeintel/context.py:264 × 1, 0.36 ms
  71. _render codeintel/context.py:321 × 1, 0.022 ms
  72. _Budget.take codeintel/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.

    Recorded runLedger

    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.

    Source verifiedLedger

    Integrity checking is not semantic code correctness or security certification.

  • Native MCP exposes search, context, symbol, repository and repository-memory tools.

    Source verifiedLedger