responses
responses
#
Response models for the CaptureGraph captured-data file API.
Pydantic models for the CaptureGraph server's captured-data file API, shared
between capturegraph-server (produces) and capturegraph-sync (consumes). The
full wire spec lives in docs/dsl/captured-data-format.md.
EntriesResponse
#
Bases: BaseModel
Response from the directories enumeration endpoint.
exists is the directory's own presence on disk, told apart from an empty
listing so a loaded Array/Map keeps a present-but-empty directory (an empty
collection) distinct from an absent one (Missing). entries are the
distinct child stems (subdirectory names plus file stems without extension),
sorted — Map key-encoded names and Array zero-padded indices in the layout.
Source code in capturegraph-lib/capturegraph/api_models/responses.py
FileSaveResponse
#
Bases: BaseModel
Response from the files:save batch endpoint.
results[i] is the present verdict for the request's entries[i],
ready for the client to cache each written leaf without a follow-up read.
Source code in capturegraph-lib/capturegraph/api_models/responses.py
LeafResolveResponse
#
Bases: BaseModel
Response from files:resolve.
results[i] answers the request's entries[i].
Source code in capturegraph-lib/capturegraph/api_models/responses.py
LeafState
#
Bases: BaseModel
The server's verdict for one leaf, the unit of the resolve and save APIs.
A leaf has exactly one status:
unchanged: the client'sknown_versionis still current. No payload; the client serves its cached copy.present: the leaf exists with content identified byversion(an opaque token; equal versions mean identical bytes).extensionis the on-disk extension.inline_base64carries the bytes themselves when they are small enough to ship inline (saving a separate download); it is absent for large files, which the client fetches fromload/file.dynamicis True for interceptor-generated leaves, whose value the server recomputes on every request — the client may cache one for offline use but must not enroll it in background revalidation.missing: no such leaf exists. No payload.
version is the single content identity: a static file's is the base64
blake2b of its bytes, an interceptor leaf's is the base64 blake2b of its
generated bytes. The client treats it as opaque — it only compares versions
and uses one as a cache key, never computing its own.
Source code in capturegraph-lib/capturegraph/api_models/responses.py
missing()
staticmethod
#
present(version, extension, inline_base64=None, dynamic=False)
staticmethod
#
Build a present leaf with the given content version and extension.
inline_base64 carries the bytes themselves when small enough to
ship inline; dynamic marks an interceptor-generated leaf.