Skip to content

Commit aceb716

Browse files
Harden Ulysses runtime and Colibri contracts
1 parent b5aad1d commit aceb716

40 files changed

Lines changed: 2670 additions & 148 deletions

‎components/sandwich/patches/hermes-sandwich.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ index d00491f6e..83269f74a 100644
498498
- * used whenever the agent makes a browser call without a cloud provider
499499
- * configured, so it must already be installed before any session starts.
500500
- * Its postinstall is also small.
501-
+ * - ``agent-browser`` is NOT eager in the Bun-sovereign deployment profile.
501+
+ * - ``agent-browser`` is NOT eager in the Bun-only deployment profile.
502502
+ * Browser calls are routed to the separately managed Camofox MCP/server, so
503503
+ * installing another browser backend during every Hermes update is both
504504
+ * redundant and an unwanted lifecycle-script surface.

‎config/ulysses/colibri-providers.json‎

Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,70 @@
1010
"source_env": "ULYSSES_COLIBRI_GLM_ROOT",
1111
"source_default": "Odysseus/colibri",
1212
"model_env": "ULYSSES_COLIBRI_GLM_MODEL",
13-
"model_default": "colibri-models/mateogrgic--GLM-5.2-colibri-int4-with-int8-mtp",
13+
"model_default": "colibri-models/mastouri--GLM-5.2-colibri-int4-g64-with-int8-mtp",
1414
"port_env": "ULYSSES_COLIBRI_GLM_PORT",
1515
"default_port": 8642,
1616
"model_id": "glm-5.2-colibri",
17-
"weight_repo": "mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp",
17+
"weight_repo": "mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp",
18+
"model_variants": [
19+
{
20+
"id": "gs64-int8-mtp",
21+
"label": "GLM-5.2 gs64 + int8 MTP",
22+
"repository": "mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp",
23+
"revision": "5276684ba30ac0026c07220d3f389171a84eb074",
24+
"directory": "mastouri--GLM-5.2-colibri-int4-g64-with-int8-mtp",
25+
"recommended": true,
26+
"model_type": "glm_moe_dsa",
27+
"main_shards": 141,
28+
"mtp_shards": 1,
29+
"weight_bytes": 429255863080,
30+
"required_files": [
31+
"config.json",
32+
"generation_config.json",
33+
"tokenizer.json",
34+
"tokenizer_config.json"
35+
],
36+
"quality_note": "Current upstream-recommended group-size-64 container; preserves substantially more quality than legacy per-row int4."
37+
},
38+
{
39+
"id": "legacy-per-row-int8-mtp",
40+
"label": "GLM-5.2 legacy per-row + int8 MTP",
41+
"repository": "mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp",
42+
"revision": "3cc8db99b1b13fc79325d987ba3c1c430766b3b8",
43+
"directory": "mateogrgic--GLM-5.2-colibri-int4-with-int8-mtp",
44+
"recommended": false,
45+
"model_type": "glm_moe_dsa",
46+
"main_shards": 141,
47+
"mtp_shards": 3,
48+
"weight_bytes": 383739826712,
49+
"required_files": [
50+
"config.json",
51+
"generation_config.json",
52+
"tokenizer.json",
53+
"tokenizer_config.json"
54+
],
55+
"quality_note": "Legacy issue-#273 reference container. Upstream reports roughly nine percentage points lower quality and think-mode looping; accepted for reproducibility but not recommended."
56+
}
57+
],
1858
"minimum_commit": "5f167e5964f40a3a62d4cadb911543ce0f15b49b",
1959
"minimum_commit_reason": "Merged PR #274: single-GPU decode pipeline and expert-cache reserve fix",
2060
"cli_path": "c/coli",
2161
"engine_path": "c/colibri",
2262
"setup_path": "c/setup.sh",
2363
"build_cwd": "c",
24-
"build_argv": ["make", "CUDA=1", "CUDA_ARCH=native"],
64+
"build_argv": ["make", "colibri", "CUDA=1", "CUDA_ARCH=native"],
65+
"validation_steps": [
66+
{
67+
"label": "Run upstream Colibri tests",
68+
"argv": ["make", "test"],
69+
"timeout": 1800
70+
},
71+
{
72+
"label": "Validate Colibri CUDA kernels",
73+
"argv": ["make", "cuda-test", "CUDA=1", "CUDA_ARCH=native"],
74+
"timeout": 900
75+
}
76+
],
2577
"plan_args": ["plan", "--auto-tier", "--gpu", "0", "--json"],
2678
"doctor_args": ["doctor", "--auto-tier", "--gpu", "0", "--json"],
2779
"serve_args": [
@@ -97,13 +149,52 @@
97149
"default_port": 8643,
98150
"model_id": "hy3-colibri",
99151
"weight_repo": "UnderstandLing/Hy3-colibri-int4",
152+
"model_variants": [
153+
{
154+
"id": "int4-int8-mtp",
155+
"label": "Hy3 int4 + int8 MTP",
156+
"repository": "UnderstandLing/Hy3-colibri-int4",
157+
"revision": "2aed3aedf043f81d8c03c0e98c27d1e61b29981d",
158+
"directory": "UnderstandLing--Hy3-colibri-int4",
159+
"recommended": true,
160+
"model_type": "hy_v3",
161+
"main_shards": 101,
162+
"mtp_shards": 6,
163+
"weight_bytes": 152446149696,
164+
"required_files": [
165+
"config.json",
166+
"generation_config.json",
167+
"tokenizer.json",
168+
"tokenizer_config.json"
169+
],
170+
"quality_note": "The sole pre-converted container supported by the official Colibri-Hy3 fork."
171+
}
172+
],
100173
"minimum_commit": "08f8439ebfe1994b607aed6adf857c80e8894c4c",
101174
"minimum_commit_reason": "Official main revision inspected for the native Hy3 provider contract",
102175
"cli_path": "c/coli",
103176
"engine_path": "c/hy3",
104177
"setup_path": "c/setup.sh",
105178
"build_cwd": "c",
106179
"build_argv": ["make", "hy3", "CUDA=1", "IOURING=1"],
180+
"validation_steps": [
181+
{
182+
"label": "Run upstream Colibri-Hy3 tests",
183+
"argv": ["make", "test"],
184+
"timeout": 1800
185+
},
186+
{
187+
"label": "Validate Colibri-Hy3 CUDA kernels",
188+
"argv": ["make", "cuda-test", "CUDA=1", "CUDA_ARCH=native"],
189+
"timeout": 900
190+
},
191+
{
192+
"label": "Validate the Hy3 teacher-forcing oracle",
193+
"argv": ["env", "SNAP=./hy3_tiny", "TF=1", "./hy3", "64", "16", "16"],
194+
"timeout": 300,
195+
"expected_output_contains": "32/32 positions"
196+
}
197+
],
107198
"plan_args": [
108199
"plan",
109200
"--ram",
@@ -135,7 +226,7 @@
135226
"--host",
136227
"127.0.0.1"
137228
],
138-
"supports_tools": null,
229+
"supports_tools": true,
139230
"model_type": "llm",
140231
"default_profile": "rtx5090-high-ram",
141232
"profiles": {
@@ -147,6 +238,7 @@
147238
"ctx": "4096",
148239
"gpu": "0",
149240
"vram": "0",
241+
"verbose": true,
150242
"policy": "balanced",
151243
"env": {
152244
"COLI_CUDA": "1",

‎config/ulysses/runtime-catalog.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"label": "Firecrawl CLI",
112112
"adapter": "native",
113113
"ownership": "external",
114-
"source_root": "${ULYSSES_MICROSERVICES_ROOT}/firecrawl",
114+
"source_root": "${ULYSSES_MICROSERVICES_ROOT}/firecrawl/cli",
115115
"dependencies": ["firecrawl.api", "sandwich.runtime"],
116116
"capabilities": ["web-scrape", "cli"]
117117
}

‎config/ulysses/runtime-management.json‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"compose": "docker-compose.yaml",
1313
"env_files": [".env"],
1414
"git_update": true,
15+
"source_url": "https://github.com/firecrawl/firecrawl",
16+
"source_branch": "main",
1517
"build_on_update": true,
1618
"ports": [3002]
1719
},
@@ -41,18 +43,6 @@
4143
"update_blocked_reason": "Chroma image updates are disabled until the active /data store has a verified durable snapshot and mount.",
4244
"ports": [8100]
4345
},
44-
{
45-
"id": "camofox.mcp.compose",
46-
"label": "Camofox MCP container",
47-
"category": "docker",
48-
"root": "${ULYSSES_MICROSERVICES_ROOT}/camofox-mcp",
49-
"compose": "docker-compose.yml",
50-
"env_files": [],
51-
"git_update": true,
52-
"build_on_update": false,
53-
"ports": [9377],
54-
"optional": true
55-
},
5646
{
5747
"id": "camofox.browser",
5848
"label": "Camofox browser",
@@ -65,6 +55,8 @@
6555
"launch": ["bun", "start"],
6656
"tmux_session": "ulysses-camofox-browser",
6757
"git_update": true,
58+
"source_url": "https://github.com/jo-inc/camofox-browser",
59+
"source_branch": "master",
6860
"build_script": "build",
6961
"ports": [9377]
7062
},
@@ -96,6 +88,8 @@
9688
"package_json": "package.json",
9789
"env_files": [],
9890
"git_update": true,
91+
"source_url": "https://github.com/CommanderTurtle/context-mode.git",
92+
"source_branch": "main",
9993
"build_script": "build",
10094
"hermes_mcp": true,
10195
"ports": []
@@ -111,6 +105,8 @@
111105
"package_json": "package.json",
112106
"env_files": [],
113107
"git_update": true,
108+
"source_url": "https://github.com/redf0x1/camofox-mcp.git",
109+
"source_branch": "main",
114110
"build_script": "build",
115111
"hermes_mcp": true,
116112
"ports": []
@@ -126,6 +122,8 @@
126122
"package_json": "package.json",
127123
"env_files": [],
128124
"git_update": true,
125+
"source_url": "https://github.com/firecrawl/cli",
126+
"source_branch": "main",
129127
"build_script": "build",
130128
"ports": []
131129
},

