Skip to content

Commit 22886ec

Browse files
feat: safeguard Chroma persistence
1 parent 16e4e71 commit 22886ec

9 files changed

Lines changed: 759 additions & 13 deletions

‎docker-compose.gpu-amd.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,15 @@ services:
101101
- ${RENDER_GID:-render}
102102

103103
chromadb:
104-
image: docker.io/chromadb/chroma:latest
104+
# Keep the candidate on the exact image already verified on this host.
105+
# Update the digest only through a reviewed maintenance plan.
106+
image: docker.io/chromadb/chroma@sha256:1e0b73a187a28757c572acba508c46f48c9e8b0acaf5c20e6d95cdedce1acdf6
105107
ports:
106108
- "${CHROMADB_BIND:-127.0.0.1}:8100:8000"
107109
volumes:
108-
- chromadb-data:/chroma/chroma
110+
# Current Chroma images declare persist_path: /data in /config.yaml.
111+
# The former /chroma/chroma target left the live database ephemeral.
112+
- chromadb-data:/data
109113
environment:
110114
- ANONYMIZED_TELEMETRY=FALSE
111115
restart: unless-stopped

‎docker-compose.gpu-nvidia.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,15 @@ services:
104104
capabilities: [gpu]
105105

106106
chromadb:
107-
image: docker.io/chromadb/chroma:latest
107+
# Keep the candidate on the exact image already verified on this host.
108+
# Update the digest only through a reviewed maintenance plan.
109+
image: docker.io/chromadb/chroma@sha256:1e0b73a187a28757c572acba508c46f48c9e8b0acaf5c20e6d95cdedce1acdf6
108110
ports:
109111
- "${CHROMADB_BIND:-127.0.0.1}:8100:8000"
110112
volumes:
111-
- chromadb-data:/chroma/chroma
113+
# Current Chroma images declare persist_path: /data in /config.yaml.
114+
# The former /chroma/chroma target left the live database ephemeral.
115+
- chromadb-data:/data
112116
environment:
113117
- ANONYMIZED_TELEMETRY=FALSE
114118
restart: unless-stopped

‎docker-compose.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ services:
8282
restart: unless-stopped
8383

8484
chromadb:
85-
image: docker.io/chromadb/chroma:latest
85+
# Keep the candidate on the exact image already verified on this host.
86+
# Update the digest only through a reviewed maintenance plan.
87+
image: docker.io/chromadb/chroma@sha256:1e0b73a187a28757c572acba508c46f48c9e8b0acaf5c20e6d95cdedce1acdf6
8688
ports:
8789
- "${CHROMADB_BIND:-127.0.0.1}:8100:8000"
8890
volumes:
89-
- chromadb-data:/chroma/chroma
91+
# Current Chroma images declare persist_path: /data in /config.yaml.
92+
# The former /chroma/chroma target left the live database ephemeral.
93+
- chromadb-data:/data
9094
environment:
9195
- ANONYMIZED_TELEMETRY=FALSE
9296
restart: unless-stopped

‎docs/ULYSSES_CONTROL_PLANE_DESIGN.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Every runtime definition therefore carries a scope: `host`,
3434
use a narrow Chroma storage/retrieval contract, but that does not connect the
3535
Odysseus and Hermes agent loops.
3636

37+
The bridge is owned by the Hermes integration: it may archive explicitly
38+
approved context-mode compactions into dedicated Chroma collections and expose
39+
provenance-preserving retrieval to Hermes. It does not register the bridge in
40+
Odysseus's MCP registry, copy Odysseus-agent MCP settings, or grant either agent
41+
implicit access to the other's tools.
42+
3743
## The service contract
3844

