Skip to content

feat(hosted-data): add hosted replay repository and CLI - #3262

Open
xiaoyaoqilan wants to merge 16 commits into
dimensionalOS:mainfrom
xiaoyaoqilan:feat/hosted-data-repository-core
Open

feat(hosted-data): add hosted replay repository and CLI#3262
xiaoyaoqilan wants to merge 16 commits into
dimensionalOS:mainfrom
xiaoyaoqilan:feat/hosted-data-repository-core

Conversation

@xiaoyaoqilan

@xiaoyaoqilan xiaoyaoqilan commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Status

This is the only PR proposed for review and merge for the current #3158 work. The earlier prototype #3201 is closed and is not a merge candidate.

User flow

After installing DimOS on Ubuntu or WSL, a developer can serve, upload, and replay a remote memory2 database through the normal dimos command:

# Server
dimos data serve --root ~/.local/share/dimos/replay-repository \
  --host 0.0.0.0 --port 8765

# Upload a memory2 replay database
dimos data upload go2_office.db \
  --server-url http://SERVER:8765 --owner alice --repo go2

# Run the existing Go2 blueprint from the hosted object
dimos --data-server-url http://SERVER:8765 \
  --replay \
  --replay-db dimos-replay://alice/go2/OBJECT_ID \
  run unitree-go2

The resolver downloads the database once to the XDG cache, verifies SHA-256, and reuses the verified cache on later runs.

What this PR adds

  • filesystem-backed SHA-256 content-addressed repository;
  • atomic streamed writes and interrupted-write cleanup;
  • HTTP upload, list, HEAD, full download, and byte-range download;
  • dimos data serve/upload/list/download commands;
  • dimos-replay://OWNER/REPOSITORY/OBJECT_ID references;
  • direct integration with GlobalConfig.replay_db and the existing Go2 ReplayConnection;
  • focused repository, API, CLI, cache, and reference tests.

The existing DimOS Relay remains responsible for live robot streams. Hosted replay storage is durable and separate.

Important format boundary

dimos --replay run unitree-go2 consumes a memory2 SQLite database (.db, .sqlite, or .sqlite3) containing synchronized lidar, odometry, and video streams. An arbitrary MP4 can be stored and downloaded, but it cannot drive the Go2 SLAM replay by itself.

Validation

  • 29 repository, HTTP API, CLI, reference, and cache tests passed;
  • Ruff check, format, and git diff --check passed;
  • real 6 MiB CLI upload/list/download smoke test passed with matching SHA-256;
  • real SQLite upload and dimos-replay:// download passed;
  • a second resolution succeeded from cache after the server was stopped;
  • HTTP byte-range request returned 206.

No new dependencies are added. Serving uses the existing DimOS web extra. Design context: #3260.

Not in this PR

No Relay modification, browser UI, cloud provider, regional routing, or production authorization. This PR does not claim to complete every production requirement in #3158.

AI assistance

OpenAI Codex with GPT-5 assisted with implementation, tests, and scope reduction.

Checklist

  • I have read and approved the CLA.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.06977% with 51 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/hosted_data/api.py 85.96% 11 Missing and 5 partials ⚠️
dimos/hosted_data/repository.py 89.61% 9 Missing and 7 partials ⚠️
dimos/hosted_data/cli.py 91.20% 7 Missing and 1 partial ⚠️
dimos/hosted_data/reference.py 92.40% 3 Missing and 3 partials ⚠️
dimos/memory2/replay.py 40.00% 3 Missing ⚠️
dimos/robot/unitree/go2/connection.py 0.00% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main    #3262      +/-   ##
==========================================
- Coverage   74.96%   74.86%   -0.11%     
==========================================
  Files        1117     1129      +12     
  Lines      106875   108219    +1344     
  Branches     9699     9824     +125     
==========================================
+ Hits        80123    81017     +894     
- Misses      23945    24403     +458     
+ Partials     2807     2799       -8     
Flag Coverage Δ
OS-ubuntu-24.04-arm 68.81% <94.06%> (+0.27%) ⬆️
OS-ubuntu-latest 70.88% <94.06%> (+0.24%) ⬆️
Py-3.10 70.88% <94.06%> (+0.24%) ⬆️
Py-3.11 70.88% <94.06%> (+0.25%) ⬆️
Py-3.12 70.88% <94.06%> (+0.24%) ⬆️
Py-3.13 70.88% <94.06%> (+0.24%) ⬆️
Py-3.14 70.88% <94.06%> (+0.24%) ⬆️
Py-3.14t 70.88% <94.06%> (+0.24%) ⬆️
SelfHosted-macOS ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/core/global_config.py 89.01% <100.00%> (+5.67%) ⬆️
dimos/hosted_data/test_api.py 100.00% <100.00%> (ø)
dimos/hosted_data/test_cli.py 100.00% <100.00%> (ø)
dimos/hosted_data/test_edge_cases.py 100.00% <100.00%> (ø)
dimos/hosted_data/test_reference.py 100.00% <100.00%> (ø)
dimos/hosted_data/test_repository.py 100.00% <100.00%> (ø)
dimos/robot/cli/dimos.py 66.98% <100.00%> (-0.07%) ⬇️
dimos/robot/unitree/go2/connection.py 58.64% <0.00%> (+3.17%) ⬆️
dimos/memory2/replay.py 56.99% <40.00%> (+5.67%) ⬆️
dimos/hosted_data/reference.py 92.40% <92.40%> (ø)
... and 3 more

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xiaoyaoqilan xiaoyaoqilan changed the title feat(hosted-data): add filesystem repository core feat(hosted-data): add repository and HTTP transfer API Jul 29, 2026
@xiaoyaoqilan xiaoyaoqilan changed the title feat(hosted-data): add repository and HTTP transfer API feat(hosted-data): add repository, HTTP API, and DimOS CLI Jul 29, 2026
@xiaoyaoqilan xiaoyaoqilan changed the title feat(hosted-data): add repository, HTTP API, and DimOS CLI feat(hosted-data): add hosted replay repository and CLI Jul 29, 2026
@xiaoyaoqilan
xiaoyaoqilan marked this pull request as ready for review July 29, 2026 03:22
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 29, 2026
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 29, 2026
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.

1 participant