# STR-003: Public Re-exports

| Link | Path |
|------|------|
| **Normative** | [NORMATIVE.md](../NORMATIVE.md) |
| **Verification** | [VERIFICATION.md](../VERIFICATION.md) |
| **Tracking** | [TRACKING.yaml](../TRACKING.yaml) |
| **Spec** | [SPEC.md](../../../../resources/SPEC.md) Section 15 |

---

## Summary

`lib.rs` MUST re-export all primary public types, constants, and key encoding functions so that consumers can import them directly from the crate root.

---

## Specification

The crate root (`lib.rs`) MUST contain `pub use` statements for:

```rust
// Core store
pub use store::BlockStore;
pub use config::BlockStoreConfig;

// Types
pub use types::block_record::BlockRecord;
pub use types::stored_checkpoint::StoredCheckpoint;
pub use types::chain_tip::ChainTip;
pub use types::storage_stats::StorageStats;

// Error
pub use error::BlockStoreError;

// Constants - Column Families
pub use constants::{
    CF_BLOCKS, CF_HEADERS, CF_ATTESTED,
    CF_CANONICAL, CF_CHECKPOINTS, CF_METADATA,
};

// Constants - Metadata Keys
pub use constants::{
    META_TIP, META_GENESIS_HASH, META_MIN_HEIGHT,
    META_SCHEMA_VERSION, META_ZSTD_DICT,
};

// Key Encoding
pub use encoding::{
    hash_key, height_key, decode_height_key, epoch_key, decode_epoch_key, metadata_key,
};
```

Consumers MUST be able to write:

```rust
use dig_blockstore::{
    BlockStore, BlockStoreConfig, BlockRecord,
    StoredCheckpoint, ChainTip, StorageStats,
    BlockStoreError,
    CF_BLOCKS, CF_HEADERS, CF_ATTESTED,
    CF_CANONICAL, CF_CHECKPOINTS, CF_METADATA,
    META_TIP, META_GENESIS_HASH,
};
```

---

## Acceptance Criteria

- [x] `BlockStore` is importable from crate root
- [x] `BlockStoreConfig` is importable from crate root
- [x] `BlockRecord` is importable from crate root
- [x] `StoredCheckpoint` is importable from crate root
- [x] `ChainTip` is importable from crate root
- [x] `StorageStats` is importable from crate root
- [x] `BlockStoreError` is importable from crate root
- [x] All `CF_*` constants are importable from crate root
- [x] All `META_*` constants are importable from crate root
- [x] Key encoding functions are importable from crate root

---

## Implementation Notes

- Re-exports should use `pub use` rather than `pub mod` to keep the public API flat.
- Internal modules may remain private; only the listed symbols need public re-export.

---

## Test Plan

| Test Name | Type | Description |
|-----------|------|-------------|
| `test_all_reexports_accessible` | unit | Import every listed symbol from `dig_blockstore` and assert compilation succeeds |
| `test_cf_constants_values` | unit | Assert each CF_* constant has the expected string value |
| `test_meta_constants_values` | unit | Assert each META_* constant has the expected string value |

---

## Expected Test Files

- `tests/str_003_tests.rs`