3945
Every service definition records:
@@ -170,3 +176,27 @@ bounded logs and, where registered, its tmux console.
170176
| signal-cli | native service | external |
171177
| Sandwich | native user runtime | observed, then managed |
172178
| Colibri | native CUDA model endpoint | not installed; final integration |
179+
180+
## Chroma persistence gate
181+
182+
The current production image starts `chroma run /config.yaml`, and its image
183+
configuration declares `persist_path: /data`. Production Compose instead mounts
184+
the `odysseus_chromadb-data` volume at `/chroma/chroma`; the mounted directory is
185+
nearly empty while the active SQLite database and vector segments are under the
186+
container's unmounted `/data`.
187+
188+
Ulysses therefore:
189+
190+
- reports the live persistence state as degraded without changing it;
191+
- pins the candidate image to the observed production digest;
192+
- mounts the candidate volume at `/data`;
193+
- inventories collection IDs, names, counts, embedding dimensions, models,
194+
lanes, and fingerprints;
195+
- accepts only explicitly configured snapshot roots and treats discovered live
196+
copies as reference snapshots, never restore candidates;
197+
- provides a preview-only migration plan whose apply action remains disabled.
198+
199+
The migration requires a maintenance window, a fresh snapshot after the
200+
container stops, candidate restore and recreation validation, representative
201+
read-only retrievals, and retention of the original container definition,
202+
image, data, volume, and snapshots as rollback.

‎docs/ULYSSES_ROADMAP.md‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,16 @@ completion, reasoning content, stop, restart, and rollback all pass.
281281

282282
Persistence first:
283283

284-
- migrate the current incorrect volume target from `/chroma/chroma` to `/data`
285-
during maintenance;
284+
- [x] Diagnose the current incorrect volume target: the live image declares
285+
`persist_path: /data`, while production mounts its named volume at
286+
`/chroma/chroma`.
287+
- [x] Pin the candidate Compose image to the exact live digest and mount the
288+
candidate volume at `/data`; no Compose command has been run.
289+
- [x] Add an admin-only, read-only persistence report with container, image,
290+
mounts, health, collection counts/fingerprints, snapshots, findings, and a
291+
preview-only migration plan.
292+
- [ ] Migrate production from `/chroma/chroma` to `/data` only during an
293+
approved maintenance window;
286294
- restore the verified safety snapshot;
287295
- pin Chroma;
288296
- verify collection counts and representative queries;
@@ -500,10 +508,12 @@ corresponding rollback has been tested.
500508
1. [x] Add this roadmap and upstream provenance to the fresh repository.
501509
2. [x] Establish the isolated upstream test baseline.
502510
3. [x] Implement control-plane data contracts and a read-only registry.
503-
4. Add discovery-only adapters for Docker, systemd, processes/ports, Git,
504-
NVIDIA, and Chroma.
511+
4. [x] Add discovery-only adapters for Docker, systemd, processes/ports, and
512+
Chroma. Git and NVIDIA detail views remain scheduled for the Services UI.
505513
5. [x] Render the first read-only topology/status API.
506514
6. [x] Integrate Sandwich as the first optional runtime.
507515
7. Adopt and validate the existing microservices, persistence, configuration,
508-
Camofox browser capability, and lifecycle views.
516+
Camofox browser capability, and lifecycle views. Chroma production migration
517+
remains human-gated; its candidate definition and read-only readiness report
518+
are complete.
509519
8. Implement and verify Colibri as the final provider integration.

‎routes/ulysses_routes.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from core.middleware import require_admin
1111
from src.sandwich_runtime import observe_sandwich_installation
12+
from src.ulysses_chroma import collect_chroma_persistence
1213
from src.ulysses_catalog import default_runtime_registry
1314
from src.ulysses_discovery import HostDiscoverySnapshot, collect_host_discovery
1415
from src.ulysses_topology import build_topology_report
@@ -17,6 +18,7 @@
1718
def setup_ulysses_routes(
1819
*,
1920
collector: Callable[[], HostDiscoverySnapshot] = collect_host_discovery,
21+
chroma_collector: Callable[[], dict] = collect_chroma_persistence,
2022
) -> APIRouter:
2123
router = APIRouter(prefix="/api/ulysses", tags=["ulysses"])
2224

@@ -28,4 +30,9 @@ async def get_topology(request: Request) -> dict:
2830
sandwich = observe_sandwich_installation()
2931
return build_topology_report(registry, snapshot, sandwich)
3032

33+
@router.get("/chroma/persistence")
34+
async def get_chroma_persistence(request: Request) -> dict:
35+
require_admin(request)
36+
return await run_in_threadpool(chroma_collector)
37+
3138
return router

0 commit comments

Comments
 (0)