Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / Serve
Source verification
Code is read at the indexed commit and compared with its Git blob SHA before it is returned.
Recorded run
PHAROS at 975a38dMIT license
How it works
PHAROS stores pointers instead of source. To answer, it fetches the file at the pinned commit, hashes the whole file the way Git does and compares that with the SHA recorded at index time.
A mismatch withholds the code and reports why. Cached bytes pass through the same comparison.
Recorded runs through it
- A question reaches verified sourceOne 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.
- What the blob check does with a mismatchThe same pointer through the same call, three times. Only the expected SHA changes.
Source evidence
- The Git blob hash
backend/app/codeintel/source.py:85–86Git's own object hash: SHA-1 over a header and the file's bytes. A span of a file cannot be checked, so the whole file is hashed. - Compare before returning
backend/app/codeintel/source.py:141–162The check itself. A mismatch returns unavailable:content_mismatch and no code. With no recorded SHA, code is returned with verified left false. - Load at the pinned commit
backend/app/codeintel/source.py:121–138Cached bytes come back through the same comparison, because the check happens after this returns. - Fetch from an allowlisted host
backend/app/codeintel/source.py:97–118Https only, allowlisted hosts, no redirects, a size cap and a timeout. - Resolve pointers concurrently
backend/app/codeintel/source.py:165–173Eight workers at most. It never raises, so one unavailable file cannot fail the response. - Pointer to request
backend/app/codeintel/context.py:116–151The blob SHA comes from the row written at index time, not from the file being checked.
Claims this supports
Source context is checked against the indexed Git blob SHA.
Integrity checking is not semantic code correctness or security certification.
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.
In a recorded run, changing the expected blob SHA made PHAROS withhold the source and report a content mismatch.
With no SHA on record, source is returned marked unverified.