‎docs/SANDWICH_BUN_COMPATIBILITY.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Captured on 2026-07-25 without installing Node.
77
- Installed Bun: `1.3.14` (`0d9b296a`)
88
- Sandwich component: `0.2.0`
99
- Sandwich compatibility suite: 36 passed
10-
- Ulysses runtime-management and identity contract suite: 103 passed
10+
- Ulysses runtime-management, identity, and audit contract suites: passing
1111
- Detected installation: `/home/alienl/Hermes/sandwich`
12-
- Latest full isolated Ulysses run under the installed Bun: 4,866 passed,
12+
- Latest full isolated Ulysses run under the installed Bun: 4,890 passed,
1313
3 skipped, 0 failed.
1414

1515
Sandwich now handles:
@@ -27,6 +27,24 @@ The component is now bundled at `components/sandwich` with a validated
2727
commands to absolute component paths and supplies a sanitized Bun-only
2828
environment without inheriting Ulysses's Python virtual environment.
2929

30+
Readiness is intentionally strict: `sandwich`, `node`, `npm`, `npx`, `pnpm`,
31+
and `yarn` must all resolve from the same Sandwich `bin` directory. A system
32+
Node mixed into `PATH` cannot make an incomplete installation appear ready.
33+
The live installation currently satisfies that contract and is byte-identical
34+
to the bundled core component.
35+
36+
Cookbook Dependencies lists Sandwich under Extras. If it is absent, Ulysses
37+
can stage the exact bundled component at
38+
`${ULYSSES_MICROSERVICES_ROOT}/sandwich` after confirmation. If anything
39+
divergent already occupies that path, installation refuses to overwrite it.
40+
An installed exact component exposes its confirmation-gated doctor instead.
41+
Standalone update, rollback, and uninstall remain later lifecycle work.
42+
43+
JavaScript and native tmux services are launched with explicit argv and a
44+
sanitized environment that removes `VIRTUAL_ENV`, `PYTHONHOME`, and
45+
`PYTHONPATH`. This prevents an Odysseus/Ulysses Python environment from leaking
46+
into Bun, MCP, browser, proxy, or native service processes.
47+
3048
## Hermes profile
3149

