Skip to content

docs(xet): document v2 CAS API + batch reconstruction; fix xorb chunk limit#2645

Open
rajatarya wants to merge 1 commit into
mainfrom
xet-docs-drift-fixes
Open

docs(xet): document v2 CAS API + batch reconstruction; fix xorb chunk limit#2645
rajatarya wants to merge 1 commit into
mainfrom
xet-docs-drift-fixes

Conversation

@rajatarya

@rajatarya rajatarya commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Fixes public-docs drift found by the automated xet-docs-refresh audit (source of truth: xetcas@3c753ea, xet-core@v1.5.1).

docs/xet/api.md — document the /v2 API + batch reconstruction (fixes huggingface-internal/xetcas#1175)

The CAS API spec documented only four /v1 endpoints, but the client actively uses several more. Added:

  • POST /v1/reconstructions — batch file reconstruction (batch_get_reconstruction).
  • GET /v2/reconstructions/{file_id} — multi-range-optimized reconstruction (get_reconstruction_v2, QueryReconstructionResponseV2); fetch info keyed under xorbs.
  • GET /v2/file-chunk-hashes/{file_id} — chunk-window / range-hash summaries for re-chunking dirty regions (get_file_chunk_hashes, FileChunkHashesResponse); requires the X-Range-Dirty header.
  • POST /v2/shards — streaming (NDJSON) variant of shard upload (post_shard_v2).

docs/xet/xorb.md — correct the chunk-count limit (fixes huggingface-internal/xetcas#1176)

The doc stated there is "no explicit limit on the number of chunks in a Xorb." Source enforces MAX_XORB_CHUNKS = 8192 (xet_core_structures/src/xorb_object/constants.rs) in addition to the 64 MiB serialized-size cap; the client cuts a xorb once either bound is hit.

All additions match the source structs in xet_client/src/cas_types and the routes in cas_server/src/serve.rs.

🤖 Generated with Claude Code


Note

Low Risk
Documentation-only updates with no runtime or API behavior changes.

Overview
Brings the public Xet CAS docs in line with endpoints and limits the client already uses.

docs/xet/api.md adds four endpoint sections after the existing v1 APIs: POST /v1/reconstructions for batch file reconstruction (no byte ranges); GET /v2/reconstructions/{file_id} with QueryReconstructionResponseV2 and fetch info under xorbs (combined signed URLs and required Range values); GET /v2/file-chunk-hashes/{file_id} with mandatory X-Range-Dirty for incremental re-chunking; and POST /v2/shards as an NDJSON streaming upload with terminal success/error frames.

docs/xet/xorb.md replaces the claim that there is no chunk-count cap with MAX_XORB_CHUNKS (8192) alongside the 64 MiB serialized limit, and notes that clients start a new xorb when either bound is hit.

Reviewed by Cursor Bugbot for commit 9838b28. Bugbot is set up for automated code reviews on this repo. Configure here.

… limit

Addresses drift found by the xet-docs-refresh audit against xetcas@3c753ea
and xet-core@v1.5.1:

- api.md: add the /v2 endpoints and batch reconstruction, which the client
  actively uses but were undocumented — GET /v2/reconstructions/{file_id},
  GET /v2/file-chunk-hashes/{file_id}, POST /v1/reconstructions (batch), and
  the streaming POST /v2/shards.
- xorb.md: correct "no explicit limit on the number of chunks" — source
  enforces MAX_XORB_CHUNKS = 8192 in addition to the 64 MiB serialized cap.

Ref huggingface-internal/xetcas#1175, huggingface-internal/xetcas#1176

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wr4cVEYeGC1kGZ9mVidzxP
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rajatarya
rajatarya requested a review from assafvayner July 14, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants