What Shelv guarantees
1) Deterministic access shape
Once a shelf is inready (or review), the API exposes a stable filesystem interface:
GET /v1/shelves/{id}/treeGET /v1/shelves/{id}/files/{path}GET /v1/shelves/{id}/archive-url
2) Verified structuring before availability
Shelves move through:uploading -> parsing -> structuring -> verifying -> ready|review|failed
The verifying phase is where Shelv checks output integrity before making a shelf available.
3) Explicit terminal states
A shelf eventually reaches one of these terminal states:ready— usable for all read/hydration flowsreview— usable for read/hydration, pending approval workflowsfailed— contains failure metadata and is retryable
Output integrity checks
Shelv verifies structured output before serving it:- Content integrity validation across processing stages
- Coverage checks to prevent dropped sections
- Structural sanity checks on generated filesystem output
- Status-gated endpoint availability (no premature reads)
failed and includes failure metadata.
Reliability patterns for production
Prefer event-driven completion
Use webhooks instead of aggressive polling. Recommended flow:- Upload document (
POST /v1/shelves) - Store shelf id
- Wait for
shelf.ready/shelf.review/shelf.failed - Fetch
treeor hydrate viaarchive-url
Implement idempotency and retries
Webhook delivery is at-least-once. Consumers should:- dedupe by
webhook-id - verify signature and timestamp freshness
- safely retry downstream operations
Handle conflict responses as a state signal
If a status-gated endpoint returns conflict, branch on current shelf status and retry only when eligible.Failure behavior you can rely on
When a shelf fails:- status becomes
failed - metadata includes failure step and message
POST /v1/shelves/{id}/retrycan re-run processing
Security posture (integration-facing)
API authentication
- API keys are required for API access (
Bearer sk_...) - Dashboard and API auth are separated by use case
Webhook safety
Shelv webhook delivery includes:- signed payloads (
webhook-signature) - timestamping (
webhook-timestamp) - idempotency key (
webhook-id)
Principle of least privilege
Scope keys to your environment and rotate on a schedule. Treat webhook secrets and API keys as production credentials.Integration trust checklist
Before production rollout:- Branch by shelf status before file access
- Use webhook-driven completion
- Verify webhook signatures and timestamps
- Deduplicate by
webhook-id - Implement retry paths for
failedshelves - Add operational alerts for repeated failures
What to measure internally
For your own proof baseline, track:- time from upload to
ready - success vs failed shelf rate
- retry success rate
- time from
readyto first successful agent read
