Skip to content

Commit 80d23e0

Browse files
Restore canonical Sandwich Hermes updates
1 parent 9838407 commit 80d23e0

2 files changed

Lines changed: 21 additions & 54 deletions

File tree

‎src/ulysses_sandwich_control.py‎

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
import os
66
from pathlib import Path
7-
import shutil
87
import sys
98
from typing import Any
109

11-
from src.ulysses_jobs import RuntimeJobError, RuntimeJobStore, native_host_environment
10+
from src.ulysses_jobs import RuntimeJobError, RuntimeJobStore
1211

1312

1413
class SandwichControl:
15-
ACTIONS = {"hermes-update", "system-update", "audit", "self-update"}
14+
ACTIONS = {"system-update", "audit", "self-update"}
1615

1716
def __init__(self, root: Path | None = None) -> None:
1817
from src.constants import DATA_DIR
@@ -48,14 +47,6 @@ def _sandwich_root(cls) -> Path:
4847
raise RuntimeJobError("ULYSSES_SANDWICH_ROOT must be absolute")
4948
return path.resolve()
5049

51-
@staticmethod
52-
def _binary(name: str, fallback: Path) -> str:
53-
found = shutil.which(name, path=native_host_environment()["PATH"])
54-
path = Path(found) if found else fallback
55-
if not path.is_file():
56-
raise RuntimeJobError(f"{name} is not installed on the host PATH")
57-
return str(path.absolute())
58-
5950
@staticmethod
6051
def _diogenes_source() -> Path:
6152
configured = os.environ.get("DIOGENES_SOURCE_ROOT", "").strip()
@@ -136,46 +127,6 @@ def create_plan(
136127
]
137128
summary = "Update detected Bun projects without pulling Git"
138129
phrase = "UPDATE JAVASCRIPT SYSTEM"
139-
elif action == "hermes-update":
140-
hermes = self._binary(
141-
"hermes",
142-
Path.home() / ".local" / "bin" / "hermes",
143-
)
144-
reconcile = sandwich / "scripts" / "reconcile-hermes-runtime.sh"
145-
if not reconcile.is_file():
146-
raise RuntimeJobError(
147-
f"Sandwich Hermes helper is missing: {reconcile}"
148-
)
149-
steps = [
150-
{
151-
"label": "Update Hermes canonically",
152-
"argv": [hermes, "update", "--no-backup", "--yes"],
153-
"cwd": str(Path.home() / ".hermes" / "hermes-agent"),
154-
"timeout": 3600,
155-
},
156-
{
157-
"label": "Reconcile frozen Hermes Bun workspaces",
158-
"argv": [str(reconcile)],
159-
"timeout": 1800,
160-
},
161-
{
162-
"label": "Restart Hermes gateway",
163-
"argv": [hermes, "gateway", "restart"],
164-
"timeout": 300,
165-
},
166-
{
167-
"label": "Check Hermes gateway",
168-
"argv": [hermes, "gateway", "status"],
169-
"timeout": 120,
170-
},
171-
{
172-
"label": "Run Hermes deep health check",
173-
"argv": [hermes, "status", "--deep"],
174-
"timeout": 300,
175-
},
176-
]
177-
summary = "Update, reconcile, and restart Hermes"
178-
phrase = "UPDATE HERMES"
179130
else:
180131
source = self._diogenes_source()
181132
steps = [

‎static/js/ulyssesServices.js‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,13 +618,21 @@ function renderSandwich() {
618618
const root = sandwichReport?.source_root || sandwichReport?.expected_root || '';
619619
return `
620620
<div class="dio-section-heading">
621-
<div><h3>Sandwich</h3><p>Bun compatibility and host maintenance.</p></div>
621+
<div><h3>Sandwich</h3><p>Bun compatibility for native project commands.</p></div>
622622
${statusBadge(ready ? 'ready' : 'not installed')}
623623
</div>
624624
${root ? `<code class="dio-root-line">${esc(root)}</code>` : ''}
625+
<details class="dio-dependency-files">
626+
<summary>Native commands</summary>
627+
<div class="dio-dependency-copy">
628+
<p><code>hermes update</code>Canonical Hermes update; Sandwich preserves its Bun integration internally.</p>
629+
<p><code>sandwich doctor</code>Verify Bun and every Node-compatible command shim.</p>
630+
<p><code>sandwich audit</code>Report foreign JavaScript runtimes without changing them.</p>
631+
</div>
632+
</details>
625633
<div class="dio-maintenance-grid">
626-
<button type="button" data-sandwich-action="hermes-update">
627-
<strong>Hermes update</strong><span>Back up, update, reconcile, restart, and health-check Hermes.</span>
634+
<button type="button" data-hermes-update>
635+
<strong>Hermes update</strong><span>Run the canonical Hermes update with Sandwich preflight and backup.</span>
628636
</button>
629637
<button type="button" data-sandwich-action="system-update">
630638
<strong>System update</strong><span>Audit and update detected Bun projects; pull no Git repositories.</span>
@@ -1004,6 +1012,14 @@ function handleServicesClick(event) {
10041012
}
10051013
const containerLog = event.target.closest('[data-docker-container-log]');
10061014
if (containerLog) return loadDockerContainerLog(containerLog.dataset.dockerContainerLog);
1015+
const hermesUpdate = event.target.closest('[data-hermes-update]');
1016+
if (hermesUpdate) {
1017+
return executePlan(
1018+
'/api/odysseus/hermes/jobs/plan',
1019+
{ action: 'update' },
1020+
{ danger: true },
1021+
);
1022+
}
10071023
const sandwichAction = event.target.closest('[data-sandwich-action]');
10081024
if (sandwichAction) return planSandwichAction(sandwichAction.dataset.sandwichAction);
10091025
const expandOwner = event.target.closest('[data-expand-owner]');

0 commit comments

Comments
 (0)