Get one file from the latest context document tree
Serve ONE file from the latest ready tree — the dashboard’s per-page fetch.
The dashboard’s /v2/p/<path> page needs a single file, but historically
fetched the whole tree via GET /tree/latest (all files’ bodies +
provenance + manifests, multi-MB) and discarded all but one — an O(corpus)
cost on every page click. This endpoint returns just the requested path:
the latest READY (COMPLETED/PUBLISHED) BRAIN tree’s matching file, scoped to
that file’s manifest, with the SAME redaction / category-filter / personal-
override semantics as the dashboard arm of /tree/latest
(include_published=true).
Redaction parity is structural, not re-implemented: redact_tree_files is
a per-file map, so running _render_tree_body on a one-element file list
yields byte-identical redacted output to what /tree/latest serves for
that file. Conditional GET (If-None-Match) short-circuits to 304 without
loading/redacting/serializing, the same fast path /tree/latest has.
Returns a TreeResponse with files narrowed to the single file and
meta narrowed to that file’s manifest, so the dashboard’s existing
parsing (files[0], meta.doc_manifests[<file_key>]) works unchanged.
Authorizations
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Query Parameters
Response
Successful Response
Sidecar describing an in-flight (or just-failed) regeneration.
Present only on the dashboard path (include_published=true) when a newer
PROCESSING/FAILED row exists behind the served ready tree — the served body
stays the last COMPLETED/PUBLISHED tree so the brain never blanks out
mid-regen, and this block is how the UI knows to show a progress banner.