Skip to content

Commit 8201314

Browse files
committed
Add symbiont golden-image crate (portable git-deps + Dockerfile)
THE one and only way the full Ada stack compiles+links as one binary: lance-graph + lance =7.0.0 + lancedb =0.30.0 + ndarray fork + ractor fork + surrealdb (kv-lance) + OGAR. Portable build for any session + Railway/CI: - Same-repo crates (lance-graph, perturbation-sim) -> path deps. - External AdaWorldAPI forks (ractor, surrealdb-core, ogar-*) -> git deps pinned to claude/jirak-math-theorems-harvest-rfii13. No machine-specific paths; resolves anywhere with fork access. - A surrealdb [patch] unifies OGAR's surrealdb dep onto the same branch. - ndarray enters via lance-graph's existing sibling path dep; the Dockerfile clones the ndarray fork next to the repo so that path resolves. Dockerfile is a multi-stage build (rust:1.95 -> debian-slim) whose purpose is to PROVE the unified graph compiles+links (build/CI validation); the binary prints the linked-stack line and exits. Excluded from the workspace (own [workspace] table) so the default lance-graph build never pulls surrealdb-core/OGAR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
1 parent 5d1c6b9 commit 8201314

5 files changed

Lines changed: 178 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ exclude = [
7373
# nibble-LUT ADC + ndarray::simd::matmul_i8_to_i32 polyfill GEMM) compiled.
7474
# Verify via `cargo test --manifest-path crates/lance-graph-turbovec/Cargo.toml`.
7575
"crates/lance-graph-turbovec",
76+
# Golden-image probe — the full Ada stack (lance-graph + lance7/lancedb0.30
77+
# + ndarray fork + ractor fork + surrealdb kv-lance + OGAR) in ONE binary.
78+
# Portable git-deps build (own [workspace] + a surrealdb [patch]) for any
79+
# session + Railway/CI. MUST stay excluded (keeps surrealdb-core/OGAR out of
80+
# the default build). Verify via `cargo build --manifest-path crates/symbiont/Cargo.toml`
81+
# or `docker build -f crates/symbiont/Dockerfile -t symbiont .`.
82+
"crates/symbiont",
7683
]
7784
resolver = "2"
7885

crates/symbiont/Cargo.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Portable golden-image probe — EXCLUDED from the lance-graph workspace.
2+
#
3+
# THE one and only way the full Ada stack is meant to compile+link as one
4+
# binary: lance-graph + lance =7.0.0 + lancedb =0.30.0 + ndarray fork +
5+
# ractor fork + surrealdb (kv-lance only) + OGAR.
6+
#
7+
# This manifest is SELF-CONTAINED via git deps to the AdaWorldAPI forks (pinned
8+
# to the `claude/jirak-math-theorems-harvest-rfii13` branch) so it resolves in
9+
# any session and on Railway/CI — no machine-specific paths. The two same-repo
10+
# crates (lance-graph, perturbation-sim) stay path deps.
11+
#
12+
# Build locally: cargo build --manifest-path crates/symbiont/Cargo.toml
13+
# Build container: docker build -f crates/symbiont/Dockerfile -t symbiont .
14+
# (from the lance-graph repo root — see Dockerfile + README)
15+
#
16+
# NOTE: lance-graph's own Cargo.toml path-deps the ndarray fork as a SIBLING
17+
# (`../../../ndarray`), so a from-scratch build needs the ndarray fork checked
18+
# out next to lance-graph. In a session it already is; the Dockerfile clones it.
19+
20+
[package]
21+
name = "symbiont"
22+
version = "0.0.0"
23+
edition = "2021"
24+
publish = false
25+
description = "Golden-image probe: the full Ada stack (lance-graph + lance7/lancedb0.30 + ndarray + ractor + surrealdb kv-lance + OGAR) compiled into ONE binary. Portable git-deps build for any session + Railway/CI."
26+
27+
# Own workspace root — keeps this crate out of the parent lance-graph workspace
28+
# AND makes the [patch] below take effect.
29+
[workspace]
30+
31+
[[bin]]
32+
name = "symbiont"
33+
path = "src/main.rs"
34+
35+
[dependencies]
36+
# ── same-repo crates: path deps ──
37+
lance-graph = { path = "../lance-graph" }
38+
perturbation-sim = { path = "../perturbation-sim" }
39+
40+
# ── external AdaWorldAPI forks: git deps, pinned to the shared dev branch ──
41+
ractor = { git = "https://github.com/AdaWorldAPI/ractor", branch = "claude/jirak-math-theorems-harvest-rfii13" }
42+
surrealdb-core = { git = "https://github.com/AdaWorldAPI/surrealdb", branch = "claude/jirak-math-theorems-harvest-rfii13", default-features = false, features = ["kv-lance"] }
43+
ogar-vocab = { git = "https://github.com/AdaWorldAPI/OGAR", branch = "claude/jirak-math-theorems-harvest-rfii13" }
44+
ogar-ontology = { git = "https://github.com/AdaWorldAPI/OGAR", branch = "claude/jirak-math-theorems-harvest-rfii13" }
45+
ogar-adapter-surrealql = { git = "https://github.com/AdaWorldAPI/OGAR", branch = "claude/jirak-math-theorems-harvest-rfii13", features = ["surrealdb-parser"] }
46+
47+
# OGAR git-deps surrealdb on its own branch (`main`); redirect ALL surrealdb
48+
# deps in the graph to the same branch we use, so it resolves to ONE surrealdb.
49+
[patch."https://github.com/AdaWorldAPI/surrealdb"]
50+
surrealdb-ast = { git = "https://github.com/AdaWorldAPI/surrealdb", branch = "claude/jirak-math-theorems-harvest-rfii13" }
51+
surrealdb-parser = { git = "https://github.com/AdaWorldAPI/surrealdb", branch = "claude/jirak-math-theorems-harvest-rfii13" }
52+
surrealdb-core = { git = "https://github.com/AdaWorldAPI/surrealdb", branch = "claude/jirak-math-theorems-harvest-rfii13" }