3250
The tested Hermes updater repair is preserved as a version-pinned Sandwich

‎docs/ULYSSES_CONTROL_PLANE_DESIGN.md‎

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Scope
44

5-
Ulysses adds one service-management surface to the existing Odysseus UI. It is
6-
Arcane-inspired in workflow, but manages more than Docker:
5+
Ulysses adds one service-management surface in the existing Odysseus UI and
6+
manages more than Docker:
77

88
- Docker Compose projects and containers;
99
- native and tmux-hosted processes;
1010
- systemd user services;
1111
- Bun/Sandwich tools and MCP servers;
1212
- Python/uv environments;
13-
- model endpoints such as vLLM and, later, Colibri;
13+
- model endpoints such as vLLM, Colibri GLM, and Colibri Hy3;
1414
- Chroma and other persistent services.
1515

1616
It is intentionally not a scheduler, Kubernetes replacement, or arbitrary
@@ -96,11 +96,15 @@ starts with a sanitized environment, then applies its declared configuration:
9696

9797
## Configuration
9898

99-
The UI can centralize configuration without immediately moving values:
99+
The UI edits each project's own registered configuration file without
100+
centralizing unrelated values:
100101

101102
- existing `.env` files remain authoritative during observation;
102-
- imports show a redacted source-to-target diff;
103-
- secrets are encrypted/referenced and never returned to normal API/UI reads;
103+
- normal reads redact sensitive values and disable Save while placeholders are
104+
present;
105+
- an explicit **Unredact & edit** action fetches the real registered document
106+
for an authorized local administrator;
107+
- the backend refuses to persist literal `<redacted>` placeholders;
104108
- one typed configuration set can materialize to Compose, systemd, native,
105109
tmux, or MCP launch adapters;
106110
- all writes are previewable, backed up, atomic, and reversible.
@@ -117,8 +121,10 @@ Add a Services window/tool using the current Odysseus visual language:
117121
- Activity: durable queued/running/completed/failed actions with cancellation.
118122
- Recovery: backups, Chroma persistence, Python/CUDA doctor, rollback.
119123

