Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
991d22d
refactor(mcap): integrate mcap crate for S3 streaming
zhexuany Feb 7, 2026
9abbd47
feat: unify transport and streaming layers
zhexuany Feb 7, 2026
435cdf2
docs: add HTTP/HTTPS URL support to README
zhexuany Feb 7, 2026
5405e30
feat: add HTTP/HTTPS authentication and write support
zhexuany Feb 7, 2026
f58e7df
refactor: eliminate technical debt - dead code, clippy warnings, exam…
zhexuany Feb 7, 2026
ade8640
refactor: complete remaining technical debt tasks
zhexuany Feb 7, 2026
7f8d90c
fix: remove needless reference in magic comparison
zhexuany Feb 7, 2026
d76bc5d
refactor: fix doc warnings and refactor tests to use public API
zhexuany Feb 7, 2026
36d2f46
refactor: remove dead code identified by API trace analysis
zhexuany Feb 7, 2026
44f0e11
refactor: systematic package-by-package technical debt cleanup
zhexuany Feb 7, 2026
0a39162
refactor: rename s3 feature to remote for clarity
zhexuany Feb 7, 2026
f89c7ae
refactor: replace test utilities with proper API examples
zhexuany Feb 7, 2026
20b7ffa
refactor: add #[must_use] to public API methods
zhexuany Feb 7, 2026
39a55a4
refactor: add #[must_use] to rewriter public API
zhexuany Feb 7, 2026
c670d38
refactor: comprehensive technical debt elimination
zhexuany Feb 7, 2026
f0f4442
remove some docs
zhexuany Feb 7, 2026
5c7777a
refactor: remove HTTP support and fix unwrap() calls
zhexuany Feb 7, 2026
c54842d
docs: add S3 support example to lib.rs
zhexuany Feb 7, 2026
6017254
ci: fix feature flags after workspace restructure
zhexuany Feb 7, 2026
fb35809
test: fix fixture_path to work from both workspace and CLI crate
zhexuany Feb 7, 2026
bb15351
update tests
zhexuany Feb 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"github@claude-plugins-official": true,
"context7@claude-plugins-official": true,
"feature-dev@claude-plugins-official": true,
"systems-programming@claude-code-workflows": true,
"pr-review-toolkit@claude-plugins-official": true,
"c4-architecture@claude-code-workflows": true,
"commit-commands@claude-plugins-official": true,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# PyO3's extension-module feature prevents linking in standalone test binaries.
# Python bindings would be tested separately via maturin if needed.
- name: Build CLI binary (for CLI tests)
run: cargo build --bin robocodec --features cli
run: cargo build --bin robocodec --package robocodec-cli

- name: Run tests
run: cargo test
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
# Note: Do NOT use --all-features or --features python here.
# PyO3's extension-module feature prevents linking in standalone test binaries.
- name: Run tests with coverage
run: cargo llvm-cov --workspace --features "cli,s3" --lcov --output-path lcov-rust.info
run: cargo llvm-cov --workspace --features remote --lcov --output-path lcov-rust.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -113,7 +113,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Build CLI binary (for CLI tests)
run: cargo build --bin robocodec --features cli
run: cargo build --bin robocodec --package robocodec-cli

- name: Run tests
run: cargo test
Expand Down Expand Up @@ -243,4 +243,4 @@ jobs:
MINIO_ENDPOINT: http://127.0.0.1:9000
MINIO_BUCKET: test-bucket
MINIO_REGION: us-east-1
run: cargo test --features s3 -- minio_tests
run: cargo test --features remote -- s3_integration_tests
264 changes: 216 additions & 48 deletions ARCHITECTURE.md

Large diffs are not rendered by default.

78 changes: 68 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ Robocodec is a **format-centric** robotics data codec library with a layered arc
│ Format-Specific Layer │
│ - io/formats/mcap/ (MCAP read/write) │
│ - io/formats/bag/ (ROS1 bag read/write) │
│ - io/formats/rrd/ (RRF2 read/write) │
└──────────────────┬──────────────────────────┘
┌──────────────────▼──────────────────────────┐
│ Transport & Streaming Layer (Internal) │
│ - io/transport/ (Transport trait) │
│ - io/streaming/ (StreamingParser trait) │
│ - LocalTransport, S3Transport, HttpTransport│
└──────────────────┬──────────────────────────┘
┌──────────────────▼──────────────────────────┐
Expand All @@ -65,23 +73,29 @@ Robocodec is a **format-centric** robotics data codec library with a layered arc

### Key Design Principles

1. **Format-Centric**: Each format (MCAP, ROS1 bag) lives in `src/io/formats/{format}/` with its own readers and writers.
1. **Format-Centric**: Each format (MCAP, ROS1 bag, RRD) lives in `src/io/formats/{format}/` with its own readers and writers.

2. **Unified Public API**: High-level `RoboReader`, `RoboWriter` provide a consistent interface across formats. Downcasting to format-specific types is intentionally **not** part of the public API.

3. **Simplified Iteration**: Single-level iteration via `reader.decoded()` returns `DecodedMessageIter` directly. No need to call `.stream()` separately.
3. **Transport Abstraction**: Internal `Transport` trait enables reading from any data source (local files, S3, HTTP) with a single API. URL detection (`s3://`, `https://`) is handled automatically.

