瀏覽代碼

docs: add packaging documentation to CLAUDE.md

fszontagh 3 月之前
父節點
當前提交
e2bec90e05
共有 1 個文件被更改,包括 49 次插入0 次删除
  1. 49 0
      CLAUDE.md

+ 49 - 0
CLAUDE.md

@@ -31,6 +31,55 @@ cmake --build build -j$(nproc) && ./build/tests/test_vector_storage
 - gRPC API with replication, events, file storage, migrations
 - **Vector Storage** — Embedding vectors stored alongside documents with SIMD-accelerated (AVX2/SSE4.1) cosine similarity search via `SimilaritySearch` RPC. Vectors use `_vector` document field, stored in parallel float arrays, persisted through WAL (`VEC_PUT`/`VEC_DELETE`) and snapshots (v3 format). Collection `vector_dimension` option is immutable after creation.
 
+## Packaging
+
+Canonical source for all smartbotic-database Debian packages.
+Replaces the old `shadowman-database` and `callerai-storage` packages.
+
+### Build modes
+
+```bash
+# Production (Docker, Debian 13)
+./packaging/build.sh                          # Build 4 .debs
+./packaging/build.sh --rebuild-base           # Rebuild Docker base image
+./packaging/build.sh --sync --suite trixie    # Build + publish to repository.smartbotics.ai
+
+# Local development (native, current system)
+./packaging/build.sh --local                  # Build 4 .debs
+./packaging/build.sh --local --install        # Build + install locally
+```
+
+### Packages
+
+| Package | Contents | Deployed where |
+|---------|----------|---------------|
+| `smartbotic-database` | Server binary + systemd + config | Production DB servers |
+| `libsmartbotic-db-client` | Shared `.so` (runtime) | All production machines |
+| `libsmartbotic-db-client-dev` | Headers + linker symlink + `.proto` + cmake config | Docker build images, dev workstations |
+| `smartbotic-db-cli` | CLI tool | Anywhere (optional) |
+
+### Local dev with installed packages
+
+After `./packaging/build.sh --local --install`, consumer projects can use:
+
+```cmake
+find_package(smartbotic-db-client REQUIRED)
+target_link_libraries(myapp PRIVATE smartbotic::db-client)
+```
+
+The submodule fallback still works for projects that haven't switched (`BUILD_SHARED_LIBS=OFF`).
+
+### Consumers
+
+| Project | Depends on | Min version | Migrations dir |
+|---------|-----------|-------------|----------------|
+| shadowman-cpp | `smartbotic-database (>= 1.2.0)` | 1.2.0 | `/opt/shadowman/share/shadowman/migrations/json` |
+| callerai | `smartbotic-database (>= 1.2.0)` | 1.2.0 | `/etc/callerai/migrations` |
+
+### Version policy
+
+Bump `VERSION` for API/protocol changes. Deb revision (`-N`) for packaging-only changes.
+
 ## Conventions
 
 - C++20