120-
Cookbook Dependencies remains the Python/system package catalog. Its
121-
JavaScript-related links deep-link into the Sandwich view.
124+
Cookbook Dependencies keeps its Python/system package catalog and adds an
125+
Extras group for separately installed Sandwich, Hermes, Colibri GLM, and
126+
Colibri Hy3 runtimes. Sandwich detection/install/doctor is available there;
127+
service and package operations live in the Services JavaScript view.
122128

123129
The existing Cookbook Active view is the implementation precedent: it already
124130
tracks the vLLM task, readiness, PID, and tmux output. Ulysses generalizes that
@@ -139,13 +145,12 @@ The overview does not concatenate every terminal into one unreadable stream.
139145
It shows compact status/port/resource cards; selecting a service opens its own
140146
bounded logs and, where registered, its tmux console.
141147

142-
The first implemented UI slice is read-only and uses the existing Odysseus
143-
window manager, icon rail, sidebar, theme variables, resizing, docking, and
144-
minimize behavior. Its Overview, Services, JavaScript, and Chroma views consume
145-
only `GET /api/ulysses/topology` and
146-
`GET /api/ulysses/chroma/persistence`. No lifecycle button is rendered until
147-
the corresponding runtime has an adoption record, typed action plan, durable
148-
job runner, and rollback contract.
148+
The Services UI uses the existing Odysseus window manager, icon rail, sidebar,
149+
theme variables, resizing, docking, and minimize behavior. Overview, Services,
150+
JavaScript, Chroma, Activity, and Recovery combine read-only observations with
151+
allowlisted lifecycle plans. A lifecycle button is enabled only when the
152+
runtime has an adoption record, typed action plan, durable job runner, and the
153+
required safety contract.
149154