4. **Streaming Parser Pattern**: `StreamingParser` trait provides chunk-based parsing for memory-efficient processing of large files from any transport.

4. **Unified Result Types**: `DecodedMessageResult` combines message data, channel info, and timestamps in a single type.
5. **Simplified Iteration**: Single-level iteration via `reader.decoded()` returns `DecodedMessageIter` directly. No need to call `.stream()` separately.

5. **Auto-Detection**: Format is detected from file extension automatically.
6. **Unified Result Types**: `DecodedMessageResult` combines message data, channel info, and timestamps in a single type.

7. **Auto-Detection**: Format is detected from file extension automatically.

### Directory Structure

- `src/io/reader/` - Unified reader API (RoboReader, iterators, config)
- `src/io/writer/` - Unified writer API (RoboWriter, config)
- `src/io/formats/mcap/` - MCAP format (read/write)
- `src/io/formats/bag/` - ROS1 bag format (read/write)
- `src/io/formats/rrd/` - RRF2 format (read/write)
- `src/io/transport/` - Transport layer (LocalTransport, S3Transport, HttpTransport, MemoryTransport)
- `src/io/streaming/` - Streaming parser trait and utilities
- `src/io/formats/mcap/` - MCAP format (read/write, streaming)
- `src/io/formats/bag/` - ROS1 bag format (read/write, streaming)
- `src/io/formats/rrd/` - RRF2 format (read/write, streaming)
- `src/io/metadata.rs` - Unified types (ChannelInfo, RawMessage, DecodedMessageResult)
- `src/io/traits.rs` - FormatReader, FormatWriter traits
- `src/encoding/` - Message codecs (CDR, Protobuf, JSON)
Expand All @@ -96,7 +110,7 @@ Robocodec is a **format-centric** robotics data codec library with a layered arc
The library exports these key types at the top level:

- **`RoboReader`** - Unified reader with format auto-detection
- `open(path)` - Open file with auto-detection
- `open(path)` - Open file with auto-detection (supports local paths, `s3://`, `https://` URLs)
- `open_with_config(path, config)` - Open with configuration
- `decoded()` - Iterate over decoded messages with timestamps (returns `DecodedMessageIter`)
- `supports_parallel()` - Check if parallel reading is available
Expand All @@ -109,6 +123,28 @@ The library exports these key types at the top level:

- **`DecodedMessageIter`** - Iterator yielding `DecodedMessageResult`

- **`DecodedMessageResult`** - Combined message + metadata
- `message` - Decoded message fields
- `channel` - Channel information
- `log_time`, `publish_time` - Timestamps
- `sequence` - Sequence number (if available)

### URL Support

`RoboReader::open()` supports URL-based sources:
- **Local files**: `/path/to/file.mcap` or `./relative/path.mcap`
- **S3**: `s3://bucket/path/file.mcap` (with optional `?endpoint=` and `?region=` query params)
- **HTTP/HTTPS**: `https://example.com/file.mcap` (via HttpTransport)

Transport-based reading uses `McapTransportReader` internally for streaming from remote sources.

- **`RoboWriter`** - Unified writer with format auto-detection
- `create(path)` - Create writer based on extension
- `create_with_config(path, config)` - Create with configuration
- Inherits `FormatWriter` trait methods (add_channel, write, finish)

- **`DecodedMessageIter`** - Iterator yielding `DecodedMessageResult`

- **`DecodedMessageResult`** - Combined message + metadata
- `message` - Decoded message fields
- `channel` - Channel information
Expand All @@ -119,11 +155,29 @@ The library exports these key types at the top level:

As a common library for other projects to use, these do NOT belong:

1. **CLI tools** - Should be in a separate `robocodec-cli` crate
2. **CLI dependencies** - `clap`, `indicatif`, `human-size` should be feature-gated or moved
1. ~~**CLI tools** - Should be in a separate `robocodec-cli` crate~~ (MOVED - CLI is now in `robocodec-cli/`)
2. ~~**CLI dependencies** - `clap`, `indicatif`, `human-size` should be feature-gated or moved~~ (MOVED - these are now in `robocodec-cli/`)
3. **Development examples** - Files with hardcoded paths in `examples/`
4. **Internal type exposure** - Downcasting methods expose implementation details

### Workspace Structure

This is a Cargo workspace with two members:
- `robocodec` - The library crate (this directory)
- `robocodec-cli/` - The CLI tool crate (separate binary)

To build just the library:
```bash
cargo build --package robocodec
```

To build and install the CLI:
```bash
cargo install --path robocodec-cli
# or
cargo build --release --package robocodec-cli
```

## Code Style

- **Naming**: Modules `snake_case`, types `PascalCase`, functions `snake_case`
Expand Down Expand Up @@ -189,3 +243,7 @@ As a staff Rust engineer, always follow these guidelines:

- `python` - PyO3 Python bindings
- `jemalloc` - Use jemalloc allocator (Linux only)
- `s3` - S3/HTTPS transport support (default enabled)
- Enables `S3Transport` for reading from S3-compatible storage
- Enables `HttpTransport` for reading from HTTP/HTTPS URLs
- Requires tokio runtime for async operations
Loading