Skip to content

Commit dece4ce

Browse files
committed
test(engine): make dogfood portable — read ATLAS_ORACLE_CMD from env, drop hardcoded local paths
1 parent e5b0bf9 commit dece4ce

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

docs/dogfood/2026-06-16-oracle-slice1-dogfood.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ appends a tamper-evident ledger event.
3030
## ATLAS_ORACLE_CMD used
3131

3232
```
33-
ATLAS_ORACLE_CMD="/home/anombyte/Hermes/current-projects/.worktrees/atlas-coin-oracle/node_modules/.bin/tsx /home/anombyte/Hermes/current-projects/.worktrees/atlas-coin-oracle/apps/cli/src/index.ts"
33+
ATLAS_ORACLE_CMD="<spine>/node_modules/.bin/tsx <spine>/apps/cli/src/index.ts"
3434
```
35+
(`<spine>` = your local atlas-protocol checkout. The test reads `ATLAS_ORACLE_CMD` from the environment and skips when it is unset.)
3536

3637
`ship-check.py` shlex-splits `ATLAS_ORACLE_CMD` and appends
3738
`oracle grade --repo <root> --commit <HEAD> --card ... --held ... --evidence ... --ledger ...`.

tests/core/test_oracle_dogfood.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import hashlib
4343
import json
4444
import os
45+
import shlex
4546
import shutil
4647
import subprocess
4748
from pathlib import Path
@@ -52,12 +53,12 @@
5253
ENGINE_ROOT = Path(__file__).resolve().parents[2]
5354
SKEL_SHIP_CHECK = ENGINE_ROOT / "skel" / "ship-check.py"
5455

55-
# ── Spine (oracle CLI) paths ──────────────────────────────────────────────────
56-
SPINE_ROOT = Path("/home/anombyte/Hermes/current-projects/.worktrees/atlas-coin-oracle")
57-
TSX_BIN = SPINE_ROOT / "node_modules" / ".bin" / "tsx"
58-
CLI_SRC = SPINE_ROOT / "apps" / "cli" / "src" / "index.ts"
59-
# The oracle invocation prefix consumed by ship-check.py via ATLAS_ORACLE_CMD.
60-
CLI_CMD = f"{TSX_BIN} {CLI_SRC}"
56+
# ── Spine (oracle CLI) ────────────────────────────────────────────────────────
57+
# The oracle invocation prefix is supplied via the ATLAS_ORACLE_CMD env var so
58+
# this test stays portable (no hardcoded paths). Point it at your built atlas CLI,
59+
# e.g. ATLAS_ORACLE_CMD="<spine>/node_modules/.bin/tsx <spine>/apps/cli/src/index.ts"
60+
# ship-check.py shlex-splits it and appends `oracle grade ...`.
61+
CLI_CMD = os.environ.get("ATLAS_ORACLE_CMD", "")
6162

6263
ALPINE_REF = "docker.io/library/alpine:3.20"
6364

@@ -68,7 +69,7 @@ def has_podman() -> bool:
6869

6970

7071
def has_oracle_cli() -> bool:
71-
return TSX_BIN.exists() and CLI_SRC.exists()
72+
return bool(CLI_CMD.strip())
7273

7374

7475
def resolve_alpine_digest() -> str:
@@ -86,7 +87,7 @@ def resolve_alpine_digest() -> str:
8687
return digest
8788

8889

89-
SKIP_REASON = "requires podman + the built atlas oracle CLI (tsx) in the spine worktree"
90+
SKIP_REASON = "requires podman + ATLAS_ORACLE_CMD pointing at a built atlas oracle CLI"
9091
podman_and_cli = pytest.mark.skipif(
9192
not (has_podman() and has_oracle_cli()), reason=SKIP_REASON
9293
)
@@ -260,7 +261,7 @@ def test_ledger_integrity(tmp_path):
260261

261262
ledger_dir = root / ".atlas-ai" / "ledger"
262263
verify = subprocess.run(
263-
[str(TSX_BIN), str(CLI_SRC), "ledger", "verify", str(ledger_dir)],
264+
shlex.split(CLI_CMD) + ["ledger", "verify", str(ledger_dir)],
264265
capture_output=True, text=True,
265266
)
266267
if verify.returncode == 0 and verify.stdout.strip():

0 commit comments

Comments
 (0)