150155
## Browser and search capabilities
151156

@@ -182,8 +187,21 @@ job runner, and rollback contract.
182187
| SearXNG | Docker Compose | external |
183188
| Bifrost | Sandwich/native | external |
184189
| signal-cli | native service | external |
185-
| Sandwich | native user runtime | observed, then managed |
186-
| Colibri | native CUDA model endpoint | not installed; final integration |
190+
| Sandwich | native user runtime | managed exact component |
191+
| Colibri GLM | native CUDA model endpoint | source present; build/model verification gated |
192+
| Colibri Hy3 | separate native CUDA endpoint | source present; build/model verification gated |
193+
194+
## Runtime update invariants
195+
196+
- Git-backed runtimes have a registered official origin and branch.
197+
- Dirty worktrees, origin/branch mismatches, and non-fast-forward updates fail
198+
closed.
199+
- JavaScript/native source sync is refused while the runtime is active.
200+
- Docker updates preserve the prior stopped/running state.
201+
- Dependencies start first and prevent unsafe dependent/dependency stops.
202+
- Firecrawl depends on SearXNG; Camofox MCP depends on Camofox.
203+
- All job directories are private (`0700`) and job records/logs are `0600`.
204+
- Job success may require a declared output oracle, not merely exit code zero.
187205

188206
## Chroma persistence gate
189207

‎docs/ULYSSES_GOLDEN_RUNTIME_PROFILE.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,28 @@ A candidate environment cannot replace or retarget production unless it:
7777

7878
“Newer” vLLM, Torch, Transformers, Triton, CUDA, or cuDNN versions do not waive
7979
these gates.
80+
81+
## ONNX Runtime CUDA loader finding
82+
83+
The production ONNX Runtime CUDA provider is not missing cuDNN. Its requested
84+
`libcudnn.so.9` is present inside the production environment under the NVIDIA
85+
wheel library tree. With that environment's
86+
`site-packages/nvidia/*/lib` directories prepended to a new child process's
87+
`LD_LIBRARY_PATH`, `ldd` resolves every provider dependency.
88+
89+
This is a process-start linker-path problem. It does not justify creating
90+
versionless or cross-version `.so` symlinks, changing `/usr/lib`, modifying a
91+
login shell, or normalizing the production environment.
92+
93+
Ulysses provides `scripts/with-wsl-cuda-libs.sh` as the scoped candidate
94+
launcher. It:
95+
96+
1. resolves `ULYSSES_VENV` when explicitly supplied, otherwise the candidate's
97+
own `.venv` (an inherited `VIRTUAL_ENV` is deliberately ignored);
98+
2. discovers its NVIDIA wheel library directories;
99+
3. adds the host CUDA and WSL driver library roots when present;
100+
4. validates the ONNX CUDA provider with `ldd`;
101+
5. executes the requested command, defaulting to the candidate Uvicorn server.
102+
103+
The launcher has been syntax- and contract-tested only. An actual CUDA provider
104+
session remains a post-download, GPU-release validation gate.

0 commit comments

Comments
 (0)