crates/symbiont/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# syntax=docker/dockerfile:1
2+
#
3+
# Golden-image build validation for the Ada stack.
4+
# Compiles the `symbiont` crate — lance-graph + lance =7.0.0 + lancedb =0.30.0
5+
# + ndarray fork + ractor fork + surrealdb (kv-lance) + OGAR — into ONE binary.
6+
# Purpose: PROVE the unified graph compiles+links in a clean container
7+
# (Railway/CI build validation). The binary itself just prints the linked-stack
8+
# line and exits.
9+
#
10+
# Build context = the lance-graph repo ROOT:
11+
# docker build -f crates/symbiont/Dockerfile -t symbiont .
12+
#
13+
# On Railway: set the service's Dockerfile path to `crates/symbiont/Dockerfile`
14+
# and the root directory to the repo root.
15+
#
16+
# AUTH: the AdaWorldAPI forks must be reachable during the build. If they are
17+
# private, provide a token — e.g. mount a git credential or pass a build secret
18+
# and configure `git config --global url."https://x-access-token:$TOKEN@github.com/".insteadOf "https://github.com/"`.
19+
20+
ARG ADA_BRANCH=claude/jirak-math-theorems-harvest-rfii13
21+
22+
# ── builder ──────────────────────────────────────────────────────────────────
23+
FROM rust:1.95-bookworm AS builder
24+
ARG ADA_BRANCH
25+
# Native build deps for the closure: aws-lc-sys (C++), zstd/lz4 (C), protoc.
26+
RUN apt-get update && apt-get install -y --no-install-recommends \
27+
cmake clang protobuf-compiler pkg-config libssl-dev git ca-certificates \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
WORKDIR /build
31+
# The lance-graph repo (this build context). symbiont path-deps lance-graph +
32+
# perturbation-sim from inside it.
33+
COPY . /build/lance-graph
34+
35+
# lance-graph's own Cargo.toml path-deps the ndarray fork as a SIBLING
36+
# (`../../../ndarray`). Clone it next to the repo so that path resolves.
37+
RUN git clone --depth 1 --branch "$ADA_BRANCH" \
38+
https://github.com/AdaWorldAPI/ndarray.git /build/ndarray
39+
40+
WORKDIR /build/lance-graph/crates/symbiont
41+
RUN cargo build --release
42+
43+
# ── runtime ──────────────────────────────────────────────────────────────────
44+
FROM debian:bookworm-slim
45+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
46+
&& rm -rf /var/lib/apt/lists/*
47+
COPY --from=builder /build/lance-graph/crates/symbiont/target/release/symbiont /usr/local/bin/symbiont
48+
ENTRYPOINT ["symbiont"]

crates/symbiont/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# symbiont — the golden image
2+
3+
> **THE one and only way the full Ada stack is meant to compile+link as one
4+
> binary:** lance-graph + lance `=7.0.0` + lancedb `=0.30.0` + the ndarray
5+
> fork + the ractor fork + surrealdb (kv-lance only) + OGAR.
6+
7+
A successful build IS the golden image — the known-good foundation for the
8+
kanban thinking, whose first test workload is the perturbation simulation
9+
(`perturbation-sim`). The binary itself just prints the linked-stack line and
10+
exits; the point is that the unified dependency graph **compiles and links**.
11+
12+
It is `exclude`d from the lance-graph workspace (own `[workspace]` table) so
13+
the default lance-graph build/CI never pulls surrealdb-core + OGAR.
14+
15+
## Build
16+
17+
```bash
18+
# Local (any session): git-deps resolve from the AdaWorldAPI forks
19+
cargo build --manifest-path crates/symbiont/Cargo.toml
20+
21+
# Container (build/CI validation) — from the lance-graph repo ROOT:
22+
docker build -f crates/symbiont/Dockerfile -t symbiont .
23+
docker run --rm symbiont
24+
```
25+
26+
## How it stays portable
27+
28+
- **Same-repo crates** (`lance-graph`, `perturbation-sim`) → path deps.
29+
- **External forks** (`ractor`, `surrealdb-core`, `ogar-*`) → **git deps**
30+
pinned to `claude/jirak-math-theorems-harvest-rfii13`. No machine-specific
31+
paths, so it resolves in any session and on Railway/CI.
32+
- **One wrinkle:** lance-graph's own `Cargo.toml` path-deps the ndarray fork as
33+
a sibling (`../../../ndarray`). In a session it's already there; the
34+
Dockerfile clones it next to the repo. (That's why ndarray isn't a git dep in
35+
this manifest — it enters via lance-graph's existing path dep.)
36+
37+
## Railway (build validation)
38+
39+
1. Point the service at this repo, root directory = repo root.
40+
2. Set the Dockerfile path to `crates/symbiont/Dockerfile`.
41+
3. The build proves the stack links; a green build is the deliverable.
42+
43+
**Auth:** the build fetches the AdaWorldAPI forks. If they're private, provide
44+
a token to the build (e.g. `git config --global
45+
url."https://x-access-token:$TOKEN@github.com/".insteadOf
46+
"https://github.com/"` via a Railway build secret).
47+
48+
## Notes
49+
50+
- ndarray is linked twice (lance-graph's path fork + surrealdb-core's git-rev
51+
fork) plus the real crates.io `ndarray 0.16.1` that lance-index needs. This
52+
is accepted as cosmetic — no ndarray type crosses the surrealdb↔lance-graph
53+
seam, so the duplication never manifests at a call boundary.
54+
- The local-path variant of this crate (absolute `/home/user/...` paths) lives
55+
on `claude/perturbation-sim-nan-hardening`; this main version is the portable
56+
git-deps build.

crates/symbiont/src/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! Golden-image probe binary.
2+
//!
3+
//! Declaring each repo as a dependency forces the entire unified dependency
4+
//! graph to compile and link into one binary. That successful build IS the
5+
//! golden image — the known-good foundation for the kanban thinking, whose
6+
//! first test workload is the perturbation simulation (`perturbation_sim`).
7+
//!
8+
//! Build: cargo build --manifest-path crates/symbiont/Cargo.toml
9+
//! Or: docker build -f crates/symbiont/Dockerfile -t symbiont .
10+
11+
fn main() {
12+
println!(
13+
"symbiont golden image: lance-graph + lance7/lancedb0.30 + ndarray + ractor + surrealdb(kv-lance) + OGAR linked"
14+
);
15+
}

0 commit comments

Comments
 (0)