feat(core): consolidate config hub, unify daemon scheduling across all entrypoints, and fix step replay
- Unified configuration and paths under artemis.config as single source of truth - Consolidated execution across CLI, SDK, MCP, and Admin Console to default to Artemis Daemon - Fixed frontend step replay to preserve failure steps with proper sequential numbering - Implemented task deduplication, debouncing, and multi-device lock isolation - Added comprehensive end-to-end multi-port integration tests for live phone and emulator
This commit is contained in:
1 parent
e984d17635
commit
5f1ee18bc1
38 files changed
+1426
-203
No files matched your search
@@ -12,63 +12,32 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
import sys
|
||||
"""Admin Console configuration facade.
|
||||
|
||||
All configuration and path management is centralized in `artemis.config`.
|
||||
This module re-exports common constants for full backward compatibility.
|
||||
"""
|
||||
|
||||
# Automatically write ANTIGRAVITY_LS_ADDRESS to shared synchronization file on startup
|
||||
# to allow decoupled background processes to communicate with Jetski
|
||||
def init_ls_address():
|
||||
ls_addr = os.environ.get("ANTIGRAVITY_LS_ADDRESS")
|
||||
if ls_addr:
|
||||
try:
|
||||
from artemis.config import write_ls_address
|
||||
from artemis.config import (
|
||||
DB_PATH,
|
||||
IMAGES_DIR,
|
||||
PAUSE_FILE,
|
||||
REPLAY_BASE_DIR,
|
||||
TEST_DATA_DIR,
|
||||
TEST_OUTPUTS_DIR,
|
||||
TRACES_PATH,
|
||||
WORKSPACE_ROOT,
|
||||
init_ls_address,
|
||||
)
|
||||
|
||||
write_ls_address(ls_addr)
|
||||
except Exception as e:
|
||||
sys.stderr.write(f"Failed to write .jetski_ls_address on startup: {e}\n")
|
||||
|
||||
|
||||
# Compute real WORKSPACE_ROOT (find repo root containing pyproject.toml or artemis)
|
||||
_current_p = Path(__file__).resolve().parent
|
||||
while _current_p != _current_p.parent:
|
||||
if (_current_p / "pyproject.toml").exists() or (_current_p / "artemis").is_dir():
|
||||
WORKSPACE_ROOT = _current_p
|
||||
break
|
||||
_current_p = _current_p.parent
|
||||
else:
|
||||
WORKSPACE_ROOT = Path(__file__).resolve().parent.parent.parent.parent
|
||||
|
||||
_apps_dir = WORKSPACE_ROOT / "apps"
|
||||
_admin_console_dir = _apps_dir / "admin_console"
|
||||
_cloud_service_dir = _apps_dir / "cloud_service"
|
||||
|
||||
for _p in (str(WORKSPACE_ROOT), str(_apps_dir), str(_admin_console_dir), str(_cloud_service_dir)):
|
||||
if _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
# Try to import settings from artemis
|
||||
try:
|
||||
from artemis.config import settings
|
||||
|
||||
TRACES_PATH = Path(settings.TRACES_PATH)
|
||||
DB_PATH = Path(settings.DATA_ENGINE_DB_PATH)
|
||||
except ImportError:
|
||||
# Fallback to default path if run outside project environment or imports fail
|
||||
TRACES_PATH = WORKSPACE_ROOT / "traces"
|
||||
DB_PATH = TRACES_PATH / "data_engine.db"
|
||||
|
||||
# Step Replay Directories (Stored within traces/replay to avoid workspace clutter)
|
||||
REPLAY_BASE_DIR = TRACES_PATH / "replay"
|
||||
TEST_DATA_DIR = REPLAY_BASE_DIR / "data"
|
||||
TEST_OUTPUTS_DIR = REPLAY_BASE_DIR / "outputs"
|
||||
IMAGES_DIR = TRACES_PATH / "images"
|
||||
PAUSE_FILE = WORKSPACE_ROOT / ".artemis_paused"
|
||||
|
||||
# Ensure all essential runtime directories exist automatically
|
||||
for _d in (TRACES_PATH, REPLAY_BASE_DIR, TEST_DATA_DIR, TEST_OUTPUTS_DIR, IMAGES_DIR):
|
||||
try:
|
||||
_d.mkdir(parents=True, exist_ok=True)
|
||||
except Exception:
|
||||
pass
|
||||
__all__ = [
|
||||
"DB_PATH",
|
||||
"IMAGES_DIR",
|
||||
"PAUSE_FILE",
|
||||
"REPLAY_BASE_DIR",
|
||||
"TEST_DATA_DIR",
|
||||
"TEST_OUTPUTS_DIR",
|
||||
"TRACES_PATH",
|
||||
"WORKSPACE_ROOT",
|
||||
"init_ls_address",
|
||||
]
|
||||
@@ -16,10 +16,7 @@ import asyncio
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
from admin_console.core.config import PAUSE_FILE
|
||||
except ImportError:
|
||||
from apps.admin_console.core.config import PAUSE_FILE
|
||||
from artemis.config import PAUSE_FILE
|
||||
|
||||
|
||||
class ServerState:
|
||||
|
||||
Reference in new issue
Block a user